-
José Luis Holgado Álvarez authoredJosé Luis Holgado Álvarez authored
S2-cGAN: Self-Supervised Adversarial Representation Learning for Binary Change Detection in Multispectral Images
This repository contains code of the paper S2-cGAN: Self-Supervised Adversarial Representation Learning for Binary Change Detection in Multispectral Images
accepted at IGARSS 2020 - 2020 IEEE International Geoscience and Remote Sensing Symposium. This work has been done at the Remote Sensing Image Analysis group by Jose Luis Holgado,Mahdyar Ravanbakhsh and Begüm Demir.
Abstract
Deep Neural Networks have recently demonstrated promising performance in binary change detection (CD) problems in remote sensing (RS), requiring a large amount of labeled multitemporal training samples. Since collecting such data is time-consuming and costly, most of the existing methods rely on pre-trained networks on publicly available computer vision (CV) datasets. However, because of the differences in image characteristics in CV and RS, this approach limits the performance of the existing CD methods. To address this problem, we propose a self-supervised conditional Generative Adversarial Network (S2-cGAN). The proposed S2-cGAN is trained to generate only the distribution of unchanged samples. To this end, the proposed method consists of two main steps: 1) Generating a reconstructed version of the input image as an unchanged image 2) Learning the distribution of unchanged samples through an adversarial game. Unlike the existing GAN based methods (which only use the discriminator during the adversarial training to supervise the generator), the S2-cGAN directly exploits the discriminator likelihood to solve the binary CD task. Experimental results show the effectiveness of the proposed S2-cGAN when compared to the state of the art CD methods
If you use this code, please cite our paper given below:
J.L. Holgado Alvarez, M. Ravanbakhsh B. Demіr, "S2-cGAN: Self-Supervised Adversarial Representation Learning for Binary Change Detection in Multispectral Images",IGARSS ,2020.
@article{IG203936,
author={J.L. {Holgado Alvarez}, M. {Ravanbakhsh} and B. {Demіr}},
journal={IGARSS 2020 - 2020 IEEE International Geoscience and Remote Sensing Symposium},
title={S2-cGAN: Self-Supervised Adversarial Representation Learning for Binary Change Detection in Multispectral Images},
year={2020},
doi={""}
}
Detection strategy introduced in S2-cGAN.
The following Illustration represents the change detection strategy introduced by S2-cGAN
Change Detection output
On this section you can see an example of the score maps associated to different pairs of patches, and its comparison to the ground-truth
Prerequisites
- The code is tested with Python 3.7, PyTorch 0.4.1 and Ubuntu 18.04.
- Please, check out the requirements file for more information
- For reproducibility, you can find our datasets on the following repository: Our repository
- Password: Igarss_2020
Hardware setup
- The software was train and tested in a machine with the following features:
- Nvidia Quadro P2000
- 16 GB RAM
- 12 CPU cores
Dataset Description
including 2 pilot sites, and each site consists of a ground truth map (labeled changed and unchanged at pixel-level) and two-period Worldview 2 satellite images (Worldview 3 and WV3 were incorrectly written in our paper), located in Shenzhen, China, with a size of 1431×1431 pixels and a spatial resolution of 2 meters, acquired in 2010 and 2015 respectively. Original dataset, Worldview 2
dataset repository
Our repository Password: Igarss_2020
Data creation
The script data_creator.py
expects the following command line arguments:
-
--band3
directory location of the rgb channels -
--band4
directory location of the I channel -
--output_dir
output parent directory -
--test_dir
output directory for json testset -
--train_dir
output directory for json trainset -
--eval_dir
output directory for json evaluation set -
--gt
name and extension for ground-truth patches -
--A
name and extension for T1 patches -
--B
name and extension for T2 patches -
--city
identification code template for patches, by default wv2{}_{}. the first gap corresponds to tile id and the second gap correspond to patch id in the tile -
--custom_filter_active
boolean variable to trigger filter operations over the trainset, the filter consist in remove patches from the trainset that contains a ratio of change/no_change bigger than certain threshold -
--filter_value
, filter threshold value (0, 1) -
--kernel
patch size, by default 128 -
--offset
padding value, by default 0 -
--stride
stride value, by default 10
Training
The script train.py
expects the following command line arguments:
-
--dataset
specify the path to the trainset json file
Test
The script test.py
expects the following command line arguments:
-
--dataset
specify the path to the testset json file -
--results_dir
specify the path to the output directory
Evaluation
The script evaluation.py
expects the following command line arguments: