# Stain Defect Classification by Gabor Filter and Dual-Stream Convolutional Neural Network
## 5 Experimental Result
### Magnetic Tile Dataset  
Figure 6 shows the MT dataset [28]. In the MT dataset, stain defects caused by external contamination exist on the metal tile surface. This paper constructed a dataset by extracting  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Layer** & **Output Size** & \(\mathbf{I_{Gray}}\mathbf{stream}\) & \(\mathbf{s_{1},s_{2},\cdots,s_{N}stream}\) \\ \hline Input & \(224\times 224\) & \(224\times 224\) @ 1 & \(224\times 224\) @ 1 \\ \hline Conv & \(112\times 112\) & \(7\times 7\), \(64\), stride 2 & \(7\times 7\), \(64\), stride 2 \\ \hline pooling & \(56\times 56\) & \(3\times 3\), stride 2 & \(3\times 3\), stride 2 \\ \hline Res\_Block1 & \(56\times 56\) & \(\begin{bmatrix}1\times 1,64\\ 3\times 3,64\\ 1\times 1,256\end{bmatrix}\times 3\) & \(\begin{bmatrix}1\times 1,64\\ 3\times 3,64\\ 1\times 1,256\end{bmatrix}\times 3\) \\ \hline Res\_Block2 & \(28\times 28\) & \(\begin{bmatrix}1\times 1,128\\ 3\times 3,128\\ 1\times 1,512\end{bmatrix}\times 4\) & \(\begin{bmatrix}1\times 1,128\\ 3\times 3,128\\ 1\times 1,512\end{bmatrix}\times 4\) \\ \hline Res\_Block3 & \(14\times 14\) & \(\begin{bmatrix}1\times 1,256\\ 3\times 3,256\\ 1\times 1,1024\end{bmatrix}\times 6\) & \(\begin{bmatrix}1\times 1,256\\ 3\times 3,256\\ 1\times 1,1024\end{bmatrix}\times 6\) \\ \hline Res\_Block4 & \(7\times 7\) & \(\begin{bmatrix}1\times 1,512\\ 3\times 3,512\\ 1\times 1,2048\end{bmatrix}\times 3\) & \(\begin{bmatrix}1\times 1,512\\ 3\times 3,512\\ 1\times 1,2048\end{bmatrix}\times 3\) \\ \hline Concat & \(4096\times 1\) & Average pool \\ \hline Output & \(2\times 1\) & Fully Connected \\ \hline \hline \end{tabular}
\end{table}
Table 1: Dual-stream network configuration.  
a 224 \(\times\) 224 image patch from an original image. If the image extract based on the ground truth image contained a stain defect region, it was labeled as a stain defect image, and if it did not contain a stain defect, it was labeled as an \"OK\" image. Table 2 shows the number of training, validation, and evaluation data of the MT dataset used in the experiment.  
Table 3 shows the classification performance according to the CNN structure and gray and Gabor filter images select method. As shown in Table 3, the F1-score shows the highest performance with 97.8 when using eight Gabor filter images. It improved by about 2.5 percent compared to the network trained by inputting only Gray Image. Through this, it was confirmed that the Gabor filter was effective in detecting stains. In addition, Single-stream or dual-stream inputting Gray Image and Gabor image together can confirm that the accuracy is slightly reduced, but both methods can confirm that the accuracy is increased compared to the network using only Gray Image.  
Table 4 shows the comparison results with the existing defect detection method using the MT data set. SEGDEC [27] and MCuePush [28] are defect detection methods based on a segmentation image, and CS-Flow [30] is a method of detecting defects by learning only a normal image. SEGDEC Among the comparative experiments, the proposed method had the highest F1-score. In the case of SEGDEC and MCuePush, defects were output from OK  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Type** & **Train** & **Validation** & **Test** \\ \hline OK & 193 & 58 & 100 \\ Stain & 188 & 60 & 100 \\ \hline Total & 381 & 118 & 200 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Magnetic tile dataset.  
Figure 6: Magnetic Tile Dataset (**Left**: image, **Right**: Stain Defect segmentation image).  
images as the method for detecting defects using the segmentation network. In addition, the F1-score was higher than CS-Flow, in which only OK images were input.