## 1 Introduction
[27] proposed a joint training strategy of Faster R-CNN and Mask R-CNN to achieve intelligent pavement crack detection. Compared with YOLOv3, it improves the performance but leads to a decrease in Mask R-CNN bounding box detection. [PERSON] et al. [28] proposed a method to improve the detection accuracy by first preprocessing the tile images with uneven illumination, complex surface texture, and low contrast using an adaptive histogram homogenization method with restricted contrast, and then using Mask R-CNN for defect detection. [PERSON] et al. [29] proposed a scheme of adding a guided anchor frame algorithm to produce an anchor based on Faster R-CNN to achieve intelligent detection of surface defects of three parts, which substantially improved the detection accuracy of the model. Compared with other algorithms, YOLO series algorithms have non-negligible advantages. [PERSON] et al. [30] proposed a YOLOv5-based model for the detection of surface defects in kiwifruit, which provides an efficient and intelligent way of post-production quality inspection for agriculture. [PERSON] et al. [31] proposed a YOLOv5-based algorithm to achieve unmanned quality inspection of tile surface defects on production lines for the current problem that manual quality inspection cannot be avoided on tile surfaces. The results show that the accuracy of the YOLOv5 model is higher than that of Faster R-CNN, SSD, and YOLOv4. [PERSON] et al. [32] used the DBSCAN+K-means clustering algorithm based on YOLOv3 to re-cluster Anchor under Avg IOU criterion, add residual units, and introduce SE attention mechanism to increase the model-specific feature extraction capability to achieve the improvement of YOLOv3 for PCB defect detection accuracy and speed. The above case study provides the feasibility of choosing YOLOv5 for defect detection in IGBT solder layers. There is a lack of research on the use of deep learning for the detection of bubble defects in the solder layer of IGBT modules, so this paper collects a dataset of labeled IGBT solder layer bubble defects. Considering that the more complex detection process of the two-stage algorithm and the network structure leads to a slower detection speed,which cannot meet the requirements of industrial quality inspection in real-time. Low confidence in the prediction results of the anchor-free frame algorithm. The regression-based, one-stage algorithm is faster and more practical to meet the requirements of industrial real-time unmanned quality control. This paper presents an improved YOLOv5-based defect detection model for IGBT solder layers. The main contributions of this research are as follows:  
1. A tiny bubble detection layer that integrates deep feature information and shallow feature information is added to improve the model's ability to detect small bubbles. 2. To speed up model convergence by optimizing anchor frame parameters. 3. We change the EIoU loss function to the bounding box loss function to solve the sample imbalance of the dataset. 4. Combine the Swin Transformer structure to improve the convolution module, form a new feature extraction module and introduce it into the backbone layer to improve the detection accuracy. In the remainder of this paper, Section 2 introduces the YOLOv5 base model. We explain our proposed methodology in Section 3, while experimental details and results are discussed in Section 4. Finally, a brief conclusion is given in Section 5.