A water leakage detection device and a water leakage detection method
By upscaling pressure time-series data into a time-frequency spectrum and using a convolutional neural network for classification, the problem of high false alarm rate in leak detection is solved, achieving highly accurate and reliable leak detection and location.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2026-04-07
AI Technical Summary
Existing leak detection methods are unable to effectively distinguish between real leaks and hydraulic transient events, resulting in a high false alarm rate that affects water supply security and resource conservation.
The pressure time series data is upgraded to a time-frequency spectrum by continuous wavelet transform, and event classification is performed using a convolutional neural network. Double confirmation is performed based on confidence level to trigger alarms and locate the target.
It effectively solves the problem of false alarms caused by signal confusion, improves the accuracy and reliability of water leakage detection and location, and reduces the false alarm rate.
Smart Images

Figure CN121033525B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of intelligent water leakage detection, and more particularly, to a water leakage detection device and a water leakage detection method. BACKGROUND
[0002] Water supply network is a key infrastructure to ensure normal operation of urban residents' life and industrial production. However, due to pipeline aging, corrosion, external damage and other factors, the problem of water leakage in water supply network is increasingly prominent, not only causing a huge waste of valuable water resources, but also possibly causing secondary disasters such as ground subsidence and equipment damage, seriously threatening public safety. Therefore, real-time and accurate water leakage detection of water supply network, timely detection and positioning of leakage points, is of great significance to ensure water supply safety and save water resources.
[0003] At present, the water leakage detection method based on pressure wave has been widely applied due to its fast response speed, high positioning accuracy and other advantages. This method usually installs pressure sensors on the pipeline to monitor pressure data in real time. When the pipeline breaks and leaks, a negative pressure wave (negative pressure wave) will be generated and propagate upstream and downstream along the pipeline. By capturing and analyzing the abnormal pressure signals monitored by the sensors, it can be determined whether a water leakage event has occurred. However, in the actual complex pipe network environment, it is far from enough to rely solely on the sudden change of pressure signal for judgment. Normal water use behaviors in the pipe network, such as user valve opening and closing, fire hydrant activation, water pump start and stop, etc., will also cause pressure fluctuations, producing similar pressure signals to real water leakage. These non-leakage events are called hydraulic transient events. Existing detection methods often have difficulty in effectively distinguishing between real water leakage events and these hydraulic transient events, resulting in high false alarm rate. High false alarm rate not only consumes a lot of manpower and resources for ineffective investigation, but also reduces the trust of operation and maintenance personnel in the alarm system, which may eventually lead to delayed response to real water leakage events, losing the significance of rapid detection.
[0004] Therefore, an optimized water leakage detection scheme is expected. SUMMARY
[0005] To solve the above technical problems, the present application is proposed. Embodiments of the present application provide a water leakage detection device and a water leakage detection method. Instead of directly analyzing pressure data with similar features in the time domain, the embodiments of the present application first convert one-dimensional pressure time series data into two-dimensional time-frequency spectrum by continuous wavelet transform, which can reveal the features in both time domain and frequency domain, and generate a unique image fingerprint for each event. Subsequently, the time-frequency spectrum is analyzed in depth by using the powerful image feature extraction and classification ability of the convolutional neural network, so as to identify the real category of the event with high precision. Finally, the event category and confidence level output by the model are used for double confirmation, and only when the event is identified as a real leakage with high confidence, an alarm is triggered and positioning calculation is performed. In this way, the false alarm problem caused by signal confusion is fundamentally solved, the interference problem of hydraulic transient events is effectively solved, and the accuracy and reliability of water leakage detection and positioning are improved.
[0006] According to one aspect of the present application, a water leakage detection method is provided, which comprises:
[0007] Performing event detection and event window segmentation on the original pressure data stream based on a preset negative threshold to obtain event window pressure time series data;
[0008] Performing continuous wavelet transform on the event window pressure time series data to obtain a pressure time-frequency spectrum image;
[0009] Performing event classification based on a convolutional neural network on the pressure time-frequency spectrum image to obtain an event category and a confidence level thereof;
[0010] Based on the event category and the confidence level thereof and the event window pressure time series data, performing leakage event confirmation and leakage positioning to obtain a leakage position and an alarm signal.
[0011] According to another aspect of the present application, a water leakage detection device is provided, which comprises:
[0012] A time window pressure acquisition module configured to perform event detection and event window segmentation on the original pressure data stream based on a preset negative threshold to obtain event window pressure time series data;
[0013] A pressure time-frequency spectrum generation module configured to perform continuous wavelet transform on the event window pressure time series data to obtain a pressure time-frequency spectrum image;
[0014] An event classification module configured to perform event classification based on a convolutional neural network on the pressure time-frequency spectrum image to obtain an event category and a confidence level thereof;
[0015] A leakage event analysis module configured to perform leakage event confirmation and leakage positioning based on the event category and the confidence level thereof and the event window pressure time series data to obtain a leakage position and an alarm signal.
[0016] Compared with the prior art, the water leakage detection device and method provided by the application is not directly analyzing pressure data similar in time domain, but first converting one-dimensional pressure time series data into two-dimensional time-frequency spectrum which can reveal time domain and frequency domain features at the same time through continuous wavelet transform, generating a unique image fingerprint for each event. Subsequently, using the powerful image feature extraction and classification ability of convolutional neural network, the time-frequency spectrum is deeply analyzed to identify the true category of the event with high precision. Finally, based on the event category and confidence output by the model, double confirmation is carried out, and only when the event is identified as a real leak with high confidence, an alarm is triggered and positioning calculation is carried out. In this way, the false alarm problem caused by signal confusion is fundamentally solved, the interference problem of hydraulic transient events is effectively solved, and the accuracy and reliability of water leakage detection and positioning are improved. BRIEF DESCRIPTION OF DRAWINGS
[0017] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description of embodiments of the present application, when taken in conjunction with the accompanying drawings. The drawings provided in the specification and the embodiments of the present application are only given to further understand for the present application, and constitute a part of the specification. The drawings provided in the specification and the embodiments of the present application are used to explain the present application, and do not constitute a limitation on the present application. In the drawings, the same reference numerals generally represent the same components or steps.
[0018] Figure 1 A flowchart of a water leakage detection method according to an embodiment of the present application;
[0019] Figure 2 A data flow diagram of a water leakage detection method according to an embodiment of the present application;
[0020] Figure 3 A flowchart of a water leakage detection method according to an embodiment of the present application, which performs event classification based on convolutional neural network on the pressure time-frequency spectrum image to obtain event category and confidence thereof;
[0021] Figure 4 A flowchart of a water leakage detection method according to an embodiment of the present application, which inputs the pressure time-frequency spectrum visual feature encoding vector into the feature sparse ablation part of the convolutional neural network to obtain a pressure time-frequency spectrum visual feature sparse encoding vector;
[0022] Figure 5 A flowchart of a water leakage detection method according to an embodiment of the present application, which performs leak event confirmation and leak positioning based on event category and confidence thereof and event window pressure time series data to obtain leak position and alarm signal;
[0023] Figure 6 A system block diagram of a water leakage detection device according to an embodiment of the present application. Detailed Implementation
[0024] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0025] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.
[0026] While this application makes various references to certain modules of the systems according to embodiments of this application, any number of different modules can be used and run on user terminals and / or servers. The modules described are merely illustrative, and different aspects of the systems and methods may use different modules.
[0027] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously as needed. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0028] Hereinafter, exemplary embodiments according to this application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments of this application. It should be understood that this application is not limited to the exemplary embodiments described herein.
[0029] To address the high false alarm rate caused by the inability of existing leak detection technologies to effectively distinguish between actual leaks and hydraulic transient events such as pump start-up / shutdown and valve operation, this application proposes a leak detection method. First, it captures pressure disturbance events in the pipeline network by real-time monitoring of the pressure gradient and extracts a pressure time-series data window containing the complete process of the event. Specifically, this method does not directly analyze this one-dimensional data, which is easily confused in the time domain. Instead, it uses continuous wavelet transform to increase its dimensionality, generating a two-dimensional time-frequency spectrum image that simultaneously displays the energy distribution of the event in both time and frequency dimensions. Subsequently, the two-dimensional time-frequency spectrum image is input into a convolutional neural network trained on a large number of real leak and non-leak event spectra. Utilizing its powerful image feature learning and classification capabilities, the neural network performs accurate qualitative analysis of the event, outputting the specific category of the event (e.g., actual leak, valve closure) and the corresponding confidence level. Finally, based on this high-confidence classification result, the system makes a decision: an alarm is triggered only when the event is confirmed as a genuine leak, and the original pressure time-series data is retrieved. The location of the leak point is then accurately calculated using the time-of-arrival method of negative pressure waves. In this way, interfering events are effectively filtered out, fundamentally solving the problem of false alarms and achieving highly accurate leak diagnosis and precise location.
[0030] Figure 1 This is a flowchart of a water leakage detection method according to an embodiment of this application. Figure 2 This is a schematic diagram of the data flow in a leakage detection method according to an embodiment of this application. Figure 1 and Figure 2 As shown, the leakage detection method according to an embodiment of this application includes the following steps: S100, performing event detection and event window segmentation on the original pressure data stream based on a preset negative threshold to obtain event window pressure time-series data; S200, performing continuous wavelet transform on the event window pressure time-series data to obtain a pressure time-frequency spectrum image; S300, performing event classification based on a convolutional neural network on the pressure time-frequency spectrum image to obtain event categories and their confidence levels; S400, performing leakage event confirmation and leakage location based on the event categories, their confidence levels, and the event window pressure time-series data to obtain the leakage location and alarm signal.
[0031] Specifically, in step S100, based on a preset negative threshold, event detection and event window segmentation are performed on the original pressure data stream to obtain event window pressure time-series data. It should be understood that since the original pressure data stream generated by the water supply network is continuous and massive, directly processing the entire data stream is not only computationally expensive and inefficient, but also results in most of the data being invalid stationary state data. Furthermore, whether it is a real leak or a hydraulic transient event, it will cause significant pressure changes in a short period of time, especially a leak event which will trigger a characteristic negative pressure mutation. Therefore, in the technical solution of this application, based on a preset negative threshold, event detection and event window segmentation are performed on the original pressure data stream to obtain event window pressure time-series data, thereby automatically and accurately capturing and separating key data segments containing event information from the continuous data stream. This reduces the amount of data in subsequent processing steps, improves the computational efficiency and real-time performance of the entire detection system, and ensures that subsequent complex calculations such as time-frequency analysis and model classification focus on valid event data, laying the foundation for subsequent accurate classification and localization.
[0032] More specifically, in this embodiment of the application, performing event detection and event window segmentation on the original pressure data stream to obtain event window pressure time-series data includes: performing real-time gradient calculation on the original pressure data stream to obtain a pressure gradient data stream; comparing each pressure gradient data in the pressure gradient data stream with the preset negative threshold to take the timestamp corresponding to the first data point less than the preset negative threshold as the trigger time; and performing forward backtracking and backward tracking on the original pressure data stream based on the trigger time to obtain the event window pressure time-series data.
[0033] More specifically, the process of event detection and event window segmentation of the raw pressure data stream first involves performing real-time differential operations on the raw pressure data stream acquired by the sensor to calculate a pressure gradient data stream characterizing the rate of pressure change. Then, each gradient value in the pressure gradient data stream is continuously compared with a pre-set negative threshold. This negative threshold is used to define the severity of the pressure drop, filtering out normal pressure fluctuations. When the first pressure gradient data point smaller than the preset negative threshold is detected, the system records the timestamp corresponding to that data point as the event trigger time. Finally, based on this trigger time, a window segmentation operation is performed on the raw pressure data stream. This involves backtracking a preset duration to include the stable state before the event, and then tracking backwards for a preset duration to capture the complete dynamic process after the event. Specifically, in a specific example of this application, the backtracking duration is 2 seconds, and the backward tracking duration is 8 seconds, thereby obtaining a fixed-length event window pressure time-series data containing complete event information for subsequent analysis.
[0034] Specifically, in step S200, continuous wavelet transform is performed on the pressure time-series data of the event window to obtain a pressure time-frequency spectrum image. It should be understood that since the pressure waves generated by real leakage events and hydraulic transient events such as valve operations may exhibit high similarity in the one-dimensional time domain signal, relying solely on time-domain features for differentiation can easily lead to confusion and misjudgment. However, the physical processes of these different events determine that their energy distribution patterns in frequency and time are fundamentally different. Therefore, in the technical solution of this application, continuous wavelet transform is further performed on the pressure time-series data of the event window to obtain a pressure time-frequency spectrum image, thereby upgrading the one-dimensional pressure time-series signal to a two-dimensional time-frequency domain, thus revealing and amplifying the time-varying frequency characteristics hidden in the pressure signal. In this way, subtle differences between different hydraulic events that are difficult to distinguish directly in the time domain can be transformed into visual textures and structural features with significant discriminative power in the time-frequency spectrum, providing high-quality, more information-rich input data for subsequent high-precision event classification based on convolutional neural networks.
[0035] More specifically, in this embodiment, performing a continuous wavelet transform on the event window pressure time-series data to obtain a pressure time-frequency spectrum image includes: performing a continuous wavelet transform on the event window pressure time-series data to obtain a wavelet coefficient matrix; and normalizing the wavelet coefficient matrix to obtain the pressure time-frequency spectrum image. That is, the process first performs a continuous wavelet transform on the event window pressure time-series data obtained in the previous step. This transform performs multi-resolution analysis on the time-series data through scaling and translation at different scales using a mother wavelet function, thereby obtaining a two-dimensional wavelet coefficient matrix. The rows and columns of this matrix correspond to the wavelet scale (reflecting frequency information) and time, respectively, and each value in the matrix represents the energy intensity of the signal at a specific time and frequency. Subsequently, in order to transform this numerical matrix into a standardized input suitable for image processing models, the system normalizes the wavelet coefficient matrix, for example, by linearly mapping all its values to a grayscale range of 0 to 255 or a floating-point range of 0 to 1. After this processing, the final pressure time-frequency spectrum image is generated, which visually displays the information of how the energy of a pressure event changes over time.
[0036] Specifically, in step S300, the pressure time-frequency spectrum image is subjected to event classification based on a convolutional neural network to obtain the event category and its confidence level. It should be understood that because different hydraulic events (real leaks, valve operations, etc.) exhibit complex and subtle texture and structural differences in the time-frequency spectrum, traditional image processing algorithms or manual rules are difficult to effectively and robustly distinguish them, which is the core difficulty leading to false alarms. Therefore, in the technical solution of this application, the pressure time-frequency spectrum image is further subjected to event classification based on a convolutional neural network to obtain the event category and its confidence level. This utilizes the powerful nonlinear feature extraction and autonomous learning capabilities of deep learning models to automatically discover and learn the deep, high-dimensional visual features that distinguish different event spectra. In this way, the event classification problem can be transformed into a standard image recognition task, achieving accurate and objective judgment of the nature of the event and quantifying the reliability (confidence level) of the judgment, thereby providing a decisive basis for subsequent leak confirmation and fundamentally solving the false alarm problem.
[0037] Figure 3 This is a flowchart illustrating the process of performing event classification based on a convolutional neural network on the pressure time-frequency spectrum image to obtain event categories and their confidence levels according to the leakage detection method of this application. (See flowchart for example.) Figure 3 As shown, step S300 includes: S310, inputting the pressure time-frequency spectrum image into the convolutional base part of the convolutional neural network to obtain a pressure time-frequency spectrum visual feature encoding vector; S320, inputting the pressure time-frequency spectrum visual feature encoding vector into the feature sparse ablation part of the convolutional neural network to obtain a pressure time-frequency spectrum visual feature sparse encoding vector; S330, inputting the pressure time-frequency spectrum visual feature sparse encoding vector into the classification head part of the convolutional neural network to obtain the event category and its confidence level.
[0038] Specifically, in step S310, the pressure time-frequency atlas image is input into the convolutional base part of the convolutional neural network to obtain a pressure time-frequency atlas visual feature encoding vector. It should be understood that since the pressure time-frequency atlas image itself is high-dimensional raw pixel data, directly using it for classification is not only computationally intensive, but also contains a large amount of redundancy and noise at the pixel level, failing to directly reflect the key structural features that distinguish different events. Therefore, in the technical solution of this application, the pressure time-frequency atlas image is further input into the convolutional base part of the convolutional neural network to obtain a pressure time-frequency atlas visual feature encoding vector, thereby automatically and hierarchically extracting discriminative abstract visual features from the raw atlas. This compresses and transforms complex image information into a compact, efficient, low-dimensional feature vector containing the core content of the atlas, providing high-quality structured input for subsequent feature optimization and accurate classification.
[0039] More specifically, in a concrete example of this application, the feature extraction process is accomplished through a convolutional base consisting of multiple stacked combined modules. It is worth noting that the convolutional base comprises multiple combined modules consisting of convolutional layers, activation layers, and pooling layers. That is, the pressure time-frequency spectrum image is first input into the first combined module. In this module, the convolutional layers use multiple convolutional kernels to perform convolution operations on the input image to detect and extract basic local features such as edges, corners, and textures, generating a preliminary feature map. Subsequently, activation layers (e.g., using the ReLU function) perform nonlinear transformations on these feature maps to enhance the network's expressive power. Next, pooling layers (e.g., max pooling) spatially downsample the activated feature maps, reducing data dimensionality while preserving key features and imparting a certain degree of translation invariance to the features. The output of the first module is used as the input of the second module, repeating the above process. Through the cascading of multiple modules, the network can progressively combine low-level features into higher-level, more abstract, complex features (such as specific energy cluster shapes or distribution patterns). After processing by all the combined modules, the final stereo feature map is flattened into a one-dimensional vector, which is the visual feature encoding vector of the pressure time-frequency map.
[0040] Specifically, in step S320, the pressure time-frequency map visual feature encoding vector is input into the feature sparse ablation part of the convolutional neural network to obtain the pressure time-frequency map visual feature sparse encoding vector. It should be understood that although the pressure time-frequency map visual feature encoding vector extracted by the convolutional base contains rich visual information, it inevitably contains redundant or even interfering feature dimensions that are not crucial for distinguishing real leaks from other hydraulic transient events. These non-critical features dilute the weight of key information, increasing the burden on subsequent classifiers and thus affecting the accuracy of the final classification. Therefore, in the technical solution of this application, the pressure time-frequency map visual feature encoding vector is further input into the feature sparse ablation part of the convolutional neural network to obtain the pressure time-frequency map visual feature sparse encoding vector, thereby introducing a dynamic, task-oriented feature adaptive refinement mechanism. This mechanism actively refines the pressure time-frequency map visual feature encoding vector during the model forward propagation process through a perturbation-evaluation-screening closed-loop logic. It first applies a structured perturbation to the visual feature encoding vector of the pressure time-frequency map through fine-grained ablation. Then, it calculates the substantial gain of this perturbation on improving the performance of the classification task. Finally, it decides whether to adopt this optimization based on whether the gain meets preset conditions. In this way, the initial visual feature encoding vector of the pressure time-frequency map can be optimized online and adaptively into a sparse encoding vector of the visual features of the pressure time-frequency map with higher information density and stronger discriminative power. This vector eliminates noise and redundant information and strengthens the core features that are crucial to distinguishing different events, providing a cleaner and more robust feature foundation for achieving high-precision event classification.
[0041] Figure 4 This is a flowchart illustrating the process of inputting the pressure time-frequency spectrum visual feature encoding vector into the feature sparse ablation part of the convolutional neural network to obtain the pressure time-frequency spectrum visual feature sparse encoding vector according to the leakage detection method of this application. Figure 4 As shown, step S320 includes: S321, performing fine-grained ablation on the visual feature encoding vector of the pressure time-frequency map to obtain the visually ablated feature vector of the pressure time-frequency map; S322, calculating the feature ablation substantial gain of the visually ablated feature vector of the pressure time-frequency map relative to the visual feature encoding vector of the pressure time-frequency map; S323, in response to the feature ablation substantial gain satisfying a preset condition, setting the visually ablated feature vector of the pressure time-frequency map as the sparse encoding vector of the visual features of the pressure time-frequency map.
[0042] More specifically, in step S321, the visual feature encoding vector of the pressure time-frequency spectrum is subjected to fine-grained ablation to obtain the visually ablated feature vector of the pressure time-frequency spectrum, expressed by the formula:
[0043] v ab=v⊙m+P(v⊙(1-m))
[0044] P(x)=W2σ(W1x+b)
[0045] Where v is the visual feature encoding vector of the pressure time-frequency map, m∈{0,1} is the learnable sparse mask weight, ⊙ is the positional dot product, P(x) is the deep feature extractor based on convolutional neural network, σ is the sigmoid function, W1 and W2 are the first and second trainable weight matrices, b is the trainable bias vector, v ab The feature vector is the result of visual ablation of the pressure time-frequency spectrum.
[0046] It is understandable that while the visual feature encoding vector of the stress time-frequency map obtained in the previous step contains rich visual information, it may contain redundant information or features that do not contribute much to the classification task. These non-critical features can dilute the truly discriminative information, potentially affecting the accuracy of subsequent classification and the robustness of the model. Therefore, in the technical solution of this application, the visual feature encoding vector of the stress time-frequency map is further subjected to fine-grained ablation to obtain the visually ablated feature vector of the stress time-frequency map. This allows for proactive and strategic micro-perturbation and exploratory modification of the internal structure of the feature vector. In this way, a carefully modified candidate feature version can be generated, laying the foundation for subsequent evaluation of which stress time-frequency map visual features are truly beneficial or harmful, thereby providing experimental input for the refinement and optimization of stress time-frequency map visual features.
[0047] More specifically, in step S322, the feature ablation substance gain of the visually ablated feature vector of the pressure time-frequency spectrum relative to the visual feature encoding vector of the pressure time-frequency spectrum is calculated, expressed by the formula:
[0048] G(v,v ab =JS(Softmax(v ab )‖Softmax(v))
[0049] Where Softmax is the Softmax function, JS(·‖·) represents the Jensen-Shannon divergence, and G(v,v) is the Softmax function. ab The visual features of the pressure time-frequency spectrum ablation are represented by the actual gain.
[0050] It is understandable that the fine-grained ablation operation only explores and locally modifies the visual feature encoding vector of the pressure time-frequency map, generating a candidate visually ablated feature vector of the pressure time-frequency map. However, it is impossible to directly determine whether this modification truly helps distinguish between real leaks and hydraulic transient events, or whether it removes redundant information or key discriminative features. Therefore, in the technical solution of this application, the substantial feature ablation gain of the visually ablated feature vector of the pressure time-frequency map relative to the visual feature encoding vector of the pressure time-frequency map is further calculated to accurately quantify the real impact of this fine-grained ablation operation on the performance of the downstream classification task of the model. In this way, an objective and quantitative evaluation basis can be provided for subsequent feature selection, ensuring that only feature optimizations that can bring substantial performance improvements or risk reductions will be adopted, thereby achieving adaptive refinement of the visual feature representation of the pressure time-frequency map and improving the accuracy and robustness of the final event classification.
[0051] More specifically, in step S323, in response to the feature ablation substantial gain satisfying a preset condition, the feature vector after visual ablation of the pressure time-frequency spectrum is set as the sparse coding vector of the visual features of the pressure time-frequency spectrum, expressed by the formula:
[0052]
[0053] Where τ is the preset threshold, γ is the trainable weight coefficient, and v en The sparse encoding vector for the visual features of the pressure time-frequency spectrum.
[0054] It is understandable that while the calculated substantial gain from feature ablation quantifies the actual impact of fine-grained ablation operations on classification performance, not all ablation operations bring positive gains; some may even remove crucial discriminative information for distinguishing between real leaks and hydraulic transient events. Therefore, in the technical solution of this application, in response to the substantial gain from feature ablation meeting a preset condition, the feature vector after visual ablation of the pressure time-frequency map is set as the sparse coding vector of the pressure time-frequency map visual features. This constructs an intelligent gating selection mechanism, ensuring that the ablated feature vector is adopted as the final sparse coding vector only when the feature ablation operation is proven to bring substantial performance improvement or risk reduction. This ensures that the final pressure time-frequency map visual feature sparse coding vector is rigorously screened and optimized, preserving the discriminative information crucial for event classification to the greatest extent possible, while effectively suppressing redundancy and noise. This significantly improves the accuracy and robustness of the convolutional neural network in identifying real leak events in complex pipeline environments and reduces the false alarm rate.
[0055] Specifically, in step S330, the sparse encoded vector of the visual features of the stress time-frequency map is input into the classification head of the convolutional neural network to obtain the event category and its confidence level. It should be understood that the sparse encoded vector of the visual features of the stress time-frequency map is a highly refined abstract feature representation containing core discriminative information about the event, but it is not a directly interpretable classification result and cannot be directly used to determine the nature of the event. Therefore, in the technical solution of this application, the sparse encoded vector of the visual features of the stress time-frequency map is further input into the classification head of the convolutional neural network to obtain the event category and its confidence level, thereby mapping the abstract, high-dimensional feature space to a specific, predefined event category space. This completes the transformation from feature representation to final decision, outputting a clear qualitative judgment result and a reliability measure of the judgment for each detected stress event, thus providing a direct and quantitative decision-making basis for subsequent leakage event confirmation and location.
[0056] More specifically, in a concrete example of this application, the classification process is performed through a classification head consisting of a fully connected layer and an activation function. First, the sparse encoded vector of the pressure time-frequency map visual features obtained in the previous step is input into at least one fully connected layer. This fully connected layer performs a final nonlinear combination and transformation on the refined features to learn the final mapping relationship between the features and different event categories. Subsequently, the output of the fully connected layer is fed into an output layer that employs the Softmax activation function. This Softmax function transforms the raw values of the output layer into a probability distribution, where each value corresponds to a probability of a predefined event category (such as a real leak, valve closure, etc.), and the sum of all probabilities is 1. Finally, the system selects the category with the highest probability value from this probability distribution as the final output event category and uses this highest probability value as its corresponding confidence level.
[0057] Specifically, in step S400, based on the event category and its confidence level, as well as the event window pressure time series data, leakage event confirmation and leakage location are performed to obtain the leakage location and alarm signal. It should be understood that since the event category and its confidence level are only probabilistic judgments of the nature of the pressure event, they are not the final business decision and do not solve the problem of locating where the leakage occurred. Therefore, in the technical solution of this application, leakage event confirmation and leakage location are further performed based on the event category and its confidence level, as well as the event window pressure time series data, to obtain the leakage location and alarm signal, thereby constructing a complete closed loop from event characterization to final handling. This closed loop first rigorously filters the classification results through a high confidence threshold to confirm the leakage event, and then regresses to use the precise timing information in the original time series data to complete spatial location. This ensures that the system only responds to real leakage events confirmed by a high-precision model, minimizing false alarms while providing pipeline maintenance personnel with accurate and operable leakage location information, achieving seamless integration from intelligent diagnosis to precise repair.
[0058] Figure 5 This is a flowchart illustrating the leakage detection method according to embodiments of this application, which uses event categories, their confidence levels, and event window pressure time-series data to confirm leakage events and locate leaks to obtain the leak location and alarm signal. Figure 5 As shown, step S400 includes: S410, triggering an alarm signal when the event category is a real leak and the confidence level is higher than the high confidence level threshold; S420, extracting the arrival time of the negative pressure wave from the pressure time series data of the event window; S430, calculating the distance of the leak point relative to the upstream pressure sensor based on the arrival time of the negative pressure wave; S440, determining the leak location based on the location information of the upstream pressure sensor and the distance of the leak point relative to the upstream pressure sensor.
[0059] Accordingly, in step S410, when the event category is a real leak and the confidence level is higher than the high confidence threshold, an alarm signal is triggered. It should be understood that since the event category and its confidence level output by the convolutional neural network are essentially a probabilistic inference, even if the model classifies the event as a real leak, the corresponding confidence level may vary, and the judgment result with low confidence has high uncertainty. Directly triggering an alarm based on any output labeled as a real leak would introduce a large number of false alarms due to model uncertainty, thereby reducing the system's practicality and reliability. Therefore, in the technical solution of this application, an alarm signal is further triggered when the event category is a real leak and the confidence level is higher than the high confidence threshold, thus setting a strict, quantitative verification checkpoint for the final alarm decision. This effectively filters out fuzzy or erroneous judgments with insufficient confidence that the model may produce, ensuring that the alarm system only responds to highly confirmed leak events with a very high probability of being real, thereby greatly improving the decision reliability of the entire leak detection system and reducing the false alarm rate.
[0060] More specifically, in a concrete example of this application, the process first receives the event category and corresponding confidence value output by the event classification module. Then, the system logically compares the received event category with a predefined real leak identifier within the system. If the event category matches a real leak, the accompanying confidence value is compared with a pre-set high confidence threshold in the system. The system determines that the leak event is finally confirmed and immediately executes an alarm operation if and only if both conditions are met: the event category is a real leak and its confidence value is greater than the high confidence threshold. This alarm operation is specifically manifested as sending alarm information to the monitoring terminal of maintenance personnel, highlighting the warning on the system interface, or automatically generating and dispatching a maintenance work order.
[0061] Accordingly, in step S420, the arrival time of the negative pressure wave is extracted from the pressure time-series data of the event window. It should be understood that since confirming a leak event only solves the qualitative problem, its specific spatial location in the pipeline network remains unknown. This location information is precisely contained in the time difference between the propagation of the negative pressure wave generated by the leak to different sensors. Therefore, in the technical solution of this application, the arrival time of the negative pressure wave is further extracted from the pressure time-series data of the event window to accurately identify and quantify the key time point information contained in the continuous time-series signal. This provides the necessary, high-precision core time parameters for subsequent leak location calculations based on the time difference method, and is a key conversion step from event confirmation to precise location.
[0062] Specifically, in one example of this application, the extraction process first processes the pressure time-series data of the event window corresponding to the confirmed leakage event. The system calculates the pressure gradient between each adjacent data point in the time-series data, thereby generating a pressure gradient sequence aligned with the original time-series data. Since the arrival of a negative pressure wave physically manifests as the most dramatic drop in pressure over a short period of time, this arrival time corresponds to the minimum point in the pressure gradient sequence. The system locates the minimum value by searching within the gradient sequence and determines the timestamp corresponding to the minimum value as the arrival time of the negative pressure wave.
[0063] Accordingly, in step S430, the distance between the leak point and the upstream pressure sensor is calculated based on the arrival time of the negative pressure wave. It should be understood that since the arrival times of the negative pressure wave extracted in the previous step are only two discrete time points, they do not directly provide the physical location of the leak in the pipeline network, but are merely the raw input required for location calculation. Therefore, in the technical solution of this application, the distance between the leak point and the upstream pressure sensor is further calculated based on the arrival time of the negative pressure wave. This applies the basic physical principles of acoustic positioning to transform the measured time difference information into precise spatial distance information. In this way, abstract time data can be converted into a concrete, measurable physical quantity, completing the key calculation from event temporal characteristics to spatial location characteristics, and providing a decisive relative positional basis for finally determining the absolute geographical coordinates of the leak point.
[0064] Specifically, in this embodiment, calculating the distance between the leak point and the upstream pressure sensor includes: calculating the distance between the leak point and the upstream pressure sensor based on the arrival time of the negative pressure wave using the following formula:
[0065] L leak =(L total +TDOA*Wave speed ) / 2
[0066] TDOA=|t downstream -t upstream |
[0067] Among them, t downstream and t upstream L is the arrival time of the negative pressure wave. total Wave is the pipe distance between the upstream and downstream pressure sensors. speed This represents the propagation speed of the pressure wave.
[0068] Accordingly, in step S440, the leak location is determined based on the upstream pressure sensor location information and the distance of the leak point relative to the upstream pressure sensor. It should be understood that since the distance of the leak point relative to the upstream pressure sensor is only a relative, one-dimensional length value, it does not provide specific coordinates in real geographic space and cannot directly guide pipeline maintenance personnel in on-site location and repair. Therefore, in the technical solution of this application, the leak location is further determined based on the upstream pressure sensor location information and the distance of the leak point relative to the upstream pressure sensor. This relative distance value is then combined with the geographic information system data of the pipeline network to complete the conversion from the pipeline coordinate system to the geographic coordinate system. This provides maintenance personnel with an accurate, intuitive, and operable geographic location of the leak point, such as a specific GPS coordinate or a marker point on an electronic map, thereby greatly improving the efficiency and accuracy of emergency repairs and achieving the final closed loop of the entire detection and location process.
[0069] Specifically, in one example of this application, the determination process first queries a pre-built pipeline geographic information system database. The system uses the unique identifiers of known upstream pressure sensors to retrieve and locate their corresponding geographic coordinates within the database, which serve as a reference point for location. Next, starting from this reference point, the system traces a path along the pipeline route defined in the database, connecting the upstream and downstream sensors. During the tracing process, the system accumulates the length of each pipeline segment traversed. When the accumulated length equals the relative distance to the leak point calculated in the previous step, the system determines the currently traced point as the final leak location. This leak location is ultimately output as a specific geographic coordinate (e.g., latitude and longitude) and can be visually marked on an electronic map.
[0070] In summary, the leak detection method according to the embodiments of this application is explained. It does not directly analyze pressure data with similar characteristics in the time domain. Instead, it first uses continuous wavelet transform to upgrade the one-dimensional pressure time-series data into a two-dimensional time-frequency spectrum that simultaneously reveals time-domain and frequency-domain characteristics, generating a unique image fingerprint for each event. Subsequently, leveraging the powerful image feature extraction and classification capabilities of convolutional neural networks, a deep analysis of the time-frequency spectrum is performed to accurately identify the true category of the event. Finally, a double confirmation is performed based on the event category and confidence level output by the model. Only when the event is identified as a genuine leak with high confidence is an alarm triggered and location calculation performed. This approach fundamentally solves the problem of false alarms caused by signal confusion, effectively addresses the interference problem of hydraulic transient events, and improves the accuracy and reliability of leak detection and location.
[0071] Furthermore, a leak detection device is also provided.
[0072] Figure 6 This is a system block diagram of a leak detection device according to an embodiment of this application. Figure 6 As shown, the leakage detection device 100 according to an embodiment of this application includes: a time window pressure acquisition module 110, used to perform event detection and event window segmentation on the original pressure data stream based on a preset negative threshold to obtain event window pressure time-series data; a pressure time-frequency spectrum generation module 120, used to perform continuous wavelet transform on the event window pressure time-series data to obtain a pressure time-frequency spectrum image; an event classification module 130, used to perform event classification based on a convolutional neural network on the pressure time-frequency spectrum image to obtain event categories and their confidence levels; and a leakage event analysis module 140, used to confirm leakage events and locate leaks based on event categories, their confidence levels, and event window pressure time-series data to obtain leakage locations and alarm signals.
[0073] As described above, the leak detection device 100 according to the embodiments of this application can be implemented in various wireless terminals, such as servers with low-voltage ride-through cooperative control algorithms for wind power converters. In one possible implementation, the leak detection device 100 according to the embodiments of this application can be integrated into the wireless terminal as a software module and / or a hardware module. For example, the leak detection device 100 can be a software module in the operating system of the wireless terminal, or it can be an application developed for the wireless terminal; of course, the leak detection device 100 can also be one of many hardware modules of the wireless terminal.
[0074] The various embodiments of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for detecting leaks, characterized in that, include: Based on a preset negative threshold, event detection and event window segmentation are performed on the original pressure data stream to obtain event window pressure time series data; Continuous wavelet transform is performed on the pressure time-series data of the event window to obtain a pressure time-frequency spectrum image; The pressure time-frequency spectrum image is subjected to event classification based on a convolutional neural network to obtain the event category and its confidence level; Based on the event category and its confidence level, as well as the event window pressure time series data, leakage events are confirmed and leaks are located to obtain the leak location and alarm signal; The pressure time-frequency spectrum image is subjected to event classification based on a convolutional neural network to obtain event categories and their confidence levels, including: The pressure time-frequency spectrum image is input into the convolutional base part of the convolutional neural network to obtain the pressure time-frequency spectrum visual feature encoding vector; The pressure time-frequency map visual feature encoding vector is input into the feature sparse ablation part of the convolutional neural network to obtain the pressure time-frequency map visual feature sparse encoding vector. The sparse encoded vector of the visual features of the pressure time-frequency map is input into the classification head of the convolutional neural network to obtain the event category and its confidence level. The pressure time-frequency map visual feature encoding vector is input into the feature sparse ablation part of the convolutional neural network to obtain the pressure time-frequency map visual feature sparse encoding vector, including: Fine-grained ablation is performed on the visual feature encoding vector of the pressure time-frequency spectrum to obtain the visually ablated feature vector of the pressure time-frequency spectrum, expressed by the formula: v ab =v⊙m+P(v⊙(1-m)) P(x) = W 2 σ(W 1 x+b) in, v This is the encoding vector for the visual features of the pressure time-frequency spectrum. m∈{0,1} For learnable sparse mask weights, ⊙ represents positional dot product. P(x) This is a deep feature extractor based on convolutional neural networks, where σ is the sigmoid function, and W1 and W2 are the first and second trainable weight matrices, respectively. b v is a trainable bias vector. ab The feature vector after visual ablation of the pressure time-frequency spectrum; The feature ablation gain of the visually ablated feature vector of the pressure time-frequency spectrum relative to the visual feature encoding vector of the pressure time-frequency spectrum is calculated and expressed by the formula: G(v,v ab =JS(Softmax(v ab ) ‖ Softmax(v)) in, Softmax for Softmax function, JS(· || ·) express Jensen-Shannon divergence, G(v,v ab ) This indicates the ablation of the actual gain in the visual features of the pressure time-frequency spectrum; In response to the feature ablation gain satisfying a preset condition, the feature vector after visual ablation of the pressure time-frequency spectrum is set as the sparse coding vector of the visual features of the pressure time-frequency spectrum, expressed by the formula: ; in, τ For the preset threshold, γ These are trainable weight coefficients. v en The sparse encoding vector for the visual features of the pressure time-frequency spectrum.
2. The leakage detection method according to claim 1, characterized in that, Based on a preset negative threshold, event detection and event window segmentation are performed on the raw pressure data stream to obtain event window pressure time-series data, including: Real-time gradient calculation is performed on the raw pressure data stream to obtain the pressure gradient data stream; Each pressure gradient data in the pressure gradient data stream is compared with the preset negative threshold, and the timestamp corresponding to the first data point that is less than the preset negative threshold is used as the trigger time. Based on the trigger time, the original pressure data stream is backtracked and traced back to obtain the event window pressure timing data.
3. The leakage detection method according to claim 2, characterized in that, The backtracking time is 2 seconds; the tracking time is 8 seconds.
4. The leakage detection method according to claim 1, characterized in that, Performing continuous wavelet transform on the pressure time-series data of the event window to obtain a pressure time-frequency spectrum image includes: Perform continuous wavelet transform on the event window pressure time series data to obtain the wavelet coefficient matrix; The wavelet coefficient matrix is normalized to obtain the pressure time-frequency spectrum image.
5. The leakage detection method according to claim 1, characterized in that, The convolutional base portion includes multiple combined modules consisting of convolutional layers, activation layers, and pooling layers.
6. The leakage detection method according to claim 1, characterized in that, Based on event categories and their confidence levels, as well as event window pressure time-series data, leakage events are confirmed and leaks are located to obtain the leak location and alarm signal, including: An alarm signal is triggered when the event category is a real leak and the confidence level is higher than the high confidence threshold; The arrival time of the negative pressure wave is extracted from the pressure time series data in the event window; Based on the arrival time of the negative pressure wave, the distance of the leak point relative to the upstream pressure sensor is calculated; The location of the leak is determined based on the location information of the upstream pressure sensor and the distance of the leak point relative to the upstream pressure sensor.
7. The leakage detection method according to claim 6, characterized in that, Based on the arrival time of the negative pressure wave, the distance between the leak point and the upstream pressure sensor is calculated, including: based on the arrival time of the negative pressure wave, the distance between the leak point and the upstream pressure sensor is calculated using the following formula, which is: L leak =(L total +TDOA*Wave speed ) / 2 TDOA= | t downstream -t upstream | in, t downstream and t upstream The arrival time of the negative pressure wave. L total The distance between the upstream and downstream pressure sensors. Wave speed This represents the propagation speed of the pressure wave.
8. A leakage detection device for performing the method as described in any one of claims 1 to 7, characterized in that, include: The time window pressure acquisition module is used to perform event detection and event window segmentation on the raw pressure data stream based on a preset negative threshold to obtain event window pressure time series data. The pressure time-frequency spectrum generation module is used to perform continuous wavelet transform on the pressure time-series data of the event window to obtain a pressure time-frequency spectrum image. An event classification module is used to perform event classification on the pressure time-frequency spectrum image based on a convolutional neural network to obtain the event category and its confidence level; The leak event analysis module is used to confirm and locate leak events based on event categories, their confidence levels, and event window pressure time series data, in order to obtain the leak location and alarm signal.
Citation Information
Patent Citations
Pipe network leakage detection and positioning method based on variational mode decomposition and neural network
CN115978464A
Pipe network leakage detection method and device, electronic equipment and medium
CN119123333A
FBG (fiber bragg grating) sensor fault positioning method and system
CN119756453A