## 3 Experiments and Analysis
### Comparison of Performance Analysis Results of Various Algorithms  
In order to verify the advantages of the selected detector head, this paper selected some commonly used ones to improve the original YOLOv8n model; the experimental results are shown in Table 2, from which it can be seen that the detector head designed in this paper compared to other ones maintains a high accuracy while reducing the amount of model calculation. In order to verify the advantages of the improved algorithms, other improved algorithms in the literature were selected to compare with the Improved_YOLOv5s model in this paper. The average accuracy comparison results of various algorithms are shown inTable 3. [PERSON] [21] proposed a PCB defect detection algorithm based on CDI-YOLO. The YOLOv7 is improved by introducing the CA (Coordinate Attention) mechanism, DSConv (Depthwise Separable Convolution), and Inner-CIOU; [PERSON] [22] proposed a PCB defect detection algorithm based on MSD-YOLOv5. On the basis of YOLOv5, the lightweight MobileNet-v3 network is combined with the CSPDarknet53 network. Additionally, an attention mechanism is introduced to highlight important feature channels. Finally, the coupled detection head is replaced with a decoupled detection head. [PERSON] [23] proposed a lightweight LW-YOLO model based on YOLOv8. On the basis of YOLOv8, a bidirectional feature pyramid network for multi-scale feature fusion, a partial convolution module for reducing redundant computations, and a minimum point distance intersection over union loss function for simplifying optimization and improving accuracy are integrated. [PERSON] [24] proposed an improved PCB surface defect detection algorithm PCB-YOLO based on YOLOv5. Based on YOLOv5, the K-means++ algorithm is incorporated, and the Swin transformer is embedded into the backbone network to construct a joint attention mechanism. Finally, DSConv is introduced to achieve model size compression. [PERSON] [25] proposed an enhanced YOLOv5s network named YOLO-MBBi to detect PCB surface defects. On the basis of YOLOv5, we aim to replace layers in the YOLOv5s network with Mobile Inverted Residual Bottleneck (MBConv) blocks, Convolutional Block Attention Module (CBAM) attention, Bidirectional Feature Pyramid Network (BiFPN), and Depthwise Convolutions (DWConv). Furthermore, during training, we intend to substitute the CIOU loss function with the SIoU loss function. Moreover, in this paper, the latest YOLOv7n and YOLOv8n are selected for experiments. From Table 3, it is seen that the improved model in this paper improves the mAP by 2.8%, 2.1%, 1.3%, 3.1%, 2.2%, 3.5%, 3.3%, and 3.8% compared to other algorithms. The model volume is 4.1 M and FPS is 144.1, which meets the requirements of real-time as well as lightweight portable deployment. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Experiment** & **SCConv** & **Triplet** & **SLCD** & **WIoU** & **Recall** & **Precision** & **mAP** & **FLOPs/G** \\ \hline VI & \(\surd\) & \(\surd\) & \(\times\) & \(\times\) & 0.951 & 0.989 & 0.968 & 8.1 \\ VII & \(\surd\) & \(\surd\) & \(\surd\) & \(\times\) & 0.949 & 0.984 & 0.969 & 5.9 \\ VIII & \(\surd\) & \(\surd\) & \(\times\) & \(\surd\) & 0.954 & 0.995 & 0.981 & 5.9 \\ IX & \(\surd\) & \(\surd\) & \(\surd\) & \(\surd\) & 0.965 & 0.998 & 0.986 & 5.9 \\ \hline \hline \end{tabular} Note: FLOPs/G measures the floating-point calculation number by \(10^{9}\) operations. \(\surd\) represents adding this module, \(\times\) represents not adding this module.  
\end{table} 
Table 1: _Cont._ \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Head** & **Precision** & **mAP** & **FLOPs/G** \\ \hline Baseline & 0.967 & 0.948 & 8.2 \\ AuxHead & 0.978 & 0.958 & 11.2 \\ DynamicHead & 0.977 & 0.955 & 11.8 \\ SEAMHead & 0.959 & 0.943 & 7.1 \\ This work & 0.981 & 0.959 & 6.1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of the effect of different detection heads.