SSA_IT

April 12, 2025 · View on GitHub

MDTSC

The code in the folder 'MDTSC' is based on related work to compress images.
Working:
python start.py --input <input_dir> --ori <original_image_dir> --output <output_dir>
Notice that input_dir is the path of file in '.mat' format of the image; original_image_dir is the path of file in '.png' or '.jpg' format of the image and output_dir is the directory you would like to save the result.
A possible input is like:
python start.py --input './caseandresult/input.mat' --ori './source/original.png' --output './result'

Split_img

The code in the folder 'Split_img' is designed to add dividing lines to two images, resulting in new images. The dividing lines partition each image into overlapping and non-overlapping sections, where the overlapping section comprises the common parts of both images, and the non-overlapping section contains the remaining parts.
Working:
python split.py --input1 <input1_dir> --input2 <input2_dir> --output1 <output1_dir> --output2 <output2_dir>
Notice that all the four paths of images are files in '.png' or '.jpg' formats of the images. Input are the images you'd like to process and output are the paths you'd like to save the result.
A possible input is like:(if you put the input images in folder 'Split_img')
python split.py --input1 'img1.png' --input2 'img2.png' --output1 'res1.png' --output2 'res2.png'

Sample

Images in the folder 'Sample' are an example of the input images used by 'Overlap'. As is shown, images are split into two sections: cross(overlapping) and uncross(non-overlapping).

Overlap

The code in the folder 'Overlap' is designed to deal with the overlapping and non-overlapping sections of an image respectively and concatenate them together to reconstruct the image.
Working:
python start.py --ori <ori_img1> <ori_img2> --cross --uncross --output --iter
Notice that ori_img1, cross1, uncross1 are respectively the original file(the original image that hasn't been split), overlapping file, non-overlapping file in '.png' or '.jpg' formats of image 1. The same rule is for image 2 with ori_img2, cross2 and uncross2. Out1 and out2 are where you'd like to save the two processed images. Iteration shows how many times of iterations the code will execute, and the best iteration will be choosed to print the final result.
A possible input is like:
python start.py --ori './source/img1.png' './source/img2.png' --cross './source/cross1.png' './source/cross2.png' --uncross './source/uncross1.png' './source/uncross2.png' --output './result/out1.png' './result/out2.png' --iter 10

Additional tips of Overlap

  1. ./caseandresult, ./tmp_img, ./tmp_res, ./tmp_mat are four folders of vital importance to the successful execution of the code. Although the code will examine whether they exist and create these folders, they may cause unpredicted errors so that please examine whether these four folders have been created after the first time start.py has been executed.
  2. When the two sections of an image, namely overlapping and non-overlapping sections are concatenated to create the final result, their sequence that which section is on the left and which section is on the right is critical to the quality of reconstructed images. Please pay attention to the two comments in start.py. You may change the order if your sequence is different from the current situation in the code.

Reinforcement Learning Algorithms for LEO Satellite Computing Resource Allocation

1. Reinforcement Learning Algorithms

All reinforcement learning-related code is integrated into RL8.py and RL8-2.py. The former implements the Double DQN algorithm, while the latter uses the standard DQN algorithm. These two algorithms are used to allocate computing tasks across 32 Low Earth Orbit (LEO) satellites.

The [32LEO-2MEO/data.pkl](https://pan.sjtu.edu.cn/web/share/25d2e47e38bf5969366884146fcc5c24) file contains a dataset generated by simulation software, representing the operational status of 2 MEO (Medium Earth Orbit) and 32 LEO satellites (2 orbital planes, each with 1 MEO and 16 LEO satellites). This dataset includes information such as MEO–LEO visibility, satellite routing distances, and satellite–ground distances.

Training results after 400 epochs are saved in RL_output_dbdqn(final).txt and RL_output_dqn(final).txt for Double DQN and DQN respectively. The result1.py script provides visualization of these training results.

2. Task Allocation Schemes

Scripts plan1.py to plan8.py represent eight different allocation schemes, corresponding to splitting an image into 1 to 8 parts, respectively, and assigning them to 1–8 LEO satellites on the same orbital plane for image compression.

  • it_start.py handles complete compression of an entire image.

    • Raw image folder: split
    • Image .mat file folder: caseandresult1
    • Compressed image output folder: resultcross
  • overlap.py and non-overlap.py represent splitting the image into overlapping and non-overlapping parts respectively.

  • overlap3.py, overlap4.py, non-overlap3.py, and non-overlap4.py split the overlapping and non-overlapping parts into two parts.

  • o1.py and n3.py split the overlapping and non-overlapping parts into three parts.

  • o2.py and no1.py split them into four parts.

    • Corresponding .mat folders: caseandresult2, caseandresult3, caseandresult4
    • Corresponding compressed image result folders: resultcross2, resultcross3, resultcross4
  • monitor.py monitors CPU and RAM usage on the Jetson device when running schemes plan1, plan2, plan4, and plan8.

3. Additional Notes

For further details about image compression-related code, please refer to the sections "Overlap" and "Additional Tips for Overlap" above.