Intelligent drainage pipeline defect identification method based on YOLOv11n optimization
By optimizing the YOLOv11n model, replacing the backbone network with MobileNetV2 and integrating the PConv module, and improving the loss function to Shape-IoU, the problems of low efficiency and insufficient accuracy in drainage pipeline detection are solved, achieving lightweight and high-precision pipeline defect identification.
Patent Information
- Application Number
- CN202511056820.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-07
AI Technical Summary
Existing methods for detecting drainage pipes are inefficient, costly, and subjective, making it difficult to identify hidden defects, especially in complex environments where feature extraction capabilities are insufficient and bounding box regression accuracy is low.
The YOLOv11n optimization method is adopted, the backbone network is replaced with MobileNetV2, some convolutional PConv modules are fused, the loss function is improved to Shape-IoU, and a C3k2_PConv module is constructed to perform pipeline defect detection.
It achieves lightweight and efficient detection, improves feature extraction capabilities and bounding box regression accuracy, and meets the high-precision requirements of drainage pipeline inspection.
Smart Images

Figure CN120912868A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of target detection, and particularly relates to a drainage pipeline defect intelligent identification method based on YOLOv11n optimization. BACKGROUND
[0002] With the accelerated advancement of urbanization, as the "underground lifeline" of the city, the safe and stable operation of the drainage pipe network is directly related to the urban flood control and drainage, sewage treatment and the quality of life of residents. However, affected by factors such as long-term water scouring, foundation settlement and human damage, the drainage pipeline is prone to structural defects such as disconnection, branch pipe dark connection and misalignment, and functional obstacles such as residual wall dam root, tree root intrusion and foreign matter penetration. These problems not only lead to a decrease in pipe network drainage efficiency, but also may cause sewage leakage, road collapse and other disasters. Traditional drainage pipeline detection methods, such as manual visual inspection and CCTV video detection, have the disadvantages of low efficiency, high cost, strong subjectivity and difficulty in identifying hidden defects, and cannot meet the current needs of fine management of urban pipe networks. Especially in the face of massive pipeline data, traditional methods have significant shortcomings in detection speed, accuracy and automation. Therefore, it is urgent to explore efficient and accurate intelligent detection technology. SUMMARY
[0003] The purpose of the present application is to provide a drainage pipeline defect intelligent identification method based on YOLOv11n optimization, to solve the problems of large model parameter quantity, insufficient feature extraction capability in complex background and low boundary box regression precision of existing models.
[0004] The technical solution adopted by the present application is a drainage pipeline defect intelligent identification method based on YOLOv11n optimization, comprising the following steps: Step S1, obtaining the internal image of the pipeline and pre-processing the image to construct a pipeline disease image dataset; Step S2, selecting YOLOv11n as the reference model and improving the YOLOv11n model; Step S3, based on the improved model of S2, performing pipeline defect detection and outputting the detection result.
[0005] Further, the specific steps of S1 are as follows: S11, obtaining the internal real scene image of the pipeline; S12, pre-processing the original image of S11 through data enhancement, including rotation, cropping, translation, mirroring, adding Gaussian noise, adjusting brightness and region occlusion; S13, dividing the image dataset into a training set, a validation set and a test set in a ratio of 6:2:2.
[0006] Further, the specific steps of S2 are as follows: S21, replacing the backbone network of YOLOv11n with a MobileNetV2 network; S22, optimizing the feature extraction module, fusing a partial convolution PConv in the C3k2 module of the neck network to construct a C3k2_PConv module; S23, improving the loss function, replacing the CIoU loss function with a Shape-IoU to realize accurate positioning of the defect position.
[0007] Further, the detection result includes the defect category of the pipeline, the boundary box of each target category and the confidence.
[0008] The beneficial effects of the present application are: 1, the backbone network structure of YOLOv11n is replaced with a MobileNetV2 feature extraction network in the present application, which reduces the model parameter quantity and meets the lightweight demand while maintaining high detection performance; 2, the present application fuses partial convolution (Partial Convolution, PConv) into the C3k2 module, so that the C3k2_PConv module can more accurately extract target features in the complex background of the drainage pipeline defect detection scene; 3, the Shape-IoU loss function is used in the present application, which calculates the loss by focusing on the shape and scale of the boundary box itself, improves the accuracy of boundary box regression, and makes the target detection more accurate and reliable in the positioning link. BRIEF DESCRIPTION OF DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiment or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0010] Figure 1 (a) and (b) are respectively the structure diagrams of the improved YOLOv11 model before and after.
[0011] Figure 2 is the structure diagram of MobileNetV2 unit.
[0012] Figure 3 is the structure diagram of partial convolution.
[0013] Figure 4 is the structure diagram of C3k2_PConv.
[0014] Figure 5(a)-(f) are images of 6 different pipeline defects before data augmentation, respectively.
[0015] Figure 6 (a)-(h) are pipeline images before and after processing by 7 data augmentation methods, respectively.
[0016] Figure 7 (a)-(d) are 4 performance comparison graphs of YOLOv11n and YOLOv11n+C3k2_PConv, respectively.
[0017] Figure 8 is a comparison graph of the average precision of YOLOv11n and YOLOv11n_Shape-IoU.
[0018] Figure 9 is a precision-recall curve graph of YOLOv11n.
[0019] Figure 10 is a precision-recall curve graph of YOLOv11n-BNH.
[0020] Figure 11 is the output of the pipeline defect detection result before and after the improvement of the YOLOv11n model. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application. EMBODIMENT
[0022] The embodiments of the present application provide a drainage pipeline defect intelligent identification method based on YOLOv11n optimization, and the steps include: Step S1, acquire the pipeline internal image, and pre-process the image to construct a pipeline disease image dataset, and the specific steps are as follows: S11, collect real scene images by deepening into the pipeline from a public data source platform or by mounting a CCTV camera device, since the pipeline internal environment is complex, there are a large number of blur, uneven illumination and other problems in the original image, which cannot be directly used for model training, this embodiment selects 6 types of common defect images, including disconnection (TJ), branch pipe dark connection (AJ), misalignment (CK), residual wall dam root (CQ), tree root (SG) and foreign matter penetration (CR) 6 defects, as shown in Figure 5 (a)-(f), respectively, for evaluating the performance of the proposed model in the defect detection task.
[0023] S12, data augmentation of the original image ( Figure 6 a) Perform preprocessing, including rotation, cropping, translation, mirroring, adding Gaussian noise, adjusting brightness, and region occlusion, as follows: Figure 6 As shown in (b) to (h), the sample size is increased and the data diversity is improved, thereby enhancing the model's generalization ability. In this embodiment, data augmentation techniques are used to increase the sample size for each defect type to between 1206 and 1458 images, as shown in Table 1. Table 1. Distribution of the number of instances of each defect category in the dataset.
[0024] S13, the image dataset is divided into a training set, a validation set, and a test set in a 6:2:2 ratio. The training set provides sufficient learning samples for the model, capturing various defect feature patterns. During selection, it ensures that defects such as disconnections and concealed pipe connections are abundant in the training set, covering the diversity of real-world scenarios. The validation set is used to monitor model training performance, adjust hyperparameters, and prevent overfitting. Its images are independent of the training set and have similar defect category distributions, allowing for evaluation of the model's adaptability to new data. The test set is used to evaluate the model's generalization ability after training. The test set data was not used during training and can truly reflect the model's performance in unknown scenarios. The data partitioning in this embodiment is shown in Table 2. Table 2 Dataset Partitioning
[0025] Random sampling was used when dividing the dataset to ensure the randomness and independence of each subset, thus avoiding data bias from affecting model training and evaluation.
[0026] Step S2: Select YOLOv11n as the baseline model (YOLOv11n is an efficient detection system composed of a backbone network, a neck network, and a head). Improve the YOLOv11n model. The model structures before and after the improvement are shown below. Figure 1 As shown in (a) and (b), the specific steps for improvement are as follows: S21, the YOLOv11n backbone network is replaced with a MobileNetV2 network to reduce the number of parameters and computational cost (from 6.3 GFLOPs to 3.9 GFLOPs) while maintaining high detection performance (89.2% mAP@50). The cell structure of the MobileNetV2 network is as follows: Figure 2As shown, the design of the MobileNetV2 network in the inverted residual structure can receive more rich feature information, use depth separable convolution to reduce the parameter amount, and replace the linear operation Linear to prevent the nonlinear damage to the feature information. In this way, the MobileNetv2 can improve the model recognition performance by stacking network layers while being more lightweight.
[0027] S22, an optimization feature extraction module, fuses a partial convolution (PConv) in a C3k2 module of the neck network, constructs a C3k2_PConv module, and enhances the extraction capability of defect features in a complex background to improve the detection precision (mAP@50 is improved from 89.8% to 92.3%). Figure 3 As shown, the structure of the fused C3k2_PConv convolution is as shown in Figure 4 As shown, in the sewer defect detection scene, the C3k2_PConv module of the present application can reduce the calculation amount and the memory access frequency, reduce the resource consumption cost of the model in the running process, and also can accurately capture the subtle feature changes in the sewer image by virtue of its unique feature extraction method, even in the face of complex pipe internal environment and various types of defects, all types of defects can be accurately detected.
[0028] S23, an improved loss function, replaces the CIoU loss function with a Shape-IoU, which can optimize the boundary box regression according to the shape and scale features of the boundary box itself, realize accurate positioning of the defect position, optimize the regression accuracy, and further improve the model performance (mAP@50 is improved from 89.8% to 91.6%).
[0029] S3, based on the improved model of S2, performs pipe defect detection, inputs the pipe image of the training set into the improved model, and outputs the defect category of the pipe, the boundary box of each target, and the confidence, as shown in Figure 11 As shown, (aʹ)~(fʹ) represents the results of the six defects of the output of the improved YOLOv11n, and (a)~(f) represents the results of the six defects of the output of the improved model of the present application.
[0030] Experimental verification In order to verify the influence of different backbone networks on the performance of the target detection model, the present application fuses ShuffleNetV2, EfficientNetV2 and MobileNetV2 as the backbone network on the basis of the YOLOv11n benchmark model. The experiment is performed from three dimensions of average precision mean (mAP@50), calculation complexity (GFLOPs) and parameter amount (Param), and the results are shown in Table 3: Table 3 Comparison results of improved backbone network experiment
[0031] The introduction of lightweight backbone network has little effect on detection accuracy. The mAP@50 of the benchmark model is 89.8%, and after combining YOLOv11n with ShuffleNetV2, the mAP@50 decreases to 89.5%, with a decrease of only 0.3%. The mAP@50 of YOLOv11n + EfficientNetV2 and YOLOv11n + MobileNetV2 both decrease to 89.2%, with a decrease of 0.6%. The lightweight backbone network compresses the model size, and YOLOv11n + MobileNetV2 performs best, with the calculation amount decreasing from 6.3 GFLOPs (GigaFloating-Point Operations) to 3.9 GFLOPs, and the parameter amount decreasing from 2.58M to 1.63M. The calculation amount of YOLOv11n + ShuffleNetV2 model is 4.1 GFLOPs, and the parameter amount is 1.71M. In addition, the calculation amount of YOLOv11n + EfficientNetV2 model is 5.2 GFLOPs, and the parameter amount is 2.09M, although it is lower than the benchmark model YOLOv11n, but in the degree of lightweight, it is still not as good as YOLOv11n + MobileNetV2 model and YOLOv11n + ShuffleNetV2 model.
[0032] The benchmark model (YOLOv11n) is compared with the model using the improved feature extraction module C3k2-PConv, and the performance comparison results are shown in Figure 7 , where (a)~(d) represent Precision, Recall, mAP@50, GFLOPs respectively, and the experimental results are shown in Table 4: Table 4 Comparison results of C3k2 fusion experiment
[0033] The GFLOPs of YOLOv11n+C3k2_PConv model decreases from 6.3 to 6.0, and the precision (Precision) is 92.2%, the recall (Recall) is 87.6%, and the mAP@50 is 92.3%, all of which are better than YOLOv11n, and the mAP@50 is improved by 2.5 percentage points compared with the benchmark model YOLOv11n, which shows that the integration of PConv reduces the model calculation amount while improving the detection performance.
[0034] To verify the optimization effect of each improved module on the model, for the above MobileNetV2 lightweight backbone network, the C3k2 and PConv fusion improvement, and the Shape-IoU improved bounding box loss function are used to construct the YOLOv11n-BNH model, and the fusion detection experiment is carried out, and the average precision comparison chart of YOLOv11n and YOLOv11n_Shape-IoU is as shown in Figure 8 During the experiment, in order to ensure the accuracy of the experimental results, the variables are strictly controlled, the training strategy is kept constant, only one algorithm improvement point is changed each time, and finally all the improved points are integrated for comprehensive experiment, and the experimental results are shown in Table 5, wherein A represents MobileNetV2, B represents C3k2_PConv, C represents Shape-IoU, and "√" represents using this module.
[0035] Table 5 Ablation experiment results of improved YOLOv11n model
[0036] The precision of the baseline model is 88.8%, the recall is 86.4%, the mAP@50 is 89.8%, and the calculation amount is 6.3GFLOPs, and the YOLOv11n precision-recall curve chart is as shown in Figure 9 .
[0037] When MobileNetV2 is introduced, the accuracy is increased to 90.0%, which shows that this module optimizes the classification ability of the model to the target, so that the model makes more accurate judgment to the target category. However, the recall rate is decreased to 84.3%, the mAP@50 is also decreased to 89.2%, and the calculation amount is decreased to 3.9GFLOPs, which reflects the advantage of lightweight design of YOLOv11n+MobileNetV2 model. After adding C3k2_PConv, the precision of the model is increased to 92.0%, the recall is increased to 87.7%, and the mAP@50 reaches 91.9%. This shows that the C3k2_PConv module is beneficial to the improvement of the model's ability to identify drainage pipeline defects, and the calculation amount is decreased to 3.6GFLOPs, which shows that the YOLOv11n+MobileNetV2+C3k2_PConv model further improves the detection performance. Finally, the Shape-IoU loss function is introduced, the precision of the model is 91.7%, slightly decreased, but the recall is increased to 88.8%, the mAP@50 is increased to 92.6%, and the calculation amount is kept at 3.6GFLOPs, which shows that the Shape-IoU loss function can optimize the shape and scale matching of the bounding box, and the module cooperates to improve the detection performance.
[0038] To comprehensively evaluate the detection performance of YOLOv11n-BNH, the present application selects some classic YOLO series algorithms for comparative experiments, and the results are shown in Table 6. Table 6 Comparative experiment results
[0039] The comparison results show that although the precision of YOLOv11s is 92.4%, which is slightly higher than that of YOLOv11n-BNH, the recall rate of YOLOv11s is 87.3%, and the average precision mean is 91.8%, which is 1.5% and 0.8% lower than that of YOLOv11n-BNH, respectively, and the overall comprehensive performance is relatively insufficient. The precision of YOLOv10n is 91.3%, which is close to the precision of 91.7% of the YOLOv11n-BNH model, but its recall rate (84.8%) and average precision mean (90.3%) are lower than those of YOLOv11n-BNH, which decrease by 4.0% and 2.3%, respectively. Although YOLOv11n performs well in terms of recall rate (86.4%) and average precision mean (89.8%), its precision is 88.8%, which is 2.9% lower than that of YOLOv11n-BNH, and it does not achieve the best in the three indicators. The performance of YOLOv7-Tiny and YOLOv3-Tiny is relatively poor. The precision of YOLOv7-Tiny is 86.5%, the recall rate is 85.5%, and the mAP@50 is 86.9%; the precision of YOLOv3-Tiny is 79.6%, the recall rate is 82.7%, and the mAP@50 is 78.9%; both the precision, recall rate and average precision mean are lower than those of other mainstream algorithms, which indicates that these two algorithms cannot meet the demand of high-precision detection in the task of drainage pipe defect target detection. The experimental results show that the average precision mean and recall rate of the YOLOv11n-BNH model are better than those of other algorithms in the comparative experiments, and the model can more reliably and accurately complete the task of drainage pipe defect target detection.
[0040] Each of the embodiments in the specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts can be referred to the part of the method embodiment.
[0041] The above only describes the preferred embodiments of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application is included in the protection scope of the present application.
Claims
1. A sewer pipe defect intelligent identification method based on YOLOv11n optimization, characterized by the steps of The application relates to a pipeline defect detection method based on improved YOLOv11n model. The method comprises the following steps: S1, acquiring a pipeline internal image and pre-processing the image to construct a pipeline defect image dataset; S2, selecting YOLOv11n as a reference model and improving the YOLOv11n model; 2. The sewer defect intelligent identification method based on YOLOv11n optimization according to claim 1, characterized in that, S3, performing pipeline defect detection based on the improved model in S2 and outputting a detection result. The specific steps of S1 are as follows: S11, acquiring a pipeline internal real scene image; S12, pre-processing the original image in S11 through data enhancement, including rotation, clipping, translation, mirroring, adding Gaussian noise, adjusting brightness and region shielding; 3. The method according to claim 1, wherein, S13, dividing the image dataset into a training set, a verification set and a test set in a 6:2:2 ratio. The specific steps of S2 are as follows: S21, replacing the backbone network of YOLOv11n with a MobileNetV2 network; S22, optimizing a feature extraction module, fusing a partial convolution PConv in a C3k2 module of a neck network of the YOLOv11n model to construct a C3k2_PConv module; 4. The sewer defect intelligent identification method based on YOLOv11n optimization according to claim 1, characterized in that, S23, improving a loss function, replacing a CIoU loss function with a Shape-IoU loss function to realize accurate positioning of a defect position. The detection result comprises a defect category of the pipeline, a bounding box of each target and a confidence.