Skip to content

thislzm/SA-CD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

SA-CD: Towards Advanced Change Detection: A Semantic-Aware Approach Inspired by Human Cognition (Code will be released soon)

To train change detection models, researchers commonly use bi-temporal images captured at different times of the same region as input, and employ corresponding change maps as training supervision signals. However, existing change detection methods primarily rely on pixel-aware change maps between bi-temporal images as constraints, deviating from human visual paradigm that emphasizes semantic understanding prior to change detection. This limitation undermines ability of model to perform effective change detection in the presence of pixel-level disturbances such as noise and illumination variations. We hypothesize that this stems from the model's lack of semantic awareness. To this end, we propose a change detection framework named Semantic-Aware Change Detection (SA-CD). Specifically, a Single-temporal Semantic Learning Pretraining (SSLP) strategy is introduced to enable the model to learn deep semantic feature representations and target change patterns from large-scale single-temporal remote sensing semantic segmentation data. Furthermore, we proposed a novel Semantic-Aware Change Detection Network (SANet), which design two distinct decoders at both pixel-difference and object-semantic levels, enabling precise decoding of target changes from global structures to fine textures, thereby enhancing overall accuracy in change detection.

Contributors Forks Stargazers Issues MIT License


Logo

Motivation of our paper

Logo

Logo

Towards Advanced Change Detection: A Semantic-Aware Approach Inspired by Human Cognition
Exploring the documentation for SA-CD »

Check Demo · Report Bug · Pull Request

Filetree

SA-CD
├── checkpoints
│   ├── SANet
│   │   ├── LEVIR
│   │   │   ├── no_pretrain.pth
│   │   │   └── with_pretrain.pth
│   │   ├── LEVIR+
│   │   │   ├── no_pretrain.pth
│   │   │   └── with_pretrain.pth
│   │   ├── S2Looking
│   │   │   ├── no_pretrain.pth
│   │   │   └── with_pretrain.pth
│   │   ├── WHU
│   │   │   ├── no_pretrain.pth
│   │   │   └── with_pretrain.pth
│   │   └── WHU_CUL
│   │       ├── no_pretrain.pth
│   │       └── with_pretrain.pth
│   └── pre_train
│       ├── Building
│       │   └── pretrain_Building.pth
│       └── Cultivalted land
│           └── pretrain_cultivalted.pth
├── datasets
│   ├── Levir_CD.py
│   ├── Levir_CD2.py
│   ├── data_utils.py
│   ├── data_utils2.py
│   ├── pre_CD.py
│   ├── pre_CD2.py
│   └── pre_CD3.py
├── fastsam_model
│   ├── FastSAM-s.pt
│   └── FastSAM-x.pt
├── models
│   ├── FastSAM
│   ├── SAM_Fusion2.py
│   └── preSAM_SNUNet4.py
├── pretrain.py
├── train.py
├── eval.py
├── ultralytics
└── utils
    ├── __init__.py
    ├── crf.py
    ├── data_vis.py
    ├── eval.py
    ├── load.py
    ├── loss.py
    ├── metric_tool.py
    ├── metrics.py
    ├── misc.py
    ├── transform.py
    └── utils.py

Contents

  1. Dataset Formats
  2. Pretrained Weights and Datasets
  3. Model Loading Instructions
  4. Pretraining Phase Instructions
  5. Fine-Tuning Phase Instructions
  6. Performance Metrics on Public Change Detection Datasets
  7. Visualization Results

Dataset Formats

Pretraining Phase: Semantic Segmentation Dataset Format

  • Structure:
    • data_name: Input images
    • A: Semantic segmentation input image
    • Label: Corresponding segmentation labels

Fine-Tuning Phase: Change Detection Dataset Format

  • Structure:
    • data_name
      • train
        • A: Image at time T1
        • B: Image at time T2
        • label: Ground truth change map
      • val
        • A, B, label: Validation dataset
      • test
        • A, B, label: Test dataset

Pretrained Weights and Datasets

Download Link of Pretrained weights

Download Link of Change Detection Datasets

Download Link of Semantic Segmentation Datasets


Model Loading Instructions

  • Update the FastSAM model path in the following scripts:
    • /models/preSAM_SUNNet4.py: Line 235
    • /models/SAM_Fusion2.py: Line 160

Pretraining Phase Instructions

Loading Pretraining Datasets

  1. Single Dataset:

    Modify the dataset path in /datasets/pre_CD.py at line 16:

    root = "<path_to_pretraining_dataset>"
  2. Two Datasets:

    Modify the paths in /datasets/pre_CD2.py at line 16:

    root1 = "<path_to_first_dataset>"
    root2 = "<path_to_second_dataset>"
  3. Three Datasets:

    Modify the paths in /datasets/pre_CD3.py at line 16:

    root1 = "<path_to_first_dataset>"
    root2 = "<path_to_second_dataset>"
    root3 = "<path_to_third_dataset>"

Saving Pretrained Models

Update the model save directory in /pretrain.py:

  • Line 19 and Line 22.

Fine-Tuning Phase Instructions

Loading Datasets

Update the dataset path in /datasets/Levir_CD.py at line 16:

root = "<path_to_dataset>"

Training

  • Configure the following parameters in /train.py:
  • Model save path: Line 19 and Line 22.
  • Pretrained model loading: Line 30, load_premodel.
  • Pretrained model path: Line 42, chkpt_path.

Validation

  • Configure the following parameters in /eval.py:
  • Model save path: Line 19 and Line 22.
  • Model name for validation: Line 38, chkpt_path.

Performance Metrics on Public Change Detection Datasets

The performance of the proposed method is evaluated with and without pretraining on multiple public datasets. Results are presented in terms of Precision (P), Recall (R), and F1-Score (F1).

Datasets Methods P(%) R(%) F1(%)
LEVIR SA - CD w/o pretrain 92.69 89.66 91.15
SA - CD w/ pretrain 91.77 91.28 91.53
LEVIR + SA - CD w/o pretrain 86.88 79.15 82.83
SA - CD w/ pretrain 85.55 83.44 84.43
S2Looking SA - CD w/o pretrain 81.25 54.73 65.40
SA - CD w/ pretrain 81.28 56.24 66.48
WHU SA - CD w/o pretrain 94.66 91.22 92.91
SA - CD w/ pretrain 95.29 93.67 94.47
WHU Cultivate Land SA - CD w/o pretrain 72.65 73.93 73.28
SA - CD w/ pretrain 77.74 72.82 75.20

Visualization Results

Visual Results on LEVIR Datasets

Visual Results on LEVIR+ Datasets

Visual Results on S2Looking Datasets

Visual Results on WHU Datasets

Visual Results on WHU Cultivate Land Datasets

About

No description, website, or topics provided.

Resources

License

Stars

5 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors