Underground drainage pipeline crack image segmentation method
By combining a convolutional neural network model with an encoder-decoder structure with preprocessing and postprocessing steps, the problem of low crack segmentation accuracy in underground pipeline environments is solved, achieving high-precision and robust automated crack detection, which is suitable for large-scale pipeline inspection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU UNIV OF SCI & TECH
- Filing Date
- 2026-01-19
- Publication Date
- 2026-04-28
AI Technical Summary
Existing traditional methods and early machine learning methods are difficult to accurately segment cracks in complex underground pipeline environments, resulting in problems such as low segmentation accuracy, false detections, and missed detections.
A convolutional neural network model based on an encoder-decoder structure is used for crack image segmentation. Combined with preprocessing and postprocessing steps, including illumination correction, adaptive histogram equalization, morphological operations and edge-preserving filtering, end-to-end automated processing is achieved.
It improves the accuracy and robustness of crack segmentation, enabling accurate crack identification under uneven lighting and low contrast conditions, reducing manual intervention, and is suitable for large-scale pipeline inspection, providing detail preservation and quantitative analysis functions.
Smart Images

Figure CN121937477A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision and image processing technology, specifically to a method for image segmentation of cracks in underground drainage pipes for urban infrastructure detection. Background Technology
[0002] Underground drainage pipes are a vital urban infrastructure, and their structural health directly impacts urban operational safety and environmental protection. Cracks can easily develop inside these pipes due to aging, corrosion, and ground settlement. If not detected and repaired promptly, these cracks can lead to serious consequences such as leaks and road collapses. Traditional pipe inspection methods primarily rely on manual review of closed-circuit television (CCTV) recordings, which is inefficient, subjective, and prone to errors due to fatigue.
[0003] In recent years, image-based automatic detection technology has gradually become a research hotspot. Accurately segmenting crack regions from pipeline images with complex backgrounds is a crucial step for subsequent quantitative analysis and damage assessment. However, the internal environment of underground pipelines presents the following challenges: 1) extremely poor and uneven lighting conditions; 2) numerous interfering elements in the images, such as stains, water stains, tree root intrusion, and pipe wall joints; 3) diverse crack shapes, varying widths, and low contrast. Existing traditional image segmentation methods (such as thresholding and edge detection) and early machine learning methods exhibit poor robustness, low segmentation accuracy, and severe false positives and false negatives in such complex scenarios.
[0004] Therefore, there is an urgent need for an accurate and robust automatic crack image segmentation method that can adapt to complex underground pipeline environments. Summary of the Invention
[0005] (a) Technical problems to be solved In view of the above-mentioned technical problems, the present invention provides a method for image segmentation of cracks in underground drainage pipes.
[0006] (II) Technical Solution This invention provides a method for image segmentation of cracks in underground drainage pipes, comprising the following steps: S1. Image preprocessing: Obtain the original image of the underground drainage pipe to be processed, and perform enhancement and normalization processing on the original image to obtain a preprocessed image; S2. Semantic segmentation: The preprocessed image is input into a pre-trained crack segmentation model, and the crack segmentation model outputs an initial segmentation mask containing the crack region. S3. Post-processing optimization: The initial segmentation mask is subjected to noise filtering and edge smoothing to obtain the final segmentation result image, in which the crack region is accurately identified.
[0007] In some embodiments of the present invention, the image enhancement and normalization processing in step S1 includes: performing illumination unevenness correction, contrast enhancement, and size normalization on the original image.
[0008] In some embodiments of the present invention, the crack segmentation model is a convolutional neural network model based on an encoder-decoder structure; the encoder is used to extract multi-level features of the input image, and the decoder is used to fuse and upsample the multi-level features to gradually restore the original image size and generate crack segmentation results.
[0009] In some embodiments of the present invention, a skip connection module is provided between the encoder and the decoder for cross-layer fusion of shallow detail features extracted by the encoder and deep semantic features recovered by the decoder.
[0010] In some embodiments of the present invention, in step S2, the training process of the crack segmentation model includes: using a training dataset containing images of underground drainage pipes and corresponding crack pixel-level annotations to perform end-to-end supervised learning on the convolutional neural network model.
[0011] In some embodiments of the present invention, the noise filtering and edge smoothing process in step S3 specifically includes: removing isolated noise points using morphological operations, and smoothing the crack edges using an edge-preserving filtering algorithm to obtain a continuous and accurate crack profile.
[0012] In some embodiments of the present invention, after obtaining the final segmentation result image, the method further includes: performing quantitative analysis on the segmented crack region to calculate the length, width and distribution characteristic parameters of the crack.
[0013] (III) Beneficial Effects As can be seen from the above technical solution, the present invention has at least one of the following beneficial effects: 1. High precision and strong robustness: The semantic segmentation model using deep learning can understand image content at the pixel level and effectively distinguish between cracks and complex background interference such as stains, watermarks, and pipe cracks. It can still maintain high segmentation accuracy under uneven lighting and low contrast conditions.
[0014] 2. End-to-end automated processing: From the input of the original image to the output of the final segmentation result, the entire process is automated, which greatly reduces manual intervention, improves detection efficiency, and is suitable for batch processing of large-scale pipeline inspection data.
[0015] 3. Strong ability to preserve details: By combining encoder-decoder structure with skip connections, the model can not only use high-level semantic information to identify crack categories, but also use low-level detail information to accurately locate crack edges, especially with excellent segmentation effect for fine cracks.
[0016] 4. High practicality: The preprocessing and post-processing steps are specifically designed for the characteristics of pipeline images, further improving the usability of the segmentation results. The final quantitative analysis function can directly serve engineering practice. Attached Figure Description
[0017] Figure 1 This is the overall flowchart of the present invention. Detailed Implementation
[0018] This invention provides a method for segmenting images of cracks in underground drainage pipes. To make the objectives, technical solutions, and advantages of this invention clearer, the following detailed description is provided in conjunction with specific embodiments and accompanying drawings. Specific Implementation like Figure 1 As shown, this invention provides a method for image segmentation of cracks in underground drainage pipes, with the following specific steps: Step S1: Data acquisition and preprocessing.
[0020] The video stream inside underground drainage pipes is captured by a camera mounted on a pipe-crawling robot, and keyframes are extracted as raw images. Raw images typically suffer from low brightness, dappled lighting, and poor contrast.
[0021] First, a method based on Retinex theory is used to correct for uneven illumination, eliminating shadows and highlights caused by non-uniform lighting.
[0022] Then, adaptive histogram equalization is applied to enhance the overall contrast of the image, making the grayscale difference between the crack and the background more obvious.
[0023] Finally, all images are scaled to a fixed size (e.g., 512x512 pixels) and pixel values are normalized to meet the input requirements of subsequent deep learning models.
[0024] Step S2: Semantic segmentation of cracks based on deep neural networks.
[0025] The preprocessed image is input into the trained crack segmentation model for forward propagation calculation.
[0026] The core of the model is an encoder-decoder network. The encoder uses a pre-trained convolutional neural network (such as ResNet) as its backbone to extract deep features from the image. The decoder consists of multiple upsampling modules, each containing deconvolution or interpolation upsampling operations, followed by convolutional layers.
[0027] The key design element is that the feature maps from each downsampling stage in the encoder are concatenated with the corresponding feature maps from the upsampling stage in the decoder along the channel dimension via skip connections. This allows the decoder to utilize both the fine texture information from the encoder and the abstract semantic information it has learned when restoring spatial resolution.
[0028] The model ultimately outputs a single-channel probability map of the same size as the input image, where the value of each pixel represents the probability that the point belongs to a crack.
[0029] Step S3: Post-processing and quantitative analysis of segmentation results.
[0030] The initial probability map output by the model is thresholded (e.g., the probability is greater than 0.5) and transformed into a binary mask map (initial segmentation mask). This mask may contain scattered noise and coarse edges.
[0031] First, morphological filtering is used for optimization: a small circular structuring element is used for opening to eliminate isolated white noise points; then a slightly larger structuring element is used for closing to fill the small holes inside the crack and connect adjacent small fracture parts.
[0032] Then, anisotropic diffusion filtering is used to smooth the crack edges, which can smooth the internal region while protecting important edge contours.
[0033] After the above post-processing, a clear, continuous, and accurate binary segmentation image of the crack is obtained.
[0034] Finally, the binary image is labeled with connected components. For each crack connected component, parameters such as pixel area, principal axis direction (length), and average width can be calculated, and a detection report is generated.
[0035] Training Phase Notes: The crack segmentation model requires pre-training. A large number of underground pipe images with crack pixel regions already labeled by professionals are collected to form the training and validation sets. The model is trained end-to-end using the cross-entropy loss function and the Adam optimizer until the model's segmentation accuracy on the validation set stabilizes.
[0036] This concludes the detailed description of the embodiment with reference to the accompanying drawings. Based on the above description, those skilled in the art should have a clear understanding of the present invention.
[0037] It should be noted that implementations not shown or described in the accompanying drawings or the main text of the specification are all forms known to those skilled in the art and are not described in detail. Furthermore, the definitions of the elements and methods described above are not limited to the various specific structures, shapes, or methods mentioned in the embodiments.
[0038] It should also be noted that this document provides examples of parameters containing specific values, but these parameters need not be exactly equal to the corresponding values, but can approximate the corresponding values within acceptable error tolerances or design constraints. Directional terms mentioned in the embodiments, such as "up," "down," "front," "back," "left," and "right," are only for reference to the accompanying drawings and are not intended to limit the scope of protection of this invention. Furthermore, unless specifically described or steps must occur in sequence, the order of the above steps is not limited to those listed above and can be varied or rearranged according to the desired design. Moreover, the above embodiments can be used in combination with each other or with other embodiments based on design and reliability considerations; that is, technical features from different embodiments can be freely combined to form more embodiments.
[0039] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for segmenting images of cracks in underground drainage pipes, characterized in that, Includes the following steps: S1. Image preprocessing: Obtain the original image of the underground drainage pipe to be processed, and perform enhancement and normalization processing on the original image to obtain a preprocessed image; S2. Semantic segmentation: The preprocessed image is input into a pre-trained crack segmentation model, and the crack segmentation model outputs an initial segmentation mask containing the crack region. S3. Post-processing optimization: The initial segmentation mask is subjected to noise filtering and edge smoothing to obtain the final segmentation result image, in which the crack region is accurately identified.
2. The method for segmenting images of cracks in underground drainage pipes according to claim 1, characterized in that, The image enhancement and normalization processing in step S1 includes: performing illumination unevenness correction, contrast enhancement, and size normalization on the original image.
3. The method for segmenting images of cracks in underground drainage pipes according to claim 1, characterized in that, The crack segmentation model is a convolutional neural network model based on an encoder-decoder structure; the encoder is used to extract multi-level features of the input image, and the decoder is used to fuse and upsample the multi-level features to gradually restore the original image size and generate crack segmentation results.
4. The method for segmenting images of cracks in underground drainage pipes according to claim 3, characterized in that, A skip connection module is provided between the encoder and the decoder to perform cross-layer fusion of the shallow detail features extracted by the encoder and the deep semantic features recovered by the decoder.
5. The method for segmenting images of cracks in underground drainage pipes according to claim 3 or 4, characterized in that, In step S2, the training process of the crack segmentation model includes: using a training dataset containing images of underground drainage pipes and corresponding crack pixel-level annotations to perform end-to-end supervised learning on the convolutional neural network model.
6. The method for segmenting images of cracks in underground drainage pipes according to claim 1, characterized in that, The noise filtering and edge smoothing process in step S3 specifically includes: using morphological operations to remove isolated noise points, and using an edge-preserving filtering algorithm to smoothly connect the crack edges to obtain a continuous and accurate crack profile.
7. The method for segmenting images of cracks in underground drainage pipes according to claim 1, characterized in that, After obtaining the final segmentation result image, the method further includes: performing quantitative analysis on the segmented crack region to calculate the length, width, and distribution characteristic parameters of the crack.