Skip to main content
QUICK REVIEW

[Paper Review] Few-Shot Defect Image Generation via Defect-Aware Feature Manipulation

Yuxuan Duan, Hong Yan|arXiv (Cornell University)|Mar 4, 2023
Advancements in Photolithography TechniquesEngineering8 citations
TL;DR

DFMGAN performs few-shot defect image generation by attaching defect-aware residual blocks to a StyleGAN2 backbone trained on defect-free images, enabling realistic, diverse defect samples with defect masks and improved downstream defect-inspection performance.

ABSTRACT

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.

Motivation & Objective

  • Address data insufficiency in industrial defect inspection by generating defect images from few real examples.
  • Leverage defect-free data to learn a robust object distribution and transfer it to defect images via region-focused manipulation.
  • Enable defect masks and controllable defect regions to support downstream tasks like defect localization and classification.
  • Maintain the ability to generate defect-free images by fixing the backbone while adding defect-focused modules.
  • Demonstrate benefits on MVTec AD for both image generation quality/diversity and improvement of downstream tasks.

Proposed method

  • Pretrain a data-efficient StyleGAN2 backbone on hundreds of defect-free images to model defect-free object distributions.
  • Attach defect-aware residual blocks to the backbone that produce defect masks and defect residual features.
  • Use a ToMask module to delimit defect regions and add defect residual features only within masked regions (feature-level manipulation).
  • Introduce a defect mapping network to control defect variation via a defect code z_defect that modulates the residual blocks.
  • Employ an extra defect matching discriminator to ensure masks align with real defect regions and use a mode-seeking loss to boost diversity across defects.
  • Fix the backbone parameters in the defect stage to keep defect-free generation capability intact when defects are disabled.

Experimental results

Research questions

  • RQ1Can a two-stage training approach (defect-free backbone + defect-aware residual blocks) generate realistic and diverse defect images from few examples?
  • RQ2Does region-focused defect manipulation improve realism and diversity compared to whole-image transfer in few-shot defect generation?
  • RQ3Do defect masks produced by the model accurately delineate defect regions and support downstream localization/classification tasks?
  • RQ4Can the generated defect samples enhance downstream defect inspection performance (e.g., defect classification) beyond standard augmentation?
  • RQ5How does the proposed method compare to existing few-shot and defect-specific generation methods on standard benchmarks?

Key findings

  • DFMGAN achieves higher quality and diversity in generated defect images than baselines across multiple defect categories in hazelnut (crack, cut, hole, print).
  • DFMGAN outperforms competing methods on KID and clustered LPIPS metrics for all four defect types in hazelnut.
  • The model can generate paired defect-free images with precise defect masks, enabling defect localization tasks.
  • In defect classification augmentation experiments, DFMGAN yields the highest accuracy improvements over baselines across partitions P1–P3.
  • The two-stage training with a fixed backbone preserves defect-free generation while enabling realistic defect augmentation with a small number of defect samples.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.