This repository contains code for the paper: Data Augmentation for Land Cover Classification Using Generative Adversarial Networks
- Python 3.7
- Tensorflow 2.0
- CUDA Version: 11.1
- Input images and labeled images must be resized to 256x256 using RESIZEto256.py
- Run GAN.py to train the model to generate a new images based on a dataset of images (SPARCS) stored in ./images folder. pretrained models will be stored in models_GAN. The images will be stored in generated_images. During the training process you can pick the generated images of the last epochs to augment the dataset.
- RUN CGAN.py to train the CGAN network to generate labels for the original dataset from ./images_CGAN/train/a. The resulting labels generated during training will be stored in ./predict_CGAN. The pretrained models of CGAN will be stored in the root directory ./
- After augmenting the dataset with the new generated images, add them to ./images_CGAN/train/a and Run CGAN.py to generate labeled images. The resulting labels generated during training will be stored in ./predict_CGAN as well.
- To generate labels for the testing set of 8 images in ./images_CGAN/test/a, run CGAN with the pretrained models in ./ root directory before and after augemntation. Use load model in CGAN.py file instead of training from scratch (check the las lines of the code.)
- Link of the dataset: SPARCS dataset
-
A screen shot of all 200 generated images. Some of them are in ./gnenerated_images
-
To evaluate the models before and after the daa augmentation, put the prediction labeled images generated using the pretrained model of the CGAN before augemntation in the folder ./Pred_before_augmentation, and put the prediction labeled images generated using the pretrained model of the CGAN sfter augemntation in the folder ./Pred_after_augmentation. After that, Run EVAL.py to generate the IOU and the eucledian distance before and after augmentation.
-
Comparison results between the classification accuracy before and after data augmentation:

-
Some of the basic model structure of the GAN design goes to manicman1999/GAN256