Home

Awesome

<div align="center"> <h1>Unified Change Detection Framework </h1> <h3>Powered by Huggingface Hub 🤗 </h3> </div>

Contributors:

Weikang Yu, Xiaokang Zhang, Richard Gloaguen, Xiao Xiang Zhu, Pedram Ghamisi

News

11.11.2024 UCD is open to everyone! Be a contributor by sending a pull request!

11.11.2024 Codes for UCD have been released, if you find any problems or bugs, please leave us a message.

09.11.2024 Our paper of MineNetCD has been published on IEEE TGRS 2024, the repo for MineNetCD is available here.

09.07.2024 The UCD project is announced on IEEE IGARSS 2024, we are organizing the codes.

Environment Preparation:

Create a conda environment for UCD

conda create -n ucd python=3.10
conda activate ucd
conda install pytorch torchvision pytorch-cuda=12.1 -c pytorch -c nvidia
pip install -r requirements.txt

Configurate the accelerate package:

accelerate config

How to use:

To train a model:

accelerate launch train.py --config $CONFIG$

An example of CONFIG can be configs/DTCDSCN_MNCD256.yml

Or if you want to run the framework in Singularity & Slurm, you can use this command:

srun singularity exec --env PREPEND_PATH=/home/yu34/.local/bin --nv /home/yu34/ucd.sif accelerate launch train.py --config $CONFIG$

To test a model:

accelerate launch test.py --model $PRETRAINED_MODEL_PATH$ 

An example of PRETRAINED_MODEL_PATH can be a local path like checkpoints/MNCD256/ResUnet/BestF1/ or a Huggingface hub id like HZDR-FWGEL/UCD-MNCD256-ResUnet

To push a pretrained model to Huggingface hub in the UCD format:

accelerate launch test.py --model $LOCAL_PATH$ --batch-size 10 --push-to-hub $HUB_NAME$

The example of LOCAL_PATH can be checkpoints/MNCD256/ResUnet/BestF1/, the example of HUB_NAME can be HZDR-FWGEL/UCD-MNCD256-ResUnet


To transfer a model from torch format (e.g., pytorch_model.bin) to UCD compatible format:

You should prepare a config file in your directory, an example can be found via configs/MineNetCD_MNCD256.yml

accelerate launch test.py --external-config configs/MineNetCD_MNCD256.yml  --batch-size 10 --push-to-hub HZDR-FWGEL/UCD-MNCD256-ChangeFFT

The use_external_checkpint will be set to false before uploading the model to the hub.

To calculate model parameters & FLOPs:

python params_sum.py --config $CONFIG$

Available Models:

<div align="center">
ModelBackbone#ParamsFLOPsSource
A2NetVGG163.60M2.86GIEEE TGRS 2023
AFCF3DResNet1816.83M29.54GIEEE TGRS 2023
BITResNet1811.39M8.28GIEEE TGRS 2021
CGNetVGG1637.18M81.66GIEEE JSTARS 2023
ChangeFormerMIT39.13M129.7GIEEE IGARSS 2022
DMINetResNet186.44M16.16GIEEE TGRS 2021
DTCDSCN-39.17M10.72GIEEE GRSL 2020
FC-EF-1.29M2.92GIEEE ICIP 2018
FCNPP-14.56M43.10GIEEE GRSL 2019
HCGMNetVGG1645.13M301.82GIEEE IGARSS 2023
ICIFNetResNet1824.64M22.97GIEEE TGRS 2022
MSPSNet-2.11M13.89GIEEE TGRS 2021
RDPNet-1.62M1.63GIEEE TGRS 2022
ResUnet-12.59M28.51GIEEE IGARSS 2021
SiamUnet-Conc-1.47M4.55GIEEE ICIP 2018
SiamUnet-Diff-1.29M3.99GIEEE ICIP 2018
SNUNet-11.48M43.6GIEEE GRSL 2021
TFI-GRResNet1827.06M9.09GIEEE TGRS 2022
TinyCDEfficientNet-b40.27M1.44GNCA 2023
MineNetCDSwinT-Tiny57.81M63.28GThis Paper
</div>

Available Datasets:

<div align="center">
Dataset#PatchesScenarioLocationSensorResolution
CLCD2400CroplandGuangdong, ChinaGaofen-20.5m-2m
EGY-BCD6091BuildingEgyptGoogle Earth0.25m
GVLM-CD7496LandslideGlobalGoogle Earth0.59m
LEVIR-CD10192BuildingTexas, USAGoogle Earth0.5m
SYSU-CD20000UrbanHong Kong, ChinaAerial Image0.5m
MineNetCD71711MiningGlobalGoogle Earth1.2m
</div>

Our Results:

Here are results derived from the UCD

CLCD256:

Dataset for these implementations: ericyu/CLCD_Cropped_256

<div align="center">
ModelDatasetAccuracymF1PrecisionRecallcIoUPretrained_Path
A2NetCLCD2560.91990.37650.44740.32500.2319HZDR-FWGEL/UCD-CLCD256-A2Net
BITCLCD2560.94880.65900.65260.66570.4915HZDR-FWGEL/UCD-CLCD256-BIT
DMINetCLCD2560.93920.57440.59900.55170.4029HZDR-FWGEL/UCD-CLCD256-DMINet
ICIFNetCLCD2560.94160.56290.63550.50520.3917HZDR-FWGEL/UCD-CLCD256-ICIFNet
RDPNetCLCD2560.92880.54310.51940.5690.3727HZDR-FWGEL/UCD-CLCD256-RDPNet
SiamUNet-DiffCLCD2560.93580.49140.59830.41690.3257HZDR-FWGEL/UCD-CLCD256-SiamUDiff
ChangeFormerCLCD2560.94310.62140.61510.62790.4508HZDR-FWGEL/UCD-CLCD256-ChangeFormer
</div>

GVLM256:

Dataset for these implementations: ericyu/GVLM_Cropped256

<div align="center">
ModelDatasetAccuracymF1PrecisionRecallcIoUPretrained_Path
A2NetGVLM2560.97760.81140.91560.72850.6827HZDR-FWGEL/UCD-GVLM256-A2Net
BITGVLM2560.98410.87680.89740.85720.7807HZDR-FWGEL/UCD-GVLM256-BIT
DMINetGVLM22560.98250.86640.87380.85910.7643HZDR-FWGEL/UCD-GVLM256-DMINet
ICIFNetGVLM2560.98310.87220.87350.8710.7734HZDR-FWGEL/UCD-GVLM256-ICIFNet
RDPNetGVLM2560.98270.8680.8750.86110.7668HZDR-FWGEL/UCD-GVLM256-RDPNet
SiamUNet-DiffGVLM2560.98010.84310.87910.810.7288HZDR-FWGEL/UCD-GVLM256-SiamUDiff
ChangeFormerGVLM2560.98310.86850.89430.84410.7675HZDR-FWGEL/UCD-GVLM256-ChangeFormer
</div>

EGYBCD:

Dataset for these implementations: ericyu/EGY_BCD

<div align="center">
ModelDatasetAccuracymF1PrecisionRecallcIoUPretrained_Path
A2NetEGY_BCD0.96240.69140.72830.65810.5284HZDR-FWGEL/UCD-EGYBCD-A2Net
BITEGYBCD0.97350.79060.80160.77990.6537HZDR-FWGEL/UCD-EGYBCD-BIT
DMINetEGYBCD0.95850.69290.65910.73040.5301HZDR-FWGEL/UCD-EGYBCD-DMINet
ICIFNetEGYBCD0.96210.69030.72410.65950.5270HZDR-FWGEL/UCD-EGYBCD-ICIFNet
RDPNetEGYBCD0.96120.68590.71250.66120.5220HZDR-FWGEL/UCD-EGYBCD-RDPNet
SiamUNet-DiffEGYBCD0.95240.64220.61910.66710.4729HZDR-FWGEL/UCD-EGYBCD-SiamUDiff
ChangeFormerEGYBCD0.96510.71810.74360.69440.5602HZDR-FWGEL/UCD-EGYBCD-ChangeFormer
</div>

LEVIRCD256:

Dataset for these implementations: ericyu/LEVIRCD_Cropped256

<div align="center">
ModelDatasetAccuracymF1PrecisionRecallcIoUPretrained_Path
A2NetLEVIRCD2560.96990.66870.76130.59620.5023HZDR-FWGEL/UCD-LEVIRCD256-A2Net
BITLEVIRCD2560.98880.88840.90460.87280.7992HZDR-FWGEL/UCD-LEVIRCD256-BIT
DMINetLEVIRCD2560.98450.84310.87080.81710.7287HZDR-FWGEL/UCD-LEVIRCD256-DMINet
ICIFNetLEVIRCD2560.98270.81620.88710.75580.6895HZDR-FWGEL/UCD-LEVIRCD256-ICIFNet
RDPNetLEVIRCD2560.98080.80580.83150.78160.6747HZDR-FWGEL/UCD-LEVIRCD256-RDPNet
SiamUNet-DiffLEVIRCD2560.98050.59910.78220.68740.6423HZDR-FWGEL/UCD-LEVIRCD256-SiamUDiff
ChangeFormerLEVIRCD2560.98260.82320.85160.79670.6996HZDR-FWGEL/UCD-LEVIRCD256-ChangeFormer
</div>

SYSUCD:

Dataset for these implementations: ericyu/SYSU_CD

<div align="center">
ModelDatasetAccuracymF1PrecisionRecallcIoUPretrained_Path
A2NetSYSUCD0.88120.75980.72600.79690.6126HZDR-FWGEL/UCD-SYSUCD-A2Net
BITSYSUCD0.8730.74970.70040.80640.5996HZDR-FWGEL/UCD-SYSUCD-BIT
DMINetSYSUCD0.88810.74640.80140.69840.5954HZDR-FWGEL/UCD-SYSUCD-DMINet
ICIFNetSYSUCD0.86400.7030.72480.68250.5421HZDR-FWGEL/UCD-SYSUCD-ICIFNet
RDPNetSYSUCD0.88520.75360.7630.74450.6047HZDR-FWGEL/UCD-SYSUCD-RDPNet
SiamUNet-DiffSYSUCD0.85460.59910.85630.46080.4277HZDR-FWGEL/UCD-SYSUCD-SiamUDiff
ChangeFormerSYSUCD0.89120.75930.79380.72770.612HZDR-FWGEL/UCD-SYSUCD-ChangeFormer
</div>

MineNetCD256:

Dataset for these implementations: HZDR-FWGEL/MineNetCD256

<div align="center">
ModelDatasetAccuracymF1PrecisionRecallcIoUPretrained_Path
A2NetMineNetCD2560.91850.64040.72150.57580.4710HZDR-FWGEL/UCD-MNCD256-A2Net
AFCF3DMineNetCD2560.89320.57720.57550.57890.4061HZDR-FWGEL/UCD-MNCD256-AFCF3D*
BITMineNetCD2560.91150.62270.67270.57950.4521HZDR-FWGEL/UCD-MNCD256-BIT
ChangeFormerMineNetCD2560.86990.49950.48480.51510.3329HZDR-FWGEL/UCD-MNCD256-ChangeFormer
CGNetMineNetCD2560.90040.5470.64120.4770.3765HZDR-FWGEL/UCD-MNCD256-CGNet
DMINetMineNetCD2560.89630.51690.62570.44030.3485HZDR-FWGEL/UCD-MNCD256-DMINet
DTCDSCNMineNetCD2560.89840.55670.61840.50680.3864HZDR-FWGEL/UCD-MNCD256-DTCDSCN*
FC-EFMineNetCD2560.88360.4150.56250.3290.2619HZDR-FWGEL/UCD-MNCD256-FCEF*
FCNPPMineNetCD2560.85490.34490.40040.30300.2084HZDR-FWGEL/UCD-MNCD256-FCNPP
HCGMNetMineNetCD2560.90760.58760.67180.52220.4161HZDR-FWGEL/UCD-MNCD256-HCGMNet
ICIFNetMineNetCD2560.89150.50180.59580.43340.3349HZDR-FWGEL/UCD-MNCD256-ICIFNet
ChangeFFTMineNetCD2560.92510.69630.71200.68140.5343HZDR-FWGEL/UCD-MNCD256-ChangeFFT
MSPSNetMineNetCD2560.89980.55910.62770.50410.388HZDR-FWGEL/UCD-MNCD256-MSPSNet
RDPNetMineNetCD2560.87680.49610.51200.48110.3298HZDR-FWGEL/UCD-MNCD256-RDPNet
ResUnetMineNetCD2560.86630.50720.47270.54880.3398HZDR-FWGEL/UCD-MNCD256-ResUnet
SiamUNet-ConcMineNetCD2560.89790.50990.64600.42110.3422HZDR-FWGEL/UCD-MNCD256-SiamUConc
SiamUNet-DiffMineNetCD2560.89560.37360.76710.24690.2297HZDR-FWGEL/UCD-MNCD256-SiamUDiff
SNUNetMineNetCD2560.89880.53710.63510.46540.3675HZDR-FWGEL/UCD-MNCD256-SNUNet*
TFI_GRMineNetCD2560.89320.57720.57550.57890.4061HZDR-FWGEL/UCD-MNCD256-TFIGR*
TinyCDMineNetCD2560.89990.56480.6250.51530.3936HZDR-FWGEL/UCD-MNCD256-TinyCD
</div> * Pretrained Models may only be loaded using accelerator with multiple graphical cards.

Tutorial Avaiable!

We just added a very simple example as a tutorial for those who are interested in change detection, check here for more details.

Future Development Schedule:

We will implement more models and datasets. If you are interested in this project and want to make any contributions, please send a pull request and we will add your names under the contributors!

If you have any questions or meeting any difficulties when using this framework, please leave us with an issue or you can contact us with email address: w.yu@hzdr.de

Acknowledgement:

We would like to thank Huggingface for providing a wonderful open-source platform. We would also like to thank all the authors and contributors who open-sourced the datasets and models that we incorporated into the UCD platform.

Citation

If you find MineNetCD useful for your study, please kindly cite us:

@ARTICLE{10744421,
  author={Yu, Weikang and Zhang, Xiaokang and Gloaguen, Richard and Zhu, Xiao Xiang and Ghamisi, Pedram},
  journal={IEEE Transactions on Geoscience and Remote Sensing}, 
  title={MineNetCD: A Benchmark for Global Mining Change Detection on Remote Sensing Imagery}, 
  year={2024},
  volume={},
  number={},
  pages={1-1},
  keywords={Data mining;Remote sensing;Feature extraction;Benchmark testing;Earth;Transformers;Annotations;Graphical models;Distribution functions;Sustainable development;Mining change detection;remote sensing;benchmark;frequency domain learning;unified framework},
  doi={10.1109/TGRS.2024.3491715}}