Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
qiyaowu 8d04df76b0 | 10 months ago | |
---|---|---|
.idea | 1 year ago | |
__pycache__ | 1 year ago | |
checkpoints/cnn3d/sa | 1 year ago | |
models | 1 year ago | |
utils | 10 months ago | |
README.md | 1 year ago | |
eval.py | 10 months ago | |
main.py | 10 months ago | |
requirements.txt | 1 year ago | |
train.py | 1 year ago |
This repository is the official implementation for our IEEE TGRS 2022 paper:
Hyperspectral image classification using group-aware hierarchical transformer
Last update: September 20, 2022
python == 3.7.9, cuda == 11.1, and packages in requirements.txt
Download following datasets:
Then organize these datasets like:
datasets/
hrl/
Loukia_GT.tif
Loukia.tif
pu/
PaviaU_gt.mat
PaviaU.mat
sa/
Salinas_corrected.mat
Salinas_gt.mat
whulk/
WHU_Hi_LongKou_gt.mat
WHU_Hi_LongKou.mat
Train our proposed GAHT using train-val-test split ratios in the paper:
python main.py --model proposed --dataset_name sa --epoch 300 --bs 64 --device 0 --ratio 0.02
python main.py --model proposed --dataset_name pu --epoch 300 --bs 64 --device 0 --ratio 0.02
python main.py --model proposed --dataset_name whulk --epoch 300 --bs 64 --device 0 --ratio 0.01
Transform the format of HRL dataset first:
python utils/tif2mat.py
Then train the model like other datasets:
python main.py --model proposed --dataset_name hrl --epoch 300 --bs 64 --device 0 --ratio 0.06
python eval.py --model proposed --dataset_name sa --device 0 --weights ./checkpoints/proposed/sa/0
python eval.py --model proposed --dataset_name pu --device 0 --weights ./checkpoints/proposed/pu/0
python eval.py --model proposed --dataset_name whulk --device 0 --weights ./checkpoints/proposed/whulk/0
python eval.py --model proposed --dataset_name hrl --device 0 --weights ./checkpoints/proposed/hrl/0
Method | Abbr. | Parameter | Paper |
---|---|---|---|
multi-scale3D deep convolutional neural network | M3D-DCNN | --model m3ddcnn | here |
CNN-based 3D deep learning approach | 3D-CNN | --model cnn3d | here |
deep feature fusion network | DFFN | --model dffn | here |
residual spectral-spatial attention network | RSSAN | --model rssan | here |
attention-based bidirectional long short-term memory network | AB-LSTM | --model ablstm | here |
transformer-based backbone network | SF | --model speformer | here |
spectral–spatial feature tokenization transformer | SSFTT | --model ssftt | here |
Please cite our paper if our work is helpful for your research.
@article{gaht,
title={Hyperspectral image classification using group-aware hierarchical transformer},
author={Mei, Shaohui and Song, Chao and Ma, Mingyang and Xu, Fulin},
journal={IEEE Trans. Geosci. Remote Sens.},
year={2022},
volume={60},
pages={1-14},
doi={10.1109/TGRS.2022.3207933}}
Some of our codes references to the following projects, and we are thankful for their great work:
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》