Giter Site home page Giter Site logo

chenhongruixuan / srgcae Goto Github PK

View Code? Open in Web Editor NEW
32.0 3.0 0.0 2.46 MB

[IEEE TGRS 2022] Official Pytorch implementation for Unsupervised Multimodal Change Detection Based on Structural Relationship Graph Representation Learning

Python 100.00%
autoencoder change-detection graph-convolutional-networks multimodal-data remote-sensing unsupervised-learning structural-relationship

srgcae's Introduction

Unsupervised Multimodal Change Detection Based on Structural Relationship Graph Representation Learning

This is an official implementation of unsupervised multimodal change detection framework SR-GCAE in our IEEE TGRS 2022 paper: Unsupervised Multimodal Change Detection Based on Structural Relationship Graph Representation Learning.

Abstract

Unsupervised multimodal change detection is a practical and challenging topic that can play an important role in time-sensitive emergency applications. To address the challenge that multimodal remote sensing images cannot be directly compared due to their modal heterogeneity, we take advantage of two types of modality-independent structural relationships in multimodal images. In particular, we present a structural relationship graph representation learning framework for measuring the similarity of the two structural relationships. Firstly, structural graphs are generated from preprocessed multimodal image pairs by means of an object-based image analysis approach. Then, a structural relationship graph convolutional autoencoder (SR-GCAE) is proposed to learn robust and representative features from graphs. Two loss functions aiming at reconstructing vertex information and edge information are presented to make the learned representations applicable for structural relationship similarity measurement. Subsequently, the similarity levels of two structural relationships are calculated from learned graph representations and two difference images are generated based on the similarity levels. After obtaining the difference images, an adaptive fusion strategy is presented to fuse the two difference images. Finally, a morphological filtering-based postprocessing approach is employed to refine the detection results. Experimental results on six datasets with different modal combinations demonstrate the effectiveness of the proposed method.

Network architecture

Get started

Requirements

python==3.9.7
pytorch==1.9.0
scikit-learn==0.18.3
imageio=2.9.0
numpy==1.20.3
gdal==3.0.2
opencv==4.5.5

Dataset

This repo contains the Shuguang dataset. The homogeneous dataset, Hanyang dataset has been open-sourced. You can download it here. The Texas dataset can be downloaded from Prof. Michele Volpi's webpage.

Usage

Performing edge information reconstruction and detecting land-cover changes by utilizing local structural relationship

train_SRGCAE_Local.py

Performing vertex information reconstruction and detecting land-cover changes by utilizing nonlocal structural relationship

train_SRGCAE_Nonlocal.py

Adaptively fusing the difference maps

adaptive_fuse.py

Postprocessing based on morphological filtering

aux_func/postprocess.py

Citation

If this code or dataset contributes to your research, please consider citing our paper. We appreciate your support!🙂

@article{chen2022unsupervised,
  author={Chen, Hongruixuan and Yokoya, Naoto and Wu, Chen and Du, Bo},
  journal={IEEE Transactions on Geoscience and Remote Sensing}, 
  title={Unsupervised Multimodal Change Detection Based on Structural Relationship Graph Representation Learning}, 
  year={2022},
  volume={60},
  number={},
  pages={1-18},
  doi={10.1109/TGRS.2022.3229027}
}

Acknowledgement

The Python code draws in part on the Matlab code of NPSG and IRGMcS. Many thanks for these brilliant works!

Q & A

For any questions, please contact us.

srgcae's People

Contributors

chenhongruixuan 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

Watchers

 avatar  avatar  avatar

srgcae's Issues

about algorithm for image segmentation

Hello, I am unable to use your code to achieve the required results. I think this is because the code uses the SLIC algorithm for image segmentation, but the article mentions using the FNEA algorithm. Do you have the code for the FNEA algorithm? thank you very much. Wishing you all the best in your future research

Request for the author to re-share the source code

@ChenHongruixuan :

Hello,

I came across your recent paper where you mentioned that the source code was open-sourced. However, I was unable to find the actual source code in this GitHub repository. Have I missed something? Can you please re-share the source code with us?

Thank you for your time and consideration. I appreciate your work and look forward to hearing from you soon.

Best regards,
yedvvard

Runtimerror

Traceback (most recent call last):
File "/home/dww/OD/others/SRGCAE-master/train_SRGCAE_Local.py", line 153, in
train_model(args)
File "/home/dww/OD/others/SRGCAE-master/train_SRGCAE_Local.py", line 76, in train_model
feat_t1 = GCAE_model(node_t1, norm_adj_t1)
File "/home/dww/anaconda3/envs/detection/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/dww/OD/others/SRGCAE-master/model/SRGCAE.py", line 35, in forward
x = torch.sigmoid(self.gc1(x, adj))
File "/home/dww/anaconda3/envs/detection/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/dww/OD/others/SRGCAE-master/model/GraphConv.py", line 33, in forward
output = torch.mm(adj, support)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (358x358 and 0x16)

运行报错

ValueError: Found array with 0 sample(s) (shape=(0, 3)) while a minimum of 1 is required by check_pairwise_arrays.

感谢您的工作!
当我想训练train_SRGCAE_Local.py时,出现以下错误:

Traceback (most recent call last):
  File "/media/meng/57673667-4363-4453-89a5-a422016a5299/Meng_forked/code/change_detection/SRGCAE/train_SRGCAE_Local.py", line 150, in <module>
    train_model(args)
  File "/media/meng/57673667-4363-4453-89a5-a422016a5299/Meng_forked/code/change_detection/SRGCAE/train_SRGCAE_Local.py", line 51, in train_model
    am_set_t1 = construct_affinity_matrix(img_t1, objects, args.band_width_t1)
  File "/media/meng/57673667-4363-4453-89a5-a422016a5299/Meng_forked/code/change_detection/SRGCAE/aux_func/graph_func.py", line 26, in construct_affinity_matrix
    adj_mat = gaussian_kernel_distance(sub_object, band_width=band_width)
  File "/media/meng/57673667-4363-4453-89a5-a422016a5299/Meng_forked/code/change_detection/SRGCAE/aux_func/graph_func.py", line 6, in gaussian_kernel_distance
    euc_dis = pairwise_distances(vector)
  File "/home/meng/anaconda3/envs/torch1.11.0/lib/python3.8/site-packages/sklearn/metrics/pairwise.py", line 2195, in pairwise_distances
    return _parallel_pairwise(X, Y, func, n_jobs, **kwds)
  File "/home/meng/anaconda3/envs/torch1.11.0/lib/python3.8/site-packages/sklearn/metrics/pairwise.py", line 1765, in _parallel_pairwise
    return func(X, Y, **kwds)
  File "/home/meng/anaconda3/envs/torch1.11.0/lib/python3.8/site-packages/sklearn/metrics/pairwise.py", line 310, in euclidean_distances
    X, Y = check_pairwise_arrays(X, Y)
  File "/home/meng/anaconda3/envs/torch1.11.0/lib/python3.8/site-packages/sklearn/metrics/pairwise.py", line 156, in check_pairwise_arrays
    X = Y = check_array(
  File "/home/meng/anaconda3/envs/torch1.11.0/lib/python3.8/site-packages/sklearn/utils/validation.py", line 969, in check_array
    raise ValueError(
ValueError: Found array with 0 sample(s) (shape=(0, 3)) while a minimum of 1 is required by check_pairwise_arrays.

代码未做任何改动,使用的数据也是下载代码时附带的曙光数据集。请问为何会出现这个错误,该如何解决?谢谢。
我的环境:
python==3.8.13
pytorch==1.11.0
scikit-learn==1.3.0
imageio=2.31.1
numpy==1.23.1
gdal==3.6.2
opencv==4.8.0

效果不佳

你好,我用你的代码在曙光数据集上进行试验,效果远不如你的,我对比生成的差分图,在局部关系上差分图效果特别差,而且DI融合得到的结果比后处理后的结果要好,请问你在实验中调整什么参数了吗?

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.