Inspection and Defect Recognition Method for Water Supply Pipe Networks Based on Image Processing Technology
Through the combination of multi-spectral imaging and deep learning, efficient inspection and defect identification of the water supply pipeline network are achieved, and the problems of low detection efficiency and inaccurate defect identification in the existing technology are solved. A three-dimensional visual distribution map of the healthy status of the pipeline network is generated, which improves the detection accuracy and visualization effect.
Patent Information
- Application Number
- CN202510435540.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-04-09
AI Technical Summary
The existing water supply pipeline inspection technology relies on manual inspection or simple equipment monitoring, with low detection efficiency and high leakage detection rate, making it difficult to accurately identify pipeline defects, especially poor image quality under the influence of pipeline material and lighting, lack effective feature extraction and defect identification methods, and traditional methods fail to combine the three-dimensional structural information of pipelines.
Multi-spectral imaging device is used to collect multi-band image data, and enhance images are generated through adaptive light compensation algorithms. Artifacts are eliminated by combining geometric constraint edge detection and adaptive dual-threshold algorithms, expanded into two-dimensional planes and grid-based divisions, perform multi-dimensional feature fusion, use deep learning models to classify defects, and generate healthy state distribution maps with spatial coordinate mapping.
It improves the efficiency and accuracy of pipeline inspection, realizes three-dimensional visualization of pipeline health status, significantly improves the defect recognition rate, overcomes the impact of lighting changes and material differences, and provides an intuitive and accurate display of pipeline health status.
Smart Images

Figure CN119964012B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of image processing and intelligent detection, and in particular to a method for inspecting and defect-identifying water supply pipe networks based on image processing technology. Background Art
[0002] With the continuous acceleration of the urbanization process, as a core component of urban infrastructure, the safe operation and stability of water supply pipe networks are crucial for the normal operation of society; traditional inspections of water supply pipe networks mostly rely on manual detection or simple equipment monitoring, often suffering from problems such as low detection efficiency, high missed detection rate, and high maintenance costs; these problems not only affect the timely maintenance of pipe networks, but may also lead to sudden failures of pipe networks, and in severe cases, even cause unpredictable consequences such as water source pollution and pipe network paralysis; in addition, defects such as pipe corrosion, cracks, and deformation gradually accumulate during long-term operation, and their early identification and accurate positioning have become a major problem in pipe network management.
[0003] Although the continuous development of image processing technology, sensor technology, and artificial intelligence in recent years has, to a certain extent, improved the automation and intelligence levels of pipe network inspections, existing image processing technologies still face many challenges; in existing technologies, most pipe network inspections rely on single image information, making it difficult to comprehensively consider various factors such as pipe materials and lighting, resulting in poor image quality and a lack of effective feature extraction and defect identification means; in addition, traditional defect identification methods are usually limited to two-dimensional images and fail to combine the three-dimensional structure information of pipes, resulting in inaccurate quantification and efficient display of features such as the spatial distribution, depth, and size of defects. Summary of the Invention
[0004] Based on the above purposes, the present invention provides a method for inspecting and defect-identifying water supply pipe networks based on image processing technology.
[0005] A method for inspecting and defect-identifying water supply pipe networks based on image processing technology includes the following steps:
[0006] S1: Synchronously collect multi-band image data on the surface of the pipe network through a multi-spectral imaging device, and generate an enhanced image using an adaptive illumination compensation algorithm that combines the reflectance characteristics of materials.
[0007] S2: Perform edge detection under geometric constraints on the enhanced image, construct a spatial filtering window based on a preset pipe diameter parameter, and use an adaptive double-threshold algorithm to eliminate reflective artifacts, generating a mask image containing the coordinates of the pipe wall area.
[0008] S3: Extract the ROI area of the pipe wall based on the mask image, unfold the pipe wall surface into a two-dimensional plane through a curvature compensation algorithm for cylindrical projection, and perform grid division along the pipe axis according to equidistant detection units.
[0009] S4: Perform multi-dimensional feature fusion extraction on each detection unit to obtain a composite feature vector containing texture features, near-infrared reflection intensity, and geometric morphology features;
[0010] S5: Input the composite feature vector into a pre-trained defect classification model to output the defect type and quantization parameters with confidence;
[0011] S6: Generate a pipeline network health status distribution map with spatial coordinate mapping based on the defect recognition results of each detection unit.
[0012] Optionally, the S1 specifically includes:
[0013] S11: Synchronously collect multi-band image data of the pipeline network surface through a multi-spectral imaging device. The multi-spectral imaging device includes multiple band sensors for respectively obtaining image data in the visible light band, near-infrared band, and mid-infrared band;
[0014] S12: According to the spectral reflection characteristics of the pipeline material, combined with the reflectivity of each band of the multi-spectral image, calculate the reflectivity difference of each band image, and dynamically generate a compensation coefficient matrix based on the reflectivity difference of the pipeline material;
[0015] S13: Use the compensation coefficient matrix to fuse the multi-band images by using an adaptive light compensation algorithm to optimize the brightness and contrast of each band image to reduce the influence of different lighting conditions on the image quality.
[0016] Optionally, the S2 specifically includes:
[0017] S21: Perform edge detection on the enhanced image. The edge detection uses an improved Canny edge detection algorithm to analyze the gradient of the enhanced image by setting high and low thresholds to extract the edge information of the pipeline surface;
[0018] S22: Based on the preset diameter parameter of the pipeline, construct a spatial filtering window. The spatial filtering window adopts a circular structure to match the actual geometric shape of the pipeline;
[0019] S23: Eliminate the specular artifact through an adaptive dual-threshold algorithm, adjust the threshold according to the reflection intensity of different regions, optimize the edge detection result, and eliminate the false detection caused by the specular reflection on the pipeline surface;
[0020] S24: Generate a mask image containing the coordinates of the pipe wall area according to the edge detection result. The mask image forms a region by closing the edges of the detected pipe wall area and extracts the region coordinate information of the pipeline.
[0021] Optionally, the S23 specifically includes:
[0022] S231: Separate the reflection area of the image by analyzing the reflection intensity in the image. Let the reflection intensity be , and its calculation formula is: , where is the maximum light intensity value of each area in the image, is the minimum light intensity value of the corresponding area, is the reflection intensity of the corresponding area;
[0023] S232: Select different double-threshold strategies for region classification according to the reflection intensity of the image; specifically, set a high threshold and a low threshold , and dynamically adjust the threshold settings according to the reflection intensity;
[0024] S233: Identify the high-reflection area and low-reflection area in the image through the adaptive double-threshold strategy, and filter the reflective artifact area in the image according to the reflection intensity threshold range. Specifically, for the low-reflection area, retain it as the effective pipe wall area, and for the high-reflection area, determine it as a reflective artifact and then eliminate it.
[0025] Optionally, the specific steps of S3 include:
[0026] S31: Unroll the curved surface of the pipe wall into a two-dimensional plane through the curvature compensation algorithm of cylindrical projection; specifically, the three-dimensional coordinates of any point on the pipe surface are converted into the coordinates on the two-dimensional plane through the following formula , and the formula is: ; , where is the radius of the pipe, is the axial angle of the pipe surface point, is the height of the pipe point in the axial direction;
[0027] S32: Divide the detection units at equal intervals along the axial direction of the pipe according to the unrolled two-dimensional plane image. The equal interval is calculated according to the total length of the pipe and the predetermined number of detection units. The formula is: , where is the axial length of each detection unit, is the total length of the pipe, is the number of detection units.
[0028] Optionally, the specific steps of S4 include:
[0029] S41: Extract the texture features of the image area of each detection unit. The texture features are calculated through the gray-level co-occurrence matrix, and the statistics including energy, contrast, homogeneity, and entropy are extracted;
[0030] S42: Extract the near-infrared reflection intensity features from the image regions of each detection unit. The reflection intensity is obtained by calculating the average reflection value of each detection unit in the near-infrared band;
[0031] S43: Extract the geometric morphology features from the image regions of each detection unit. The geometric morphology features are shape features, including area, perimeter, and aspect ratio;
[0032] S44: Fuse the extracted texture features, near-infrared reflection intensity features, and geometric morphology features into a composite feature vector, which is obtained by weighted synthesis.
[0033] Optionally, the specific steps of S5 are as follows:
[0034] S51: Input the extracted composite feature vector into a pre-trained defect classification model. The defect classification model is a convolutional neural network model based on deep learning, and its feature extraction ability is improved by embedding a channel attention mechanism;
[0035] S52: Normalize the composite feature vector to ensure that each feature has the same scale when input into the model. Subtract the mean value of each dimension feature value in the composite feature vector and divide it by the standard deviation to obtain the normalized feature value;
[0036] S53: Input the normalized composite feature vector into the pre-trained defect classification model, and perform feature extraction and classification through convolutional layers and fully connected layers. Finally, output the confidence values of each potential defect;
[0037] S54: According to the classification results, output the defect types with confidence and quantization parameters. The defect types include cracks, corrosion, and deformation, and the quantization parameters include the specific size, depth, and length of the defects.
[0038] Optionally, the specific steps of S51 are as follows:
[0039] S511: Improve the feature extraction ability of the defect classification model by embedding a channel attention mechanism. Specifically, after each convolutional layer of the convolutional neural network, use global average pooling operation to calculate the global information description of each channel. The formula is: , where, is the global description value of the th channel, is the th channel at position feature value, and are the height and width of the feature map respectively;
[0040] S512: Perform a linear transformation on the global information description value, and generate channel attention coefficients through a fully connected layer. The calculation formula is: , where is the channel attention coefficient, is the activation function, is the weight matrix of the fully connected layer, is the bias term, is the global description value;
[0041] S513: Perform a per-channel multiplication operation on the channel attention coefficient and the original feature map to generate a weighted feature map. The formula is: , where is the -th channel feature map after weighting, is the -th channel attention coefficient, is the -th channel original feature map.
[0042] Optionally, the S53 specifically includes:
[0043] S531: Input the normalized composite feature vector into a pre-trained defect classification model. The defect classification model includes multiple convolutional layers and fully connected layers, and performs feature extraction through the convolutional layers;
[0044] S532: After multiple convolutional operations, perform dimensionality reduction on the feature map through a pooling layer;
[0045] S533: Input the pooled feature map into a fully connected layer, and perform weighted summation on each feature through a weight matrix;
[0046] S534: After being processed by the fully connected layer, output a vector representing each potential defect category. Each element in the vector represents the confidence value of a certain defect category, and calculate the probability of each defect type through the Softmax activation function. The formula is: , where is the probability of the -th type of defect, is the prediction score of the -th type of defect, is the exponential function of the score, represents the index of all potential defect categories; represents the -th prediction score output for the defect category. The Softmax function converts the scores of all categories into probabilities, and the sum of the probability values is 1, thereby outputting a confidence value for each defect type;
[0047] S535: By sorting the confidence values of each potential defect category, the defect type with the highest confidence and its corresponding confidence value are finally output.
[0048] Optionally, the S6 specifically includes:
[0049] S61: According to the defect recognition results of each detection unit, a preliminary data model of the pipeline network health status is constructed. Each detection unit corresponds to a three-dimensional space coordinate, indicating its specific position in the pipeline;
[0050] S62: Map the defect recognition result of each detection unit to its corresponding three-dimensional space coordinate to generate a defect data point for each detection unit. Each data point contains quantization information on the defect type, size, depth, and length of the defect, as well as its spatial coordinate information in the pipeline;
[0051] S63: According to the data points of all detection units, perform spatial smoothing processing on the defect data through a spatial interpolation method to obtain the continuous distribution of the pipeline network health status in space;
[0052] S64: Based on the interpolated data, use visualization technology to map the pipeline network health status data into a three-dimensional coordinate system to generate a pipeline network health status distribution map; at the same time, intuitively display the severity of the defect by color. Specifically, severe defects are represented by red, no defects are represented by green, and minor defects are represented by yellow.
[0053] Advantages of the present invention:
[0054] In the present invention, by combining multi-spectral imaging technology and a deep learning model, efficient inspection and defect recognition of the water supply pipeline network are achieved; through the synchronous acquisition of multi-band images and an adaptive light compensation algorithm, the image quality can be effectively improved, overcoming the influence of factors such as light changes and material differences on image processing, and ensuring the accuracy of defect recognition; at the same time, by adopting a multi-dimensional feature fusion extraction technology, combining texture features, near-infrared reflection intensity, and geometric morphology features, the recognition rate of pipeline defects is significantly improved.
[0055] In the present invention, by constructing a pipeline network health status distribution map with spatial coordinate mapping, the limitation of traditional two-dimensional image analysis is broken through, and three-dimensional visualization display of the pipeline network health status is realized; combined with spatial interpolation technology, the detection blind area is filled and the health status distribution map is optimized, so that the spatial distribution, severity, and position of the defect can be presented more intuitively and accurately. Description of the Drawings
[0056] To more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only those of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0057] Figure 1 Schematic diagram of the water supply network inspection and defect identification method according to an embodiment of the present invention;
[0058] Figure 2 Schematic diagram of the method for generating the distribution map of the health status of the pipe network according to an embodiment of the present invention. Detailed implementation manners
[0059] The present invention will be described in detail below in conjunction with the drawings and specific embodiments. At the same time, it should be noted here that in order to make the embodiments more detailed, the following embodiments are the best and preferred embodiments. For some well-known technologies, those skilled in the art can also adopt other alternative methods for implementation; moreover, the drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0060] It should be pointed out that in the specification, when referring to "an embodiment", "embodiment", "exemplary embodiment", "some embodiments", etc., it is indicated that the described embodiments may include specific features, structures or characteristics, but not necessarily every embodiment includes such specific features, structures or characteristics. In addition, when combining embodiments to describe specific features, structures or characteristics, implementing such features, structures or characteristics in combination with other embodiments (whether explicitly described or not) should be within the knowledge of those skilled in the relevant art.
[0061] Generally, the terms can be understood at least in part from their use in the context. For example, at least in part depending on the context, the term "one or more" used herein can be used to describe any feature, structure or characteristic in a singular sense, or can be used to describe a combination of features, structures or characteristics in a plural sense. In addition, the term "based on" can be understood as not necessarily intended to convey a set of exclusive factors, but instead, at least in part depending on the context, allowing the existence of other factors that are not necessarily explicitly described.
[0062] As Figure 1 - Figure 2 shown, the water supply network inspection and defect identification method based on image processing technology includes the following steps:
[0063] S1: Synchronously collect multi-band image data on the surface of the pipe network through a multi-spectral imaging device, and generate an enhanced image by using an adaptive illumination compensation algorithm that fuses the reflectance characteristics of materials;
[0064] S2: Perform edge detection on the enhanced image under geometric constraints, construct a spatial filtering window based on the preset pipeline diameter parameter, adopt an adaptive double-threshold algorithm to eliminate the specular artifact, and generate a mask image containing the coordinates of the pipe wall area;
[0065] S3: Extract the ROI area of the pipe wall based on the mask image, unfold the pipe wall surface into a two-dimensional plane through the curvature compensation algorithm of cylindrical projection, and perform grid division along the pipe axis according to equal-distance detection units;
[0066] S4: Perform multi-dimensional feature fusion extraction on each detection unit to obtain a composite feature vector containing texture features, near-infrared reflection intensity, and geometric morphology features;
[0067] S5: Input the composite feature vector into a pre-trained defect classification model, output the defect type and quantization parameters with confidence, and the defect classification model improves the feature extraction ability by embedding a channel attention mechanism;
[0068] S6: Generate a pipeline network health status distribution map with spatial coordinate mapping according to the defect recognition results of each detection unit.
[0069] S1 specifically includes:
[0070] S11: Synchronously collect multi-band image data of the pipeline network surface through a multi-spectral imaging device. The multi-spectral imaging device includes multiple band sensors for respectively acquiring image data in the visible light band, near-infrared band, and mid-infrared band; the acquisition frequencies and resolutions of each band sensor are matched to ensure the synchronous acquisition of data in different bands and the consistency of image quality;
[0071] S12: According to the spectral reflection characteristics of the pipeline material, combined with the reflectance of each band of the multi-spectral image, calculate the reflectance difference of each band image, and dynamically generate a compensation coefficient matrix based on the reflectance difference of the pipeline material; the calculation formula for the reflectance difference is: , where is the reflectance difference of the b-th band image, is the actual reflectance of the b-th band, is the reflectance of the reference band; by calculating the reflectance differences of all bands, generate a compensation coefficient matrix C, whose elements are the adjustment coefficients of each band, reflecting the illumination compensation requirements of different bands; for each band , its compensation coefficient is calculated through the following formula: , where is the total number of bands;
[0072] S13: Using the compensation coefficient matrix, perform fusion on the multi-band images with the adaptive illumination compensation algorithm to optimize the brightness and contrast of each band image, so as to reduce the impact of different illumination conditions on the image quality; the adaptive illumination compensation formula is: , where, is the original image intensity of the b-th band, is the compensation coefficient of the b-th band, is the image intensity after compensation, and are the minimum and maximum values of the b-th band image respectively. Through the above formula, adjust the brightness and contrast of each band image to make the overall illumination of the image balanced and reduce the impact of different illumination conditions on the image quality;
[0073] In the above steps, the multi-spectral imaging device synchronously collects multi-band image data on the surface of the pipeline network, and combines the material reflectivity differences to generate a compensation coefficient matrix, and implements the adaptive illumination compensation algorithm, which can significantly improve the image quality under different illumination conditions. This technology can eliminate the image distortion problem caused by uneven illumination, thus ensuring the subsequent defect recognition accuracy.
[0074] S2 specifically includes:
[0075] S21: Perform edge detection on the enhanced image. The edge detection uses an improved Canny edge detection algorithm to analyze the gradient of the enhanced image by setting high and low thresholds to extract the edge information on the surface of the pipeline;
[0076] S22: Based on the preset diameter parameter of the pipeline, construct a spatial filtering window. The spatial filtering window adopts a circular structure to match the actual geometric shape of the pipeline; this spatial filtering window is used to further smooth the image and filter out noise to ensure the accuracy of edge extraction; let the radius of the spatial filtering window be , and its calculation formula is: , where, is the preset pipeline diameter parameter, is the radius of the filtering window. Through this formula, ensure that the size of the filtering window is consistent with the actual size of the pipeline, so as to better match the geometric shape of the pipeline;
[0077] S23: Eliminate the specular artifacts through the adaptive dual-threshold algorithm, adjust the threshold according to the reflection intensity in different regions, optimize the edge detection results, and eliminate the false detection caused by the specular reflection on the surface of the pipeline;
[0078] S23: Eliminate the specular artifacts through the adaptive dual-threshold algorithm, adjust the threshold according to the reflection intensity in different regions, optimize the edge detection results, and eliminate the false detection caused by the specular reflection on the surface of the pipeline;
[0079] S24: Generate a mask image containing the coordinates of the pipe wall area according to the edge detection result. The mask image forms a region by enclosing the detected edges of the pipe wall area and extracts the regional coordinate information of the pipeline, providing an accurate ROI (Region of Interest) area for subsequent processing. Through the improved Canny edge detection algorithm, the above steps can effectively extract the surface edge information of the pipeline, and by dynamically adjusting the high and low thresholds, the edge detection can adapt to the characteristics of different images, improving the accuracy of edge extraction. The introduction of the spatial filtering window further ensures the smoothness and accuracy of edge extraction, while the application of the adaptive double-threshold algorithm effectively eliminates the influence of reflection artifacts on the image quality. The finally generated mask image provides the accurate pipe wall area coordinates for subsequent pipeline defect recognition.
[0080] S23 specifically includes:
[0081] S231: Separate the reflection area of the image by analyzing the reflection intensity in the image. Let the reflection intensity be , and its calculation formula is: , where is the maximum light intensity value of each area in the image, is the minimum light intensity value of the corresponding area, is the reflection intensity of the corresponding area;
[0082] S232: Select different double-threshold strategies for region classification according to the reflection intensity of the image. Specifically, set the high threshold and the low threshold , and dynamically adjust the threshold settings according to the reflection intensity. The calculation formulas for the high threshold and the low threshold are: ; , where is the mean value of the image reflection intensity, is the standard deviation of the reflection intensity, and are adjustment coefficients used to flexibly adjust the high and low threshold ranges to enable them to adapt to the reflection intensity characteristics of different regions;
[0083] S233: Identify the high-reflection areas and low-reflection areas in the image through an adaptive dual-threshold strategy, and filter the specular artifact areas in the image according to the reflection intensity threshold range. Specifically, for the low-reflection areas, retain them as effective pipe wall areas, while for the high-reflection areas, determine them as specular artifacts and then eliminate them. Through the above steps, the adaptive dual-threshold algorithm can dynamically adjust the threshold according to the reflection intensity of different areas, accurately identify and eliminate the specular artifacts in the image. This method can effectively distinguish the effective areas on the pipe surface and the specular artifact areas caused by light, ensuring that the edge extraction process is not interfered by artifacts and improving the accuracy of pipe defect detection.
[0084] S3 specifically includes:
[0085] S31: Through the curvature compensation algorithm of cylindrical projection, unfold the curved surface of the pipe wall into a two-dimensional plane. The cylindrical projection algorithm calculates according to the radius of the pipe and the axial angle of the pipe to obtain the two-dimensional coordinate positions of each point on the pipe wall. Specifically, the three-dimensional coordinates of any point on the pipe surface are converted into coordinates on the two-dimensional plane through the following formula , and the formula is: ; , where is the radius of the pipe, is the axial angle of the point on the pipe surface, is the height of the pipe point in the axial direction. Through this formula, the pipe surface is unfolded into a two-dimensional plane, thus avoiding the deformation error caused by the pipe curvature;
[0086] S32: According to the unfolded two-dimensional plane image, divide the detection units at equal interval along the axial direction of the pipe. The equal interval is calculated according to the total length of the pipe and the predetermined number of detection units. The formula is: , where is the axial length of each detection unit, is the total length of the pipe, is the number of detection units. Through this formula, the pipe is evenly divided into several detection units along the axial direction to ensure that each unit can be accurately detected. By taking the two-dimensional area of each divided detection unit as the basic unit of analysis and further processing according to the texture features, reflection intensity and geometric morphological features of each unit, it provides efficient area division and accurate data support for defect identification.
[0087] S4 specifically includes:
[0088] S41: Extract the texture features from the image regions of each detection unit. The texture features are calculated through the Gray-Level Co-occurrence Matrix (GLCM), and statistics including energy, contrast, homogeneity, and entropy are extracted. The formulas are as follows: ; ; ; , where is an element of the gray-level co-occurrence matrix, and are the gray values of different pixels in the image. The statistics are used to describe the texture distribution characteristics of the image region;
[0089] S42: Extract the near-infrared reflection intensity features from the image regions of each detection unit. The reflection intensity is obtained by calculating the average reflection value of each detection unit in the near-infrared band. The calculation formula is: , where is the reflection intensity value in the near-infrared band of the th detection unit, is the number of pixel points in this detection unit, is the average reflection intensity of this region. This feature is used to capture the illumination features of the pipeline surface and help distinguish pipeline surfaces of different materials or damage degrees;
[0090] S43: Extract the geometric morphological features from the image regions of each detection unit. The geometric morphological features are shape features, including area, perimeter, and aspect ratio. The specific calculation formulas are: ; ; ; where are the coordinates of the th point in the image, is the area of the detection unit, is the boundary length of the corresponding region, is the aspect ratio of the region, refers to the length of the major axis in the best-fit ellipse of the fitting region, representing the maximum size of the region; refers to the length of the minor axis in the best-fit ellipse of the fitting region, representing the minimum size of the region. These features are used to describe the geometric morphological information of the detection unit and help further judge whether there are defects on the pipeline surface;
[0091] S44: Fuse the extracted texture features, near-infrared reflection intensity features, and geometric morphological features into a composite feature vector. The composite feature vector is obtained through weighted synthesis. The calculation formula is:
[0092] , where is the composite feature vector, is the texture feature vector, is the near-infrared reflection intensity feature vector, is the geometric morphology feature vector, are the weighted coefficients of each feature, and the weighted coefficients are set according to the contribution of each feature to defect recognition; through multi-dimensional feature fusion for each detection unit in the above steps, the texture feature, near-infrared reflection intensity feature, and geometric morphology feature can be fully utilized to comprehensively analyze the pipeline surface from multiple perspectives. The weighted fusion of each feature not only enhances the defect recognition ability but also improves the sensitivity to different materials and damage degrees.
[0093] S5 specifically includes:
[0094] S51: Input the extracted composite feature vector into a pre-trained defect classification model. The defect classification model is a convolutional neural network (CNN) model based on deep learning. This defect classification model improves the feature extraction ability by embedding a channel attention mechanism. This defect classification model has been trained on a large amount of labeled data, can identify various types of pipeline defects, and can map the composite features to the corresponding defect categories;
[0095] S52: Normalize the composite feature vector to ensure that each feature has the same scale when input into the model. Subtract the mean value of each dimension feature value in the composite feature vector and divide by the standard deviation to obtain the normalized feature value. The normalized composite feature vector can improve the stability and convergence speed of model training;
[0096] S53: Input the normalized composite feature vector into the pre-trained defect classification model, perform feature extraction and classification through convolutional layers and fully connected layers, and finally output the confidence value of each potential defect. This confidence value represents the prediction credibility of the model for a certain defect type, and the numerical range is usually from 0 to 1;
[0097] S54: According to the classification result, output the defect type with confidence and quantization parameters. The defect types include cracks, corrosion, and deformation, and the quantization parameters include the specific size, depth, and length of the defect. This output result provides accurate data support for subsequent pipeline network health status analysis; through the above steps of inputting the composite feature vector into the pre-trained defect classification model, the defects of the pipeline can be efficiently classified and quantitatively analyzed. The normalization process ensures that the contributions of different features to the model input are relatively balanced, improving the stability and prediction accuracy of the model. The output result with confidence not only provides the defect type but also provides quantization parameters for the severity and influence range of the defect, making the pipeline network inspection more accurate and efficient.
[0098] S51 specifically includes:
[0099] S511: Improve the feature extraction ability of the defect classification model by embedding the Channel Attention Mechanism (CAM). The channel attention mechanism is used to dynamically adjust the weights of each feature channel to enhance the attention to key features. Specifically, after each convolutional layer in the convolutional neural network, use the Global Average Pooling (GAP) operation to calculate the global information description of each channel. The formula is: , where is the global description value of the -th channel, is the -th channel's feature value at position , and are the height and width of the feature map respectively. This step extracts the global information features of each channel by performing global average pooling on each channel.
[0100] S512: Perform a linear transformation on the global information description value, and generate channel attention coefficients through a fully connected layer. The calculation formula is: , where is the channel attention coefficient, is the activation function (usually the Sigmoid function), is the weight matrix of the fully connected layer, is the bias term, is the global description value. This operation converts the global information into the weight coefficients of each channel to control the attention of each channel.
[0101] S513: Perform a per-channel multiplication operation on the channel attention coefficients and the original feature map to generate a weighted feature map. The formula is: , where is the weighted -th channel feature map, is the attention coefficient of the -th channel, is the -th channel's original feature map. This operation enhances the network's attention to important features by adjusting the weights of each channel. Finally, perform subsequent convolutional operations and fully connected layer processing on the weighted feature map of the channel attention mechanism to optimize the feature extraction process and improve the defect classification model's ability to identify different types of defects. The above steps can dynamically adjust the weights of each channel by embedding the channel attention mechanism, thereby enhancing the ability to extract key features.
[0102] S53 specifically includes:
[0103] S531: Input the normalized composite feature vector into a pre-trained defect classification model. The defect classification model includes multiple convolutional layers and fully-connected layers. Feature extraction is performed through the convolutional layers. Specifically, each convolutional layer uses a set of convolutional kernels (filters) to perform convolution operations on the input features. The convolution formula is: , where is the value at the position of the output feature map, is the value in the corresponding area of the input feature map, is the th value of the convolutional kernel. In this way, the convolutional layer extracts the local feature information in the feature map;
[0104] S532: After multiple convolution operations, the feature map is dimensionally reduced through a pooling layer (such as max pooling or average pooling). The calculation formula for the max pooling operation is: , where is the pooled feature value. The pooling operation helps to retain the main information in the features while reducing the computational amount;
[0105] S533: Input the pooled feature map into the fully-connected layer for high-level feature combination and classification operations. The fully-connected layer performs weighted summation on each feature through a weight matrix. The formula is: , where is the pooled feature vector, is the weight matrix of the fully-connected layer, is the bias term, is the output of the fully-connected layer. The role of the fully-connected layer is to map low-level features to high-level representations and make classification decisions;
[0106] S534: After being processed by the fully-connected layer, output a vector representing each potential defect category. Each element in the vector represents the confidence value of a certain defect category, and the probability of each defect type is calculated through the Softmax activation function. The formula is: , where is the probability of the th type of defect, is the predicted score of the th type of defect, is the exponential function of the score, represents the indices of all potential defect categories; represents the predicted score output for the th defect category. The Softmax function converts the scores of all categories into probabilities, and the sum of the probability values is 1, thereby outputting a confidence value for each defect type;
[0107] S535: By sorting the confidence values of each potential defect category, the defect type with the highest confidence and its corresponding confidence value are finally output; through the multi-level processing of the convolutional layer and the fully connected layer in the above steps, the defect classification model can extract multi-level features from low-level to high-level, further enhancing the model's recognition ability; the convolutional operation effectively captures the local features of the image, while the pooling operation helps reduce unnecessary calculations and improves the robustness of feature representation; the confidence values output by the Softmax function enable the model to give the credibility of the defect type in the form of probability, providing a more accurate and reliable classification result.
[0108] S6 specifically includes:
[0109] S61: According to the defect recognition results of each detection unit, a preliminary data model of the pipeline network health status is constructed. Each detection unit corresponds to a three-dimensional space coordinate, indicating its specific position in the pipeline.
[0110] S62: Map the defect recognition result of each detection unit to its corresponding three-dimensional space coordinate to generate the defect data point of each detection unit. Each data point contains the defect type (such as crack, corrosion or deformation), the quantified information of the size, depth and length of the defect, as well as the spatial coordinate information in the pipeline.
[0111] S63: According to the data points of all detection units, perform spatial smoothing processing on the defect data through spatial interpolation methods to obtain the continuous distribution of the pipeline network health status in space. Specifically, a three-dimensional Gaussian smoothing algorithm or an interpolation algorithm, such as nearest neighbor interpolation, bilinear interpolation, etc., can be used to fill the missing data in the undetected area to smooth and optimize the health status distribution map.
[0112] S64: Based on the interpolated data, use visualization technology to map the pipeline network health status data into a three-dimensional coordinate system to generate a pipeline network health status distribution map, which is used to display the defect distribution at each position in the pipeline and mark the defect type, position and severity; at the same time, the severity of the defect is intuitively displayed by color. Specifically, severe defects are represented by red, no defects are represented by green, and minor defects are represented by yellow; the pipeline network health status distribution map generated through the above steps of spatial coordinate mapping can intuitively display the defect conditions at each position in the pipeline network; combined with spatial interpolation technology, the undetected areas can be supplemented and optimized, improving the comprehensiveness and accuracy of pipeline network health status analysis; this distribution map can provide intuitive and accurate data support for the maintenance and repair of the pipeline network, enabling managers to quickly make scientific and reasonable decisions based on the graphical results and improving the efficiency of pipeline network inspection.
[0113] The present invention encompasses any alternatives, modifications, equivalent methods, and solutions that are made within the spirit and scope of the present invention. For the purpose of enabling the public to have a thorough understanding of the present invention, specific details are described in detail in the following preferred embodiments of the present invention. However, those skilled in the art can fully understand the present invention even without the description of these details. Additionally, well-known methods, processes, procedures, components, and circuits are not described in detail to avoid unnecessary confusion with the essence of the present invention.
[0114] The above description is only a preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A method for inspecting water supply pipe networks and identifying defects based on image processing technology, characterized in that, It includes the following steps: S1: Synchronously collect multi-band image data of the pipe network surface through a multi-spectral imaging device, and generate an enhanced image by using an adaptive illumination compensation algorithm that integrates the reflectance characteristics of the material; S2: Perform edge detection under geometric constraints on the enhanced image, construct a spatial filtering window based on the preset pipe diameter parameter, and use an adaptive double-threshold algorithm to eliminate specular artifacts, generating a mask image containing the coordinates of the pipe wall area; S3: Extract the ROI area of the pipe wall based on the mask image, unfold the pipe wall surface into a two-dimensional plane through a curvature compensation algorithm for cylindrical projection, and perform grid division along the pipe axis according to equal-distance detection units; S4: Perform multi-dimensional feature fusion extraction on each detection unit to obtain a composite feature vector containing texture features, near-infrared reflection intensity, and geometric morphology features; S5: Input the composite feature vector into a pre-trained defect classification model, and output the defect type and quantization parameters with confidence; S6: Generate a pipe network health status distribution map with spatial coordinate mapping according to the defect recognition results of each detection unit.
2. The method for inspection and defect recognition of water supply pipe networks based on image processing technology according to claim 1, characterized in that, The specific content of S1 includes: S11: Synchronously collect multi-band image data of the pipe network surface through a multi-spectral imaging device. The multi-spectral imaging device includes multiple band sensors for respectively obtaining image data in the visible light band, near-infrared band, and mid-infrared band; S12: According to the spectral reflection characteristics of the pipe material, combined with the reflectance of each band of the multi-spectral image, calculate the reflectance difference of each band image, and dynamically generate a compensation coefficient matrix based on the reflectance difference of the pipe material; S13: Use the compensation coefficient matrix to fuse the multi-band image by using an adaptive illumination compensation algorithm, optimize the brightness and contrast of each band image to reduce the influence of different illumination conditions on the image quality.
3. The method for inspection and defect recognition of water supply pipe networks based on image processing technology according to claim 1, characterized in that, The specific content of S2 includes: S21: Perform edge detection on the enhanced image. The edge detection uses an improved Canny edge detection algorithm to analyze the gradient of the enhanced image by setting high and low thresholds to extract the edge information of the pipe surface; S22: Based on the preset diameter parameter of the pipe, construct a spatial filtering window. The spatial filtering window adopts a circular structure to match the actual geometric shape of the pipe; S23: Eliminate specular artifacts through an adaptive double-threshold algorithm, adjust the threshold according to the reflection intensity of different regions, optimize the edge detection result, and eliminate false detections caused by specular reflection on the pipe surface; S24: According to the edge detection result, generate a mask image containing the coordinates of the pipe wall area. The mask image forms a region by closing the detected edge of the pipe wall area and extracts the region coordinate information of the pipe.
4. The method for inspection and defect recognition of water supply pipe networks based on image processing technology according to claim 3, characterized in that, The specific content of S23 includes: S231: Separate the reflection area of the image by analyzing the reflection intensity in the image. Let the reflection intensity be , and its calculation formula is: , where is the maximum light intensity value of each area in the image, is the minimum light intensity value of the corresponding area, is the reflection intensity of the corresponding area; S232: Select different dual-threshold strategies for region classification according to the reflection intensity of the image; specifically, set a high threshold and a low threshold , and dynamically adjust the setting of the threshold according to the reflection intensity; S233: Through an adaptive double-threshold strategy, identify the high-reflection area and low-reflection area in the image, and filter the specular artifact area in the image according to the reflection intensity threshold range. Specifically, for the low-reflection area, it is retained as the effective pipe wall area, while for the high-reflection area, it is determined as a specular artifact and then eliminated.
5. The method for inspection and defect recognition of water supply pipe networks based on image processing technology according to claim 1, characterized in that, The specific content of S3 includes: S31: Unfold the curved surface of the pipe wall into a two-dimensional plane through the curvature compensation algorithm of cylindrical projection; specifically, the three-dimensional coordinates of any point on the pipe surface are converted into the coordinates on the two-dimensional plane through the following formula , and the formula is: ; , where is the radius of the pipe, is the axial angle of the point on the pipe surface, is the height of the pipe point in the axial direction; S32: Divide the detection units at equal interval along the axial direction of the pipeline according to the expanded two-dimensional plane image. The equal interval is calculated based on the total length of the pipeline and the predetermined number of detection units, and the formula is: , where is the axial length of each detection unit, is the total length of the pipeline, is the number of detection units.
6. The method for inspection and defect recognition of water supply pipe networks based on image processing technology according to claim 1, characterized in that The specific content of S4 includes: S41: Extract texture features from the image regions of each detection unit. The texture features are calculated through a gray-level co-occurrence matrix, and statistics including energy, contrast, homogeneity, and entropy are extracted. S42: Extract near-infrared reflection intensity features from the image regions of each detection unit. The reflection intensity is obtained by calculating the average reflection value of each detection unit in the near-infrared band. S43: Extract geometric morphological features from the image regions of each detection unit. The geometric morphological features are shape features, including area, perimeter, and aspect ratio. S44: Fuse the extracted texture features, near-infrared reflection intensity features, and geometric morphological features into a composite feature vector, which is obtained by weighted synthesis.
7. The method for inspection and defect recognition of water supply pipe networks based on image processing technology according to claim 1, wherein The specific steps of S5 are as follows: S51: Input the extracted composite feature vector into a pre-trained defect classification model. The defect classification model is a convolutional neural network model based on deep learning, and its feature extraction ability is improved by embedding a channel attention mechanism. S52: Perform normalization processing on the composite feature vector to ensure that each feature has the same scale when input into the model. Subtract the mean value of each dimension feature value in the composite feature vector and divide it by the standard deviation to obtain the normalized feature value. S53: Input the normalized composite feature vector into the pre-trained defect classification model, and perform feature extraction and classification through convolutional layers and fully connected layers. Finally, output the confidence values of each potential defect. S54: According to the classification results, output the defect type with confidence and quantization parameters. The defect types include cracks, corrosion, and deformation, and the quantization parameters include the specific size, depth, and length of the defects.
8. The method for inspection and defect identification of water supply pipe networks based on image processing technology according to claim 7, characterized in that, The specific steps of S51 are as follows: S511: Improve the feature extraction ability of the defect classification model by embedding a channel attention mechanism; specifically, after each convolutional layer of the convolutional neural network, use global average pooling operation to calculate the global information description of each channel, and the formula is: , where is the global description value of the -th channel, is the feature value of the -th channel at position , and are the height and width of the feature map respectively; S512: Perform a linear transformation on the global information description value, and generate channel attention coefficients through a fully connected layer. The calculation formula is: , where is the channel attention coefficient, is the activation function, is the weight matrix of the fully connected layer, is the bias term, is the global description value; S513: Perform a per-channel multiplication operation on the channel attention coefficient and the original feature map to generate a weighted feature map. The formula is: , where is the weighted -th channel feature map, is the attention coefficient of the -th channel, is the original feature map of the -th channel.
9. The method for inspection and defect recognition of water supply pipe networks based on image processing technology according to claim 8, wherein The specific steps of S53 are as follows: S531: Input the normalized composite feature vector into the pre-trained defect classification model. The defect classification model includes multiple convolutional layers and fully connected layers, and feature extraction is performed through convolutional layers. S532: After multiple convolutional operations, perform dimensionality reduction on the feature map through a pooling layer. S533: Input the pooled feature map into the fully connected layer, and perform weighted summation on each feature through a weight matrix. S534: After being processed by the fully connected layer, a vector representing each potential defect category is output. Each element in the vector represents the confidence value of a certain defect category, and the probability of each defect type is calculated through the Softmax activation function. The formula is: , where is the probability of the -th type of defect, is the predicted score of the -th type of defect, is the exponential function of the score, represents the indices of all potential defect categories; represents the predicted score output for the -th defect category. The Softmax function converts the scores of all categories into probabilities, and the sum of the probability values is 1, thereby outputting a confidence value for each defect type; S535: Sort the confidence values of each potential defect category, and finally output the defect type with the highest confidence and its corresponding confidence value.
10. The method for inspecting and defect-identifying a water supply pipeline network based on image processing technology according to claim 1, wherein, The specific steps of S6 are as follows: S61: According to the defect identification results of each detection unit, construct a preliminary data model of the pipeline network health status. Each detection unit corresponds to a three-dimensional space coordinate, indicating its specific position in the pipeline. S62: Map the defect identification result of each detection unit to its corresponding three-dimensional space coordinate to generate a defect data point for each detection unit. Each data point contains quantization information on the defect type, size, depth, and length of the defect, as well as its spatial coordinate information in the pipeline. S63: According to the data points of all detection units, perform spatial smoothing processing on the defect data through a spatial interpolation method to obtain the continuous distribution of the pipeline network health status in space. S64: Based on the interpolated data, the visualization technology is used to map the pipeline network health status data into a three-dimensional coordinate system to generate a pipeline network health status distribution map; meanwhile, the severity of the defects is visually displayed by color. Specifically, severe defects are represented by red, no defects are represented by green, and minor defects are represented by yellow.
Citation Information
Patent Citations
Method for detecting pipeline defects based on three-dimensional data points acquired through circle structured light vision detection
CN102565081A
Intelligent pipeline defect detection method and system
CN112944105A