[论文解读] Few-Shot Defect Image Generation via Defect-Aware Feature Manipulation
DFMGAN 通过在 StyleGAN2 主干上附加 defect-aware 残差块,在仅有少量真实样本的情况下进行缺陷图像的少-shot 生成,从而在带有缺陷掩码的前提下生成真实且多样的缺陷样本,并提升下游缺陷检测的性能。
The performances of defect inspection have been severely hindered by insufficient defect images in industries, which can be alleviated by generating more samples as data augmentation. We propose the first defect image generation method in the challenging few-shot cases. Given just a handful of defect images and relatively more defect-free ones, our goal is to augment the dataset with new defect images. Our method consists of two training stages. First, we train a data-efficient StyleGAN2 on defect-free images as the backbone. Second, we attach defect-aware residual blocks to the backbone, which learn to produce reasonable defect masks and accordingly manipulate the features within the masked regions by training the added modules on limited defect images. Extensive experiments on MVTec AD dataset not only validate the effectiveness of our method in generating realistic and diverse defect images, but also manifest the benefits it brings to downstream defect inspection tasks. Codes are available at https://github.com/Ldhlwh/DFMGAN.
研究动机与目标
- 通过从少量真实样本中生成缺陷图像,解决工业缺陷检测中的数据不足问题。
- 利用无缺陷数据学习鲁棒的对象分布,并通过区域聚焦操作将其转移到缺陷图像。
- 支持下游任务如缺陷定位和分类的缺陷掩码与可控缺陷区域。
- 在保持主干固定的同时,添加缺陷聚焦模块以维持生成无缺陷图像的能力。
- 在 MVTec AD 上展示在图像生成质量/多样性与下游任务改进方面的双重收益。
提出的方法
- 在数百张无缺陷图像上对数据高效的 StyleGAN2 主干进行预训练,以建模无缺陷对象分布。
- 在主干上附加缺陷感知残差块,生成缺陷掩码与缺陷残差特征。
- 使用 ToMask 模块限定缺陷区域,并仅在掩模区域内添加缺陷残差特征(特征层面的操作)。
- 引入缺陷映射网络,通过缺陷代码 z_defect 调制残差块来控制缺陷变化。
- 使用额外的缺陷匹配判别器确保掩模与真实缺陷区域对齐,并采用模式寻求损失来提升缺陷的多样性。
- 在缺陷阶段固定主干参数,以在禁用缺陷时保持无缺陷生成能力。
实验结果
研究问题
- RQ1两阶段训练方法(无缺陷主干 + 缺陷感知残差块)是否能够从少量样本生成真实且多样的缺陷图像?
- RQ2区域聚焦的缺陷操作是否在少-shot 缺陷生成中相比全图迁移提高真实感与多样性?
- RQ3模型产生的缺陷掩码是否能准确划定缺陷区域并支持下游的定位/分类任务?
- RQ4生成的缺陷样本是否能超越标准增广提升下游缺陷检测性能(如缺陷分类)?
- RQ5与现有的少-shot 与缺陷特定生成方法在标准基准上的比较结果如何?
主要发现
| Method | KID_crack | LPIPS_crack | KID_cut | LPIPS_cut | KID_hole | LPIPS_hole | KID_print | LPIPS_print |
|---|---|---|---|---|---|---|---|---|
| Finetune | 41.64 | 0.1541 | 21.80 | 0.1192 | 30.54 | 0.1263 | 28.75 | 0.1526 |
| DiffAug | 24.69 | 0.0570 | 19.84 | 0.0456 | 22.43 | 0.0466 | 39.03 | 0.0604 |
| CDC | 206.14 | 0.0437 | 213.98 | 0.0390 | 271.72 | 0.0566 | 355.37 | 0.0500 |
| Crop&Paste | - | 0.1894 | - | 0.2045 | - | 0.2108 | - | 0.2185 |
| SDGAN | 148.86 | 0.1607 | 161.16 | 0.1474 | 152.86 | 0.1689 | 176.09 | 0.1748 |
| Defect-GAN | 30.98 | 0.1905 | 32.69 | 0.1734 | 36.30 | 0.2007 | 33.35 | 0.2007 |
| DFMGAN | 19.73 | 0.2600 | 16.88 | 0.2073 | 20.78 | 0.2391 | 27.25 | 0.2649 |
- DFMGAN 在榛子样本的多种缺陷类别(裂纹、切口、孔洞、印刷)上,生成图像的质量与多样性优于基线方法。
- 在四类榛子缺陷上,DFMGAN 在 KID 与聚类 LPIPS 指标上均优于竞争方法。
- 模型能够生成配对的无缺陷图像并具备精准的缺陷掩码,支持缺陷定位任务。
- 在缺陷分类的增强实验中,DFMGAN 在 P1–P3 分区上实现对比基线的最高准确率提升。
- 两阶段训练并固定主干在保持无缺陷生成能力的同时,能够实现用少量缺陷样本进行真实缺陷增强。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。