atlas

Research map / Image generation / Autoregressive and latent generation

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

CVPR 2025 · Image generation › Autoregressive and latent generation · approach: Compositional scene generation · 14 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Fine-tunes Stable Diffusion 2 inpainting with LoRA using defect, object, and attention losses plus Low-Fidelity Selection to generate realistic defect images from few references, improving MVTec AD classification and localization.

Problem

Visual inspection models suffer from scarce defect data, and existing defect image generators produce unrealistic defects that limit downstream inspection accuracy.

Approach

Adapts an inpainting diffusion model with LoRA using three custom losses (defect loss on masked region, object loss with random-box masks and "A [Object] with [V*]" prompt, and cross-attention loss aligning the defect token to the mask), then selects the least-reconstructed sample among eight via LPIPS in the masked region.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use DefectFill-generated defects instead of AnoDiff-generated defects for classification trainingResNet-34 · MVTec AD capsuleclassification accuracy: 66.67 → 87.50Helped
Use DefectFill-generated defects instead of AnoDiff-generated defects for classification trainingResNet-34 · MVTec AD pillclassification accuracy: 64.58 → 97.53Helped
Use DefectFill instead of the strongest baseline for defect generationDefectFill · MVTec AD carpetKID: 25.14 → 50.37Hurt
Add Low-Fidelity Selection (ablation)DefectFill · MVTec AD generated defectsKID: 28.485 → 25.947Helped
Add Low-Fidelity Selection (ablation)DefectFill · MVTec AD generated defectsIC-LPIPS: 0.247 → 0.250Helped
Add defect loss (ablation)DefectFill · MVTec AD defect generationdefect fidelityHelped
Add object loss (ablation)DefectFill · MVTec AD defect generationsemantic alignmentHelped
Add attention loss (ablation)DefectFill · MVTec AD defect generationdefect fidelityHelped
Use an inpainting diffusion model instead of vanilla Stable Diffusion (ablation)DefectFill with the proposed loss · MVTec AD defect generationdefect realismHelped
Replace the proposed loss with CLiC loss (ablation)Stable Diffusion 2 defect generation · MVTec AD defect generationdefect realismHurt

Surprising findings

Limitations

Experimental setup

Datasets: MVTec AD

Benchmarks: MVTec AD

Metrics: KID IC-LPIPS classification accuracy AUROC AP F1-max PRO

Baselines: DFMGAN AnomalyDiffusion CLiC

Builds on: Latent Diffusion Models Stable Diffusion inpainting CLiC LoRA AnomalyDiffusion

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy