This is an official implementation of GT-HAD: Gated Transformer for Hyperspectral Anomaly Detection.
Framework of GT-HAD:
In addition to GT-HAD, this repo includes the implementation of the following anomaly detection methods. DNN-based methods (Auto-AD, LREN) are available in GT-HAD/dnnmethods
, and non-DNN methods (RX, KIFD, 2S-GLRT, CRD, GTVLRR, PCA-TLRSR) are available in GT-HAD/non-dnnmethods
.
Besides, we also provide their original codes in GT-HAD/original-codes
.
- RX, CRD, and 2S-GLRT are available in
GT-HAD/original-codes/2S-GLRT.zip
. - KIFD is available in
GT-HAD/original-codes/KIFD.zip
. - GTVLRR is available in
GT-HAD/original-codes/PTA.zip
. - PCA-TLRSR is available in
GT-HAD/original-codes/PCA-TLRSRT.zip
. - Auto-AD is available in
GT-HAD/original-codes/Auto-AD.zip
. - LREN is available in
GT-HAD/original-codes/LREN.zip
.
- Python 3 (Recommend to use Anaconda)
- NVIDIA GPU + CUDA
- Tensorflow for LREN
- Pytorch for Auto-AD and GT-HAD
- Numpy
- Sklearn
- Scipy
- Progressbar
- MATLAB
- Matplotlib
- Seaborn
Datasets are available in GT-HAD/data
.
-- los-angeles-1.mat
-- los-angeles-2.mat
-- gulfport.mat
-- texas-goast.mat
-- cat-island.mat
-- pavia.mat
- DNN-based Methods:
# Auto-AD
cd GT-HAD/dnnmethods/Auto-AD/
python main.py
# LREN
cd GT-HAD/dnnmethods/LREN/
python main.py
# GT-HAD
cd GT-HAD/dnnmethods/GT-HAD/
python main.py
- non-DNN Methods:
# RX
locate GT-HAD/non-dnnmethods/RX/
run run.m
# KIFD
locate GT-HAD/non-dnnmethods/KIFD/
run run.m
# 2S-GLRT
locate GT-HAD/non-dnnmethods/2S-GLRT/
run run.m
# CRD
locate GT-HAD/non-dnnmethods/CRD/
run run.m
# GTVLRR
locate GT-HAD/non-dnnmethods/GTVLRR/
run run.m
# PCA-TLRSR
locate GT-HAD/non-dnnmethods/PCA-TLRSR/
run run.m
The detection results will be output into GT-HAD/results/
. Taking RX as an example, RX_map.mat is used to draw color anomaly map and box-whisker plot, and RX_roc.mat is used to draw ROC curve and calculate AUC.
- Generate color anomaly map:
cd GT-HAD/scripts/
python heatmap.py
- Generate box-whisker plot:
cd GT-HAD/scripts/
python boxplot.py
- Generate ROC curve and calculate AUC:
cd GT-HAD/scripts/
python roc.py
If this repo helps you, please consider citing our work:
For any question, please contact:
lianjie@bit.edu.cn