Skip to content

a Change Detection Framework for Remote Sensing Images via a Feature Interactive Bi-temporal Network

License

Notifications You must be signed in to change notification settings

TianWen580/FIBT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FIBTNet: Building Change Detection for Remote Sensing images Using Feature Interactive Bi-temporal Network


Results

Benchmark F1-Score Param (M) FLOPs (G) Config Weights
LEVIR-CD 91.96% 13.26 6.40 fibt_r18_512x512_40k_levircd_fdaf download
S2Looking 68.60% 13.26 6.40 fibt_r18_512x512_80k_s2looking_fdaf download

Usage

Dependencies

  • Linux or Windows
  • Python 3.7+, recommended 3.10
  • PyTorch 2.0 or higher, recommended 2.1
  • CUDA 11.7 or higher, recommended 12.1
  • MMCV 2.0 or higher, recommended 2.1

Environment Installation

We recommend using Miniconda for installation. The following command will create a virtual environment named ttp and install PyTorch and MMCV.

Note: If you have experience with PyTorch and have already installed it, you can skip to the next section. Otherwise, you can follow these steps to prepare.

conda create -n fibt python=3.10 -y
conda activate fibt

Then, install PyTorch on Linux/Windows:

pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121

Or

conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=12.1 -c pytorch -c nvidia

Requirements Installation

Install MMCV

pip install -U openmim
mim install mmcv==2.1.0

Install other dependencies.

pip install -U wandb einops importlib peft==0.8.2 scipy ftfy prettytable torchmetrics==1.3.1 transformers==4.38.1

Install FIBTNet

Download or clone the fibt repository.

git clone git@github.com:TianWen580/FIBT.git
cd FIBT

Dataset Preparation

Levir-CD Change Detection Dataset

Dataset Download

  • Image and label download address: Levir-CD.

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
├── train
│   ├── A
│   ├── B
│   └── label
├── val
│   ├── A
│   ├── B
│   └── label
└── test
    ├── A
    ├── B
    └── label

Note: In the project folder, we provide a folder named data, which contains an example of the organization method of the above dataset.

Other Datasets

If you want to use other datasets, you can refer to MMSegmentation documentation to prepare the datasets.

Model Training

FIBTNet Model

Config File and Main Parameter Parsing

We provide the configuration files of the FIBTNet model used in the paper, which can be found in the configs/fibt folder. The Config file is completely consistent with the API interface and usage of MMSegmentation. Below we provide an analysis of some of the main parameters. If you want to know more about the meaning of the parameters, you can refer to MMSegmentation documentation.

Single Card Training

python tools/train.py configs/fibt/xxx.py  # xxx.py is the configuration file you want to use

Multi-card Training

sh ./tools/dist_train.sh configs/fibt/xxx.py ${GPU_NUM}  # xxx.py is the configuration file you want to use, GPU_NUM is the number of GPUs used

Model Testing

Single Card Testing:

python tools/test.py configs/fibt/xxx.py ${CHECKPOINT_FILE}  # xxx.py is the configuration file you want to use, CHECKPOINT_FILE is the checkpoint file you want to use

Multi-card Testing:

sh ./tools/dist_test.sh configs/fibt/xxx.py ${CHECKPOINT_FILE} ${GPU_NUM}  # xxx.py is the configuration file you want to use, CHECKPOINT_FILE is the checkpoint file you want to use, GPU_NUM is the number of GPUs used

Note: If you need to get the visualization results, you can uncomment default_hooks-visualization in the Config file.

Image Prediction

Single Image Prediction:

todo...

Citation

If you find this project useful in your research, please consider cite:

License

FIBTNet is released under the Apache 2.0 license.

About

a Change Detection Framework for Remote Sensing Images via a Feature Interactive Bi-temporal Network

Resources

License

Stars

Watchers

Forks

Packages

No packages published