## 1 Introduction
proposed an improved low-complexity NCC method to locate missing ICs on PCBs by converting 2D sub-images to 1D feature descriptors and performing computations in the Transform domain, which results in improved speed and robustness to noise [24]. [PERSON] et al. introduced an end-to-end deep learning model that uses an improved YOLOv5 model in combination with transformers to quickly and accurately detect and classify manufacturing defects on PCBs, greatly reducing the number of parameters in the model while achieving superior performance [25]. In addition, there are other studies to improve YOLO small object detection, such as YOLO-Z (reference [26]), which enhances small object detection by improving the feature pyramid, but relies on static channel attention (such as SE module) and does not solve the problem of spatial-channel information fragmentation. Transformer-YOLO (reference [27]) uses self-attention to capture global relationships, but its high computational complexity makes it difficult to adapt to real-time detection. The attention mechanism mentioned in this study dynamically adjusts the number of channel groups through the progressive channel compression strategy to reduce redundant calculations, and strengthens the response of small target features through bidirectional weight allocation, which is superior to the traditional attention in focusing the missing solder joint. The rapid development of deep learning technology has provided new solutions in the field of PCB defect detection [28], and the use of deep learning for PCB defect detection has become a mainstream trend. In this study, we explored an improved deep-learning model to further enhance the accuracy and efficiency of PCB defect detection. To further enhance the detection of various PCB defects, this study proposes a more accurate and lightweight model based on the YOLOv8n network. The main innovations and improvements introduced in the approach include the following:  
1. Adding the SCSA attention mechanism enhances the generalization ability in visual tasks such as image classification, target detection, and semantic segmentation. 2. Introducing Unified-IoU loss function, optimized for high-quality targets. Unified-IoU introduces the FocalBox method, which allocates weights by scaling the prediction frames with the real frames and employs an annealing strategy (introducing the dynamic parameter epoch), which gradually shifts the model's attention from the low-quality prediction frames to the high-quality prediction frames, balancing the training speed and detection accuracy. 3. The backbone part combines the Universal Inverted Bottleneck (UIB) module of MobileNetV4 to form the C2 fUIB model, which improves the performance of the lightweight network, and the MobileMQA attention mechanism further optimizes the inference speed of the mobile gas pedal. 4. The neck part combines the novel network structure of SDI and ASF-YOLO to enhance the performance of target detection and segmentation tasks. The SDI module and the weighted bidirectional feature pyramid network of ASF-YOLO enhance the semantic and detailed information of the image to achieve excellent performance in instance segmentation. 5. The effectiveness of each part of this paper and the performance advantages of the proposed algorithm are verified by image enhancement, ablation experiments, and comparison experiments on the PKU-MARKET-PCB public dataset.