Spatial–Spectral Self-Attention Learning Network for Defending Against Adversarial Attacks in Hyperspectral Image Classification
- Python 3.7.13
- Pytorch 1.12
- Download the Pavia University image and the corresponding annotations. Put these files into the
Data
folder.
-
Data Preparation:
-
python GenSample.py --train_samples 300
Prepare the training and testing set. The training samples is generated by randomly selecting
300
samples from each category.
-
-
Adversarial Attack with the FGSM:
CUDA_VISIBLE_DEVICES=0 python Attack_FGSM_S3ANet.py --dataID 1 --bins 1 2 3 6 --epoch 1000 --iter 10
-
Adversarial Examples Visualization:
CUDA_VISIBLE_DEVICES=0 python GenAdvExample.py --model S3ANet --bins 1 2 3 6
if you find it useful for your research, please consider giving this repo a ⭐ and citing our paper! We appreciate your support!😊
@article{S³ANet,
title={S³ANet: Spatial–Spectral Self-Attention Learning Network for Defending Against Adversarial Attacks in Hyperspectral Image Classification},
author={Xu, Yichu and Xu, Yonghao and Jiao, Hongzan and Gao, Zhi and Zhang, Lefei},
journal={IEEE Trans. Geos. Remote Sens.},
volume={62},
pages={1--13},
year={2024},
}