With the spirit of reproducible research, this repository contains all the codes required to produce the results in the manuscript:
S. Dev, A. Nautiyal, Y. H. Lee, S. Winkler, CloudSegNet: A Deep Network for Nychthemeron Cloud Segmentation, IEEE Geoscience and Remote Sensing Letters, 2019.
Please cite the above paper if you intend to use whole/part of the code. This code is only for academic and research purposes.
- Create the following folder structure inside
./dataset
../dataset/SWIMSEG
: Contains the SWIMSEG dataset. The corresponding images, along with the corresponding ground-truth maps can be downloaded from this link. The images are saved inside./dataset/SWIMSEG/images
folder, and the corresponding ground-truth maps are saved inside./dataset/SWIMSEG/GTmaps
../dataset/SWINSEG
: Contains the SWINSEG dataset. The dataset can be downloaded from this link. The images and ground-truth maps are saved in the same order../dataset/aug_SWIMSEG
: Contains the augmented set of daytime images. It follows the similar structure, and is computed using the scriptcreate_aug_day.py
../dataset/aug_SWINSEG
: Contains the augmented set of nightime images. It follows the similar structure, and is computed using the scriptcreate_aug_night.py
.
- Run the script
python2 create_aug_day.py
. Please installkeras 2.0.0
usingpip install keras==2.0.0
. The latest version of keras hasimage
module removed, and re-factored intoImageDataGenerator
class, and therefore, renders the current version error-prone (more details here). You have to change this script, if you wish to make it compatible with the latest version of keras. It saves the augmented images insideaug_SWIMSEG/images/
and corresponding augmented masks insideaug_SWIMSEG/GTmaps/
. - Run the script
python2 create_aug_night.py
, for computing the augmentated images and masks for nighttime images. This saves the augmented images insideaug_SWINSEG/images/
folder, and corresponding masks inaug_SWINSEG/GTmaps/
. - Run the script
python2 create_dayimages.py
for generating the.h5
file for actual- and augmented- daytime images. The results are stored in./data/day_images
. - Run the script
python2 create_nightimages.py
for generating the.h5
file for actual- and augmented- nightime images. The results are stored in./data/night_images
. - Run the script
python2 train_model.py
for training the CloudSegNet model in the composite dataset containing actual- and augmented- images. The logfile and the model is saved inside the folder./results/withAUG_dataset
. - Run the script
python2 train_model_balanced.py
for training the CloudSegNet model in a balanced dataset with equal number of day- and night- images. All night images of extended dataset are considered, and a single random sample of day images included for the training.composite dataset containing actual- and augmented- images. The logfile and the model is saved inside the folder./results/balanced_random_sample
. - Run the script
python2 evaluation_DNN.py
for getting the evaluation results of CloudSegNet model. The values are populated in Table I. - Run the script
python2 generate_figures.py
for generating Figure 2 and Figure 3 of the paper. - Run the script
python2 result_rand_exps.py
for getting results of Table II. The results are stored in./results/balanced_experiments
folder. Subsequently, run the scriptpython2 sensitivity.py
to compute the Table II values.
calculate_score.py
: Helper script needed during ROC computationcreate_dataset.py
: Splits datasets into training and testing setsroc_items.py
: Helper script during ROC computationscore_card.py
: Computes the different evaluation scores