## 4 Experimental Results
### Comparison Experiments  
To demonstrate the effectiveness of our proposed method, we compared several common segmentation methods for defect segmentation, including UNet [23], DeepLabv3 plus [33], SegFormer [34], PSPNet [35], and HRNet [36]. We used the mIoU, mPA, number of model parameters, and FPS as evaluation metrics in the experiments on the PCB soldering defect dataset. The comparison results are presented in Table 6, and the specific IoU values for the background and each defect using the different methods are provided in Table 7. From the experimental results, it can be observed that DeepLabv3 plus did not perform well for small defects like SS, resulting in a relatively low overall mIoU and a large number of model parameters with a slower speed. Although SegFormer had the smallest number of model parameters and the fastest speed, its performance in terms of the mIoU and mPA was not outstanding. PSPNet exhibited a faster detection speed but had a larger number of model parameters and relatively lower segmentation performance. While UNet had fewer parameters and a faster detection speed, its mIoU was only 77.40% and the mPA was 83.11%. HRNet demonstrated higher segmentation accuracy but had a larger number of model parameters and a slower detection speed. None of the mentioned algorithms could simultaneously achieve high segmentation accuracy, a fast detection speed, and a low number of model parameters. In contrast, our proposed method achieved the highest mIoU and mPA, reaching 81.74% and 87.33%, respectively. Compared to UNet, there was an improvement of 4.34% and 4.22% in the mIoU and mPA, respectively. Moreover, our method outperformed the others in the segmentation of each defect, especially for the most challenging MP and SS defects, surpassing other methods significantly while maintaining a lower number of model parameters and a faster detection speed. Compared to the other methods, it achieved the best overall performance.  
Additionally, Figure 6 provides the segmentation results of various methods for different types of defects. All methods performed well in segmenting defects with large and regular shapes. However, as shown in the comparison of the second row of images, DeepLab3 plus, SegFormer, and UNet failed to detect small SB defects. From the comparisons in the first and third rows of images, it can be observed that the other methods did not fully capture the details of certain defects in their segmentation. In contrast, our method demonstrates stronger detection capabilities and a superior detail segmentation ability for small defect targets.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Method** & **mIoU/\%** & **mPA/\%** & **Parameters/M** & **FPS** \\ \hline DeepLab3 plus & 71.70 & 80.56 & 54.71 & 25.50 \\ SegFormer-B1 & 75.26 & 83.76 & 13.68 & 60.93 \\ PSPNet-ResNet50 & 76.60 & 84.23 & 46.71 & 39.19 \\ UNet & 77.40 & 83.11 & 19.59 & 39.57 \\ HRNet-W32 & 78.27 & 85.56 & 29.54 & 22.31 \\ Ours & 81.74 & 87.33 & 22.13 & 30.16 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Comparison results of different methods.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Method** & \multicolumn{6}{c}{**IoU**} \\ \cline{2-7}  & **BG** & **MP** & **MS** & **SB** & **SS** & **OD** \\ \hline DeepLab3 plus & 99.66 & 87.02 & 43.85 & 80.59 & 41.16 & 77.90 \\ SegFormer-B1 & 99.69 & 86.15 & 44.43 & 81.44 & 60.87 & 79.00 \\ PSPNet-ResNet50 & 99.72 & 88.37 & 43.00 & 81.78 & 65.28 & 81.43 \\ UNet & 99.74 & 88.03 & 52.40 & 84.69 & 56.57 & 82.99 \\ HRNet-W32 & 99.73 & 88.55 & 49.13 & 84.51 & 64.62 & 83.07 \\ Ours & 99.78 & 89.82 & 57.59 & 87.61 & 70.74 & 84.93 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Comparison of IoU results on background and defects for different methods.