Awesome
AdaBLDM
The implement for paper : "A Novel Approach to Industrial Defect Generation through Blended Latent Diffusion Model with Online Adaptation"
News!
2024/04/25 : Update the training code! :blush:
Dataset
- MVTEC AD
- BTAD
- KSDD2
Due to the non-square ksdd2 image , it need to crop the image of KSDD2 samples.
Preprocess code in this.
Env Install
We follows ControlNet.
Prepare
Build trainset for AdaBLDM training.
MVTec-AD in this.
BTAD in this.
KSDD in this.
Train
Mvtec-AD Part
- Download Mvtec-AD dataset.
- Foreground_predictor : Look this
- Prepare for mvtec dataset : Look this
- Download SD model : download "v1-5-pruned.ckpt". And put it on the directory named "./models".
- Convert weight of sd model :
python tool_add_control.py ./models/v1-5-pruned.ckpt ./models/control_sd15_ini.ckpt
- Config training setting : Look this
- Start to train a AdaBLDM:
# default : train a hazelnut with hole. python train.py
Test
- Input the model checkpoint : in test.py line 35.
- Run code:
# default : test with hazelnut with hole. python test.py
Stable Diffusion
Pretrain Stage
How to obtain the mvtec object's description? Look at this.
Foreground_predictor for trimap
How to get the object's foreground ? Look at this
SVM
Coming soon....
DeSTSeg(CVPR2023)
DeSTSeg: Segmentation Guided Denoising Student-Teacher for Anomaly Detection
Compare Method
DFMGAN(AAAI2023)
Few-Shot Defect Image Generation via Defect-Aware Feature Manipulation
Eval metric
Anomaly detection (following DeSTSeg)
- pixel-auc
- pro
- ap
- iap
- iap90
Image quality (following DFMGAN)
- KID
- LPIPS
Acknowledgement
Citation
@article{Li2024ANA,
title={A Novel Approach to Industrial Defect Generation through Blended Latent Diffusion Model with Online Adaptation},
author={Hanxi Li and Zhengxun Zhang and Hao Chen and Lin Wu and Bo Li and Deyin Liu and Mingwen Wang},
year={2024},
url={https://api.semanticscholar.org/CorpusID:268091266},
}