Code Monkey home page Code Monkey logo

group-aware-hierarchical-transformer's Introduction

Group-Aware-Hierarchical-Transformer

This repository is the official implementation for our IEEE TGRS 2022 paper:

Hyperspectral image classification using group-aware hierarchical transformer

Last update: November 29, 2022

Requirements

python == 3.7.9, cuda == 11.1, and packages in requirements.txt

Datasets

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

Codes for Training and Validation

Train our proposed GAHT using train-val-test split ratios in the paper:

For the SA/PU/WHU-LK Dataset:

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

For the HRL Dataset:

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

Evaluate the Model

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

Other Supported SOTA Methods:

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

Citation

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}}

Acknowledgement

Some of our codes references to the following projects, and we are thankful for their great work:

group-aware-hierarchical-transformer's People

Contributors

meishaohui avatar psychao 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

Watchers

 avatar  avatar

group-aware-hierarchical-transformer's Issues

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.