Abstract:Ultrasonic welding is widely used in high-precision connections due to its environmentally friendly and high efficiency. However, surface defects in ultrasonic welding vary widely in size and contain significant background noise. Current deep learning-based industrial surface defect detection networks struggle to balance detection accuracy and computational efficiency. To address these challenges, this paper proposes a lightweight object detection network for ultrasonically welded wire harness terminal surface defects. First, a multi-scale feature extraction module (MSWT) using the wavelet transform is proposed. Second, an efficient multi-scale residual block (EMR) is proposed, leveraging residual structures and re-parameterization techniques to enhance multi-scale feature representation. Third, a contextual and spatial feature calibration module (CSFC)is applied to the network to fuse contextual features, enhancing the detection of small objects and the network’s ability to recognize global information. To verify the network’s effectiveness, a dataset of surface defects in ultrasonically welded wire harness terminals (UWSD) is constructed in a real-world production environment. Experimental evaluation on the UWSD dataset shows that UWSDLNet achieves an accuracy of 93.6% and a mean average precision (mAP) of 88.2% with a computational overhead of 2.24×106 and a model size of 4.9×106. In addition, the good performance on the public dataset NEU-DET demonstrates the generalization ability and stability of UWSDLNet, showing its broad prospects in the field of industrial defect detection.