A Lightweight YOLOv8 Network Based on Ghost Modules and SimAM for PCB Defect Detection
Abstract
Automated inspection of printed circuit boards remains difficult because many surface defects occupy only small regions, occur close to one another, and exhibit weak visual differences from normal circuit patterns. This study redesigns YOLOv8n for deployment under limited computational and storage resources by integrating Ghost-based feature extraction with SimAM. GhostConv and C3Ghost replace major conventional convolutional blocks in the backbone and neck to suppress redundant computation, while a parameter-free SimAM unit is positioned after SPPF to reinforce informative defect responses before multi-scale feature fusion. The resulting network was assessed on the DeepPCB dataset through detector comparisons and controlled ablation experiments. Relative to YOLOv8n, the parameter count decreased from 3.007 M to 1.715 M, and the computational cost declined from 8.1 to 5.0 GFLOPs, representing reductions of 42.95% and 38.27%, respectively. The final model obtained a precision of 0.935, a recall of 0.905, an mAP50 of 0.957, and an mAP50-95 of 0.599. Its mAP50 differed from the baseline by only 0.001 despite the substantial reduction in model size. These findings indicate that the proposed architecture preserves competitive defect recognition at an IoU threshold of 0.50 while requiring markedly fewer computational resources. The lower mAP50–95 also suggests that further improvement is needed for high-IoU localization.