JustinTebbe / Dynamic-noise-AD

MIT License
6 stars 0 forks source link

Dynamic Addition of Noise in a Diffusion Model for Anomaly Detection

D3AD This repo contains the official implementation of Dynamic Addition of Noise in a Diffusion Model for Anomaly Detection

Setup

Install dependencies:

pip install -r requirements.txt

For consistency decoder:

$ pip install git+https://github.com/openai/consistencydecoder.git

Create folder structure for model checkpoints and results like:

checkpoints
|--- VisA
|--- BTAD
|--- MVTec
results
|--- category_name

Data:
MVTec can be used as is.
For VisA please structure like:

VisA_pytorch
|--- candle
|-----|----- ground_truth
|-----|----- test
|-----|-------|------- good 
|-----|-------|------- bad 
|-----|----- train
|-----|-------|------- good
|--- capsules
|--- ...

Run the model

For training of the model run:

python main.py

For evaluating model performance run:

python main.py --eval True

Citation

@InProceedings{Tebbe_2024_CVPR,
    author    = {Tebbe, Justin and Tayyub, Jawad},
    title     = {Dynamic Addition of Noise in a Diffusion Model for Anomaly Detection},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    month     = {June},
    year      = {2024},
    pages     = {3940-3949}
}