[AAAI2025] Filter or Compensate: Towards Invariant Representation from Distribution Shift for Anomaly Detection
conda env create -f environment.yml
-
Download the original dataset MVTec, PACS and CIFAR-10.
-
Generate the corrupted test set for MVTec and CIFAR-10.
python generate_corrupted_mvtec.py
python generate_corrupted_cifar10.py
Arrange data with the following structure (e.g. MVTec dataset):
Path/To/Dataset
├── mvtec
├── bottle
├── ......
├── mvtec_brightness
├── bottle
├── ......
├── mvtec_contrast
├── bottle
├── ......
├── mvtec_defocus_blur
├── bottle
├── ......
├── mvtec_gaussian_noise
├── bottle
├── ......
Modify the file path in the scripts.
For the training process, please simply execute (e.g. MVTec dataset):
python train_mvtec_fico.py
For the inference process, please simply execute (e.g. MVTec dataset):
python inference_mvtec_ATTA.py
We thank the authors from ADShift for reference. We modify their code to implement FiCo.
@article{chen2024filter,
title={Filter or Compensate: Towards Invariant Representation from Distribution Shift for Anomaly Detection},
author={Chen, Zining and Luo, Xingshuang and Wang, Weiqiu and Zhao, Zhicheng and Su, Fei and Men, Aidong},
journal={arXiv preprint arXiv:2412.10115},
year={2024}
}