This is the official implementation of the synthetic data part of Defect Spectrum.
Defect inspection is paramount within the closed-loop manufacturing system. However, existing datasets for defect inspection often lack precision and semantic granularity required for practical applications. In this paper, we introduce the Defect Spectrum, a comprehensive benchmark that offers precise, semantic-abundant, and large-scale annotations for a wide range of industrial defects. Building on four key industrial benchmarks, our dataset refines existing annotations and introduces rich semantic details, distinguishing multiple defect types within a single image. Furthermore, we introduce Defect-Gen, a two-stage diffusion-based generator designed to create high-quality and diverse defective images, even when working with limited datasets. The synthetic images generated by Defect-Gen significantly enhance the efficacy of defect inspection models. Overall, The Defect Spectrum dataset demonstrates its potential in defect inspection research, offering a solid platform for testing and refining advanced models.
For more details, please refer to:
Defect Spectrum: A Granular Look of Large-Scale Defect Datasets with Rich Semantics [Paper][Project Page][Dataset]
Shuai Yang*, ZhiFei Chen*, Pengguang Chen, Xi Fang, Shu Liu, Yingcong Chen
- Create an environment with python==3.8.0
conda create -n diff python==3.8.0
. - Activate it
conda activate diff
. - Install basic requirements
pip install -r requirements.txt
.
- Specify the number of defect types in
train_[large/small].sh
corresponds to your own needs. - Prepare your config yaml file for both large and small models. The input and output channel should be a total of the number of defect types, RGB channels, background channels(if needed).
- Run it with
sh train_[large/small].sh
- All the checkpoints will be save to
/[working_dir]/checkpoint
. - Update your checkpoints in
inference.sh
. - Specify your switching point for the large and small model in
--step_inference
. - Specify your defective types in
--num_defect
. - Run inference with
sh inference.sh
.
If you find this project useful in your research, please consider citing:
@misc{yang2023defect,
title={Defect Spectrum: A Granular Look of Large-Scale Defect Datasets with Rich Semantics},
author={Shuai Yang and Zhifei Chen and Pengguang Chen and Xi Fang and Shu Liu and Yingcong Chen},
year={2023},
eprint={2310.17316},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
- This work is built upon the Guided-Diffusion and SinDiffusion.
- The datasets we adopted come from Apple-Vision, MVTec-AD, DAGM-2007 and Cotton.
- We would like to extend our greatest thanks to those who helped at SmartMore Corp., regardless of whether their contributions are recognized or remain behind the scenes.