光电子·激光2024,Vol.35Issue(2) :155-163.DOI:10.16136/j.joel.2024.02.0603

基于改进YOLOv5的PCB小目标缺陷检测研究

Research on PCB small target defect detection based on improved YOLOv5

伍济钢 梁谋 曹鸿 张源 杨康
光电子·激光2024,Vol.35Issue(2) :155-163.DOI:10.16136/j.joel.2024.02.0603

基于改进YOLOv5的PCB小目标缺陷检测研究

Research on PCB small target defect detection based on improved YOLOv5

伍济钢 1梁谋 1曹鸿 1张源 1杨康1
扫码查看

作者信息

  • 1. 湖南科技大学机械设备健康维护湖南省重点实验室,湖南湘潭 411201
  • 折叠

摘要

面对印刷电路板(print circuit board,PCB)小型化、多层化、高集成化的趋势,针对目前PCB缺陷检测方法存在漏检、特征提取困难、误检率高以及检测性能差等问题,本文提出了基于改进YOLOv5算法的PCB小目标缺陷检测方法.该方法先针对PCB小目标缺陷特点采用DBSCAN(density-based spatial clustering of applications with noise)+二分 K-means 聚类算法以找到更适合的锚框;然后对YOLOv5的特征提取层、特征融合层以及特征检测层进行改进,增强关键信息的提取,加强深层信息与浅层信息的融合;从而减少PCB缺陷的误检率、漏检率,以提高网络的检测性能;最后在公开PCB数据集上进行相关对比实验.结果表明,改进后模型的平均精度(mAP)为99.5%,检测速度为0.016s.相比于Faster R-CNN、YOLOv3、YOLOv4网络模型,检测精度分别提升了 17.8%、9.7%、5.3%,检测速度分别提升了0.846 s、0.120 s、0.011 s,满足PCB缺陷在实际工业生产现场的高精度、高速度检测要求.

Abstract

Facing the trend of miniaturization,multilayer,and high integration of print circuit board(PCB),to address the problems of missed detection,difficult feature extraction,high false detection rate,and poor detection performance of current PCB defect detection methods,this paper proposes a PCB small target defect detection method based on the improved YOLOv5 algorithm.It first uses the density-based spatial clustering of applications with noise(DBSCAN)+dichotomous K-means clustering algo-rithm for PCB small target defect characteristics to find a more suitable anchor frame.It then improves the feature extraction layer,feature fusion layer,and feature detection layer of the YOLOv5 network to enhance the extraction of key information and strengthen the fusion of deep and shallow information.This reduces the false and missed detection rate of PCB defects to improve the detection performance of the network.Finally,relevant comparative experiments are conducted on the publicly available PCB data-set.The results show that the improved model has an average accuracy(mAP)of 99.5%and a detection speed of 0.016 s.Compared with the Faster R-CNN,YOLOv3,and YOLOv4 network models,the de-tection accuracy is improved by 17.8%,9.7%and 5.3%,respectively,and the detection speed is im-proved by 0.846 s,0.120 s and 0.011 s,respectively,which satisfies the requirements of high precision and high-speed detection of PCB defects in actual industrial production sites.

关键词

PCB缺陷检测/YOLOv5/聚类算法/注意力机制/解耦头

Key words

PCB defect detection/YOLOv5/clustering algorithm/attention mechanism/decoupled-head

引用本文复制引用

基金项目

国家自然科学基金(51775181)

出版年

2024
光电子·激光
天津理工大学 中国光学学会

光电子·激光

北大核心
影响因子:1.437
ISSN:1005-0086
参考文献量27
段落导航相关论文