基于YOLOv5m的电机换向器缺陷检测
许云涛,焦培刚*,刘家齐
山东交通学院工程机械学院,山东 济南 250357
摘要:为降低电机换向器缺陷的检测成本,提高检测效率,满足实际工程中对检测精度和检测速度的均衡要求,以YOLOv5m模型为基础提出优化改进的表面缺陷检测算法,将采集的数据集经Mosica数据增强,提高模型的鲁棒性;在其他层中采用双向特征金字塔网络(bidirectional feature pyramid network,BiFPN)层代替路径聚合网路(path aggregation network,PANet)层,引入双向连接和跨层特征融合机制,同时增加Criss-Cross注意力机制,更好地捕捉输入序列中的相关信息,增强网络在不同尺度下的反馈,并通过消融试验验证。结果表明:相较于传统YOLOv5m模型,优化改进后YOLOv5m模型的总体平均检测精度增大17%,准确率增大28.3%,召回率增大8.2%。在保证检测精度的同时,缩短缺陷检测时间,较好地满足缺陷检测工程中对检测精度与检测速度的均衡需求。
关键词:电机换向器;表面缺陷;YOLOv5m;注意力机制;特征融合
Motor commutator defect detection based on YOLOv5m
XU Yuntao, JIAO Peigang*, LIU Jiaqi
School of Construction Machinery, Shandong Jiaotong University, Jinan 250357, China
Abstract:To reduce the detection cost of motor commutator defects, and improve detection efficiency, and meet the balanced requirements of detection accuracy and speed in practical engineering, an optimized and improved surface defect detection algorithm based on the YOLOv5m model is proposed. The collected data is enhanced through Mosica data augmentation to enhance the robustness of model. In other layers, the bidirectional feature pyramid network (BiFPN) layer is used instead of the path aggregation network (PANet) layer, introducing bidirectional connections and cross-layer feature fusion mechanisms, and adding a Criss-Cross attention mechanism to better capture relevant information in the input sequence, and enhance network feedback at different scales, and verified through ablation experiments. The results show that compared to the traditional YOLOv5m model, the average precision (AP), accuracy, and recall of the optimized and improved YOLOv5m model increases by 17%, 28.3%, and 8.2%, respectively. While ensuring detection accuracy, the detection time for defects is shortened, better meeting the balanced requirements of detection accuracy and speed in defect detection engineering.
Keywords: motor commutator; surface defect; YOLOv5m; attention mechanism; feature fusion