# A Survey on Surface Defect Inspection Based on Generative Models in Manufacturing
## 5 Discussion and Conclusions
### Challenges and Opportunities  
Although generative models have been widely used in the field of defect inspection, there are some challenges with both the model itself and its application to the task of sample generation of surface defects. * Small-scale defect datasets. Due to the difficulty in collecting defect samples, existing industrial surface defect datasets are relatively small scale. For deep neural networks, the larger model size brings stronger representability that can achieve better inspection results. However, the model size is positively correlated with sample requirements. A small training set limits the application of large models in industrial inspection tasks. Therefore, it is very cheap to obtain samples through generative models, which have been the research hotspot in the field of industrial inspection.Not only in terms of the number of defect samples, manual annotations are also insufficient due to the lack of simple and reliable labeling methods [72]. Undoubtedly, inspection methods can achieve excellent accuracy under the supervision of manual labels. However, industrial labeling is highly professional and heavy work, resulting in most existing defect datasets only having image-level labels. Meanwhile, the generated samples are unlabeled, and inspection models can hardly be constructed in a supervised learning manner with these samples. Therefore, current methods can only utilize generated  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & \multicolumn{3}{c}{**(h) NEU-CLS-64**} \\ \hline
**Method** & **ACC (\%)** & & **FID** \\ \hline \begin{tabular}{c} [72] \\ [85] \\ [103] \\ \end{tabular}  & \ \begin{tabular}{c} 99.38 \\ 88.28 \\ 99.79 \\ \end{tabular}  & \begin{tabular}{c} - \\ 153.15 \\ \end{tabular}  \\ \hline \multicolumn{5}{c}{**(i) RSDDs**} \\ \hline
**Method** & **mIoU (\%)** & **mAP (\%)** & **AUROC (\%) (image-level)** & **AUROC (\%) (pixel-level)** \\ \hline \begin{tabular}{c} [63] \\ [67] \\ [84] \\ \end{tabular}  & - & - & \begin{tabular}{c} 100 \\ 98.5 \\ 86.89 \\ \end{tabular}  & \ \begin{tabular}{c} 98.8 \\ 87.2 \\ - \\ \end{tabular}  & \begin{tabular}{c} 98.8 \\ 97.2 \\ - \\ \end{tabular}  \\ \hline \multicolumn{5}{c}{**(j) X-SDD**} \\ \hline
**Method** & **ACC (\%)** & **Recall (\%)** & **Precision (\%)** & **F1-score (\%)** \\ \hline \begin{tabular}{c} [77] \\ [85] \\ \end{tabular}  & \begin{tabular}{c} 99.2 \\ 86.4 \\ \end{tabular}  & \begin{tabular}{c} 99.21 \\ - \\ \end{tabular}  & \ \begin{tabular}{c} 99.29 \\ - \\ - \\ \end{tabular}  & \begin{tabular}{c} 99.24 \\ - \\ \end{tabular}  \\ \hline \multicolumn{5}{c}{**(k) YDFID-1**} \\ \hline
**Method** & **ACC (\%)** & **Recall (\%)** & **Precision (\%)** & **F1-score (\%)** & **mIoU (\%)** \\ \hline \begin{tabular}{c} [56] \\ [61] \\ [62] \\ [104] \\ \end{tabular}  & \ \begin{tabular}{c} 92.4 \\ 99.28 \\ 98.42 \\ 98.95 \\ \end{tabular}  &
\begin{tabular}{c} 80.5 \\ 58.71 \\  
samples for defect inspection tasks, especially for defect detection and segmentation tasks, in weakly-supervised learning and unsupervised learning manners. The accuracy obtained in these ways cannot meet the actual levels of industrial inspection.Furthermore, the small scale of a dataset can lead to an imbalance in representation learning during the process of sample generation [124]. For large-scale datasets, it is not necessary to require equal sample sizes between classes, which means class imbalance can slightly affect the training of deep models. However, defect datasets are all small-scale, in which the number of defect-free samples is usually bigger than that of defect samples. If training on such a class-imbalanced dataset, the model tends to learn features in features of categories with larger sample sizes. Although it is easy to recover the balance of a dataset by adding generated samples, these samples are essentially fake images, which may not necessarily have a positive impact on generation learning. * Difficulties in training of generative models. Advanced generative models have their own difficulties in training.