## 4 Results
### Object Detection Result  
In the case of the preprocessing method we proposed and the typical preprocessing method, the noise that hindered learning was removed after CLAHE was applied. The CNN model requires several computing resources if it is trained with the original pixel values of the image because each pixel has a value of 0-255. In the preprocessing method we proposed, after thresholding the raw images so that the pixels are normalized, the thresholded image, the reverse thresholded image, and raw image are merged into three channels to reflect the features of white and black defects.  
The loss graph and mAP for learning were derived by training the YOLO algorithm with the raw images, typical preprocessed images and preprocessed images of the welding defects. Figure 14 shows the loss graphs of the preprocessed, typical preprocessed and raw image learning models. The loss on the training dataset for the preprocessed image learning model, typical preprocessed image learning model, and the raw image learning model, converged to 0.03019, 0.031688 and 0.03415. The loss on the test dataset for the preprocessed image learning model, typical preprocessed image learning model, and the raw image learning model, converged to 0.05406, 0.05434 and 0.05674. In the loss graph of the three learning models, both the loss on the training data and the loss on the validation data show a decreasing trend, so it can be judged that overfitting did not occur in the trained models.  
Figure 15a shows a mask image marked with welding defects, Figure 15b shows the detection image of the model trained with the preprocessed image, and Figure 15c shows the detection image of the model trained with the typical preprocessed image, and  
Figure 14: (a) Loss of preprocessed image, (b) loss of typical preprocessed image and (c) loss of raw image.  
Figure 15d shows the detection image of the model trained with the raw image. Comparing the defect detection images for each model and the mask images with welding defects, one false negative in Figure 15b, two false negatives in Figure 15c, and two false negatives and one false positive in Figure 15d were found.  
Table 3 shows the mAP obtained through the PR curve for the training and test datasets of the preprocessed, typical preprocessed and raw image learning models in Figure 16. The mAP of the training data was 84.9% for the preprocessed image learning model, 82.0% for the typical preprocessed image learning model, and 78.0% for the raw image learning model. The mAP of the test data was 51.2%, 43.5% and 40.8%, respectively.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & \multicolumn{2}{c}{**Image with**} & \multicolumn{2}{c}{**Image with Typical**} & \\  & \multicolumn{2}{c}{**Preprocessing**} & \multicolumn{2}{c}{**Preprocessing**} & \multicolumn{2}{c}{**Raw Image**} \\  & \multicolumn{2}{c}{**Method we Proposed**} & \multicolumn{2}{c}{**Method**} & \\ \hline \multicolumn{5}{c}{**AP**} \\ \hline \multirow{2}{*}{Training} & Black defect & 81.6\% & 78.9\% & 71.3\% \\  & White defect & 88.2\% & 85.1\% & 84.7\% \\ \hline \multirow{2}{*}{Test} & Black defect & 48.3\% & 46.3\% & 43.5\% \\  & White defect & 54.0\% & 40.6\% & 38.1\% \\ \hline \multicolumn{5}{c}{**mAP**} \\ \hline \multicolumn{5}{c}{Training} & 84.9\% & 82.0\% & 78.0\% \\  & Test & 51.2\% & 43.5\% & 40.8\% \\ \hline \hline \end{tabular}
\end{table}
Table 3: mAP for the preprocessed and raw images.  
Figure 15: (**a**) Mask image for the location of welding defects, (**b**) example of preprocessed image test result, and (**c**) example of typical preprocessed image test result, and (**d**) example of raw image test result.  
Figure 16: _Cont._