# Steel Surface Defect Detection Based on YOLOv8-TLC
## 4 Experimental Results and Analysis
### Analysis of Realization Results
#### 4.3.3 Ablation Experiment  
To validate the effectiveness of the newly added detection head (A), the constructed Triplet Spatial Pyramid Module (B), the introduced attention mechanism (C), and the C2f-DS module (D) in the detection of surface defects in steel, six sets of ablation experiments were designed. The effectiveness of the improvements made to the YOLOv8-TLC algorithm is validated in Table 7, with the P-R curve of the original YOLOv8n algorithm shown in Figure 11. Building on this, the new detection head, TSP, LSK-Attention, and C2f-DS modules were sequentially integrated, resulting in the P-R curve for YOLOv8-TLC, depicted in Figure 12. Visual representations of some results are shown in Figure 13. The newly added detection head successfully identified targets that were previously unrecognized, leading to a 0.7% increase in mean average precision (mAP). Additionally, the proposed TSP structure enhanced the network's ability to learn important features, resulting in a 1.1% improvement in mAP and an increase in processing speed to 25.1 frames per second. Following this, the LSK-Attention mechanism was introduced to fully exploit the required spatial structural information, further enhancing mAP by 1%. Finally, optimization of the C2f module through DSConv not only improved detection accuracy but also achieved high computational speed with low storage requirements, thereby enhancing the overall efficiency of the defect detection model. The comparison of detection results for the improved algorithm is illustrated in Figure 14, where, aside from a slight decrease in the detection capability for scratch defects, all other defect categories exhibited improved detection performance. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Parameters/10\({}^{6}\)**} & \multirow{2}{*}{**mAP/(\%)**} & \multicolumn{6}{c}{**AP/(\%)**} \\ \cline{3-10}  & & & **Cr** & **In** & **Pa** & **Ps** & **Rs** & **Sc** \\ \hline YOLOv8+ BIG + TSP + LSK + C2f-faconv & 5.34 & 78.1 & 42.5 & 83.7 & **95.1** & 81.6 & 71.8 & 93.9 \\ YOLOv8 + BIG + TSP + LSK + C2f-doconv & 5.58 & 79.1 & 43.3 & 84.4 & 93.5 & **86.4** & 71.4 & 95.4 \\ YOLOv8 + BIG + TSP + LSK + C2f-dysnake & 5.45 & 78.5 & 42.7 & **86.4** & 93.9 & 81.7 & 70.8 & 95.4 \\ YOLOv8 + BIG + TSP + LSK + C2f-dcnv2 & 5.24 & 78.2 & 45.2 & 81.7 & 93.3 & 80.7 & **74.5** & 93.7 \\
**YOLOv8 + BIG + TSP + LSK + C2f-DS (ours)** & **5.20** & **79.8** & **50.1** & 82.6 & 93.4 & 84.8 & 72.3 & **95.4** \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of different convolution modules. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**mAP/(\%)**} & \multicolumn{6}{c}{**AP/(\%)**} \\ \cline{3-10}  & & **Cr** & **In** & **Pa** & **Ps** & **Rs** & **Sc** \\ \hline YOLOv8 + BIG + TSP + GAM & 78.2 & 45.3 & 77.3 & 92.5 & 91.5 & 69.1 & 93.5 \\ YOLOv8 + BIG + TSP + CBAM & 78.1 & **47.3** & 81.3 & 92.9 & 91.6 & 64.9 & 90.3 \\ YOLOv8 + BIG + TSP + GE & 77.7 & 47.0 & 80.6 & 88.9 & 94.9 & 66.3 & 88.5 \\ YOLOv8 + BIG + TSP + EVC & 78.2 & 44.6 & 80.1 & 92.5 & **98.0** & 64.5 & 89.2 \\
**YOLOv8 + BIG + TSP + LSK (ours)** & **79.5** & 43.2 & **82.7** & **95.3** & 83.2 & **78.2** & **94.3** \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of different attention mechanisms. Figure 11: P-R curve of YOLOv8n algorithm.