Abstract:In response to the issues of large computational load,easy omission of small target defects,and slow detection speed in existing PCB defect detection methods,this paper proposes the YOLOv8n-4SCDP defect detection algorithm. Firstly,upsampling is added to the neck network of YOLOv8n,integrating shallow semantic information in the Backbone,and a small target detection head is added to reduce the omission rate of small target defects in PCBs. Secondly,the CA attentionmechanism is integrated into the Backbone to enhance the semantic and positional information of features,thereby improving the feature fusion capability of the model.Thirdly,a dense connection mechanism was designed to enhance the utilization of defect features in the model.Additionally,PConv was employed to compress the model,ensuring both accuracy and significantly reducing the model's size.Finally,to address the issue of imbalanced difficult and easy samples,we employ a linear interval mapping method to redefine the Focaler-SIoU regression loss function.This approach enhances both model convergence speed and regression accuracy.The experimental results indicate that the YOLOv8n-4SCDP algorithm achieves an accuracy of 95.8%and a frame rate of 65 fps.This effectively addresses YOLOv8n's issues related to high defect omission rates and low detection accuracy for small PCB targets.