With the popularization of the emerging 3C products (e.g., smartwatches, smart entertainment robots, and various wearable devices), printed circuit boards (PCBs), considered as the core of electronic products, have gained more attention in terms of the performance in the quality control. Many studies have been conducted and outstanding results have been obtained. However, there are still many challenges, e.g., the complexity and diversity of the PCB small defect dataset. To further cope with the above problems, the improved YOLOv4 algorithm is designed and verified in terms of the detection performance on a public PCB small defect dataset. First, the size distributions of six class defect images are analyzed; the reasonable size of anchor boxes is re-designed and assigned to multiscale feature layers. Second, the ADD-path module and the DSCBlock-W module combined with the MobiletNetv2 module are used to construct the backbone of the YOLOv4 method. Finally, the fusion of multilevel features is enhanced and the data information of the low-level feature is fully utilized, thereby enabling YOLOv4 to better detect small defects. Compared to different state-of-the-art methods, the improved YOLOv4 method obtains an mAP as high as 99.71%, which confirms the efficiency and accuracy of the improved method.