Skip to content

Gated Transformer for Hyperspectral Anomaly Detection

Notifications You must be signed in to change notification settings

NanWangAC/GT-HAD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GT-HAD

This is an official implementation of GT-HAD: Gated Transformer for Hyperspectral Anomaly Detection.

Framework of GT-HAD:

1. Comparison Methods:

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.

Supported Algorithms:

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.

2. Create Environment:

2.1 DNN-based Methods:

  • Python 3 (Recommend to use Anaconda)
  • NVIDIA GPU + CUDA
  • Tensorflow for LREN
  • Pytorch for Auto-AD and GT-HAD
  • Numpy
  • Sklearn
  • Scipy
  • Progressbar

2.2 Non-DNN Methods:

  • MATLAB

2.3 Other Requirements:

  • Matplotlib
  • Seaborn

3. Prepare Dataset:

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

4. Experiments:

4.1 Running:

  • 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.

4.2 Testing:

  • 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

5. Citation:

If this repo helps you, please consider citing our work:

6. Contact:

For any question, please contact:

lianjie@bit.edu.cn

About

Gated Transformer for Hyperspectral Anomaly Detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published