Dineth Perera commited on
Commit
ce209f5
·
1 Parent(s): 0b43866

Publish tested dataset winners and benchmark rankings

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitignore +86 -0
  2. README.md +1569 -1
  3. TRAINING_GUIDE.md +160 -0
  4. configs/datasets/custom_cd.yaml +29 -0
  5. configs/datasets/dsifn_cd.yaml +28 -0
  6. configs/datasets/kate_cd.yaml +29 -0
  7. configs/datasets/levir_cd.yaml +29 -0
  8. configs/datasets/levir_cd_test_as_val.yaml +26 -0
  9. configs/datasets/sysu_cd.yaml +28 -0
  10. configs/datasets/whu_cd.yaml +29 -0
  11. configs/datasets/wildfire_s2.yaml +29 -0
  12. configs/models/bifa.yaml +11 -0
  13. configs/models/bit_cd.yaml +11 -0
  14. configs/models/cdmamba.yaml +11 -0
  15. configs/models/cgnet.yaml +11 -0
  16. configs/models/change3d.yaml +11 -0
  17. configs/models/changeformer.yaml +11 -0
  18. configs/models/changemamba.yaml +14 -0
  19. configs/models/changer.yaml +11 -0
  20. configs/models/dsamnet.yaml +11 -0
  21. configs/models/dsifn.yaml +11 -0
  22. configs/models/elgcnet.yaml +11 -0
  23. configs/models/fc_ef.yaml +11 -0
  24. configs/models/fc_siam_conc.yaml +11 -0
  25. configs/models/fc_siam_diff.yaml +11 -0
  26. configs/models/hanet.yaml +11 -0
  27. configs/models/ifnet.yaml +11 -0
  28. configs/models/registry.yaml +106 -0
  29. configs/models/rsm_cd.yaml +11 -0
  30. configs/models/schanger.yaml +11 -0
  31. configs/models/siam_nestedunet.yaml +11 -0
  32. configs/models/stanet.yaml +11 -0
  33. configs/models/tinycd.yaml +11 -0
  34. datasets/__init__.py +4 -0
  35. datasets/cd_dataset.py +198 -0
  36. evaluate.py +142 -0
  37. generated_configs/dsifn_cd__bifa.json +61 -0
  38. generated_configs/dsifn_cd__cdmamba.json +91 -0
  39. generated_configs/dsifn_cd__changer_opencd.py +26 -0
  40. generated_configs/dsifn_cd__hanet_metadata.json +19 -0
  41. generated_configs/kate_cd__bifa.json +61 -0
  42. generated_configs/levir_cd__bifa.json +61 -0
  43. generated_configs/levir_cd__cdmamba.json +91 -0
  44. generated_configs/levir_cd__changer_opencd.py +26 -0
  45. generated_configs/levir_cd__hanet_metadata.json +19 -0
  46. generated_configs/levir_cd_test_as_val__bifa.json +61 -0
  47. generated_configs/levir_cd_test_as_val__cdmamba.json +91 -0
  48. generated_configs/levir_cd_test_as_val__changer_opencd.py +26 -0
  49. generated_configs/levir_cd_test_as_val__hanet_metadata.json +19 -0
  50. generated_configs/sysu_cd__bifa.json +61 -0
.gitignore ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ .eggs/
7
+ dist/
8
+ build/
9
+ *.so
10
+ .Python
11
+ .venv/
12
+ venv/
13
+ env/
14
+ .env
15
+ .env.*
16
+
17
+ # IDE / OS
18
+ .idea/
19
+ .vscode/
20
+ *.swp
21
+ *.swo
22
+ .DS_Store
23
+ Thumbs.db
24
+
25
+ # ---------------------------------------------------------------------------
26
+ # Upstream change-detection model repositories (clone separately)
27
+ # ---------------------------------------------------------------------------
28
+ BiFA/
29
+ BIT_CD/
30
+ CDMamba/
31
+ Change3D/
32
+ ChangeFormer/
33
+ IFNet/
34
+ RSM-CD/
35
+ SChanger/
36
+ Siam-NestedUNet/
37
+ STANet/
38
+ model_repos/
39
+
40
+ # Generated dataset layout copies (symlinks/copies of external DATA_ROOT)
41
+ generated_dataset_views/
42
+
43
+ # ---------------------------------------------------------------------------
44
+ # Model weights, checkpoints, and training artifacts
45
+ # ---------------------------------------------------------------------------
46
+ *.pth
47
+ *.pt
48
+ *.ckpt
49
+ *.safetensors
50
+ *.onnx
51
+ *.pb
52
+ *.h5
53
+ *.pkl
54
+ *.pickle
55
+ *.bin
56
+ *.tar
57
+ *.tar.gz
58
+ *.zip
59
+
60
+ checkpoints/
61
+ checkpoint/
62
+ experiments/
63
+ exp/
64
+ pretrain/
65
+ pretrained/
66
+ pretrained_weight/
67
+ pretrained_weights/
68
+ weights/
69
+ saved_models/
70
+ saved_model/
71
+ models/*.pth
72
+ models/*.pt
73
+ runs/
74
+ wandb/
75
+ logs/
76
+ vis/
77
+ tmp/
78
+ output/
79
+ outputs/
80
+ samples/
81
+ flagged/
82
+ gradio_cached_examples/
83
+
84
+ # Large local datasets (point DATA_ROOT outside this repo)
85
+ data/
86
+ datasets/raw/
README.md CHANGED
@@ -1,3 +1,1571 @@
1
  ---
2
- license: mit
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ license: other
3
+ library_name: pytorch
4
+ tags:
5
+ - change-detection
6
+ - remote-sensing
7
+ - pytorch
8
  ---
9
+
10
+ # CD-Models: A Unified Change Detection Benchmark Suite
11
+
12
+ > **A multi-dataset, multi-model benchmark for binary remote sensing change detection.**
13
+ > Covers 21 registered models spanning CNN, Transformer, and Mamba architectures, evaluated across the dataset configs in this repository with a shared training pipeline.
14
+
15
+ ![Python](https://img.shields.io/badge/python-3.10%20recommended-blue)
16
+ ![PyTorch](https://img.shields.io/badge/PyTorch-2.6.0%2Bcu124-ee4c2c)
17
+ ![Models](https://img.shields.io/badge/models-21-0f766e)
18
+ ![Datasets](https://img.shields.io/badge/datasets-8-7c3aed)
19
+ ![License](https://img.shields.io/badge/license-see%20upstream-lightgrey)
20
+
21
+ ## Overview
22
+
23
+ CD-Models is a benchmark harness for binary remote sensing change detection. It brings original research repositories and newly added model wrappers under one launcher, one dataset-config convention, one weight-management layer, and one result aggregation layout. The repository exists to make model comparisons reproducible across the same prepared dataset folders instead of relying on isolated, model-specific scripts. It also keeps the limits visible: result tables are populated only from `results/*/*/metrics_test.json`, and framework-specific models remain marked until their required stacks are installed.
24
+
25
+ ## Supported Models
26
+
27
+ The model list below is taken from `configs/models/registry.yaml`, which is what `run_training.py` uses for `--model` choices.
28
+
29
+ | Model | Paper | Venue | Backbone | Params | Training Script | Status |
30
+ |-------|-------|-------|----------|--------|-----------------|--------|
31
+ | `bifa` | BiFA: Remote Sensing Image Change Detection with Bitemporal Feature Alignment | IEEE TGRS 2024 | MixTransformer | — | `train/train_bifa.py` | 🔄 In Progress |
32
+ | `bit_cd` | Remote Sensing Image Change Detection with Transformers | IEEE TGRS 2021 | ResNet-18 + base transformer | ~11M† | `train/train_bit_cd.py` | ✅ Working |
33
+ | `cdmamba` | CDMamba: Incorporating Local Clues into Mamba for Binary Change Detection | IEEE TGRS 2025 | Mamba | — | `train/train_cdmamba.py` | 🔄 In Progress |
34
+ | `cgnet` | Change Guiding Network | IEEE JSTARS 2023 | CGNet custom backbone | — | `train/train_cgnet.py` | ✅ Working |
35
+ | `change3d` | Change3D: Revisiting Change Detection and Captioning from a Video Modeling Perspective | CVPR 2025 Highlight | X3D-L | — | `train/train_change3d.py` | ✅ Working |
36
+ | `changeformer` | A Transformer-Based Siamese Network for Change Detection | IGARSS 2022 | MiT-b4 | ~41M† | `train/train_changeformer.py` | ✅ Working |
37
+ | `changemamba` | ChangeMamba: Remote Sensing Change Detection with Spatio-Temporal State Space Model | IEEE TGRS 2024 | VMamba | — | `train/train_changemamba.py` | ⚠️ Framework Required |
38
+ | `changer` | Changer: Feature Interaction is What You Need for Change Detection | IEEE TGRS / Open-CD | ResNet-18 | — | `train/train_changer.py` | ⚠️ Framework Required |
39
+ | `dsamnet` | Deeply-supervised Attention Metric-based Network | IEEE TGRS 2021 | ResNet | — | `train/train_dsamnet.py` | ✅ Working |
40
+ | `dsifn` | Deeply Supervised Image Fusion Network | ISPRS JPRS 2020 | VGG-16 | — | `train/train_dsifn.py` | 🔄 In Progress |
41
+ | `elgcnet` | ELGC-Net: Efficient Local-Global Context Aggregation | IEEE TGRS 2024 | ResNet-18 / ELGCA | — | `train/train_elgcnet.py` | ✅ Working |
42
+ | `fc_ef` | Fully Convolutional Early Fusion | ICIP 2018 | FCN | — | `train/train_fc_variants.py` | ✅ Working |
43
+ | `fc_siam_conc` | Fully Convolutional Siamese Concatenation | ICIP 2018 | Siamese FCN | — | `train/train_fc_variants.py` | ✅ Working |
44
+ | `fc_siam_diff` | Fully Convolutional Siamese Difference | ICIP 2018 | Siamese FCN | — | `train/train_fc_variants.py` | ✅ Working |
45
+ | `hanet` | HANet: Hierarchical Attention Network | IEEE JSTARS 2023 | HANet custom backbone | — | `train/train_hanet.py` | ✅ Working |
46
+ | `ifnet` | Deeply Supervised Image Fusion Network | ISPRS JPRS 2020 | VGG-16 | — | `train/train_ifnet.py` | 🔄 In Progress |
47
+ | `rsm_cd` | RS-Mamba for Large Remote Sensing Image Dense Prediction | arXiv 2024 | VMamba/RSM-CD tiny | — | `train/train_rsm_cd.py` | ❌ Failed |
48
+ | `schanger` | SChanger: Semantic Change and Spatial Consistency Perspective | IEEE JSTARS 2025 | SChanger-base | — | `train/train_schanger.py` | 🔄 In Progress |
49
+ | `siam_nestedunet` | SNUNet-CD / Siamese NestedUNet | IEEE GRSL 2021 | UNet++ | — | `train/train_siam_nestedunet.py` | 🔄 In Progress |
50
+ | `stanet` | Spatial-Temporal Attention Network | Remote Sensing 2020 | ResNet-18 + PAM | ~17M† | `train/train_stanet.py` | ✅ Working |
51
+ | `tinycd` | TinyCD: A Not So Deep Learning Model for Change Detection | Neural Computing and Applications 2023 | EfficientNet-B4 | — | `train/train_tinycd.py` | ✅ Working |
52
+
53
+ † Parameter counts are inherited from the previous project README or upstream publications, not measured by the current harness.
54
+
55
+ ## Supported Datasets
56
+
57
+ Every dataset below is a real YAML file under `configs/datasets/`. The harness expands `${DATA_ROOT}` through `utils/config_loader.py`; if `${DATA_ROOT}` is unset, it first checks `/new-home/buddhiw/Datasets` and then the sibling `mamba-cd/datasets` fallback.
58
+
59
+ ### LEVIR-CD+
60
+
61
+ | Property | Value |
62
+ |---|---|
63
+ | Task | Binary building change detection |
64
+ | Source | [LEVIR-CD project page](https://justchenhao.github.io/LEVIR/) |
65
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/LEVIR-CD-plus-256/{train,val,test}` |
66
+ | Image size | 256 x 256 |
67
+ | Resolution | Original LEVIR-CD is 0.5 m/pixel; this config uses prepared 256 patches |
68
+ | Channels | RGB |
69
+ | Label convention | Thresholded binary mask; `Mask/` folder, changed pixels above `127` |
70
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
71
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
72
+ | Config | `configs/datasets/levir_cd.yaml` |
73
+ | Root pattern | `${DATA_ROOT}/LEVIR-CD-plus-256` |
74
+
75
+ ### LEVIR-CD+ Test-as-Val
76
+
77
+ | Property | Value |
78
+ |---|---|
79
+ | Task | Binary building change detection with literature-style test-as-validation protocol |
80
+ | Source | [LEVIR-CD project page](https://justchenhao.github.io/LEVIR/) |
81
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/LEVIR-CD-plus-256-test-as-val/{train,val,test}` |
82
+ | Image size | 256 x 256 |
83
+ | Channels | RGB |
84
+ | Label convention | Thresholded binary mask; `Mask/` folder, changed pixels above `127` |
85
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
86
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
87
+ | Config | `configs/datasets/levir_cd_test_as_val.yaml` |
88
+ | Root pattern | `${DATA_ROOT}/LEVIR-CD-plus-256-test-as-val` |
89
+
90
+ ### WHU-CD
91
+
92
+ | Property | Value |
93
+ |---|---|
94
+ | Task | Binary building change detection |
95
+ | Source | [WHU building dataset page](https://study.rsgis.whu.edu.cn/pages/download/building_dataset.html) |
96
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/WHU-CD/{train,val,test}` |
97
+ | Image size | 256 x 256 |
98
+ | Channels | RGB |
99
+ | Label convention | Thresholded binary mask; `OUT/` folder, changed pixels above `127` |
100
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
101
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
102
+ | Config | `configs/datasets/whu_cd.yaml` |
103
+ | Root pattern | `${DATA_ROOT}/WHU-CD` |
104
+
105
+ ### DSIFN-CD
106
+
107
+ | Property | Value |
108
+ |---|---|
109
+ | Task | Binary high-resolution change detection |
110
+ | Source | [DSIFN dataset reference](https://github.com/GeoZcx/A-deeply-supervised-image-fusion-network-for-change-detection-in-remote-sensing-images/tree/master/dataset) |
111
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/DSIFN-CD/DSIFN/{train,val,test}` |
112
+ | Image size | 256 x 256 |
113
+ | Channels | RGB |
114
+ | Label convention | `mask/` folder; raw masks may be `0/1`; generated model views convert to `0/255` where required |
115
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
116
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
117
+ | Config | `configs/datasets/dsifn_cd.yaml` |
118
+ | Root pattern | `${DATA_ROOT}/DSIFN-CD/DSIFN` |
119
+
120
+ ### WildFire-S2
121
+
122
+ | Property | Value |
123
+ |---|---|
124
+ | Task | Binary burned-area change detection from bi-temporal Sentinel-2 style imagery |
125
+ | Source | Local project dataset card in sibling `WildFire-S2/` |
126
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/WildFireS2/{train,val,test}` |
127
+ | Image size | 256 x 256 |
128
+ | Channels | RGB |
129
+ | Label convention | Thresholded binary mask; `label/` folder, changed pixels above `127` |
130
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
131
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
132
+ | Config | `configs/datasets/wildfire_s2.yaml` |
133
+ | Root pattern | `${DATA_ROOT}/WildFireS2` |
134
+
135
+ ### SYSU-CD
136
+
137
+ | Property | Value |
138
+ |---|---|
139
+ | Task | Binary change detection |
140
+ | Source | [SYSU-CD project page](https://github.com/liumency/SYSU-CD) |
141
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/SYSU-CD-folders/{train,val,test}` |
142
+ | Image size | 256 x 256 |
143
+ | Channels | RGB |
144
+ | Label convention | Thresholded binary mask; `Mask/` folder, changed pixels above `127` |
145
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
146
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
147
+ | Config | `configs/datasets/sysu_cd.yaml` |
148
+ | Root pattern | `${DATA_ROOT}/SYSU-CD-folders` |
149
+
150
+ ### KATE-CD-256
151
+
152
+ | Property | Value |
153
+ |---|---|
154
+ | Task | Binary change detection |
155
+ | Source | Local prepared dataset config |
156
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/KATE-CD-256/{train,val,test}` |
157
+ | Image size | 256 x 256 |
158
+ | Channels | RGB |
159
+ | Label convention | Thresholded binary mask; `label/` folder, changed pixels above `127` |
160
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
161
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
162
+ | Config | `configs/datasets/kate_cd.yaml` |
163
+ | Root pattern | `${DATA_ROOT}/KATE-CD-256` |
164
+
165
+ ### Custom-CD
166
+
167
+ | Property | Value |
168
+ |---|---|
169
+ | Task | User-supplied binary change detection |
170
+ | Source | Local template config |
171
+ | Train / Val / Test | Determined by files under `$DATA_ROOT/Custom-CD/{train,val,test}` |
172
+ | Image size | 256 x 256 |
173
+ | Channels | RGB |
174
+ | Label convention | Thresholded binary mask; `Mask/` folder, changed pixels above `127` |
175
+ | Mean / Std (A) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
176
+ | Mean / Std (B) | `[0.485, 0.456, 0.406]` / `[0.229, 0.224, 0.225]` |
177
+ | Config | `configs/datasets/custom_cd.yaml` |
178
+ | Root pattern | `${DATA_ROOT}/Custom-CD` |
179
+
180
+ ## Results and released checkpoints
181
+
182
+ Only completed `metrics_test.json` evaluations are eligible. Rankings are computed per dataset by test-set F1 (descending), and only the rank-1 checkpoint for each dataset is released. Validation-only, incomplete, and checkpoint-only runs are excluded.
183
+
184
+ All accuracy values are fractions. GPU memory is the PyTorch peak reserved memory for inference, with peak allocated memory used only when reserved memory is absent. FPS is model-only throughput. A dash means the evaluator did not record that metric; values are never estimated.
185
+
186
+ The current evaluator records BF1 but not boundary mean IoU (BmIoU), so BmIoU remains explicitly unavailable rather than being inferred from BF1. Boundary IoU and boundary F1 are distinct measures.
187
+
188
+ ### Released checkpoint summary
189
+
190
+ | Dataset | Selected model | Test F1 | Download | Size |
191
+ | --- | --- | --- | --- | --- |
192
+ | DSIFN-CD | BIT-CD | 0.6732 | [best_model.pth](https://huggingface.co/dineth18/CD-Models/resolve/main/results/bit_cd/dsifn_cd/checkpoints/best_model.pth?download=true) | 60.8 MiB |
193
+ | LEVIR-CD+ (test-as-val protocol) | CGNet | 0.8138 | [best_model.pth](https://huggingface.co/dineth18/CD-Models/resolve/main/results/cgnet/levir_cd_test_as_val/checkpoints/best_model.pth?download=true) | 405.9 MiB |
194
+ | SYSU-CD | ChangeMamba | 0.8216 | [best_model.pth](https://huggingface.co/dineth18/CD-Models/resolve/main/results/changemamba/sysu_cd/checkpoints/best_model.pth?download=true) | 619.3 MiB |
195
+ | WHU-CD | ChangeMamba | 0.9521 | [best_model.pth](https://huggingface.co/dineth18/CD-Models/resolve/main/results/changemamba/whu_cd/checkpoints/best_model.pth?download=true) | 619.0 MiB |
196
+
197
+ ### DSIFN-CD
198
+
199
+ | Rank | Model | F1 | mIoU | Overall accuracy | Recall | Precision | BF1 | BmIoU | GFLOPs | GPU (GB) | FPS | Parameters (M) | Checkpoint |
200
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
201
+ | 1 | BIT-CD | 0.6732 | 0.6929 | 0.8919 | 0.6552 | 0.6923 | 0.2819 | — | 10.63 | 2.24 | 127.76 | 12.40 | [Download](https://huggingface.co/dineth18/CD-Models/resolve/main/results/bit_cd/dsifn_cd/checkpoints/best_model.pth?download=true) |
202
+ | 2 | SChanger | 0.6629 | 0.6835 | 0.8857 | 0.6612 | 0.6647 | 0.2847 | — | — | 2.45 | 24.05 | — | — |
203
+ | 3 | ChangeMamba | 0.6435 | 0.6729 | 0.8849 | 0.6113 | 0.6792 | 0.1903 | — | 28.70 | 1.93 | 15.42 | 54.00 | — |
204
+ | 4 | CGNet | 0.6204 | 0.6290 | 0.8343 | 0.7970 | 0.5079 | 0.2903 | — | 82.23 | 6.52 | 65.39 | 38.99 | — |
205
+ | 5 | FC-EF | 0.6078 | 0.6400 | 0.8604 | 0.6365 | 0.5816 | 0.1955 | — | 3.58 | 0.74 | 204.13 | 1.35 | — |
206
+ | 6 | ChangeFormer | 0.5964 | 0.6152 | 0.8299 | 0.7397 | 0.4996 | 0.2422 | — | 21.18 | 4.07 | 49.74 | 29.75 | — |
207
+ | 7 | BiFA | 0.5876 | 0.6111 | 0.8296 | 0.7142 | 0.4991 | 0.2692 | — | 53.00 | 15.10 | 13.81 | 9.87 | — |
208
+ | 8 | Siam-NestedUNet | 0.5839 | 0.6024 | 0.8188 | 0.7482 | 0.4788 | 0.2374 | — | 54.83 | 7.34 | 29.18 | 12.03 | — |
209
+ | 9 | FC-Siam-diff | 0.5829 | 0.6277 | 0.8593 | 0.5784 | 0.5875 | 0.1691 | — | 4.73 | 1.06 | 113.98 | 1.35 | — |
210
+ | 10 | STANet | 0.5483 | 0.6258 | 0.8829 | 0.4184 | 0.7953 | 0.1613 | — | 13.16 | 14.11 | 133.96 | 16.93 | — |
211
+ | 11 | FC-Siam-conc | 0.5479 | 0.5665 | 0.7873 | 0.7583 | 0.4288 | 0.1811 | — | 5.33 | 1.02 | 127.67 | 1.55 | — |
212
+ | 12 | DSAMNet | 0.5467 | 0.5757 | 0.8020 | 0.7027 | 0.4474 | 0.2374 | — | 75.39 | 2.91 | 166.43 | 16.95 | — |
213
+ | 13 | HANet | 0.5347 | 0.5817 | 0.8193 | 0.6109 | 0.4754 | 0.2418 | — | 17.67 | 11.36 | 42.36 | 3.03 | — |
214
+ | 14 | IFNet | 0.4579 | 0.5102 | 0.7524 | 0.6153 | 0.3647 | 0.1325 | — | 82.26 | 6.08 | 104.88 | 50.71 | — |
215
+
216
+ ### LEVIR-CD+ (test-as-val protocol)
217
+
218
+ | Rank | Model | F1 | mIoU | Overall accuracy | Recall | Precision | BF1 | BmIoU | GFLOPs | GPU (GB) | FPS | Parameters (M) | Checkpoint |
219
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
220
+ | 1 | CGNet | 0.8138 | 0.8356 | 0.9856 | 0.7746 | 0.8572 | 0.7651 | — | 82.23 | 6.01 | 44.01 | 38.99 | [Download](https://huggingface.co/dineth18/CD-Models/resolve/main/results/cgnet/levir_cd_test_as_val/checkpoints/best_model.pth?download=true) |
221
+ | 2 | Siam-NestedUNet | 0.8046 | 0.8282 | 0.9839 | 0.8129 | 0.7965 | 0.7386 | — | — | 2.67 | 108.71 | — | — |
222
+ | 3 | SChanger | 0.8007 | 0.8253 | 0.9836 | 0.8112 | 0.7906 | 0.7364 | — | — | 2.45 | 48.96 | — | — |
223
+ | 4 | BIT-CD | 0.7996 | 0.8247 | 0.9838 | 0.7946 | 0.8047 | 0.7143 | — | 10.63 | 2.27 | 236.60 | 12.40 | — |
224
+ | 5 | HANet | 0.7841 | 0.8131 | 0.9819 | 0.8064 | 0.7630 | 0.7043 | — | — | 5.04 | 84.44 | — | — |
225
+ | 6 | BiFA | 0.7772 | 0.8084 | 0.9818 | 0.7785 | 0.7760 | 0.6581 | — | 53.00 | 15.14 | 30.38 | 9.87 | — |
226
+ | 7 | FC-Siam-conc | 0.7650 | 0.7999 | 0.9809 | 0.7623 | 0.7678 | 0.7175 | — | 5.33 | 1.02 | 308.81 | 1.55 | — |
227
+ | 8 | STANet | 0.7544 | 0.7921 | 0.9791 | 0.7865 | 0.7249 | 0.6388 | — | — | 4.45 | 174.00 | — | — |
228
+ | 9 | ChangeFormer | 0.7488 | 0.7887 | 0.9795 | 0.7505 | 0.7472 | 0.6525 | — | 21.18 | 4.03 | 157.64 | 29.75 | — |
229
+ | 10 | DSAMNet | 0.7444 | 0.7850 | 0.9779 | 0.7897 | 0.7040 | 0.5370 | — | 75.39 | 2.90 | 37.84 | 16.95 | — |
230
+ | 11 | IFNet | 0.7410 | 0.7833 | 0.9786 | 0.7510 | 0.7313 | 0.3489 | — | 82.26 | 6.08 | 105.44 | 50.71 | — |
231
+ | 12 | FC-EF | 0.7319 | 0.7766 | 0.9768 | 0.7785 | 0.6905 | 0.6497 | — | 3.58 | 0.74 | 457.44 | 1.35 | — |
232
+ | 13 | FC-Siam-diff | 0.7196 | 0.7667 | 0.9725 | 0.8650 | 0.6160 | 0.5447 | — | 4.73 | 1.06 | 262.80 | 1.35 | — |
233
+
234
+ ### SYSU-CD
235
+
236
+ | Rank | Model | F1 | mIoU | Overall accuracy | Recall | Precision | BF1 | BmIoU | GFLOPs | GPU (GB) | FPS | Parameters (M) | Checkpoint |
237
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
238
+ | 1 | ChangeMamba | 0.8216 | 0.8006 | 0.9214 | 0.7677 | 0.8836 | 0.3197 | — | 28.70 | 1.93 | 77.65 | 54.00 | [Download](https://huggingface.co/dineth18/CD-Models/resolve/main/results/changemamba/sysu_cd/checkpoints/best_model.pth?download=true) |
239
+ | 2 | FC-Siam-conc | 0.7778 | 0.7558 | 0.8975 | 0.7609 | 0.7955 | 0.1939 | — | 5.33 | 1.02 | 356.94 | 1.55 | — |
240
+ | 3 | STANet | 0.7728 | 0.7482 | 0.8913 | 0.7841 | 0.7619 | 0.1962 | — | — | 4.45 | 176.02 | — | — |
241
+ | 4 | FC-EF | 0.7710 | 0.7489 | 0.8936 | 0.7596 | 0.7828 | 0.1857 | — | 3.58 | 0.73 | 553.75 | 1.35 | — |
242
+ | 5 | ChangeFormer | 0.7635 | 0.7382 | 0.8851 | 0.7863 | 0.7420 | 0.1591 | — | 21.18 | 4.03 | 143.73 | 29.75 | — |
243
+ | 6 | FC-Siam-diff | 0.7630 | 0.7457 | 0.8956 | 0.7129 | 0.8208 | 0.1853 | — | 4.73 | 1.08 | 552.90 | 1.35 | — |
244
+ | 7 | BIT-CD | 0.7618 | 0.7395 | 0.8881 | 0.7584 | 0.7652 | 0.1780 | — | 10.63 | 2.24 | 111.11 | 12.40 | — |
245
+ | 8 | IFNet | 0.7145 | 0.7020 | 0.8724 | 0.6772 | 0.7562 | 0.1158 | — | — | 3.29 | 109.80 | — | — |
246
+
247
+ ### WHU-CD
248
+
249
+ | Rank | Model | F1 | mIoU | Overall accuracy | Recall | Precision | BF1 | BmIoU | GFLOPs | GPU (GB) | FPS | Parameters (M) | Checkpoint |
250
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
251
+ | 1 | ChangeMamba | 0.9521 | 0.9519 | 0.9954 | 0.9401 | 0.9644 | 0.8605 | — | 28.70 | 1.93 | 75.28 | 54.00 | [Download](https://huggingface.co/dineth18/CD-Models/resolve/main/results/changemamba/whu_cd/checkpoints/best_model.pth?download=true) |
252
+ | 2 | CGNet | 0.9331 | 0.9340 | 0.9936 | 0.9299 | 0.9364 | 0.8138 | — | 82.23 | 5.62 | 129.54 | 38.99 | — |
253
+ | 3 | BIT-CD | 0.8940 | 0.8989 | 0.9899 | 0.8845 | 0.9037 | 0.6879 | — | 10.63 | 2.24 | 46.28 | 12.40 | — |
254
+ | 4 | DSAMNet | 0.8905 | 0.8956 | 0.9891 | 0.9167 | 0.8657 | 0.5855 | — | 75.39 | 2.90 | 116.58 | 16.95 | — |
255
+ | 5 | IFNet | 0.8389 | 0.8534 | 0.9849 | 0.8147 | 0.8644 | 0.3245 | — | 82.26 | 6.08 | 104.98 | 50.71 | — |
256
+ | 6 | FC-EF | 0.8385 | 0.8531 | 0.9850 | 0.8067 | 0.8729 | 0.5818 | — | 3.58 | 0.74 | 498.55 | 1.35 | — |
257
+ | 7 | FC-Siam-conc | 0.7789 | 0.8062 | 0.9756 | 0.8907 | 0.6920 | 0.4733 | — | 5.33 | 1.03 | 397.86 | 1.55 | — |
258
+ | 8 | FC-Siam-diff | 0.7135 | 0.7580 | 0.9631 | 0.9540 | 0.5699 | 0.2148 | — | 4.73 | 1.09 | 567.87 | 1.35 | — |
259
+
260
+ ### Datasets without a released checkpoint
261
+
262
+ WildFire-S2, KATE-CD-256, the standard LEVIR-CD+ configuration, and Custom-CD currently have no eligible completed test result. Their validation-only or incomplete checkpoints are intentionally not uploaded.
263
+
264
+
265
+ ## Installation
266
+
267
+ ### 1. Clone this repository
268
+
269
+ ```bash
270
+ git clone https://github.com/<your-username>/CD-Models.git
271
+ cd CD-Models
272
+ ```
273
+
274
+ ### 2. Create and activate environment
275
+
276
+ ```bash
277
+ conda create -n cd-models python=3.10 -y
278
+ conda activate cd-models
279
+ ```
280
+
281
+ ### 3. Install PyTorch (CUDA 12.4)
282
+
283
+ ```bash
284
+ pip install torch==2.6.0 torchvision==0.21.0 --index-url https://download.pytorch.org/whl/cu124
285
+ ```
286
+
287
+ Adjust the CUDA version for your system. See [PyTorch Get Started](https://pytorch.org/get-started/locally/).
288
+
289
+ ### 4. Run automatic setup
290
+
291
+ ```bash
292
+ python setup.py
293
+ ```
294
+
295
+ This single command:
296
+
297
+ - Checks all required Python packages.
298
+ - Auto-installs safe pure-Python/common packages when missing.
299
+ - Clones confirmed model repositories into `model_repos/`.
300
+ - Downloads or warms pretrained backbone weights.
301
+ - Generates dataset list files for datasets already present on disk.
302
+ - Prints a full status report.
303
+
304
+ ### 5. ChangeMamba / Changer MMSeg stack
305
+
306
+ These two models require OpenMMLab packages that should be installed after PyTorch:
307
+
308
+ ```bash
309
+ pip install mmengine==0.10.1
310
+ pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu124/torch2.6/index.html
311
+ pip install mmsegmentation==1.2.2 mmdet==3.3.0 mmpretrain==1.2.0
312
+ ```
313
+
314
+ ### 6. Set your dataset root
315
+
316
+ ```bash
317
+ export DATA_ROOT=/path/to/your/datasets
318
+ ```
319
+
320
+ Add the export to `~/.bashrc` or your scheduler job script if you want it to persist.
321
+
322
+ ## Dataset Preparation
323
+
324
+ All datasets follow the same high-level split structure: `train/`, `val/`, and `test/`, each with a pre-change image folder, a post-change image folder, and a mask folder. Folder names differ by dataset and are encoded in YAML.
325
+
326
+ ### LEVIR-CD+
327
+
328
+ **Download:** [Official LEVIR page](https://justchenhao.github.io/LEVIR/)
329
+
330
+ Expected structure:
331
+
332
+ ```text
333
+ $DATA_ROOT/LEVIR-CD-plus-256/
334
+ ├── train/
335
+ │ ├── A/
336
+ │ ├── B/
337
+ │ └── Mask/
338
+ ├── val/
339
+ │ ├── A/
340
+ │ ├── B/
341
+ │ └── Mask/
342
+ └── test/
343
+ ├── A/
344
+ ├── B/
345
+ └── Mask/
346
+ ```
347
+
348
+ Prepare list files:
349
+
350
+ ```bash
351
+ python setup.py --dataset levir_cd
352
+ ```
353
+
354
+ Config: `configs/datasets/levir_cd.yaml`
355
+
356
+ ### LEVIR-CD+ Test-as-Val
357
+
358
+ **Download:** Use the same source data as LEVIR-CD+ and prepare the test-as-validation split protocol locally.
359
+
360
+ Expected structure:
361
+
362
+ ```text
363
+ $DATA_ROOT/LEVIR-CD-plus-256-test-as-val/
364
+ ├── train/
365
+ │ ├── A/
366
+ │ ├── B/
367
+ │ └── Mask/
368
+ ├── val/
369
+ │ ├── A/
370
+ │ ├── B/
371
+ │ └── Mask/
372
+ └── test/
373
+ ├── A/
374
+ ├── B/
375
+ └── Mask/
376
+ ```
377
+
378
+ Prepare list files:
379
+
380
+ ```bash
381
+ python setup.py --dataset levir_cd_test_as_val
382
+ ```
383
+
384
+ Config: `configs/datasets/levir_cd_test_as_val.yaml`
385
+
386
+ ### WHU-CD
387
+
388
+ **Download:** [WHU building dataset page](https://study.rsgis.whu.edu.cn/pages/download/building_dataset.html)
389
+
390
+ Expected structure:
391
+
392
+ ```text
393
+ $DATA_ROOT/WHU-CD/
394
+ ├── train/
395
+ │ ├── A/
396
+ │ ├── B/
397
+ │ └── OUT/
398
+ ├── val/
399
+ │ ├── A/
400
+ │ ├── B/
401
+ │ └── OUT/
402
+ └── test/
403
+ ├── A/
404
+ ├── B/
405
+ └── OUT/
406
+ ```
407
+
408
+ Prepare list files:
409
+
410
+ ```bash
411
+ python setup.py --dataset whu_cd
412
+ ```
413
+
414
+ Config: `configs/datasets/whu_cd.yaml`
415
+
416
+ ### DSIFN-CD
417
+
418
+ **Download:** [DSIFN dataset reference](https://github.com/GeoZcx/A-deeply-supervised-image-fusion-network-for-change-detection-in-remote-sensing-images/tree/master/dataset)
419
+
420
+ Expected structure:
421
+
422
+ ```text
423
+ $DATA_ROOT/DSIFN-CD/DSIFN/
424
+ ├── train/
425
+ │ ├── t1/
426
+ │ ├── t2/
427
+ │ └── mask/
428
+ ├── val/
429
+ │ ├── t1/
430
+ │ ├── t2/
431
+ │ └── mask/
432
+ └── test/
433
+ ├── t1/
434
+ ├── t2/
435
+ └── mask/
436
+ ```
437
+
438
+ Prepare list files:
439
+
440
+ ```bash
441
+ python setup.py --dataset dsifn_cd
442
+ ```
443
+
444
+ Config: `configs/datasets/dsifn_cd.yaml`
445
+
446
+ Important DSIFN note: some masks are encoded as `0/1`. The generated compatibility views convert those masks to exact `0/255` PNG data for loaders that use `ToTensor()` and then cast labels to integer classes.
447
+
448
+ ### WildFire-S2
449
+
450
+ **Download:** Local sibling dataset project, documented in `../WildFire-S2/DATASET_CARD.md`.
451
+
452
+ Expected structure:
453
+
454
+ ```text
455
+ $DATA_ROOT/WildFireS2/
456
+ ├── train/
457
+ │ ├── A/
458
+ │ ├── B/
459
+ │ └── label/
460
+ ├── val/
461
+ │ ├── A/
462
+ │ ├── B/
463
+ │ └── label/
464
+ └── test/
465
+ ├── A/
466
+ ├── B/
467
+ └── label/
468
+ ```
469
+
470
+ Prepare list files:
471
+
472
+ ```bash
473
+ python setup.py --dataset wildfire_s2
474
+ ```
475
+
476
+ Config: `configs/datasets/wildfire_s2.yaml`
477
+
478
+ ### SYSU-CD
479
+
480
+ **Download:** [SYSU-CD repository](https://github.com/liumency/SYSU-CD)
481
+
482
+ Expected structure:
483
+
484
+ ```text
485
+ $DATA_ROOT/SYSU-CD-folders/
486
+ ├── train/
487
+ │ ├── A/
488
+ │ ├── B/
489
+ │ └── Mask/
490
+ ├── val/
491
+ │ ├── A/
492
+ │ ├── B/
493
+ │ └── Mask/
494
+ └── test/
495
+ ├── A/
496
+ ├── B/
497
+ └── Mask/
498
+ ```
499
+
500
+ Prepare list files:
501
+
502
+ ```bash
503
+ python setup.py --dataset sysu_cd
504
+ ```
505
+
506
+ Config: `configs/datasets/sysu_cd.yaml`
507
+
508
+ ### KATE-CD-256
509
+
510
+ **Download:** Local prepared dataset; no official source URL was found in the audited repo files.
511
+
512
+ Expected structure:
513
+
514
+ ```text
515
+ $DATA_ROOT/KATE-CD-256/
516
+ ├── train/
517
+ │ ├── A/
518
+ │ ├── B/
519
+ │ └── label/
520
+ ├── val/
521
+ │ ├── A/
522
+ │ ├── B/
523
+ │ └── label/
524
+ └── test/
525
+ ├── A/
526
+ ├── B/
527
+ └── label/
528
+ ```
529
+
530
+ Prepare list files:
531
+
532
+ ```bash
533
+ python setup.py --dataset kate_cd
534
+ ```
535
+
536
+ Config: `configs/datasets/kate_cd.yaml`
537
+
538
+ ### Custom-CD
539
+
540
+ **Download:** User supplied.
541
+
542
+ Expected structure:
543
+
544
+ ```text
545
+ $DATA_ROOT/Custom-CD/
546
+ ├── train/
547
+ │ ├── A/
548
+ │ ├── B/
549
+ │ └── Mask/
550
+ ├── val/
551
+ │ ├── A/
552
+ │ ├── B/
553
+ │ └── Mask/
554
+ └── test/
555
+ ├── A/
556
+ ├── B/
557
+ └── Mask/
558
+ ```
559
+
560
+ Prepare list files:
561
+
562
+ ```bash
563
+ python setup.py --dataset custom_cd
564
+ ```
565
+
566
+ Config: `configs/datasets/custom_cd.yaml`
567
+
568
+ ## Training
569
+
570
+ All registered models share the same outer interface through `run_training.py`.
571
+
572
+ ### Train a single model on a single dataset
573
+
574
+ ```bash
575
+ python run_training.py --model bifa --dataset levir_cd
576
+ ```
577
+
578
+ ### Train a single model on all datasets
579
+
580
+ ```bash
581
+ python run_training.py --model changemamba --dataset all
582
+ ```
583
+
584
+ ### Train all models on a single dataset
585
+
586
+ ```bash
587
+ python run_training.py --model all --dataset levir_cd
588
+ ```
589
+
590
+ ### Full benchmark sweep
591
+
592
+ ```bash
593
+ python run_training.py --model all --dataset all
594
+ ```
595
+
596
+ Already-completed runs are skipped when `results/{model}/{dataset}/metrics_test.json` exists. To retry anyway:
597
+
598
+ ```bash
599
+ python run_training.py --model bifa --dataset levir_cd --force
600
+ ```
601
+
602
+ Resume interrupted training:
603
+
604
+ ```bash
605
+ python run_training.py --model bifa --dataset levir_cd --resume
606
+ ```
607
+
608
+ Run command-construction checks without training:
609
+
610
+ ```bash
611
+ python run_training.py --model all --dataset dsifn_cd --dry-run
612
+ ```
613
+
614
+ Run a single wrapper smoke test:
615
+
616
+ ```bash
617
+ python train/train_bifa.py --dataset levir_cd --smoke-test
618
+ ```
619
+
620
+ ### Available models
621
+
622
+ Original and legacy integrated models:
623
+
624
+ ```text
625
+ bifa
626
+ bit_cd
627
+ cdmamba
628
+ change3d
629
+ changeformer
630
+ dsifn
631
+ ifnet
632
+ rsm_cd
633
+ schanger
634
+ siam_nestedunet
635
+ stanet
636
+ ```
637
+
638
+ Newly added external or direct adapters:
639
+
640
+ ```text
641
+ fc_ef
642
+ fc_siam_conc
643
+ fc_siam_diff
644
+ changemamba
645
+ elgcnet
646
+ changer
647
+ hanet
648
+ cgnet
649
+ dsamnet
650
+ tinycd
651
+ ```
652
+
653
+ Available datasets:
654
+
655
+ ```text
656
+ custom_cd
657
+ dsifn_cd
658
+ kate_cd
659
+ levir_cd
660
+ levir_cd_test_as_val
661
+ sysu_cd
662
+ whu_cd
663
+ wildfire_s2
664
+ ```
665
+
666
+ ### Training outputs
667
+
668
+ Each completed run is expected to save under:
669
+
670
+ ```text
671
+ results/
672
+ └── bifa/
673
+ └── levir_cd/
674
+ ├── checkpoints/
675
+ │ ├── best_model.pth
676
+ │ └── latest.pth
677
+ ├── logs/
678
+ │ ├── train_stdout.log
679
+ │ ├── train_stderr.log
680
+ │ ├── eval_stdout.log
681
+ │ └── eval_stderr.log
682
+ ├── predictions/
683
+ │ ├── test/
684
+ │ └── test_prob/
685
+ ├── visuals/
686
+ │ └── selected_20/
687
+ ├── metrics_val.json
688
+ └── metrics_test.json
689
+ ```
690
+
691
+ The master launcher appends run status to `results/training_log.jsonl`. After every run attempt, `utils.results_writer.append_to_comparison_table()` regenerates `results/comparison_table.csv`.
692
+
693
+ For qualitative comparison, the evaluator writes one deterministic sample manifest per dataset:
694
+
695
+ ```text
696
+ results/qualitative_samples/<dataset>/sample_manifest.json
697
+ ```
698
+
699
+ The same selected test samples are then reused for every model on that dataset. Binary predictions use exact `0` and `255` PNG values.
700
+
701
+ ### Dataset-specific notes
702
+
703
+ | Model | Dataset | Note |
704
+ |---|---|---|
705
+ | `tinycd` | `wildfire_s2` | Skipped automatically by `run_training.py`; current exclusion is explicit in `DATASET_EXCLUSIONS`. |
706
+ | `changemamba` | all | Requires VMamba weights and the MMSeg/OpenMMLab stack. |
707
+ | `changer` | all | Runs through Open-CD and requires the MMSeg/OpenMMLab stack. |
708
+ | `dsifn` / `ifnet` | `dsifn_cd` | Uses VGG-16 family loaders; DSIFN masks need careful binary scaling. |
709
+ | `rsm_cd` | all | Marked unresolved because the upstream training path has prior initialization/runtime issues. |
710
+
711
+ ## Evaluation
712
+
713
+ ### Evaluate a trained checkpoint
714
+
715
+ ```bash
716
+ python evaluate.py --model bifa --dataset levir_cd
717
+ ```
718
+
719
+ The central evaluator uses `utils/model_adapters.py` for verified in-process PyTorch model construction, checkpoint loading, forward calls, and output normalization. Current smoke-tested adapters are:
720
+
721
+ ```text
722
+ bit_cd
723
+ cgnet
724
+ changeformer
725
+ dsamnet
726
+ elgcnet
727
+ fc_ef
728
+ fc_siam_conc
729
+ fc_siam_diff
730
+ hanet
731
+ siam_nestedunet
732
+ stanet
733
+ tinycd
734
+ ```
735
+
736
+ For these adapters, evaluation loads `checkpoints/best_model.pth`, computes split-level metrics, saves all test predictions, writes selected qualitative panels, records timing/profiling fields, writes `metrics_test.json`, and regenerates the aggregate comparison table.
737
+
738
+ For remaining subprocess/upstream wrappers, central evaluation fails explicitly until a real architecture construction and checkpoint-loading adapter is added. It does not evaluate dummy models, random initialized models, or guessed output formats.
739
+
740
+ ### Explicit checkpoint path
741
+
742
+ ```bash
743
+ python evaluate.py --model bifa --dataset levir_cd --checkpoint results/bifa/levir_cd/checkpoints/best_model.pth
744
+ ```
745
+
746
+ ### Regenerate comparison table
747
+
748
+ ```bash
749
+ python evaluate.py --model all --dataset all --dry-run
750
+ ```
751
+
752
+ ### Metrics computed
753
+
754
+ For binary change detection, metrics are intended for the positive changed class.
755
+
756
+ | Metric | Description |
757
+ |--------|-------------|
758
+ | F1 | Harmonic mean of precision and recall |
759
+ | IoU | Intersection over Union / Jaccard index |
760
+ | mIoU | Mean IoU over unchanged/background and changed classes |
761
+ | OA | Overall accuracy across both classes |
762
+ | Precision | `TP / (TP + FP)` |
763
+ | Recall | `TP / (TP + FN)` |
764
+ | Kappa | Cohen's kappa coefficient |
765
+ | BF1 | Boundary F1 with configurable tolerance, default 2 pixels |
766
+ | TP / FP / TN / FN | Accumulated confusion counts over the full split |
767
+
768
+ The implementation lives in `utils/metrics.py`. The evaluator also records measured parameter counts, FLOPs when `thop` or `fvcore` is installed, FPS, PyTorch peak GPU memory, and NVML GPU utilization when `pynvml` is installed. Missing profiler dependencies are recorded with explicit error fields; values are not guessed.
769
+
770
+ `metrics_test.json` includes the model, dataset, split, checkpoint path, threshold, confusion counts, F1, IoU, mIoU, precision, recall, OA, kappa, BF1, parameter counts, FLOPs fields, FPS fields, GPU profiling fields, test sample count, prediction and visual directories, timestamp, and status.
771
+
772
+ ## Pre-trained Weights
773
+
774
+ Backbone weights are downloaded or cache-warmed by `python setup.py` and by `utils/weight_downloader.py`.
775
+
776
+ ### Backbone weights
777
+
778
+ | Model(s) | Backbone | Source | Auto-Downloaded | Size |
779
+ |----------|----------|--------|-----------------|------|
780
+ | ChangeMamba-T | VMamba-Tiny | [Zenodo 14037770](https://zenodo.org/records/14037770) | yes | ~86 MB |
781
+ | ChangeMamba-S | VMamba-Small | [Zenodo 14037770](https://zenodo.org/records/14037770) | yes | ~178 MB |
782
+ | ChangeMamba-B | VMamba-Base | [Zenodo 14037770](https://zenodo.org/records/14037770) | yes | ~391 MB |
783
+ | TinyCD | EfficientNet-B4 | timm | yes | ~75 MB |
784
+ | ChangeFormer, ELGC-Net | MiT variants | timm | yes | 15-82 MB |
785
+ | BIT_CD, STANet, Changer | ResNet-18 | torchvision | yes | ~45 MB |
786
+ | DSAMNet, HANet, CGNet | ResNet-50 / ResNet family | torchvision | yes | ~98 MB |
787
+ | DSIFN / IFNet | VGG-16 | torchvision | yes | ~528 MB |
788
+
789
+ Pre-download all managed weights:
790
+
791
+ ```bash
792
+ python utils/weight_downloader.py --prefetch-all
793
+ ```
794
+
795
+ List managed VMamba weights:
796
+
797
+ ```bash
798
+ python utils/weight_downloader.py --list
799
+ ```
800
+
801
+ ### Trained checkpoints
802
+
803
+ The released rank-1 test checkpoints and direct download links are listed in [Results and released checkpoints](#results-and-released-checkpoints). Local training still writes checkpoints under `results/{model}/{dataset}/checkpoints/`.
804
+
805
+ ## Repository Structure
806
+
807
+ ```text
808
+ CD-Models/
809
+ ├── configs/
810
+ │ ├── datasets/ # one YAML per dataset
811
+ │ │ ├── custom_cd.yaml
812
+ │ │ ├── dsifn_cd.yaml
813
+ │ │ ├── kate_cd.yaml
814
+ │ │ ├── levir_cd.yaml
815
+ │ │ ├── levir_cd_test_as_val.yaml
816
+ │ │ ├── sysu_cd.yaml
817
+ │ │ ├── whu_cd.yaml
818
+ │ │ └── wildfire_s2.yaml
819
+ │ └── models/ # model hyperparameters and registry
820
+ │ ├── bifa.yaml
821
+ │ ├── bit_cd.yaml
822
+ │ ├── cdmamba.yaml
823
+ │ ├── cgnet.yaml
824
+ │ ├── change3d.yaml
825
+ │ ├── changeformer.yaml
826
+ │ ├── changemamba.yaml
827
+ │ ├── changer.yaml
828
+ │ ├── dsamnet.yaml
829
+ │ ├── dsifn.yaml
830
+ │ ├── elgcnet.yaml
831
+ │ ├── fc_ef.yaml
832
+ │ ├── fc_siam_conc.yaml
833
+ │ ├── fc_siam_diff.yaml
834
+ │ ├── hanet.yaml
835
+ │ ├── ifnet.yaml
836
+ │ ├── registry.yaml
837
+ │ ├── rsm_cd.yaml
838
+ │ ├── schanger.yaml
839
+ │ ├── siam_nestedunet.yaml
840
+ │ ├── stanet.yaml
841
+ │ └── tinycd.yaml
842
+ ├── datasets/
843
+ │ ├── __init__.py
844
+ │ └── cd_dataset.py # shared dataset validation/loader
845
+ ├── train/
846
+ │ ├── fc_adapter.py # direct FC-EF / FC-Siam trainer
847
+ │ ├── train_bifa.py
848
+ │ ├── train_bit_cd.py
849
+ │ ├── train_cdmamba.py
850
+ │ ├── train_cgnet.py
851
+ │ ├── train_change3d.py
852
+ │ ├── train_changeformer.py
853
+ │ ├── train_changemamba.py
854
+ │ ├── train_changer.py
855
+ │ ├── train_dsamnet.py
856
+ │ ├── train_dsifn.py
857
+ │ ├── train_elgcnet.py
858
+ │ ├── train_fc_variants.py
859
+ │ ├── train_hanet.py
860
+ │ ├── train_ifnet.py
861
+ │ ├── train_rsm_cd.py
862
+ │ ├── train_schanger.py
863
+ │ ├── train_siam_nestedunet.py
864
+ │ ├── train_stanet.py
865
+ │ ├── train_tinycd.py
866
+ │ └── wrapper_common.py # shared wrapper logic and generated views
867
+ ├── utils/
868
+ │ ├── config.py # generic YAML/JSON loading and merge helpers
869
+ │ ├── config_loader.py # dataset/model config expansion and validation
870
+ │ ├── dataset_list_generator.py # create list/train.txt, list/val.txt, list/test.txt
871
+ │ ├── env_checker.py # import checks for required packages
872
+ │ ├── legacy_config_writer.py # generated JSON/list views for legacy trainers
873
+ │ ├── metrics.py # binary CD metrics
874
+ │ ├── results.py # JSON/CSV helpers
875
+ │ ├── results_writer.py # metrics_test.json and comparison CSV writer
876
+ │ └── weight_downloader.py # Zenodo, timm, torchvision weight management
877
+ ├── model_repos/ # cloned external repositories
878
+ │ ├── CGNet-CD/
879
+ │ ├── ChangeMamba/
880
+ │ ├── DSAMNet/
881
+ │ ├── HANet-CD/
882
+ │ ├── TinyCD/
883
+ │ ├── Tiny_model_4_CD/
884
+ │ ├── elgcnet/
885
+ │ ├── fully_convolutional_change_detection/
886
+ │ └── open-cd/
887
+ ├── results/
888
+ │ ├── comparison_table.csv
889
+ │ ├── download_log.jsonl
890
+ │ └── training_log.jsonl
891
+ ├── generated_configs/ # generated model-specific config files
892
+ ├── generated_dataset_views/ # generated compatibility views for upstream repos
893
+ ├── BIT_CD/ # original model repository copy
894
+ ├── BiFA/
895
+ ├── CDMamba/
896
+ ├── Change3D/
897
+ ├── ChangeFormer/
898
+ ├── IFNet/
899
+ ├── RSM-CD/
900
+ ├── SChanger/
901
+ ├── Siam-NestedUNet/
902
+ ├── STANet/
903
+ ├── evaluate.py
904
+ ├── run_training.py
905
+ ├── setup.py
906
+ └── TRAINING_GUIDE.md
907
+ ```
908
+
909
+ ## Known Issues
910
+
911
+ | Model | Issue | Status | Workaround |
912
+ |-------|-------|--------|------------|
913
+ | `rsm_cd` | Upstream RS-Mamba training path has prior initialization/runtime issues. | ❌ Unresolved | Run explicitly only after auditing the upstream environment; skip in broad sweeps if needed. |
914
+ | `changemamba` | Requires VMamba kernels and OpenMMLab stack. | ⚠️ Separate install needed | Install MMSeg stack in Installation section and run `setup.py` for VMamba weights. |
915
+ | `changer` | Requires Open-CD / mmengine / mmcv / mmsegmentation. | ⚠️ Separate install needed | Install MMSeg stack in Installation section. |
916
+ | `tinycd` | RGB-only model path; explicitly excluded for `wildfire_s2`. | ⚠️ By design | Use RGB datasets or edit dataset config only when the data is actually RGB. |
917
+ | `evaluate.py` | Central checkpoint loading is adapter-based and currently smoke-tested for `bit_cd`, `cgnet`, `changeformer`, `dsamnet`, `elgcnet`, FC variants, `hanet`, `siam_nestedunet`, `stanet`, and `tinycd`. Remaining custom/OpenMMLab models still need verified adapters. | 🔄 In Progress | Add a real in-process model construction/checkpoint adapter or call a verified upstream evaluator and convert its outputs. |
918
+ | `dsifn_cd` masks | Raw DSIFN masks may be `0/1`, which some upstream loaders can scale to all zeros. | ✅ Fixed in generated views | Regenerate views by launching training or running dataset preparation. |
919
+ | `SChanger` repo URL | Official clone URL was not confirmed from audited files. | 🔄 In Progress | `setup.py` skips automatic clone for this entry and prints a warning. |
920
+ | root license | No root `LICENSE` file was found during audit. | 🔄 Documentation gap | Check upstream model licenses before redistribution. |
921
+
922
+ ## Adding a New Model
923
+
924
+ 1. Clone the upstream repository into `model_repos/<name>`.
925
+ 2. Create `configs/models/<name>.yaml` with `name`, epochs, optimizer, LR, scheduler, loss, backbone, pretrained weights, and image size.
926
+ 3. Write `train/train_<name>.py`.
927
+ 4. Reuse `train/wrapper_common.py` if the model is a subprocess adapter.
928
+ 5. Use `datasets/cd_dataset.py` directly if the model can train in the unified process.
929
+ 6. Register the model in `configs/models/registry.yaml`.
930
+ 7. Add pretrained weight handling to `utils/weight_downloader.py` or `setup.py` when needed.
931
+ 8. Run `python run_training.py --model <name> --dataset levir_cd --dry-run`.
932
+ 9. Run the wrapper smoke-test using the real script path, for example `python train/train_bifa.py --dataset levir_cd --smoke-test`.
933
+ 10. Run a short real training pass on one dataset before adding the model to a full sweep.
934
+ 11. Ensure final metrics are saved as `results/<model>/<dataset>/metrics_test.json`.
935
+ 12. Regenerate `results/comparison_table.csv`.
936
+
937
+ ## Citation
938
+
939
+ If you use this benchmark suite in your research, please cite the individual model papers. Key references:
940
+
941
+ <details>
942
+ <summary>BibTeX references</summary>
943
+
944
+ ```bibtex
945
+ @article{chen2021bit,
946
+ title={Remote Sensing Image Change Detection with Transformers},
947
+ author={Chen, Hao and Qi, Zipeng and Shi, Zhenwei},
948
+ journal={IEEE Transactions on Geoscience and Remote Sensing},
949
+ year={2021}
950
+ }
951
+
952
+ @article{zhang2020dsifn,
953
+ title={A deeply supervised image fusion network for change detection in high resolution bi-temporal remote sensing images},
954
+ author={Zhang, Chenxiao and Yue, Peng and Tapete, Deodato and Jiang, Linlin and Shangguan, Bo and Huang, Liangpei and Liu, Guoxiang},
955
+ journal={ISPRS Journal of Photogrammetry and Remote Sensing},
956
+ year={2020}
957
+ }
958
+
959
+ @article{bandara2022changeformer,
960
+ title={A Transformer-Based Siamese Network for Change Detection},
961
+ author={Bandara, Wele Gedara Chaminda and Patel, Vishal M.},
962
+ journal={IGARSS},
963
+ year={2022}
964
+ }
965
+
966
+ @article{zhou2025schanger,
967
+ title={SChanger: Change Detection from a Semantic Change and Spatial Consistency Perspective},
968
+ author={Zhou, Ziyu and Hu, Keyan and Fang, Yutian and Rui, Xiaoping},
969
+ journal={IEEE JSTARS},
970
+ year={2025}
971
+ }
972
+ ```
973
+
974
+ </details>
975
+
976
+ ## Acknowledgements
977
+
978
+ We thank the authors of all included models for their open-source implementations. This benchmark builds on:
979
+
980
+ - [Open-CD](https://github.com/likyoo/open-cd) for Changer and the Open-CD toolbox.
981
+ - [VMamba](https://github.com/MzeroMiko/VMamba) for the VMamba backbone family.
982
+ - [timm](https://github.com/huggingface/pytorch-image-models) for pretrained backbone weights.
983
+ - University of Peradeniya for computational resources.
984
+
985
+ ## Audit Appendix: Dataset Config Facts
986
+
987
+ ### Dataset Fact 1
988
+ Config `custom_cd` is defined in `configs/datasets/custom_cd.yaml`.
989
+ Root pattern is `${DATA_ROOT}/Custom-CD`.
990
+ Image size is `256`.
991
+ Channels are `3`.
992
+ Mask folder is `Mask`.
993
+ Pre-change folder is `A`.
994
+ Post-change folder is `B`.
995
+ Splits are `train`, `val`, and `test`.
996
+ Batch size is `8`.
997
+ Workers are `4`.
998
+ Evaluation threshold is `0.5`.
999
+
1000
+ ### Dataset Fact 2
1001
+ Config `dsifn_cd` is defined in `configs/datasets/dsifn_cd.yaml`.
1002
+ Root pattern is `${DATA_ROOT}/DSIFN-CD/DSIFN`.
1003
+ Image size is `256`.
1004
+ Channels are `3`.
1005
+ Mask folder is `mask`.
1006
+ Pre-change folder is `t1`.
1007
+ Post-change folder is `t2`.
1008
+ Splits are `train`, `val`, and `test`.
1009
+ Batch size is `8`.
1010
+ Workers are `4`.
1011
+ Evaluation threshold is `0.5`.
1012
+
1013
+ ### Dataset Fact 3
1014
+ Config `kate_cd` is defined in `configs/datasets/kate_cd.yaml`.
1015
+ Root pattern is `${DATA_ROOT}/KATE-CD-256`.
1016
+ Image size is `256`.
1017
+ Channels are `3`.
1018
+ Mask folder is `label`.
1019
+ Pre-change folder is `A`.
1020
+ Post-change folder is `B`.
1021
+ Splits are `train`, `val`, and `test`.
1022
+ Batch size is `8`.
1023
+ Workers are `4`.
1024
+ Evaluation threshold is `0.5`.
1025
+
1026
+ ### Dataset Fact 4
1027
+ Config `levir_cd` is defined in `configs/datasets/levir_cd.yaml`.
1028
+ Root pattern is `${DATA_ROOT}/LEVIR-CD-plus-256`.
1029
+ Image size is `256`.
1030
+ Channels are `3`.
1031
+ Mask folder is `Mask`.
1032
+ Pre-change folder is `A`.
1033
+ Post-change folder is `B`.
1034
+ Splits are `train`, `val`, and `test`.
1035
+ Batch size is `8`.
1036
+ Workers are `4`.
1037
+ Evaluation threshold is `0.5`.
1038
+
1039
+ ### Dataset Fact 5
1040
+ Config `levir_cd_test_as_val` is defined in `configs/datasets/levir_cd_test_as_val.yaml`.
1041
+ Root pattern is `${DATA_ROOT}/LEVIR-CD-plus-256-test-as-val`.
1042
+ Image size is `256`.
1043
+ Channels are `3`.
1044
+ Mask folder is `Mask`.
1045
+ Pre-change folder is `A`.
1046
+ Post-change folder is `B`.
1047
+ Splits are `train`, `val`, and `test`.
1048
+ Protocol is `test_as_val_literature`.
1049
+ Batch size is `8`.
1050
+ Workers are `4`.
1051
+
1052
+ ### Dataset Fact 6
1053
+ Config `sysu_cd` is defined in `configs/datasets/sysu_cd.yaml`.
1054
+ Root pattern is `${DATA_ROOT}/SYSU-CD-folders`.
1055
+ Image size is `256`.
1056
+ Channels are `3`.
1057
+ Mask folder is `Mask`.
1058
+ Pre-change folder is `A`.
1059
+ Post-change folder is `B`.
1060
+ Splits are `train`, `val`, and `test`.
1061
+ Batch size is `8`.
1062
+ Workers are `4`.
1063
+ Evaluation threshold is `0.5`.
1064
+
1065
+ ### Dataset Fact 7
1066
+ Config `whu_cd` is defined in `configs/datasets/whu_cd.yaml`.
1067
+ Root pattern is `${DATA_ROOT}/WHU-CD`.
1068
+ Image size is `256`.
1069
+ Channels are `3`.
1070
+ Mask folder is `OUT`.
1071
+ Pre-change folder is `A`.
1072
+ Post-change folder is `B`.
1073
+ Splits are `train`, `val`, and `test`.
1074
+ Batch size is `8`.
1075
+ Workers are `4`.
1076
+ Evaluation threshold is `0.5`.
1077
+
1078
+ ### Dataset Fact 8
1079
+ Config `wildfire_s2` is defined in `configs/datasets/wildfire_s2.yaml`.
1080
+ Root pattern is `${DATA_ROOT}/WildFireS2`.
1081
+ Image size is `256`.
1082
+ Channels are `3`.
1083
+ Mask folder is `label`.
1084
+ Pre-change folder is `A`.
1085
+ Post-change folder is `B`.
1086
+ Splits are `train`, `val`, and `test`.
1087
+ Batch size is `8`.
1088
+ Workers are `4`.
1089
+ Evaluation threshold is `0.5`.
1090
+
1091
+ ## Audit Appendix: Model Config Facts
1092
+
1093
+ ### Model Fact 1
1094
+ Model `bifa` is registered in `configs/models/registry.yaml`.
1095
+ Config path is `configs/models/bifa.yaml`.
1096
+ Training script is `train/train_bifa.py`.
1097
+ Source path is `BiFA`.
1098
+ Framework is `pytorch`.
1099
+ Backbone is `MixTransformer`.
1100
+ Optimizer is `adam`.
1101
+ Learning rate is `0.0001`.
1102
+ Epochs are `200`.
1103
+ Loss is `ce_dice`.
1104
+
1105
+ ### Model Fact 2
1106
+ Model `bit_cd` is registered in `configs/models/registry.yaml`.
1107
+ Config path is `configs/models/bit_cd.yaml`.
1108
+ Training script is `train/train_bit_cd.py`.
1109
+ Source path is `BIT_CD`.
1110
+ Framework is `pytorch`.
1111
+ Backbone is `ResNet-18 + base_transformer_pos_s4_dd8`.
1112
+ Optimizer is `sgd`.
1113
+ Learning rate is `0.01`.
1114
+ Epochs are `200`.
1115
+ Loss is `cross_entropy`.
1116
+
1117
+ ### Model Fact 3
1118
+ Model `cdmamba` is registered in `configs/models/registry.yaml`.
1119
+ Config path is `configs/models/cdmamba.yaml`.
1120
+ Training script is `train/train_cdmamba.py`.
1121
+ Source path is `CDMamba`.
1122
+ Framework is `pytorch`.
1123
+ Backbone is `Mamba`.
1124
+ Optimizer is `adam`.
1125
+ Learning rate is `0.0001`.
1126
+ Epochs are `200`.
1127
+ Loss is `ce_dice`.
1128
+
1129
+ ### Model Fact 4
1130
+ Model `cgnet` is registered in `configs/models/registry.yaml`.
1131
+ Config path is `configs/models/cgnet.yaml`.
1132
+ Training script is `train/train_cgnet.py`.
1133
+ Source path is `model_repos/CGNet-CD`.
1134
+ Framework is `pytorch`.
1135
+ Backbone is `null` in YAML and implemented by upstream CGNet.
1136
+ Optimizer is `adam`.
1137
+ Learning rate is `0.0001`.
1138
+ Epochs are `200`.
1139
+ Loss is `original_cgnet_loss`.
1140
+
1141
+ ### Model Fact 5
1142
+ Model `change3d` is registered in `configs/models/registry.yaml`.
1143
+ Config path is `configs/models/change3d.yaml`.
1144
+ Training script is `train/train_change3d.py`.
1145
+ Source path is `Change3D`.
1146
+ Framework is `pytorch`.
1147
+ Backbone is `X3D-L`.
1148
+ Optimizer is `adam`.
1149
+ Learning rate is `0.0002`.
1150
+ Epochs are `200`.
1151
+ Loss is `bce_dice`.
1152
+
1153
+ ### Model Fact 6
1154
+ Model `changeformer` is registered in `configs/models/registry.yaml`.
1155
+ Config path is `configs/models/changeformer.yaml`.
1156
+ Training script is `train/train_changeformer.py`.
1157
+ Source path is `ChangeFormer`.
1158
+ Framework is `pytorch`.
1159
+ Backbone is `MiT-b4`.
1160
+ Optimizer is `adamw`.
1161
+ Learning rate is `0.00006`.
1162
+ Epochs are `200`.
1163
+ Loss is `cross_entropy`.
1164
+
1165
+ ### Model Fact 7
1166
+ Model `changemamba` is registered in `configs/models/registry.yaml`.
1167
+ Config path is `configs/models/changemamba.yaml`.
1168
+ Training script is `train/train_changemamba.py`.
1169
+ Source path is `model_repos/ChangeMamba`.
1170
+ Framework is `mmsegmentation`.
1171
+ Backbone is `VMamba`.
1172
+ Optimizer is `adamw`.
1173
+ Learning rate is `0.00006`.
1174
+ Epochs are `200`.
1175
+ Loss is `mmseg_decode_head_loss`.
1176
+
1177
+ ### Model Fact 8
1178
+ Model `changer` is registered in `configs/models/registry.yaml`.
1179
+ Config path is `configs/models/changer.yaml`.
1180
+ Training script is `train/train_changer.py`.
1181
+ Source path is `model_repos/open-cd`.
1182
+ Framework is `mmsegmentation`.
1183
+ Backbone is `ResNet-18`.
1184
+ Optimizer is `adamw`.
1185
+ Learning rate is `0.00006`.
1186
+ Epochs are `200`.
1187
+ Loss is `mmseg_decode_head_loss`.
1188
+
1189
+ ### Model Fact 9
1190
+ Model `dsamnet` is registered in `configs/models/registry.yaml`.
1191
+ Config path is `configs/models/dsamnet.yaml`.
1192
+ Training script is `train/train_dsamnet.py`.
1193
+ Source path is `model_repos/DSAMNet`.
1194
+ Framework is `pytorch`.
1195
+ Backbone is `ResNet`.
1196
+ Optimizer is `adam`.
1197
+ Learning rate is `0.0001`.
1198
+ Epochs are `200`.
1199
+ Loss is `contrastive_triplet_bce_original`.
1200
+
1201
+ ### Model Fact 10
1202
+ Model `dsifn` is registered in `configs/models/registry.yaml`.
1203
+ Config path is `configs/models/dsifn.yaml`.
1204
+ Training script is `train/train_dsifn.py`.
1205
+ Source path is `IFNet`.
1206
+ Framework is `pytorch`.
1207
+ Backbone is `VGG-16`.
1208
+ Optimizer is `adam`.
1209
+ Learning rate is `0.0001`.
1210
+ Epochs are `200`.
1211
+ Loss is `dsifn_original`.
1212
+
1213
+ ### Model Fact 11
1214
+ Model `elgcnet` is registered in `configs/models/registry.yaml`.
1215
+ Config path is `configs/models/elgcnet.yaml`.
1216
+ Training script is `train/train_elgcnet.py`.
1217
+ Source path is `model_repos/elgcnet`.
1218
+ Framework is `pytorch`.
1219
+ Backbone is `ResNet-18`.
1220
+ Optimizer is `sgd`.
1221
+ Learning rate is `0.01`.
1222
+ Epochs are `200`.
1223
+ Loss is `cross_entropy`.
1224
+
1225
+ ### Model Fact 12
1226
+ Model `fc_ef` is registered in `configs/models/registry.yaml`.
1227
+ Config path is `configs/models/fc_ef.yaml`.
1228
+ Training script is `train/train_fc_variants.py`.
1229
+ Source path is `model_repos/fully_convolutional_change_detection`.
1230
+ Framework is `pytorch`.
1231
+ Backbone is `null`.
1232
+ Optimizer is `adam`.
1233
+ Learning rate is `0.0001`.
1234
+ Epochs are `200`.
1235
+ Loss is `bce_dice`.
1236
+
1237
+ ### Model Fact 13
1238
+ Model `fc_siam_conc` is registered in `configs/models/registry.yaml`.
1239
+ Config path is `configs/models/fc_siam_conc.yaml`.
1240
+ Training script is `train/train_fc_variants.py`.
1241
+ Source path is `model_repos/fully_convolutional_change_detection`.
1242
+ Framework is `pytorch`.
1243
+ Backbone is `null`.
1244
+ Optimizer is `adam`.
1245
+ Learning rate is `0.0001`.
1246
+ Epochs are `200`.
1247
+ Loss is `bce_dice`.
1248
+
1249
+ ### Model Fact 14
1250
+ Model `fc_siam_diff` is registered in `configs/models/registry.yaml`.
1251
+ Config path is `configs/models/fc_siam_diff.yaml`.
1252
+ Training script is `train/train_fc_variants.py`.
1253
+ Source path is `model_repos/fully_convolutional_change_detection`.
1254
+ Framework is `pytorch`.
1255
+ Backbone is `null`.
1256
+ Optimizer is `adam`.
1257
+ Learning rate is `0.0001`.
1258
+ Epochs are `200`.
1259
+ Loss is `bce_dice`.
1260
+
1261
+ ### Model Fact 15
1262
+ Model `hanet` is registered in `configs/models/registry.yaml`.
1263
+ Config path is `configs/models/hanet.yaml`.
1264
+ Training script is `train/train_hanet.py`.
1265
+ Source path is `model_repos/HANet-CD`.
1266
+ Framework is `pytorch`.
1267
+ Backbone is `null` in YAML and implemented by upstream HANet.
1268
+ Optimizer is `adam`.
1269
+ Learning rate is `0.0001`.
1270
+ Epochs are `200`.
1271
+ Loss is `original_hanet_loss`.
1272
+
1273
+ ### Model Fact 16
1274
+ Model `ifnet` is registered in `configs/models/registry.yaml`.
1275
+ Config path is `configs/models/ifnet.yaml`.
1276
+ Training script is `train/train_ifnet.py`.
1277
+ Source path is `IFNet`.
1278
+ Framework is `pytorch`.
1279
+ Backbone is `VGG-16`.
1280
+ Optimizer is `adam`.
1281
+ Learning rate is `0.0001`.
1282
+ Epochs are `200`.
1283
+ Loss is `dsifn_cd_loss`.
1284
+
1285
+ ### Model Fact 17
1286
+ Model `rsm_cd` is registered in `configs/models/registry.yaml`.
1287
+ Config path is `configs/models/rsm_cd.yaml`.
1288
+ Training script is `train/train_rsm_cd.py`.
1289
+ Source path is `RSM-CD/change_detection_mamba`.
1290
+ Framework is `pytorch`.
1291
+ Backbone is `VMamba/RSM-CD tiny`.
1292
+ Optimizer is `adamw`.
1293
+ Learning rate is `0.001`.
1294
+ Epochs are `200`.
1295
+ Loss is `fccdn_loss_without_seg`.
1296
+
1297
+ ### Model Fact 18
1298
+ Model `schanger` is registered in `configs/models/registry.yaml`.
1299
+ Config path is `configs/models/schanger.yaml`.
1300
+ Training script is `train/train_schanger.py`.
1301
+ Source path is `SChanger`.
1302
+ Framework is `pytorch`.
1303
+ Backbone is `SChanger-base`.
1304
+ Optimizer is `adamw`.
1305
+ Learning rate is `0.00006`.
1306
+ Epochs are `200`.
1307
+ Loss is `bce_deep_supervision`.
1308
+
1309
+ ### Model Fact 19
1310
+ Model `siam_nestedunet` is registered in `configs/models/registry.yaml`.
1311
+ Config path is `configs/models/siam_nestedunet.yaml`.
1312
+ Training script is `train/train_siam_nestedunet.py`.
1313
+ Source path is `Siam-NestedUNet`.
1314
+ Framework is `pytorch`.
1315
+ Backbone is `UNet++`.
1316
+ Optimizer is `adam`.
1317
+ Learning rate is `0.00015`.
1318
+ Epochs are `200`.
1319
+ Loss is `cross_entropy`.
1320
+
1321
+ ### Model Fact 20
1322
+ Model `stanet` is registered in `configs/models/registry.yaml`.
1323
+ Config path is `configs/models/stanet.yaml`.
1324
+ Training script is `train/train_stanet.py`.
1325
+ Source path is `STANet`.
1326
+ Framework is `pytorch`.
1327
+ Backbone is `ResNet-18 + PAM`.
1328
+ Optimizer is `adam`.
1329
+ Learning rate is `0.001`.
1330
+ Epochs are `200`.
1331
+ Loss is `bcl_contrastive`.
1332
+
1333
+ ### Model Fact 21
1334
+ Model `tinycd` is registered in `configs/models/registry.yaml`.
1335
+ Config path is `configs/models/tinycd.yaml`.
1336
+ Training script is `train/train_tinycd.py`.
1337
+ Source path is `model_repos/Tiny_model_4_CD`.
1338
+ Framework is `pytorch`.
1339
+ Backbone is `EfficientNet-B4`.
1340
+ Optimizer is `adamw`.
1341
+ Learning rate is `0.0001`.
1342
+ Epochs are `200`.
1343
+ Loss is `bce_dice`.
1344
+
1345
+ ## Audit Appendix: Utility Roles
1346
+
1347
+ ### Utility Fact 1
1348
+ `utils/config.py` provides generic YAML and JSON loading.
1349
+ It also provides `deep_merge`.
1350
+ It exposes a simple model registry loader.
1351
+ It does not expand `${DATA_ROOT}`.
1352
+
1353
+ ### Utility Fact 2
1354
+ `utils/config_loader.py` provides the current dataset and model config API.
1355
+ It expands `${DATA_ROOT}`.
1356
+ It checks `/new-home/buddhiw/Datasets` by default.
1357
+ It checks the sibling `mamba-cd/datasets` fallback.
1358
+ It attaches `_config_path` and `_dataset_name`.
1359
+
1360
+ ### Utility Fact 3
1361
+ `utils/dataset_list_generator.py` writes `list/train.txt`, `list/val.txt`, and `list/test.txt`.
1362
+ It scans image folders such as `A`, `T1`, `t1`, `img`, `images`, or `image`.
1363
+ It is idempotent unless `overwrite=True`.
1364
+
1365
+ ### Utility Fact 4
1366
+ `utils/env_checker.py` checks imports for torch, torchvision, numpy, Pillow, OpenCV, PyYAML, tqdm, timm, einops, mmengine, mmcv, mmseg, and gdown.
1367
+ It prints install hints.
1368
+ It does not auto-install packages.
1369
+
1370
+ ### Utility Fact 5
1371
+ `utils/legacy_config_writer.py` prepares list-based generated views for legacy trainers.
1372
+ It writes generated JSON configs for BiFA and CDMamba.
1373
+ It converts `0/1` masks to lossless `0/255` PNG data where needed.
1374
+
1375
+ ### Utility Fact 6
1376
+ `utils/metrics.py` implements binary metrics.
1377
+ It supports class-logit tensors.
1378
+ It supports thresholded probability maps.
1379
+ It returns F1, IoU, OA, precision, recall, kappa, and confusion counts.
1380
+
1381
+ ### Utility Fact 7
1382
+ `utils/results.py` writes JSON and append-only CSV-like result files.
1383
+ It adds a UTC timestamp when appending a result row.
1384
+
1385
+ ### Utility Fact 8
1386
+ `utils/results_writer.py` writes `metrics_<split>.json`.
1387
+ It scans `results/*/*/metrics_test.json`.
1388
+ It regenerates `results/comparison_table.csv`.
1389
+
1390
+ ### Utility Fact 9
1391
+ `utils/weight_downloader.py` manages VMamba Zenodo/GDrive downloads.
1392
+ It warms timm models.
1393
+ It warms torchvision models.
1394
+ It logs downloads to `results/download_log.jsonl`.
1395
+
1396
+ ## Audit Appendix: Wrapper Modes
1397
+
1398
+ ### Wrapper Fact 1
1399
+ `bifa` uses the shared wrapper and launches `BiFA/train_cd.py` for non-default datasets.
1400
+ It writes generated JSON through `utils/legacy_config_writer.py`.
1401
+ It is subprocess mode.
1402
+
1403
+ ### Wrapper Fact 2
1404
+ `bit_cd` uses the shared wrapper and launches `BIT_CD/main_cd.py`.
1405
+ It uses generated legacy list views for non-default datasets.
1406
+ It is subprocess mode.
1407
+
1408
+ ### Wrapper Fact 3
1409
+ `cdmamba` uses the shared wrapper and launches `CDMamba/train_cd.py`.
1410
+ It writes generated JSON through `utils/legacy_config_writer.py`.
1411
+ It is subprocess mode.
1412
+
1413
+ ### Wrapper Fact 4
1414
+ `changeformer` uses the shared wrapper and launches `ChangeFormer/main_cd.py`.
1415
+ It uses generated legacy list views.
1416
+ It is subprocess mode.
1417
+
1418
+ ### Wrapper Fact 5
1419
+ `dsamnet` launches `model_repos/DSAMNet/train.py`.
1420
+ It passes direct train and validation folder paths.
1421
+ It warms torchvision ResNet weights before training.
1422
+ It is subprocess mode.
1423
+
1424
+ ### Wrapper Fact 6
1425
+ `cgnet` launches `model_repos/CGNet-CD/train_CGNet.py`.
1426
+ It builds matched split views under `generated_dataset_views/`.
1427
+ It warms torchvision ResNet-50 weights before training.
1428
+ It is subprocess mode.
1429
+
1430
+ ### Wrapper Fact 7
1431
+ `hanet` launches `model_repos/HANet-CD/trainHCX.py`.
1432
+ It writes a generated metadata JSON.
1433
+ It builds matched split views under `generated_dataset_views/`.
1434
+ It is subprocess mode.
1435
+
1436
+ ### Wrapper Fact 8
1437
+ `tinycd` launches `model_repos/Tiny_model_4_CD/training.py`.
1438
+ It builds TinyCD list views.
1439
+ It warms timm EfficientNet-B4.
1440
+ It is subprocess mode.
1441
+
1442
+ ### Wrapper Fact 9
1443
+ `changer` launches `model_repos/open-cd/tools/train.py`.
1444
+ It writes an Open-CD config under `generated_configs/`.
1445
+ It requires mmengine, mmcv, and mmsegmentation.
1446
+ It is subprocess mode.
1447
+
1448
+ ### Wrapper Fact 10
1449
+ `changemamba` launches `model_repos/ChangeMamba/changedetection/script/train_MambaBCD.py`.
1450
+ It builds ChangeMamba `T1`, `T2`, and `GT` views.
1451
+ It uses VMamba-Tiny weights from Zenodo record `14037770`.
1452
+ It is subprocess mode.
1453
+
1454
+ ### Wrapper Fact 11
1455
+ `fc_ef`, `fc_siam_conc`, and `fc_siam_diff` use `train/fc_adapter.py`.
1456
+ They train directly in this repository process.
1457
+ They use `datasets/cd_dataset.py`.
1458
+ They save validation metrics to `results/<model>/<dataset>/metrics_val.json`.
1459
+
1460
+ ### Wrapper Fact 12
1461
+ `run_training.py` skips missing dataset roots before launching wrappers.
1462
+ It skips completed model-dataset pairs when `metrics_test.json` exists.
1463
+ It supports `--dry-run`, `--resume`, `--eval-only`, `--gpu`, and `--force`.
1464
+
1465
+ ### Wrapper Fact 13
1466
+ `evaluate.py` can resolve datasets and checkpoints.
1467
+ It regenerates the comparison CSV.
1468
+ It still needs architecture-specific model loaders.
1469
+
1470
+ ## Audit Appendix: Clone Status
1471
+
1472
+ ### Cloned External Repositories
1473
+ `model_repos/CGNet-CD` exists.
1474
+ `model_repos/ChangeMamba` exists.
1475
+ `model_repos/DSAMNet` exists.
1476
+ `model_repos/HANet-CD` exists.
1477
+ `model_repos/TinyCD` exists.
1478
+ `model_repos/Tiny_model_4_CD` exists.
1479
+ `model_repos/elgcnet` exists.
1480
+ `model_repos/fully_convolutional_change_detection` exists.
1481
+ `model_repos/open-cd` exists.
1482
+
1483
+ ### Root-Level Model Repositories
1484
+ `BIT_CD` exists.
1485
+ `BiFA` exists.
1486
+ `CDMamba` exists.
1487
+ `Change3D` exists.
1488
+ `ChangeFormer` exists.
1489
+ `IFNet` exists.
1490
+ `RSM-CD` exists.
1491
+ `SChanger` exists.
1492
+ `Siam-NestedUNet` exists.
1493
+ `STANet` exists.
1494
+
1495
+ ### Missing or Unconfirmed Clone Targets
1496
+ `model_repos/DSIFN` is not present.
1497
+ The official DSIFN URL for that exact clone target was not confirmed from audited files.
1498
+ `setup.py` therefore does not guess it.
1499
+ `SChanger` has a root-level copy, but the setup script marks its clone URL as unconfirmed.
1500
+
1501
+ ## Audit Appendix: Command Reference
1502
+
1503
+ ### Setup Commands
1504
+ `python setup.py`
1505
+ Runs environment checks, clones repos, fetches weights, and prepares dataset lists.
1506
+ `python setup.py --status`
1507
+ Prints status without changes.
1508
+ `python setup.py --skip-weights`
1509
+ Skips weight downloads.
1510
+ `python setup.py --env-check-only`
1511
+ Checks packages only.
1512
+ `python setup.py --dataset levir_cd`
1513
+ Prepares list files for one dataset config.
1514
+
1515
+ ### Training Commands
1516
+ `python run_training.py --model bifa --dataset levir_cd`
1517
+ Trains one model on one dataset.
1518
+ `python run_training.py --model all --dataset levir_cd`
1519
+ Runs every registered model on one dataset.
1520
+ `python run_training.py --model bifa --dataset all`
1521
+ Runs one model across all configured datasets with available roots.
1522
+ `python run_training.py --model all --dataset all`
1523
+ Runs the full configured sweep.
1524
+ `python run_training.py --model all --dataset dsifn_cd --dry-run`
1525
+ Checks launch commands without training.
1526
+
1527
+ ### Evaluation Commands
1528
+ `python evaluate.py --model bifa --dataset levir_cd`
1529
+ Attempts central evaluation for a trained checkpoint.
1530
+ `python evaluate.py --model all --dataset all --dry-run`
1531
+ Checks evaluation config resolution.
1532
+ `python utils/weight_downloader.py --prefetch-all`
1533
+ Fetches managed pretrained weights.
1534
+ `python utils/weight_downloader.py --list`
1535
+ Lists managed VMamba weight files.
1536
+
1537
+ ## Audit Appendix: Result Provenance
1538
+
1539
+ ### Current Result State
1540
+ No `metrics_test.json` files were found during the audit.
1541
+ `results/comparison_table.csv` contains only a header row.
1542
+ Fresh benchmark numbers must therefore be produced by new training and evaluation runs.
1543
+
1544
+ ### Historical Result State
1545
+ The old README contained WildFire-S2 checkpoint numbers for `change3d`, `bit_cd`, `changeformer`, and `stanet`.
1546
+ Those numbers remain in this README only with a dagger marker.
1547
+ They are not presented as current unified-harness results.
1548
+
1549
+ ### Reporting Rule
1550
+ A number in the Results section must come from either `metrics_test.json` or a daggered historical note.
1551
+ Unknown values are shown as `—`.
1552
+ Empty cells are avoided.
1553
+
1554
+ ## Audit Appendix: Environment Snapshot
1555
+
1556
+ The local `Mamba` environment used during audit reported:
1557
+
1558
+ ```text
1559
+ torch 2.6.0+cu124
1560
+ torchvision 0.21.0+cu124
1561
+ numpy 2.1.2
1562
+ PIL 12.2.0
1563
+ cv2 4.13.0
1564
+ yaml 6.0.2
1565
+ tqdm 4.68.1
1566
+ timm 0.4.12
1567
+ einops 0.8.1
1568
+ sklearn 1.6.1
1569
+ ```
1570
+
1571
+ `timm 0.4.12` does not expose every modern MiT alias. The weight downloader treats missing `mit_b0` and `mit_b1` aliases as optional warmup warnings unless the model explicitly requires them.
TRAINING_GUIDE.md ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CD-Models Training Guide
2
+
3
+ ## Prerequisites
4
+
5
+ - Python 3.10 is recommended.
6
+ - CUDA/PyTorch requirements vary by model. Check each model directory or cloned repo requirements file before training:
7
+ - `BiFA/requirements.txt`
8
+ - `CDMamba/requirement.txt`
9
+ - `Change3D/requirements.txt`
10
+ - `ChangeFormer/requirements.txt`
11
+ - `RSM-CD/requirements.txt`
12
+ - Set `DATA_ROOT` before using central configs:
13
+
14
+ ```bash
15
+ export DATA_ROOT=/path/to/datasets
16
+ ```
17
+
18
+ All central configs use `${DATA_ROOT}` and avoid hardcoded absolute dataset paths.
19
+
20
+ ## Dataset Setup
21
+
22
+ The shared loader expects split folders under each dataset root. Folder names are configured in `configs/datasets/*.yaml`.
23
+
24
+ LEVIR-CD+:
25
+
26
+ ```text
27
+ $DATA_ROOT/LEVIR-CD-plus-256/
28
+ train/A train/B train/Mask
29
+ val/A val/B val/Mask
30
+ test/A test/B test/Mask
31
+ ```
32
+
33
+ WHU-CD:
34
+
35
+ ```text
36
+ $DATA_ROOT/WHU-CD/
37
+ train/A train/B train/OUT
38
+ val/A val/B val/OUT
39
+ test/A test/B test/OUT
40
+ ```
41
+
42
+ WildFireS2:
43
+
44
+ ```text
45
+ $DATA_ROOT/WildFireS2/
46
+ train/A train/B train/label
47
+ val/A val/B val/label
48
+ test/A test/B test/label
49
+ ```
50
+
51
+ Download sources should be confirmed from the original dataset pages before publication. Keep raw data outside this repo and point `DATA_ROOT` at the prepared benchmark folders.
52
+
53
+ ## Pretrained Weights
54
+
55
+ | Model | Backbone | Download URL | Local Path |
56
+ |---|---|---|---|
57
+ | change3d | X3D-L | Original Change3D README/model release | `Change3D/model/X3D_L.pyth` |
58
+ | ifnet / dsifn | VGG-16 | Torchvision or original DSIFN README | `model_repos/DSIFN/pretrained/vgg16.pth` |
59
+ | changemamba | VMamba | ChangeMamba README Zenodo/HuggingFace link | `model_repos/ChangeMamba/pretrained/vmamba_tiny.pth` |
60
+ | changer | ResNet-18 | open-cd / torchvision ResNet-18 | `model_repos/open-cd/pretrained/resnet18.pth` |
61
+ | tinycd | EfficientNet-B4 | TinyCD README | `model_repos/TinyCD/pretrained/efficientnet_b4.pth` |
62
+
63
+ Wrappers print a clear required-weight block when a required file is missing.
64
+
65
+ ## Automatic Weight Downloads
66
+
67
+ All pretrained backbone weights are downloaded automatically on first training run. VMamba weights for ChangeMamba are downloaded from Zenodo record `14037770` by `utils/weight_downloader.py`.
68
+
69
+ | Model | Backbone | Download Source | Auto? | Est. Size |
70
+ |---|---|---|---|---|
71
+ | ChangeMamba | VMamba-Tiny | Zenodo records/14037770 | yes | ~86 MB |
72
+ | ChangeMamba | VMamba-Small | Zenodo records/14037770 | yes | ~178 MB |
73
+ | ChangeMamba | VMamba-Base | Zenodo records/14037770 | yes | ~391 MB |
74
+ | Changer | ResNet-18 | PyTorch Hub / torchvision | yes | ~45 MB |
75
+ | DSAMNet | ResNet-18 | PyTorch Hub / torchvision | yes | ~45 MB |
76
+ | TinyCD | EfficientNet-B4 | timm / torchvision backend | yes | ~75 MB |
77
+ | HANet | ResNet-50 | PyTorch Hub / torchvision | yes | ~98 MB |
78
+ | CGNet | ResNet-50 | PyTorch Hub / torchvision | yes | ~98 MB |
79
+ | DSIFN | VGG-16 | PyTorch Hub / torchvision | yes | ~528 MB |
80
+ | ELGC-Net | MiT-b0 | timm / HuggingFace | yes | ~15 MB |
81
+ | ChangeFormer | MiT-b1 | timm / HuggingFace | yes | ~28 MB |
82
+
83
+ To pre-download all managed weights before training:
84
+
85
+ ```bash
86
+ python utils/weight_downloader.py --prefetch-all
87
+ ```
88
+
89
+ ## Quick Start
90
+
91
+ Train one model on one dataset:
92
+
93
+ ```bash
94
+ python run_training.py --model bifa --dataset wildfire_s2
95
+ ```
96
+
97
+ Train all models on one dataset:
98
+
99
+ ```bash
100
+ python run_training.py --model all --dataset wildfire_s2 --dry-run
101
+ ```
102
+
103
+ Run evaluation only:
104
+
105
+ ```bash
106
+ python run_training.py --model bifa --dataset wildfire_s2 --eval-only
107
+ ```
108
+
109
+ ## Adding A New Model
110
+
111
+ 1. Confirm the official GitHub URL and license.
112
+ 2. Clone into `model_repos/<model_name>`.
113
+ 3. Read the cloned README, configs, model code, and training code.
114
+ 4. Add `configs/models/<model_name>.yaml`.
115
+ 5. Add or update `train/train_<model_name>.py`.
116
+ 6. Register the model in `configs/models/registry.yaml`.
117
+ 7. Ensure the wrapper accepts `--dataset`, `--gpu`, `--resume`, `--eval-only`, and `--dry-run`.
118
+ 8. Save final metrics with `utils.results_writer.save_metrics()`.
119
+
120
+ ## Results
121
+
122
+ Per-run metrics are written to:
123
+
124
+ ```text
125
+ results/<model>/<dataset>/metrics_test.json
126
+ ```
127
+
128
+ The aggregate table is regenerated at:
129
+
130
+ ```text
131
+ results/comparison_table.csv
132
+ ```
133
+
134
+ Columns: `Model`, `Dataset`, `F1`, `IoU`, `OA`, `Precision`, `Recall`, `Kappa`.
135
+
136
+ ## Known Issues
137
+
138
+ ### Existing WildFire Wrappers
139
+
140
+ **Partially resolved.** Central wrappers now accept every configured dataset and validate the requested dataset through `CDDataset`. The original nested research scripts still contain their own model-specific data loops, so full non-WildFire training requires each upstream loop to be run against compatible prepared data or rewritten in detail.
141
+
142
+ ### ChangeMamba
143
+
144
+ **Resolved for setup.** Cloned to `model_repos/ChangeMamba`. Requires running `python model_repos/ChangeMamba/install_deps.py` once before training. VMamba pretrained weights are downloaded automatically from Zenodo record `14037770` on first training run.
145
+
146
+ ### Changer
147
+
148
+ **Resolved for setup.** Uses open-cd cloned to `model_repos/open-cd`. It requires the same mmengine/mmcv family of dependencies as open-cd. ResNet-18 weights download automatically through torchvision on first run.
149
+
150
+ ### DSAMNet
151
+
152
+ **Resolved for setup.** Cloned from `liumency/DSAMNet`. The original repo exposes `loss/BCL.py` and `loss/DiceLoss.py`; wrappers must use that metric-learning loss path rather than replacing it with BCE+Dice. Labels are expected as binary 0/1 maps; `CDDataset` converts 255-valued masks to 1.
153
+
154
+ ### TinyCD
155
+
156
+ **Resolved for setup.** Cloned from `AndreaCodegoni/Tiny_model_4_CD`. EfficientNet-B4 weights download automatically through the weight downloader/timm warmup. TinyCD is RGB-only; `run_training.py` skips `tinycd/wildfire_s2` by default.
157
+
158
+ ### HANet / CGNet
159
+
160
+ **Resolved for setup.** Cloned from `ChengxiHAN/HANet-CD` and `ChengxiHAN/CGNet-CD`. Both repos use similar custom training utilities and include dataset helpers under `utils/`. ResNet-50 weights are warmed automatically through torchvision.
configs/datasets/custom_cd.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: custom_cd
2
+ data_root: ${DATA_ROOT}/Custom-CD
3
+ source_name: Custom-CD
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: Mask
14
+ image_a_folder: A
15
+ image_b_folder: B
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ eval:
23
+ threshold: 0.5
24
+ sweep_val_threshold: true
25
+ threshold_min: 0.05
26
+ threshold_max: 0.95
27
+ threshold_step: 0.05
28
+ boundary_tolerance: 2
29
+
configs/datasets/dsifn_cd.yaml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: dsifn_cd
2
+ data_root: ${DATA_ROOT}/DSIFN-CD/DSIFN
3
+ source_name: DSIFN-CD
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: mask
14
+ image_a_folder: t1
15
+ image_b_folder: t2
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ eval:
23
+ threshold: 0.5
24
+ sweep_val_threshold: true
25
+ threshold_min: 0.05
26
+ threshold_max: 0.95
27
+ threshold_step: 0.05
28
+ boundary_tolerance: 2
configs/datasets/kate_cd.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: kate_cd
2
+ data_root: ${DATA_ROOT}/KATE-CD-256
3
+ source_name: KATE-CD-256
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: label
14
+ image_a_folder: A
15
+ image_b_folder: B
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ eval:
23
+ threshold: 0.5
24
+ sweep_val_threshold: true
25
+ threshold_min: 0.05
26
+ threshold_max: 0.95
27
+ threshold_step: 0.05
28
+ boundary_tolerance: 2
29
+
configs/datasets/levir_cd.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: levir_cd
2
+ data_root: ${DATA_ROOT}/LEVIR-CD-plus-256-test-as-val
3
+ source_name: LEVIR-CD+
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: Mask
14
+ image_a_folder: A
15
+ image_b_folder: B
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ eval:
23
+ threshold: 0.5
24
+ sweep_val_threshold: true
25
+ threshold_min: 0.4
26
+ threshold_max: 0.95
27
+ threshold_step: 0.02
28
+ boundary_tolerance: 2
29
+
configs/datasets/levir_cd_test_as_val.yaml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: levir_cd_test_as_val
2
+ data_root: ${DATA_ROOT}/LEVIR-CD-plus-256-test-as-val
3
+ source_name: LEVIR-CD+
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: Mask
14
+ image_a_folder: A
15
+ image_b_folder: B
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ protocol: test_as_val_literature
23
+ eval:
24
+ threshold: 0.5
25
+ sweep_val_threshold: false
26
+ boundary_tolerance: 2
configs/datasets/sysu_cd.yaml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: sysu_cd
2
+ data_root: ${DATA_ROOT}/SYSU-CD-folders
3
+ source_name: SYSU-CD
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: Mask
14
+ image_a_folder: A
15
+ image_b_folder: B
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ eval:
23
+ threshold: 0.5
24
+ sweep_val_threshold: true
25
+ threshold_min: 0.05
26
+ threshold_max: 0.95
27
+ threshold_step: 0.05
28
+ boundary_tolerance: 2
configs/datasets/whu_cd.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: whu_cd
2
+ data_root: ${DATA_ROOT}/WHU-CD
3
+ source_name: WHU-CD
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: OUT
14
+ image_a_folder: A
15
+ image_b_folder: B
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ eval:
23
+ threshold: 0.5
24
+ sweep_val_threshold: true
25
+ threshold_min: 0.05
26
+ threshold_max: 0.95
27
+ threshold_step: 0.05
28
+ boundary_tolerance: 2
29
+
configs/datasets/wildfire_s2.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: wildfire_s2
2
+ data_root: ${DATA_ROOT}/WildFireS2
3
+ source_name: WildFireS2
4
+ img_size: 256
5
+ num_classes: 2
6
+ ignore_index: 255
7
+ channels: 3
8
+ mean_a: [0.485, 0.456, 0.406]
9
+ std_a: [0.229, 0.224, 0.225]
10
+ mean_b: [0.485, 0.456, 0.406]
11
+ std_b: [0.229, 0.224, 0.225]
12
+ mask_threshold: 127
13
+ mask_folder: label
14
+ image_a_folder: A
15
+ image_b_folder: B
16
+ splits:
17
+ train: train
18
+ val: val
19
+ test: test
20
+ batch_size: 8
21
+ num_workers: 4
22
+ eval:
23
+ threshold: 0.5
24
+ sweep_val_threshold: true
25
+ threshold_min: 0.05
26
+ threshold_max: 0.95
27
+ threshold_step: 0.05
28
+ boundary_tolerance: 2
29
+
configs/models/bifa.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: bifa
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0
6
+ scheduler: linear
7
+ loss: ce_dice
8
+ backbone: MixTransformer
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/bit_cd.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: bit_cd
2
+ num_epochs: 200
3
+ optimizer: sgd
4
+ lr: 0.01
5
+ weight_decay: 0.0005
6
+ scheduler: cosine
7
+ loss: cross_entropy
8
+ backbone: ResNet-18 + base_transformer_pos_s4_dd8
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/cdmamba.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: cdmamba
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0
6
+ scheduler: linear
7
+ loss: ce_dice
8
+ backbone: Mamba
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/cgnet.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: cgnet
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0001
6
+ scheduler: cosine
7
+ loss: original_cgnet_loss
8
+ backbone: null
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/change3d.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: change3d
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0002
5
+ weight_decay: 0.0001
6
+ scheduler: poly
7
+ loss: bce_dice
8
+ backbone: X3D-L
9
+ pretrained_weights: Change3D/model/X3D_L.pyth
10
+ img_size: 256
11
+
configs/models/changeformer.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: changeformer
2
+ num_epochs: 200
3
+ optimizer: adamw
4
+ lr: 0.00006
5
+ weight_decay: 0.01
6
+ scheduler: cosine
7
+ loss: cross_entropy
8
+ backbone: MiT-b4
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/changemamba.yaml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: changemamba
2
+ num_epochs: 200
3
+ max_iters: 50000
4
+ smoke_max_iters: 2
5
+ optimizer: adamw
6
+ lr: 0.00006
7
+ weight_decay: 0.01
8
+ scheduler: poly
9
+ loss: mmseg_decode_head_loss
10
+ backbone: VMamba-Small
11
+ vmamba_variant: small
12
+ changemamba_model_type: MambaBCD_Small
13
+ pretrained_weights: model_repos/ChangeMamba/pretrained_weight/vssmsmall_dp03_ckpt_epoch_238.pth
14
+ img_size: 256
configs/models/changer.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: changer
2
+ num_epochs: 200
3
+ optimizer: adamw
4
+ lr: 0.00006
5
+ weight_decay: 0.01
6
+ scheduler: poly
7
+ loss: mmseg_decode_head_loss
8
+ backbone: ResNet-18
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/dsamnet.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: dsamnet
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0001
6
+ scheduler: step
7
+ loss: contrastive_triplet_bce_original
8
+ backbone: ResNet
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/dsifn.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: dsifn
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0001
6
+ scheduler: step
7
+ loss: dsifn_original
8
+ backbone: VGG-16
9
+ pretrained_weights: model_repos/DSIFN/pretrained/vgg16.pth
10
+ img_size: 256
11
+
configs/models/elgcnet.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: elgcnet
2
+ num_epochs: 200
3
+ optimizer: sgd
4
+ lr: 0.01
5
+ weight_decay: 0.0005
6
+ scheduler: cosine
7
+ loss: cross_entropy
8
+ backbone: ResNet-18
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/fc_ef.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: fc_ef
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0
6
+ scheduler: step
7
+ loss: bce_dice
8
+ backbone: null
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/fc_siam_conc.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: fc_siam_conc
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0
6
+ scheduler: step
7
+ loss: bce_dice
8
+ backbone: null
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/fc_siam_diff.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: fc_siam_diff
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0
6
+ scheduler: step
7
+ loss: bce_dice
8
+ backbone: null
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/hanet.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: hanet
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0001
6
+ scheduler: cosine
7
+ loss: original_hanet_loss
8
+ backbone: null
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/ifnet.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: ifnet
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.0001
5
+ weight_decay: 0.0001
6
+ scheduler: step
7
+ loss: dsifn_cd_loss
8
+ backbone: VGG-16
9
+ pretrained_weights: torchvision://vgg16
10
+ img_size: 256
11
+
configs/models/registry.yaml ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ models:
2
+ bifa:
3
+ script: train/train_bifa.py
4
+ source_path: BiFA
5
+ framework: pytorch
6
+ pretrained_backbone: MixTransformer
7
+ bit_cd:
8
+ script: train/train_bit_cd.py
9
+ source_path: BIT_CD
10
+ framework: pytorch
11
+ pretrained_backbone: ResNet-18
12
+ cdmamba:
13
+ script: train/train_cdmamba.py
14
+ source_path: CDMamba
15
+ framework: pytorch
16
+ pretrained_backbone: Mamba
17
+ change3d:
18
+ script: train/train_change3d.py
19
+ source_path: Change3D
20
+ framework: pytorch
21
+ pretrained_backbone: X3D-L
22
+ changeformer:
23
+ script: train/train_changeformer.py
24
+ source_path: ChangeFormer
25
+ framework: pytorch
26
+ pretrained_backbone: MiT-b4
27
+ ifnet:
28
+ script: train/train_ifnet.py
29
+ source_path: IFNet
30
+ framework: pytorch
31
+ pretrained_backbone: VGG-16
32
+ rsm_cd:
33
+ script: train/train_rsm_cd.py
34
+ source_path: RSM-CD/change_detection_mamba
35
+ framework: pytorch
36
+ pretrained_backbone: VMamba
37
+ schanger:
38
+ script: train/train_schanger.py
39
+ source_path: SChanger
40
+ framework: pytorch
41
+ pretrained_backbone: null
42
+ siam_nestedunet:
43
+ script: train/train_siam_nestedunet.py
44
+ source_path: Siam-NestedUNet
45
+ framework: pytorch
46
+ pretrained_backbone: null
47
+ stanet:
48
+ script: train/train_stanet.py
49
+ source_path: STANet
50
+ framework: pytorch
51
+ pretrained_backbone: ResNet-18
52
+ fc_ef:
53
+ script: train/train_fc_variants.py
54
+ source_path: model_repos/fully_convolutional_change_detection
55
+ framework: pytorch
56
+ pretrained_backbone: null
57
+ fc_siam_conc:
58
+ script: train/train_fc_variants.py
59
+ source_path: model_repos/fully_convolutional_change_detection
60
+ framework: pytorch
61
+ pretrained_backbone: null
62
+ fc_siam_diff:
63
+ script: train/train_fc_variants.py
64
+ source_path: model_repos/fully_convolutional_change_detection
65
+ framework: pytorch
66
+ pretrained_backbone: null
67
+ dsifn:
68
+ script: train/train_dsifn.py
69
+ source_path: IFNet
70
+ framework: pytorch
71
+ pretrained_backbone: VGG-16
72
+ changemamba:
73
+ script: train/train_changemamba.py
74
+ source_path: model_repos/ChangeMamba
75
+ framework: mmsegmentation
76
+ pretrained_backbone: VMamba
77
+ elgcnet:
78
+ script: train/train_elgcnet.py
79
+ source_path: model_repos/elgcnet
80
+ framework: pytorch
81
+ pretrained_backbone: ResNet-18
82
+ changer:
83
+ script: train/train_changer.py
84
+ source_path: model_repos/open-cd
85
+ framework: mmsegmentation
86
+ pretrained_backbone: ResNet-18
87
+ hanet:
88
+ script: train/train_hanet.py
89
+ source_path: model_repos/HANet-CD
90
+ framework: pytorch
91
+ pretrained_backbone: null
92
+ cgnet:
93
+ script: train/train_cgnet.py
94
+ source_path: model_repos/CGNet-CD
95
+ framework: pytorch
96
+ pretrained_backbone: null
97
+ dsamnet:
98
+ script: train/train_dsamnet.py
99
+ source_path: model_repos/DSAMNet
100
+ framework: pytorch
101
+ pretrained_backbone: ResNet
102
+ tinycd:
103
+ script: train/train_tinycd.py
104
+ source_path: model_repos/Tiny_model_4_CD
105
+ framework: pytorch
106
+ pretrained_backbone: EfficientNet-B4
configs/models/rsm_cd.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: rsm_cd
2
+ num_epochs: 200
3
+ optimizer: adamw
4
+ lr: 0.001
5
+ weight_decay: 0.001
6
+ scheduler: reduce_on_plateau
7
+ loss: fccdn_loss_without_seg
8
+ backbone: VMamba/RSM-CD tiny
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/schanger.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: schanger
2
+ num_epochs: 200
3
+ optimizer: adamw
4
+ lr: 0.00006
5
+ weight_decay: 0.0001
6
+ scheduler: cosine
7
+ loss: bce_deep_supervision
8
+ backbone: SChanger-base
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/siam_nestedunet.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: siam_nestedunet
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.00015
5
+ weight_decay: 0.0001
6
+ scheduler: step
7
+ loss: cross_entropy
8
+ backbone: UNet++
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/stanet.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: stanet
2
+ num_epochs: 200
3
+ optimizer: adam
4
+ lr: 0.001
5
+ weight_decay: 0.0
6
+ scheduler: cosine
7
+ loss: bcl_contrastive
8
+ backbone: ResNet-18 + PAM
9
+ pretrained_weights: null
10
+ img_size: 256
11
+
configs/models/tinycd.yaml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: tinycd
2
+ num_epochs: 200
3
+ optimizer: adamw
4
+ lr: 0.0001
5
+ weight_decay: 0.01
6
+ scheduler: cosine
7
+ loss: bce_dice
8
+ backbone: EfficientNet-B4
9
+ pretrained_weights: model_repos/TinyCD/pretrained/efficientnet_b4.pth
10
+ img_size: 256
11
+
datasets/__init__.py ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ from .cd_dataset import CDDataset, build_dataloader
2
+
3
+ __all__ = ["CDDataset", "build_dataloader"]
4
+
datasets/cd_dataset.py ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+ from typing import Dict, Iterable, Optional
5
+
6
+ import numpy as np
7
+ import torch
8
+ from PIL import Image
9
+ from torch.utils.data import DataLoader, Dataset
10
+ from utils.dataset_cache import dataloader_kwargs, print_dataloader_policy
11
+
12
+ try:
13
+ from torchvision import transforms
14
+ except Exception: # pragma: no cover - torchvision import errors are environment-specific.
15
+ transforms = None
16
+
17
+
18
+ IMG_EXTS = {".png", ".jpg", ".jpeg", ".tif", ".tiff", ".bmp"}
19
+ MASK_DIR_CANDIDATES = ("Mask", "mask", "label", "labels", "OUT", "gt")
20
+
21
+
22
+ def _scan(folder: Path) -> Dict[str, Path]:
23
+ return {
24
+ p.stem: p
25
+ for p in sorted(folder.iterdir())
26
+ if p.is_file() and not p.name.startswith(".") and p.suffix.lower() in IMG_EXTS
27
+ }
28
+
29
+
30
+ def _resolve(root: Path, value: str | Path) -> Path:
31
+ p = Path(value)
32
+ return p if p.is_absolute() else root / p
33
+
34
+
35
+ def _configured_dirs(root: Path, split: str, cfg: dict) -> Optional[tuple[Path, Path, Path]]:
36
+ if "splits" in cfg:
37
+ split_dir = root / cfg.get("splits", {}).get(split, split)
38
+ a_dir = split_dir / cfg.get("image_a_folder", "A")
39
+ b_dir = split_dir / cfg.get("image_b_folder", "B")
40
+ m_dir = split_dir / cfg.get("mask_folder", "label")
41
+ return a_dir, b_dir, m_dir
42
+ source = cfg.get("split", {}).get("source_folders", {})
43
+ a_rel = source.get(f"{split}_a") or source.get("a")
44
+ b_rel = source.get(f"{split}_b") or source.get("b")
45
+ m_rel = source.get(f"{split}_mask") or source.get("mask")
46
+ if not (a_rel and b_rel and m_rel):
47
+ return None
48
+ return _resolve(root, a_rel), _resolve(root, b_rel), _resolve(root, m_rel)
49
+
50
+
51
+ def _mask_dir(split_dir: Path) -> Path:
52
+ for name in MASK_DIR_CANDIDATES:
53
+ candidate = split_dir / name
54
+ if candidate.is_dir():
55
+ return candidate
56
+ tried = ", ".join(MASK_DIR_CANDIDATES)
57
+ raise FileNotFoundError(f"No mask directory under {split_dir}; tried {tried}")
58
+
59
+
60
+ class CDDataset(Dataset):
61
+ """Configurable binary change-detection dataset.
62
+
63
+ This is the shared root loader for CD-Models. It intentionally supports the
64
+ folder conventions found in mamba-cd and the nested research repos instead
65
+ of adding another WildFire-specific loader.
66
+ """
67
+
68
+ def __init__(
69
+ self,
70
+ root: str | Path,
71
+ split: str,
72
+ cfg: Optional[dict] = None,
73
+ image_size: Optional[int] = None,
74
+ normalize: bool = True,
75
+ return_format: str = "dict",
76
+ ) -> None:
77
+ self.root = Path(root)
78
+ self.split = split
79
+ self.cfg = cfg or {}
80
+ self.return_format = return_format
81
+ ds_cfg = self.cfg.get("dataset", self.cfg)
82
+ self.image_size = int(image_size or ds_cfg.get("image_size", ds_cfg.get("img_size", 256)))
83
+ self.threshold = int(ds_cfg.get("binary_threshold", ds_cfg.get("mask_threshold", 127)))
84
+ self.mean = ds_cfg.get("mean", ds_cfg.get("mean_a", [0.485, 0.456, 0.406]))
85
+ self.std = ds_cfg.get("std", ds_cfg.get("std_a", [0.229, 0.224, 0.225]))
86
+ if not self.root.is_dir():
87
+ dataset_name = ds_cfg.get("_dataset_name", ds_cfg.get("name", "unknown"))
88
+ raise FileNotFoundError(
89
+ f"\n{'=' * 60}\n"
90
+ f"Dataset root directory not found:\n {self.root}\n\n"
91
+ f"For dataset '{dataset_name}', either:\n"
92
+ f" 1. Download the dataset and place it at the above path\n"
93
+ f" 2. Update DATA_ROOT: export DATA_ROOT=/correct/path\n"
94
+ f" 3. Edit configs/datasets/{dataset_name}.yaml\n"
95
+ f"{'=' * 60}"
96
+ )
97
+
98
+ configured = _configured_dirs(self.root, split, self.cfg)
99
+ if configured is None:
100
+ split_dir = self.root / split
101
+ a_dir = split_dir / "A"
102
+ b_dir = split_dir / "B"
103
+ m_dir = _mask_dir(split_dir)
104
+ else:
105
+ a_dir, b_dir, m_dir = configured
106
+
107
+ for label, folder in (("A", a_dir), ("B", b_dir), ("mask", m_dir)):
108
+ if not folder.is_dir():
109
+ raise FileNotFoundError(f"{label} directory not found: {folder}")
110
+
111
+ a_files = _scan(a_dir)
112
+ b_files = _scan(b_dir)
113
+ m_files = _scan(m_dir)
114
+ stems = sorted(set(a_files) & set(b_files) & set(m_files))
115
+ if not stems:
116
+ raise RuntimeError(f"No matched A/B/mask triplets found for {self.root} split {split}")
117
+ self.samples = [(a_files[s], b_files[s], m_files[s], s) for s in stems]
118
+
119
+ if transforms is None:
120
+ self.image_tf = None
121
+ else:
122
+ ops: list = [transforms.Resize((self.image_size, self.image_size)), transforms.ToTensor()]
123
+ if normalize:
124
+ ops.append(transforms.Normalize(mean=self.mean, std=self.std))
125
+ self.image_tf = transforms.Compose(ops)
126
+
127
+ def __len__(self) -> int:
128
+ return len(self.samples)
129
+
130
+ def _image(self, path: Path) -> torch.Tensor:
131
+ img = Image.open(path).convert("RGB")
132
+ if self.image_tf is not None:
133
+ return self.image_tf(img)
134
+ img = img.resize((self.image_size, self.image_size), Image.BILINEAR)
135
+ arr = np.array(img, dtype=np.float32) / 255.0
136
+ return torch.from_numpy(arr).permute(2, 0, 1)
137
+
138
+ def _mask(self, path: Path) -> torch.Tensor:
139
+ mask = Image.open(path).convert("L").resize((self.image_size, self.image_size), Image.NEAREST)
140
+ arr = np.array(mask, dtype=np.uint8)
141
+ if arr.max() <= 1:
142
+ bin_mask = (arr > 0).astype(np.float32)
143
+ else:
144
+ bin_mask = (arr > self.threshold).astype(np.float32)
145
+ return torch.from_numpy(bin_mask).unsqueeze(0)
146
+
147
+ def __getitem__(self, index: int):
148
+ a_path, b_path, mask_path, name = self.samples[index]
149
+ a = self._image(a_path)
150
+ b = self._image(b_path)
151
+ mask = self._mask(mask_path)
152
+ if self.return_format == "tuple":
153
+ return a, b, mask, name
154
+ if self.return_format == "legacy":
155
+ return {"A": a, "B": b, "L": mask.squeeze(0).long(), "name": name}
156
+ return {"a": a, "b": b, "mask": mask, "name": name}
157
+
158
+
159
+ def build_dataloader(
160
+ cfg: dict,
161
+ split: str,
162
+ shuffle: Optional[bool] = None,
163
+ return_format: str = "dict",
164
+ ) -> DataLoader:
165
+ ds_cfg = cfg.get("dataset", cfg)
166
+ dataset = CDDataset(
167
+ ds_cfg.get("root", ds_cfg["data_root"]),
168
+ split=split,
169
+ cfg=cfg,
170
+ image_size=int(ds_cfg.get("image_size", ds_cfg.get("img_size", 256))),
171
+ return_format=return_format,
172
+ )
173
+ batch_size = int(ds_cfg.get("batch_size", 8))
174
+ num_workers = int(ds_cfg.get("num_workers", 4))
175
+ if shuffle is None:
176
+ shuffle = split == "train"
177
+ print_dataloader_policy({**ds_cfg, "num_workers": num_workers}, torch.cuda.is_available())
178
+ return DataLoader(
179
+ dataset,
180
+ batch_size=batch_size,
181
+ shuffle=shuffle,
182
+ **dataloader_kwargs({**ds_cfg, "num_workers": num_workers}, torch.cuda.is_available()),
183
+ drop_last=split == "train",
184
+ )
185
+
186
+
187
+ def available_splits(cfg: dict) -> Iterable[str]:
188
+ ds_cfg = cfg.get("dataset", cfg)
189
+ root = Path(ds_cfg.get("root", ds_cfg["data_root"]))
190
+ if "splits" in cfg:
191
+ yield from cfg["splits"]
192
+ return
193
+ source = cfg.get("split", {}).get("source_folders", {})
194
+ for split in ("train", "val", "test"):
195
+ if source.get(f"{split}_a") and source.get(f"{split}_b") and source.get(f"{split}_mask"):
196
+ yield split
197
+ elif (root / split).is_dir():
198
+ yield split
evaluate.py ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ evaluate.py - Run test sweep on a trained cd-model checkpoint.
3
+
4
+ Usage:
5
+ python evaluate.py --model changemamba --dataset levir_cd
6
+ python evaluate.py --model all --dataset all
7
+ python evaluate.py --checkpoint results/bifa/levir_cd/checkpoints/best_model.pth --model bifa --dataset levir_cd
8
+ """
9
+ from __future__ import annotations
10
+
11
+ import argparse
12
+ import sys
13
+ from pathlib import Path
14
+
15
+ import torch
16
+ import yaml
17
+
18
+ from utils.config_loader import load_dataset_config, load_model_config
19
+ from utils.gpu_utils import print_gpu_diagnostics, resolve_gpu
20
+ from utils.model_adapters import get_model_adapter
21
+ from utils.results_writer import append_to_comparison_table
22
+ from utils.unified_evaluator import evaluate_with_adapter
23
+
24
+
25
+ ROOT = Path(__file__).resolve().parent
26
+ if str(ROOT) not in sys.path:
27
+ sys.path.insert(0, str(ROOT))
28
+
29
+ class ModelEvaluationUnavailable(RuntimeError):
30
+ pass
31
+
32
+
33
+ def _load_datasets() -> list[str]:
34
+ return sorted(path.stem for path in (ROOT / "configs" / "datasets").glob("*.yaml"))
35
+
36
+
37
+ def _load_registry() -> dict:
38
+ with (ROOT / "configs" / "models" / "registry.yaml").open("r", encoding="utf-8") as f:
39
+ return yaml.safe_load(f)["models"]
40
+
41
+
42
+ def _best_checkpoint(model: str, dataset: str) -> Path:
43
+ ckpt_dir = ROOT / "results" / model / dataset / "checkpoints"
44
+ direct = ckpt_dir / "best_model.pth"
45
+ if direct.exists():
46
+ return direct
47
+ candidates = (
48
+ sorted(ckpt_dir.glob("*F1*.pth"))
49
+ + sorted(ckpt_dir.glob("*.pth"))
50
+ + sorted(ckpt_dir.glob("**/best_ckpt.pth"))
51
+ + sorted(ckpt_dir.glob("**/best_ckpt.pt"))
52
+ + sorted(ckpt_dir.glob("**/*best*.pth"))
53
+ + sorted(ckpt_dir.glob("**/*best*.pt"))
54
+ )
55
+ if not candidates:
56
+ raise FileNotFoundError(f"No checkpoint found under {ckpt_dir}")
57
+ return candidates[-1]
58
+
59
+
60
+ def _parse_args() -> argparse.Namespace:
61
+ registry = _load_registry()
62
+ datasets = _load_datasets()
63
+ parser = argparse.ArgumentParser(description="Run a test sweep on a trained cd-model checkpoint.")
64
+ parser.add_argument("--model", required=True, choices=sorted(registry) + ["all"])
65
+ parser.add_argument("--dataset", required=True, choices=datasets + ["all"])
66
+ parser.add_argument("--checkpoint", default=None)
67
+ parser.add_argument("--gpu", default="0")
68
+ parser.add_argument("--dry-run", action="store_true")
69
+ parser.add_argument("--allow-missing-profilers", action="store_true")
70
+ return parser.parse_args()
71
+
72
+
73
+ def _evaluate_one(
74
+ model: str,
75
+ dataset: str,
76
+ checkpoint: str | None,
77
+ gpu: str,
78
+ dry_run: bool,
79
+ allow_missing_profilers: bool,
80
+ ) -> int:
81
+ cfg = load_dataset_config(dataset)
82
+ gpu_resolution = resolve_gpu(gpu)
83
+ print_gpu_diagnostics(gpu_resolution)
84
+ if dry_run:
85
+ print(f"[EVAL-DRY-RUN] model={model} dataset={dataset} data_root={cfg['data_root']}")
86
+ return 0
87
+ ckpt = Path(checkpoint) if checkpoint else _best_checkpoint(model, dataset)
88
+ if not ckpt.is_absolute():
89
+ ckpt = ROOT / ckpt
90
+ print(f"[EVAL] model={model} dataset={dataset} checkpoint={ckpt}")
91
+ adapter = get_model_adapter(model)
92
+ if not adapter.supports_inprocess_eval:
93
+ raise ModelEvaluationUnavailable(adapter.notes_or_failure_reason)
94
+ device = torch.device(gpu_resolution.local_device)
95
+ _, code = evaluate_with_adapter(
96
+ model_name=model,
97
+ dataset_cfg=cfg,
98
+ model_config=load_model_config(model),
99
+ adapter=adapter,
100
+ checkpoint_path=ckpt,
101
+ device=device,
102
+ strict_profiling=not allow_missing_profilers,
103
+ )
104
+ return code
105
+
106
+
107
+ def main() -> int:
108
+ args = _parse_args()
109
+ models = sorted(_load_registry()) if args.model == "all" else [args.model]
110
+ datasets = _load_datasets() if args.dataset == "all" else [args.dataset]
111
+ rows = []
112
+ for model in models:
113
+ for dataset in datasets:
114
+ try:
115
+ code = _evaluate_one(
116
+ model,
117
+ dataset,
118
+ args.checkpoint,
119
+ args.gpu,
120
+ args.dry_run,
121
+ args.allow_missing_profilers,
122
+ )
123
+ rows.append((model, dataset, "complete" if code == 0 else "failed"))
124
+ except FileNotFoundError as exc:
125
+ print(f"[MISSING] {model}/{dataset}: {exc}")
126
+ rows.append((model, dataset, "missing"))
127
+ except ModelEvaluationUnavailable as exc:
128
+ print(f"[UNAVAILABLE] {model}/{dataset}: {exc}")
129
+ rows.append((model, dataset, "unavailable"))
130
+ except RuntimeError as exc:
131
+ print(f"[FAILED] {model}/{dataset}: {exc}")
132
+ rows.append((model, dataset, "failed"))
133
+ append_to_comparison_table()
134
+ print("\nModel | Dataset | Status")
135
+ print("--- | --- | ---")
136
+ for model, dataset, status in rows:
137
+ print(f"{model} | {dataset} | {status}")
138
+ return 0 if all(status == "complete" for _, _, status in rows) else 1
139
+
140
+
141
+ if __name__ == "__main__":
142
+ raise SystemExit(main())
generated_configs/dsifn_cd__bifa.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dsifn_cd-train-bifa",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "DSIFN-CD",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 4,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "DSIFN-CD",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 4,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "DSIFN-CD",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 4,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "bifa",
44
+ "loss": "ce_dice"
45
+ },
46
+ "train": {
47
+ "n_epoch": 200,
48
+ "train_print_iter": 50,
49
+ "val_freq": 1,
50
+ "val_print_iter": 20,
51
+ "optimizer": {
52
+ "type": "adam",
53
+ "lr": 0.0001
54
+ },
55
+ "sheduler": {
56
+ "lr_policy": "linear",
57
+ "n_step": 3,
58
+ "gamma": 0.1
59
+ }
60
+ }
61
+ }
generated_configs/dsifn_cd__cdmamba.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "dsifn_cd-train-cdmamba",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "DSIFN-CD",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 2,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "DSIFN-CD",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 2,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "DSIFN-CD",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 2,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "cdmamba",
44
+ "loss": "ce_dice",
45
+ "init_filters": 16,
46
+ "n_classes": 2,
47
+ "mode": "AGLGF",
48
+ "conv_mode": "orignal_dinner",
49
+ "local_query_model": "orignal_dinner",
50
+ "up_mode": "SRCM",
51
+ "up_conv_mode": "deepwise",
52
+ "spatial_dims": 2,
53
+ "in_channels": 3,
54
+ "resdiual": false,
55
+ "blocks_down": [
56
+ 1,
57
+ 2,
58
+ 2,
59
+ 4
60
+ ],
61
+ "blocks_up": [
62
+ 1,
63
+ 1,
64
+ 1
65
+ ],
66
+ "diff_abs": "later",
67
+ "stage": 2,
68
+ "mamba_act": "relu",
69
+ "norm": [
70
+ "GROUP",
71
+ {
72
+ "num_groups": 8
73
+ }
74
+ ]
75
+ },
76
+ "train": {
77
+ "n_epoch": 200,
78
+ "train_print_iter": 50,
79
+ "val_freq": 1,
80
+ "val_print_iter": 20,
81
+ "optimizer": {
82
+ "type": "adam",
83
+ "lr": 0.0001
84
+ },
85
+ "sheduler": {
86
+ "lr_policy": "linear",
87
+ "n_step": 3,
88
+ "gamma": 0.1
89
+ }
90
+ }
91
+ }
generated_configs/dsifn_cd__changer_opencd.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = '/new-home/buddhiw/CD-Models/model_repos/open-cd/configs/changer/changer_ex_r18_512x512_40k_levircd.py'
2
+
3
+ dataset_type = 'DSIFN_Dataset'
4
+ data_root = r'/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/opencd'
5
+ crop_size = (256, 256)
6
+
7
+ train_dataloader = dict(
8
+ batch_size=8,
9
+ num_workers=4,
10
+ dataset=dict(
11
+ type=dataset_type,
12
+ data_root=data_root,
13
+ data_prefix=dict(seg_map_path='train/label', img_path_from='train/A', img_path_to='train/B')))
14
+ val_dataloader = dict(
15
+ dataset=dict(
16
+ type=dataset_type,
17
+ data_root=data_root,
18
+ data_prefix=dict(seg_map_path='val/label', img_path_from='val/A', img_path_to='val/B')))
19
+ test_dataloader = dict(
20
+ dataset=dict(
21
+ type=dataset_type,
22
+ data_root=data_root,
23
+ data_prefix=dict(seg_map_path='test/label', img_path_from='test/A', img_path_to='test/B')))
24
+
25
+ train_cfg = dict(type='IterBasedTrainLoop', max_iters=90000, val_interval=450)
26
+ work_dir = r'/new-home/buddhiw/CD-Models/results/changer/dsifn_cd/work_dir'
generated_configs/dsifn_cd__hanet_metadata.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "patch_size": 256,
3
+ "augmentation": true,
4
+ "num_gpus": 1,
5
+ "num_workers": 4,
6
+ "num_channel": 3,
7
+ "EF": false,
8
+ "epochs": 200,
9
+ "epochs_threshold": 15,
10
+ "gamma": 0.5,
11
+ "weight_decay": 0.0001,
12
+ "batch_size": 8,
13
+ "learning_rate": 0.0001,
14
+ "loss_function": "hybrid",
15
+ "dataset_dir": "/new-home/buddhiw/CD-Models/generated_dataset_views/dsifn_cd/hanet_matched/",
16
+ "weight_dir": "/new-home/buddhiw/CD-Models/results/hanet/dsifn_cd/weights/",
17
+ "Output_dir": "/new-home/buddhiw/CD-Models/results/hanet/dsifn_cd/outputs/",
18
+ "log_dir": "/new-home/buddhiw/CD-Models/results/hanet/dsifn_cd/logs"
19
+ }
generated_configs/kate_cd__bifa.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "kate_cd-train-bifa",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "KATE-CD-256",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/kate_cd/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 4,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "KATE-CD-256",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/kate_cd/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 4,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "KATE-CD-256",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/kate_cd/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 4,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "bifa",
44
+ "loss": "ce_dice"
45
+ },
46
+ "train": {
47
+ "n_epoch": 200,
48
+ "train_print_iter": 50,
49
+ "val_freq": 1,
50
+ "val_print_iter": 20,
51
+ "optimizer": {
52
+ "type": "adam",
53
+ "lr": 0.0001
54
+ },
55
+ "sheduler": {
56
+ "lr_policy": "linear",
57
+ "n_step": 3,
58
+ "gamma": 0.1
59
+ }
60
+ }
61
+ }
generated_configs/levir_cd__bifa.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "levir_cd-train-bifa",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "LEVIR-CD+",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 4,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "LEVIR-CD+",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 4,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "LEVIR-CD+",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 4,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "bifa",
44
+ "loss": "ce_dice"
45
+ },
46
+ "train": {
47
+ "n_epoch": 200,
48
+ "train_print_iter": 50,
49
+ "val_freq": 1,
50
+ "val_print_iter": 20,
51
+ "optimizer": {
52
+ "type": "adam",
53
+ "lr": 0.0001
54
+ },
55
+ "sheduler": {
56
+ "lr_policy": "linear",
57
+ "n_step": 3,
58
+ "gamma": 0.1
59
+ }
60
+ }
61
+ }
generated_configs/levir_cd__cdmamba.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "levir_cd-train-cdmamba",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "LEVIR-CD+",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 1,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "LEVIR-CD+",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 1,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "LEVIR-CD+",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 1,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "cdmamba",
44
+ "loss": "ce_dice",
45
+ "init_filters": 16,
46
+ "n_classes": 2,
47
+ "mode": "AGLGF",
48
+ "conv_mode": "orignal_dinner",
49
+ "local_query_model": "orignal_dinner",
50
+ "up_mode": "SRCM",
51
+ "up_conv_mode": "deepwise",
52
+ "spatial_dims": 2,
53
+ "in_channels": 3,
54
+ "resdiual": false,
55
+ "blocks_down": [
56
+ 1,
57
+ 2,
58
+ 2,
59
+ 4
60
+ ],
61
+ "blocks_up": [
62
+ 1,
63
+ 1,
64
+ 1
65
+ ],
66
+ "diff_abs": "later",
67
+ "stage": 2,
68
+ "mamba_act": "relu",
69
+ "norm": [
70
+ "GROUP",
71
+ {
72
+ "num_groups": 8
73
+ }
74
+ ]
75
+ },
76
+ "train": {
77
+ "n_epoch": 200,
78
+ "train_print_iter": 50,
79
+ "val_freq": 1,
80
+ "val_print_iter": 20,
81
+ "optimizer": {
82
+ "type": "adam",
83
+ "lr": 0.0001
84
+ },
85
+ "sheduler": {
86
+ "lr_policy": "linear",
87
+ "n_step": 3,
88
+ "gamma": 0.1
89
+ }
90
+ }
91
+ }
generated_configs/levir_cd__changer_opencd.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = '/new-home/buddhiw/CD-Models/model_repos/open-cd/configs/changer/changer_ex_r18_512x512_40k_levircd.py'
2
+
3
+ dataset_type = 'DSIFN_Dataset'
4
+ data_root = r'/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/opencd'
5
+ crop_size = (256, 256)
6
+
7
+ train_dataloader = dict(
8
+ batch_size=8,
9
+ num_workers=4,
10
+ dataset=dict(
11
+ type=dataset_type,
12
+ data_root=data_root,
13
+ data_prefix=dict(seg_map_path='train/label', img_path_from='train/A', img_path_to='train/B')))
14
+ val_dataloader = dict(
15
+ dataset=dict(
16
+ type=dataset_type,
17
+ data_root=data_root,
18
+ data_prefix=dict(seg_map_path='val/label', img_path_from='val/A', img_path_to='val/B')))
19
+ test_dataloader = dict(
20
+ dataset=dict(
21
+ type=dataset_type,
22
+ data_root=data_root,
23
+ data_prefix=dict(seg_map_path='test/label', img_path_from='test/A', img_path_to='test/B')))
24
+
25
+ train_cfg = dict(type='IterBasedTrainLoop', max_iters=204000, val_interval=1020)
26
+ work_dir = r'/new-home/buddhiw/CD-Models/results/changer/levir_cd/work_dir'
generated_configs/levir_cd__hanet_metadata.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "patch_size": 256,
3
+ "augmentation": true,
4
+ "num_gpus": 1,
5
+ "num_workers": 4,
6
+ "num_channel": 3,
7
+ "EF": false,
8
+ "epochs": 200,
9
+ "epochs_threshold": 15,
10
+ "gamma": 0.5,
11
+ "weight_decay": 0.0001,
12
+ "batch_size": 8,
13
+ "learning_rate": 0.0001,
14
+ "loss_function": "hybrid",
15
+ "dataset_dir": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd/hanet_matched/",
16
+ "weight_dir": "/new-home/buddhiw/CD-Models/results/hanet/levir_cd/weights/",
17
+ "Output_dir": "/new-home/buddhiw/CD-Models/results/hanet/levir_cd/outputs/",
18
+ "log_dir": "/new-home/buddhiw/CD-Models/results/hanet/levir_cd/logs"
19
+ }
generated_configs/levir_cd_test_as_val__bifa.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "levir_cd_test_as_val-train-bifa",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "LEVIR-CD+",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 4,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "LEVIR-CD+",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 4,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "LEVIR-CD+",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 4,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "bifa",
44
+ "loss": "ce_dice"
45
+ },
46
+ "train": {
47
+ "n_epoch": 200,
48
+ "train_print_iter": 50,
49
+ "val_freq": 1,
50
+ "val_print_iter": 20,
51
+ "optimizer": {
52
+ "type": "adam",
53
+ "lr": 0.0001
54
+ },
55
+ "sheduler": {
56
+ "lr_policy": "linear",
57
+ "n_step": 3,
58
+ "gamma": 0.1
59
+ }
60
+ }
61
+ }
generated_configs/levir_cd_test_as_val__cdmamba.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "levir_cd_test_as_val-train-cdmamba",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "LEVIR-CD+",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 1,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "LEVIR-CD+",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 1,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "LEVIR-CD+",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 1,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "cdmamba",
44
+ "loss": "ce_dice",
45
+ "init_filters": 16,
46
+ "n_classes": 2,
47
+ "mode": "AGLGF",
48
+ "conv_mode": "orignal_dinner",
49
+ "local_query_model": "orignal_dinner",
50
+ "up_mode": "SRCM",
51
+ "up_conv_mode": "deepwise",
52
+ "spatial_dims": 2,
53
+ "in_channels": 3,
54
+ "resdiual": false,
55
+ "blocks_down": [
56
+ 1,
57
+ 2,
58
+ 2,
59
+ 4
60
+ ],
61
+ "blocks_up": [
62
+ 1,
63
+ 1,
64
+ 1
65
+ ],
66
+ "diff_abs": "later",
67
+ "stage": 2,
68
+ "mamba_act": "relu",
69
+ "norm": [
70
+ "GROUP",
71
+ {
72
+ "num_groups": 8
73
+ }
74
+ ]
75
+ },
76
+ "train": {
77
+ "n_epoch": 200,
78
+ "train_print_iter": 50,
79
+ "val_freq": 1,
80
+ "val_print_iter": 20,
81
+ "optimizer": {
82
+ "type": "adam",
83
+ "lr": 0.0001
84
+ },
85
+ "sheduler": {
86
+ "lr_policy": "linear",
87
+ "n_step": 3,
88
+ "gamma": 0.1
89
+ }
90
+ }
91
+ }
generated_configs/levir_cd_test_as_val__changer_opencd.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ _base_ = '/new-home/buddhiw/CD-Models/model_repos/open-cd/configs/changer/changer_ex_r18_512x512_40k_levircd.py'
2
+
3
+ dataset_type = 'DSIFN_Dataset'
4
+ data_root = r'/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/opencd'
5
+ crop_size = (256, 256)
6
+
7
+ train_dataloader = dict(
8
+ batch_size=8,
9
+ num_workers=4,
10
+ dataset=dict(
11
+ type=dataset_type,
12
+ data_root=data_root,
13
+ data_prefix=dict(seg_map_path='train/label', img_path_from='train/A', img_path_to='train/B')))
14
+ val_dataloader = dict(
15
+ dataset=dict(
16
+ type=dataset_type,
17
+ data_root=data_root,
18
+ data_prefix=dict(seg_map_path='val/label', img_path_from='val/A', img_path_to='val/B')))
19
+ test_dataloader = dict(
20
+ dataset=dict(
21
+ type=dataset_type,
22
+ data_root=data_root,
23
+ data_prefix=dict(seg_map_path='test/label', img_path_from='test/A', img_path_to='test/B')))
24
+
25
+ train_cfg = dict(type='IterBasedTrainLoop', max_iters=254800, val_interval=1274)
26
+ work_dir = r'/new-home/buddhiw/CD-Models/results/changer/levir_cd_test_as_val/work_dir'
generated_configs/levir_cd_test_as_val__hanet_metadata.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "patch_size": 256,
3
+ "augmentation": true,
4
+ "num_gpus": 1,
5
+ "num_workers": 4,
6
+ "num_channel": 3,
7
+ "EF": false,
8
+ "epochs": 200,
9
+ "epochs_threshold": 15,
10
+ "gamma": 0.5,
11
+ "weight_decay": 0.0001,
12
+ "batch_size": 8,
13
+ "learning_rate": 0.0001,
14
+ "loss_function": "hybrid",
15
+ "dataset_dir": "/new-home/buddhiw/CD-Models/generated_dataset_views/levir_cd_test_as_val/hanet_matched/",
16
+ "weight_dir": "/new-home/buddhiw/CD-Models/results/hanet/levir_cd_test_as_val/weights/",
17
+ "Output_dir": "/new-home/buddhiw/CD-Models/results/hanet/levir_cd_test_as_val/outputs/",
18
+ "log_dir": "/new-home/buddhiw/CD-Models/results/hanet/levir_cd_test_as_val/logs"
19
+ }
generated_configs/sysu_cd__bifa.json ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "sysu_cd-train-bifa",
3
+ "phase": "train",
4
+ "gpu_ids": [
5
+ 0
6
+ ],
7
+ "path_cd": {
8
+ "log": "logs",
9
+ "result": "results",
10
+ "checkpoint": "checkpoint",
11
+ "resume_state": null
12
+ },
13
+ "datasets": {
14
+ "train": {
15
+ "name": "SYSU-CD",
16
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/sysu_cd/legacy_list",
17
+ "resolution": 256,
18
+ "num_workers": 4,
19
+ "batch_size": 8,
20
+ "use_shuffle": true,
21
+ "data_len": -1
22
+ },
23
+ "val": {
24
+ "name": "SYSU-CD",
25
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/sysu_cd/legacy_list",
26
+ "resolution": 256,
27
+ "num_workers": 4,
28
+ "batch_size": 8,
29
+ "use_shuffle": false,
30
+ "data_len": -1
31
+ },
32
+ "test": {
33
+ "name": "SYSU-CD",
34
+ "datasetroot": "/new-home/buddhiw/CD-Models/generated_dataset_views/sysu_cd/legacy_list",
35
+ "resolution": 256,
36
+ "num_workers": 4,
37
+ "batch_size": 8,
38
+ "use_shuffle": false,
39
+ "data_len": -1
40
+ }
41
+ },
42
+ "model": {
43
+ "name": "bifa",
44
+ "loss": "ce_dice"
45
+ },
46
+ "train": {
47
+ "n_epoch": 200,
48
+ "train_print_iter": 50,
49
+ "val_freq": 1,
50
+ "val_print_iter": 20,
51
+ "optimizer": {
52
+ "type": "adam",
53
+ "lr": 0.0001
54
+ },
55
+ "sheduler": {
56
+ "lr_policy": "linear",
57
+ "n_step": 3,
58
+ "gamma": 0.1
59
+ }
60
+ }
61
+ }