Giter Site home page Giter Site logo

saras-net's Introduction

SARAS-Net: Scale And Relation Aware Siamese Network for Change Detection

PWC

PWC

PWC

Target: Change detection aims to find the difference between two images at different times and output a change map.

#f03c15 This paper has been accepted in AAAI-23.

For more information, please see our paper at AAAI or arxiv.

Overview of SARAS-Net: image

Visualize each module by Gradcam:
image

Requirements

cuda: 11.0  
python: 3.6.9  
pytorch: 1.7.0  
torchvision: 0.8.1 

Installation

git clone https://github.com/f64051041/SARAS-Net.git  
cd SARAS-Net  

Quick start

Download LEVIR-CD weight : https://drive.google.com/file/d/1Gs6iYQcZI1Jm4NhthCwWI2olbO-bpvTd/view?usp=share_link
After downloaded the model weight, you can put it in SARAS-Net/.
Then, run a demo to get started as follows:

python demo.py

After that, you can find the prediction results in SARAS-Net/samples/

Cover

Train

You can find SARAS-Net/cfgs/config.py to set the training parameter.

python train.py

Test

After training, you can put weight in SARAS-Net/.
Then, run a cal_acc.py to get started as follows:

python cal_acc.py

You can set show_result = True in cal_acc.py to show the result for each pairs.

Cover

Data structure

Train Data Path

train_dataset  
  |- train_dataset 
      |- image1, image2, gt  
  |- val_dataset  
      |- image1, image2, gt  
  |- train.txt
  |- val.txt

The format of train.txt and val.txt please refer to SARAS-Net/train_dataset/train.txt and SARAS-Net/train_dataset/val.txt

Test Data Path

test_dataset  
  |- A 
      |- image1 
  |- B  
      |- image2 
  |- label
      |- gt 

Data Download

LEVIR-CD: https://justchenhao.github.io/LEVIR/

WHU-CD: https://study.rsgis.whu.edu.cn/pages/download/building_dataset.html

DSIFN-CD: https://github.com/GeoZcx/A-deeply-supervised-image-fusion-network-for-change-detection-in-remote-sensing-images/tree/master/dataset

Quick train on LEVIR-CD : https://drive.google.com/file/d/1DAlxuqalNIPopt-WgtDmCYO98_jWM3ER/view?usp=share_link

Quick test on LEVIR-CD : https://drive.google.com/file/d/1Bj5GQ3hZcDVSpFGZKxm7zIuCBP5XEr6x/view?usp=share_link

Result

Dataset Pre. Rec. F1-score IoU OA
LEVIR-CD 91.97% 91.85% 91.91% 84.95% 99.10%
CCD-CD 97.76% 97.23% 97.49% 95.11% 99.35%
WHU-CD 88.41% 85.81% 87.09% 77.14% 98.89%
DSIFN-CD 67.65% 67.51% 67.58% 51.04% 89.01%

saras-net's People

Contributors

f64051041 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

saras-net's Issues

Why the count of parameters and flops differ from that shown in the paper?

image

Here are my codes.

model = Change_detection()
input1 = torch.rand((1, 3, 256, 256))
input2 = torch.rand((1, 3, 256, 256))
from fvcore.nn import FlopCountAnalysis, flop_count_table
model.eval()
flops = FlopCountAnalysis(model, (input1, input2))
print(flop_count_table(flops))

image

Thank you for help.

visualization by Gradcam

Thank you for open-sourcing the code, but I didn't find the code for visualization by Gradcam in the code, can you post it? thank you very much

BasePath、DataPath、SavePath meaning

hi, i change my own training dataset name, but i got error as follows:

AttributeError: 'Dataset' object has no attribute 'img_pth'

my setting is like this :

BASE_PATH ='/data/chengxi.han/Sigma122/SARAS-Net' (Project location )
DATA_PATH ='/data/chengxi.han/data/LEVIR-CD-Dataset256' (Data location )
SAVE_PATH ='/data/chengxi.han/Sigma122/SARAS-Net/Results/LEVIR' (Project location )

hope for your reply, many thanks.

關於多類別數據集的訓練和測試

你好作者,首先感謝您的貢獻。我想問一下這個模型可以訓練多類別的數據集嗎,不是只有change和unchange兩個類別,我將變化的類別分爲”從沙漠到河流“→1、”從沙漠到建築“→2,等等。用SARAS模型怎麽修改呢,期待您的回復

Weights of DSFIN dataset?

Hello,

Thank you for sharing your code.

Can you share the weights of the DSFIN dataset?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.