东北大学学报(自然科学版) ›› 2025, Vol. 46 ›› Issue (10): 1-9.DOI: 10.12068/j.issn.1005-3026.2025.20240038

• 信息与控制 •    

基于改进的YOLOv8的PCB瑕疵检测

吕真真, 房立金, 赵乾坤, 万应才   

  1. 东北大学 机器人科学与工程学院,辽宁 沈阳 110169
  • 收稿日期:2024-03-04 出版日期:2025-10-15 发布日期:2026-01-13
  • 作者简介:吕真真(1998—),女,安徽阜阳人,东北大学硕士研究生
    房立金(1965—),男,辽宁沈阳人,东北大学教授,博士生导师.
  • 基金资助:
    国家自然科学基金资助项目(62273081)

Defect Detection on PCB Based on Improved YOLOv8

Zhen-zhen LYU, Li-jin FANG, Qian-kun ZHAO, Ying-cai WAN   

  1. School of Robot Science and Engineering,Northeastern University,Shenyang 110169,China. Corresponding author: FANG Li-jin,E-mail: ljfang@mail. neu. edu. cn
  • Received:2024-03-04 Online:2025-10-15 Published:2026-01-13

摘要:

由于印刷电路板(PCB)集成度高且线路复杂以及参数量日益增加,其存在的瑕疵直接影响PCB的生产效率,利用计算机视觉技术对PCB瑕疵进行检测对PCB生产具有重要意义.本文在YOLO目标检测算法基础上,提出了一种基于自注意力的PCB瑕疵检测算法.首先,在特征提取阶段引入了极化自注意力机制,对PCB特征的空间与语义特征分别进行提取,并将其与输入原始特征进行结合,增强网络特征的表征能力.然后,在解码阶段加入了一种小目标检测头,该检测头充分利用了YOLO网络Backbone模块提取的低分辨率特征,使网络关注PCB局部细节特征,提高瑕疵区域的定位精度.实验结果表明,所提方法在PCB数据集上精度可达95.5%,与原YOLOv8方法相比提高了4%,mAP0.5∶0.95指标与原YOLOv8方法相比提高了2.8%.

关键词: YOLOv8, 小目标检测头, 极化自注意力机制, 瑕疵检测, 目标检测

Abstract:

Due to the high integration, complex circuits, and increasing parameters of printed circuit boards (PCBs), defects in PCBs directly affect production efficiency, making computer vision-based defect detection crucial for PCB manufacturing. A self-attention-based PCB defect detection algorithm was proposed based on the YOLO object detection algorithm. First, a polarized self-attention (PSA) mechanism was introduced in the feature extraction stage to separately extract spatial and semantic features of PCBs, which were combined with input raw features to enhance the network’s feature representation capability. Then, a small-object detection head was added in the decoding stage, which fully utilized low-resolution features from the YOLO network Backbone module to enable the network to focus on local details of PCBs and improve defect positioning accuracy. Experiments show that the proposed method achieves 95.5% accuracy on the PCB dataset, 4% higher than the original YOLOv8 method, with the mAP0.5∶0.95 metric increased by 2.8%.

Key words: YOLOv8, small-object detection head, polarized self-attention mechanism, defect detection, object detection

中图分类号: