基于改进YOLOv5s算法的轨道扣件缺陷检测
张兴盛,阮久宏*,沈本兰,李金城,华超
山东交通学院轨道交通学院,山东 济南 250357
摘要:针对轨道扣件缺陷复杂程度较高、严重影响列车行车安全、人工巡检效率较低等问题,提出一种基于计算机视觉的轨道扣件缺陷检测算法。考虑轨道扣件缺陷的特征以及检测时所处复杂作业环境,采用ConvNeXt V2模块代替YOLOv5s算法主干网络前端C3模块,采用Efficient Rep网络改进YOLOv5s算法主干网络末端,引入具有动态非聚焦机制的损失函数WIoU加快YOLOv5s算法模型计算收敛速度,形成改进YOLOv5s算法(CR-YOLOv5s算法),检测轨道扣件缺陷状态,开展消融试验,并与快速区域卷积神经网络(faster region-based convolutional neural networks, Faster R-CNN)算法、单阶多层检测(single shot multibox detector, SSD)算法、YOLOv3算法、YOLOv4算法检测进行对比试验。试验结果表明:CR-YOLOv5s算法的召回率为89.3%,平均检测精度均值为95.8%,平均检测时间为10.1 ms,3项指标均优于其他4种算法;与YOLOv5s算法相比,CR-YOLOv5s算法的召回率均值提高5.7%,平均检测精度均值提高4.0%,平均检测时间延长1.0 ms。综合考虑轨道扣件状态检测任务要求、召回率、平均检测精度均值、平均检测时间等因素,采用CR-YOLOv5s算法检测轨道扣件缺陷状态更具优势。
关键词:轨道扣件;缺陷检测;YOLOv5s算法;ConvNeXt V2模块;Efficient Rep网络;损失函数WIoU
Track fastener defect detection based on improved YOLOv5s algorithm
ZHANG Xingsheng, RUAN Jiuhong*, SHEN Benlan, LI Jincheng, HUA Chao
School of Rail Transportation, Shandong Jiaotong University, Jinan 250357, China
Abstract: Aiming at the problems of high complexity of track fastener defects, serious impact on train safety, and low efficiency of manual inspection, a track fastener defect detection algorithm based on computer vision is proposed. Considering the characteristics of track fastener defects and the complex working environment during detection, the ConvNeXt V2 module is used to replace the front-end C3 module of the YOLOv5s algorithm backbone network, the Efficient Rep network is used to improve the back-end of the YOLOv5s algorithm backbone network, and the WIoU loss function with dynamic non-focusing mechanism is introduced to accelerate the convergence speed of the YOLOv5s algorithm model, forming an improved YOLOv5s algorithm(CR-YOLOv5s algorithm) to detect track fastener defect states. Ablation experiments and comparative experiments with faster region-based convolutional neural networks(Faster R-CNN) algorithm, single shot multibox detector(SSD) algorithm, YOLOv3 algorithm, and YOLOv4 algorithm are conducted. The experimental results show that the recall rate of CR-YOLOv5s algorithm is 89.3%, the average detection accuracy is 95.8%, and the average detection time is 10.1 ms, all three indicators are superior to the other four algorithms. Compared with the YOLOv5s algorithm, the CR-YOLOv5s algorithm improves the recall rate by 5.7%, the average detection accuracy by 4.0%, and prolongs the average detection time by 1.0 ms. Considering factors such as track fastener state detection task requirements, recall rate, average detection accuracy, and average detection time, the CR-YOLOv5s algorithm is more advantageous for detecting track fastener defect states.
Keywords: track fastener; defect detection; YOLOv5s algorithm; ConvNeXt V2 module; Efficient Rep network; loss function WIoU
