• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2025, Vol. 47 ›› Issue (02): 317-326.

• 图形与图像 • 上一篇    下一篇

改进ESP-YOLO的PCB缺陷检测算法

王海群,王炳楠,葛超   

  1. (华北理工大学电气工程学院,河北 唐山 063210)
  • 收稿日期:2023-11-07 修回日期:2024-03-19 接受日期:2025-02-25 出版日期:2025-02-25 发布日期:2025-02-24
  • 基金资助:
    河北省自然科学基金(F2021209006)

A PCB defect detection algorithm based on improved ESP-YOLO

WANG Haiqun,WANG Bingnan,GE Chao   

  1. (College of Electrical Engineering,North China University of Science and Technology,Tangshan 063210,China)
  • Received:2023-11-07 Revised:2024-03-19 Accepted:2025-02-25 Online:2025-02-25 Published:2025-02-24

摘要: PCB板的缺陷检测是保证其质量的重要手段。为了避免漏检、误检现象的发生,并提高PCB缺陷检测速度,提出了一种改进ESP-YOLO的PCB缺陷检测算法。引入ESP网络结构,通过ESPblock实现下采样,并改进特征提取模块,采用更轻量的网络结构实现特征提取,解决PCB缺陷检测模型较大并且难以部署的问题;引入一种无参数注意力机制SimAM,在不增加网络参数的同时提高复杂环境中算法对目标的关注度,解决由于背景复杂导致的PCB缺陷漏检问题;引入RFB多尺度特征提取模块,扩大算法感受野并提高多尺度特征提取能力,解决由于缺陷大小差异导致的漏检问题;引入可学习参数特征融合模块BiFPN,提高融合特征图的特征表达能力。实验结果显示,ESP-YOLO算法的参数量和GFLOPs分别为5.32×106和11.2,相比YOLOv5s算法分别降低了23.8%和29.1%;平均精度为97.8%,相比于原YOLOv5s算法提升了3.2%。

关键词: PCB缺陷检测, ESPNet, SimAM, RFB, BiFPN, YOLOv5s

Abstract: Defect detection of PCB boards is a crucial means to ensure their quality. To avoid missed and false detections and to enhance the speed of PCB defect detection, an improved ESP-YOLO algorithm for PCB defect detection is proposed. This algorithm incorporates the ESP network structure, utilizing ESP blocks for downsampling, and improves the feature extraction module by adopting a lighter network structure for feature extraction, thereby solving the problem of large PCB defect detection models being difficult to deploy. Additionally,  a parameter-free attention mechanism SimAM  is introduced to increase the algorithm’s focus on targets in complex environments without increasing the number of network parameters, addressing the issue of missed PCB defect detections due to complex backgrounds. Furthermore, the RFB multi-scale feature extraction module is introduced to expand the model’s receptive field and improve its multi-scale feature extraction capability, solving the problem of missed detections due to varying defect sizes. A learnable parametric feature fusion module, BiFPN, is also introduced to enhance the feature representation ability of the fused feature map. Experimental results show that the ESP-YOLO algorithm has a parameter count of 5.32×106 and a GFLOPs of 11.2, representing a reduction of 23.8% and 29.1% respectively compared to the original YOLOv5s algorithm. The average accuracy is 97.8%, representing an improvement of 3.2% compared to the original algorithm.

Key words: PCB defect detection, efficient spatial pyramid network(ESPNet), simple and parameter-free attention module(SimAM), receptive field block(RFB), bi-directional feature pyramid network_add(Bi-FPN), YOLOv5s