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

计算机工程与科学 ›› 2023, Vol. 45 ›› Issue (08): 1463-1471.

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

基于轻量化YOLOX的电子元器件缺陷检测方法研究

吴栋梁1,刘知贵1,2   

  1. (1.西南科技大学信息工程学院,四川 绵阳 621000;2.西南科技大学计算机科学与技术学院,四川 绵阳 621000) 

  • 收稿日期:2022-06-06 修回日期:2022-08-13 接受日期:2023-08-25 出版日期:2023-08-25 发布日期:2023-08-18
  • 基金资助:
    国家自然科学基金(U21A20157)

An electronic component defect detection method based on lightweight YOLOX

WU Dong-liang1,LIU Zhi-gui1,2   

  1. (1.School of Information Engineering,Southwest University of Science and Technology,Mianyang 621000;
    2.School of Computer Science and Technology,Southwest University of Science and Technology,Mianyang 621000,China)
  • Received:2022-06-06 Revised:2022-08-13 Accepted:2023-08-25 Online:2023-08-25 Published:2023-08-18

摘要: 针对传统目标检测方法在对电子元器件进行缺陷检测时存在参数量大、检测效率低的问题,提出了一种基于轻量化YOLOX检测网络的目标检测方法。首先,使用深度可分离卷积对主干网络实现轻量化处理,减少参数量的同时提高检测速度;其次,构建基于空间金字塔的通道注意力模型,对不同尺度特征进行筛选融合,加强小尺寸缺陷的特征权重;在特征融合的采样过程中,加入高效通道注意力,在略微增加参数量的情况下,提升检测精度;最后,采用EIoU损失函数优化IoU损失函数,并使用余弦退火算法来使模型达到最佳检测效果。采用自制的电子元器件外观缺陷数据集进行实验,所提方法的平均检测精度达到98.96%,每幅图像的检测时间大约为0.09 s,与原YOLOX网络相比检测速度提高了一倍,模型大小缩小了约60%,并且在PCB瑕疵公共数据集上进行了验证,结果表明所提方法实现了目标缺陷的快速检测。

关键词: 电子元器件, 缺陷检测, YOLOX, 注意力机制

Abstract: Aiming at the problem of large number of parameters and low detection efficiency of the traditional target detection method in defect detection of electronic components, this paper proposes a target detection method based on the lightweight YOLOX detection network. Firstly, the backbone network is lightened using deeply separable convolution to reduce parameters and improve detection speed. Secondly, a spatial Pyramid-based channel attention model is constructed to filter and fuse features of different scales to enhance the feature weights of small size defects. In the feature fusion upsampling process, efficient channel attention is added to improve detection accuracy with slightly increased parameters. Finally, the EIoU loss function is used to optimize the IoU loss function, and the cosine annealing algorithm is used to make the model achieve the best detection effect. The model is tested on a self-made dataset of electronic component appearance defects, and the average detection accuracy reaches 98.96%, with a detection time of approximately 0.09 seconds per image. Compared with the original model, the detection speed is doubled and the model size is reduced by about 60%. The model is also validated on the PCB defect public dataset, achieving fast detection of target defects.

Key words: electronic component, defect detection, YOLOX, attention mechanism ,