# DVCW-YOLO for Printed Circuit Board Surface Defect Detection
## 4 Experiments and Analysis of Results
### Experimental Comparative Analysis
#### 4.3.2 Optimize the Module Ablation Experiment  
To verify the performance of each optimization operation, ablation experiments were conducted on DWConv, C2 fCBAM, VOVGSCSP, and WIOU loss functions in the backbone and neck networks, respectively. Four sets of experiments were designed to evaluate different optimization strategies by incorporating various modules into the YOLOv8n model, with each experiment using identical training parameters. The experimental results are presented in Table 2.  
An analysis of Table 2 reveals several key performance improvements when comparing the YOLOv8n-D model to YOLOv8n. Specifically, the mAP of YOLOv8n-D increased by 3.9%, the FPS improved by 0.5, the model's FLOPs decreased by 1.2 G, and the number of parameters was reduced by 0.57 M. These findings indicate that the incorporation of the DWConv convolution operation not only enhances detection accuracy but also reduces the model's parameter count, contributing to a lighter model. When comparing YOLOv8n-DV to YOLOv8n-D, the mAP of YOLOv8n-DV slightly decreased by 0.4%, but FPS increased by 1.5, FLOPs reduced by 0.7 G, and the number of parameters decreased by 0.12 M. This suggests that while the addition of VOVGSCSP leads to a minor reduction in detection accuracy, it effectively boosts detection speed and reduces model complexity. The further  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Attention Mechanism of** & & & & & & \\
**YOLOv8n Model** & **P/\%** & **R/\%** & **mAP0.5/\%** & **FPS (f/s)** & **FLOPs/G** & **Parameters/M** \\
**Backbone Network** & & & & & & \\ \hline NONE & 96.1 & 95.0 & 95.3 & 41.6 & 8.9 & 3.15 \\ +GAM & 98.2 & 99.0 & 99.0 & 18.8 & 18.0 & 7.87 \\ +LSK & 98.2 & 99.0 & 99.1 & 35.7 & 9.3 & 3.35 \\
**+CBAM** & 98.4 & 99.4 & 99.3 & 41.2 & 8.9 & 3.17 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Performance comparison of three attention mechanisms.  
comparison of YOLOv8n-DVM with YOLOv8n-DVW shows a 0.4% improvement in mAP, with no changes in detection speed or model complexity. These results indicate that the YOLOv8n-DVM model, optimized with the WIOU loss function, enhances the quality of detection anchor frames, improves the model's attention to small samples, and ultimately boosts detection accuracy. Finally, in comparison with YOLOv8n-DVW, the DVCW-YOLO model shows a 0.2% increase in mAP, a slight decrease of 0.3 in FPS, no change in FLOPs, and a marginal increase of 0.01 M in parameters. This suggests that the C2 fCBAM structure used in DVCW-YOLO effectively improves detection accuracy, with only a minimal increase in model size.  
To further analyze the impact of different modules on model performance, the trends of the detection loss value and mAP for each detection model were compared across training iterations, as shown in Figure 9. Under the same threshold, the DVCW-YOLO model outperforms the other models. As seen in Figure 9a, after 50 iterations, the loss curves for all models fluctuate within a small range, but the DVCW-YOLO model consistently exhibits the lowest loss, indicating that the model's predictions are closer to the actual labels in the training data. Additionally, the DVCW-YOLO model and the YOLOv8n-DVW model converge significantly faster than YOLOv8n-DV, YOLOv8n-D, and YOLOv8n, suggesting that the C2 fCBAM and WIOU loss functions facilitate optimization efficiency. Figure 9b illustrates that the mAP value of DVCW-YOLO model converges more quickly than the other four models and tends to stabilize after training 50 epochs. This confirms that the DVCW-YOLO model effectively performs PCB defect detection and exhibits clear overall performance advantages.