ViT 和注意力融合的类别不均衡 PCB 缺陷检测方法
DOI:
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

TP391 TH862

基金项目:

国家自然科学基金(62103316)、陕西省自然科学基础研究计划(2023-JC-YB-562)项目资助


ViT and attention fusion for class-imbalanced PCB defect detection
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 资源附件
  • |
  • 文章评论
    摘要:

    针对实际环境下印刷电路板(PCB)缺陷样本难以收集造成的数据长尾分布和检测精度低以及 ViT 用于检测时计算 复杂度高等问题,提出多尺度 ViT 特征提取和注意力特征融合的端到端 PCB 缺陷检测算法。 首先结合 ViT 和部分卷积构建 多尺度特征提取网络,利用层级多头注意力对不同尺度的特征图执行自适应的注意力操作,使网络能够更好地捕捉局部和 全局信息进而增强其特征提取能力,部分卷积可以降低计算开销。 其次,基于能量空域抑制的无参数注意力机制将多尺度 特征有效融合,提升网络融合特征图的表达能力。 最后,引入对类别不均衡敏感的分类函数对网络的损失函数进行改进,增 强网络对类别不平衡数据的拟合程度,提高网络的泛化能力。 在 3 种不同类型的公开 PCB 数据集上的实验结果表明,所提 出的检测算法在 PCB 表面缺陷数据集的平均精度均值(mAP)均有提升,分别为 99. 13% 、98. 67% ,99. 82% ;在类别不均衡的 PCB 缺陷检测任务上,相较于改进前方法,mAP 提升了 11. 94% ,网络检测速度达到 25 FPS,为 PCB 缺陷的检测提供了一种 快速、有效的方法。

    Abstract:

    Addressing the challenges of a long-tailed distribution of data and low detection accuracy caused by the difficulty in collecting defect samples for printed circuit boards (PCBs) in real-world environments, as well as the high computational complexity when using Vision Transformer (ViT) for detection, we propose an end-to-end PCB defect detection algorithm that incorporates multi-scale ViT feature extraction and attention feature fusion. Firstly, a multi-scale feature extraction network is constructed by combining ViT and partial convolution. Hierarchical multi-head attention is employed to perform adaptive attention operations on different scales of feature maps, enabling the network to better capture local and global information, thereby enhancing its feature extraction capabilities. Partial convolution is utilized to reduce computational costs. Secondly, a non-parametric attention mechanism based on the energy domain suppression effectively fuses multi-scale features, enhancing the expressive power of the network′s fused feature maps. Finally, a classification function sensitive to class imbalance is introduced to improve the loss function of the network, enhancing its fitting ability to imbalanced data and improving generalization. The experimental results on three different types of publicly available PCB datasets indicate that the proposed detection algorithm shows improvement in the mean Average Precision ( mAP) for PCB surface defect datasets, with respective values of 99. 13% , 98. 67% , and 99. 82% . In the case of class-imbalanced PCB defect detection tasks, the mAP is improved by 11. 94% compared to the previous method, and the network achieves a detection speed of 25 FPS, providing a fast and effective approach for PCB defect detection.

    参考文献
    相似文献
    引证文献
引用本文

陈俊英,李朝阳,席月芸,刘 冲. ViT 和注意力融合的类别不均衡 PCB 缺陷检测方法[J].仪器仪表学报,2024,45(4):294-306

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:
  • 最后修改日期:
  • 录用日期:
  • 在线发布日期: 2024-07-15
  • 出版日期: