## 5 Conclusions  
PCB soldering defect segmentation plays a crucial role in the quality control of PCBs. In this study, we propose an improved method for PCB soldering defect segmentation based on UNet. To address the issue of low segmentation accuracy, our proposed model replaces the encoder with the VGG16 encoder. By deepening the network's feature extraction part to enhance the encoder's feature extraction capabilities, we aim to capture more detailed edge features of defect contours.  
Additionally, we introduce a hybrid attention module based on channel attention and dynamic spatial attention, replacing the simple skip connections in the UNet structure. This helps to mitigate interference from complex backgrounds and facilitates the better acquisition of defect information.  
In the decoder network part, we employ the residual GSConv module to fuse features from different depths, enhancing the feature fusion capabilities and better restoring the detail information in the image.  
Finally, we design a hybrid loss function combining the Dice loss and focal loss to enhance the model's ability to distinguish between defects and backgrounds.  
The experimental results demonstrate that our model achieves significant segmentation performance while maintaining a fast detection speed and a lower number of model parameters. In future work, we will continue to investigate the influence of different parameters on model training and apply the model to other PCB defects.  
Conceptualization, Z.L. and X.L.; methodology, Z.L.; software, Z.L.; validation, Z.L.; formal analysis, Z.L. and X.L.; investigation, Z.L.; resources, Z.L. and X.L.; data curation, Z.L.; writing--original draft preparation, Z.L.; writing--review and editing, Z.L. and X.L.; visualization, Z.L.; supervision, X.L.; project administration, X.L.; funding acquisition, X.L. All authors have read and agreed to the published version of the manuscript.  
This research was supported in part by the Academician (Expert) Workstation Fund Project of Sichuan Province of China, under Grant 2016 YSGZZ01; in part by the Special Fund for Training High Level Innovative Talents of Sichuan University of Science and Engineering, under Grant B12402005; in part by the Sichuan University of Science and Engineering for Talent Introduction project, under Grant 2021 RC16; in part by the Project of Sichuan University of Science and Engineering for Research on the Ideological and Political Construction of Machine Learning Curriculum, under Grant SZ20204; and in part by the Innovation Fund of Postgraduate, Sichuan University of Science & Engineering, under Grant Y2024117.  
Figure 6: Segmentation results for each method. (**a**) Original figure. (**b**) Ground truth. (**c**) DeepLab3 plus. (**d**) SegFormer-B1. (**e**) PSPNet-ResNet50. (**f**) UNet. (**g**) HRNet-W32. (**h**) Our method.  
Data Availability Statement: The data that support the findings of this study are available at the online repository of Baidu ([[https://pan.baidu.com/s/1_xLYqL18](https://pan.baidu.com/s/1_xLYqL18) HwxcsBO3i0 wsyQ]([https://pan.baidu.com/s/1_xLYqL18](https://pan.baidu.com/s/1_xLYqL18) HwxcsBO3i0 wsyQ), access code: 2516, accessed on 20 July 2024).  
The authors declare no conflicts of interest.