This repository is the official implementation of Continuous Memory Representation for Anomaly Detection.
Python3.8
Packages:
- torch==1.12.1
- torchvision==0.13.1
To install requirements:
pip install -r requirements.txt
- Download the MVTec AD dataset
- Construct the data structure as follows:
|-- data
|-- MVTec-AD
|-- mvtec_anomaly_detection
|--bottle
|--cable
|-- ...
|-- train.json
|-- test.json
To train the model(s) in the paper, run this command:
cd experiments/
bash train_torch.sh config.yaml 4 0,1,2,3 1111
# bash train.sh <config> <num gpus> <gpu ids> <master port>
To evaluate a trained model, run:
cd experiments/
bash eval_torch.sh config.yaml 4 0,1,2,3 1111
# bash eval.sh <config> <num gpus> <gpu ids> <master port>
Our model achieves the following performance on MVTec AD:
Platform | GPU | Detection AUROC | Localization AUROC |
---|---|---|---|
torch.distributed.launch | 4 GPU (NVIDIA RTX A5000 24 GB) | 99.3 | 97.8 |
@article{lee2024crad,
title={Continuous Memory Representation for Anomaly Detection},
author={Lee, Joo Chan and Kim, Taejune and Park, Eunbyung and Woo, Simon S. and Ko, Jong Hwan},
journal={arXiv preprint arXiv:2402.18293},
year={2024}
}