Repository containing augmentation code corresponding to the paper Sparse Signal Models for Data Augmentation in Deep Learning ATR.
"model" folder contains the code to produce synthetic complex SAR images for data augmentation. "data" folder stores data as generated by scripts from the "model" folder.
- MATLAB (preferably 2017+)
- MSTAR data
- mtimesx Copyright (c) 2011, James Tursa. All rights reserved. (Already included in model folder)
- SPGL1 solver outlined in paper E. van den Berg and M. P. Friedlander, Probing the Pareto frontier for basis pursuit solutions, SIAM J. on Scientific Computing, 31(2):890-912, November 2008. (Already included in model folder)
- Run "model/preprocess_raw_data.m" after specifying the variable "path2mstar" as local path to MSTAR CD data. This will pre-process and save phase-history values in the folder "data/phase_histories" for further use.
Note: Further Optimization and Image Generation was done class by class to enable execution on multiple PCs in parallel. A for loop can be simply used in each of the following scripts if desired.
-
Run "model/sparse_recovery.m" after setting for-loop variable "idxClass" to the class number you want to generate for, where class nos. are in reference to the variable "fileNamePrefix". This script is the main optimization procedure and is expected to take significant amount of time, depending on your computer specifications. The progress will be printed and will save recovered coefficients "C" (refer paper) in the folder "data/recovered_coefficients" for further use.
-
Open "model/generate_aug_images.m" and set following parameters as per need. Set for-loop variable "idxClass" to the class number you want to generate for, where class nos. are in reference to the variable "fileNamePrefix". Use "sample_start" variable to start generating from that sample and check comments to use "sample_end" similarily. Run this script. This should start generating images with subpixel shifts (refer paper) image by image for that particular class and saving it in "data/gen_aug_data/".
Note: Each sample's .mat file will have [1 (original sample)+ 48 (extrapolated samples)] * 4(subpixel shifts)]= 196 complex-valued images in -1.5 to 1.5 deg neighborhood of that sample's azimuthal angle. For reference, azimuthal angles are provided in the variable "aziTrain" correpsonding to the complex images in "imgTrain" where the first image is the original.
- Once done, use the "model/merge_files.m" to combine all the individual samples into a single array for easier data-loading later. Set variables "idxClass", "sample_start" and "sample_end" just like in step 2. Run this script. This should start merging all samples for that particular class into a final single array and saving it as "data/gen_aug_data/_aug_images.mat". You may delete the corresponding directory "data/gen_aug_data/" thereafter.
Contributions are welcome for improving this repo. They could be about refactoring the code, creating other language versions of the code (Python, R etc.) or improving the performance. Feel free to reach out to Tushar Agarwal (agarwal.270@buckeyemail.osu.edu) or Nithin Sugavanam (sugavanam.3@buckeyemail.osu.edu) with any questions, suggestions or concerns.