TransCD: Scene Change Detection via Transformer-based Architecture
Requirements
Python 3.7.0
Pytorch 1.6.0
Visdom 0.1.8.9
Torchvision 0.7.0
Datasets
- CD2014 dataset
- VL-CMU-CD
Pretrained Model
Pretrained models for CDNet-2014 and VL-CMU-CD are available. You can download them from the following link.
- CDNet-2014: [Baiduyun] the password is 78cp. [GoogleDrive].
- We uploaded six models trained on CDNet-2014 dataset, they are SViT_E1_D1_16, SViT_E1_D1_32, SViT_E4_D4_16, SViT_E4_D4_32, Res_SViT_E1_D1_16 and Res_SViT_E4_D4_16.
- VL-CMU-CD: [Baiduyun] the password is ydzl. [GoogleDrive].
- We uploaded four models trained on VL-CMU-CD dataset, ther are SViT_E1_D1_16, SViT_E1_D1_32, Res_SViT_E1_D1_16 and Res_SViT_E1_D1_32.
Test
Before test, please download datasets and predtrained models. Copy pretrained models to folder './dataset_name/outputs/best_weights', and run the following command:
cd TransCD_ROOT
python test.py --net_cfg
--train_cfg
Use --save_changemap True
to save predicted changemaps. For example:
python test.py --net_cfg SVit_E1_D1_32 --train_cfg CDNet_2014 --save_changemap True
Training
Before training, please download datasets and revise dataset path in configs.py to your path. CD TransCD_ROOT
python -m visdom.server
python train.py --net_cfg
--train_cfg
For example:
python -m visdom.server
python train.py --net_cfg Res_SViT_E1_D1_16 --train_cfg VL_CMU_CD
To display training processing, copy 'http://localhost:8097' to your browser.
Citing TransCD
If you use this repository or would like to refer the paper, please use the following BibTex entry.
@inproceddings{TransCD,
title={TransCD: Scene Change Detection via Transformer-based Architecture},
author={ZHIXUE WANG, YU ZHANG*, LIN LUO, NAN WANG},
journal={Optics Express},
yera={2021},
organization={The Optical Society},
}
Reference
-Akcay, Samet, Amir Atapour-Abarghouei, and Toby P. Breckon. "Ganomaly: Semi-supervised anomaly detection via adversarial training." Asian conference on computer vision. Springer, Cham, 2018.
-Chen, Jieneng, et al. "Transunet: Transformers make strong encoders for medical image segmentation." arXiv preprint arXiv:2102.04306 (2021).