Abstract:The existing PCB defect detection methods has problems of low efficiency, high false detection rate, low generality and poor real-time performance. To address these issues, a PCB defect detection method based on the improved you only look once (YOLO) v4 algorithm is proposed. Anchor frames are determined by the improved dichotomous K-means clustering combined with intersection over union (IoU) loss function. In this way, the problem that the pre-defined anchor frames are not applicable to PCB small target defect detection is solved. MobileNetV3 is introduced as a feature extraction network to enhance the detection performance of small target defects on PCB, while facilitating deployment in the field on lightweight mobile terminals. Inceptionv3 is introduced as the detection network, which utilizes multiple convolutional kernels for operations to meet the requirements of PCB defect detection in multiple categories. The PCB_DATASET dataset is used as the test object. The proposed method is compared with Faster R-CNN, YOLOv4 and MobileNetV3-YOLOv4 for evaluation experiments. Results show that the mean average precision ( mAP) of the proposed method is 99. 10% , the model size is 53. 2 MB, and the detection speed is 43. 01 FPS. The detection mAP is improved by 4. 88% , 0. 05% , and 2. 01% , respectively. The model size is reduced by 0, 203. 2, and 3. 3 MB, respectively. And the detection speed is improved by 29. 93 FPS. The speed is increased by 29. 93, 6. 37, and 0. 79 FPS, which meets requirements of high inspection accuracy and inspection speed in PCB industrial production sites.