# A Survey on Surface Defect Inspection Based on Generative Models in Manufacturing
## 5 Discussion and Conclusions
### Future Research Directions  
* A generative model with high generation quality. Generative models are not intended as a means of data augmentation. If the generated samples are not clear enough, it will have a negative impact on feature learning. For defect inspection methods based on generative models, a training set always contains a much larger number of generated samples than real ones. Only increasing the number of samples cannot improve the final detection accuracy. DM is currently the most advanced and powerful generative model, which holds great potential in defect detection. However, this model still needs improvements due to difficulties in training, slow sampling speed, and other reasons. An important research direction will be to solve the problems of DMs and design inspection methods based on these models.
* Knowledge transferring. The distribution differences exist between the generated sample and the real sample. Due to the difficulty in obtaining new samples, the differences can seriously affect the quality of generation and inspection results. A promising research direction is to mine common knowledge and suppress special knowledge across different defect datasets. For example, both steel and aluminum plates have scratch defects that have similar features. The scratch features are common knowledge, and correspondingly different surface textures are their special knowledge. If aluminum plate datasets have a few samples, common knowledge from steel plate datasets can be transferred to boost sample generation. The most commonly used knowledge-transferring method is the cross-domain adaptation [126]. The effectiveness of mining knowledge from fake data is disappointing, which is a research problem that needs to be investigated.
* Accurate defect detection or segmentation in the weakly-supervised learning mode. Due to generated samples being unlabeled, most defect inspection methods are in the weakly-supervised learning mode. Although effective at defect classification, the detection and segmentation accuracy is far inferior to supervised learning methods. On one hand, it is because of the limitations of weakly-supervised learning itself; on the other hand, it is due to the lack of reliable label assignment methods, which are worth studying in future work.
* Lightweight model design. There are successful lightweight design cases in convolutional neural networks, e.g., the MobileNet [127]. However, these schemes are unable to integrate into generative models. To obtain high generation quality, powerful generative models require a complex learning process, such as the adversarial learning of GANs and the diffusion-and-denoising process of DMs, which depends on a heavy network architecture. Finally, the generation process is always time consuming. To meet real-time inspecting, generative models require lightweight design, which can also reduce the sample demand.  
Conceptualization, Y.H. and X.W.; methodology, Y.H. and J.X.; software, Y.H. and S.L.; validation, S.L. and X.W.; investigation, S.L.; resources, Y.H.; data curation X.W.; writing--original draft preparation, Y.H.; writing--review and editing, X.W. and J.X.; visualization, Y.H.; project administration, Y.H. All authors have read and agreed to the published version of the manuscript.  
This work was supported by the National Natural Science Foundation of China (62306186), the Technology Plan Joint Foundation of Liaoning Province (2023-BSBA-238), and the Technology Plan Joint Foundation of Liaoning Province (2023-MSLH-246).  
Not applicable.  
Data Availability Statement: Data are contained within the article.