A Lightweight Method for Detecting Sewer Defects Based on Improved YOLOv5
Abstract
:1. Introduction
- (1)
- By replacing the backbone network of YOLOv5 with a lightweight network called GhostNet, which is suitable for mobile platforms, the problem of calculating redundancy in traditional convolution methods is solved, greatly reducing the volume and computing power of the model.
- (2)
- A new feature fusion network is proposed, which improves the neck network based on the weighted feature fusion and same-scale feature residual connection in the Bidirectional Feature Pyramid Network (BiFPN) [15]. Shallow feature increase is introduced to provide the model with detailed information in images, enhancing the efficiency of feature fusion and the accuracy of detecting tiny defects.
- (3)
- By introducing a coordinate attention mechanism [16] to improve the bottleneck modules of the neck network, the model can be made lightweight while achieving higher sensitivity to critical features.
2. Lightweight YOLOv5 Sewer Defect Detection Model
- (1)
- Input terminal: In order to expand the number of datasets and enrich the background of the detected objects, traditional data augmentation techniques such as random scaling, flipping, and color jitter, as well as Mosaic data augmentation techniques, are used to process the input images, improving the model’s robustness.
- (2)
- Backbone network: The original YOLOv5 backbone network consists of four different-sized bottleneck modules, but traditional convolutional approaches have a large computational load. In order to meet the demand for lightweight mobile deployment, the lightweight network, GhostNet, which is suitable for mobile platforms, is used instead of the original backbone network, as shown in Figure 1. The improved backbone network can maintain high detection accuracy while greatly reducing the network parameter count and floating-point computation load. Secondly, to improve the backbone network’s feature extraction capabilities, a coordinate attention mechanism is introduced in the feature fusion network to enhance the model’s sensitivity to different feature channels and reduce the influence of interference information.
- (3)
- Neck network: The original YOLOv5 neck network mainly consists of a Fast Spatial Pyramid Pooling (SPPF) module and a Path-Aggregation Network (PANet) [17]. PANet improves the fusion effect between deep semantic information and shallow spatial information based on the Feature Pyramid Networks (FPNs) [18]. However, this approach can require a large number of parameters and computational loads. To further improve the model’s feature fusion efficiency, this paper improves the original neck network based on the Weighted Bidirectional Feature Pyramid Network (BiFPN) using weighted feature fusion and same-scale feature residual connections. On the other hand, to improve detection accuracy for tiny defects, shallow features containing rich spatial information are fused into the neck network.
- (4)
- Prediction head: The prediction head is mainly used to process the multi-scale feature maps generated by the neck network, generating position, confidence, and category information for the predicted bounding boxes. In response to the improvement of the neck network, a prediction head dedicated to detecting tiny targets is added.
2.1. Lightweight Backbone Network
2.2. Improving the Feature Fusion Network
2.3. Coordinate Attention Mechanism
3. Experimental Results and Analysis
3.1. Data Preparation
3.2. Experimental Environment and Configuration
3.3. Evaluation Metrics
3.4. Analysis of Ablation Experiment
3.5. Comparison Analysis of the Model before and after Improvement
3.6. Comparison Analysis with Other Models
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Wang, Q.; Yao, J.; Tan, W.L.; Pan, H.H. Research on Defect Detection of Drainage Pipeline Based on Faster R-CNN. Softw. Guide 2019, 18, 40–44. [Google Scholar]
- Liu, X.Y.; Ye, S.Z.; Lü, B.; Yan, Z. Information Solution for Intelligent Detection of Drainage Pipe Network Defects. China Water Wastewater 2021, 37, 32–36. [Google Scholar]
- Wang, H.H.; Xie, H.L.; Gao, Y.; Liu, J.X.; Song, X.F. Evaluation method of municipal sewer health status based on YOLO v5. Water Wastewater Eng. 2022, 58, 130–136. [Google Scholar]
- Shankar, R.S.; Srinivas, L.V.; Neelima, P.; Mahesh, G. A Framework to Enhance Object Detection Performance by Using YOLO Algorithm. In Proceedings of the 2022 International Conference on Sustainable Computing and Data Communication Systems (ICSCDS), IEEE, Erode, India, 7–9 April 2022; pp. 1591–1600. [Google Scholar]
- Devareddi, R.B.; Shankar, R.S.; Murthy, K.; Raminaidu, C. Image segmentation based on scanned document and hand script counterfeit detection using neural network. AIP Conf. Proc. 2022, 2576, 050001. [Google Scholar]
- 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] [PubMed]
- Zhou, Q.; Situ, Z.; Teng, S.; Chen, W.; Chen, G.; Su, J. Comparison of classic object-detection techniques for automated sewer defect detection. J. Hydroinform. 2022, 24, 406–419. [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 Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Part I 14. Springer: Berlin/Heidelberg, Germany, 2016; pp. 21–37. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 779–788. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Yin, X.; Chen, Y.; Bouferguene, A.; Zaman, H.; Al-Hussein, M.; Kurach, L. A deep learning-based framework for an automated defect detection system for sewer pipes. Autom. Constr. 2020, 109, 102967. [Google Scholar] [CrossRef]
- Cheng, J.C.P.; 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]
- Li, D.; Xie, Q.; Yu, Z.; Wu, Q.; Zhou, J.; Wang, J. Sewer pipe defect detection via deep learning with local and global feature fusion. Autom. Constr. 2021, 129, 103823. [Google Scholar] [CrossRef]
- Huang, D.; Liu, X.; Jiang, S.; Wang, H.; Wang, J.; Zhang, Y. Current state and future perspectives of sewer networks in urban China. Front. Environ. Sci. Eng. 2018, 12, 2. [Google Scholar] [CrossRef]
- Tan, M.; Pang, R.; Le, Q.V. Efficientdet: Scalable and Efficient Object Detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 10781–10790. [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]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path Aggregation Network for Instance Segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8759–8768. [Google Scholar]
- Lin, T.-Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature Pyramid Networks for Object Detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Dhaka, Bangladesh, 13–14 February 2017; pp. 2117–2125. [Google Scholar]
- Wang, K.; Xu, M.; Sun, X.; Xu, Q.; Tan, S.-B. Insulator Self-explosion Defect Detection Method Based on Improved YOLOv3. J. Chin. Comput. Syst. 2022, 43, 2564–2569. [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]
- 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 IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1314–1324. [Google Scholar]
- Ma, N.; Zhang, X.; Zheng, H.T.; Sun, J. Shufflenet v2: Practical Guidelines for Efficient cnn Architecture Design. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 116–131. [Google Scholar]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 11534–11542. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional Block Attention Module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Haurum, J.B.; Moeslund, T.B. Sewer-ML: A Multi-Label Sewer Defect Classification Dataset and Benchmark. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 13456–13467. [Google Scholar]
- Lin, M.B. Health inspection and analysis of sewer system in an area of Fuzhou City. China Water Wastewater 2014, 30, 96–98. [Google Scholar]
Defect | Number |
---|---|
Crack | 749 |
Deposition | 780 |
Stagger | 778 |
Root | 748 |
Total | 3055 |
Environment | Parameters |
---|---|
Operating System | Ubuntu |
Deep Learning Framework | PyTorch 1.7.0 |
CPU | Intel(R) Xeon(R) Platinum 8255C |
GPU | RTX 3080 |
Model | GhosNet | WR-PANet | CA | [email protected] /% | Recall /% | F1 | Model Parameters /106 | Model Volume /MB | FLOPs /109 |
---|---|---|---|---|---|---|---|---|---|
YOLOv5 | - | - | - | 86.33 | 80.92 | 0.80 | 46.40 | 177.95 | 48.42 |
YOLOv5-G | √ | - | - | 86.06 | 79.82 | 0.81 | 22.32 | 85.15 | 17.45 |
YOLOv5-GB | √ | √ | - | 88.17 | 79.78 | 0.82 | 23.30 | 90.01 | 26.47 |
YOLOv5-GBC | √ | √ | √ | 87.21 | 82.43 | 0.84 | 12.06 | 46.01 | 12.21 |
Model | AP50/% | Recall/% | FPS /(Frames/s) | ||||||
---|---|---|---|---|---|---|---|---|---|
Crack | Deposition | Root | Stagger | Crack | Deposition | Root | Stagger | ||
YOLOv5 | 74.26 | 89.21 | 90.68 | 91.17 | 61.82 | 80.95 | 90.24 | 90.67 | 5.5 |
YOLOv5-G | 67.21 | 93.72 | 89.27 | 94.05 | 58.90 | 87.95 | 79.27 | 93.15 | 10.3 |
YOLOv5-GB | 81.44 | 93.01 | 85.05 | 93.17 | 67.12 | 85.54 | 71.95 | 94.52 | 8.4 |
YOLOv5-GBC | 82.20 | 94.85 | 81.14 | 90.64 | 68.49 | 93.98 | 76.83 | 90.41 | 9.0 |
Model | [email protected]/% | Recall/% | Precision/% | F1 | Model Parameters /106 | Model Volume /MB | FLOPs /109 | FPS /(Frames/s) |
---|---|---|---|---|---|---|---|---|
YOLOv5 | 86.33 | 80.92 | 80.07 | 0.80 | 46.40 | 177.95 | 48.42 | 5.5 |
YOLOv5-GBC | 87.21 | 82.43 | 85.38 | 0.84 | 12.06 | 46.01 | 12.21 | 9.0 |
Model | [email protected] /% | Recall/% | Precision/% | F1 | Model Parameters /106 | Model Volume /MB | FLOPs/109 |
---|---|---|---|---|---|---|---|
SSD | 82.38 | 80.79 | 75.87 | 0.78 | 24.01 | 91.6 | 115.97 |
YOLOv3 | 84.57 | 80.31 | 85.18 | 0.83 | 61.54 | 234.76 | 65.62 |
YOLOv4 | 86.76 | 85.17 | 86.32 | 0.86 | 63.95 | 243.96 | 59.98 |
YOLOX | 89.89 | 89.78 | 86.04 | 0.87 | 54.15 | 206.57 | 65.78 |
YOLOv7 | 88.34 | 81.41 | 90.9 | 85.5 | 37.21 | 141.95 | 44.42 |
Faster RCNN | 79.79 | 88.07 | 49.02 | 0.63 | 136.75 | 521.66 | 252.66 |
YOLOv5-M | 85.61 | 81.29 | 84.08 | 0.82 | 22.63 | 86.34 | 18.05 |
YOLOv5-GBC | 87.21 | 82.43 | 85.38 | 0.84 | 12.06 | 46.01 | 12.21 |
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. |
© 2023 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
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. https://doi.org/10.3390/app13158986
Zhang X, Zhang J, Tian L, Liu X, Wang S. A Lightweight Method for Detecting Sewer Defects Based on Improved YOLOv5. Applied Sciences. 2023; 13(15):8986. https://doi.org/10.3390/app13158986
Chicago/Turabian StyleZhang, Xing, Jiawei Zhang, Lei Tian, Xiang Liu, and Shuohong Wang. 2023. "A Lightweight Method for Detecting Sewer Defects Based on Improved YOLOv5" Applied Sciences 13, no. 15: 8986. https://doi.org/10.3390/app13158986
APA StyleZhang, X., Zhang, J., Tian, L., Liu, X., & Wang, S. (2023). A Lightweight Method for Detecting Sewer Defects Based on Improved YOLOv5. Applied Sciences, 13(15), 8986. https://doi.org/10.3390/app13158986