计算机工程与应用 ›› 2025, Vol. 61 ›› Issue (3): 242-252.DOI: 10.3778/j.issn.1002-8331.2408-0162

• 图形图像处理 • 上一篇    下一篇

DySnake-YOLO:改进的YOLOv9c电路板表面缺陷检测方法

李耀龙,陈晓林,林浩,王宇,王春林   

  1. 1.云南师范大学 信息学院,昆明 650500
    2.楚雄师范学院 数学与计算机学院,云南 楚雄 675099
    3.琼台师范学院 信息科学技术学院,海口 571100
  • 出版日期:2025-02-01 发布日期:2025-01-24

DySnake-YOLO: Improved Detection of Surface Defects on YOLOv9c Circuit Board

LI Yaolong, CHEN Xiaolin, LIN Hao, WANG Yu, WANG Chunlin   

  1. 1.School of Information, Yunnan Normal University, Kunming 650500, China
    2.School of Mathematics and Computer Science, Chuxiong Normal University, Chuxiong, Yunnan 675099, China
    3.School of Information Science and Technology, Qiongtai Normal University, Haikou 571100, China
  • Online:2025-02-01 Published:2025-01-24

摘要: 针对印刷电路板生产时出现缺孔、开路、短路、毛刺和假铜等缺陷,由于缺陷尺寸微小和背景的相似性等问题造成的检测精度低,提出一种改进YOLOv9的电路板表面缺陷检测算法DySnake-YOLO。在特征提取部分,添加了一种动态的、查询感知的稀疏注意力机制BRA,来对印刷电路板的特征进行细粒度的提取。在特征融合部分设计了一种根据管状目标以适应电路板特性,以及关注区域连通性特征适合管状场景的RE4DConv卷积模块,提升了模型融合印刷电路板中的管状尺度特征的能力。通过在北京大学公开的PCB缺陷数据集上进行实验表明,改进后的算法相较于原型,mAP50提高了0.023,与YOLOv8n等主流目标检测算法相比,改进方法在mAP50、mAP50-95方面分别提升了0.071、0.085,在印刷电路板缺陷检测任务上的有着较高的应用价值。

关键词: 目标检测, 电路板检测, YOLOv9, BRA模块, RE4DConv

Abstract: For the production of printed circuit boards with defects such as missing holes, open circuits, short circuits, burrs and false copper, and the low detection accuracy caused by problems such as the tiny size of the defects and the similarity of the background, this paper proposes a circuit board surface defect detection algorithm, DySnake-YOLO, that improves on YOLOv9. In the feature extraction part, a dynamic, query-aware sparse-attention mechanism, BRA, is added to perform fine-grained extraction of printed circuit board features. In the feature fusion section, a convolutional module RE4DConv is designed to fit the tubular scenario according to the tubular target to fit the board characteristics as well as to focus on the regional connectivity features, which enhances the ability of model to fuse the tubular-scale features in printed circuit boards. Experiments on the publicly available PCB defect dataset from Peking University show that the improved algorithm improves the mAP50 by 0.023 compared to the prototype, and the improved method improves the mAP50 and mAP50-95 by 0.071 and 0.085, respectively, compared to the mainstream target detection algorithms, such as YOLOv8n, which has a high value in the application of the printed circuit board defect detection task. The improved method has a high value in the task of printed circuit board defect detection.

Key words: object detection, circuit board inspection, YOLOv9, bilevel routing attention (BRA) module, RE4DConv