Haoyang He1, Jiangning Zhang1†, Guanzhong Tian1, Chengjie Wang2, Lei Xie1†
1College of Control Science and Engineering, Zhejiang University, 2Youtu Lab, Tencent,
[Paper]
Our MVAD is based on ADer.
Subscripts S, I, and R represent rsample-level, image-level, and pixel-level, respectively.
| Dataset | mAU-ROCS | mAPS | mF1-maxS | mAU-ROCI | mAPI | mF1-maxI | mAU-ROCP | mAPP | mF1-maxP | mAU-PROP | Download |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Real-IAD | 90.2 | 95.3 | 90.1 | 86.6 | 84.8 | 77.2 | 97.9 | 30.3 | 36.8 | 91.2 | log & weight |
- Prepare general experimental environment
pip3 install timm==0.8.15dev0 mmselfsup pandas transformers openpyxl imgaug numba numpy tensorboard accimage Ninja pip3 install --upgrade protobuf==3.20.1 scikit-image faiss-gpu pip3 install geomloss FrEIA adeval fvcore==0.1.5.post20221221 pip3 install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu118 (or) conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=11.8 -c pytorch -c nvidia
- Download and extract Real-IAD into
data/realiad.
- Check
dataandmodelsettings for the config fileconfigs/mvad/mvad_realiad.py - Train with single GPU example:
CUDA_VISIBLE_DEVICES=0 python run.py -c configs/mvad/mvad_realiad.py -m train
- Modify
trainer.resume_dirto resume training.
- The training log of MVAD can be find at log and the weights at model.
- Modify
trainer.resume_dirormodel.kwargs['checkpoint_path'] - Test with single GPU example:
CUDA_VISIBLE_DEVICES=0 python run.py -c configs/mvad/mvad_realiad.py -m test model.kwargs.checkpoint_path=log/mvad.pth
If you find this code useful, don't forget to star the repo and cite the paper:
@article{he2024learning,
title={Learning Multi-view Anomaly Detection},
author={He, Haoyang and Zhang, Jiangning and Tian, Guanzhong and Wang, Chengjie and Xie, Lei},
journal={arXiv preprint arXiv:2407.11935},
year={2024}
}