Pipeline water leakage automatic positioning method and system based on AI model
By employing a dual-model leak detection method based on AI models, combined with sound and image sensors, the problem of lag in pipeline leak detection is solved, enabling real-time, low-cost leak location and detection, and improving detection accuracy and environmental adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2026-04-07
AI Technical Summary
Current pipeline leak detection relies on manual inspection, which is costly and cannot achieve real-time detection, making it difficult to detect leaks in a timely manner and resulting in a lag.
A dual-model leak detection method based on AI models is adopted, which combines sound sensors and image sensors to establish pipe leak prediction models. The probability of leaks is calculated using image and audio data, and weighted optimization is performed under different environments to achieve accurate location.
It enables real-time, accurate location and low-cost detection of pipe leaks, reducing the impact of leaks on residents' lives and improving the accuracy and environmental adaptability of leak detection.
Smart Images

Figure CN121804769A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pipeline leakage detection technology, and in particular to an automatic pipeline leakage location method and system based on an AI model. Background Technology
[0002] Currently, pipe leak detection is still based on manual inspection, which is costly. Due to the large number of pipes, manual inspection cannot detect leaks in different pipe sections in real time. Often, the leak is only discovered when the leakage is very obvious and affects residents' lives. Therefore, the existing manual pipe leak detection method has an inherent lag, making it difficult to effectively prevent pipe leaks. Summary of the Invention
[0003] One objective of this invention is to provide an automatic pipeline leak location method and system based on an AI model. The method and system design a dual-model leak identification method, which uses an image detection-based pipeline leak identification model and a sound detection-based pipeline leak identification model. The probability of pipeline leaks is calculated for each of the two models, and the pipeline leaks of the two models are weighted and optimized according to rules under certain conditions. This results in a more accurate pipeline leak detection effect, making the dual-model pipeline leak identification mechanism of this invention more adaptable to different environments.
[0004] One of the objectives of this invention is to provide an automatic pipe leak location method and system based on an AI model. The method and system include a sound sensor and an image sensor, which are arranged at fixed intervals on or near the surface of the corresponding water pipe to perform image detection and sound detection respectively. Since both the sound sensor and the image sensor are fixedly set, the pipe location of the corresponding sensor can be known during communication, thereby realizing real-time and accurate location of the pipe leak after detection.
[0005] One of the objectives of this invention is to provide an automatic pipeline leak location method and system based on AI models. The method and system utilize two different AI models to significantly reduce the cost of pipeline leak detection while maintaining environmental adaptability. They can provide efficient prediction of the intensity and location of pipeline leaks, thereby enabling low-cost water pipe maintenance operations and reducing the impact of water pipe leaks on residents.
[0006] To achieve at least one of the above-mentioned objectives, the present invention further provides an automatic pipeline leakage location method based on an AI model, the method comprising:
[0007] The water pipe spacing configuration includes a sound sensor and an image sensor, wherein the sound sensor and the image sensor are arranged in pairs to detect audio data and image data of the water pipe in the same area, respectively.
[0008] Establish a trained first pipe leakage prediction model and a second pipe leakage prediction model, and input the audio data of the corresponding pipe location into the trained first pipe leakage prediction model for prediction to obtain the first leakage prediction probability of the corresponding pipe location.
[0009] The image data is input into the trained second pipe leakage prediction model to obtain the second leakage prediction probability for the corresponding pipe location;
[0010] Set environmental matching rules, calculate the sum of the leakage prediction probabilities based on the first leakage prediction probability and the second leakage prediction probability respectively, set the corresponding sum of prediction probability threshold, and output the leakage detection result for the corresponding pipe location.
[0011] According to a preferred embodiment of the present invention, the first pipeline leakage prediction model is an audio prediction model. After the sound detection device detects the audio data, it converts the audio data into a Mel spectrum and inputs the Mel spectrum into the trained first pipeline leakage model, and outputs the first leakage prediction probability corresponding to the pipeline location.
[0012] According to another preferred embodiment of the present invention, the second pipeline leakage prediction model is an image prediction model. After the image detection device detects the image of the corresponding pipeline area, the image prediction model inputs the image into the second pipeline leakage prediction model and outputs the second leakage prediction probability of the corresponding pipeline area.
[0013] According to another preferred embodiment of the present invention, the first pipeline leakage prediction model includes any one or a combination of several of the following: Hidden Markov Model, Mel-spectral cepstral coefficient Model, Convolutional Neural Network, Gaussian Mixture Model, RBF Neural Network, and BP Neural Network.
[0014] According to another preferred embodiment of the present invention, the second pipeline leakage prediction model includes any one of the following target prediction models: R-CNN model, fast R-CNN model, SSD model and YOLO series model, or any one of the following deep learning models: convolutional neural network, recurrent neural network, generative adversarial network and reinforcement learning model.
[0015] According to another preferred embodiment of the present invention, the environment matching rule includes: acquiring an image of the current corresponding pipe region based on the image sensor, calculating the average grayscale value w0 of the image within the corresponding pipe, and setting a threshold range W for the stepped grayscale value of the detected image.n And for the threshold range W of the stepped grayscale value n Set different environmental weights σ respectively n When the detected average gray value inside the pipe is within the corresponding stepped threshold range W n When the time is right, extract the corresponding environmental weight σ. n The environmental weight σ serves as the second leakage prediction probability P in the second leakage prediction model. n The value range is the interval 0-1 including the endpoints.
[0016] According to another preferred embodiment of the present invention, when the environmental weight σ of the second leakage prediction probability P corresponding to the second leakage pipe prediction model of the image sensor is obtained... n Then, the environmental weight of the first leakage prediction probability Q of the first leakage prediction model was further calculated to be 1-σ. n Further calculation yields the corrected total leakage prediction probability F = P * σ n +Q*(1-σ n ).
[0017] According to another preferred embodiment of the present invention, the method includes: setting a total leakage prediction probability threshold Fs; if the current total leakage prediction probability F value is greater than the total leakage prediction probability threshold Fs, then outputting a leakage prediction judgment of the current pipeline area to the host computer; the host computer simultaneously obtains the pipeline location of the current leakage area based on the sound sensor and image sensor of the area.
[0018] To achieve at least one of the above-mentioned objectives, the present invention further provides an AI-based automatic pipeline leakage location system, wherein the system executes the above-mentioned AI-based automatic pipeline leakage location method.
[0019] To achieve at least one of the above-mentioned objectives, the present invention further provides a computer-readable storage medium storing a computer program that is executed by a processor to implement the above-mentioned AI model-based automatic pipeline leakage location method. Attached Figure Description
[0020] Figure 1 The diagram shown is a flowchart of an automatic pipeline leakage location method based on an AI model according to the present invention. Detailed Implementation
[0021] The following description is intended to disclose the present invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art. The basic principles of the invention defined in the following description can be applied to other embodiments, modifications, improvements, equivalents, and other technical solutions that do not depart from the spirit and scope of the invention.
[0022] It is understood that the term "a" should be understood as "at least one" or "one or more", that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple, and the term "a" should not be understood as a limitation on the number.
[0023] Please combine Figure 1This invention discloses an automatic pipe leakage location method and system based on an AI model. The method includes the following steps: First, a sound sensor is configured on the drainage pipe, which can be installed on the outer surface of the drainage pipe. Further, an image sensor, including but not limited to a camera, is installed in the pipe area corresponding to the sound sensor. The sound sensor is used to collect audio information from the pipe side, while the image sensor collects image information of the pipe. This invention configures a first pipe leakage prediction model and a second pipe leakage prediction model. The first pipe leakage prediction model is preferably a sound prediction model, used to detect and determine whether there is a leakage in the pipe. If there is dripping or other forms of leakage in the pipe, it will emit a sound with corresponding frequency characteristics. Therefore, the first pipe leakage prediction model based on the sound prediction model can be used to detect the location of a pipe that may be leaking. The second pipe leakage prediction model is preferably an image prediction model, used to detect whether there is a leakage in the corresponding pipe area image, thus allowing for visual judgment of whether the corresponding pipe area is leaking. Due to the different locations of the drainage pipes, some relatively exposed parts can be clearly captured in images, while others are relatively dark and cannot be clearly captured in images. Furthermore, due to the difference between day and night, the image areas captured for the corresponding pipe regions vary significantly. For pipes at night, without illumination, the captured images are completely black. Therefore, image prediction models face certain difficulties and errors in detecting pipe leaks under different environmental conditions. The first pipe leak prediction model based on audio prediction may be affected by non-dripping leak sounds, the sound of flowing water inside the pipe, and the sound of rainwater penetrating the pipe walls, creating numerous impurities that influence its prediction results. When a relatively clear image of the pipe region is available, the leak detection accuracy obtained using the second pipe leak prediction model is relatively higher. Therefore, this invention establishes prediction results using both the sound and image features of pipe leaks, calculates the pipe leak probability values for corresponding features under different leak prediction models, and optimizes the pipe leak prediction results of the two AI prediction models under different environmental conditions by setting different environmental rules, thereby obtaining leak prediction results more adaptable to different environmental conditions.
[0024] Specifically, this invention describes the establishment and training process of the first leaking pipe prediction model based on sound features as input features. The model can be constructed using any one or a combination of several of the following models: Hidden Markov Model, Mel-spectral cepstral coefficient model, convolutional neural network, Gaussian mixture model, RBF neural network, and BP neural network. Taking the convolutional neural network as an example, the model constructs an input layer, multiple convolutional layers, pooling layers, and fully connected layers, configuring weight parameters for each layer. These layers are then connected together using a specific connection method to form the convolutional neural network. The invention outputs the probability value of the presence of dripping water at the output layer of the convolutional neural network. The training method for the convolutional neural network (CNN) as the first leaking pipe model includes: collecting different leaking sounds from different pipes as a sample set; dividing the sample set into a training set and a test set; inputting the test set into the CNN model for training; obtaining a trained CNN model for detecting pipe leak probabilities after adjusting hyperparameters and training multiple times; further testing the training results of the CNN model using the test set; if the model training results on the test set meet the testing requirements, a first leak probability prediction model based on the CNN model is obtained. It should be noted that the leak probability calculation method in the above example is based on the category probability calculation at the output of the CNN model, i.e., the output is the probability of determining the leaking pipe category. It should also be noted that the above CNN model is only an example, and the invention is not limited to constructing the first leak probability prediction model of the invention using the example model.
[0025] This invention further describes the construction and training process of the second leakage probability prediction model: The second leakage probability prediction model is an image detection-based probability prediction model. This model can employ any target prediction model, including but not limited to: R-CNN, Fast R-CNN, SSD, and YOLO series models, or any deep learning model, including convolutional neural networks, recurrent neural networks, generative adversarial networks, and reinforcement learning models. For example, a YOLO model can be used to construct a prediction box to identify the target pipe and further predict its leakage probability. The YOLO model's input layer, convolutional layer, pooling layer, and other network layer structures are constructed, and the weight parameters of the corresponding network layers are configured according to the YOLO model's network structure. The leakage probability of the pipe within the target prediction box is output at the output layer. This invention obtains images of the corresponding pipe region as a sample set, which includes images of leaking pipes and non-leaking pipes. The sample set is divided into a training set and a test set. The YOLO model is trained using the training set, and the network hyperparameters are adjusted. The trained YOLO model is tested using the test set to obtain the trained second leakage probability prediction model.
[0026] This invention acquires sound detection data from a sound sensor and image detection data from an image sensor installed at corresponding locations. Each sound sensor and image sensor can be configured with a communication module, which connects to the control center of the system. The control center collects relevant data from the sound and image sensors at different locations along the pipeline. Notably, each sound sensor and image sensor in this invention has its own unique identifier, which is uploaded to the system's control center during communication to distinguish data acquisition locations. Each unique identifier for a sound sensor and image sensor is bound to its corresponding pipeline location. Therefore, when the unique identifier of the sound sensor or image sensor is found, the pipeline location of that sensor can be located. Consequently, when a pipeline leak is predicted, the corresponding pipeline location can be quickly and accurately pinpointed.
[0027] It should be noted that, when obtaining the first pipeline leakage probability value for the same pipeline area by the first leakage probability prediction model and the second pipeline leakage probability value for the same pipeline area by the second leakage probability prediction model, an environmental weight σ is further set on the second pipeline leakage probability value. nIn this invention, the environmental weights for the second pipeline leakage probability are based on the brightness settings captured by the image sensor. Specifically, the image of the corresponding pipeline area captured by the image sensor can be converted into a grayscale image, and the average grayscale value of the entire grayscale image can be calculated. Since the corresponding pipeline area image appears dark, especially in darkness, the prediction using the second leakage probability model will have significant errors, and may even fail completely. Therefore, this invention configures the environmental weights σ for the second leakage probability model's output prediction probability by calculating the average grayscale value w0 of the corresponding pipeline area's grayscale image. n In this invention, the second leakage probability model outputs the environmental weight σ of the predicted probability. n To assign segmented weights, weights are assigned based on the average grayscale value range of the grayscale image. For example, a threshold range W of stepped grayscale values is defined for the detected pipe region image. n The threshold range W of the stepped grayscale value n Set to 5 ranges, for example, W1∈[0,50], W2∈(50,100], W2∈(100,150], W2∈(150,200], W2∈(200,255]; where each grayscale value threshold range W n Set the corresponding environmental weights σ respectively n The values are: W1→σ1=0, W2→σ2=0.2, W3→σ3=0.7, W4→σ4=0.8, W5→σ5=0.9; The above settings indicate that when the average grayscale value w0 of the detected corresponding pipe region image ∈ the stepped grayscale value threshold range W... n When that happens, the corresponding assigned environmental weight σ is extracted. n Therefore, the above settings can fully consider the impact of different lighting environments on the pipeline. Furthermore, this invention uses the predicted probability output by the second leakage probability model as the main reference model, primarily employing image detection supplemented by sound detection, and adjusting for environmental factors, because image feature detection is less susceptible to interference than sound feature detection.
[0028] The present invention further calculates the environmental weight of the predicted pipeline leakage probability output by the first leakage probability model as 1-σ. n The total probability of pipe leakage prediction is further calculated using the following formula: F = P * σ n +Q*(1-σ nWhere P is the second leakage prediction probability corresponding to the image sensor, and Q is the first leakage prediction probability of the first leakage prediction model. A total leakage prediction probability threshold Fs is set. If the current total leakage prediction probability F is greater than the total leakage prediction probability threshold Fs, the leakage prediction judgment of the current pipeline area is output to the host computer. The host computer simultaneously obtains the pipeline location of the current leakage area based on the sound sensor and image sensor of that area.
[0029] The processes described above with reference to the flowcharts in the embodiments disclosed in this invention can be implemented as computer software programs. The embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), it performs the functions defined in the methods of this application. It should be noted that the computer-readable medium described above in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The 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 of computer-readable storage media may include, but are not limited to: electrical connections having one or more wire segments, portable computer disks, hard disks, 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 devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless segments, wire segments, optical fibers, RF, etc., or any suitable combination thereof.
[0030] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0031] Those skilled in the art should understand that the embodiments of the present invention described above and shown in the accompanying drawings are merely examples and do not limit the present invention. The purpose of the present invention has been fully and effectively achieved. The functions and structural principles of the present invention have been shown and explained in the embodiments. Without departing from the stated principles, the implementation of the present invention may have any variations or modifications.
Claims
1. A method for automatic pipe leakage location based on an AI model, characterized in that, The method includes: The water pipe spacing configuration includes a sound sensor and an image sensor, wherein the sound sensor and the image sensor are arranged in pairs to detect audio data and image data of the water pipe in the same area, respectively. Establish a trained first pipe leakage prediction model and a second pipe leakage prediction model, and input the audio data of the corresponding pipe location into the trained first pipe leakage prediction model for prediction to obtain the first leakage prediction probability of the corresponding pipe location. The image data is input into the trained second pipe leakage prediction model to obtain the second leakage prediction probability for the corresponding pipe location; Set environmental matching rules, calculate the sum of the leakage prediction probabilities based on the first leakage prediction probability and the second leakage prediction probability respectively, set the corresponding sum of prediction probability threshold, and output the leakage detection result for the corresponding pipe location.
2. The method for automatic pipe leakage location based on an AI model according to claim 1, characterized in that, The first pipeline leakage prediction model is an audio prediction model. After the sound detection device detects the audio data, it converts the audio data into a Mel spectrum and inputs the Mel spectrum into the trained first pipeline leakage model, outputting the first leakage prediction probability corresponding to the pipeline location.
3. The method for automatic pipe leakage location based on an AI model according to claim 1, characterized in that, The second pipeline leakage prediction model is an image prediction model. After the image detection device detects the image of the corresponding pipeline area, the image prediction model inputs the image into the second pipeline leakage prediction model and outputs the second leakage prediction probability of the corresponding pipeline area.
4. The automatic pipeline leakage location method based on an AI model according to claim 1, characterized in that, The first pipeline leakage prediction model includes any one or a combination of several of the following: Hidden Markov Model, Mel-spectral cepstral coefficient model, convolutional neural network, Gaussian mixture model, RBF neural network, and BP neural network.
5. The method for automatic pipe leakage location based on an AI model according to claim 1, characterized in that, The second pipeline leakage prediction model includes any one of the following target prediction models: R-CNN model, fast R-CNN model, SSD model and YOLO series model, or any one of the following deep learning models: convolutional neural network, recurrent neural network, generative adversarial network and reinforcement learning model.
6. The method for automatic pipe leakage location based on an AI model according to claim 1, characterized in that, The environment matching rule includes: acquiring an image of the corresponding pipe region from the image sensor, calculating the average grayscale value w0 of the image within the corresponding pipe, and setting a threshold range W for the stepped grayscale value of the detected image. n And for the threshold range W of the stepped grayscale value n Set different environmental weights σ respectively n When the detected average gray value inside the pipe is within the corresponding stepped threshold range W n When the time is right, extract the corresponding environmental weight σ. n The environmental weight σ serves as the second leakage prediction probability P in the second leakage prediction model. n The value range is the interval 0-1 including the endpoints.
7. The method for automatic pipe leakage location based on an AI model according to claim 6, characterized in that, When the environmental weight σ of the second leakage prediction probability P of the second leakage pipe prediction model corresponding to the image sensor is obtained... n Then, the environmental weight of the first leakage prediction probability Q of the first leakage prediction model was further calculated to be 1-σ. n Further calculation yields the corrected total leakage prediction probability F = P * σ n +Q*(1-σ n ).
8. The method for automatic pipe leakage location based on an AI model according to claim 7, characterized in that, The method includes: setting a total leakage prediction probability threshold Fs; if the current total leakage prediction probability F value is greater than the total leakage prediction probability threshold Fs, then outputting a leakage prediction judgment for the current pipeline area to the host computer; the host computer simultaneously obtains the pipeline location of the current leakage area based on the sound sensor and image sensor of the area.
9. An automatic pipeline leakage location system based on an AI model, characterized in that, The system executes the automatic pipeline leakage location method based on an AI model as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computationally readable storage medium stores a computer program, which is executed by a processor to implement the automatic pipeline leakage location method based on an AI model as described in any one of claims 1-8.