DefectFill: Realistic Defect Generation with Inpainting Diffusion Model for Visual Inspection

Abstract

Developing effective visual inspection models remains challenging due to the scarcity of defect data. While image generation models have been used to synthesize defect images, producing highly realistic defects remains difficult. We propose DefectFill, a novel method for realistic defect generation that requires only a few reference defect images. It leverages a fine-tuned inpainting diffusion model, optimized with our custom loss functions incorporating defect, object, and attention terms. It enables precise capture of detailed, localized defect features and their seamless integration into defect-free objects. Additionally, our Low-Fidelity Selection method further enhances the defect sample quality. Experiments show that DefectFill generates high-quality defect images, enabling visual inspection models to achieve state-of-the-art performance on the MVTec AD dataset.

Cite

Text

Song et al. "DefectFill: Realistic Defect Generation with Inpainting Diffusion Model for Visual Inspection." Conference on Computer Vision and Pattern Recognition, 2025. doi:10.1109/CVPR52734.2025.01744

Markdown

[Song et al. "DefectFill: Realistic Defect Generation with Inpainting Diffusion Model for Visual Inspection." Conference on Computer Vision and Pattern Recognition, 2025.](https://mlanthology.org/cvpr/2025/song2025cvpr-defectfill/) doi:10.1109/CVPR52734.2025.01744

BibTeX

@inproceedings{song2025cvpr-defectfill,
  title     = {{DefectFill: Realistic Defect Generation with Inpainting Diffusion Model for Visual Inspection}},
  author    = {Song, Jaewoo and Park, Daemin and Baek, Kanghyun and Lee, Sangyub and Choi, Jooyoung and Kim, Eunji and Yoon, Sungroh},
  booktitle = {Conference on Computer Vision and Pattern Recognition},
  year      = {2025},
  pages     = {18718-18727},
  doi       = {10.1109/CVPR52734.2025.01744},
  url       = {https://mlanthology.org/cvpr/2025/song2025cvpr-defectfill/}
}