Abstract:To address the challenges of complex defect morphology, strong background interference, and the strict requirements for real-time performance and lightweight deployment in printed circuit board (PCB) defect detection, an efficient lightweight detection model named KDYOLOv8 is proposed in this article, which integrates wavelet transform and knowledge distillation. Firstly, a Star-YOLO backbone network is designed, utilizing star operation to map input features into a high-dimensional non-linear space, thereby enhancing feature extraction capabilities for complex defect patterns while significantly reducing computational redundancy. Secondly, the wavelet transform convolution (WTConv) is introduced to decouple high-frequency defect details from low-frequency background textures through multi-resolution analysis, effectively suppressing noise interference and expanding the receptive field without significantly increasing parameters. Meanwhile, an EMBFPN enhanced multi-scale bi-directional feature pyramid network is constructed, employing a bi-directional information flow interaction mechanism to strengthen the fusion of deep and shallow features, addressing the problem of small defect feature dilution in deep networks. Furthermore, a channel-wise knowledge distillation (CWD) strategy is adopted to guide the lightweight model in learning the channel attention distribution of the teacher network, compensating for accuracy loss caused by model compression. Experimental results show that, on a public PCB defect dataset, KDYOLOv8 achieves a mean average precision (mAP) of 97.1%, with a model size of only 2.9 MB and an inference speed of 117.3 fps. Compared with the baseline YOLOv8n, it maintains high accuracy while reducing the volume by 52.5%. In cross-dataset generalization experiments, the detection accuracy for subtle defects such as “mouse bite” and “short” improved by 1.9% and 1.6%, respectively. This study effectively balances detection speed, accuracy, and resource consumption, providing strong support for industrial deployment in resource-constrained environments.