Abstract
Developing a robust and cost-effective real-time AI based PCB defect detection system for PCB manufacturing is at an early stage. In this work, a lightweight object detection model, CSPGhost-YOLO, has been proposed for reliable PCB mixed defects detection. CSPGhost-YOLO is based on the YOLOv5 architecture, but it replaces the standard C3 module in the backbone with a GhostC3 module to reduce the number of parameters and enhance feature extraction. Also, the prediction head has been modified by adding a simple attention module called SimAM (simple parameter free attention module) to improve the feature maps generation and prediction accuracy. This approach helps CSPGhost-YOLO achieve reduction in number of parameters, floating-point operations (FLOPs) with an enhancement in the model’s capability for extracting high-level features while suppressing irrelevant information. The proposed design reaches 98.9% mAP and 98.6% accuracy, using only 1.2 million parameters and 2.9 GFLOPs. The model can detect defects at a speed of 153.91 frames per second (FPS) in general, and it runs at 25 FPS in real-time when tested on a Jetson Nano board. To make the model’s decisions easier to understand and more trustworthy, we used Grad-CAM explainability tools. This visually confirmed that the model accurately detected and focused on the defective parts of the PCB. With its lightweight design, high accuracy, and real-time hardware validation, CSPGhost-YOLO demonstrates strong potential as a practical and reliable solution for PCB manufacturing quality control, where defect detection is inherently a measurement and inspection task critical for ensuring precision and uniformity.