Pytorch implementation of our method for hyperspectral image classification.
-
Install Pytorch 1.1 with Python 3.5.
-
Clone this repo.
git clone https://github.com/DotWang/ASSMN.git
-
Training and evaluation with trainval.py.
For example, for Indian Pines dataset, if SeMN and SaMN are all employed:
CUDA_VISIBLE_DEVICES=0 python trainval.py \
--dataset 'indian' \
--dr-num 4 --dr-method 'pca' \
--mi -1 --ma 1 \
--half-size 13 --rsz 27 \
--experiment-num 10 \
--lr 1e-2 --epochs 200 --batch-size 16 \
--scheme 2 --strategy 's2' \
--spec-time-steps 2 \
--group 'alternate' --seq 'cascade' \
--npi-num 2
Then the assessment results are recorded in the corresponding *.mat file and the generated model is saved.
- Predicting with the previous stored model through infer.py
CUDA_VISIBLE_DEVICES=0 python infer.py \
--dataset 'indian' \
--mi -1 --ma 1 \
--half-size 13 --rsz 27 \
--bz 50000 \
--scheme 2 --strategy 's2'
and then produce the final classification map.
If this repo is useful for your research, please cite our paper.
@ARTICLE{2020ASSMN,
author={D. {Wang} and B. {Du} and L. {Zhang} and Y. {Xu}},
journal={IEEE Transactions on Geoscience and Remote Sensing},
title={Adaptive Spectral-Spatial Multiscale Contextual Feature Extraction for Hyperspectral Image Classification},
year={2020},
pages={1-17},
doi={10.1109/TGRS.2020.2999957},
url={https://doi.org/10.1109/TGRS.2020.2999957},
}
Thanks Andrea Palazzi for providing the Pytorch implementation of Convolutional LSTM!