A burst pipe detection method based on a bidirectional LSTM autoencoder
By using a bidirectional LSTM autoencoder-based method to preprocess and extract features from high-frequency pressure data of water supply networks, the problem of low sensitivity in pipe burst detection in existing technologies is solved. This enables real-time and accurate detection of pipe burst events, adapts to complex patterns, and improves the sensitivity and accuracy of detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2025-01-08
- Publication Date
- 2026-04-17
AI Technical Summary
Existing pipe burst detection technologies for water supply networks suffer from low detection sensitivity, making it difficult to detect burst events in a timely manner. In particular, there is insufficient research on high-frequency data in large and complex pipe networks, and a lack of identification and extraction of burst data features.
A bidirectional LSTM autoencoder-based method is used to preprocess the real-time high-frequency pressure data of the monitoring points. The high-frequency pressure components are extracted by discrete wavelet transform, and a bidirectional LSTM autoencoder model is built. The dataset is divided into a training set and a test set. The model is trained using the training set, and the reconstruction error threshold is determined. The reconstruction error of the test set is used to determine whether to issue a pipe burst alarm.
It enables real-time and accurate detection of pipe burst events, can sensitively capture pressure transients, improves detection sensitivity and accuracy, adapts to complex abnormal patterns, and reduces the impact of normal residential water demand changes on pressure changes.
Smart Images

Figure CN120067565B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water supply network operation status diagnosis and deep learning intersection technology, and in particular to a method for detecting pipe bursts based on a bidirectional LSTM autoencoder. Background Technology
[0002] Over long periods of operation, urban water supply networks gradually age due to the cumulative effects of structural fatigue, pipe corrosion, ground subsidence, and third-party factors (such as surface loads). This can lead to pipe bursts in pressurized pipelines, causing significant water loss in a short period and potentially damaging the urban environment and contaminating drinking water. In 2022, the Ministry of Housing and Urban-Rural Development and the National Development and Reform Commission jointly issued the "Notice on Strengthening Leakage Control of Public Water Supply Networks," which explicitly proposed building a precise, efficient, safe, and long-term leakage control system for water supply networks and emphasized improving information and intelligent management. Against this backdrop, research on rapid detection of water supply network bursts can provide crucial support for timely repair, reducing water loss, and ensuring water supply safety.
[0003] Currently, Supervisory Control and Data Acquisition (SCADA) systems have been widely used in urban water supply. SCADA systems can acquire key data such as flow and pressure of the pipeline network in real time, realize comprehensive monitoring of the pipeline network operation status, and provide rich data support for the detection of pipe burst events. At present, based on SCADA data, combined with data mining, hydraulic simulation and other methods, some relatively effective methods for detecting pipe burst events have been developed at home and abroad. However, these methods still have the following limitations: (1) Most of the existing studies use 5-15 minute steady-state pressure data. Although slow leakage events, valve operation and other pressure changes can be detected in a few minutes or hours, pipe burst events often cause pressure transients within a few seconds. If steady-state data is used for detection, the detection results of pipe burst will be delayed and the detection sensitivity will be low. (2) With the widespread application of high-frequency pressure sensors, some studies have begun to analyze transient monitoring data to detect pipe burst events, such as using multi-scale wavelet analysis and short-time Fourier transform. However, currently, there is limited research experience on high-frequency data from large and complex pipe networks, and there is also a lack of attention to the identification and extraction of the characteristics of the pipe burst data itself. In summary, although there has been a large amount of research on pipe burst detection, the existing pipe burst detection technology is still not effective enough to meet practical needs. Summary of the Invention
[0004] In a first aspect, embodiments of the present invention provide a method for detecting burst tubes based on a bidirectional LSTM autoencoder, the method comprising:
[0005] Preprocess the real-time high-frequency pressure data from the monitoring points to construct a peak feature sequence dataset of the real-time high-frequency pressure data;
[0006] Discrete wavelet transform is used to separate the peak feature sequence dataset into high and low frequencies, and the high-frequency pressure component is extracted to obtain the high-frequency pressure component dataset.
[0007] A bidirectional LSTM autoencoder model was constructed, and the high-frequency stress component dataset was divided into training and test sets.
[0008] The bidirectional LSTM autoencoder model is trained using the training set, the training set data sequence is reconstructed, the reconstruction error of the training set is calculated, and the reconstruction error threshold is determined accordingly.
[0009] The trained bidirectional LSTM autoencoder model is used to process the test set, reconstruct the test set data sequence, calculate the reconstruction error of the test set, and issue a pipe burst alarm when the reconstruction error exceeds the threshold.
[0010] In some possible implementations of the first aspect, the real-time high-frequency pressure data from the monitoring points are preprocessed to construct a peak feature sequence dataset of the real-time high-frequency pressure data, including:
[0011] Extract the raw 256Hz high-frequency pressure monitoring dataset from the monitoring points during the time period to be detected;
[0012] Clean the original high-frequency pressure monitoring dataset, removing duplicate, missing, and outlier data.
[0013] Wavelet denoising was performed on the cleaned high-frequency pressure monitoring dataset;
[0014] The high-frequency pressure monitoring dataset after noise reduction is resampled and features are extracted to construct a one-dimensional time series dataset containing transient features, namely the peak feature sequence dataset.
[0015] In some possible implementations of the first aspect, the original high-frequency pressure monitoring dataset is cleaned to handle duplicate, missing, and outlier data, including:
[0016] If the pressure data of the monitoring points in the original high-frequency pressure monitoring dataset contains duplicate or disordered timestamps, the data of the duplicate timestamps within the corresponding time period will be deleted to ensure that the timestamps are correct.
[0017] If there are short-term gaps in the pressure data of monitoring points in the original high-frequency pressure monitoring dataset, then linear interpolation is performed on the pressure data of monitoring points within the corresponding time period to fill in the missing values.
[0018] If the pressure data of the monitoring points in the original high-frequency pressure monitoring dataset is missing for a long period of time, the pressure data of the monitoring points at the same time the previous day will be used to replace it.
[0019] Using the pressure data from monitoring points under normal operating conditions as a reference, high and low thresholds are set to remove abnormal pressure data from monitoring points in the original high-frequency pressure monitoring dataset.
[0020] In some possible implementations of the first aspect, wavelet denoising is performed on the cleaned high-frequency pressure monitoring dataset, including:
[0021] Multi-level discrete wavelet transform was performed on the cleaned high-frequency pressure monitoring dataset. The wavelet basis function used was db4, and decomposition was performed using a soft thresholding function and the VisuShrink universal threshold.
[0022]
[0023] Where T is the VisuShrink universal threshold; N is the original signal length; d j,k represents the k-th wavelet coefficient at the j-th decomposition scale in the discrete wavelet transform; These are the wavelet coefficients after processing with a soft thresholding function;
[0024] Observe the signals after each level of discrete wavelet decomposition. When the effective signal is smooth and no high-frequency signal is decomposed, determine the corresponding wavelet decomposition level k as the level of wavelet denoising for each step.
[0025] The wavelet coefficients are reconstructed at level k to obtain the denoised high-frequency pressure monitoring dataset.
[0026] In some possible implementations of the first aspect, the denoised high-frequency pressure monitoring dataset is resampled and features are extracted to construct a one-dimensional time series dataset containing transient features, including:
[0027] The 256Hz pressure data in the noise-reduced high-frequency pressure monitoring dataset were resampled, and the maximum value p within 1 second was extracted. max and minimum value p min ;
[0028] Calculate the midpoint p of each time subsequence of length 1s. std As a benchmark value;
[0029] A new variable p, representing the peak pressure per second, is constructed based on the following formula. value This yields a one-dimensional time series dataset with a frequency of 1 second that includes transient features;
[0030]
[0031] Where, pmax p is the maximum pressure per second. min p is the minimum pressure per second. std This represents the median pressure per second.
[0032] In some possible implementations of the first aspect, discrete wavelet transform is used to separate the peak feature sequence dataset into high and low frequencies, extracting the high-frequency pressure component to obtain a high-frequency pressure component dataset, including:
[0033] A multi-level discrete wavelet transform is performed on the original pressure peak feature column vector P in the peak feature sequence dataset. The wavelet basis function is db4, and the decomposition level k is half of the maximum decomposition level. Through k-level wavelet decomposition, one approximation coefficient f and k detail coefficients w are obtained respectively. i ;
[0034] Retain the approximation coefficient f, and reduce the detail coefficients w at each level. i Set the value to 0, perform k-level wavelet reconstruction, and obtain the reconstructed low-frequency pressure column vector P';
[0035] The difference between the original pressure peak feature column vector P and the reconstructed low-frequency pressure column vector P' is calculated, and the high-frequency pressure component dataset is obtained based on this.
[0036] In some possible implementations of the first aspect, a bidirectional LSTM autoencoder model is constructed, and the high-frequency stress component dataset is divided into a training set and a test set, including:
[0037] An autoencoder model is established, in which both the encoder and decoder are BiLSTM networks. The LSTM layer in the BiLSTM network has 32 units, a window size of 300, 1 feature at each time point, and ReLU activation function.
[0038] The high-frequency pressure component dataset was divided into a set of subsequences with a length of 5 minutes.
[0039] Select 80% of the subsequences as the training set and the remaining 20% as the test set;
[0040] Perform preliminary screening on all 5-minute subsequences in the training set to remove abnormal subsequences;
[0041] The training and test sets are normalized using the following formula:
[0042]
[0043] Where, x min x is the minimum value in the original data. max x represents the maximum value in the original data. norm This is the normalized value.
[0044] In some possible implementations of the first aspect, all 5-minute subsequences in the training set are initially screened to remove abnormal subsequences, including:
[0045] Calculate the range of each 5-minute subsequence in the training set;
[0046] Calculate the mean μ of the range i and standard deviation σ i ;
[0047] Selecting samples with a range greater than μ from the training set i +3σ i The subsequences are then removed.
[0048] In some possible implementations of the first aspect, a bidirectional LSTM autoencoder model is trained using a training set, the training set data sequence is reconstructed, the reconstruction error of the training set is calculated, and a reconstruction error threshold is determined accordingly, including:
[0049] The training set is input into the bidirectional LSTM autoencoder model for training, where the Adam optimizer is used, the learning rate is set to 0.0001, the batch size is set to 32, the number of iterations is set to 50, and the loss function is set to mean squared error (MSE).
[0050]
[0051] Where n is the number of samples; y i For reconstructed values; The actual value;
[0052] The mean square error (MSE) is taken as the reconstruction error (RE), and the μ+2σ of the reconstruction error distribution of the training set is taken as the reconstruction error threshold.
[0053] In some possible implementations of the first aspect, a trained bidirectional LSTM autoencoder model is used to process the test set, reconstruct the test set data sequence, calculate the reconstruction error of the test set, and issue a burst alarm when the reconstruction error exceeds a threshold, including:
[0054] Input the test set into the trained bidirectional LSTM autoencoder model, reconstruct the test set data sequence, and calculate the reconstruction error of each subsequence of the test set.
[0055] If the subsequence reconstruction error is less than the reconstruction error threshold, it indicates that the pressure data within the corresponding time period is normal and no pipe burst has occurred; if the subsequence reconstruction error is greater than or equal to the reconstruction error threshold, it indicates that the pressure data within the corresponding time period has changed drastically and a pipe burst has occurred, thus triggering a pipe burst alarm.
[0056] Secondly, embodiments of the present invention provide a tube bursting detection device based on a bidirectional LSTM autoencoder, the device comprising:
[0057] The preprocessing module is used to preprocess the real-time high-frequency pressure data from the monitoring points and construct a peak feature sequence dataset of the real-time high-frequency pressure data.
[0058] The extraction module is used to perform high- and low-frequency separation on the peak feature sequence dataset using discrete wavelet transform, and extract the high-frequency pressure component to obtain the high-frequency pressure component dataset.
[0059] The module is used to build a bidirectional LSTM autoencoder model and divide the high-frequency stress component dataset into training and test sets.
[0060] The training module is used to train the bidirectional LSTM autoencoder model using the training set, reconstruct the training set data sequence, calculate the reconstruction error of the training set, and determine the reconstruction error threshold accordingly.
[0061] The processing module is used to process the test set using the trained bidirectional LSTM autoencoder model, reconstruct the test set data sequence, calculate the reconstruction error of the test set, and issue a burst tube alarm when the reconstruction error exceeds the threshold.
[0062] Thirdly, embodiments of the present invention provide an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.
[0063] Fourthly, embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described above.
[0064] In summary, according to the embodiments of the present invention, at least the following technical effects are achieved:
[0065] (1) Pressure monitoring does not require expensive equipment and can easily obtain relatively stable monitoring data. Moreover, with the continuous advancement of hardware and storage technology, the sampling frequency can be further increased. Some regions at home and abroad have begun to use high-frequency monitoring equipment to collect data, which greatly expands the application space for pipe burst detection based on high-frequency pressure data. This invention samples and analyzes high-frequency pressure data, which can more accurately reflect the instantaneous changes in pressure in the water supply network, sensitively capture the pressure transients caused by pipe burst events, ensure real-time detection, and save time for subsequent emergency repairs.
[0066] (2) This invention extracts the high-frequency pressure component caused by the burst pipe through wavelet transform, which can specifically separate the pressure characteristics caused by the burst pipe, avoid the influence of pressure fluctuations caused by changes in normal residents' water demand on the pressure change of the burst pipe, and ensure the accuracy of the detection results.
[0067] (3) This invention extends the traditional unidirectional network by introducing a second layer of inverse LSTM units based on a bidirectional LSTM autoencoder. This allows for the full utilization of past and future sequence information to reconstruct most normal sequences. For a very small number of abnormal sequences, the model struggles to mine their patterns, resulting in relatively large reconstruction errors. This allows for accurate identification of these abnormal sequences as pressure transient events caused by pipe bursts. This method has strong nonlinear modeling capabilities, enabling it to better adapt to complex abnormal patterns. It can also detect pressure transient events with small amplitude changes, further improving detection sensitivity.
[0068] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0069] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the invention. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0070] Figure 1 A flowchart of a burst tube detection method based on a bidirectional LSTM autoencoder provided in an embodiment of the present invention;
[0071] Figure 2 This is a schematic diagram of a peak feature sequence dataset obtained after data preprocessing at a monitoring point, as provided in an embodiment of the present invention.
[0072] Figure 3 This is a schematic diagram of the high-frequency pressure components of a monitoring point after discrete wavelet transform, provided in an embodiment of the present invention.
[0073] Figure 4 This is a schematic diagram illustrating the loss statistics of pressure data at a certain monitoring point during model training, as provided in an embodiment of the present invention.
[0074] Figure 5 This is a schematic diagram of the reconstruction error distribution and reconstruction error threshold of a training set of a certain monitoring point provided in an embodiment of the present invention;
[0075] Figure 6 A structural diagram of a burst tube detection device based on a bidirectional LSTM autoencoder provided in an embodiment of the present invention;
[0076] Figure 7 This is a structural diagram of an exemplary electronic device capable of implementing embodiments of the present invention. Detailed Implementation
[0077] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0078] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.
[0079] To address the technical problems mentioned in the background art, this invention provides a method, apparatus, device, and storage medium for detecting burst pipes based on a bidirectional LSTM autoencoder. Specifically, real-time high-frequency pressure data from monitoring points is preprocessed to construct a peak feature sequence dataset of real-time high-frequency pressure data; high and low frequencies are separated from the peak feature sequence dataset using discrete wavelet transform to extract high-frequency pressure components, resulting in a high-frequency pressure component dataset; a bidirectional LSTM autoencoder model is built, and the high-frequency pressure component dataset is divided into a training set and a test set; the model is trained using the training set, the training set data sequence is reconstructed, the reconstruction error of the training set is calculated, and a reconstruction error threshold is determined accordingly; the trained model is used to process the test set, the test set data sequence is reconstructed, the reconstruction error of the test set is calculated, and a burst pipe alarm is issued when the reconstruction error is greater than or equal to the reconstruction error threshold.
[0080] In this way, real-time high-frequency pressure data can be used to provide timely early warning of pipe bursts. In addition, the present invention has strong nonlinear modeling capabilities, which can better adapt to complex abnormal modes and can also detect pressure transient events with small amplitude changes, making the detection results more accurate.
[0081] The following detailed description, in conjunction with the accompanying drawings, of a method, apparatus, device, and storage medium for detecting burst tubes based on a bidirectional LSTM autoencoder, provided by an embodiment of the present invention, will be provided in detail through specific embodiments.
[0082] Figure 1A flowchart of a burst tube detection method based on a bidirectional LSTM autoencoder provided for an embodiment of the present invention is shown below. Figure 1 As shown, the burst pipe detection method 100 may include:
[0083] S110, preprocess the real-time high-frequency pressure data from the monitoring points to construct a peak feature sequence dataset of the real-time high-frequency pressure data.
[0084] Extract the raw 256Hz high-frequency pressure monitoring dataset from the monitoring points during the detection period.
[0085] The original high-frequency pressure monitoring dataset was cleaned to remove duplicate, missing, and abnormal data.
[0086] Specifically:
[0087] If the pressure data at monitoring points in the original high-frequency pressure monitoring dataset contains duplicate or incorrect timestamps, the data with duplicate timestamps within the corresponding time period will be deleted to ensure the correct timestamps. If the pressure data at monitoring points in the original high-frequency pressure monitoring dataset has a short period of missing data (<5 min), the pressure data at monitoring points within the corresponding time period will be linearly interpolated to fill in the missing values. If the pressure data at monitoring points in the original high-frequency pressure monitoring dataset has a long period of missing data, the pressure data at the same time the previous day will be used to replace it. Using the pressure data at monitoring points under normal operating conditions as a reference, high and low thresholds will be set to remove abnormal pressure data at monitoring points in the original high-frequency pressure monitoring dataset.
[0088] Wavelet denoising was performed on the cleaned high-frequency pressure monitoring dataset. Specifically:
[0089] Multi-level discrete wavelet transform was performed on the cleaned high-frequency pressure monitoring dataset. The wavelet basis function used was db4, and decomposition was performed using a soft thresholding function and the VisuShrink universal threshold.
[0090]
[0091] Where T is the VisuShrink universal threshold; N is the original signal length; d j,k represents the k-th wavelet coefficient at the j-th decomposition scale in the discrete wavelet transform; These are the wavelet coefficients after processing with a soft threshold function.
[0092] Next, the signals after each level of discrete wavelet decomposition are observed. When the effective signal is smooth and no high-frequency signal is decomposed, the corresponding wavelet decomposition level k is determined as the level of wavelet denoising for each step. Subsequently, the wavelet coefficients are reconstructed at level k to obtain the denoised high-frequency pressure monitoring dataset.
[0093] The denoised high-frequency pressure monitoring dataset is resampled and its features are extracted to construct a one-dimensional time series dataset containing transient features, i.e., a peak feature sequence dataset. Specifically:
[0094] The 256Hz pressure data in the noise-reduced high-frequency pressure monitoring dataset were resampled, and the maximum value p within 1 second was extracted. max and minimum value p min Next, the midpoint p of each time subsequence of length 1s is calculated. std As a baseline, a new variable p, representing the peak pressure characteristic per second, is constructed based on the following formula. value This yields a one-dimensional time series dataset with transient features at a frequency of 1 second.
[0095]
[0096] Where, p max p is the maximum pressure per second. min p is the minimum pressure per second. std This represents the median pressure per second.
[0097] S120 uses discrete wavelet transform to separate the peak feature sequence dataset into high and low frequencies, extracts the high-frequency pressure component, and obtains the high-frequency pressure component dataset.
[0098] A multi-level discrete wavelet transform is performed on the original pressure peak feature column vector P in the peak feature sequence dataset. The wavelet basis function is db4, and the decomposition level k is half of the maximum decomposition level. Through k-level wavelet decomposition, one approximation coefficient f and k detail coefficients w are obtained respectively. i .
[0099] Retain the approximation coefficient f, and reduce the detail coefficients w at each level. i Set it to 0, perform k-level wavelet reconstruction, and obtain the reconstructed low-frequency pressure column vector P'.
[0100] The difference between the original pressure peak feature column vector P and the reconstructed low-frequency pressure column vector P' is calculated, and the high-frequency pressure component dataset is obtained based on this.
[0101] S130, build a bidirectional LSTM autoencoder model, and divide the high-frequency pressure component dataset into training set and test set.
[0102] An autoencoder model is established, in which both the encoder and decoder are BiLSTM networks. The number of units in the LSTM layer of the BiLSTM network is 32, the window size is 300, the number of features at each time point is 1, and the activation function is ReLU.
[0103] The high-frequency stress component dataset was divided into a set of subsequences with a length of 5 minutes. 80% of the subsequences were selected as the training set, and the remaining 20% were selected as the test set.
[0104] All 5-minute subsequences in the training set are initially screened to remove abnormal subsequences. Specifically:
[0105] Calculate the range R of each 5-minute subsequence in the training set. i Calculate the mean μ of the range i and standard deviation σ i Select those with a range greater than μ in the training set. i +3σ i The subsequences are then removed.
[0106] The training and test sets are then subjected to Min-Max normalization based on the following formula:
[0107]
[0108] Where, x min x is the minimum value in the original data. max x represents the maximum value in the original data. norm This is the normalized value.
[0109] S140: Train the bidirectional LSTM autoencoder model using the training set, reconstruct the training set data sequence, calculate the reconstruction error of the training set, and determine the reconstruction error threshold accordingly.
[0110] The training set is input into the bidirectional LSTM autoencoder model for training, where the Adam optimizer is used, the learning rate is 0.0001, the batch size is 32, the number of epochs is 50, and the loss function is set to mean squared error (MSE).
[0111]
[0112] Where n is the number of samples; y i For reconstructed values; This is the actual value.
[0113] The mean square error (MSE) is taken as the reconstruction error (RE), and the μ+2σ (95.4%) of the reconstruction error distribution of the training set is taken as the reconstruction error threshold.
[0114] S150 uses a trained bidirectional LSTM autoencoder model to process the test set, reconstruct the test set data sequence, calculate the reconstruction error of the test set, and issue a burst alarm when the reconstruction error exceeds the threshold.
[0115] The test set is input into the trained bidirectional LSTM autoencoder model, which reconstructs the test set data sequence and calculates the reconstruction error of each subsequence of the test set.
[0116] If the subsequence reconstruction error is less than the reconstruction error threshold, it indicates that the pressure data within the corresponding time period is normal and no pipe burst has occurred; if the subsequence reconstruction error is greater than or equal to the reconstruction error threshold, it indicates that the pressure data within the corresponding time period has changed drastically and a pipe burst has occurred, thus triggering a pipe burst alarm.
[0117] In summary, according to the embodiments of the present invention, at least the following technical effects are achieved:
[0118] (1) Pressure monitoring does not require expensive equipment and can easily obtain relatively stable monitoring data. Moreover, with the continuous advancement of hardware and storage technology, the sampling frequency can be further increased. Some regions at home and abroad have begun to use high-frequency monitoring equipment to collect data, which greatly expands the application space for pipe burst detection based on high-frequency pressure data. This invention samples and analyzes high-frequency pressure data, which can more accurately reflect the instantaneous changes in pressure in the water supply network, sensitively capture the pressure transients caused by pipe burst events, ensure real-time detection, and save time for subsequent emergency repairs.
[0119] (2) This invention extracts the high-frequency pressure component caused by the burst pipe through wavelet transform, which can specifically separate the pressure characteristics caused by the burst pipe, avoid the influence of pressure fluctuations caused by changes in normal residents' water demand on the pressure change of the burst pipe, and ensure the accuracy of the detection results.
[0120] (3) This invention extends the traditional unidirectional network by introducing a second layer of inverse LSTM units based on a bidirectional LSTM autoencoder. This allows for the full utilization of past and future sequence information to reconstruct most normal sequences. For a very small number of abnormal sequences, the model struggles to mine their patterns, resulting in relatively large reconstruction errors. This allows for accurate identification of these abnormal sequences as pressure transient events caused by pipe bursts. This method has strong nonlinear modeling capabilities, enabling it to better adapt to complex abnormal patterns. It can also detect pressure transient events with small amplitude changes, further improving detection sensitivity.
[0121] To facilitate understanding, the following example, which focuses on detecting whether a pressure transient event occurred at a monitoring point in the water supply network of City N on December 6, 2023, will further illustrate the implementation process of the pipe burst detection method 100 based on a bidirectional LSTM autoencoder.
[0122] (1) Preprocessing of real-time high-frequency pressure data from a single monitoring point to construct a peak feature sequence dataset of real-time high-frequency pressure data. First, extract the original 256Hz high-frequency pressure monitoring dataset for the monitoring point during the detection period (December 2, 2023 to December 6, 2023, a total of 5 days). Clean the original high-frequency pressure monitoring dataset, delete data with repeated times within the time period, perform linear interpolation on pressure data from monitoring points with short-term (<5min) missing values, replace pressure data from monitoring points with long-term missing values with pressure data from monitoring points at the same time the previous day, and finally remove abnormal pressure data from monitoring points with values higher than 100m and lower than 1m. Next, perform multi-level discrete wavelet transform on the cleaned high-frequency pressure monitoring dataset, using db4 as the wavelet basis function and 5 as the wavelet decomposition level. Process the wavelet coefficients using a soft thresholding function and the VisuShrink universal threshold, and then reconstruct it at 5 levels to obtain the effective high-frequency pressure monitoring dataset after noise reduction. Finally, the 256Hz pressure data in the effective high-frequency pressure monitoring dataset were resampled, and the maximum and minimum values within 1 second were extracted. A one-dimensional pressure time series dataset containing transient characteristics, i.e., the peak feature sequence dataset, was constructed based on the difference between the peak value and the baseline median. For example, the peak feature sequence dataset can be as follows: Figure 2 As shown, it is a stress dataset containing transient features with a frequency of 1 second.
[0123] (2) Discrete wavelet transform is used to separate the high and low frequencies of the peak feature sequence dataset, extracting the high-frequency pressure component to obtain the high-frequency pressure component dataset. The maximum wavelet decomposition level of the original pressure peak feature column vector P in the peak feature sequence dataset is 12, so it is decomposed into a 6-level wavelet decomposition to obtain one approximation coefficient and six detail coefficients. After setting all detail coefficients to 0, a 6-level wavelet reconstruction is performed. The difference between the original pressure peak feature column vector P and the reconstructed low-frequency pressure column vector P' is the high-frequency pressure component H of the monitoring point. For example, it can be done as follows: Figure 3 As shown, a high-frequency pressure component dataset is obtained from this.
[0124] (3) A bidirectional LSTM autoencoder model was constructed, and the high-frequency stress component dataset was divided into training and test sets. The number of units in the LSTM layer of the BiLSTM network was set to 32, the window size was set to 300, the number of features at each time point was set to 1, and the activation function was set to ReLU. The high-frequency stress component dataset was divided into a set of subsequences with a length of 5 minutes. The 1152 5-minute subsequences from the first 4 days were set as the training set, and the 288 5-minute subsequences from the last day were set as the test set. Then, all subsequences in the training set were initially screened to remove abnormal subsequences. Finally, the training and test sets were subjected to Min-Max normalization.
[0125] (4) Train the bidirectional LSTM autoencoder model using the training set, reconstruct the training set data sequence, and calculate the reconstruction error and threshold of the training set. The model training uses the Adam optimizer, with a learning rate of 0.0001, a batch size of 32, 50 epochs, and a loss function of mean squared error (MSE). Simultaneously, the MSE is taken as the reconstruction error RE, and μ+2σ (95.4%) of the reconstruction error distribution of the training set is taken as the reconstruction error threshold, which is 0.00759 here. For example, Figure 4 The loss statistics during model training are shown; Figure 5 The reconstruction error distribution and reconstruction error threshold of the training set are shown.
[0126] (5) The trained bidirectional LSTM autoencoder model is used to process the test set, reconstruct the test set data sequence, and calculate the reconstruction error of the test set. When the reconstruction error exceeds the reconstruction error threshold, a pipe burst alarm is issued. The test set is input into the trained bidirectional LSTM autoencoder model, which reconstructs the test set data sequence. The reconstruction error of each subsequence is calculated using the mean squared error (MSE). The reconstruction error of the 145th subsequence in the test set is 1.47e+41, which is much larger than the set reconstruction error threshold. This indicates that a pressure transient event occurred between 12:00 and 12:05 on December 6, 2023, thus triggering the pipe burst alarm.
[0127] To verify the accuracy of the detection results, this invention compares the detection results with actual water release experiment records. According to the experiment records, the water company conducted a water release experiment via valve switching at approximately 12:00 on December 6, 2023, resulting in a pressure transient event, which is completely consistent with the detection results of this invention.
[0128] In view of this, the present invention can accurately detect pressure transient events in water supply networks and issue timely warnings of pipe bursts, which is of great significance for pipe burst repair and ensuring water supply safety.
[0129] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0130] The above is an introduction to the method embodiments. The following describes the solution of the present invention further through device embodiments.
[0131] Figure 6 A structural diagram of a burst tube detection device based on a bidirectional LSTM autoencoder provided in an embodiment of the present invention is shown below. Figure 6 As shown, the burst pipe detection device 600 may include:
[0132] The preprocessing module 610 is used to preprocess the real-time high-frequency pressure data from the monitoring points and construct a peak feature sequence dataset of the real-time high-frequency pressure data.
[0133] The extraction module 620 is used to perform high- and low-frequency separation on the peak feature sequence dataset using discrete wavelet transform, extract the high-frequency pressure component, and obtain the high-frequency pressure component dataset.
[0134] Module 630 is used to build a bidirectional LSTM autoencoder model and divide the high-frequency pressure component dataset into training and testing sets.
[0135] The training module 640 is used to train the bidirectional LSTM autoencoder model using the training set, reconstruct the training set data sequence, calculate the reconstruction error of the training set, and determine the reconstruction error threshold accordingly.
[0136] The processing module 650 is used to process the test set using the trained bidirectional LSTM autoencoder model, reconstruct the test set data sequence, calculate the reconstruction error of the test set, and issue a burst tube alarm when the reconstruction error exceeds the threshold.
[0137] Understandable Figure 6 Each module / unit in the shown burst tube detection device 600 has the ability to realize Figure 1 The functions of each step in the tube burst detection method 100 shown, and the corresponding technical effects they achieve, will not be elaborated here for the sake of brevity.
[0138] Figure 7 This is a structural diagram of an exemplary electronic device capable of implementing embodiments of the present invention. Electronic device 700 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 700 may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown in this invention, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0139] like Figure 7 As shown, the electronic device 700 may include a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the electronic device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0140] Multiple components in electronic device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of displays, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0141] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as method 100. For example, in some embodiments, method 100 may be implemented as a computer program product, including a computer program tangibly contained in a computer-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of method 100 described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform method 100 by any other suitable means (e.g., by means of firmware).
[0142] The various embodiments described above in this invention can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), payload programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0144] In the context of this invention, a computer-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0145] It should be noted that the present invention also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute method 100 and achieve the corresponding technical effects achieved by the embodiments of the present invention in executing the method. For the sake of brevity, they will not be described in detail here.
[0146] In addition, the present invention also provides a computer program product, which includes a computer program that implements method 100 when executed by a processor.
[0147] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this invention does not impose any limitations on them.
[0148] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for burst detection based on bidirectional LSTM autoencoder, characterized in that, The method includes: Preprocess the real-time high-frequency pressure data from the monitoring points to construct a peak feature sequence dataset of the real-time high-frequency pressure data; Discrete wavelet transform is used to separate the peak feature sequence dataset into high and low frequencies, and the high-frequency pressure component is extracted to obtain the high-frequency pressure component dataset. A bidirectional LSTM autoencoder model was constructed, and the high-frequency stress component dataset was divided into training and test sets. The bidirectional LSTM autoencoder model is trained using the training set, the training set data sequence is reconstructed, the reconstruction error of the training set is calculated, and the reconstruction error threshold is determined accordingly. The trained bidirectional LSTM autoencoder model is used to process the test set, reconstruct the test set data sequence, calculate the reconstruction error of the test set, and issue a burst tube alarm when the reconstruction error is greater than or equal to the reconstruction error threshold. The preprocessing of real-time high-frequency pressure data from monitoring points to construct a peak feature sequence dataset of real-time high-frequency pressure data includes: Extract the raw 256Hz high-frequency pressure monitoring dataset from the monitoring points during the time period to be detected; Clean the original high-frequency pressure monitoring dataset, removing duplicate, missing, and outlier data. Wavelet denoising was performed on the cleaned high-frequency pressure monitoring dataset; The high-frequency pressure monitoring dataset after noise reduction is resampled and features are extracted to construct a one-dimensional time series dataset containing transient features, namely, a peak feature sequence dataset. The process of resampling and feature extraction on the denoised high-frequency pressure monitoring dataset to construct a one-dimensional time series dataset containing transient features includes: The 256Hz pressure data in the noise-reduced high-frequency pressure monitoring dataset were resampled, and the maximum value within 1 second was extracted. and minimum value ; calculating the median value in each time sub-sequence of length 1 s as a reference value; The pressure peak per second feature new variable is constructed based on the following formula , to obtain a one-dimensional time series data set containing transient features with a frequency of 1s; ; wherein, is the maximum value of pressure per second, is the minimum value of pressure per second, is the median value of pressure per second.
2. The method of claim 1, wherein, The cleaning of the original high-frequency pressure monitoring dataset, including processing duplicate, missing, and outlier data, includes: If the pressure data of the monitoring points in the original high-frequency pressure monitoring dataset contains duplicate or disordered timestamps, the data of the duplicate timestamps within the corresponding time period will be deleted to ensure that the timestamps are correct. If there are short-term gaps in the pressure data of monitoring points in the original high-frequency pressure monitoring dataset, then linear interpolation is performed on the pressure data of monitoring points within the corresponding time period to fill in the missing values. If the pressure data of the monitoring points in the original high-frequency pressure monitoring dataset is missing for a long period of time, the pressure data of the monitoring points at the same time the previous day will be used to replace it. Using the pressure data from monitoring points under normal operating conditions as a reference, high and low thresholds are set to remove abnormal pressure data from monitoring points in the original high-frequency pressure monitoring dataset.
3. The method according to claim 1, characterized in that, The wavelet denoising process performed on the cleaned high-frequency pressure monitoring dataset includes: Multi-level discrete wavelet transform was performed on the cleaned high-frequency pressure monitoring dataset. The wavelet basis function used was db4, and decomposition was performed using a soft thresholding function and the VisuShrink universal threshold. ; ; Where T is the VisuShrink universal threshold; The original signal length; In the discrete wavelet transform, the first... The k-th wavelet coefficient at the layer decomposition scale; These are the wavelet coefficients after processing with a soft thresholding function; Observe the signals after each level of discrete wavelet decomposition. When the effective signal is smooth and no high-frequency signal is decomposed, determine the corresponding wavelet decomposition level. Let be the number of stages in each wavelet denoising step; The wavelet coefficients are reconstructed at level k to obtain the denoised high-frequency pressure monitoring dataset.
4. The method of claim 1, wherein, The discrete wavelet transform is used to separate the peak feature sequence dataset into high and low frequencies, extracting the high-frequency pressure component to obtain a high-frequency pressure component dataset, including: A multi-level discrete wavelet transform is performed on the original pressure peak feature column vector P in the peak feature sequence dataset. The wavelet basis function is db4, and the decomposition level k is half of the maximum decomposition level. Through k-level wavelet decomposition, one approximation coefficient f and k detail coefficients w are obtained respectively. i ; The approximation coefficients f are reserved, and each level of the detail coefficients w is set to 0, and k-level wavelet reconstruction is performed to obtain a reconstructed low-frequency pressure column vector P'; i The difference between the original pressure peak feature column vector P and the reconstructed low-frequency pressure column vector P' is calculated, and the high-frequency pressure component dataset is obtained based on this.
5. The method of claim 1, wherein, The construction of the bidirectional LSTM autoencoder model and the division of the high-frequency stress component dataset into training and testing sets include: An autoencoder model is established, in which both the encoder and decoder are BiLSTM networks. The LSTM layer in the BiLSTM network has 32 units, a window size of 300, 1 feature at each time point, and ReLU activation function. The high-frequency pressure component dataset was divided into a set of subsequences with a length of 5 minutes. Select 80% of the subsequences as the training set and the remaining 20% as the test set; Perform preliminary screening on all 5-minute subsequences in the training set to remove abnormal subsequences; The training and test sets are normalized using the following formula: ; wherein, is the minimum value in the original data, is the maximum value in the original data, is the normalized value.
6. The method according to claim 5, characterized in that, The preliminary screening of all 5-minute subsequences in the training set to remove abnormal subsequences includes: Calculate the range of each 5-minute subsequence in the training set; Calculate the mean μ of the range i and standard deviation σ i ; Selecting samples with a range greater than μ from the training set i +3σ i The subsequences are then removed.
7. The method of claim 1, wherein, The process of training a bidirectional LSTM autoencoder model using a training set, reconstructing the training set data sequence, calculating the reconstruction error of the training set, and determining the reconstruction error threshold based on this error includes: The training set is input into the bidirectional LSTM autoencoder model for training, where the Adam optimizer is used, the learning rate is set to 0.0001, the batch size is set to 32, the number of iterations is set to 50, and the loss function is set to mean squared error (MSE). ; wherein n is the number of samples; is the reconstructed value; is the true value; The mean square error (MSE) is taken as the reconstruction error (RE), and the μ+2σ of the reconstruction error distribution of the training set is taken as the reconstruction error threshold.
8. The method of claim 1, wherein, The process of using the trained bidirectional LSTM autoencoder model to process the test set, reconstruct the test set data sequence, calculate the reconstruction error of the test set, and issue a burst alarm when the reconstruction error is greater than or equal to a reconstruction error threshold includes: Input the test set into the trained bidirectional LSTM autoencoder model, reconstruct the test set data sequence, and calculate the reconstruction error of each subsequence of the test set. If the subsequence reconstruction error is less than the reconstruction error threshold, it indicates that the pressure data within the corresponding time period is normal and no pipe burst has occurred; if the subsequence reconstruction error is greater than or equal to the reconstruction error threshold, it indicates that the pressure data within the corresponding time period has changed drastically and a pipe burst has occurred, thus triggering a pipe burst alarm.
Citation Information
Patent Citations
Fault early warning method for transmission system of wind turbine generator
CN112834211A
Vehicle vibration signal denoising method based on wavelet decomposition
CN116383605A