# SDD-CNN: Small Data-Driven Convolution Neural Networks for Subtle Roller Defect Inspection
## 3 Materials and Methods  
### Overview of Proposed Method  
As shown in Figure 1, the SDD-CNN-based roller defect inspection approach proposed in this paper includes raw image acquisition, roller ring region expansion, surface sample acquisition, small dataset preprocessing, CNN model training, and classification. Details are as follows:  
(1) Capture raw roller images using a monocular camera and a customized light source system. This paper obtains 194 raw images with 2592 \(\times\) 1944 pixel resolutions. To improve the robustness of the classifier, these images cover three different lighting conditions by adjusting the brightness of the light source system: perfect brightness (PB), 1.2 PB, and 0.8 PB [4];  
Figure 1: Framework and flowchart of proposed small data-driven convolution neural network (SDD-CNN) for roller defect inspection.  
(2) To facilitate the inspection algorithm, the ring-shape image of the roller is transformed into a rectangle by using a Polar-to-Cartesian (P2C) coordinate transformation [2]. Let (\(C_{x}\), \(C_{y}\)) denote the center of the roller; \(R\) and \(R_{0}\) denote the outer radius and inner radius of the roller, respectively; and (\(P_{x}\), \(P_{y}\)) and (\(D_{uv}\), \(D_{r}\)) represent the coordinates of the corresponding points before and after the transformation, respectively. Then, the P2C transformation can be described as  
\[\left\{\begin{array}{l}x=C_{x}+(r+R_{0})*\cos(\theta)\\ y=C_{y}-(r+R_{0})*\sin(\theta)\end{array}\right. \tag{1}\]  
where \(\theta\) = 2\(\pi\)_tw/W_. To ensure the quality of the resulting image, the bilinear interpolation method is adopted to obtain a proper pixel value;  
(3) Use a sliding window to crop the rectangular roller image into a small image suitable for CNN training and prediction (with a resolution of 256 \(\times\) 256). Then, screen and label the cropped image [29]. Figure 2 displays examples of the 11 categories of roller surface samples. In this paper, 830 surface samples were obtained, and the distribution of different categories is listed in Table 1;  
(4) Small data preprocessing. The initial roller dataset is expanded for the first time by the LD method for the sample imbalance problem. Then, the SSAD method is adopted to expand the dataset a second time. Finally, the dataset is divided into three parts: a training set, verification set, and test set, at a ratio of 3:1:1 [30];  
(5) Sample training is conducted using four state-of-the-art CNN architectures, namely, SqueezeNet v1.1 [31], Inception v3 [32], VGG-16 [33], and ResNet-18 [34]. The trained model is then used to classify the roller image through a sliding window to obtain the final inspection result.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Surface Type** & **EFQ** & **EFC** & **EFI** & **EFSc** & **EFSt** & **EFSF** \\ \hline Number of samples & 300 & 94 & 14 & 32 & 18 & 44 \\ Surface type & CQ & CC & CI & CSc & CSt & \\ Number of samples & 200 & 70 & 31 & 6 & 21 & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Distribution of different categories of initial roller dataset.  
Figure 2: Examples of different roller samples: (**a**) CQ: chamfer qualified; (**b**) CC: chamfer cracks; (**c**) CI: chamfer indentations; (**d**) CSc: chamfer scratches; (**e**) CSt: chamfer stains; (**f**) EFQ: end-face qualified; (**g**) EFC: end-face cracks; (**h**) EFI: end-face indentations; (**i**) EFSc: end-face scratches; (**j**) EFSt: end-face stains; (**k**) EFSF: end-face serious fracture.