GithubHelp home page GithubHelp logo

egctnet_pytorch's Introduction

EGCTNet: Building Change Detection based on an Edge-Guided Convolutional Neural Network combined with Transformer

(Posted in Remote Sensing)

Here, we provide the pytorch implementation of the paper: Building Change Detection based on an Edge-Guided Convolutional Neural Network combined with Transformer.

For more information, please see our paper at arxiv.

Network Architecture

![image-20210228153142126](./images/Figure 1.jpg)

Quantitative & Qualitative Results on LEVIR-CD and WHU-CD

LEVIR-CD ![image-20210228153142126](./images/Figure 9.jpg) WHU-CD ![image-20210228153142126](./images/Figure 10.jpg)

Requirements

Python 3.8.0
pytorch 1.10.1
torchvision 0.11.2
einops  0.3.2

Please see requirements.txt for all the other requirements.

Train on LEVIR-CD

You can run the script file by main_cd.py in the command environment.

Evaluate on LEVIR

You can run the script file by eval_cd.py in the command environment.

Dataset Preparation

Data structure

"""
Change detection data set with pixel-level binary labels;
├─A
├─B
├─label
├─label_edge
└─list
"""

A: images of t1 phase;

B:images of t2 phase;

label: label maps;

label_edge: using the Canny edge detection operator on theusing the Canny edge detection operator on the label maps;

list: contains train.txt, val.txt and test.txt, each file records the image names (XXX.png) in the change detection dataset.

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

License

Code is released for non-commercial and research purposes only. For commercial purposes, please contact the authors.

Citation

If you use this code for your research, please cite our paper:

MDPI and ACS Style
Xia, L.; Chen, J.; Luo, J.; Zhang, J.; Yang, D.; Shen, Z. Building Change Detection Based on an Edge-Guided Convolutional Neural Network Combined with a Transformer. Remote Sens. 2022, 14, 4524. https://doi.org/10.3390/rs14184524

AMA Style
Xia L, Chen J, Luo J, Zhang J, Yang D, Shen Z. Building Change Detection Based on an Edge-Guided Convolutional Neural Network Combined with a Transformer. Remote Sensing. 2022; 14(18):4524. https://doi.org/10.3390/rs14184524

Chicago/Turabian Style
Xia, Liegang, Jun Chen, Jiancheng Luo, Junxia Zhang, Dezhi Yang, and Zhanfeng Shen. 2022. "Building Change Detection Based on an Edge-Guided Convolutional Neural Network Combined with a Transformer" Remote Sensing 14, no. 18: 4524. https://doi.org/10.3390/rs14184524

References

Appreciate the work from the following repositories:

egctnet_pytorch's People

Contributors

chen11221 avatar

Stargazers

 avatar  avatar  avatar alex bao avatar rsdljm avatar ChaiLanKang avatar Peter Jackson avatar  avatar  avatar  avatar  avatar Robin Cole avatar

Watchers

 avatar

egctnet_pytorch's Issues

调试main_cd.py中出现ValueError: size shape must match input shape. Input is 2D, size is 4

作者您好,您的论文和代码工作相当出色,当我在调试代码过程中遇到了问题,需要您的指点,希望您能回复我的问题,非常感谢
Traceback (most recent call last):
File "/home/huangbo/CD_Code/2022-RS-EGCTNet/EGCTNet_pytorch-main/main_cd.py", line 83, in
train(args)
File "/home/huangbo/CD_Code/2022-RS-EGCTNet/EGCTNet_pytorch-main/main_cd.py", line 14, in train
model.train_models()
File "/home/huangbo/CD_Code/2022-RS-EGCTNet/EGCTNet_pytorch-main/models/trainer.py", line 342, in train_models
self._backward_G()
File "/home/huangbo/CD_Code/2022-RS-EGCTNet/EGCTNet_pytorch-main/models/trainer.py", line 315, in _backward_G
self.G_loss = self._pxl_loss(self.G_pred[-1], gt, self.G_pred[-2], gt_edge)
File "/home/huangbo/anaconda3/envs/pytorch1.8/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/huangbo/CD_Code/2022-RS-EGCTNet/EGCTNet_pytorch-main/models/losses.py", line 278, in forward
loss_c = cross_entropy(inputs, target)
File "/home/huangbo/CD_Code/2022-RS-EGCTNet/EGCTNet_pytorch-main/models/losses.py", line 19, in cross_entropy
input = F.interpolate(input, size=target.shape[1:], mode='bilinear',align_corners=True)
File "/home/huangbo/anaconda3/envs/pytorch1.8/lib/python3.8/site-packages/torch/nn/functional.py", line 3472, in interpolate
raise ValueError(
ValueError: size shape must match input shape. Input is 2D, size is 4

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.