rschange is an open-source change detection toolbox, which is dedicated to reproducing and developing advanced methods for change detection of remote sensing images.
-
Supported Methods
-
Supported Datasets
-
Supported Tools
- Training
- Testing
- Params and FLOPs counting
- Class activation maps
-
2024/07/14
: Class activation maps and some other popular methods (BIT, SNUNet, ChangeFormer, LGPNet, SARAS-Net) are now supported. -
2024/06/24
: CDMask has been submitted to Arxiv, see here, and the official implementation of CDMask is available!
-
Environment preparation
conda create -n rscd python=3.9 conda activate rscd conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.7 -c pytorch -c nvidia pip install -r requirements.txt
Note: same as rsseg. If you have already installed the environment of rsseg, use it directly.
-
Dataset preprocessing
LEVIR-CDοΌThe original images are sized at 1024x1024. Following its original division method, we crop these images into non-overlapping patches of 256x256.
WHU-CD: It contains a pair of dual-time aerial images measuring 32507 Γ 15354. These images are cropped into patches of 256 Γ 256 size. The dataset is then randomly divided into three subsets: the training set, the validation set, and the test set, following a ratio of 8:1:1.
DSIFN-CD & CLCD & SYSU-CD: They all follow the original image size and dataset division method.
Note: We also provide the pre-processed data, which can be downloaded at this link
Prepare the following folders to organize this repo:
rschangedetection
βββ rscd (code)
βββ work_dirs (save the model weights and training logs)
β ββCLCD_BS4_epoch200 (dataset)
β ββstnet (model)
β ββversion_0 (version)
β β ββckpts
β β ββtest (the best ckpts in test set)
β β ββval (the best ckpts in validation set)
β ββlog (tensorboard logs)
β ββtrain_metrics.txt (train & val results per epoch)
β ββtest_metrics_max.txt (the best test results)
β ββtest_metrics_rest.txt (other test results)
βββ data
βββ LEVIR_CD
β βββ train
β β βββ A
β β β βββ images1.png
β β βββ B
β β β βββ images2.png
β β βββ label
β β βββ label.png
β βββ val (the same with train)
β βββ test(the same with train)
βββ DSIFN
β βββ train
β β βββ t1
β β β βββ images1.jpg
β β βββ t2
β β β βββ images2.jpg
β β βββ mask
β β βββ mask.png
β βββ val (the same with train)
β βββ test
β βββ t1
β β βββ images1.jpg
β βββ t2
β β βββ images2.jpg
β βββ mask
β βββ mask.tif
βββ WHU_CD
β βββ train
β β βββ image1
β β β βββ images1.png
β β βββ image2
β β β βββ images2.png
β β βββ label
β β βββ label.png
β βββ val (the same with train)
β βββ test(the same with train)
βββ CLCD (the same with WHU_CD)
βββ SYSU_CD
βββ train
β βββ time1
β β βββ images1.png
β βββ time2
β β βββ images2.png
β βββ label
β βββ label.png
βββ val (the same with train)
βββ test(the same with train)
-
Training
python train.py -c configs/STNet.py
-
Testing
python test.py \ -c configs/STNet.py \ --ckpt work_dirs/CLCD_BS4_epoch200/stnet/version_0/ckpts/test/epoch=45.ckpt \ --output_dir work_dirs/CLCD_BS4_epoch200/stnet/version_0/ckpts/test \
-
Count params and flops
python tools/params_flops.py --size 256
-
Class activation maps
python tools/grad_cam_CNN.py -c configs/cdmask.py
If you are interested in our work, please consider giving a π and citing our work below. We will update rschange regularly.
@inproceedings{stnet,
title={STNet: Spatial and Temporal feature fusion network for change detection in remote sensing images},
author={Ma, Xiaowen and Yang, Jiawei and Hong, Tingfeng and Ma, Mengting and Zhao, Ziyan and Feng, Tian and Zhang, Wei},
booktitle={2023 IEEE International Conference on Multimedia and Expo (ICME)},
pages={2195--2200},
year={2023},
organization={IEEE}
}
@article{ddlnet,
title={DDLNet: Boosting Remote Sensing Change Detection with Dual-Domain Learning},
author={Ma, Xiaowen and Yang, Jiawei and Che, Rui and Zhang, Huanting and Zhang, Wei},
journal={arXiv preprint arXiv:2406.13606},
year={2024}
}
@article{cdmask,
title={Rethinking Remote Sensing Change Detection With A Mask View},
author={Ma, Xiaowen and Wu, Zhenkai and Lian, Rongrong and Zhang, Wei and Song, Siyang},
journal={arXiv preprint arXiv:2406.15320},
year={2024}
}
Thanks to previous open-sourced repo:
Thanks to the main contributor Zhenkai Wu