arXiv:2507.02314cs.CVcs.AI2025-07中稿 · CVPR被引 1

MAGIC通过三重机制生成高保真且多样化的缺陷图像,提升工业质检模型泛化能力。

MAGIC: Few-Shot Mask-Guided Anomaly Inpainting with Prompt Perturbation, Spatially Adaptive Guidance, and Context Awareness

  • 用高斯提示扰动学习真实缺陷的平滑流形,避免少样本过拟合。
  • 空间自适应引导在异常与背景区域施加不同强度指导,保持细节清晰。
  • 上下文感知掩码对齐使缺陷位置更自然,适合下游检测任务部署。

少样本异常生成是工业质量控制的关键挑战。尽管扩散模型具有潜力,现有方法存在局限:全局提示引导会破坏正常区域,现有基于修复的方法常缺乏对下游模型至关重要的分布内多样性。我们提出MAGIC,一个微调的修复框架,能生成严格遵循掩码且高度多样化的高质量异常。MAGIC引入三个互补组件:(i) 高斯提示扰动,通过在真实异常的平滑流形上学习和采样,防止少样本场景下的过拟合;(ii) 空间自适应引导,在异常与背景区域应用不同强度的引导;(iii) 上下文感知掩码对齐,将掩码重新定位至目标物体中更合理的置放位置。在统一评估协议下,MAGIC在多个异常数据集上的下游任务中均优于现有最先进方法。

原文摘要 · Abstract (English)

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 object. Under consistent identical evaluation protocol, MAGIC outperforms state-of-the-art methods on diverse anomaly datasets in downstream tasks.

异常生成扩散模型少样本学习工业质检

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。