# A Survey on Surface Defect Inspection Based on Generative Models in Manufacturing
## 3 Defect Inspection Based on Generative Models
### Defect Inspection Based on VAEs
In 2022-2024, most methods focused on the challenging defect segmentation tasks. However, VAEs-based methods are only suitable for simple situations, for example, each image containing only one defect. VAEs generate samples by an encoding-decoding process, which assumes input samples follow a Gaussian distribution and maps them to the continuous data distribution [28]. Therefore, VAEs are good at reconstructing features with regular patterns but fail to learn complex and random features, resulting in the problem of generating blurry images [32]. Comparatively, GANs and DMs have more complex latent priors for data assumption, and thus have the ability to deal with a complex defect dataset [31]. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Method** & **Year** & **Brief Description** & **GM** & **Objective** & **Task** & **LM** \\ \hline
[56] & 2022 & Generate image pairs with random masks for training. & & & & \\  & & Design the AES-SSIM with five & & & & \\
[57] & 2022 & sub-encoders and five sub-decoders for & AE5-SSIM & tinfoil surface & & & \\  & & tinfoil defect detection. & & & & \\
[58] & 2022 & augmentation and train Unet to predict the & & VAE & MVTec & SEG & WSL \\  & & segmentation map. & & & & \\
[59] & 2023 & Use a VAE for image reconstruction and & & & & & \\
[60] & 2023 & Image gradient filter for edge detection. & & & & & \\  & & A lightweight reconstruction network & & & & \\  & & based on CAE. & & & & \\  & & Adopt autoregressive modelling of & & & & \\
[61] & 2022 & discrete variables to avoid the posterior & & & & \\  & & collapse problem of traditional VAEs. & & & & \\
[62] & 2022 & A multi-scale U-shaped denoising CAE is & & & & \\  & & modelled using defect-free samples. & & & & \\  & & Use a Siamese architecture to capture & & & & \\
[63] & 2022 & discriminative features of defect-free & & & & \\  & & samples and obtain defect samples by a & & & & \\  & & random generation module. & & & & \\  & & Combine supervised and self-supervised & & & & \\
[64] & 2022 & learning methods to complete the model & & & & \\  & & training and detect defects on the rail & & & & \\  & & surfaces automatically. & & & \\
[65] & 2023 & improve interclass distance in potential & & & & \\  & & space. & & & & \\
[66] & 2023 & A few-shot anomaly detection strategy that & & & & \\  & works in a low-data regime. & & & & \\  & & Integrate the concept of self-supervised & & & \\
[67] & 2024 & learning into an introspective & & & & \\  & auto-encoder. & & & & & \\
[68] & 2024 & Add frequency shift operation on the basis & & & & \\  & of the CAE for surface defect detection. & & & & \\  & & Employ VIT architecture that incorporates & & & \\
[69] & 2024 & a transformer structure to understand the & & & & \\  & global context between image blocks. & & & & \\ \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 2: Summary of studies based on VAEs for surface defect inspection.