Home

Awesome

ALS4GAN

This repository contains code for the paper: Active Learning for Improved Semi Supervised Semantic Segmentation in Satellite Images which has been accepted at WACV 2022.

Abstract

Remote sensing data is crucial for applications ranging from monitoring forest fires and deforestation to tracking urbanization. Most of these tasks require dense pixel-level annotations for the model to parse visual information from limited labeled data available for these satellite images. Due to the dearth of high-quality labeled training data in this domain, recent advances have focused on semi-supervised techniques. These techniques generate pseudo-labels from a small set of labeled examples which are used to augment the labeled training set. This makes it necessary to have a highly representative and diverse labeled training set. Therefore, we propose to use an active learning-based sampling strategy to select a highly representative set of labeled training data. We demonstrate our proposed method's effectiveness on two existing semantic segmentation datasets containing satellite images: UC Merced Land Use Classification Dataset, and DeepGlobe Land Cover Classification Dataset. We report a 27% improvement in mIoU with as little as 2% labeled data using active learning sampling strategies over randomly sampling the small set of labeled training data.

Network Architecture

Pre-requisites

Create a conda enviroment using the provided requirements.yaml file

conda env create --file=requirements.yaml

Data Peparation

UC Merced Land Use Classification Dataset

DeepGlobe Land Cover Classification Dataset

Training and Testing

Training the Active Learner

python tools/train_AL.py --dataset-name <DATASET_NAME>   
                         --query-strategy <QUERY_STRATEGY> 
                         --random-scale 
                         --random-mirror 
                         --data-dir <DATA_DIR>
                         --data-list <DATA_LIST> 
                         --labeled-ratio <LABELED_RATIO>
                         --model-name <MODEL_NAME>
                         --num-classes <NUM_CLASSES>
                         --learning-rate 0.001 
                         --num-epochs 50 
                         --alpha <ALPHA>
                         --beta <BETA>

Here is an explanation of the important parameters:

Training the active learner would output a .npy with the image names of the top-k most diverse samples selected by the query strategy.

Training the S4GAN Model

python tools/train_s4gan.py --dataset <DATASET_NAME> 
                            --labeled-ratio <LABELED_RATIO>
                            --threshold-st <SELF_TRAINING_THRESHOLD>
                            --num-classes <NUM_CLASSES>
                            --data-dir <DATA_DIR>
                            --data-list <TRAIN_DATA_LIST>
                            --batch-size 10 
                            --num-steps 20000 
                            --restore-from <PRETRAINED_BACKBONE_WEIGHTS_PATH> 
                            --save-pred-every 100 
                            --random-seed <RANDOM_SEED> 
                            --active-learning 
                            --active-learning-images-array <OUTPUT OF train_al.py>

Here is an explanation of the important paramters:

Evaluating the S4GAN Model

python tools/auto_evaluate.py --start-eval 100 
                              --end-eval 20000 
                              --step-eval 100 
                              --dataset <DATASET_NAME>
                              --data-dir <DATA_DIR>
                              --data-list <TEST_DATA_LIST>
                              --num-classes <NUM_CLASSES>
                              --checkpoint-dir <CHECKPOINT_DIR>
                              --input-size '320,320'

This script runs evaluation on all the weights saved during the training of s4gan and finds the epoch at which the model performs the best. Here is an explanation of the important paramters:

Acknowledgements

Parts of the code have been adapted from:

Citation

@inproceedings{desai2022active,
  title={Active Learning for Improved Semi-Supervised Semantic Segmentation in Satellite Images},
  author={Desai, Shasvat and Ghose, Debasmita},
  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
  pages={553--563},
  year={2022}
}