MAGIC: Few-Shot Mask-Guided Anomaly Inpainting with Prompt Perturbation, Spatially Adaptive Guidance, and Context Awareness
JaeHyuck Choi, MinJun Kim, Je Hyeong Hong

TL;DR
MAGIC is a novel inpainting framework for few-shot anomaly generation that enhances diversity and realism using prompt perturbation, spatial guidance, and mask alignment, improving industrial quality control models.
Contribution
Introduces MAGIC, a fine-tuned inpainting method with three components to generate diverse, high-fidelity anomalies for robust downstream industrial applications.
Findings
MAGIC outperforms existing methods on various anomaly datasets.
The approach produces high-fidelity, diverse anomalies adhering to masks.
MAGIC improves downstream model robustness in industrial quality control.
Abstract
Few-shot anomaly generation is a key challenge in industrial quality control. Although diffusion models are promising, existing methods struggle: global prompt-guided approaches corrupt normal regions, and existing inpainting-based methods often lack the in-distribution diversity essential for robust downstream models. We propose MAGIC, a fine-tuned inpainting framework that generates high-fidelity anomalies that strictly adhere to the mask while maximizing this diversity. MAGIC introduces three complementary components: (i) Gaussian prompt perturbation, which prevents model overfitting in the few-shot setting by learning and sampling from a smooth manifold of realistic anomalies, (ii) spatially adaptive guidance that applies distinct guidance strengths to the anomaly and background regions, and (iii) context-aware mask alignment to relocate masks for plausible placement within the host…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
