DCN-T
DCN-T copied to clipboard
[TIP 2023] The official repo for the paper "DCN-T: Dual Context Network with Transformer for Hyperspectral Image Classification".
DCN-T: Dual Context Network with Transformer for Hyperspectral Image Classification (TIP 2023)
Di Wang, Jing Zhang, Bo Du, Liangpei Zhang and Dacheng Tao
Pytorch implementation of our paper for ImageNet Pretraining and Transformer-based image-level hyperspectral image classification.
![]() |
![]() |
Usage
- Install Pytorch 1.9 with Python 3.8.
- Clone this repo.
git clone https://github.com/DotWang/DCN-T.git
- Prepare the tri-spectral dataset with the notebook
- Download ImageNet pretrained model
- For implementing the clusttering, install the SSN
cd utils/gensp/src
python setup.py install
Or you can taste the pytorch version realized in the network_local_global.py
- Training and Testing
For example, training on the WHU-Hi-LongKou scene with soft voting
CUDA_VISIBLE_DEVICES=0 python -m torch.distributed.launch --nproc_per_node=1 --nnodes 1 \
--node_rank=0 --master_port=1901 --use_env train_memory.py \
--dataset 'WHUHi_LongKou_15_100' \
--backbone 'vgg16' \
--epochs 30 --lr 1e-3 --groups 128 --eval_interval 1 \
--batch_size 4 --test_batch_size 1 --workers 2 \
--ra_head_num 4 --ga_head_num 4 --mode 'soft'
CUDA_VISIBLE_DEVICES=0 python test_gpu.py \
--dataset 'WHUHi_LongKou_15_100' \
--backbone 'vgg16' --ra_head_num 4 --ga_head_num 4 \
--scales 1 --groups 128 \
--model_path './run/WHUHi_LongKou_15_100/vgg16_128/experiment_0/model_last.pth.tar' \
--save_folder './run/WHUHi_LongKou_15_100/vgg16_128/experiment_0/'
Citation
@ARTICLE{wang_2023_dcnt,
author={Wang, Di and Zhang, Jing and Du, Bo and Zhang, Liangpei and Tao, Dacheng},
journal={IEEE Transactions on Image Processing},
title={DCN-T: Dual Context Network With Transformer for Hyperspectral Image Classification},
year={2023},
volume={32},
number={},
pages={2536-2551},
doi={10.1109/TIP.2023.3270104}}
Thanks
Relevant Projects
[1] Pixel and Patch-level Hyperspectral Image Classification
Adaptive Spectral–Spatial Multiscale Contextual Feature Extraction for Hyperspectral Image Classification, IEEE TGRS, 2020 | Paper | Github
Di Wang∗, Bo Du, Liangpei Zhang and Yonghao Xu
[2] Image-level/Patch-free Hyperspectral Image Classification
Fully Contextual Network for Hyperspectral Scene Parsing, IEEE TGRS, 2021 | Paper | Github
Di Wang∗, Bo Du, and Liangpei Zhang
[3] Graph Convolution based Hyperspectral Image Classification
Spectral-Spatial Global Graph Reasoning for Hyperspectral Image Classification, IEEE TNNLS, 2023 | Paper | Github
Di Wang∗, Bo Du, and Liangpei Zhang
[4] Neural Architecture Search for Hyperspectral Image Classification
HKNAS: Classification of Hyperspectral Imagery Based on Hyper Kernel Neural Architecture Search, IEEE TNNLS, 2023 | Paper | Github
Di Wang∗, Bo Du, Liangpei Zhang, and Dacheng Tao