# Fabric Defect Detection Based on Improved Lightweight YOLOv8n
## 3 Result and Discussion
### Ablation Experiments  
To validate the effectiveness of each improvement module in the proposed GSL-YOLOv8n algorithm, we conducted eight sets of ablation experiments on the fabric defect dataset. The evaluation metrics included model size, GFLOPs, FPS, model parameters, and [EMAIL_ADDRESS]. Based on YOLOv8, we replaced standard convolutions with Ghost convolutions, upgraded the detection head to the newly designed shared convolution detection head (LSCDH), and introduced the SimAM attention mechanism. The detection results are shown in Table 3, where \"\(\surd\)\" indicates the use of the corresponding module. Based on the experimental results presented in Table 3 the following observations can be made: (1) Complexity Reduction with Ghost Convolutions: By replacing the standard convolutions in the YOLOv8 network with Ghost convolutions, the model size decreased by 39.7%, the computation and parameter count were reduced by 38.3% and 43.0%, respectively, and the [EMAIL_ADDRESS] increased by 0.46% compared to the unmodified YOLOv8 model. (2) Improvement with SimAM Attention Mechanism: To address the multi-scale feature problem of textile defects, the SimAM parameter-free attention mechanism was introduced. Figure 6: Confusion matrix. The left matrix represents the data without augmentation, and the right matrix shows the data with augmentation. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Experiment** & **Ghost** & **SimAM** & **LSCDH** & **Model Size/MB** & **GFLOPs/G** & **Parameters** & **FPS/(Frame-s-1)** & **[EMAIL_ADDRESS]/\%** \\ \hline
1 & & & & 6.3 & 8.1 & 3,006,818 & 239.6 & 97.70 \\
2 & \(\surd\) & & & 3.8 & 5.0 & 1,715,246 & 236.2 & 98.15 \\
3 & & \(\surd\) & & 6.3 & 8.1 & 3,006,818 & 301.5 & 98.16 \\
4 & & & \(\surd\) & 5.0 & 6.5 & 2,362,713 & 299.4 & 98.02 \\
5 & \(\surd\) & \(\surd\) & & 3.7 & 5.0 & 1,687,566 & 244.9 & 97.99 \\
6 & \(\surd\) & & \(\surd\) & 2.5 & 3.5 & 1,071,141 & 226.9 & 97.75 \\
7 & & \(\surd\) & \(\surd\) & 4.0 & 6.1 & 1,878,617 & 299.2 & 97.99 \\
8 & \(\surd\) & \(\surd\) & \(\surd\) & 2.1 & 3.4 & 981,381 & 238.9 & 98.29 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Dissolution experiment results. This resulted in a 0.46% increase in [EMAIL_ADDRESS] and a 25.8% increase in FPS without increasing the model size, parameters, or computational load. This implies that SimAM enhances the model's ability to select relevant features, allowing it to locate and process important features more quickly and reducing the time spent on irrelevant features, thus improving inference efficiency. (3) Network Lightweighting with LSCDH: To further lightweight the network, replacing the original YOLOv8 detection head with the shared convolution detection head (LSCDH) resulted in a model size reduction of 20.6%, computation and parameter count decreases of 19.8% and 21.4%, respectively, and an [EMAIL_ADDRESS] improvement of 0.33%. (4) Combination of improvements: After replacing the standard convolutions in YOLOv8 with Ghost convolutions and introducing SimAM, the model size and parameter count decreased by 41.3% and 43.9%, respectively, with the [EMAIL_ADDRESS] increasing to 97.99. Replacing the detection head with LSCDH after introducing Ghost convolutions resulted in model size and parameter count reductions of 60.3% and 56.8%, with the [EMAIL_ADDRESS] increasing to 97.75. Combining all three improvements (Ghost convolutions, SimAM, and LSCDH) into the YOLOv8 model, creating the GSL-YOLOv8 model, resulted in reductions of 66.7% in model size, 58.0% in computation, and 67.4% in parameter count, with the FPS remaining nearly constant and the [EMAIL_ADDRESS] improving by 0.60%. The ablation experiments indicate that each improvement point and their combinations positively impacted the model's performance, demonstrating that the proposed algorithm effectively enhances the original model's capability to detect fabric defects. Figure 7 compares the training performance of the baseline YOLOv8 and the improved GSL-YOLOv8 models across four key metrics.