# Metal Surface Defect Detection Using Modified YOLO
## 4 Experiments and Results
### Comparison of the Improved Model with the YOLOv3 Model  
In order to demonstrate the feasibility of the proposed method, this paper compares and analyzes the improvement points one by one. In terms of speed, the two neural network models are very similar. In terms of accuracy, the improved YOLOv3 model turns out to be slightly superior.  
K-Means++ and K-Means are used to cluster the dataset, respectively. As shown in Table 3, the mAP using K-Means++ clustering is 75.1%, which is 3.02% higher than that of YOLOv3 using K-Means. The results show that K-Means++ can play a role in optimizing clustering centers, strengthening positioning, and improving the detection accuracy of the algorithm.  
Table 4 shows the comparison of the detection accuracy of various types of defects on the dataset of YOLOv3 before and after the improved network structure. The K-Means++ clustering algorithm is used to cluster the generated Anchor Box. According to the analysis of Table 3, the mAP after the improvement of the network structure is 75.1%, which is 1.03 times of that before the improvement. The modified network structure has significantly improved the accuracy of various detections, especially the detection of small defect targets. For example, the detection accuracy of deformation is 62.8%, which is 11.8% higher than that of YOLOv3 before the improvement. In Table 4, the classification accuracy of the scratches detected by the proposed model is worse than the original one. The reason is that the improved model can detect small targets more accurately. However, the metal surface texture is very clear after image preprocessing, so that some metal surfaces are wrongly detected as scratches resulting in a decrease in accuracy.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Defects/AP(\%)** & **The Original Model** & **The Improved Model** \\ \hline Deformations & 55.4 & 62.8 \\ Scratches & 68.1 & 66.0 \\ Wrinkles & 95.1 & 96.4 \\ \hline
**Precision** & 0.746 & 0.792 \\
**Recall** & 0.677 & 0.715 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Results before and after network improvement.  
Figure 9: The curve of the mAP. The abscissa is the number of the iterations. Furthermore, the \(y\)-axis is the value of the prediction, recall, [EMAIL_ADDRESS], and [EMAIL_ADDRESS]:0.95.  
The precision is also called the accuracy rate. It shows how many samples of the predicted results are correct. The precision represents the generalization ability of a model. The recall refers to how many positive samples of the predicted results are correctly detected. When \(Recall=1\), there are no missed tests. The AP curve is calculated by the area enclosed under the curve of precision and recall. As shown in Table 4, the value of the precision increased by 6.2% while the value of the recall increased by 5.6%. This indicates that the improved model reduces the false negative error rate, so that the additional costs in the next stage of the production line can also be reduced.  
Using the YOLOv3 and the modified model detect metal surface defects, respectively, as shown in Figure 10. Comparing the YOLOv3 and the improved model in this paper, it can be clearly seen that the improved model in this study detects all the small defect targets. In the detection of the three types of defects, the detection effect of the improved model in this paper is better than that of the YOLOv3, indicating that the improved model can effectively reduce the probability of missed detection.  
Therefore, the comprehensive performance of the proposed model is optimal and meets the requirement of higher precision of metal defect detection.