# Automatic Metallic Surface Defect Detection and Recognition with Convolutional Neural Networks
## 1 Introduction  
Surface defects have an adverse effect on the quality and performance of industrial products. As for manufacturers, a lot of efforts have been made to inspect surface defects and the quality control of products [1]. In recent years, machine vision-based methods have gradually become a trend in the surface defect detection, because they can overcome many of the shortcomings of manual detection, including low accuracy, poor real-time performance, subjectivity, and high labor intensity. These machine vision-based inspection systems occur in many industrial applications, such as steel strip inspection [2; 3], liquid crystal display (LCD) inspection [4], fabric inspection [5; 6], aluminum profiles [7], railway track inspection [8], food inspection [9], and optical components inspection [10]. Metallic surfaces have received significant attention as they are widely used in industrial applications. Compared with smooth surfaces (such as LCD and optical components), photographs of a metallic surface may easily have some problems such as uneven illumination, strong reflection, and background noise, which increase the difficulty of detection. A captured image of a metallic component in the automotive industry is shown in Figure 1. As can be seen from Figure 0(a), the existence of defects is very complex, and there are multiple types such as damage spots, glue marks (spots) and scratches. In Figure 0(b), there are some defects (glue spots) with ambiguous edges and low contrastdue to the strong reflection. Meanwhile, Figure 1(b2) shows that the same batch of components differs in background color, owing to the different surface film. Since there are pollutants in the industrial environment, non-defective materials such as dust and fibers [Figure 1(b3_A_)] may also appear on the inspected surface. In addition, advanced defect assessment standards not only need to judge whether there are defects in the surface, they also need to obtain the exact size and type of defect. These scenarios are widely present in the actual industrial environment and pose great challenges to the inspection of metallic surface defects. In the last decade, many studies have investigated the machine vision technique in surface defect detection, which was not limited to the metallic surface. These methods can be mainly divided into two categories, namely: the traditional image processing method, and the machine learning method, which is based on handcrafted features or shallow learning techniques. The traditional image processing method uses the primitive attributes reflected by local anomalies to detect and segment defects, which can be further divided into the structural method, threshold method, spectral method, and model-based method [11]. The structural method includes edge [12], skeleton [13], template match [14], and morphological operations [15]. The threshold methods include the iterative optimal threshold [16], Otsu method [17], contrast adjustment threshold method [18], Kittler method [19], and watershed method [20], etc. The spectral methods commonly include Fourier transform [21], wavelet transform [22], and Gabor transform [23]. Model-based methods include the Gaussian mixture entropy model [24] and low-rank matrix model [4]. Machine learning-based methods generally include two stages of feature extraction and pattern classification. By analyzing the characteristics of the input image, the feature vector describing the defect information is designed, and then the feature vector is put into a classifier model that is trained in advance to determine whether the input image has a defect or not. These features include the local binary patterns (LBP) feature [2], a gray level co-occurrence matrix (GLCM) [7], a histogram of oriented gradient (HOG) features [25], and other grayscale statistical features [8; 10]. Although those detection algorithms have achieved better detection results in various surface defect detection, these cannot be directly applied to the aforementioned metallic surface.