A Novel PCB Surface Defect Detection Method Based on the GBE-YOLOv8 Model
Abstract
1. Introduction
- (1)
- The intricate physical structure of PCBs gives rise to diverse types and shapes of surface defects. These defects typically exhibit small sizes, similar characteristics, and complex backgrounds. Consequently, detection algorithms must possess robust multi-scale feature extraction capabilities while effectively distinguishing subtle differences among various defects against complex wiring backgrounds. Therefore, significantly improving the detection accuracy of small targets represents a major challenge for PCB defect detection algorithms.
- (2)
- The production process of PCB assembly lines demands real-time defect detection. Reducing model complexity can enhance detection speed, but this often comes at the cost of some detection accuracy. Moreover, low-complexity models are advantageous for deployment on resource-constrained edge computing terminals. Therefore, effectively balancing detection accuracy and model complexity represents another challenge for PCB defect detection algorithms.
- (1)
- This study proposes a novel Ghost-BiFPN-Efficient-YOLOv8 (GBE-YOLOv8) model architecture based on an improved YOLOv8n. Compared with the baseline YOLOv8n, the mAP@0.5, mAP@0.5:0.95 and FPS of GBE-YOLOv8 increased by 3.1%, 11.7% and 8.2%, respectively, while the parameters and GFLOPs of GBE-YOLOv8 decreased by 13.3% and 7.4%, respectively.
- (2)
- The lightweight Ghost Conv module is introduced into the backbone network of the model to partially replace regular convolutions, thereby reducing computational complexity and parameter count. This enhancement accelerates the model’s detection speed for PCB defects.
- (3)
- The model incorporates a multi-stage feature fusion module named G-C2f and a dynamic weighting module named BiFPN-Concat within its neck network. These components enhance the model’s ability to characterize PCB defects, thereby improving detection accuracy.
- (4)
- An Efficient Head combining mixed depthwise convolution and partial convolution is designed in the model’s head network to further optimize detection accuracy and computational efficiency.
2. Related Work
2.1. Vision-Based Methods for PCB Surface Defect Detection
2.2. YOLOv8-Based Methods for PCB Surface Defect Detection
3. Methods
3.1. Overall Framework of the GBE-YOLOv8 Model
3.2. Improvement Methods of the GBE-YOLOv8 Model
3.2.1. Ghost Conv Module
3.2.2. G-C2f Module
3.2.3. BiFPN-Concat Module
3.2.4. Efficient Head Module
4. Experiments and Results
4.1. Experimental Design
4.1.1. Dataset
4.1.2. Experimental Environment and Model Hyperparameter Settings
4.1.3. Model Evaluation Metrics
4.2. Results and Analysis
4.3. Ablation Studies
- (1)
- Ghost Conv: Compared with the YOLOv8n, by introducing the Ghost Conv module, the parameters and GFLOPs of the A model decreased by 16.7% and 8.6% respectively, while the mAP@0.5 and mAP@0.5:0.95 only slightly decreased by 0.2% and 0.7% respectively. These experimental results demonstrate that the Ghost Conv-based optimization can significantly reduce model complexity while maintaining high detection precision, thereby improving the model’s inference speed and laying a foundation for lightweight model deployment.
- (2)
- G-C2f: Compared with the A model, by introducing the G-C2f module, the mAP@0.5 and mAP@0.5:0.95 of the AB model increased by 0.7% and 3.8% respectively, indicating that the G-C2f-based optimization can significantly improve the detection precision of the model. Comparing the AC and ABC models, as well as the AD and ABD models, it can be observed that the G-C2f module still enhances detection precision when using pairwise optimization methods. This indicates that the BiFPN-Concat or Efficient Head module does not suppress the contribution of the G-C2f module. Compared with the ACD model, the GBE-YOLOv8 achieved mAP@0.5 and mAP@0.5:0.95 improvements of 1.5% and 5.5% respectively, indicating that the combined application of all optimization methods can further enhance the contribution of the G-C2f module. The class activation heatmaps of the A model before and after introducing the G-C2f module are illustrated in Figure 12. The experimental results confirm that the G-C2f module can significantly suppress background noise while strengthening both the focus and intensity of the model’s response to various defect types.
- (3)
- BiFPN-Concat: Compared with the A model, by introducing the BiFPN-Concat module, the mAP@0.5 and mAP@0.5:0.95 of the AC model increased by 0.8% and 3.9% respectively, indicating that the BiFPN-Concat-based optimization can significantly improve the detection precision of the model. Comparing the AB and ABC models, as well as the AD and ACD models, it can be observed that the BiFPN-Concat module still enhances detection precision when using pairwise optimization methods. This indicates that the G-C2f or Efficient Head module does not suppress the contribution of the BiFPN-Concat module. Compared with the ABD model, the GBE-YOLOv8 achieved mAP@0.5 and mAP@0.5:0.95 improvements of 1.4% and 5.2% respectively, indicating that the combined application of all optimization methods can further enhance the contribution of the BiFPN-Concat module. The class activation heatmaps of the A model before and after introducing the BiFPN-Concat module are illustrated in Figure 13. The experimental results indicate that before adding the BiFPN-Concat module, the model is prone to missed detection (mouse_bite) and false detection (spur) during the early stages of training. After adding the BiFPN-Concat module, the detection accuracy and convergence speed of the model can be significantly improved.
- (4)
- Efficient Head: Compared with the A model, by introducing the Efficient Head module, the mAP@0.5 and mAP@0.5:0.95 of the AD model increased by 0.9% and 4.0% respectively, while the parameters remained unchanged and the GFLOPs only slightly increased by 1.4%, indicating that the Efficient Head-based optimization can significantly improve the detection precision while maintaining a low model complexity. Comparing the AB and ABD models, as well as the AC and ACD models, it can be observed that the Efficient Head module still enhances detection precision when using pairwise optimization methods. This indicates that the G-C2f or BiFPN-Concat module does not suppress the contribution of the Efficient Head module. Compared with the ABC model, the GBE-YOLOv8 achieved mAP@0.5 and mAP@0.5:0.95 improvements of 1.7% and 5.8% respectively, indicating that the combined application of all optimization methods can further enhance the contribution of the Efficient Head module. The class activation heatmaps of the A model before and after introducing the Efficient Head module are illustrated in Figure 14. The experimental results demonstrate that before adding the Efficient Head module, the model can accurately locate the defect when detecting the larger defect types such as missing_hole, but when detecting the smaller defect types such as mouse_bite and spur, the focus of the model is significantly deviated from the defect location, even resulting in missed detection and false detection. After adding the Efficient Head module, the localization accuracy of the model for various defect types has been greatly improved.
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Chen, I.C.; Hwang, R.C.; Huang, H.C. PCB defect detection based on deep learning algorithm. Processes 2023, 11, 775. [Google Scholar] [CrossRef]
- Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell. 2016, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- Li, Y.T.; Guo, J.I. A VGG-16 based faster RCNN model for PCB error inspection in industrial AOI applications. In Proceedings of the 2018 IEEE International Conference on Consumer Electronics-Taiwan (ICCE-TW), Taichung, China, 19–21 May 2018. [Google Scholar]
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv 2014, arXiv:1409.1556. [Google Scholar]
- Hu, B.; Wang, J. Detection of PCB surface defects with improved faster-RCNN and feature pyramid network. IEEE Access 2020, 8, 108335–108345. [Google Scholar] [CrossRef]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016. [Google Scholar]
- Wang, J.; Chen, K.; Yang, S.; Loy, C.C.; Lin, D. Region proposal by guided anchoring. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019. [Google Scholar]
- Ma, N.; Zhang, X.; Zheng, H.T.; Sun, J. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018. [Google Scholar]
- Li, D.; Fu, S.; Zhang, Q.; Mo, Y.; Liu, L.; Xu, C. An improved PCB defect detector based on feature pyramid networks. In Proceedings of the 2020 4th International Conference on Computer Science and Artificial Intelligence, Zhuhai, China, 11–13 December 2020. [Google Scholar]
- He, K.; Gkioxari, G.; Dollár, P.; Girshick, R. Mask r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. Ssd: Single shot multibox detector. In Proceedings of the European Conference on Computer Vision (ECCV), Amsterdam, The Netherlands, 8–16 October 2016. [Google Scholar]
- Hussain, M. YOLO-v1 to YOLO-v8, the rise of YOLO and its complementary nature toward digital manufacturing and industrial defect detection. Machines 2023, 11, 677. [Google Scholar] [CrossRef]
- Shi, W.; Lu, Z.; Wu, W.; Liu, H. Single-shot detector with enriched semantics for PCB tiny defect detection. J. Eng. 2020, 2020, 366–372. [Google Scholar] [CrossRef]
- Chen, W.; Huang, Z.; Mu, Q.; Sun, Y. PCB defect detection method based on transformer-YOLO. IEEE Access 2022, 10, 129480–129489. [Google Scholar] [CrossRef]
- Ling, Q.; Isa, N.A.M.; Asaari, M.S.M. Precise detection for dense PCB components based on modified YOLOv8. IEEE Access 2023, 11, 116545–116560. [Google Scholar] [CrossRef]
- Anitha, D.B.; Rao, M. A survey on defect detection in bare PCB and assembled PCB using image processing techniques. In Proceedings of the 2017 International Conference on Wireless Communications, Signal Processing and Networking (WiSPNET), Chennai, India, 22–24 March 2017. [Google Scholar]
- Ma, J.; Cheng, X. Fast segmentation algorithm of PCB image using 2D OTSU improved by adaptive genetic algorithm and integral image. J. Real-Time Image Process. 2023, 20, 10. [Google Scholar] [CrossRef]
- Ling, Z.; Zhang, A.; Ma, D.; Shi, Y.; Wen, H. Deep Siamese semantic segmentation network for PCB welding defect detection. IEEE Trans. Instrum. Meas. 2022, 71, 1–11. [Google Scholar] [CrossRef]
- Zhang, H.; Jiang, L.; Li, C. CS-ResNet: Cost-sensitive residual convolutional neural network for PCB cosmetic defect detection. Expert Syst. Appl. 2021, 185, 115673. [Google Scholar] [CrossRef]
- Zhang, W.; Lu, Y.; Chen, T.; Li, J.W. A Random Forest Algorithm for PCB SMD Defect Detection. IEEE Trans. Compon. Pack. Manuf. Technol. 2025, 15, 1135–1142. [Google Scholar] [CrossRef]
- Lu, Z.; He, Q.; Xiang, X.; Liu, H. Defect detection of PCB based on Bayes feature fusion. J. Eng. 2018, 2018, 1741–1745. [Google Scholar] [CrossRef]
- Adibhatla, V.A.; Chih, H.C.; Hsu, C.C.; Cheng, J.; Abbod, M.F.; Shieh, J.S. Defect detection in printed circuit boards using you-only-look-once convolutional neural networks. Electronics 2020, 9, 1547. [Google Scholar] [CrossRef]
- Adibhatla, V.A.; Chih, H.C.; Hsu, C.C.; Cheng, J.; Abbod, M.F.; Shieh, J.S. Applying deep learning to defect detection in printed circuit boards via a newest model of you-only-look-once. Math. Biosci. Eng. 2021, 18, 4411–4428. [Google Scholar] [CrossRef]
- Zhao, Q.; Ji, T.; Liang, S.; Yu, W. PCB surface defect fast detection method based on attention and multi-source fusion. Multimed. Tools Appl. 2023, 83, 5451–5472. [Google Scholar] [CrossRef]
- Tang, J.; Liu, S.; Zhao, D.; Tang, L.; Zou, W.; Zheng, B. PCB-YOLO: An improved detection algorithm of PCB surface defects based on YOLOv5. Sustainability 2023, 15, 5963. [Google Scholar] [CrossRef]
- Yuan, M.; Zhou, Y.; Ren, X.; Zhi, H.; Zhang, J.; Chen, H. YOLO-HMC: An improved method for PCB surface defect detection. IEEE Trans. Instrum. Meas. 2024, 73, 1–11. [Google Scholar] [CrossRef]
- Khan, R.U.; Shah, F.; Khan, A.A.; Tahir, H. Advancing PCB quality control: Harnessing YOLOv8 deep learning for real-time fault detection. CMC-Comput. Mater. Con. 2024, 81, 345–367. [Google Scholar] [CrossRef]
- Yi, F.; Mohamed, A.S.A.; Noor, M.H.M.; Ani, F.C.; Zolkefli, Z.E. YOLOv8-DEE: A high-precision model for printed circuit board defect detection. PeerJ Comput. Sci. 2024, 10, e2548. [Google Scholar] [CrossRef]
- Liu, L.J.; Zhang, Y.; Karimi, H.R. Defect detection of printed circuit board surface based on an improved YOLOv8 with FasterNet backbone algorithms. Signal Image Video Process. 2025, 19, 89. [Google Scholar] [CrossRef]
- Li, S.; Wang, W.; Lu, Q. CSS-YOLOv8: An efficient detection model for printed circuit boards with tiny defects. Eng. Res. Express 2025, 7, 025401. [Google Scholar] [CrossRef]
- Wang, R.; Liang, F.; Wang, B.; Zhang, G.; Chen, Y.; Mou, X. An efficient and accurate surface defect detection method for wood based on improved YOLOv8. Forests 2024, 15, 1176. [Google Scholar] [CrossRef]
- Xie, W.; Sun, X.; Ma, W. A light weight multi-scale feature fusion steel surface defect detection model based on YOLOv8. Meas. Sci. Technol. 2024, 35, 055017. [Google Scholar] [CrossRef]
- Su, J.; Yuan, Y.; Przystupa, K.; Kochan, O. Insulator defect detection algorithm based on improved YOLOv8 for electric power. Signal Image Video Process. 2024, 18, 6197–6209. [Google Scholar] [CrossRef]
- Han, K.; Wang, Y.; Xu, C.; Guo, J.; Xu, C.; Wu, E.; Tian, Q. GhostNets on heterogeneous devices via cheap operations. Int. J. Comput. Vision 2022, 130, 1050–1069. [Google Scholar] [CrossRef]
- Tan, M.; Pang, R.; Le, Q.V. Efficientdet: Scalable and efficient object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020. [Google Scholar]
- Tan, M.; Le, Q.V. Mixconv: Mixed depthwise convolutional kernels. arXiv 2019, arXiv:1907.09595. [Google Scholar] [CrossRef]
- Chen, J.; Kao, S.H.; He, H.; Zhuo, W.; Wen, S.; Lee, C.H.; Chan, S.H.G. Run, don’t walk: Chasing higher FLOPS for faster neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 18–22 June 2023. [Google Scholar]
- Huang, W.; Wei, P.; Zhang, M.; Liu, H. HRIPCB: A challenging dataset for PCB defects detection and classification. J. Eng. 2020, 2020, 303–309. [Google Scholar] [CrossRef]
- Du, B.; Wan, F.; Lei, G.; Xu, L.; Xu, C.; Xiong, Y. YOLO-MBBi: PCB surface defect detection method based on enhanced YOLOv5. Electronics 2023, 12, 2821. [Google Scholar] [CrossRef]
- Xia, K.; Lv, Z.; Liu, K.; Lu, Z.; Zhou, C.; Zhu, H.; Chen, X. Global contextual attention augmented YOLO with ConvMixer prediction heads for PCB surface defect detection. Sci. Rep. 2023, 13, 9805. [Google Scholar] [CrossRef] [PubMed]
- Tang, J.; Wang, Z.; Zhang, H.; Li, H.; Wu, P.; Zeng, N. A lightweight surface defect detection framework combined with dual-domain attention mechanism. Expert Syst. Appl. 2024, 238, 121726. [Google Scholar] [CrossRef]
- Zhou, B.; Khosla, A.; Lapedriza, A.; Oliva, A.; Torralba, A. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016. [Google Scholar]














| Parameter Name | Parameter Value |
|---|---|
| Batch size | 16 |
| Epochs | 100 |
| Learning rate | 0.01 |
| Momentum | 0.94 |
| Gamma | 0.1 |
| Confidence threshold | 0.348 |
| NMS threshold | 0.45 |
| Defect Category | AP@0.5 (%) | AP@0.5:0.95 (%) |
|---|---|---|
| Missing_hole | 99.4 | 64.0 |
| Mouse_bite | 99.3 | 63.5 |
| Open_circuit | 98.7 | 59.0 |
| Short | 98.2 | 57.5 |
| Spur | 99.3 | 63.8 |
| Spurious_copper | 98.6 | 60.5 |
| Model | mAP@0.5 (%) | mAP@0.5:0.95 (%) | Parameters (M) | GFLOPs | FPS |
|---|---|---|---|---|---|
| Faster R-CNN | 92.7 | 45.0 | 34 | 150 | 13 |
| RT-DETR-L | 94.6 | 48.1 | 32 | 110 | 17 |
| YOLOv8n | 95.8 | 49.7 | 3.0 | 8.1 | 233 |
| YOLOv11n | 97.9 | 55.0 | 2.6 | 6.5 | 290 |
| GBE-YOLOv8 | 98.9 | 61.4 | 2.6 | 7.5 | 252 |
| Model | Ghost Conv | G-C2f | BiFPN- Concat | Efficient Head | mAP@0.5 (%) | mAP@0.5:0.95 (%) | Parameters (M) | GFLOPs |
|---|---|---|---|---|---|---|---|---|
| YOLOv8n | 95.8 | 49.7 | 3.0 | 8.1 | ||||
| A | √ | 95.6 | 49.0 | 2.5 | 7.4 | |||
| AB | √ | √ | 96.3 | 52.8 | 2.5 | 7.5 | ||
| AC | √ | √ | 96.4 | 52.9 | 2.6 | 7.6 | ||
| AD | √ | √ | 96.5 | 53.0 | 2.5 | 7.5 | ||
| ABC | √ | √ | √ | 97.2 | 55.6 | 2.7 | 7.6 | |
| ABD | √ | √ | √ | 97.5 | 56.2 | 2.6 | 7.6 | |
| ACD | √ | √ | √ | 97.4 | 55.9 | 2.5 | 7.5 | |
| GBE-YOLOv8 | √ | √ | √ | √ | 98.9 | 61.4 | 2.6 | 7.5 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Gao, C.; Zhang, X.; Bai, M.; Lian, X.; Chen, S. A Novel PCB Surface Defect Detection Method Based on the GBE-YOLOv8 Model. Micromachines 2026, 17, 339. https://doi.org/10.3390/mi17030339
Gao C, Zhang X, Bai M, Lian X, Chen S. A Novel PCB Surface Defect Detection Method Based on the GBE-YOLOv8 Model. Micromachines. 2026; 17(3):339. https://doi.org/10.3390/mi17030339
Chicago/Turabian StyleGao, Chao, Xin Zhang, Mengting Bai, Xiaoqin Lian, and Shichao Chen. 2026. "A Novel PCB Surface Defect Detection Method Based on the GBE-YOLOv8 Model" Micromachines 17, no. 3: 339. https://doi.org/10.3390/mi17030339
APA StyleGao, C., Zhang, X., Bai, M., Lian, X., & Chen, S. (2026). A Novel PCB Surface Defect Detection Method Based on the GBE-YOLOv8 Model. Micromachines, 17(3), 339. https://doi.org/10.3390/mi17030339

