# ImbDef-GAN: Defect Image-Generation Method Based on Sample Imbalance

**Authors:** Dengbiao Jiang, Nian Tao, Kelong Zhu, Yiming Wang, Haijian Shao

PMC · DOI: 10.3390/jimaging11100367 · Journal of Imaging · 2025-10-16

## TL;DR

ImbDef-GAN is a new method that generates realistic defect images to improve defect detection when real defect samples are scarce.

## Contribution

ImbDef-GAN introduces a two-stage framework to generate defect images with natural transitions, accurate masks, and improved detection performance under sample imbalance.

## Key findings

- ImbDef-GAN outperforms existing methods in generating realistic and diverse defect images.
- Using generated data improves YOLOv11 detection accuracy by 5.4% in mAP@0.5.
- The framework addresses key limitations like boundary transitions and mask alignment.

## Abstract

In industrial settings, defect detection using deep learning typically requires large numbers of defective samples. However, defective products are rare on production lines, creating a scarcity of defect samples and an overabundance of samples that contain only background. We introduce ImbDef-GAN, a sample imbalance generative framework, to address three persistent limitations in defect image generation: unnatural transitions at defect background boundaries, misalignment between defects and their masks, and out-of-bounds defect placement. The framework operates in two stages: (i) background image generation and (ii) defect image generation conditioned on the generated background. In the background image-generation stage, a lightweight StyleGAN3 variant jointly generates the background image and its segmentation mask. A Progress-coupled Gated Detail Injection module uses global scheduling driven by training progress and per-pixel gating to inject high-frequency information in a controlled manner, thereby enhancing background detail while preserving training stability. In the defect image-generation stage, the design augments the background generator with a residual branch that extracts defect features. By blending defect features with a smoothing coefficient, the resulting defect boundaries transition more naturally and gradually. A mask-aware matching discriminator enforces consistency between each defect image and its mask. In addition, an Edge Structure Loss and a Region Consistency Loss strengthen morphological fidelity and spatial constraints within the valid mask region. Extensive experiments on the MVTec AD dataset demonstrate that ImbDef-GAN surpasses existing methods in both the realism and diversity of generated defects. When the generated data are used to train a downstream detector, YOLOv11 achieves a 5.4% improvement in mAP@0.5, indicating that the proposed approach effectively improves detection accuracy under sample imbalance.

## Full-text entities

- **Diseases:** AD (MESH:D000544)

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12565522/full.md

## Figures

12 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12565522/full.md

## References

40 references — full list in the complete paper: https://tomesphere.com/paper/PMC12565522/full.md

---
Source: https://tomesphere.com/paper/PMC12565522