# Steel Surface Defect Detection Algorithm Based on Improved YOLOv8n
## 3 Results
### Analysis of Experimental Results  
#### 3.4.1 Ablation Experiments  
To demonstrate the enhancement effect of each of our improvements to YOLOv8, we conducted five sets of ablation experiments separately. First, the DWR module was added to the sixth and eighth layers of the C2f structure in the backbone network, and then the DRB module was added outside the second, fourth, sixth, and eighth layers of the C2f structure. The DRB module was also added to the neck and head layers. In addition to that, a combination of DRB and DWR modules were added to the sixth and eighth layers in the C2f structure in the backbone network, and, lastly, the Inner-IoU loss function took the place of the original loss function. Each part of the modules corresponding to the above was added to the YOLOv8 model accordingly, and we report the experimental results of the various combinations of the improved modules. Table 1 shows the outcomes of our ablation studies.  
As it can be seen from Table 1, after replacing C2f in the backbone network with C2f_DWR, except for a slight decrease in recall and FPS, the rest of the metrics, such as mAP and precision, improved, with the mAP item experiencing a notable upgrade of 2.5 percentage points which was attributed to the excellent ability of DWR to extract the multiscale contextual information and then fuse the wildly formed by the multiscale fields into the feature maps, with a decrease in the number of parameters and computational effort. After substituting the C2f structure in the main network with the C2f_DRB structure, the DRB reparameterization module used a non-inflated small kernel and multiple inflated small kernel layers to augment a non-inflated large kernel convolutional layer, an approach which greatly reduced the number of parameters and significantly increased mAP and FPS, as well as FPS to 104. This was because DRB compensated for the inability of Cf2 to capture small-scale patterns between training sessions, thus improving the model's training and detection capabilities. Then, after substituting the loss function of YOLOv8 with the Inner-IoU loss function alone, while not affecting the size of the model parameters, there was a notable increase in accuracy, mAP, and FPS, with a 5.4% increase in accuracy, a 1.5% increase in mAP, and a 9% increase in FPS. Therefore, our improvement not only optimized the speed of the model, but also enhanced the detection of defects by the model, the average accuracy rate, and the speed of defect detection, indicating that our improvement is effective. The fourth set of experiments entailed the DWR module and the DRB module being combined to form a new C2f_DWR_DRB structure and, from Table 1, we can see that, except for the recall rate having declined, all other indexes experienced a great improvement, with the precision rate, mAP, and FPS improving by 2.1%, 4.6%, and 27%, respectively. The most obvious improvement was that experienced by the mAP and FPS indexes, as well as the quantity of calculations and the number of parameters. There was a decrease in the number of calculations and the number of parameters, showing that the C2f_DWR_DRB structure combined the advantages of the two respective modules. Finally, our DDI-YOLO experienced a decrease in recall, but all other metrics remained optimal. In summary, the improvement method of the model put forth in this research works well.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **P\%** & **R\%** & **mAP\%** & **Params/M** & **GFLOPs/G** & **FPS (Frames/s)** \\ \hline YOLOv8n & 69.2 & 77.4 & 75.9 & 3.01 & 8.1 & 99 \\ YOLOv8n + DWR & 71.7 & 76.8 & 78.4 & 2.95 & 8.0 & 95 \\ YOLOv8n + DRB & 68.1 & 75.6 & 76.6 & 2.62 & 7.4 & 104 \\ YOLOv8n + Inner-Iou & 74.6 & 72.5 & 77.4 & 3.01 & 8.1 & 108 \\ YOLOv8n + DWR + DRB & 73.8 & 71.6 & 78.0 & 2.66 & 7.5 & 126 \\ DDI-YOLO (ours) & 72.5 & 71.4 & 78.3 & 2.66 & 7.5 & 158 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Ablation experiment results.