Lightweight tunnel surface defect detection algorithm based on MDS-YOLO
-
摘要: 针对隧道表观病害检测中存在复杂环境干扰严重、多尺度病害特征难以准确提取与高效识别的问题,提出了一种基于改进YOLOv8的轻量级隧道表观病害检测算法MDS-YOLO,以YOLOv8n模型为基础进行改进。在骨干网络中设计多尺度特征融合(C2f_MSFA)模块替代原C2f特征提取模块,通过部分通道卷积与多尺度特征融合方式,有效提取并聚合来自不同层级的特征图,增强模型对尺寸差异显著的病害目标的感知与表达能力;在颈部网络中引入动态上采样模块(DySample)替代传统上采样方法,根据输入特征内容自适应学习采样参数,增强上采样阶段的特征还原能力和空间信息保持效果,提高了特征融合的精度和效率;构建共享卷积检测头(SC_Detection),利用共享卷积策略与组归一化策略,在降低参数量和计算复杂度的同时提升了模型的检测效率和稳定性。试验结果表明:MDS-YOLO模型在渗漏水、裂缝、衬砌脱落3类隧道表观病害检测任务中检测精度较改进前分别提升了2.2%、3.4%、4.4%,平均检测精度达到74.2%,较基准模型YOLOv8n提升3.4%;模型参数量由3.00×106压缩至1.97×106,减少34.3%;计算量由8.1×109降低至5.6×109,减少30.9%;模型体积从5.96 MB压缩至4.00 MB。该算法在保证检测精度的同时实现了模型的轻量化,满足隧道巡检、边缘计算等实际场景中对高精度与低计算资源并重的应用需求。
-
关键词:
- 隧道工程 /
- MDS-YOLO算法 /
- 深度学习 /
- 隧道病害检测 /
- 轻量化
Abstract: To address the issues of severe interference in complex environments and the difficulty in accurately extracting and efficiently identifying multi-scale defect features in tunnel surface defect detection, a lightweight tunnel surface defect detection algorithm named MDS-YOLO was proposed based on an improved YOLOv8 model. The algorithm was built upon the YOLOv8n model. A multi-scale feature fusion (C2f_MSFA) module was designed in the backbone network to replace the original C2f feature extraction module. By using partial channel convolution and multi-scale feature fusion methods, the feature maps were effectively extracted and aggregated from different levels, enhancing the model's perception and representation ability for defect targets with significant size differences. A dynamic upsampling module (DySample) was introduced in the neck network to replace traditional upsampling methods. The module adaptively learned sampling parameters based on the input feature content, enhancing the feature restoration ability and spatial information preservation during upsampling and improving the accuracy and efficiency of feature fusion. A shared convolution detection head (SC_Detection) was constructed. By using shared convolution and group normalization strategies, the model's detection efficiency and stability were improved while reducing the number of parameters and computational complexity. Experimental results show that the MDS-YOLO model achieves accuracy improvements of 2.2%, 3.4%, and 4.4% in detecting three types of tunnel surface defects, including water leakage, cracks, and lining spalling, respectively. The average detection accuracy reaches 74.2%, which is 3.4% higher than that of the baseline model YOLOv8n. The number of model parameters is reduced from 3.00×106 to 1.97×106, with a decrease of 34.3%. The amount of computation is reduced from 8.1×109 to 5.6×109, with a reduction of 30.9%. The model size is compressed from 5.96 MB to 4.00 MB. The algorithm achieves a lightweight model while ensuring detection accuracy, meeting the application requirements of high accuracy and low computational resources in practical scenarios such as tunnel inspection and edge computing.-
Key words:
- tunnel engineering /
- MDS-YOLO algorithm /
- deep learning /
- tunnel defect detection /
- lightweight
-
表 1 C2f_MSFA模块验证试验
Table 1. Validation experiment of C2f_MSFA module
参数 P/% R/% Map/% 参数量/106 计算量/109 试验前 81.2 64.7 70.8 3.00 8.1 主干 81.0 64.6 71.1 2.79 7.5 颈部 79.9 67.7 71.8 2.81 7.7 主+颈 83.9 65.6 72.2 2.60 7.1 表 2 消融试验
Table 2. Ablation experiments
试验编号 C2f_MSFA DySample SC_Detection P/% R/% Map/% 参数量/106 计算量/109 模型大小/MB 1 × × × 81.2 64.7 70.8 3.00 8.1 5.96 2 √ × × 83.9 65.6 72.2 2.60 7.1 5.95 3 √ √ × 85.0 67.0 72.9 2.56 6.8 5.23 4 × √ √ 78.3 67.5 71.0 2.37 6.5 4.73 5 √ × √ 78.3 67.6 72.0 2.16 6.1 4.35 6 √ √ √ 84.7 66.9 74.2 1.97 5.6 4.00 表 3 改进前后3类病害指标对比
Table 3. Comparison of 3 types of defect indicators before and after improvement
模型 类别 P/ % R/ % Map/ % P的指标均值/% R的指标均值/% Map的指标均值/% YOLO v8n 渗漏水 78.6 82.0 79.3 81.2 64.7 70.8 裂缝 88.0 63.4 72.5 衬砌脱落 77.0 48.8 60.7 MDS- YOLO 渗漏水 83.4 78.8 81.5 84.7 66.9 74.2 裂缝 92.0 64.5 75.9 衬砌脱落 78.7 57.6 65.1 表 4 C2f_MSFA模块对比试验
Table 4. Comparison experiment of the C2f_MSFA module
方法 P/% R/% Map/ % 参数量/106 计算量/109 C3 75.8 65.5 69.9 2.48 6.8 C2f 81.2 64.7 70.8 3.00 8.1 C2f_Faster 77.9 64.3 69.7 2.47 6.3 C2f_DBB 75.0 67.0 71.4 3.01 8.1 C2f_MSFA 83.9 65.6 72.2 2.60 7.1 表 5 DySample模块对比试验
Table 5. Comparison experiment of the DySample module
方法 P/% R/% Map/ % 参数量/106 计算量/109 Upsample 81.2 64.7 70.8 3.00 8.1 CARAFE 79.5 66.4 72.3 3.14 8.4 DySample 78.7 68.7 71.9 2.81 7.7 表 6 SC_Detection检测头对比试验
Table 6. Comparison experiment of the SC_Detection head
方法 P/% R/% Map/ % 参数量/106 计算量/109 YOLOv8head 81.2 64.7 70.8 3.00 8.1 Dyhead 81.7 68.6 72.3 3.48 9.6 LADH 77.3 66.8 70.9 2.38 6.2 SEAMhead 83.1 64.6 72.1 2.81 7.0 SC_Detection 84.8 65.6 72.0 2.36 6.5 表 7 算法对比试验
Table 7. Comparison experiment of algorithms
模型 P/% R/% Map/% 参数量/106 计算量/109 模型大小/MB SSD 69.6 57.3 65.4 24.28 275.6 96.80 Faster R-CNN 73.1 62.8 67.9 41.03 215.1 186.70 YOLOv5n 77.7 65.2 68.6 1.95 5.4 3.94 YOLOv6n 82.8 62.4 71.1 4.23 11.8 8.70 YOLOv7t 71.7 59.8 65.4 6.01 13.0 12.30 YOLOv8n 81.2 64.7 70.8 3.00 8.1 5.96 YOLOv10n 80.6 64.5 70.4 2.26 6.5 5.48 YOLOv11n 79.3 66.6 71.2 2.58 6.3 4.97 YOLOv8n-Fasternet 77.7 64.1 69.8 4.17 9.7 6.20 YOLOv8n-Starnet 82.2 63.9 70.8 1.68 4.9 3.42 YOLOv8n-Efficientnet 80.2 65.5 70.4 2.01 5.4 4.34 MDS-YOLO 84.7 66.9 74.2 1.97 5.6 4.00 -
[1] 王福文, 梁帅文, 冯爱军. 2023年我国城市轨道交通数据统计与发展分析[J]. 隧道建设(中英文), 2024, 44(2): 393-400.WANG Fu-wen, LIANG Shuai-wen, FENG Ai-jun. Statistics and development analysis of urban rail transit in China in 2023[J]. Tunnel Construction, 2024, 44(2): 393-400. [2] 朱明哲, 梁彧, 范长新. 既有铁路隧道病害整治技术及运维周期管理分析[J]. 中国设备工程, 2023(11): 238-241.ZHU Ming-zhe, LIANG Yu, FAN Chang-xin. Analyses on the repair technology and operation and maintenance cycle management of existing railway tunnels[J]. China Plant Engineering, 2023(11): 238-241. [3] 《中国公路学报》编辑部. 中国交通隧道工程学术研究综述·2022[J]. 中国公路学报, 2022, 35(4): 1-40.Editorial Department of China Journal of Highway and Transport. Review on China's traffic tunnel engineering research: 2022[J]. China Journal of Highway and Transport, 2022, 35(4): 1-40. [4] 刘德军, 仲飞, 黄宏伟, 等. 运营隧道衬砌病害诊治的现状与发展[J]. 中国公路学报, 2021, 34(11): 178-199.LIU De-jun, ZHONG Fei, HUANG Hong-wei, et al. Present status and development trend of diagnosis and treatment of tunnel lining diseases[J]. China Journal of Highway and Transport, 2021, 34(11): 178-199. [5] LU W, MENG L X, LI S C, et al. Study on progressive failure behavior and mechanical properties of tunnel arch support structures[J]. Tunnelling and Underground Space Technology, 2023, 140: 105285. doi: 10.1016/j.tust.2023.105285 [6] 王石磊, 高岩, 齐法琳, 等. 铁路运营隧道检测技术综述[J]. 交通运输工程学报, 2020, 20(5): 41-57. doi: 10.19818/j.cnki.1671-1637.2020.05.003WANG Shi-lei, GAO Yan, QI Fa-lin, et al. Review on inspection technology of railway operation tunnels[J]. Journal of Traffic and Transportation Engineering, 2020, 20(5): 41-57. doi: 10.19818/j.cnki.1671-1637.2020.05.003 [7] HUANG M Q, NINIC J, ZHANG Q B. BIM, machine learning and computer vision techniques in underground construction: Current status and future perspectives[J]. Tunnelling and Underground Space Technology, 2021, 108: 103677. doi: 10.1016/j.tust.2020.103677 [8] 王健, 郑理科, 吴斌杰, 等. 改进Mask RCNN的盾构隧道渗漏水检测方法[J]. 测绘通报, 2024(2): 170-177.WANG Jian, ZHENG Li-ke, WU Bin-jie, et al. Improved Mask RCNN method for shield tunnel leakage detection[J]. Bulletin of Surveying and Mapping, 2024(2): 170-177. [9] WANG Y D, LIAO W S, DONG A Q, et al. High-speed acquisition and intelligent tunnel surface defects recognition[J]. Tunnelling and Underground Space Technology, 2024, 144: 105572. doi: 10.1016/j.tust.2023.105572 [10] 任松, 朱倩雯, 涂歆玥, 等. 基于深度学习的公路隧道衬砌病害识别方法[J]. 浙江大学学报(工学版), 2022, 56(1): 92-99.REN Song, ZHU Qian-wen, TU Xin-yue, et al. Lining disease identification of highway tunnel based on deep learning[J]. Journal of Zhejiang University (Engineering Science), 2022, 56(1): 92-99. [11] ZHOU Z, ZHANG J J, GONG C J. Automatic detection method of tunnel lining multi-defects via an enhanced You Only Look Once network[J]. Computer-aided Civil and Infrastructure Engineering, 2022, 37(6): 762-780. doi: 10.1111/mice.12836 [12] MEI C B, WEN Y C. Subway tunnel crack identification based on YOLOv5[J]. Frontiers in Computing and Intelligent Systems, 2024, 8(1): 122-129. doi: 10.54097/7gw4nw71 [13] 高贤君, 刘振宇, 许磊, 等. 基于CutMix数据增强与多约束损失函数的YOLOv7盾构隧道渗漏水检测[J]. 测绘通报, 2024(7): 105-110.GAO Xian-jun, LIU Zhen-yu, XU Lei, et al. YOLOv7 shield tunnel water leakage detection method based on CutMix data augmentation and multi-constraint loss function[J]. Bulletin of Surveying and Mapping, 2024(7): 105-110. [14] WANG L, TANG C. Effective small crack detection based on tunnel crack characteristics and an anchor-free convolu-tional neural network[J]. Scientific Reports, 2024, 14(1): 10355. doi: 10.1038/s41598-024-60454-3 [15] 宋娟, 贺龙喜, 龙会平. 基于深度学习的隧道衬砌多病害检测算法[J]. 浙江大学学报(工学版), 2024, 58(6): 1161-1173.SONG Juan, HE Long-xi, LONG Hui-ping. Deep learning-based algorithm for multi defect detection in tunnel lining[J]. Journal of Zhejiang University (Engineering Science), 2024, 58(6): 1161-1173. [16] SOHAN M, SAI RAM T, RAMI REDDY C V. Interna-tional conference on data intelligence and cognitive informatics[M]. Berlin: Springer, 2024: 529-545. [17] WANG C Y, BOCHKOVSKIY A, LIAO H Y M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]//IEEE. 2023 IEEE/CVF Confe-rence on Computer Vision and Pattern Recognition. New York: IEEE, 2023: 7464-7475. [18] LIU W Z, LU H, FU H T, et al. Learning to upsample by learning to sample[C]//IEEE. 2023 IEEE/CVF Interna-tional Conference on Computer Vision (ICCV). New York: IEEE, 2023: 6027-6037. [19] TIAN Z, SHEN C H, CHEN H, et al. FCOS: Fully convo-lutional one-stage object detection[C]//IEEE. 2019 IEEE/CVF International Conference on Computer Vision (ICCV). New York: IEEE, 2019: 9627-9636. [20] XUE Y D, CAI X Y, SHADABFAR M, et al. Deep learning-based automatic recognition of water leakage area in shield tunnel lining[J]. Tunnelling and Underground Space Tech-nology, 2020, 104: 103524. doi: 10.1016/j.tust.2020.103524 [21] ZHOU Q, QU Z, LI Y X, et al. Tunnel crack detection with linear seam based on mixed attention and multiscale feature fusion[J]. IEEE Transactions on Instrumentation and Measurement, 2022, 71: 5014711. [22] DING X H, ZHANG X Y, HAN J G, et al. Scaling up your kernels to 31×31: Revisiting large kernel design in CNNs[C]//IEEE. 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). New York: IEEE, 2022: 11963-11975. [23] 耿焕同, 刘振宇, 蒋骏, 等. 基于改进YOLOv8的嵌入式道路裂缝检测算法[J]. 计算机应用, 2024, 44(5): 1613-1618.GENG Huan-tong, LIU Zhen-yu, JIANG Jun, et al. Embedded road crack detection algorithm based on improved YOLOv8[J]. Journal of Computer Applications, 2024, 44(5): 1613-1618. [24] 蒋仕新, 邹小雪, 杨建喜, 等. 复杂背景下基于改进YOLO v8s的混凝土桥梁裂缝检测方法[J]. 交通运输工程学报, 2024, 24(6): 135-147. doi: 10.19818/j.cnki.1671-1637.2024.06.009 JIANG Shi-xin, ZOU Xiao-xue, YANG Jian-xi, et al. Concrete bridge crack detection method based on improved YOLO v8s in complex backgrounds[J]. Journal of Traffic and Trans-portation Engineering, 2024, 24(6): 135-147. doi: 10.19818/j.cnki.1671-1637.2024.06.009 [25] WANG H, LIU C Y, CAI Y F, et al. YOLOv8-QSD: An improved small object detection algorithm for autonomous vehicles based on YOLOv8[J]. IEEE Transactions on Instrumentation and Measurement, 2024, 73: 2513916. [26] WANG J Q, CHEN K, XU R, et al. CARAFE++: Unified content-aware ReAssembly of FEatures[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022, 44(9): 4674-4687. [27] 渠逸, 汪诚, 余嘉博, 等. 基于YOLOv5的表面缺陷检测优化算法[J]. 空军工程大学学报, 2023, 24(5): 80-87.QU Yi, WANG Cheng, YU Jia-bo, et al. Optimized algorithm for surface defect detection based on YOLOv5[J]. Journal of Air Force Engineering University, 2023, 24(5): 80-87. [28] ZHANG J R, CHEN Z H, YAN G X, et al. Faster and lightweight: An improved YOLOv5 object detector for remote sensing images[J]. Remote Sensing, 2023, 15(20): 4974. doi: 10.3390/rs15204974 [29] FU Z B, LING J R, YUAN X P, et al. Yolov8n-FADS: A study for enhancing miners' helmet detection accuracy in complex underground environments[J]. Sensors, 2024, 24(12): 3767. doi: 10.3390/s24123767 [30] 梁礼明, 龙鹏威, 李俞霖. 改进轻量高效FMG-YOLOv8s的钢材表面缺陷检测算法[J]. 计算机工程与应用, 2025, 61(3): 84-93.LIANG Li-ming, LONG Peng-wei, LI Yu-lin. Improved lightweight and efficient FMG-YOLOv8s algorithm for steel surface defect detection[J]. Computer Engineering and Applications, 2025, 61(3): 84-93. [31] MA X, DAI X Y, BAI Y, et al. Rewrite the stars[C]//IEEE. 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). New York: IEEE, 2024: 5694-5703. [32] 江德港, 江智, 黄子杰, 等. 基于Efficientnet的无人机车辆目标检测算法[J]. 计算机工程与应用, 2023, 59(12): 228-234.JIANG De-gang, JIANG Zhi, HUANG Zi-jie, et al. UAV vehicle object detection algorithm based on Efficientnet[J]. Computer Engineering and Applications, 2023, 59(12): 228-234. -
下载: