Pipeline leakage detection method and system based on deep learning and neural network
By applying deep learning technology in pipeline leakage detection, a combined model of wav2vec2.0 and CNN model is built, which solves the problem of low detection accuracy of traditional methods in noise environments, and achieves high-precision, real-time leakage detection and alarm.
Patent Information
- Application Number
- CN202510262535.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-06-13
AI Technical Summary
Traditional pipeline leakage detection methods are not effective when dealing with complex and dynamic leak signals, and are difficult to achieve high-precision detection in environments with severe noise interference.
Using a deep learning and neural network method, a combined model composed of wav2vec2.0 model and CNN model is constructed to extract and analyze the sound signals inside the pipeline to identify leaked signals.
It realizes high-precision feature extraction and recognition of leaked signals, enhances robustness, can effectively handle complex signals under multiple background noises, realizes real-time detection and alarm, and reduces manual intervention.
Smart Images

Figure CN120140672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of signal sound signal processing and pipeline monitoring. Specifically, it relates to a pipeline leakage detection method and system based on deep learning and neural networks. Background Art
[0002] In traditional pipeline leakage detection, sound signal processing methods mainly include frequency domain analysis by Fourier transform, time domain analysis, and feature extraction and matching. Specifically, Fourier transform techniques, such as the short-time Fourier transform (STFT), can decompose sound signals into frequency components, but it is often difficult to meet the requirements of high-precision detection in the trade-off between time and frequency resolution, especially in dealing with complex and dynamic leakage signals. Time domain analysis detects leakage signals by directly analyzing the audio waveform, but it is very sensitive to background noise and difficult to extract useful signals from complex environments. In addition, traditional feature extraction methods usually rely on manually designed features, and these handcrafted features may not be able to fully capture the complex patterns and subtle changes in sound signals, resulting in limited processing accuracy, especially in environments with severe noise interference.
[0003] In recent years, artificial intelligence (AI) and deep learning technologies have made remarkable progress in the field of sound signal processing. These emerging technologies have greatly improved the accuracy and robustness of detection. Modern feature extraction models, such as wav2vec2.0 and HuBERT, etc., are trained on a large amount of unlabeled audio data through self-supervised learning and can automatically learn and extract deep features in audio signals. These models can not only capture subtle changes that are difficult to identify by traditional methods but also process complex signals under various background noises, thus providing a more comprehensive and accurate feature representation.
[0004] The application of convolutional neural networks (CNNs) in audio feature processing further improves the detection accuracy and real-time performance. Through multiple layers of convolution and pooling operations, CNNs can effectively extract spatial and temporal patterns in sound signals and identify complex features in leakage signals. Its automatic feature learning ability enables it to adapt to various types of leakage signals and maintain high-precision detection under various noise backgrounds. Compared with traditional methods, these deep learning technologies not only improve the detection accuracy and reliability but also achieve real-time analysis and response, greatly enhancing the efficiency and effectiveness of sound-based pipeline leakage detection. Summary of the Invention
[0005] In order to further improve the efficiency and effectiveness of sound-based pipeline leakage detection, the present invention provides a pipeline leakage detection method based on deep learning and neural networks, including the following steps: Construct a combined model consisting of a wav2vec2.0 model and a CNN model, and use the sound signals collected inside the pipeline as a dataset for model training to generate a detection model. Based on the detection model, by collecting the sound signals inside the pipeline to be tested, determine whether there is a leakage in the pipeline to be tested.
[0006] Preferably, in the process of constructing the combined model, the wav2vec2.0 model is used to extract features from the audio data inside the pipeline. Among them, the wav2vec2.0 model is trained with a labeled dataset, and the hyperparameters of the model are adjusted.
[0007] Preferably, in the process of obtaining the labeled dataset, after denoising, gain adjustment, and feature standardization of the original signal, according to the sound characteristics of actual pipeline leakage, the audio data is classified and marked as the "leakage" or "normal" state, and a standardized labeled dataset is formed.
[0008] Preferably, in the process of using the wav2vec2.0 model to extract features from the audio data inside the pipeline, the audio data is divided into multiple batches for input. Each batch contains multiple audio segments, and the extracted feature vectors are saved in CSV format. Among them, the choice of batch size needs to balance performance and computing resources.
[0009] Preferably, in the process of constructing the combined model, the CNN model is used to perform feature analysis on the feature data extracted by the wav2vec2.0 model, extract the spatial and temporal patterns in the audio features, and identify the sound patterns related to pipeline leakage.
[0010] Preferably, in the process of performing feature analysis by the CNN model, the spatial and temporal patterns in the audio features are extracted through multi-layer convolution and pooling operations to identify the sound patterns related to pipeline leakage. Among them, first, feature analysis is performed through the convolutional layer. After the convolution operation, the activation function ReLU is applied to introduce non-linearity. The spatial dimension of the feature map is reduced through the max-pooling operation, and then the output is passed through the fully connected layer.
[0011] Preferably, in the process of determining whether there is a leakage in the pipeline to be tested, an alarm operation is triggered according to the leakage situation. Among them, it is judged whether to trigger the alarm through a set threshold. If the detection result exceeds the set threshold, a detailed detection report is generated and an alarm signal is triggered.
[0012] The present invention discloses a pipeline leakage detection system based on deep learning and neural networks, including: A model construction module for constructing a combined model composed of a wav2vec2.0 model and a CNN model, using the collected sound signals inside the pipeline as a data set for model training to generate a detection model; A leakage detection module for judging whether there is a leakage in the pipeline to be measured based on the detection model by collecting the sound signals inside the pipeline to be measured.
[0013] Preferably, the model construction module is further configured to extract features from the audio data inside the pipeline through the wav2vec2.0 model. Among them, the wav2vec2.0 model is trained with a labeled data set, and the hyperparameters of the model are adjusted; in the process of obtaining the labeled data set, after denoising, gain adjustment and feature standardization processing of the original signal, according to the sound characteristics of actual pipeline leakage, the audio data is classified and marked as "leakage" or "normal" status, and a standardized label data set is formed.
[0014] Preferably, the model construction module is further configured to perform feature analysis on the feature data extracted by the wav2vec2.0 model through the CNN model, extract the spatial and temporal patterns in the audio features, and identify the sound patterns related to pipeline leakage.
[0015] The present invention discloses the following technical effects: Through the combined application of wav2vec2.0 and CNN, the present invention realizes high-precision feature extraction and recognition of leakage signals; The present invention enhances the robustness: it can effectively process complex signals under various background noises and overcomes the limitations of traditional methods under noise interference; The present invention realizes real-time detection: using deep learning technology, the system can realize real-time analysis and response to pipeline leakage; The present invention reduces manual intervention: through automatic feature extraction and model training, it reduces the dependence on manually designed features and thresholds and improves the automation level of the system. Description of the Drawings
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments 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.
[0017] Figure 1 It is a schematic flow chart of the method described in the present invention; Figure 2 It is a structural diagram of the wav2vec2.0 model described in the present invention; Figure 3 It is the structure diagram of the CNN model described in the present invention Specific implementation manners
[0018] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Components of the embodiments of the present application usually described and illustrated herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.
[0019] As Figures 1-3 shown, the present invention provides a pipeline leakage detection method based on the wav2vec2.0 model and CNN, which specifically includes the following contents: S1: Use a high-sensitivity fiber optic sensor to collect the sound signal inside the pipeline and preprocess it to obtain the processed water pipe audio data.
[0020] S2: Obtain a small amount of unlabeled water pipe audio data preprocessed in S1, perform manual annotation, and obtain labeled water pipe audio data.
[0021] S3: Use the labeled water pipe audio data in S2 to fine-tune the wav2vev2.0 model to make it have a better feature extraction effect for water pipe audio.
[0022] S4: Obtain the unlabeled water pipe audio data preprocessed in S1, and use the fine-tuned wav2vec2.0 model in S3 to extract features from the water pipe audio data.
[0023] S5: Input the features extracted in S4 into the CNN model for further analysis to identify leakage features.
[0024] S6: Judge whether there is pipeline leakage according to the output of the CNN model, and generate a detection result and an alarm signal.
[0025] The collection of the sound signal inside the pipeline described in step S1 for preprocessing is specifically as follows: The data processing unit preprocesses the collected original audio signal, including signal denoising, gain adjustment, and feature standardization.
[0026] The manual annotation of the water pipe leakage audio described in step S2 is specifically processed as follows: The water pipe audio data collected in S1 is manually reviewed, and the audio segments of leakage and non-leakage are annotated. The annotator needs to classify the audio data according to the actual sound characteristics of the pipeline leakage, mark it as the "leakage" or "normal" state, and form a standardized label data set for subsequent training and testing.
[0027] The fine-tuning of the wav2vec2.0 model described in step S3 is specifically processed as follows: 3.1: Divide the labeled water pipe audio data set into a training set and a validation set for model fine-tuning and performance evaluation.
[0028] S3.2: Retrain the wav2vec2.0 model with the labeled data to adapt to specific leakage audio characteristics. This includes adjusting hyperparameters such as the learning rate and batch size of the model, and using appropriate optimization algorithms to improve the model's ability to extract features from water pipe leakage audio.
[0029] S3.3: Evaluate the performance of the fine-tuned model on the validation set to ensure that it can effectively identify and extract the features of water pipe leakage audio.
[0030] The use of the fine-tuned wav2vec2.0 model to extract features from water pipe audio described in step S4 is specifically processed as follows: S4.1: To improve the processing efficiency, the water pipe audio data is usually divided into multiple batches for input. Each batch contains multiple audio segments to facilitate efficient calculation by the model in batch processing mode. The selection of the batch size needs to balance performance and computing resources.
[0031] S4.2: The wav2vec2.0 model maps the audio data to a high-dimensional feature space and generates feature vectors. These feature vectors contain rich information of the audio signal, such as the frequency components of the sound, the temporal characteristics, and possible abnormal patterns. Specifically, wav2vec2.0 processes the audio signal through its encoder part and extracts important features in the audio using the knowledge learned in the pre-training and fine-tuning processes.
[0032] S4.3: The high-dimensional feature vectors output by the model usually include multiple levels of feature representations, such as low-level acoustic features and high-level semantic features. To use these feature vectors for subsequent analysis, it may be necessary to perform dimensionality reduction, standardization, or other forms of processing on them to adapt to the input requirements of the CNN model.
[0033] S4.4: The extracted feature vectors are saved in CSV format and ensure that they can be effectively transmitted to the CNN model for further analysis.
[0034] The feature analysis using CNN described in step S5 is specifically processed as follows: The CNN model extracts the spatial and temporal patterns in the audio features through multiple convolutional and pooling operations, and identifies the sound patterns related to pipeline leakage.
[0035] The preprocessing of collecting the sound signals inside the pipeline described in step S6 is as follows: It is determined whether there is pipeline leakage according to the output of the CNN model, and a detection result and an alarm signal are generated. The system determines whether to trigger an alarm through a set threshold based on the classification result or prediction probability of the CNN model. If the detection result exceeds the set threshold, the system will generate a detailed detection report and trigger an alarm signal, including functions such as audible and visual alarms, information push, and system recording, to achieve timely response and processing.
[0036] Embodiment: The embodiment of the present invention provides a pipeline leakage detection method based on wav2vec2.0 and CNN, which specifically includes the following processes: Step 1: High-sensitivity fiber optic sensors and water pipes are arranged on-site to collect a large amount of normal water pipe audio data and unlabeled audio data of different types of leaking water pipes, totaling 1000 hours; Step 2: Randomly select 20 hours of water pipe audio data and use audio processing software for manual annotation, and classify and save the labeled normal water pipe data and leaking water pipe data; Step 3: Deploy the pre-trained wav2vec2.0 model, and then use the labeled water pipe audio data for fine-tuning. Its structure is as Figure 2 shown, and it is specifically implemented through the following sub-steps: 3.1. The labeled water pipe audio data X generates a hidden representation Z by extracting features through a feature encoder composed of a CNN network. The convolution operation formula is: ; Among them, x is the input signal, w is the convolution kernel, and k is the length of the convolution kernel. The convolution operation extracts local features by sliding the convolution kernel for weighted summation on the input signal.
[0037] 3.2. The quantized representation Q after quantizing Z and the context representation C generated by the context network stacked by multiple transformer encoder blocks are processed by the self-attention mechanism for the context representation C. The formula of the self-attention mechanism is: ; Among them, Q is the query matrix (Query), K is the key matrix (Key), V is the value matrix (Value), and d k is the dimension of the key. This formula calculates the correlation between the input features and calculates the final output by weighting.
[0038] Step 4: The processing method for the remaining 980 hours of unlabeled data is similar to that of labeled data. However, in wav2vec2.0, for self-supervised learning to process unlabeled data, the model will perform a masking operation on the input audio. The mathematical formula for the masking operation is: ; where x is the input feature, m is the masking mask (usually a matrix composed of 0s and 1s), is the masked feature. The masking operation simulates data loss by setting some parts of the feature to zero, thereby training the model to make predictions in the case of missing information.
[0039] Step 5: Feed the water pipe audio vectors extracted in the above steps into the CNN network for classification. As Figure 3 shown, the specific classification details are implemented through the following sub-steps: S5.1. The water pipe audio feature information first undergoes feature analysis through the convolutional layer. After the convolutional operation, an activation function is usually applied to introduce non-linear characteristics. The commonly used activation function is ReLU. The ReLU function sets all negative values to zero and retains positive values.
[0040] S5.2. In the CNN network, pooling operations are commonly used to reduce the spatial dimension of the feature map while retaining important information. The most commonly used pooling operation is max pooling, which takes the maximum value within the window to represent the region.
[0041] S5.3. In a CNN network, multiple convolutional and pooling operations are often required to obtain better results, and then it passes through the fully connected layer for output. In the fully connected layer, each neuron is connected to all neurons in the previous layer. The output of the fully connected layer can be represented by matrix multiplication: ; where x is the input vector, W is the weight matrix, b is the bias vector, and y is the output vector.
[0042] Step 6: The corresponding program will record the probability of detecting water leakage in the water pipe audio output by the CNN network in real time and compare this probability with the set threshold. If it exceeds the threshold, an alarm will be triggered to remind relevant personnel to handle it.
[0043] Based on the above, it can be seen that the present invention improves the detection accuracy. Through the combined application of wav2vec2.0 and CNN, high-precision feature extraction and recognition of leakage signals are achieved; the robustness is enhanced, and complex signals under various background noises can be effectively processed, overcoming the limitations of traditional methods under noise interference; at the same time, real-time detection is realized. Using deep learning technology, the system can achieve real-time analysis and response to pipeline leakage; and it also reduces manual intervention. Through automatic feature extraction and model training, the dependence on manually designed features and thresholds is reduced, and the automation level of the system is improved.
[0044] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one Figure 1 one process or multiple processes and / or blocks Figure 1 or multiple blocks.
[0045] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality" means two or more, unless otherwise specifically defined.
[0046] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.
Claims
1. A pipeline leakage detection method based on deep learning and neural network, characterized in that: The following steps are involved: Build a combined model consisting of a wav2vec2.0 model and a CNN model, use the collected sound signals inside the pipeline as a data set for model training, and generate a detection model; Based on the detection model, by collecting the sound signal inside the pipeline to be tested, it is determined whether there is a leakage in the pipeline to be tested.
2. According to claim 1, a pipeline leakage detection method based on deep learning and neural network is characterized in that: In the process of building the combined model, the wav2vec2.0 model is used to extract features of the audio data inside the pipeline, wherein the wav2vec2.0 model is trained with a labeled data set and the hyperparameters of the model are adjusted.
3. According to claim 2, a pipeline leakage detection method based on deep learning and neural network is characterized in that: In the process of obtaining a labeled data set, after denoising, gain adjustment and feature normalization of the original signal, the audio data is classified and marked as "leakage" or "normal" according to the sound characteristics of the actual pipeline leakage, and a standardized labeled data set is formed.
4. According to claim 3, a pipeline leakage detection method based on deep learning and neural network is characterized in that: In the process of extracting features from audio data within the pipeline through the wav2vec2.0 model, the audio data is divided into multiple batches for input, each batch contains multiple audio clips, and the extracted feature vectors are saved in CSV format. The selection of batch size requires a balance between performance and computing resources.
5. A pipeline leakage detection method based on deep learning and neural network according to claim 4, characterized in that: In the process of building the combined model, the CNN model is used to perform feature analysis on the feature data extracted by the wav2vec2.0 model, extract the spatial and temporal patterns in the audio features, and identify the sound patterns related to pipeline leakage.
6. A pipeline leakage detection method based on deep learning and neural network according to claim 5, characterized in that: In the process of feature analysis through the CNN model, spatial and temporal patterns in audio features are extracted through multi-layer convolution and pooling operations, and sound patterns related to pipe leakage are identified. Feature analysis is first performed through the convolution layer. After the convolution operation, the activation function ReLU is applied to introduce nonlinear characteristics. The spatial dimension of the feature map is reduced through the maximum pooling operation, and then the output is passed through the fully connected layer.
7. A pipeline leakage detection method based on deep learning and neural network according to claim 6, characterized in that: In the process of determining whether there is a leak in the pipeline to be tested, an alarm operation is triggered according to the leakage situation, wherein whether to trigger an alarm is determined by a set threshold. If the test result exceeds the set threshold, a detailed test report is generated and an alarm signal is triggered.
8. A pipeline leakage detection system based on deep learning and neural network, characterized in that: include: The model building module is used to build a combined model consisting of a wav2vec2.0 model and a CNN model, use the collected sound signals inside the pipeline as a data set for model training, and generate a detection model; The leakage detection module is used to determine whether there is leakage in the pipeline to be tested by collecting sound signals inside the pipeline to be tested based on the detection model.
9. A pipeline leakage detection system based on deep learning and neural network according to claim 8, characterized in that: The model building module is also used to extract features from the audio data inside the pipeline through the wav2vec2.0 model, wherein the wav2vec2.0 model is trained through a labeled data set and the hyperparameters of the model are adjusted; in the process of obtaining the labeled data set, after denoising, gain adjustment and feature normalization of the original signal, the audio data is classified according to the sound characteristics of the actual pipeline leakage, and marked as "leakage" or "normal" state, and a standardized labeled data set is formed.
10. A pipeline leakage detection system based on deep learning and neural network according to claim 9, characterized in that: The model building module is also used to perform feature analysis on the feature data extracted by the wav2vec2.0 model through the CNN model, extract spatial and temporal patterns in the audio features, and identify sound patterns related to pipeline leakage.