Abstract:To solve the problems of low accuracy and high false detection rate of current defect detection algorithms for Printed Circuit Board (PCB) bare board,an improved YOLO-PCB defect detection algorithm was proposed. Based on YOLOv5s algorithm, the new algorithm integrates attention mechanism to enhance the channel features of feature map. At the same time, the feature fusion layer is improved by introducing the weighted bidirectional feature pyramid network, which enables the network to achieve higher-level feature fusion. In addition, the new algorithm adds a small target detection layer to improve the network’s detection capability for small target defects on the printed circuit board. The experimental results show that compared with the original YOLOv5 algorithm, the YOLO-PCB detection algorithm has stronger feature extraction fusion capability and higher detection precision, and the new algorithm improves the mAP_0.5 by 4.08%, the mAP0.5:0.95 by 56.69%, the precision by 1.81%, and the recall by 6.76%.