北京邮电大学学报

  • EI核心期刊

北京邮电大学学报 ›› 2024, Vol. 47 ›› Issue (2): 38-44.

• 论文 • 上一篇    下一篇

轻量化的PCB表面缺陷检测算法

张果,陈逃,王剑平,杨凯钧   

  1. 昆明理工大学信息工程与自动化学院
  • 收稿日期:2023-07-04 修回日期:2023-08-08 出版日期:2024-04-28 发布日期:2024-01-24
  • 通讯作者: 陈逃 E-mail:20212204101@stu.kust.edu.cn
  • 基金资助:
    国家重点研发计划项目;云南省基础研究重点资助项目

Lightweight Detection Algorithm for Detecting Surface Defects in PCB

  • Received:2023-07-04 Revised:2023-08-08 Online:2024-04-28 Published:2024-01-24

摘要: 针对印刷电路板(PCB)表面缺陷检测存在的速度低和准确率不高等问题, 提出了一种基于改进 YOLOv4-tiny 模型的 PCB 表面缺陷检测算法。首先, 采用了优化后的聚类方法对缺陷数据集进行聚类,以解决初始先验框不适合 PCB 表面缺陷检测的问题;其次,为了解决主干网络在下采样时可能丢失小尺度目标信息的问题, 引入了切片操作;接着,在特征融合网络中, 引入了软池化卷积结构,以提高模型感受野,增强对小目标特征的表达能力;最后,通过引入改进后的交叉熵损失函数对损失函数进行优化。在北京大学开源的印刷电路板缺陷数据集上验证了所提算法的效果,结果表明,相较于其他经典算法,所提算法在检测速度、精度和模型参数量等指标上都有较大的提升。

关键词: PCB表面缺陷检测, YOLOv4-tiny, K-means, Focus切片, Focal Loss

Abstract: Surface defect detection for PCB, the speed and accuracy of detection need to be improved, An image detection algorithm: FFS-YOLO is proposed, which is based on the YOLO-V4-tiny framework. The calculation process of the algorithm is: Firstly, the optimized K-means clustering method was used to cluster the defect data set to solve the problem that the initial prior frame was not suitable for PCB surface defect detection. Secondly, in order to solve the problem of small-scale target information loss during down sampling, FOCUS slicing operation is introduced. Thirdly, SCC structure was introduced into PANet to improve the model receptive field and enhance the expression ability of small target features, so as to optimize the model performance. Finally, the Focal loss is used to optimize the loss function. The dataset used for algorithm experimental verification comes from the PCB surface defect dataset published by Peking University, the results showed that: the average detection accuracy of FFS-YOLO was 99.22%, FPS was 142, and the number of model parameters was 6.10MB. Compared with the classical algorithm, the detection speed, accuracy and the number of model parameters of FFS-YOLO are greatly improved.

Key words: PCB surface defect detection, YOLOv4-tiny, K-means, Focus slice, Focal?Loss

中图分类号: