YOLOv5-Sewer: Lightweight Sewer Defect Detection Model
Abstract
:1. Introduction
2. YOLOv5-Sewer Network Design
2.1. Related Works
2.2. YOLOv5-Sewer Network Architecture
- The original backbone of the YOLOv5s network is substituted with MobileNetV3 block stacking. This modification is aimed at reducing the network’s complexity.
- The C3 module is upgraded to the C3-Faster module, incorporating partial convolutions. This adjustment focuses the network on crucial regions of the feature map, enhancing its ability to capture relevant information.
- To counteract the reduction in detection accuracy resulting from the lightweight design, a convolutional block attention module (CBAM) and channel attention (CA) modules are integrated. These attention mechanisms help the network to adapt to the challenging visual characteristics of sewer environments.
- The Efficient Intersection over Union (EIOU) localization loss function is introduced, replacing the original Complete Intersection over Union (CIOU) loss function. This adaptation allows the model to effectively handle multi-scale sewer defects.
2.2.1. Lightweight Network
2.2.2. C3-Faster
2.2.3. Convolutional Block Attention Module
2.2.4. Coordinate Attention
- Decomposition of Avg pool: To preserve spatial information and obtain positional information for long-range channel dependencies, CA decomposes the Avg pool by pooling separately in the X and Y directions. This generates feature maps of dimensions and , allowing the attention module to capture long-range dependencies along one spatial direction while preserving the positional information along the other spatial direction.
- Feature map fusion: The obtained feature maps are fused through a concatenate operation.
- Processing through convolution and activation: Through a convolutional kernel and activation operation, the fused feature maps are processed.
- Spatial split: A split operation is applied along the spatial dimension, dividing the feature maps into two parts, and .
- Up-sampling and final attention vector: An up-sampling operation is performed through a convolutional kernel, combined with the sigmoid activation function, to obtain the final attention vector.
- Element-wise multiplication: The final attention vector is used to perform element-wise multiplication on the original feature maps, resulting in the final feature maps with attention weights in the X and Y directions.
2.2.5. Loss Function
- The first part is based on the CIOU loss, which considers the overlapping area. This component measures how well the predicted bounding box aligns with the truth bounding box.
- The second part involves the calculation of the center point distance loss. This loss term evaluates the differences in the x and y coordinates of the center points of the predicted and true bounding boxes. Minimizing this distance contributes to accurate localization.
- The third part deals with the aspect ratio loss. In this calculation, the lengths and widths of both boxes are separately computed. This component aims to minimize the differences in width and length between the predicted and true bounding boxes. This is particularly important in addressing variations in aspect ratio.
3. Experiment and Results Analysis
3.1. Sewer Defect Image Dataset
3.2. Experimental Parameters and Experimental Configuration
3.3. Evaluation Indicators
3.4. Analysis of Experimental Results
3.4.1. Reducing the Number of Model Parameters Using MobileNetv3 Block
3.4.2. Fusion Experiments
- The integration of the C3-Faster module not only reduces the model computation, parameters, and size but also enhances the mean Average Precision (mAP) and detection speed.
- The inclusion of attention mechanisms incurs minimal computational and parameter costs while improving the recognition accuracy.
- The fusion of these modules results in positive optimizations across the overall performance metrics.
3.4.3. Contrast Experiments
- Faster-RCNN:
- mAP improved by 7.4%;
- Detection speed increased by 100 FPS;
- Floating-point operations decreased by 98.6%;
- Parameters decreased by 97.7%;
- Model size decreased by 26.4%.
- YOLOv3-tiny:
- mAP improved by 6.9%;
- Detection speed decreased by 51 FPS;
- Floating-point operations decreased by 60.5%;
- Parameters decreased by 63.9%;
- Model size decreased by 62.3%.
- SSD:
- mAP improved by 5.7%;
- Detection speed increased by 78.3 FPS;
- Floating-point operations decreased by 91%;
- Parameters decreased by 88%;
- Model size increased by 6%.
- YOLOv7-tiny:
- mAP decreased by 0.3%;
- Detection speed increased by 60 FPS;
- Floating-point operations decreased by 61.4%;
- Parameters decreased by 47.9%;
- Model size decreased by 45.5%.
- Floating-point operations decreased by 58.2%;
- Parameters decreased by 73.9%;
- Model size decreased by 85.4%.
3.4.4. Detection Results
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Hawari, A.; Alamin, M.; Alkadour, F.; Elmasry, M.; Zayed, T. Automated defect detection tool for closed circuit television (cctv) inspected sewer pipelines. Autom. Constr. 2018, 89, 99–109. [Google Scholar] [CrossRef]
- Zhang, J.; Liu, X.; Zhang, X.; Xi, Z.; Wang, S. Automatic Detection Method of Sewer Pipe Defects Using Deep Learning Techniques. Appl. Sci. 2023, 13, 4589. [Google Scholar] [CrossRef]
- Yu, Y.; Safari, A.; Niu, X.; Drinkwater, B.; Horoshenkov, K.V. Acoustic and ultrasonic techniques for defect detection and condition monitoring in water and sewerage pipes: A review. Appl. Acoust. 2021, 183, 108282. [Google Scholar] [CrossRef]
- Li, Y.; Wang, H.; Dang, L.M.; Song, H.K.; Moon, H. Vision-based defect inspection and condition assessment for sewer pipes: A comprehensive survey. Sensors 2022, 22, 2722. [Google Scholar] [CrossRef]
- Czimmermann, T.; Ciuti, G.; Milazzo, M.; Chiurazzi, M.; Roccella, S.; Oddo, C.M.; Dario, P. Visual-based defect detection and classification approaches for industrial applications—A survey. Sensors 2020, 20, 1459. [Google Scholar] [CrossRef] [PubMed]
- Ye, X.; Zuo, J.; Li, R.; Wang, Y.; Gan, L.; Yu, Z.; Hu, X. Diagnosis of sewer pipe defects on image recognition of multi-features and support vector machine in a southern Chinese city. Front. Environ. Sci. Eng. 2019, 13, 1–13. [Google Scholar] [CrossRef]
- Myrans, J.; Everson, R.; Kapelan, Z. Automated detection of fault types in CCTV sewer surveys. J. Hydroinform. 2019, 21, 153–163. [Google Scholar] [CrossRef]
- Kumar, S.S.; Abraham, D.M.; Jahanshahi, M.R.; Iseley, T.; Starr, J. Automated defect classification in sewer closed circuit television inspections using deep convolutional neural networks. Autom. Constr. 2018, 91, 273–283. [Google Scholar] [CrossRef]
- Chen, K.; Hu, H.; Chen, C.; Chen, L.; He, C. An intelligent sewer defect detection method based on convolutional neural network. In Proceedings of the IEEE International Conference on Information and Automation, IEEE, Wuyishan, China, 11–13 August 2018; pp. 1301–1306. [Google Scholar]
- Wang, M.; Cheng, J.C. A unified convolutional neural network integrated with conditional random field for pipe defect segmentation. Comput.-Aided Civ. Infrastruct. Eng. 2020, 35, 162–177. [Google Scholar] [CrossRef]
- Pan, G.; Zheng, Y.; Guo, S.; Lv, Y. Automatic sewer pipe defect semantic segmentation based on improved U-Net. Autom. Constr. 2020, 119, 103383. [Google Scholar] [CrossRef]
- Cheng, J.C.; Wang, M. Automated detection of sewer pipe defects in closed-circuit television images using deep learning techniques. Autom. Constr. 2018, 95, 155–171. [Google Scholar] [CrossRef]
- Wang, M.; Cheng, J.C. Development and improvement of deep learning based automated defect detection for sewer pipe inspection using faster R-CNN. In Proceedings of the Advanced Computing Strategies for Engineering, Lausanne, Switzerland, 10–13 June 2018; Springer: Berlin/Heidelberg, Germany, 2018; pp. 171–192. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Liu, R.; Ren, C.; Fu, M.; Chu, Z.; Guo, J. Platelet detection based on improved yolo_v3. Cyborg Bionic Syst. 2022, 2022, 9780569. [Google Scholar] [CrossRef]
- Chen, K.; Li, H.; Li, C.; Zhao, X.; Wu, S.; Duan, Y.; Wang, J. An Automatic Defect Detection System for Petrochemical Pipeline Based on Cycle-GAN and YOLO v5. Sensors 2022, 22, 7907. [Google Scholar] [CrossRef] [PubMed]
- Zhang, X.; Zhang, J.; Tian, L.; Liu, X.; Wang, S. A Lightweight Method for Detecting Sewer Defects Based on Improved YOLOv5. Appl. Sci. 2023, 13, 8986. [Google Scholar] [CrossRef]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. 2015, 28, 1137–1149. [Google Scholar] [CrossRef]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. Ssd: Single shot multibox detector. In Proceedings of the European Conference Computer Vision, Amsterdam, The Netherlands, 11–14 October 2016; Springer: Berlin/Heidelberg, Germany, 2016; pp. 21–37. [Google Scholar]
- Patil, R.R.; Calay, R.K.; Mustafa, M.Y.; Ansari, S.M. AI-Driven High-Precision Model for Blockage Detection in Urban Wastewater Systems. Electronics 2023, 12, 3606. [Google Scholar] [CrossRef]
- Wang, T.; Li, Y.; Zhai, Y.; Wang, W.; Huang, R. A Sewer Pipeline Defect Detection Method Based on Improved YOLOv5. Processes 2023, 11, 2508. [Google Scholar] [CrossRef]
- Huang, Q.; Zhou, Y.; Yang, T.; Yang, K.; Cao, L.; Xia, Y. A Lightweight Transfer Learning Model with Pruned and Distilled YOLOv5s to Identify Arc Magnet Surface Defects. Appl. Sci. 2023, 13, 2078. [Google Scholar] [CrossRef]
- Howard, A.; Sandler, M.; Chu, G.; Chen, L.C.; Chen, B.; Tan, M.; Wang, W.; Zhu, Y.; Pang, R.; Vasudevan, V.; et al. Searching for mobilenetv3. In Proceedings of the International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1314–1324. [Google Scholar]
- Chen, J.; Kao, S.h.; He, H.; Zhuo, W.; Wen, S.; Lee, C.H.; Chan, S.H.G. Run, Don’t Walk: Chasing Higher FLOPS for Faster Neural Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 12021–12031. [Google Scholar]
- Yu, J.; Wang, C.; Xi, T.; Ju, H.; Qu, Y.; Kong, Y.; Chen, X. Development of an Algorithm for Detecting Real-Time Defects in Steel. Electronics 2023, 12, 4422. [Google Scholar] [CrossRef]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision, Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Hou, Q.; Zhou, D.; Feng, J. Coordinate attention for efficient mobile network design. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 13713–13722. [Google Scholar]
- Zhang, Y.F.; Ren, W.; Zhang, Z.; Jia, Z.; Wang, L.; Tan, T. Focal and efficient IOU loss for accurate bounding box regression. Neurocomputing 2022, 506, 146–157. [Google Scholar] [CrossRef]
- Yougao, L.; Wei, H. Identification and feature extraction of drainage pipeline cracks based on SVD and edge recognition method. In Proceedings of the Electronic Information Technology and Computer Engineering, IEEE, Xiamen, China, 18–20 October 2019; pp. 1184–1188. [Google Scholar]
- Wang, Z.; Jin, L.; Wang, S.; Xu, H. Apple stem/calyx real-time recognition using YOLO-v5 algorithm for fruit automatic loading system. Postharvest Biol. Technol. 2022, 185, 111808. [Google Scholar] [CrossRef]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar]
- new-workspace zyqyt. Storm Drain Model Dataset. 2021. Available online: https://universe.roboflow.com/new-workspace-zyqyt/storm-drain-model (accessed on 10 January 2024).
- rootdataset. Pipe-Root Dataset. 2023. Available online: https://universe.roboflow.com/rootdataset/pipe_root (accessed on 10 January 2024).
- Zhang, J.; Li, X.; Li, J.; Liu, L.; Xue, Z.; Zhang, B.; Jiang, Z.; Huang, T.; Wang, Y.; Wang, C. Rethinking mobile block for efficient neural models. arXiv 2023, arXiv:2301.01146. [Google Scholar]
- Han, K.; Wang, Y.; Tian, Q.; Guo, J.; Xu, C.; Xu, C. Ghostnet: More features from cheap operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 1580–1589. [Google Scholar]
- Redmon, J.; Farhadi, A. Yolov3: An incremental improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- 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. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 7464–7475. [Google Scholar]
Name | Environment Configuration |
---|---|
Operating system | Windows 11 |
CPU | I7 12700 |
GPU | NVIDIA RTX 3070Ti |
Memory | 32G |
GPU graphics memory | 8G |
Python version | 3.8 |
Algorithm framework | Pytorch 1.10.0 |
Test | Backbone | FLOPs/G | Param/M | Size/MB | mAP/% | FPS | ||
---|---|---|---|---|---|---|---|---|
EMO | GhostNet | MobileNetV3 | ||||||
1 | × | × | × | 15.8 | 7.03 | 14.5 | 85.5 | 149 |
2 | √ | × | × | 29.6 | 4.32 | 9.1 | 82.7 | 93 |
3 | × | √ | × | 6.0 | 3.26 | 7.0 | 78.6 | 107 |
4 | × | × | √ | 5.9 | 3.53 | 7.5 | 80.3 | 136 |
Test | Module | FLOPs/G | Param/M | Size/MB | mAP/% | FPS | |||
---|---|---|---|---|---|---|---|---|---|
C3-Faster | CA | CBAM | EIOU | ||||||
1 | × | × | × | × | 5.9 | 3.53 | 7.5 | 80.3 | 136 |
2 | √ | × | × | × | 4.8 | 2.97 | 6.4 | 82.3 | 147 |
3 | √ | √ | × | × | 4.9 | 3.03 | 6.5 | 83.4 | 126 |
4 | √ | √ | √ | × | 5.1 | 3.14 | 6.7 | 83.7 | 112 |
5 | √ | √ | √ | √ | 5.1 | 3.14 | 6.7 | 84.0 | 112 |
Test | AP0.5/% | FLOPs/G | Param/M | Size/MB | mAP/% | FPS | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||||||
a | 70.1 | 86.1 | 70.3 | 80.7 | 84.9 | 62.3 | 79.2 | 79.1 | 370 | 137 | 9.1 | 76.6 | 12 |
b | 70.6 | 88.4 | 70.1 | 79.3 | 83.2 | 65.4 | 81.5 | 78.3 | 12.9 | 8.7 | 17.8 | 77.1 | 163 |
c | 71.6 | 90.4 | 73.2 | 86.4 | 86.4 | 60.1 | 87.2 | 70.7 | 63 | 26.3 | 6.3 | 78.3 | 33.7 |
d | 72.0 | 92.1 | 83.0 | 90.9 | 94.0 | 72.1 | 92.7 | 77.3 | 13.2 | 6.03 | 12.3 | 84.3 | 52 |
e | 77.8 | 96.1 | 80.4 | 92.8 | 88.9 | 69.8 | 90.2 | 76.4 | 5.1 | 3.14 | 6.7 | 84.0 | 112 |
Model Name | FPS |
---|---|
Faster-RCNN | 0.5 |
SSD | 3.5 |
YOLOv5s | 8 |
YOLOv7-tiny | 9 |
YOLOv3-tiny | 9 |
YOLOv5-Sewer | 12 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhao, X.; Xiao, N.; Cai, Z.; Xin, S. YOLOv5-Sewer: Lightweight Sewer Defect Detection Model. Appl. Sci. 2024, 14, 1869. https://doi.org/10.3390/app14051869
Zhao X, Xiao N, Cai Z, Xin S. YOLOv5-Sewer: Lightweight Sewer Defect Detection Model. Applied Sciences. 2024; 14(5):1869. https://doi.org/10.3390/app14051869
Chicago/Turabian StyleZhao, Xingliang, Ning Xiao, Zhaoyang Cai, and Shan Xin. 2024. "YOLOv5-Sewer: Lightweight Sewer Defect Detection Model" Applied Sciences 14, no. 5: 1869. https://doi.org/10.3390/app14051869
APA StyleZhao, X., Xiao, N., Cai, Z., & Xin, S. (2024). YOLOv5-Sewer: Lightweight Sewer Defect Detection Model. Applied Sciences, 14(5), 1869. https://doi.org/10.3390/app14051869