# A Survey on Surface Defect Inspection Based on Generative Models in Manufacturing
## 3 Defect Inspection Based on Generative Models
### Defect Inspection Based on GANs  
GANs are the most popular generative model used in defect inspection. There are two main network architectures used for defect sample generation. The one is the classical GAN architecture that samples from the random noise distribution and generates samples unconditionally. Among the most representative models are standard GAN [42], DCGAN (deep convolutional GAN) [70], and WGAN (Wasserstein GAN) [71], etc. Existing inspection methods utilize these generative models for data augmentation or modify the output layer of the discriminator according to the type of inspection task. Table 3 summarizes the selected methods which are based on classical GAN architecture for defect inspection. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Method** & **Year** & **Brief Description** & **GM** & **Objective** & **Task** & **LM** \\ \hline
[72] & 2022 & Utilize label assignment for generated samples and mix them into semi-supervised learning & Customized GAN & NEU-CLS-64; & CLS & WSL \\  & & A triple attention semantic segmentation & DAGM; & & \\
[73] & 2022 & network for pixel-wise segmentation of surface defects & DA-GAN & NEU-DET; & SEG & WSL \\
[74] & 2022 & Introduce latent variables in anomalous states & MT & MT & CLS & USL \\
[75] & 2022 & Use a typical GAN to generate leather samples & GAN & Leather & CLS & WSL \\
[76] & 2022 & Equip the GAN with fully convolutional networks and Markov discriminators & DefectGAN & Aluminum plate & CLS & WSL \\
[77] & 2022 & Classify defect based on WGAN and attention mechanism. & WGAN & X-SDD & CLS & WSL \\
[78] & 2022 & Construct GAN structure mapping the latent space to improve the quality of generated data & Latent Mapping GAN & Several & CLS & WSL \\
[79] & 2023 & Modify the DCGAN with ELU activation functions for sample generation & EDCGAN & NEU-CLS & CLS & WSL \\
[80] & 2023 & Make the generator cheat two discriminators simultaneously & GAN & NEU-CLS; & \\
[81] & 2023 & Incorporate Vision Transformer into a GAN for image reconstruction & GAN with ViT & MVTec & CLS & WSL \\
[82] & 2023 & DCGAN and the encoder work together to & & & \\
[83] & 2023 & produce a residual mapping with prominent defects. & DCGAN & Fabric & SEG & USL \\
[84] & 2023 & Incorporate both channel-wise and spatial-wise attention into GAN for sample generation. & ADRGAN & Steel Strip surface & CLS & WSL \\
[85] & 2023 & Simulate the background style of defect-free samples to obtain reasonable defects. & AGAN & AITEX; & SEG & USL \\  & & A contrastive learning framework for steel & & NEU-CLS; & \\
[86] & 2023 & surface defect recognition with few labeled samples. & DGAN & NEU-CLS-64; & CLS & WSL \\
[87] & 2024 & Employ two encoder-decoder models in GAN & DLS-GAN & Metal Iron & CLS & WSL \\  & & The deployment time of the detection method & & Sheet & DET & WSL \\
[88] & 2024 & is reduced by applying the Wasserstein distance and spectral normalized strategy & & & \\
[89] & 2024 & Use a pyramidal structure to learn the internal features of a single image. & & & \\
[90] & 2024 & Separate training on defects and backgrounds & defect-background & Battery exterior; & CLS & \\
[91] & 2024 & Use DCGAN to generate samples. & & & \\ \hline \hline \end{tabular}  
* Notions: GM = generative model, CLS = classification, SEG = segmentation, LM = learning mode, USL = unsupervised learning, WSL = weakly-supervised learning.  
\end{table} 
Table 3: Summary of studies based on typical GANs for surface defect inspection. For example, [PERSON] et al. [72] designed a customized GAN to generate unlabeled samples and performed label assignment for unlabeled samples to enable them to participate in semi-supervised training. [PERSON] et al. [73] introduced a triple-attention semantic segmentation network for surface defect detection, which utilized the GAN-based data augmentation (DA-GAN) method to exaggerate defect images and capture contextual information to improve segmentation results. [PERSON] et al.