qichaoliu / Double-Branch-Dual-Attention-Mechanism-Network

This repository implementates 6 frameworks for hyperspectral image classification based on PyTorch and sklearn.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hyperspectral Image Classification

Apology: The crucial and lastest implements about the frameworks are on the laboratorial computer, which is located in Wuhan University. Since 2019-nCoV is raging in Wuhan now, we can't get access to the laboratory now. It exists certain diffierences between the lastest files and the uploaded files. But we will updata the code immediately when we could obtain the files.

This repository implementates 6 frameworks for hyperspectral image classification based on PyTorch and sklearn.

The detailed results can be seen in the Classification of Hyperspectral Image Based on Double-Branch Dual-Attention Mechanism Network.

Feel free to contact me if you need any further information: lironui@whu.edu.cn.

Some of our code references the projects

If our code is help to you, please cite Li R, Zheng S, Duan C, et al. Classification of Hyperspectral Image Based on Double-Branch Dual-Attention Mechanism Network[J]. Remote Sensing, 2020, 12(3): 582.

Requirements:

numpy >= 1.16.5
PyTorch >= 1.3.1
sklearn >= 0.20.4

Datasets:

You can download the hyperspectral datasets in mat format at: http://www.ehu.eus/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes, and move the files to ./datasets folder.

Usage:

  1. Set the percentage of training and validation samples by the load_dataset function in the file ./global_module/generate_pic.py.
  2. Taking the DBDA framework as an example, run ./DBDA/main.py and type the name of dataset.
  3. The classfication maps are obtained in ./DBDA/classification_maps folder, and accuracy result is generated in ./DBDA/records folder.

Network:

network
Figure 1. The structure of the DBDA network. The upper Spectral Branch composed of the dense spectral block and channel attention block is designed to capture spectral features. The lower Spatial Branch constituted by dense spatial block, and spatial attention block is designed to exploit spatial features.

Results:

IP Figure 2. Classification maps for the IP dataset using 3% training samples. (a) False-color image. (b) Ground-truth (GT). (c)–(h) The classification maps with disparate algorithms. UP Figure 3. Classification maps for the UP dataset using 0.5% training samples. (a) False-color image. (b) Ground-truth (GT). (c)–(h) The classification maps with disparate algorithms. SV Figure 4. Classification maps for the UP dataset using 0.5% training samples. (a) False-color image. (b) Ground-truth (GT). (c)–(h) The classification maps with disparate algorithms. BS Figure 5. Classification maps for the BS dataset using 1.2% training samples. (a) False-color image. (b) Ground-truth (GT). (c)–(h) The classification maps with disparate algorithms.

About

This repository implementates 6 frameworks for hyperspectral image classification based on PyTorch and sklearn.

License:GNU Affero General Public License v3.0


Languages

Language:Python 100.0%