# Dual-Kernel-Based Aggregated Residual Network for Surface Defect Inspection in Injection
## 3 Dual-Kernel-Based Aggregated Residual Networks
### Design of the DK-ResNeXt
#### 3.1.2 Double-Frame ResNeXt  
The double-frame ResNeXt (DF-ResNeXt) is inspired from a fast and robust CNN using the twofold approach proposed by [PERSON] et al. [24]. DF-ResNeXt, illustrated in Figure 3, has a mainframe composed of FKL (5) and FCL (1000) and a subframe composed of FKL (2), DKL (2), and FCL (1000).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Stage** & **Output** & **PE-ResNeXt-50 (\(32\times 4\)d)** & **PE-ResNeXt-101 (\(32\times 8\)d)** \\ \hline FKL1 & \(112\times 112\) & \multicolumn{2}{c}{7\(\times\)7, 64, stride 2} \\ \hline \multirow{3}{*}{FKL2} & \multirow{3}{*}{\(56\times 56\)} & \multicolumn{2}{c}{3\(\times\)3 max pool, stride 2} \\ \cline{3-3}  & & \(\left[\begin{array}{cc}1\times 1,&128\\ 3\times 3,&128\\ 1\times 1,&256\end{array}\right]\) & \(\times 3\) & \(\left[\begin{array}{cc}1\times 1,&128\\ 3\times 3,&128\\ 1\times 1,&256\end{array}\right]\) & \(\times 3\) \\ \hline FKL3 & \multirow{3}{*}{\(28\times 28\)} & \(\left[\begin{array}{cc}1\times 1,&256\\ 3\times 3,&256\\ 1\times 1,&256\end{array}\right]\) & \(\times 4\) & \(\left[\begin{array}{cc}1\times 1,&256\\ 3\times 3,&256\\ 1\times 1,&256\end{array}\right]\) & \(\times 3\) \\ \hline FKL4 & \multirow{3}{*}{\(14\times 14\)} & \(\left[\begin{array}{cc}1\times 1,&512\\ 3\times 3,&512\\ 1\times 1,&1024\end{array}\right]\) & \(\times 4\) & \(\left[\begin{array}{cc}1\times 1,&256\\ 3\times 3,&256\\ 1\times 1,&256\end{array}\right]\) & \(\times 32\) \\ \hline FKL4 & \multirow{3}{*}{\(7\times 7\)} & \(\left[\begin{array}{cc}1\times 1,&1024\\ 3\times 3,&1024\\ 1\times 1,&1024\end{array}\right]\) & \(\times 3\) & \(\left[\begin{array}{cc}1\times 1,&1024\\ 3\times 3,&1024\\ 1\times 1,&1024\end{array}\right]\) & \(\times 3\) \\ \hline FCL & \multirow{3}{*}{\(1\times 1\)} & \multicolumn{2}{c}{Global average pooling, \multirow{3}{*}{1000-d, softmax}} & \multicolumn{2}{c}{Global average pooling, \multirow{3}{*}{1000-d, softmax}} \\ \cline{3-3}  & & \(\left[\begin{array}{cc}1\times 1,&1024\\ 3\times 3,&1024\\ 1\times 1,&1024\end{array}\right]\) & \(\times 3\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Detailed structure of PE-ResNeXt.  
Figure 3: Schematic of the DF-ResNeXt architecture.  
The mainframe inputs a \(224\times 224\) image. The network structure of the mainframe is the same as that of ResNeXt presented in Table 1. The input size of the images for the subframe was \(28\times 28\). The mainframe classifies classes, and the subframe determines the defects. The decision of two frames is combined to determine which class has defects. Detailed model information is listed in Table 2.  
FKL1 (\(3\times 3\), \(32\), stride \(1\), and padding \(1\)) indicates that the \(3\times 3\) kernel performs convolution operations with one stride and one padding in the first fixed kernel layer. The subframe is composed of only FKL and DKL. FCL has \(256\) nodes, and the activation function is the softmax function. We cropped the image to emphasize the defect features presented in various forms, and we assumed that the cropped image can further improve the performance of DKL. We assumed that the cropped input images emphasized the defect features. Therefore, we expected to be able to distinguish various defects using a simple network structure.