Skip to content

Code for "Combining SAM with Limited Data for Change Detection in Remote Sensing".

Notifications You must be signed in to change notification settings

zhangda1018/Meta-CD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meta-CD

Pytorch codes of Combining SAM with Limited Data for Change Detection in Remote Sensing [paper]

alt text

How to Use (Following SAM-CD)

  1. Installation

  2. Dataset preparation.

    • Please split the data into training, validation and test sets and organize them as follows:
      YOUR_DATA_DIR
      ├── ...
      ├── train
      │   ├── A
      │   ├── B
      │   ├── label
      ├── val
      │   ├── A
      │   ├── B
      │   ├── label
      ├── test
      │   ├── A
      │   ├── B
      │   ├── label
  • Find change line 13 in datasets/Levir_CD.py (or other data-loading .py files), change /YOUR_DATA_ROOT/ to your local dataset directory.
  1. Training

    classic CD training: python train_CD.py

    training CD with the proposed task-agnostic semantic learning: python train_SAM_CD.py

    line 16-45 are the major training args, which can be changed to load different datasets, models and adjust the training settings.

  2. Inference and evaluation

    inference on test sets: set the chkpt_path and run

    python pred_CD.py

    evaluation of accuracy: set the prediction dir and GT dir, and run

    python eval_CD.py

Dataset Download

In the following, we summarize links to some frequently used CD datasets:

Acknowledgement

Our code is based on SAM-CD.

Cite Meta-CD

If you find this work useful or interesting, please consider citing the following BibTeX entry.

@article{gao2025combining,
  title={Combining SAM With Limited Data for Change Detection in Remote Sensing},
  author={Gao, Junyu and Zhang, Da and Wang, Feiyu and Ning, Lichen and Zhao, Zhiyuan and Li, Xuelong},
  journal={IEEE Transactions on Geoscience and Remote Sensing},
  year={2025},
  publisher={IEEE}
}

About

Code for "Combining SAM with Limited Data for Change Detection in Remote Sensing".

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages