Home

Awesome

<div align="center"> <h2> CDMamba: Remote Sensing Image Change Detection with Mamba </h2> </div> <br> <div align="center"> <img src="resources/CDMamba.png" width="800"/> </div> <br> <div align="center"> &nbsp;&nbsp;&nbsp;&nbsp; <a href="https://arxiv.org/abs/2406.04207"> <span style="font-size: 20px; ">arXiv</span> </a> &nbsp;&nbsp;&nbsp;&nbsp; <a href="resources/CDMamba.pdf"> <span style="font-size: 20px; ">PDF</span> </a> &nbsp;&nbsp;&nbsp;&nbsp; </div> <br> <br>

GitHub stars license arXiv

<br> <br>

Introduction

This repository is the code implementation of the paper CDMamba: Remote Sensing Image Change Detection with Mamba

The current branch has been tested on Linux system, PyTorch 2.1.0 and CUDA 12.1, supports Python 3.10.

If you find this project helpful, please give us a star ⭐️, your support is our greatest motivation.

Updates

🌟 2024.06.20 Released the CDMamba project.

Benchmark

Change detection methods supported by the repository

TODO

Table of Contents

Installation

Requirements

Environment Installation

It is recommended to use Miniconda for installation. The following commands will create a virtual environment named cd_mamba and install PyTorch. In the following installation steps, the default installed CUDA version is 12.1. If your CUDA version is not 12.1, please modify it according to the actual situation.

Note: If you are experienced with PyTorch and have already installed it, you can skip to the next section. Otherwise, you can follow the steps below.

<details open>

Step 0: Install Miniconda.

Step 1: Create a virtual environment named cd_mamba and activate it.

conda create -n cd_mamba python=3.10
conda activate cd_mamba

Step 2: Install dependencies.

pip install -r requirements.txt

Note: Please refer to https://github.com/hustvl/Vim or https://blog.csdn.net/weixin_45667052/article/details/136311600 when installing mamba.

</details>

Install CDMamba

You can download or clone the CDMamba repository.

git clone git@github.com:zmoka-zht/CDMamba.git
cd CDMamba

Dataset Preparation

Remote Sensing Change Detection Dataset

We provide the method of preparing the remote sensing change detection dataset used in the paper.

WHU-CD Dataset

LEVIR-CD Dataset

LEVIR+-CD Dataset

Organization Method

You can also choose other sources to download the data, but you need to organize the dataset in the following format:

${DATASET_ROOT} # Dataset root directory, for example: /home/username/data/LEVIR-CD
β”œβ”€β”€ A
β”‚   β”œβ”€β”€ train_1_1.png
β”‚   β”œβ”€β”€ train_1_2.png
β”‚   β”œβ”€β”€...
β”‚   β”œβ”€β”€ val_1_1.png
β”‚   β”œβ”€β”€ val_1_2.png
β”‚   β”œβ”€β”€...
β”‚   β”œβ”€β”€ test_1_1.png
β”‚   β”œβ”€β”€ test_1_2.png
β”‚   └── ...
β”œβ”€β”€ B
β”‚   β”œβ”€β”€ train_1_1.png
β”‚   β”œβ”€β”€ train_1_2.png
β”‚   β”œβ”€β”€...
β”‚   β”œβ”€β”€ val_1_1.png
β”‚   β”œβ”€β”€ val_1_2.png
β”‚   β”œβ”€β”€...
β”‚   β”œβ”€β”€ test_1_1.png
β”‚   β”œβ”€β”€ test_1_2.png
β”‚   └── ...
β”œβ”€β”€ label
β”‚   β”œβ”€β”€ train_1_1.png
β”‚   β”œβ”€β”€ train_1_2.png
β”‚   β”œβ”€β”€...
β”‚   β”œβ”€β”€ val_1_1.png
β”‚   β”œβ”€β”€ val_1_2.png
β”‚   β”œβ”€β”€...
β”‚   β”œβ”€β”€ test_1_1.png
β”‚   β”œβ”€β”€ test_1_2.png
β”‚   └── ...
β”œβ”€β”€ list
β”‚   β”œβ”€β”€ train.txt
β”‚   β”œβ”€β”€ val.txt
β”‚   └── test.txt

Model Training and Testing

All configuration for model training and testing are stored in the local folder config

Example of Training on LEVIR-CD Dataset

python train.py --config/mamba/levir_cdmamba.json 

Example of Testing on LEVIR-CD Dataset

python test.py --config/mamba/levir_test_cdmamba.json 

CDMamba Weight

Data download link: Weight PanBaiDu. Code:ckpt

Citation

If you use the code or performance benchmarks of this project in your research, please refer to the following bibtex citation of CDMamba.

@article{zhang2024cdmamba,
  title={CDMamba: Remote Sensing Image Change Detection with Mamba},
  author={Zhang, Haotian and Chen, Keyan and Liu, Chenyang and Chen, Hao and Zou, Zhengxia and Shi, Zhenwei},
  journal={arXiv preprint arXiv:2406.04207},
  year={2024}
}

License

This project is licensed under the Apache 2.0 License.

Contact Us

If you have any other questions❓, please contact us in time πŸ‘¬