# A Survey on Surface Defect Inspection Based on Generative Models in Manufacturing
## 1 Introduction  
The manufacturing industry is the foundation of national economic development, directly reflecting the productivity level and international competitiveness of this country. To maintain competitiveness in the international market, excellent product quality is key. In the actual production process, it is inevitable that various defects appear on the surface of the product due to the difficulty in controlling the quality of raw materials, complex production technology, etc. Therefore, surface defect inspection, as an important component of quality production, plays a crucial role. Generally, surface defects can be defined as the areas with local texture colors or structures that are inconsistent with the normal background surfaces [1]. According to the difference in material stiffness of a product, there are two types of surface defects in industry, i.e., the defects on rigid material surfaces, e.g., metal, wood, and ceramics, etc., and the defects on flexible material surfaces, e.g., fabric, leather, and rubber, etc. [2]. Visually, the former show irregular cracks, chipping inclusions, and stripe scratches, whereas the latter present bubbles, and dot or short-line type defects. Figure 1 shows the examples of two types of surface defects. Regardless of either type of surface defects, they not only influence the appearance of a product but also always become the starting point of physical damage or chemical corrosion, which can affect its quality and performance [3]. However, traditional defect inspection is performed by human vision, which is time-consuming,hard sledding, and inefficient [4]. The studies [5; 6; 7] reported the drawbacks of the manual inspection in details. It is necessary to develop an automatic defect inspection system to replace the unreliable manual inspection. To achieve this, automatic defect inspection schemes were proposed in the 1980s [8]. Continuously, with the wide applications of vision sensors, more and more inspection methods based on machine learning (ML) and image processing techniques have emerged, mainly during the period 1981-2010. Usually, these methods extract well-designed hand-craft features and then feed them into a pattern recognizer, hence also known as feature engineering. In past decades, related works have been reported. The surveys [9; 10; 11] summarized the surface defect inspection methods in the 1980s, 1990s, and 2000s, respectively. Commonly, the traditional ML-based methods can be divided into four types: statistical methods, structural methods, filter-based methods, and model-based methods. However, no matter which kind of method of those mentioned above, the key to success is to design appropriate handcraft features, resulting in the inspection system having poor generalization and universality. In 2012, AlexNet [12] achieved great success in the visual recognition competition, attracting the world's attention to the deep learning (DL) technique, especially the convolutional neural network (CNN). These models adopt neural networks with multiple convolutional layers to learn the high-level features with the powerful knowledge representation ability. In various computer vision tasks, e.g., image classification and object detection, a CNN has shown higher accuracy, better generalization, and less sensitivity to application conditions than traditional ML methods [13; 14; 15]. It is natural that such models are employed in surface defect inspection and have become the most popular tools until now. Understandably, there are many reviews, such as focused on the DL-based defect inspection methods proposed in 2013-2023 [16; 17; 18; 19; 20; 21; 22]. According to their summaries, the published methods can intuitively be divided into two stages with the gradual development of a CNN. The earlier stage is to combine CNNs and traditional ML pattern recognizers, such as [23], which uses the former to extract features and the latter to perform vision tasks. Figure 1: Examples of surface defect images.