|
|
Surface defect detection algorithm of electronic components based on improved YOLOv5 |
Yao ZENG(),Fa-qin GAO*() |
School of Information Science and Engineering, Zhejiang Sci-Tech University, Hangzhou 310018, China |
|
|
Abstract For the poor real-time detection capability of the current object detection model in the production environment of electronic components, GhostNet was used to replace the backbone network of YOLOv5. And for the existence of small objects and objects with large scale changes on the surface defects of electronic components, a coordinate attention module was added to the YOLOv5 backbone network, which enhanced the sensory field while avoiding the consumption of large computational resources. The coordinate information was embedded into the channel attention to improve the object localization of the model. The feature pyramid networks (FPN) structure in the YOLOv5 feature fusion module was replaced with a weighted bi-directional feature pyramid network structure, to enhance the fusion capability of multi-scale weighted features. Experimental results on the self-made defective electronic component dataset showed that the improved GCB-YOLOv5 model achieved an average accuracy of 93% and an average detection time of 33.2 ms, which improved the average accuracy by 15.0% and the average time by 7 ms compared with the original YOLOv5 model. And the improved model can meet the requirements of both accuracy and speed of electronic component surface defect detection.
|
Received: 30 May 2022
Published: 31 March 2023
|
|
Fund: 浙江省教育厅一般科研项目(专业学位专项)(Y202147956) |
Corresponding Authors:
Fa-qin GAO
E-mail: yaozeng2019@163.com;gfqzjlg@126.com
|
基于改进YOLOv5的电子元件表面缺陷检测算法
目标检测模型在电子元件生产环境中的实时检测能力不佳,为此采用GhostNet替换YOLOv5的主干网络. 针对电子元件表面缺陷存在小目标及尺度变化较大的目标的情况,在YOLOv5主干网络中加入坐标注意力机制,在避免大量计算资源消耗的前提下增强感受野,将坐标信息嵌入通道注意力中以提升模型对目标的定位. 使用加权双向特征金字塔网络结构替换YOLOv5特征融合模块中的特征金字塔网络(FPN)结构,提升多尺度加权特征的融合能力. 在自制缺陷电子元件数据集上的实验结果表明,改进的GCB-YOLOv5模型平均精度达到93%,平均检测时间为33.2 ms,相比于原始YOLOv5模型,平均精度提高了15.0%,平均时间提升了7 ms,可以同时满足电子元件表面缺陷检测精度与速度的需求.
关键词:
目标检测网络,
深度学习,
电子元件表面缺陷,
YOLOv5,
注意力机制
|
|
[1] |
王宇, 吴智恒, 邓志文, 等 基于机器视觉的金属零件表面缺陷检测系统[J]. 机械工程与自动化, 2018, (4): 210- 211+214 WANG Yu, WU Zhi-heng, DENG Zhi-wen, et al Metal component surface defect detection system based on machine vision[J]. Mechanical Engineering and Automation, 2018, (4): 210- 211+214
doi: 10.3969/j.issn.1672-6413.2018.04.088
|
|
|
[2] |
HO C C, SU E, LI P, et al Machine vision and deep learning based rubber gasket defect detection[J]. Advances in Technology Innovation, 2020, 5 (2): 76- 83
doi: 10.46604/aiti.2020.4278
|
|
|
[3] |
李璟钰, 肖俊良, 付晗, 等 基于机器视觉的导光板表面微小缺陷检测[J]. 信息系统工程, 2021, (2): 65- 69 LI Jing-yu, XIAO Jun-liang, FU Han, et al Detection of small defects on the surface of light guide plates[J]. China CIO News, 2021, (2): 65- 69
|
|
|
[4] |
戴君洁. 基于机器视觉的目标识别和表面缺陷检测研究[D]. 大理: 大理大学, 2021. DAI Jun-jie. Research on object recognition and surface defect detection based on machine vision [D]. Dali: Dali University, 2021.
|
|
|
[5] |
LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot MultiBox detector [EB/OL]. [2022-04-07]. https://arxiv.org/pdf/1512.02325.pdf.
|
|
|
[6] |
REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2016: 779-788.
|
|
|
[7] |
GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Columbus: IEEE, 2014: 580-587.
|
|
|
[8] |
GIRSHICK R. Fast R-CNN [C]// 2015 IEEE International Conference on Computer Vision. Santiago: IEEE, 2015: 1440-1448.
|
|
|
[9] |
REN S Q, HE K M, GIRSHICK R, et al Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39 (6): 1137- 1149
doi: 10.1109/TPAMI.2016.2577031
|
|
|
[10] |
HE K M, GKIOXARI G, DOLLÁR P, et al. Mask R-CNN [C]// 2017 IEEE International Conference on Computer Vision. Venice: IEEE, 2017: 2980−2988.
|
|
|
[11] |
黄海新, 金鑫. 基于YOLOv4的小目标缺陷检测[J]. 电子世界, 2021(5): 146-147. HUANG Hai-xin, JIN Xin. Detection of small object defect based on YOLOv4 [J]. Electronics World, 2021(5): 146-147.
|
|
|
[12] |
刘聪. 基于卷积神经网络的微小零件表面缺陷检测技术研究[D]. 哈尔滨: 哈尔滨理工大学, 2019. LIU Cong. Research on surface defects detection of micro parts based on convolution neural network [D]. Harbin: Harbin University of Science and Technology, 2019.
|
|
|
[13] |
陈绪浩. 基于深度学习的高速连接器高精度表面缺陷检测算法研究[D]. 成都: 电子科技大学, 2021. CHEN Xu-hao. Research on high precision surface defect detection algorithm of high speed connector based on deep learning [D]. Chengdu: University of Electronic Science and Technology of China, 2021.
|
|
|
[14] |
代牮, 赵旭, 李连鹏, 等 基于改进YOLOv5的复杂背景红外弱小目标检测算法[J]. 红外技术, 2022, 44 (5): 504- 512 DAI Jian, ZHAO Xu, LI Lian-peng, et al Improved YOLOv5-based infrared dim-small target detection under complex background[J]. Infrared Technology, 2022, 44 (5): 504- 512
|
|
|
[15] |
HOU Q, ZHOU D, FENG J. Coordinate attention for efficient mobile network design [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Nashville: IEEE, 2021: 13708-13717.
|
|
|
[16] |
TAN M, PANG R, LE Q V. EfficientDet: scalable and efficient object detection [EB/OL]. [2022-04-07]. https://arxiv.org/pdf/1911.09070.pdf.
|
|
|
[17] |
HAN K, WANG Y, TIAN Q, et al. GhostNet: more features from cheap operations [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 1577-1586.
|
|
|
[18] |
LIU S, QI L, QIN H, et al. Path aggregation network for instance segmentation [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Lake City: IEEE, 2018: 8759-8768.
|
|
|
[19] |
BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detection [EB/OL]. [2022-04-07]. https://arxiv.org/pdf/2004.10934.pdf.
|
|
|
[20] |
GHIASI G, CUI Y, SRINIVAS A, et al. Simple copy-paste is a strong data augmentation method for instance segmentation [EB/OL]. [2022-04-07]. https://arxiv.org/pdf/2012.07177.pdf.
|
|
|
|
Viewed |
|
|
|
Full text
|
|
|
|
|
Abstract
|
|
|
|
|
Cited |
|
|
|
|
|
Shared |
|
|
|
|
|
Discussed |
|
|
|
|