# Research on Seamless Fabric Defect Detection Based on Improved YOLOv8n
## 4 Experiment and Result Analysis
### Ablation Experiments  
To verify the effectiveness of the proposed improvement in seamless fabric defect detection, a set of ablation experiments is designed. The experiment evaluates the performance improvement of each module on the network model by adding LSKA improved SPPF module, modifying the CARAFE upsampling method, introducing a small object detection layer, and optimizing the OREPA technology of the C2f module. The specific ablation experiment data is shown in Table 4.  
According to the results, in Experiment 2, the YOLOv8n model is improved by adding SPPF_LSKA; although the recall rate decreased, the precision and [EMAIL_ADDRESS] indicators are both improved by 2.2% and 0.4%, respectively. This result indicates that the addition of SPPF_LSKA helps enhance sensitivity to fabric defects. In Experiment 3, after adding a small object detection layer, although the computational complexity of the model increased, the precision, recall, and [EMAIL_ADDRESS] indicators were significantly improved, increasing by 5.6%, 7.1%, and 3.7%, respectively. This improvement significantly enhances the model's ability to detect small folds and slight arc edges on fabric surfaces. In Experiment 4, by replacing the CARAFE upsampling module, the performance indicators of the model are also improved, indicating that CARAFE upsampling can better capture the details and boundaries of surface defects on fabrics of different colors. In Experiment 5, the addition of the C2f_OREPA module not only improves the precision, recall, and [EMAIL_ADDRESS] of the model but also reduces the computational complexity by 0.5G. Comparing Experiment 7 and Experiment 8, it can be seen that the model performance has been further improved, indicating that this module helps accelerate model convergence.  
As shown in Table 4, when each improvement scheme is applied separately, the detection performance of the model is improved compared to YOLOv8n. The results of experiments 6, 7, and 8 further indicate that when the four improvement schemes are integrated into YOLOv8n, the model performance is significantly improved, and the model becomes more stable. In the end, the improved model in this paper improves recall, precision, and [EMAIL_ADDRESS] by 7.3%, 8.5%, and 5.1%, respectively, compared to the baseline model YOLOv8n. Figures 10 and 11 show that the improved model converges faster and has a larger area under the P-R curve, resulting in more stable overall performance.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Number**} & **SPPF\_** & **Small-** & \multirow{2}{*}{**CARAFE**} & **C2f\_** & **P/** & \multirow{2}{*}{**R/\%**} & \multirow{2}{*}{**AP\_**\%**} & \multirow{2}{*}{**AP\_**\%**} & **Parameters/** & \multirow{2}{*}{**FLOPs/G**} \\  & **LSKA** & **Layer** & & & & & & & & & & \\ \hline
1 & \(\times\) & \(\times\) & \(\times\) & \(\times\) & 89 & 84.3 & 85.3 & 97.7 & 91.5 & 3.0 & 8.2 \\
2 & \(\surd\) & \(\times\) & \(\times\) & \(\times\) & 91.2 & 83.7 & 86.7 & 97 & 91.9 & 3.2 & 8.3 \\
3 & \(\times\) & \(\surd\) & \(\times\) & \(\times\) & 94.6 & 91.4 & 92.9 & 97.4 & 95.2 & 2.9 & 12.6 \\
4 & \(\times\) & \(\times\) & \(\surd\) & \(\times\) & 91.3 & 90.4 & 89.3 & 97.3 & 93.6 & 3.1 & 8.5 \\
5 & \(\times\) & \(\times\) & \(\times\) & \(\surd\) & 92.3 & 84.3 & 85.9 & 98.1 & 92 & 3.5 & 7.7 \\
6 & \(\surd\) & \(\surd\) & \(\times\) & \(\times\) & 95.7 & 91.3 & 93.4 & 97.5 & 95.4 & 3.3 & 12.9 \\
7 & \(\surd\) & \(\surd\) & \(\surd\) & \(\times\) & 96.4 & 91.2 & 94 & 97.7 & 95.8 & 3.4 & 14 \\
8 & \(\surd\) & \(\surd\) & \(\surd\) & \(\surd\) & 96.3 & 92.8 & 94.7 & 98.6 & 96.6 & 4 & 13.2 \\ \hline \hline \end{tabular} \(\surd\) indicates the use of the algorithm, \(\times\) indicates not in use of the algorithm, and f and a represent folds and arc edges, respectively.  
\end{table}
Table 4: Ablation experiments.