PR-YOLOv8s: A Lightweight Improved YOLOv8s for Printed Circuit Board Micro-Defect Detection
Miao Wang, Wanyi Zhang, Tengteng Wang, Qian Du
Key points
From the paper's conclusion- Although the added P2 head and attention module introduce a moderate computational overhead (GFLOPs increase by approximately 10% and parameters by less than 1% over the baseline YOLOv8s), the accuracy gain is substantial and far outweighs this cost.
Abstract
Printed Circuit Boards (PCBs) are core components in electronics manufacturing. Six types of micro-defects, such as missing holes, mouse-bites and open circuits, may easily cause complete device failure. The original YOLOv8 employs only the P3/P4/P5 multi-scale detection heads, leading to severe loss of shallow fine-grained features of PCB micro-defects. Although the vanilla P2 shallow detection head supplements fine-grained features, background noise from PCB silkscreen and copper cladding triggers oscillating upward drift of validation-set DFL and weakens model generalization. To tackle this problem, this study proposes PR-YOLOv8s for general PCB micro-defect detection. Taking the self-optimized P2 detection head as the core innovation, we reconstruct the shallow detection branch by optimizing network structure and training strategy. Shared convolution reduces redundant parameters. Depthwise separable convolution cuts inference cost in regression branches. Label smoothing is utilized for loss regularization to suppress training oscillation of the original P2 head. Furthermore, CBAM attention and RepDepthconv re-parameterized separable convolution are integrated to build RD-CBAM, a unified feature enhancement module. It suppresses background interference, enhances defect representation and reduces computational overhead to balance accuracy, stability and lightweight performance. Ablation and comparative experiments are implemented under unified hyperparameters, with performance evaluated via loss curves, quantitative metrics and normalized confusion matrices. Results verify that the optimized P2 head dominates performance gain and fully eliminates the upward drift of DFL. The proposed model achieves 98.45% precision, 98.87% recall, 99.30% mAP50 and 81.04% mAP50-95. Its mAP50-95 rises by about 19 percentage points over baseline YOLOv8s, outperforming recent real-time detectors including YOLOv9-s, YOLOv10-s, RT-DETR-R18, and YOLO-NAS-S. With high precision and real-time inference, PR-YOLOv8s is applicable to industrial PCB inspection and pre-competition defect screening for college electronics competitions, possessing practical value for both industrial deployment and higher-education practice. Although the added P2 head and attention module introduce a moderate computational overhead (GFLOPs increase by approximately 10% and parameters by less than 1% over the baseline YOLOv8s), the accuracy gain is substantial and far outweighs this cost.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- MDEB-YOLO: A Lightweight Multi-Scale Attention Network for Micro-Defect Detection on Printed Circuit BoardsMicromachines · 2026
- Toward Real-Time Industrial Small Object Inspection: Decoupled Attention and Multi-Scale Aggregation for PCB Defect DetectionElectronics · 2026
- Research on PCB Defect Detection Based on Improved YOLOv8Engineering Research Express · 2026
- Printed Circuit Board Defect Detection Based on Lightweight Deep Learning Fusion ModelSensors · 2025
- A Novel PCB Surface Defect Detection Method Based on the GBE-YOLOv8 ModelMicromachines · 2026
- YOLO-MDMN: a new lightweight algorithm for efficient PCB defect detectionMeasurement Science and Technology · 2026