Quality inspection is required in the process of industrial intelligent production of PCBs, and the detection of electronic components on PCBs is one of the keys to this task. A deep learning-based method for small object detection of SMDs in PCB complex scenes, which was named Improved VarifocalNet, was proposed to extract multi-scale semantic features of image data using multiple convolutional layers of different depths, enabling this model can fully extract the location of SMDs implicitly on PCB image data and category information. A fusion dataset was built by adapting the PCB-WACV and FICS-PCB public datasets, on which the model is trained and validated. Moreover, ablation experiments were conducted on this model and six other models are selected for comparison experiments. The experiment results demonstrated better generalization performance of the Improved VarifocalNet model for detection, showing the practicality of the improved method with high accuracy and high detection speed.