Computer Integrated Manufacturing System ›› 2024, Vol. 30 ›› Issue (11): 3984-3998.DOI: 10.13196/j.cims.2022.0312

Previous Articles     Next Articles

YOLO-J based PCB defect detection algorithm

SU Jia,JIA Xinyu,HOU Weimin+   

  1. College of Information Science and Engineering,Hebei University of Science and Technology
  • Online:2024-11-30 Published:2024-11-28
  • Supported by:
    Project supported by the Equipment Pre-Research Key Laboratory Fund,China(No.6142A010301).

基于YOLO-J的PCB缺陷检测算法

苏佳,贾欣雨,侯卫民+   

  1. 河北科技大学信息科学与工程学院
  • 作者简介:
    苏佳(1981-),女,河北石家庄人,副教授,博士,研究方向:无线通信、目标检测,E-mail:sujia@hebust.edu.cn;

    贾欣雨(1997-),女,河北石家庄人,硕士研究生,研究方向:目标检测、目标跟踪,E-mail:871174246@qq.com;

    +侯卫民(1973-),男,河北邢台人,教授,博士,研究方向:遥感信号处理、人工智能,通讯作者,E-mail:hwm@hebust.edu.cn。
  • 基金资助:
    装备预研重点实验室基金资助项目(6142A010301)。

Abstract: Aiming at the problems of low accuracy and excessive number of model parameters in existing Printed Circuit Boards (PCB) defect detection methods,a PCB defect detection algorithm based on YOLO-J with improved YOLOv4 was proposed.To solve the problem that CSPDarknet53 in YOLOv4 has too many parameters to deploy on mobile,the Resnet50 was used as the feature extraction network for the model.To avoid reducing the detection effect by replacing the feature extraction network,the feature extraction capability of the model for small target PCB defects was enhanced by adding the attention mechanism and improving the PANet structure.The H-Swish activation function was used as the activation function of the neck for the purpose of improving detection accuracy and training speed.In addition,to solve the problem that the initial anchor frame was not suitable for detecting PCB defects,bisecting K-means was used to cluster the PCB dataset.The PCB defect dataset published by Peking University Laboratory was used for the experiment.The results showed that compared with YOLOv4,the mAP of the proposed method increased by 0.29% when IOU = 0.5;when IOU = 0.5:0.95,both mAP and recall increased by 6.7% and the speed increased by 2.24FPS,and the model size was 132MB,which was about 1/2 of YOLOv4.

Key words: deep learning, YOLOv4, defect detection, small target detection

摘要: 针对现有PCB缺陷检测方法存在准确率低和模型参数量过多的问题,提出基于改进YOLOv4的YOLO-J的PCB缺陷检测算法。该方法使用Resnet作为模型的特征提取网络,解决YOLOv4中因CSPDarknet53参数太多从而难以部署在移动端的问题。为避免替换特征提取网络降低检测效果,通过增加注意力机制和改进PANet结构,提高模型对小目标PCB缺陷的特征提取能力。使用H-Swish激活函数作为颈部的激活函数,以达到提升检测精度和训练速度的目的。另外,通过使用二分K-means对PCB数据集聚类,解决初始锚框不适合检测PCB缺陷的问题。使用北京大学实验室公开发布的PCB缺陷数据集进行实验,结果表明,该方法相较于YOLOv4,在IoU=0.5时mAP提升了0.29%;在IoU=0.5:0.95时mAP和召回率均提升了6.7%,速度提升了2.24FPS,模型大小为132MB,约为YOLOv4的1/2。

关键词: 深度学习, YOLOv4, 缺陷检测, 小目标检测

CLC Number: