Image processing-based water supply pipeline defect detection method and system
By using an image processing-based method for detecting defects in water supply pipelines, combined with multi-scale feature extraction and a fluid dynamics inversion model, the problems of low detection efficiency and insufficient accuracy in existing technologies are solved. This method achieves high-precision automatic defect identification and scientific grade assessment, supporting decision-making for water supply network renovation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA RAILWAY GUIZHOU ENG CORP LTD
- Filing Date
- 2026-05-06
- Publication Date
- 2026-06-05
AI Technical Summary
Existing methods for inspecting water supply pipelines are inefficient, subjective, difficult to quantify and assess, and have low accuracy in complex environments. They also struggle to integrate static geometric features with dynamic fluid effects, resulting in inaccurate defect classification.
An image processing-based defect detection method for water supply pipelines is adopted. Through multi-scale feature extraction and fluid dynamics inversion model, combined with static geometric features and dynamic influencing factors, a comprehensive quantitative evaluation model is constructed, including atmospheric scattering model defogging, optical flow field correction, improved YOLOv8 network, and fluid dynamics inversion, to achieve automatic defect identification and level assessment.
It improves the accuracy and efficiency of pipeline defect detection, provides scientific defect level assessment, and supports scientific decision-making in pipeline network renovation projects.
Smart Images

Figure CN122156193A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing and defect detection technology, specifically to a method and system for detecting defects in water supply pipelines based on image processing. Background Technology
[0002] As urban water supply networks age, internal defects such as cracks, corrosion, and leaks frequently appear in the pipes, severely impacting water supply safety and efficiency. Traditional closed-circuit television (CCTV) inspection of pipelines relies on manual interpretation, resulting in low efficiency, high subjectivity, and difficulty in quantification. Existing image processing methods have significant shortcomings when dealing with the complex environment inside water supply pipelines: the pipelines are constantly damp, contain water mist, and experience uneven lighting, leading to decreased image contrast and blurred details; dynamic distortion caused by water flow fluctuations results in nonlinear geometric distortion between consecutive frames; scale, air bubbles, and other deposits are easily confused with real defects, leading to low detection accuracy and a high false alarm rate; existing methods primarily focus on the static geometric features of defects, lacking a quantitative assessment of the dynamic expansion risk of defects under fluid conditions; and defect classification often relies on single features or simple weighting, failing to comprehensively reflect the overall hazard of defects.
[0003] Therefore, there is an urgent need for an intelligent detection method that can overcome the above-mentioned environmental interferences, integrate static geometric features with dynamic fluid effects, and achieve high-precision quantitative assessment to support scientific decision-making in pipeline renovation projects. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to address the shortcomings of the prior art by providing a method and system for detecting defects in water supply pipelines based on image processing.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A method and system for detecting defects in water supply pipelines based on image processing, comprising the following steps:
[0007] Step S1: Obtain the original image of the inner wall of the water supply pipe and preprocess the original image to obtain a standardized image;
[0008] Step S2: Construct a preliminary screening network for defect candidate regions based on multi-scale feature extraction, process the standardized image, and identify and locate potential defect regions in the image;
[0009] Step S3: Extract the static geometric features of the potential defect region, including the area, perimeter, length, average width, convex hull area, and shape complexity index of the defect;
[0010] Step S4: Based on the fluid dynamics inversion model, combined with continuous multi-frame images and real-time pipeline operating parameters, calculate the dynamic influence factor of the potential defect area under the influence of water flow.
[0011] Step S5: Integrate the static geometric features and the dynamic influencing factors to construct a comprehensive quantitative assessment model for defects and determine the level of defects.
[0012] Furthermore, in step S1, the preprocessing of the original image specifically includes:
[0013] The original image is enhanced by a dehazing algorithm based on atmospheric scattering model and mean filtering. The image is divided into grids to estimate atmospheric light, local minima are calculated to estimate coarse transmittance, and mean filtering is used to smooth and optimize transmittance in order to eliminate the impact of water mist in the pipe on image clarity.
[0014] A dynamic distortion correction method based on optical flow field is used to correct the dehazed image. By calculating the optical flow field between consecutive frames and quantifying the average optical flow amplitude, a correction matrix is dynamically constructed to correct the dynamic distortion caused by water flow impact, thus obtaining a standardized image.
[0015] Furthermore, step S2 specifically includes the following steps:
[0016] Step S2.1: Using an improved YOLOv8 network as the basic architecture, in the last four stages of the backbone network, the C2f module is replaced with an inverted residual moving module to enhance the ability to extract long-distance dependent features such as defect edges and textures.
[0017] Step S2.2: Replace all standard convolutional layers in the YOLOv8 neck network with GSConv and replace all C2f modules with VoVGSCSP modules for deep fusion of multi-scale features extracted by the backbone network.
[0018] Step S2.3: Process the fused features using the detection head to output screening results containing defect categories and bounding boxes, i.e., potential defect areas.
[0019] Furthermore, step S4 specifically includes:
[0020] Step S4.1: Analyze the edge pixel displacement of the same defect region in multiple consecutive frames of images, and use the optical flow method to calculate the instantaneous deformation rate of the defect under the action of fluid;
[0021] Step S4.2: Obtain real-time operating parameters of the pipeline, including water pressure and flow velocity. By solving the Navier-Stokes equations, construct a microscopic pressure gradient field at the defect location. The microscopic pressure gradient field directly correlates the optical flow field in the image with the physical pressure field.
[0022] Step S4.3: Input the microscopic pressure gradient field and instantaneous deformation rate as boundary conditions into the fluid dynamics inversion model to calculate the dynamic growth potential energy of the defect, which is used as the dynamic influence factor.
[0023] Further, in step S4.3, the dynamic growth potential energy is calculated as follows: it is obtained by weighted summation of the surface integral of the tensor intensity of the normal pressure gradient at the defect edge and the fluid velocity gradient, combined with the line integral of the boundary curvature, wherein the velocity gradient tensor intensity is defined as the square of the Frobenius norm of the velocity gradient tensor.
[0024] Furthermore, step S5 specifically includes the following steps:
[0025] Step S5.1: Normalize the static geometric features and dynamic influence factors respectively;
[0026] Step S5.2: Construct a comprehensive defect index. The index is obtained by using a nonlinear fusion model based on risk field theory, which is calculated from the normalized defect area, average defect width, maximum defect length, shape complexity index, and dynamic growth potential energy.
[0027] Step S5.3: Based on the comparison between the calculated comprehensive defect index and the preset threshold, the defects are divided into different levels.
[0028] The image processing-based water supply pipeline defect detection system is used to implement any of the image processing-based water supply pipeline defect detection methods described above, including:
[0029] The image acquisition module is used to acquire raw images of the inner wall of the water supply pipe;
[0030] The image preprocessing module, connected to the image acquisition module, is used to perform dehazing enhancement and dynamic distortion correction based on optical flow field on the original image, and output a standardized image.
[0031] The defect screening module, connected to the image preprocessing module, is used to automatically identify and extract candidate defect regions from the standardized image;
[0032] The feature extraction module, connected to the defect screening module, is used to extract the static geometric features of the defect candidate region;
[0033] The dynamic analysis module, connected to the image acquisition module and the feature extraction module, is used to calculate the dynamic influence factor based on continuous frame images and pipeline operation parameters.
[0034] The comprehensive evaluation module connects the feature extraction module and the dynamic analysis module. It is used to integrate static geometric features and dynamic influence factors, and output the defect level evaluation result by calculating the comprehensive defect index.
[0035] Furthermore, the image preprocessing module internally includes:
[0036] The dehazing enhancement unit is used to perform a dehazing algorithm based on an atmospheric scattering model and mean filtering. It estimates atmospheric light by dividing the image into grids, calculates local minima to estimate coarse transmittance, and uses mean filtering to smooth and optimize the transmittance.
[0037] The distortion correction unit is used to correct the dehazed image using a dynamic distortion correction method based on optical flow field. By calculating the optical flow field between consecutive frames and quantifying the average optical flow amplitude, a correction matrix is dynamically constructed to correct the dynamic distortion caused by water flow impact, thus obtaining a standardized image.
[0038] Furthermore, the defect screening module is built on an improved YOLOv8 network, with inverted residual moving modules integrated in the last four stages of the backbone network, and all standard convolutional layers and C2f modules in its neck network are replaced by GSConv and VoVGSCSP modules, respectively.
[0039] The dynamic analysis module contains a fluid dynamics inversion unit, which is used to calculate the dynamic growth potential of the defect based on the normal pressure gradient and the fluid velocity gradient tensor intensity at the defect edge. The velocity gradient tensor intensity is defined as the square of the Frobenius norm of the velocity gradient tensor.
[0040] Furthermore, the system also includes a data storage module for storing historical water pressure, flow velocity, and corresponding defect image data of the pipeline, in order to update and optimize the calculation weights of dynamic influence factors and comprehensive defect index.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0042] 1. This invention employs a dehazing algorithm based on an atmospheric scattering model and mean filtering. It utilizes a combined strategy of grid partitioning to estimate atmospheric light, local minima to estimate transmittance, and mean filtering to smooth transmittance, effectively eliminating the impact of water mist inside the pipe on image clarity. Simultaneously, it employs a dynamic distortion correction method based on optical flow field. By calculating the optical flow field between consecutive frames and quantifying the average optical flow amplitude, a correction matrix is dynamically constructed to correct the dynamic distortion caused by water flow impact, thereby improving image quality and providing reliable standardized images for subsequent defect detection.
[0043] 2. This invention constructs an improved YOLOv8 multi-scale feature extraction network. In the last four stages of the backbone network, an inverted residual moving module is introduced to enhance the extraction capability of long-distance dependent features such as defect edges and textures. In the neck network, GSConv is used to replace the standard convolution to reduce computation and maintain information fusion. The VoVGSCSP module is used to replace the C2f module to enhance cross-layer feature fusion. This invention can effectively address the detection challenge of pipeline defects with different scales and improve the accuracy of defect identification and localization.
[0044] 3. This invention constructs a shape complexity index that integrates roundness, concavity, and slenderness, uses convex hull area to quantify the degree of unevenness of the defect edge, and combines static geometric features such as defect area, perimeter, length, and average width to comprehensively characterize the irregularity of the defect shape and the complexity of its structure, providing rich geometric feature dimensions for defect quantitative assessment.
[0045] 4. This invention uses a nonlinear fusion model based on risk field theory to calculate the comprehensive defect index. By combining the index saturation of three risk sources—the ratio of defect area to average width, the product of length and shape complexity, and dynamic growth potential energy—it reflects the synergistic amplification effect of multiple risk sources. Combined with industry standards such as evaluation criteria, it determines the grading threshold and classifies defects into three levels, providing a scientific basis for pipeline renovation projects. Attached Figure Description
[0046] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0047] Figure 1 This is a flowchart illustrating an embodiment of the present invention;
[0048] Figure 2 This is a system schematic diagram according to an embodiment of the present invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0050] like Figure 1 As shown, the image processing-based method and system for detecting defects in water supply pipelines includes the following steps:
[0051] Step S1: Obtain the original image of the inner wall of the water supply pipe and preprocess the original image to obtain a standardized image;
[0052] Step S2: Construct a preliminary screening network for defect candidate regions based on multi-scale feature extraction, process the standardized image, and identify and locate potential defect regions in the image;
[0053] Step S3: Extract the static geometric features of the potential defect region, including the area, perimeter, length, average width, convex hull area, and shape complexity index of the defect;
[0054] Step S4: Based on the fluid dynamics inversion model, combined with continuous multi-frame images and real-time pipeline operating parameters, calculate the dynamic influence factor of the potential defect area under the influence of water flow.
[0055] Step S5: Integrate the static geometric features and the dynamic influencing factors to construct a comprehensive quantitative assessment model for defects and determine the level of defects.
[0056] In step S1, the preprocessing of the original image specifically includes:
[0057] The original image is enhanced by a dehazing algorithm based on atmospheric scattering model and mean filtering. The image is divided into grids to estimate atmospheric light, local minima are calculated to estimate coarse transmittance, and mean filtering is used to smooth and optimize transmittance in order to eliminate the impact of water mist in the pipe on image clarity.
[0058] A dynamic distortion correction method based on optical flow field is used to correct the dehazed image. By calculating the optical flow field between consecutive frames and quantifying the average optical flow amplitude, a correction matrix is dynamically constructed to correct the dynamic distortion caused by water flow impact, thus obtaining a standardized image.
[0059] High humidity inside water supply pipes often results in water mist, which reduces image contrast and blurs details. To eliminate the effects of water mist, a classic atmospheric scattering model is used to recover fog-free images by estimating atmospheric light and transmittance. Specifically, this includes:
[0060] The atmospheric scattering model is expressed as:
[0061]
[0062] in, Represents the two-dimensional coordinates of a pixel. This indicates an image with fog. This represents the fog-free image to be recovered. Transmittance, with a value range of [0, 1], represents the proportion of light that passes through the medium without being scattered and reaches the camera. This represents the global atmospheric light value, typically taken as the value of the brightest pixel in the image.
[0063] The goal of defogging is to The middle estimate and to restore The specific steps include:
[0064] The image is divided into several grids of equal size. The brightness of all pixels in each grid is calculated, and the grid with the highest brightness is selected. The brightest pixel value in that grid is taken as the atmospheric light value. The estimated value;
[0065] For each pixel, within a local neighborhood such as a 15×15 pixel window, calculate the minimum values for each of the three color channels:
[0066]
[0067] in, This represents the local minimum value after normalization. This represents the three color channels: red, green, and blue. Represented in pixels A local window centered on the object, such as 15x15 pixels. Indicates the image in channels Up pixel The intensity value, Indicates in local window centered The coordinates of the neighboring pixels being traversed within the range. Indicates atmospheric light in the channel The amount;
[0068] Rough transmittance The calculation formula is:
[0069]
[0070] in, This represents the retention factor, which is typically 0.95.
[0071] The coarse transmittance contains a blocky effect, and using it directly will cause halo in the restored image. Mean filtering is used to smooth the coarse transmittance to obtain the optimized transmittance.
[0072] The estimated Substituting the optimized transmittance into the atmospheric scattering model, the haze-free image is recovered. The specific formula is as follows:
[0073]
[0074] in, This represents the lower limit threshold of transmittance, which is usually set to 0.1 to prevent noise amplification caused by an excessively small denominator.
[0075] The impact of water flow in a pipe lens causes dynamic distortion, resulting in nonlinear geometric distortion between consecutive frames. This method utilizes the optical flow field information between consecutive frames to dynamically construct a correction model to eliminate image jitter and distortion caused by water flow. Specifically, it includes:
[0076] For two consecutive frames of images, the motion vector of each pixel is calculated to obtain the optical flow field. The optical flow field reflects the dynamic disturbance of the water flow on the image: in areas where the water flow is strong, the pixel motion amplitude is large; in areas where the water flow is stable, the pixel motion amplitude is small.
[0077] To quantify the degree of dynamic distortion across the entire image region, the average magnitude of light loss across all pixels is calculated using the following formula:
[0078]
[0079] in, This represents the average optical flow amplitude, which is the degree of dynamic distortion of the entire image. The larger the value, the stronger the water flow impact and the more severe the image distortion. Represents the entire image region. Indicates the region The total number of pixels within, This indicates the speed of pixel movement in the horizontal direction. This indicates the speed at which a pixel moves in the vertical direction;
[0080] Using optical flow field information, a dynamic correction matrix is constructed to perform geometric transformations on the current frame image to counteract the distortion caused by water flow. The correction matrix consists of a static basic correction matrix and dynamic compensation terms, with the specific formula as follows:
[0081]
[0082] in, Represents the dynamic correction matrix. This represents the static fundamental correction matrix, used to correct fixed distortions inherent in the lens itself, and is obtained through camera calibration. This represents the correction strength coefficient, determined through experimental calibration, typically ranging from 0.01 to 0.1, used to control the intensity of dynamic correction. This represents a 3×3 identity matrix that operates only on the first two rows. Specifically, it applies dynamic compensation to only the first two rows of the transformation matrix, while keeping the third row unchanged.
[0083]
[0084] The dynamic correction matrix is applied to the current frame image to obtain the corrected image, as shown in the following formula:
[0085]
[0086] in, Represents the pixel coordinates in the original distorted image. This represents the corresponding coordinates in the corrected image. The grayscale value of each pixel in the corrected image is obtained through bilinear interpolation.
[0087] Step S2 specifically includes the following steps:
[0088] Step S2.1: Using an improved YOLOv8 network as the basic architecture, in the last four stages of the backbone network, the C2f module is replaced with an inverted residual moving module to enhance the ability to extract long-distance dependent features such as defect edges and textures.
[0089] Step S2.2: Replace all standard convolutional layers in the YOLOv8 neck network with GSConv and replace all C2f modules with VoVGSCSP modules for deep fusion of multi-scale features extracted by the backbone network.
[0090] Step S2.3: Process the fused features using the detection head to output screening results containing defect categories and bounding boxes, i.e., potential defect areas.
[0091] The YOLOv8 backbone network is used as the basis, and the inverted residual moving module iRMB is introduced in the last four stages, including Stage 3, Stage 4, Stage 5 and Stage 6. Specifically, the last C2f module in each stage is replaced with iRMB. The iRMB structure includes a multi-head self-attention layer and a feedforward network. This module can capture long-range dependencies and enhance the ability to extract subtle features such as defect edges and textures.
[0092] In the Neck network, lightweight modifications are made to adapt to the scale diversity of pipe defects. All standard convolutional layers are replaced with GSConv, which reduces computational cost while maintaining inter-channel information fusion through grouped convolutions and channel shuffle operations. All C2f modules are replaced with VoVGSCSP modules. VoVGSCSP is built on GSConv and contains multiple parallel GSConv branches and cross-layer connections, further enhancing the fusion capability of cross-layer features and effectively integrating shallow detail information and deep semantic information. After processing by the Neck network, a fused multi-scale feature map is generated.
[0093] The fused feature maps are input into the YOLOv8 detection head. Each feature map corresponds to three detection branches at different scales. The detection head outputs a tensor containing defect category probability, bounding box coordinates, and confidence. After non-maximum suppression, the final defect candidate regions are obtained. Each candidate region contains category label and bounding box information.
[0094] Step S3 specifically includes: performing fine segmentation and feature quantization on each candidate region to extract the static geometric feature vector of the defect;
[0095] A U-Net-based semantic segmentation network is used to segment candidate regions at the pixel level, resulting in an accurate binary mask for defects. The semantic segmentation network is pre-trained on a pipeline defect dataset and can distinguish between real defects and the background.
[0096] The following geometric features are calculated from the binary mask: the area of the defect, i.e., the total number of defect pixels; the perimeter of the defect, i.e., the number of pixels at the defect boundary, obtained by calculating the boundary chain code length; the length of the defect, i.e., the length of the major axis of the smallest bounding rectangle of the defect contour; the average width of the defect, obtained by the ratio of the defect area to the defect length; the convex hull area of the defect contour, i.e., the area of the smallest convex polygon that can contain all defect pixels; and the shape complexity index, which is larger the more elongated or irregular the shape.
[0097] The formula for calculating the shape complexity index is as follows:
[0098]
[0099] in, Represents the shape complexity index. Indicates the perimeter of the defect. Indicates the area of the defect. The area of the convex hull representing the defect profile. Indicates the length of the defect. The index represents the average width of the defect. It combines roundness, indentation, and thinness to provide a more comprehensive description of the shape complexity of the defect. The larger the value, the more irregular and complex the defect shape.
[0100] Finally, the above geometric features are integrated to obtain a static geometric feature vector.
[0101] Step S4 specifically includes:
[0102] Step S4.1: Analyze the edge pixel displacement of the same defect region in multiple consecutive frames of images, and use the optical flow method to calculate the instantaneous deformation rate of the defect under the action of fluid;
[0103] Step S4.2: Obtain real-time operating parameters of the pipeline, including water pressure and flow velocity. By solving the Navier-Stokes equations, construct a microscopic pressure gradient field at the defect location. The microscopic pressure gradient field directly correlates the optical flow field in the image with the physical pressure field.
[0104] Step S4.3: Input the microscopic pressure gradient field and instantaneous deformation rate as boundary conditions into the fluid dynamics inversion model to calculate the dynamic growth potential energy of the defect, which is used as the dynamic influence factor.
[0105] In step S4.3, the dynamic growth potential energy is calculated as follows: it is obtained by weighted summation of the surface integral of the tensor intensity of the normal pressure gradient at the defect edge and the fluid velocity gradient, combined with the line integral of the boundary curvature, wherein the velocity gradient tensor intensity is defined as the square of the Frobenius norm of the velocity gradient tensor.
[0106] The instantaneous deformation rate of the defect is calculated by analyzing the pixel displacement of the same defect region in two consecutive frames of images using the optical flow method. The specific formula is as follows:
[0107]
[0108] in, This represents the instantaneous deformation rate of the defect, reflecting the degree of dynamic response of the defect under fluid action. The larger the value, the more severe the deformation. This represents the position coordinate vector of the i-th pixel on the defect boundary at time t. This represents the position coordinate vector of the i-th pixel at time t+1 in the next frame. The Euclidean norm of a vector. This represents the total number of sampling points on the defect boundary. This represents the perimeter of the defect at time t;
[0109] Based on real-time pipeline operating parameters, including water pressure, flow velocity, and the geometry of defects, a microscopic pressure gradient field at the defect location is constructed. This pressure gradient field is obtained by solving the Navier-Stokes equations, with the specific formula as follows:
[0110]
[0111] in, This represents the fluid density; for water, it is taken as 1000 kg / m³. Represents the fluid velocity field. Indicates pressure, Indicates the pressure gradient. Indicates time, This represents the dynamic viscosity, which is taken as 1.0 × 10⁻³ Pa·s for water. The Laplace operator represents the velocity field. This represents volume forces, such as gravity, which can be ignored in this model;
[0112] The computational fluid dynamics method was adopted, combining the optical flow field obtained from continuous image frames as the velocity field input and the real-time water pressure of the pipeline as the boundary condition. The computational mesh was constructed using the geometry of the defect, and the pressure gradient at each pixel was obtained by finite element numerical solution. This pressure gradient field reflects the pressure distribution of water flow in the local area of the defect due to cross-sectional changes, providing a basis for subsequent dynamic growth potential energy calculation.
[0113] The dynamic growth potential energy of the defect is calculated based on the fluid dynamics inversion model, and the specific formula is as follows:
[0114]
[0115] in, This represents the dynamic growth potential energy of the defect. The unit normal vector representing the edge of the defect. This represents the nonlinear adjustment coefficient, ranging from 0.5 to 2.0, obtained through fitting experimental data, and is used to adjust the nonlinear effects of impact force. The squared Frobenius norm of the velocity gradient tensor is... Indicates the area of the defect. Indicates the perimeter of the defect. Indicates the location of the boundary curve The curvature function at that point, This indicates that the curvature is integraled along the defect boundary using a line integral. The impact force-flux coupling coefficient, taken as 0.12, is obtained by fitting finite element simulation data from historical pipeline defect samples. It is used to balance the dimensions and contribution of the impact force and flux variation terms. This represents the boundary tension coefficient, typically taken as 0.45, determined experimentally by comparing the propagation rates of defects with different curvatures, and is used to balance the contribution of the boundary geometric tension term.
[0116] Step S5 specifically includes the following steps:
[0117] Step S5.1: Normalize the static geometric features and dynamic influence factors respectively;
[0118] Step S5.2: Construct a comprehensive defect index. The index is obtained by using a nonlinear fusion model based on risk field theory, which is calculated from the normalized defect area, average defect width, maximum defect length, shape complexity index, and dynamic growth potential energy.
[0119] Step S5.3: Based on the comparison between the calculated comprehensive defect index and the preset threshold, the defects are divided into different levels.
[0120] To avoid the influence of different dimensions, the static geometric features and dynamic influencing factors are normalized by using the maximum-minimum normalization method.
[0121] A comprehensive defect index is constructed using a nonlinear weighted fusion model to fully reflect the static geometric characteristics and dynamic risks of defects. The specific formula is as follows:
[0122]
[0123] in, This represents the overall defect index. , , , and Let represent the normalized defect area, average defect width, maximum defect length, shape complexity index, and dynamic growth potential energy of the defect, respectively. , and These represent the risk field intensity coefficients, used to adjust the contribution weights of different risk sources, and are typically set to 1.5, 2.0, and 2.5 respectively.
[0124] When the individual risk sources are small, the internal value of the index is small, and the comprehensive defect index is approximately equal to the internal value of the index, showing linear growth. When multiple risk sources increase simultaneously, the internal value of the index increases, and the comprehensive defect index shows non-linear accelerated growth, reflecting the synergistic amplification effect of multiple risk sources. When the risk is extremely high, the comprehensive defect index approaches 1, achieving saturation, thus avoiding the infinite amplification of the index due to a single abnormal feature.
[0125] Based on the calculated comprehensive defect index, defects are divided into three levels using preset thresholds. and Specifically, it includes:
[0126] The value is 0.35, which is calculated based on the first-level assessment standard for leakage rate in the "Standard for Leakage Control and Assessment of Urban Water Supply Networks" (CJJ 92-2016), corresponding to the boundary between minor damage and medium risk.
[0127] The value is 0.65, which is determined based on the secondary assessment standard in this standard and the high-risk threshold in the municipal local standard "Technical Specification for Safety Risk Assessment of Urban Water Supply Network" (DB31 / T 1332-2021), corresponding to the level of severe structural damage that needs to be repaired immediately;
[0128] The specific classification of defect levels includes:
[0129] Level I minor damage: 0 ≤ comprehensive defect index < 0.35, small defect area, regular shape, low dynamic potential energy, and minimal impact on pipeline structural safety. It can be temporarily left untreated or included in routine monitoring. According to the industry standard, no less than 1% of the total pipeline length should be renovated every year. Such defects can be included in long-term observation.
[0130] Level II, Medium Leakage Risk: 0.35 ≤ Comprehensive Defect Index < 0.65. The defect is of a certain size, has a relatively complex shape, and moderate dynamic potential energy, posing a leakage risk. It is recommended to include it in the near-term maintenance plan.
[0131] Level III Severe Structural Damage: Comprehensive defect index ≥ 0.65, large defect area, highly irregular shape, and high dynamic potential energy, potentially leading to a severe decrease in structural strength and posing a risk of pipe bursting. Immediate repair or replacement measures are required. Referring to the "Technical Standards for the Renovation of Old Municipal Pipelines," this type of defect should be prioritized for renovation.
[0132] The image processing-based water supply pipeline defect detection system is used to implement any of the image processing-based water supply pipeline defect detection methods described above, including:
[0133] The image acquisition module is used to acquire raw images of the inner wall of the water supply pipe;
[0134] The image preprocessing module, connected to the image acquisition module, is used to perform dehazing enhancement and dynamic distortion correction based on optical flow field on the original image, and output a standardized image.
[0135] The defect screening module, connected to the image preprocessing module, is used to automatically identify and extract candidate defect regions from the standardized image;
[0136] The feature extraction module, connected to the defect screening module, is used to extract the static geometric features of the defect candidate region;
[0137] The dynamic analysis module, connected to the image acquisition module and the feature extraction module, is used to calculate the dynamic influence factor based on continuous frame images and pipeline operation parameters.
[0138] The comprehensive evaluation module connects the feature extraction module and the dynamic analysis module. It is used to integrate static geometric features and dynamic influence factors, and output the defect level evaluation result by calculating the comprehensive defect index.
[0139] The image preprocessing module includes:
[0140] The dehazing enhancement unit is used to perform a dehazing algorithm based on an atmospheric scattering model and mean filtering. It estimates atmospheric light by dividing the image into grids, calculates local minima to estimate coarse transmittance, and uses mean filtering to smooth and optimize the transmittance.
[0141] The distortion correction unit is used to correct the dehazed image using a dynamic distortion correction method based on optical flow field. By calculating the optical flow field between consecutive frames and quantifying the average optical flow amplitude, a correction matrix is dynamically constructed to correct the dynamic distortion caused by water flow impact, thus obtaining a standardized image.
[0142] The defect screening module is built on an improved YOLOv8 network. The inverted residual moving module is integrated in the last four stages of the backbone network, and all standard convolutional layers and C2f modules in the neck network are replaced by GSConv and VoVGSCSP modules, respectively.
[0143] The dynamic analysis module contains a fluid dynamics inversion unit, which is used to calculate the dynamic growth potential of the defect based on the normal pressure gradient and the fluid velocity gradient tensor intensity at the defect edge. The velocity gradient tensor intensity is defined as the square of the Frobenius norm of the velocity gradient tensor.
[0144] The system also includes a data storage module for storing historical water pressure, flow velocity, and corresponding defect image data of the pipeline, in order to update and optimize the calculation weights of dynamic influence factors and comprehensive defect index.
[0145] Any combination of one or more computer-readable media may be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.
[0146] The examples described herein are merely preferred embodiments of the invention and are not intended to limit the concept and scope of the invention. Any modifications and improvements made by those skilled in the art to the technical solutions of the invention without departing from the design concept of the invention should fall within the protection scope of the invention.
Claims
1. A method for detecting defects in water supply pipelines based on image processing, characterized in that, Includes the following steps: Step S1: Obtain the original image of the inner wall of the water supply pipe and preprocess the original image to obtain a standardized image; Step S2: Construct a preliminary screening network for defect candidate regions based on multi-scale feature extraction, process the standardized image, and identify and locate potential defect regions in the image; Step S3: Extract the static geometric features of the potential defect region, including the area, perimeter, length, average width, convex hull area, and shape complexity index of the defect; Step S4: Based on the fluid dynamics inversion model, combined with continuous multi-frame images and real-time pipeline operating parameters, calculate the dynamic influence factor of the potential defect area under the influence of water flow. Step S5: Integrate the static geometric features and the dynamic influence factors to construct a comprehensive quantitative assessment model for defects and determine the level of defects; In step S3, the average width of the defect is calculated as the ratio of area to length. The convex hull area of the defect is the area of the smallest convex polygon of the defect contour. The shape complexity index is calculated from the perimeter, area, convex hull area, length, and average width using a formula, specifically: ; in, Represents the shape complexity index. Indicates the perimeter of the defect. Indicates the area of the defect. The area of the convex hull representing the defect profile. Indicates the length of the defect. Indicates the average width of the defect; The comprehensive defect quantitative evaluation model calculates a comprehensive defect index using normalized defect area, average defect width, maximum defect length, and shape complexity index. Based on the calculated comprehensive defect index, defects are divided into three levels using a preset threshold.
2. The method according to claim 1, characterized in that, In step S1, the preprocessing of the original image specifically includes: The original image is enhanced by a dehazing algorithm based on atmospheric scattering model and mean filtering. The image is divided into grids to estimate atmospheric light, local minima are calculated to estimate coarse transmittance, and mean filtering is used to smooth and optimize transmittance in order to eliminate the impact of water mist in the pipe on image clarity. A dynamic distortion correction method based on optical flow field is used to correct the dehazed image. By calculating the optical flow field between consecutive frames and quantifying the average optical flow amplitude, a correction matrix is dynamically constructed to correct the dynamic distortion caused by water flow impact, thus obtaining a standardized image.
3. The method according to claim 2, characterized in that, Step S2 specifically includes the following steps: Step S2.1: Using an improved YOLOv8 network as the basic architecture, in the last four stages of the backbone network, the C2f module is replaced with an inverted residual moving module to enhance the ability to extract long-distance dependent features such as defect edges and textures. Step S2.2: Replace all standard convolutional layers in the YOLOv8 neck network with GSConv and replace all C2f modules with VoVGSCSP modules for deep fusion of multi-scale features extracted by the backbone network. Step S2.3: Process the fused features using the detection head to output screening results containing defect categories and bounding boxes, i.e., potential defect areas.
4. The method according to claim 3, characterized in that, Step S4 specifically includes: Step S4.1: Analyze the edge pixel displacement of the same defect region in multiple consecutive frames of images, and use the optical flow method to calculate the instantaneous deformation rate of the defect under the action of fluid; Step S4.2: Obtain real-time operating parameters of the pipeline, including water pressure and flow velocity. By solving the Navier-Stokes equations, construct a microscopic pressure gradient field at the defect location. The microscopic pressure gradient field directly correlates the optical flow field in the image with the physical pressure field. Step S4.3: Input the microscopic pressure gradient field and instantaneous deformation rate as boundary conditions into the fluid dynamics inversion model to calculate the dynamic growth potential energy of the defect, which is used as the dynamic influence factor.
5. The method according to claim 4, characterized in that, In step S4.3, the dynamic growth potential energy is calculated as follows: it is obtained by weighted summation of the surface integral of the tensor intensity of the normal pressure gradient at the defect edge and the fluid velocity gradient, combined with the line integral of the boundary curvature, wherein the velocity gradient tensor intensity is defined as the square of the Frobenius norm of the velocity gradient tensor.
6. The method according to claim 5, characterized in that, Step S5 specifically includes the following steps: Step S5.1: Normalize the static geometric features and dynamic influence factors respectively; Step S5.2: Construct a comprehensive defect index. The index is obtained by using a nonlinear fusion model based on risk field theory, which is calculated from the normalized defect area, average defect width, maximum defect length, shape complexity index, and dynamic growth potential energy. Step S5.3: Based on the comparison between the calculated comprehensive defect index and the preset threshold, the defects are divided into different levels.
7. A water supply pipeline defect detection system based on image processing, used to implement the water supply pipeline defect detection method based on image processing as described in any one of claims 1-6, characterized in that, include: The image acquisition module is used to acquire raw images of the inner wall of the water supply pipe; The image preprocessing module, connected to the image acquisition module, is used to perform dehazing enhancement and dynamic distortion correction based on optical flow field on the original image, and output a standardized image. The defect screening module, connected to the image preprocessing module, is used to automatically identify and extract candidate defect regions from the standardized image; The feature extraction module, connected to the defect screening module, is used to extract the static geometric features of the defect candidate region; The dynamic analysis module, connected to the image acquisition module and the feature extraction module, is used to calculate the dynamic influence factor based on continuous frame images and pipeline operation parameters. The comprehensive evaluation module connects the feature extraction module and the dynamic analysis module. It is used to integrate static geometric features and dynamic influence factors, and output the defect level evaluation result by calculating the comprehensive defect index.
8. The system according to claim 7, characterized in that, The image preprocessing module includes: The dehazing enhancement unit is used to perform a dehazing algorithm based on an atmospheric scattering model and mean filtering. It estimates atmospheric light by dividing the image into grids, calculates local minima to estimate coarse transmittance, and uses mean filtering to smooth and optimize the transmittance. The distortion correction unit is used to correct the dehazed image using a dynamic distortion correction method based on optical flow field. By calculating the optical flow field between consecutive frames and quantifying the average optical flow amplitude, a correction matrix is dynamically constructed to correct the dynamic distortion caused by water flow impact, thus obtaining a standardized image.
9. The system according to claim 8, characterized in that, The defect screening module is built on an improved YOLOv8 network. The inverted residual moving module is integrated in the last four stages of the backbone network, and all standard convolutional layers and C2f modules in the neck network are replaced by GSConv and VoVGSCSP modules, respectively. The dynamic analysis module contains a fluid dynamics inversion unit, which is used to calculate the dynamic growth potential of the defect based on the normal pressure gradient and the fluid velocity gradient tensor intensity at the defect edge. The velocity gradient tensor intensity is defined as the square of the Frobenius norm of the velocity gradient tensor.
10. The system according to claim 9, characterized in that, The system also includes a data storage module for storing historical water pressure, flow velocity, and corresponding defect image data of the pipeline, in order to update and optimize the calculation weights of dynamic influence factors and comprehensive defect index.
Citation Information
Patent Citations
Cable identification method and system based on image processing
CN118628983A
Medical instrument intelligent defect detection method and system based on image processing
CN121481986A
Drainage pipe network defect detection method based on data optimization and multi-model fusion
CN121504892A
Pipeline defect positioning method, device, equipment, medium and product
CN121837269A
Defect depth estimation from borescope imagery
US20250218017A1