Abstract:Reference template is used in most methods of PCB defect detection,which is very time consuming and causes a big position error. YOLOv4 is fast but it misses the object easily in PCB detection and its accuracy is not high in detecting the small object. Therefore, the method of PCB defect detection based on improved YOLOv4 algorithm is proposed. Firstly, CSPDarknet53 is used as backbone and the structure of single feature layer is adopted, which avoids the prior boxes assignment problem caused by data imbalance. Then, five convolutions are improved using CSP to increase further the ability offeature extract.Finally, prior boxes are gotten by using K-means++ to improve the training effect. In the experiment, Peking University PCB public dataset is used for training. The result shows that mean average precision of our algorithm achieves 98.71% and it has a better performance compared with other several classical object detection algorithms.