A Real-Time PCB Defect Detection Framework on Raspberry Pi Based on YOLOv5n

Authors

  • Fan Huang
  • Wanrong Hui
  • Shuchang Wan
  • Xincan Wang
  • Haoxu Zhao
  • Lili Zhang

DOI:

https://doi.org/10.54097/389rw478

Keywords:

PCB defect detection, Deep learning, Real-time detection, Raspberry Pi, YOLO, Edge computing, Micro-target detection

Abstract

PCB defect detection requires both high accuracy and real-time performance, while small defect sizes and complex backgrounds pose significant challenges for deployment on edge devices. This paper proposes a real-time PCB defect detection method based on the YOLOv5n model and constructs an edge-side detection system on Raspberry Pi 5. To enhance small defect detection capability, dataset integration, image slicing, and data augmentation strategies are employed. The trained model is deployed using the NCNN framework for lightweight inference. Experimental results demonstrate that the proposed method achieves 97.0% mAP50 on the test set and maintains a stable real-time detection speed of approximately 9 FPS on Raspberry Pi 5, showing strong performance on small-scale and sparse defects. The proposed approach provides a feasible solution for low-cost PCB defect detection on edge devices.

Downloads

Download data is not yet available.

References

[1] Wang Z, Wu J, Wang J. Research on the PCB defect detection algorithm based on YOLOv5. Journal of Project Management. 2024, Vol. 5 (No. 1), p. 235-237.

[2] Liu L, Zhang Y, Karimi HR. Defect detection of printed circuit board surface based on animproved YOLOv8 with FasterNet backbone algorithms. Signal, Image and Video Processing. 2025, Vol. 19 (No. 1), p. 89.

[3] Qin C, Zhou Z. YOLO-FGD: a fast lightweight PCB defect method based on FasterNet and the Gather-and-Distribute mechanism. Journal of Real-Time Image Processing. 2024, Vol. 21, p. 122.

[4] Zhuang J, Luo S, Hou C, et al. Detection of orchard citrus fruits using a monocular machine vision-based method for automatic fruit picking applications. Computers and Electronics in Agriculture. 2018, Vol. 152, p. 64-73.

[5] Information on: https://github.com/ultralytics/yolov5

Downloads

Published

27-04-2026

Issue

Section

Articles

How to Cite

Huang, F., Hui, W., Wan, S., Wang, X., Zhao, H., & Zhang, L. (2026). A Real-Time PCB Defect Detection Framework on Raspberry Pi Based on YOLOv5n . Journal of Computing and Electronic Information Management, 21(1), 80-83. https://doi.org/10.54097/389rw478