Skip to main content
QUICK REVIEW

[论文解读] AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model

Teng Hu, Jiangning Zhang|arXiv (Cornell University)|Dec 10, 2023
Anomaly Detection Techniques and ApplicationsComputer Science被引用 8
一句话总结

AnomalyDiffusion 是一种基于扩散的少样本异常图像生成框架,通过空间异常嵌入实现异常外观与位置的解耦,并使用自适应注意力重加权来产生真实、与掩码对齐的异常图像-掩码对,提升下游异常检查任务的效果。

ABSTRACT

Anomaly inspection plays an important role in industrial manufacture. Existing anomaly inspection methods are limited in their performance due to insufficient anomaly data. Although anomaly generation methods have been proposed to augment the anomaly data, they either suffer from poor generation authenticity or inaccurate alignment between the generated anomalies and masks. To address the above problems, we propose AnomalyDiffusion, a novel diffusion-based few-shot anomaly generation model, which utilizes the strong prior information of latent diffusion model learned from large-scale dataset to enhance the generation authenticity under few-shot training data. Firstly, we propose Spatial Anomaly Embedding, which consists of a learnable anomaly embedding and a spatial embedding encoded from an anomaly mask, disentangling the anomaly information into anomaly appearance and location information. Moreover, to improve the alignment between the generated anomalies and the anomaly masks, we introduce a novel Adaptive Attention Re-weighting Mechanism. Based on the disparities between the generated anomaly image and normal sample, it dynamically guides the model to focus more on the areas with less noticeable generated anomalies, enabling generation of accurately-matched anomalous image-mask pairs. Extensive experiments demonstrate that our model significantly outperforms the state-of-the-art methods in generation authenticity and diversity, and effectively improves the performance of downstream anomaly inspection tasks. The code and data are available in https://github.com/sjtuplayer/anomalydiffusion.

研究动机与目标

  • 在制造业中少量异常数据下提升异常检查的动机。
  • 提出一种基于扩散的方法,从少量示例中生成真实且多样的异常样本。
  • 实现异常外观与位置的解耦,以控制异常的类型与放置位置。
  • 改进生成异常与掩码之间的一致性,以支持定位和分类任务。

提出的方法

  • 利用预训练的潜在扩散模型(LDM)将大规模数据的先验知识迁移到少样本异常生成。
  • 引入空间异常嵌入,将异常嵌入(外观)与空间嵌入(位置)结合起来作为生成条件。
  • 应用掩码文本反演以学习异常外观令牌,同时聚焦于异常区域。
  • 通过专用的空间编码器将异常掩码编码为空间嵌入,并在类别之间共享。
  • 引入自适应注意力重加权,在去噪过程中动态强调不易察觉的区域,提升掩码对齐。
  • 在输入的正常样本上进行混合扩散生成,将异常区域与常规内容按掩码进行混合。
  • 可选地通过学习的掩码嵌入生成异常掩码,以扩充下游任务的训练数据。

实验结果

研究问题

  • RQ1能否使用少量异常样本生成与给定掩码高度对齐、真实且多样的异常图像?
  • RQ2将异常外观与位置解耦是否能提升对生成异常的可控性?
  • RQ3自适应注意力重加权是否能在扩散合成过程中改善生成异常与异常掩码之间的对齐?
  • RQ4生成的异常样本是否提升下游异常检查任务(如检测、定位、分类)?
  • RQ5通过学习嵌入生成掩码在扩充异常任务的训练数据方面的效果如何?

主要发现

  • AnomalyDiffusion 在 MVTec 数据集上的生成真实性与多样性方面优于最先进的异常生成模型。
  • 该方法在高质量、密集对齐的异常图像方面表现突出,得益于自适应注意力重加权机制。
  • 生成的异常数据显著提升下游异常检查性能,包括像素级定位。
  • 在 MVTec 上,当使用用生成数据训练的简单 U-Net 进行评估时,像素级定位 AUROC 为 99.1%,AP 为 81.4%。
  • 该模型仅需少量真实异常样本即可生成大量异常图像-掩码对(如每种异常类型 1000 个),且空间异常嵌入提供对异常放置与外观的可控性。
  • 生成的异常在用于训练分类器时表现出强的类别分类性能,超越若干基线。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。