Please wait a minute...
浙江大学学报(工学版)  2025, Vol. 59 Issue (9): 1838-1845    DOI: 10.3785/j.issn.1008-973X.2025.09.007
计算机技术     
轻量化YOLOv5s-OCG的轨枕裂纹检测算法
董超群1,2(),汪战1,廖平1,谢帅1,2,荣玉杰1,周靖淞1
1. 重庆科技大学 机械与智能制造学院,重庆 401331
2. 重庆科技大学 石油天然气装备研究院,重庆 401331
Lightweight YOLOv5s-OCG rail sleeper crack detection algorithm
Chaoqun DONG1,2(),Zhan WANG1,Ping LIAO1,Shuai XIE1,2,Yujie RONG1,Jingsong ZHOU1
1. College of Mechanical and Intelligent Manufacturing, Chongqing University of Science and Technology, Chongqing 401331, China
2. Oil and Gas Equipment Research Institute, Chongqing University of Science and Technology, Chongqing 401331, China
 全文: PDF(1980 KB)   HTML
摘要:

针对高铁轨枕运行年限增加导致裂纹缺陷增多的安全隐患,以及高铁轨枕表面裂纹漏检与误检问题,提出改进的YOLOv5s轨枕裂纹目标检测算法. 在YOLOv5s算法主干网络中使用基于多维注意力机制的全维动态卷积代替传统卷积,提升网络整体的特征提取能力以提高细小裂纹的检测精度;根据ConvNeXt模块和深度可分离卷积提出改进的轻量化C3结构,压缩模型体积和加速网络的收敛以提高检测效率;使用尺度优化的加权GFPN特征融合网络,解决小目标多尺度下采样过程中细节特征丢失的问题,改进的YOLOv5s轨枕裂纹目标检测算法能够有效改善轨枕表面细小裂纹漏检问题. 实验结果表明:改进后的算法模型参数量减少了19.7%,精确率、召回率、平均精度均值分别提高了1.8、2.4和4.2个百分点,检测速度达96帧/s. 结果表明,提出的轻量化YOLOv5s-OCG算法模型为轨枕表面裂纹的实时性检测提供了一种有效解决方案.

关键词: 轨枕裂纹检测目标检测全维动态卷积轻量化结构特征融合网络    
Abstract:

An improved YOLOv5s sleeper crack target detection algorithm was proposed, in response to the safety hazards posed by the increasing number of crack defects in high-speed rail sleepers due to extended service life, as well as the issues of missed and false detections of surface fine cracks in high-speed rail sleepers. In the backbone network of the YOLOv5s algorithm, the full-dimensional dynamic convolution based on the multi-dimensional attention mechanism was used instead of the traditional convolution to enhance the overall feature extraction ability of the network and improve the detection accuracy of fine cracks. An improved lightweight C3 structure was proposed based on the ConvNeXt module and depth-separable convolution to compress the model volume and accelerate the convergence of the network to improve the detection efficiency. The scale-optimized weighted GFPN feature fusion network was used to solve the problem of detail feature loss in the sampling process of small targets at multiple scales. The improved YOLOv5s sleeper crack target detection algorithm could solve the problem of missed detection of fine cracks on the sleeper surface effectively. The experimental results showed that the parameter count of the improved algorithm model was decreased by 19.7%, the accuracy rate, recall rate and mean average precision were increased by 1.8, 2.4 and 4.2 percentage points respectively, and the detection speed was up to 96 frames per second. The results verify that the proposed lightweight YOLOv5s-OCG algorithm model provides an effective solution for the real-time detection of surface cracks on sleepers.

Key words: rail sleeper crack detection    object detection    omni-dimensional dynamic convolution    lightweight structure    feature fusion network
收稿日期: 2024-04-03 出版日期: 2025-08-25
CLC:  TP 391.4  
基金资助: 国家自然科学基金资助项目(5227041805);国家重点研发计划资助项目(2018YFB2002205);重庆市教委资助项目(KJQN202001538).
作者简介: 董超群(1983—)男,副教授,博士,从事基于图像处理的油气装备安全评价研究. orcid.org/0000-0002-3962-2435. E-mail:dcqust@126.com
服务  
把本文推荐给朋友
加入引用管理器
E-mail Alert
作者相关文章  
董超群
汪战
廖平
谢帅
荣玉杰
周靖淞

引用本文:

董超群,汪战,廖平,谢帅,荣玉杰,周靖淞. 轻量化YOLOv5s-OCG的轨枕裂纹检测算法[J]. 浙江大学学报(工学版), 2025, 59(9): 1838-1845.

Chaoqun DONG,Zhan WANG,Ping LIAO,Shuai XIE,Yujie RONG,Jingsong ZHOU. Lightweight YOLOv5s-OCG rail sleeper crack detection algorithm. Journal of ZheJiang University (Engineering Science), 2025, 59(9): 1838-1845.

链接本文:

https://www.zjujournals.com/eng/CN/10.3785/j.issn.1008-973X.2025.09.007        https://www.zjujournals.com/eng/CN/Y2025/V59/I9/1838

图 1  YOLOv5s-6.0网络结构
图 2  ODConv结构示意图
图 3  C3模块示意图
图 4  ConvNeXt结构示意图
图 5  轻量化C3结构示意图
图 6  不同尺度的特征融合结构图
图 7  YOLOv5特征融合网络结构图
配置项配置规格
CPUIntel(R) Xeon(R) CPU E5-2680 v4 @2.40 GHZ
GPUNVIDIA GeForce RTX3060(12 G)
内存30 G
操作系统Ubuntu18.04
深度学习框架Pytorch1.11.0、CUDA11.3
编程语言Python
表 1  实验硬件与软件环境
图 8  标注样例与数据集样例
编号模型ODConvC3_LIGHTGFPNPrecision/%Recall/%mAP@0.5/%FPS/(帧·s?1)P/106
1YOLOv5s44.459.742.9947.03
2YOLOv5s-O45.161.144.9917.03
3YOLOv5s-C44.761.144.8985.55
4YOLOv5s-G45.861.846.2927.35
5YOLOv5s-OC45.661.445.7965.56
6YOLOv5s-OG45.561.946.5927.35
7YOLOv5s-CG45.961.846.3955.62
8YOLOv5s-OCG46.262.147.1965.64
表 2  YOLOv5s基础实验和改进模块的消融实验结果
ModelPrecision/%Recall/%mAP@0.5/%FPS/(帧·s?1)P/106
Faster-RCNN41.943.832.612137.10
SSD40.354.438.13126.23
CenterNet43.656.141.87032.62
RetinaNet41.154.840.06428.55
YOLOv342.559.741.9889.31
YOLOv5s44.459.742.9947.03
YOLOv7-tiny43.156.842.0896.03
YOLOv5s-GhostNet40.856.138.51073.71
YOLOv5s-shufflenetv240.153.536.21100.84
YOLOv5s-OCG46.262.147.1965.64
表 3  经典算法模型与轻量化模型对比实验结果
图 9  改进算法前后检测效果图和热力图
1 李修文, 曾承志, 杨荣华, 等 轨道故障引发的轮轨冲击特征研究[J]. 城市轨道交通研究, 2022, 25 (1): 122- 126
LI Xiuwen, ZENG Chengzhi, YANG Ronghua, et al Research on the characteristics of wheel rail impact caused by rail fault[J]. Urban Mass Transit, 2022, 25 (1): 122- 126
2 侯学良, 单腾飞, 薛靖国 深度学习的目标检测典型算法及其应用现状分析[J]. 国外电子测量技术, 2022, 41 (6): 165- 174
HOU Xueliang, SHAN Tengfei, XUE Jingguo Analysis of typical target detection algorithm based on deep learning and its application status[J]. Foreign Electronic Measurement Technology, 2022, 41 (6): 165- 174
3 WANG Y, ZHANG K, WANG L, et al An improved YOLOv8 algorithm for rail surface defect detection[J]. IEEE Access, 2024, 12: 44984- 44997
doi: 10.1109/ACCESS.2024.3380009
4 GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation [C]// IEEE Conference on Computer Vision and Pattern Recognition. Columbus: IEEE, 2014: 580–587.
5 REN S, HE K, 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
6 LIU W, DRAGOMIR A, DUMITRU E, et al. SSD: single shot multibox detector [C]// European Conference on Computer Vision. Cham: Springer, 2016: 21–37.
7 薛雅丽, 贺怡铭, 崔闪, 等 基于改进YOLOv5的SAR图像有向舰船目标检测算法[J]. 浙江大学学报: 工学版, 2025, 59 (2): 261- 268
XUE Yali, HE Yiming, CUI Shan, et al Oriented ship detection algorithm in SAR image based on improved YOLOv5[J]. Journal of Zhejiang University: Engineering Science, 2025, 59 (2): 261- 268
8 REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection [C]// IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2016: 779–788.
9 李鑫, 李香蓉, 汪诚, 等 基于改进YOLOv5的航空发动机表面缺陷检测模型[J]. 激光与光电子学进展, 2023, 60 (16): 304- 313
LI Xin, LI Xiangrong, WANG Cheng, et al Aero-engine surface defect detection model based on improved YOLOv5[J]. Laser & Optoelectronics Progress, 2023, 60 (16): 304- 313
10 汪沛洁, 谌雨章, 王诗琦, 等 基于改进YOLOv5的鱼群小目标检测优化算法[J]. 湖北大学学报: 自然科学版, 2024, 46 (1): 14- 24
WANG Peijie, CHEN Yuzhang, WANG Shiqi, et al Optimization algorithm of fish shoal small target detection based on improved YOLOv5[J]. Journal of Hubei University: Natural Science, 2024, 46 (1): 14- 24
11 王宏志, 宋明轩, 程超, 等 基于改进 YOLOv5 算法的道路目标检测方法[J]. 吉林大学学报: 工学版, 2024, (9): 2658- 2667
WANG Hongzhi, SONG Mingxuan, CHENG Chao, et al Road object detection method based on improved YOLOv5 algorithm[J]. Journal of Jilin University: Engineering and Technology Edition, 2024, (9): 2658- 2667
12 令雅莉, 杨桂芹, 张又元, 等 基于改进算法YOLOv5+的混凝土轨枕裂纹检测[J]. 铁道标准设计, 2024, 68 (4): 70- 77
LING Yali, YANG Guiqin, ZHANG Youyuan, et al Crack detection of concrete sleeper based on improved algorithm YOLOv5+[J]. Railway Standard Design, 2024, 68 (4): 70- 77
13 王琳毅, 白静, 李文静, 等 YOLO系列目标检测算法研究进展[J]. 计算机工程与应用, 2023, 59 (14): 15- 29
WANG Linyi, BAI Jing, LI Wenjing, et al Research progress of YOLO series target detection algorithms[J]. Computer Engineering and Applications, 2023, 59 (14): 15- 29
doi: 10.3778/j.issn.1002-8331.2301-0081
14 GUO S, LI L, GUO T, et al Research on mask-wearing detection algorithm based on improved YOLOv5[J]. Sensors, 2022, 22 (13): 4933
doi: 10.3390/s22134933
15 LI C, ZHOU A, YAO A. Omni-dimensional dynamic convolution [C]// International Conference on Learning Representations. Appleton: [s.n.], 2022(1181): 1–20.
16 YANG B, BENDER G, LE Q V, et al. Condconv: conditionally parameterized convolutions for efficient inference [J]. Advances in Neural Information Processing Systems, 2019, 32.
17 CHEN Y, DAI X, LIU M, et al. Dynamic convolution: attention over convolution kernels [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 11030–11039.
18 LIU Z, MAO H, WU C Y, et al. A ConvNet for the 2020s [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition. New Orleans: IEEE, 2022: 11966–11976.
19 LIU Z, LIN Y, CAO Y, et al. Swin transformer: hierarchical vision transformer using shifted windows [C]// IEEE/CVF International Conference on Computer Vision. Montreal: IEEE, 2021: 9992–10002.
20 刘欢, 李云红, 张蕾涛, 等 基于MA-ConvNext网络和分步关系知识蒸馏的苹果叶片病害识别[J]. 浙江大学学报: 工学版, 2024, 58 (9): 1757- 1767,1780
LIU Huan, LI Yunhong, ZHANG Leitao, et al Identification of apple leaf diseases based on MA-ConvNext network and stepwise relational knowledge distillation[J]. Journal of Zhejiang University: Engineering Science, 2024, 58 (9): 1757- 1767,1780
21 朱宏禹, 韩建宁, 徐勇 基于改进型YOLOv5s的印刷线路板瑕疵检测[J]. 国外电子测量技术, 2023, 42 (3): 152- 159
ZHU Hongyu, HAN Jianning, XU Yong Printed circuit board blemishes detection based on the improved YOLOv5s[J]. Foreign Electronic Measurement Technology, 2023, 42 (3): 152- 159
22 TAN M, PANG R, LE Q V. EfficientDet: scalable and efficient object detection [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 10778–10787.
23 ZHAO C, SHU X, YAN X, et al RDD-YOLO: a modified YOLO for detection of steel surface defects[J]. Measurement, 2023, 214: 112776
doi: 10.1016/j.measurement.2023.112776
24 曹建斌. 基于深度学习的高速铁路混凝土轨枕裂纹检测[D]. 上海: 上海大学, 2020.
CAO Jianbin. Crack detection of railway concrete sleeper based on deep learning [D]. Shanghai: Shanghai University, 2020.
25 李飞, 胡坤, 张勇, 等 基于混合域注意力YOLOv4的输送带纵向撕裂多维度检测[J]. 浙江大学学报: 工学版, 2022, 56 (11): 2156- 2167
LI Fei, HU Kun, ZHANG Yong, et al Multi-dimensional detection of longitudinal tearing of conveyor belt based on YOLOv4 of hybrid domain attention[J]. Journal of Zhejiang Universit: Engineering Science, 2022, 56 (11): 2156- 2167
26 王安静, 袁巨龙, 朱勇建, 等 基于改进YOLOv8s的鼓形滚子表面缺陷检测算法[J]. 浙江大学学报: 工学版, 2024, 58 (2): 370- 380
WANG Anjing, YUAN Julong, ZHU Yongjian, et al Drum roller surface defect detection algorithm based on improved YOLOv8s[J]. Journal of Zhejiang University: Engineering Science, 2024, 58 (2): 370- 380
27 HAN K, WANG Y, TIAN Q, et al. GhostNet: more features from cheap operations [C]// IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 1577–1586.
[1] 付家瑞,李兆飞,周豪,黄惟. 基于Convnextv2与纹理边缘引导的伪装目标检测[J]. 浙江大学学报(工学版), 2025, 59(8): 1718-1726.
[2] 翟亚红,陈雅玲,徐龙艳,龚玉. 改进YOLOv8s的轻量级无人机航拍小目标检测算法[J]. 浙江大学学报(工学版), 2025, 59(8): 1708-1717.
[3] 徐慧智,王秀青. 基于车辆图像特征的前车距离与速度感知[J]. 浙江大学学报(工学版), 2025, 59(6): 1219-1232.
[4] 李沈崇,曾新华,林传渠. 基于轴向注意力的多任务自动驾驶环境感知算法[J]. 浙江大学学报(工学版), 2025, 59(4): 769-777.
[5] 王浚银,文斌,沈艳军,张俊,王子豪. 基于改进YOLOv7-tiny的铝型材表面缺陷检测方法[J]. 浙江大学学报(工学版), 2025, 59(3): 523-534.
[6] 何永福,谢世维,于佳禄,陈思宇. 考虑跨层特征融合的抛洒风险车辆检测方法[J]. 浙江大学学报(工学版), 2025, 59(2): 300-309.
[7] 董红召,林少轩,佘翊妮. 交通目标YOLO检测技术的研究进展[J]. 浙江大学学报(工学版), 2025, 59(2): 249-260.
[8] 于家艺,吴秦. 基于上下文信息增强和深度引导的单目3D目标检测[J]. 浙江大学学报(工学版), 2025, 59(1): 89-99.
[9] 宋娟,贺龙喜,龙会平. 基于深度学习的隧道衬砌多病害检测算法[J]. 浙江大学学报(工学版), 2024, 58(6): 1161-1173.
[10] 邓天民,程鑫鑫,刘金凤,张曦月. 基于特征复用机制的航拍图像小目标检测算法[J]. 浙江大学学报(工学版), 2024, 58(3): 437-448.
[11] 张会娟,李坤鹏,姬淼鑫,刘振江,刘建娟,张弛. 基于空间相关性增强的无人机检测算法[J]. 浙江大学学报(工学版), 2024, 58(3): 468-479.
[12] 宋耀莲,王粲,李大焱,刘欣怡. 基于改进YOLOv5s的无人机小目标检测算法[J]. 浙江大学学报(工学版), 2024, 58(12): 2417-2426.
[13] 莫恒辉,魏霖静. 基于改进YOLOv7的复杂环境下苹果目标检测[J]. 浙江大学学报(工学版), 2024, 58(12): 2447-2458.
[14] 吕佳铭,张峰,罗亚波. 基于改进YOLOv5s的烟梗物料目标检测算法[J]. 浙江大学学报(工学版), 2024, 58(12): 2438-2446.
[15] 杜丁健,高遵海,陈倬. 基于改进YOLOv5的枸杞虫害检测[J]. 浙江大学学报(工学版), 2024, 58(10): 1992-2000.