Home

Awesome

GT-HAD: Gated Transformer for Hyperspectral Anomaly Detection (IEEE TNNLS)

Jie Lian, Lizhi Wang, He Sun, Hua Huang

<hr />

Abstract: Hyperspectral anomaly detection (HAD) aims to distinguish between the background and anomalies in a scene, which has been widely adopted in various applications. Deep neural network (DNN)-based methods have emerged as the predominant solution, wherein the standard paradigm is to discern the background and anomalies based on the error of self-supervised hyperspectral image (HSI) reconstruction. However, current DNN-based methods cannot guarantee correspondence between the background, anomalies, and reconstruction error, which limits the performance of HAD. In this article, we propose a novel gated transformer network for HAD (GT-HAD). Our key observation is that the spatial–spectral similarity in HSI can effectively distinguish between the background and anomalies, which aligns with the fundamental definition of HAD. Consequently, we develop GT-HAD to exploit the spatial–spectral similarity during HSI reconstruction. GT-HAD consists of two distinct branches that model the features of the background and anomalies, respectively, with content similarity as constraints. Furthermore, we introduce an adaptive gating unit to regulate the activation states of these two branches based on a content-matching method (CMM). Extensive experimental results demonstrate the superior performance of GT-HAD.

<hr />

Network Architecture

<img src="framework.png" width=600 height=375>

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, MsRFQFT, CRD, GTVLRR, PTA, PCA-TLRSR) are available in GT-HAD/non-dnnmethods.

<details open> <summary><b>Supported Algorithms:</b></summary> </details>

Besides, we also provide their original codes in GT-HAD/original-codes.

1. Create Environment:

1.1 DNN-based Methods:

1.2 Non-DNN Methods:

1.3 Other Requirements:

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

3. Experiments:

3.1 Running:

# 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 
# 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 

# MsRFQFT
locate GT-HAD/non-dnnmethods/MsRFQFT/
run run.m

# CRD
locate GT-HAD/non-dnnmethods/CRD/
run run.m

# GTVLRR
locate GT-HAD/non-dnnmethods/GTVLRR/
run run.m

# PTA
locate GT-HAD/non-dnnmethods/PTA/
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.

3.2 Testing:


cd GT-HAD/scripts/
python heatmap.py


cd GT-HAD/scripts/
python boxplot.py


cd GT-HAD/scripts/
python roc.py

4. Citation:

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

@article{gt-had,
  title={GT-HAD: Gated Transformer for Hyperspectral Anomaly Detection},
  author={Jie Lian and Lizhi Wang and He Sun and Hua Huang},
  journal={IEEE Transactions on Neural Networks and Learning Systems},
  year={2024}
}

5. Contact:

For any question, please contact:

lianjie@bit.edu.cn