Abstract:Aiming at the problem that the detection accuracy of PCB surface defects is insufficient and it is difficult to balance the detection accuracy and real-time performance of the model, which cannot meet the stable operation requirements of modern electronic manufacturing systems, an improved PCB surface defect detection method named HDH.YOLO is proposed. This method replaces the backbone network of the original YOLO11 with an optimized HGNetV2 to achieve model lightweighting. It also improves the HGBlock by referring to the idea of Dynamicconv, and replaces the last four HGBlocks in the HGNetV2 network with the improved Dynamic_HGBlock. This approach introduces more network parameters without significantly increasing the computational load, thereby enhancing the network′s ability to learn generalized features and improving detection accuracy. In addition, a DSM attention mechanism layer is added at the end of the backbone network to enhance the model′s feature extraction capability by amplifying the spatial and frequency domain responses of key regions. Comparative experiments and ablation studies were conducted on the PKU-Market PCB and DeepPCB datasets. The results show that, compared with the baseline YOLO11n model, the proposed HDH-YOLO model reduces the number of parameters by 6.20% and the computational load by 12.70%, while increasing the mAP50 and mAP50.95 by 2.6% and 2.3%, respectively. HDH.YOLO thus achieves a better balance between lightweighting and detection accuracy and demonstrates high reliability and practicality in modern electronic manufacturing systems.