# Copper Strip Surface Defect Detection Model Based on Deep Convolutional Neural Network
## 2 Surface Defect of Copper Strip
### Surface Defect Dataset  
The eight types of surface defect images mentioned above were collected on a domestic copper strip production line. The three types of defects of LM, CP, and EC after a period of production site tracking appeared relatively few times, collecting 157, 204, and 231, respectively. The collected number of other types of defect images was more than 300. This paper combines the image augmentation theory and practical environmental conditions that may occur to ensure even distribution of each type of defect image and randomly adopts five transformation methods shown in Table 2 (adding Gaussian noise, salt and pepper noise, angle rotation, brightness reduction, and enhancement) to expend the three aforementioned types of defect images, wherein each type was expended to 300. The original image and the added noise are respectively assumed as \(f\) and \(n\) when adding noise to the image, and then the image after adding noise is expressed as Equation (1). If the noise type is Gaussian noise, then it should obey the normal distribution [21], and the probability density function of the noise \(n\) should satisfy the Equation (2); if the noise type is salt and pepper noise, then this type shows bright and dark spots in the image [22], and the probability density function of the noise \(n\) should satisfy Equation (3). \[g=f+n \tag{1}\]  
\[p(n)=\frac{1}{\sqrt{2\pi}\sigma}e^{-(n-\mu)^{2}/(2\sigma^{2})} \tag{2}\] \begin{table}
\begin{tabular}{c c} \hline \hline
**Classifications** & **Characteristics** \\ \hline LM & Single or multiple lines appear on the surface, with continuous or intermittent distribution \\  & and different lengths. \\ BS & Single or multiple round black spots on the surface, usually single spot point is common. \\ CP & Pits or bulges of different sizes on the surface. \\ EC & Cracks on the sides of the two sides extend from the outside to the inside. \\ Ho & Holes with different sizes and irregular shapes on the surface. \\ IS & Most are embedded in the surface of copper strip, with insect appearance. \\ Pe & Serious upwarp appear on the surface. \\ Sm & Irregular dispersive residue marks appear on the surface. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Characteristics of surface defects. Figure 1: Image acquisition process of surface defects of copper strip: (a) LM, (b) BS, (c) CP, (d) EC, (e) Ho, (f) IS, (g) Pe, and (h) Sm. where \(\mu\) is the average value of noise \(n\), and \(\sigma\) is the standard deviation of noise \(n\). \[p(n)=\left\{ \begin{array}{ll}p_{a}&n=a\\ p_{b}&n=b\\ 1-p_{a}-p_{b}&n\
eq a,\,n\
eq b\end{array} \right. \tag{3}\]  
where \(0\leq p_{a}\leq 1\), \(0\leq p_{b}\leq 1\). If \(a>b\), then the noise \(n=a\) is reflected as a light spot; if \(a<b\), then the noise \(n=b\) is reflected as dark spots. The centre of the image is the fixed point when the image is rotated, and the coordinate of any point in the original image is \((x_{0},y_{0})\). The coordinate after the rotation angle \(\theta\) becomes \((x,y)\), and the calculation equation between the two is expressed as Equation (4). \[\left[ \begin{array}{c}x\\ y\end{array} \right]=\left[ \begin{array}{cc}\cos\theta&-\sin\theta\\ \sin\theta&\cos\theta\end{array} \right]\left[ \begin{array}{c}x_{0}\\ y_{0}\end{array} \right]. \tag{4}\]  
The brightness adjustment aims to increase or decrease uniformly the gray value of all pixels in the image. Assuming that the gray values in the original image are represented by \(\Omega\), \(\Omega^{\prime}\) is the adjusted gray values, and the calculation equation between the two is expressed as Equation (5). \[\Omega^{\prime}=\Omega\times(1+\eta) \tag{5}\]  
where \(\eta\) is the brightness adjustment factor. The surface defect dataset of the copper strip (YSU_CSC) in this paper is shown in Figure 2. This dataset contains 2400 surface defect images, and each defect has 300 images. The original image size is 200 \(\times\) 200. The size of each image is unified to 224 \(\times\) 224 after image pre-processing.