RAS

February 20, 2025 ยท View on GitHub

Official implementation of Context Enhancement with Reconstruction as Sequence for Unified Unsupervised Anomaly Detection, accepted by ECAI 2024. pipeline

Preparation

Datasets

Please download the MVTec-AD dataset, VisA dataset, BTAD dataset and MPDD dataset, and put them at ./data.

|-- data
	|-- btad
		|-- 01
		|-- 02
		|-- 03
	|-- mpdd
		|-- bracket_black
		|-- bracket_brown
		...
	|-- mvtec
		|-- bottle
		|-- cable
		...
	|-- visa
		|-- 1cls
			|-- candle
			|-- capsules
			...

Environment

conda create -n ras python=3.8
conda activate ras
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge
pip install -r requirements.txt

Training & Evaluation

train

sh ras_train.sh

eval

sh ras_eval.sh

Acknowledgement

We acknowledge the excellent implementation from UniAD.

Citation

If our code or models help your work, please cite our paper:

@incollection{yang2024context,
  title={Context Enhancement with Reconstruction as Sequence for Unified Unsupervised Anomaly Detection},
  author={Yang, Hui-Yue and Chen, Hui and Liu, Lihao and Lin, Zijia and Chen, Kai and Wang, Liejun and Han, Jungong and Ding, Guiguang},
  booktitle={ECAI 2024},
  pages={2098--2105},
  year={2024},
  publisher={IOS Press}
}