A bi-lstm-based pipeline leakage detection and positioning method

CN118328316BActive Publication Date: 2026-08-07CHONGQING SPECIAL EQUIP TESTING & RES INST (CHONGQING SPECIAL EQUIP ACCIDENT EMERGENCY INVESTIGATION & PROCESSING CENT)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING SPECIAL EQUIP TESTING & RES INST (CHONGQING SPECIAL EQUIP ACCIDENT EMERGENCY INVESTIGATION & PROCESSING CENT)
Filing Date
2024-05-15
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0003]然而,在实际情况下,由于类似的压力变化瞬变,在正常工况下,如泵、阀门等操作下的压力变化可能被误认为为泄漏

Benefits of technology

[0043]本发明提供了一种基于BiLSTM的管道泄漏检测与定位方法。与现有技术相比具备以下有益效果:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118328316B_ABST
    Figure CN118328316B_ABST
Patent Text Reader

Abstract

The application discloses a pipeline leakage detection and positioning method based on BiLSTM, which comprises collecting pressure wave signals from different sensors, pre-processing and classifying the signals, calculating the time delay of pressure disturbance from different sensors, online estimating the NPW speed, using the TDOA method to position the leakage with the newly updated NPW speed when reporting the "leakage", and belongs to the technical field of pipeline leakage detection; the application proposes a pressure sequence classification scheme based on BiLSTM deep learning, which can not only identify leakage, but also identify typical periodic non-leakage pressure disturbance, and simultaneously proposes a method for calculating the leakage position without using empirical constants as the NPW speed, but using disturbance auxiliary positioning, and using non-leakage disturbance to online update the NPW speed; the method has high detection accuracy, rare false positives, and significantly reduces the leakage positioning error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pipeline leak detection technology, specifically a pipeline leak detection and location method based on BiLSTM. Background Technology

[0002] Pipeline transportation has become a crucial means of transporting fluid industrial products such as oil, natural gas, and water. However, pipeline leaks can cause significant property damage and environmental hazards, especially when the transported products are flammable, toxic, or corrosive. To ensure pipeline safety, comprehensive research has been conducted on leak detection and location methods. Among various methods, continuous pressure monitoring (CPW) is one of the most direct methods for detecting pipeline pressure states obtained from sensors installed along the pipeline. When a rupture or collapse occurs, a sudden negative pressure wave (NPW) propagates from the leak point to each side. By capturing this sudden pressure drop, the leak event can be detected. As an important application of wireless sensor networks (WSN), multiple pressure sensors are typically deployed. By analyzing the time difference of arrival (TDOA) of the NPW, given the NPW velocity and pipeline length, the leak location can be determined. Fluid pipeline leak detection and location methods based on negative pressure wave (NPW) detect leaks by capturing pressure change trends and locate leaks by calculating the time difference of arrival (TDOA) of the NPW between upstream and downstream sensors.

[0003] However, in real-world situations, due to similar transient pressure changes, pressure variations under normal operating conditions, such as those of pumps and valves, may be mistaken for leaks. Furthermore, the traditional TDOA method for leak location assumes a constant propagation velocity of the NPW, which is inconsistent with reality and limits its accuracy in many practical applications.

[0004] To address these issues, this invention provides a BiLSTM-based method for detecting and locating pipeline leaks. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method for pipeline leak detection and location based on BiLSTM, which solves the aforementioned problems.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting and locating pipeline leaks based on BiLSTM, comprising the following steps:

[0007] Step 1: Collect pressure wave signals from different sensors, preprocess them, and classify them into "leakage" or "no leakage" waves;

[0008] Step 2: When "no leakage" is reported in Step 1, the NPW velocity is estimated online by calculating the time delay of pressure disturbances from different sensors;

[0009] Step 3: When a "leak" is reported in Step 1, use the TDOA method to locate the leak at the newly updated NPW rate.

[0010] Preferably, step one specifically includes: data preprocessing, feature extraction, BiLSTM classifier training, result pooling, and decision-making.

[0011] Preferably, the specific method for data preprocessing is to process data from n sensors P. r =[P r 1 , ···· P r n The original pressure sequence was interpolated and low-pass filtered, with a sampling period of 0.1s after interpolation. Maximum overlap discrete wavelet transform was used to filter the signal, employing the Donohue and Johnston universal threshold and horizontal correlation threshold. The wavelet function was selected as "db10" and the wavelet transform level was 4. Then, the filtered data P... f Slice the image and prepare for feature extraction.

[0012] Preferably, the specific method for feature extraction is to select a segment of pressure wave using a sliding window, calculate its similarity to typical features, and use the calculated similarity as a feature. The feature extracted from the i-th part of the signal from sensor j is represented as f. I =[f i1 f i2 f i3 The corresponding sensor feature sequence is written as F = [f] T 1,…,f T 1,…,f T 1] T .

[0013] Preferably, the feature extraction includes canonical feature description and similarity calculation through dynamic time warping, wherein the canonical feature description includes the following steps:

[0014] Step S1: Construct a similarity matrix W. Assume a feature has a length of t, and there are r leaks, q pumps, and u valves whose pressure patterns are represented by P. leak P pump and P valve Concatenate them to form a matrix P = [P leak T Ppump T Pvalve T ]T Where the dimension of P is n×t, n=r+q+u, the Gaussian model is applied to retrieve the n×n similarity matrix W=[ω ij ], where the elements are represented as:

[0015]

[0016] Step S2: Select typical features; the leakage feature is selected as the i-th row P of matrix P. i :

[0017]

[0018] The first cumulative term in equation (2) represents the similarity between the i-th leaking part and other leaking parts, including itself, and the second cumulative term represents the similarity between the i-th leaking part and non-leaking parts.

[0019] Preferably, the similarity calculation method using dynamic time warping in the feature extraction is as follows: A dynamic time warping algorithm is used to calculate similarity, and the similarity calculation based on the warped signal is defined as a Gaussian function of the dynamic time warping distance.

[0020]

[0021] Among them, f i For the i-th pressure segment P i Its typical characteristics P s The similarity.

[0022] Preferably, the specific method for training the BiLSTM classifier is as follows:

[0023] The training set is selected from the labeled feature sequence F and the corresponding label Y. The feature sequence F and the corresponding label Y are:

[0024]

[0025] Among them, the element y in Y i This indicates the class label to which the corresponding feature belongs.

[0026] Preferably, the leak location model in step three is:

[0027]

[0028] Where x represents the distance between the leak point and sensor 1, d represents the distance between the two sensors, represents the time difference between the negative pressure wave and the two sensors, and represents the propagation speed of the negative pressure wave.

[0029] Preferably, in step two, the NPW velocity is calculated using a weighted average. With multiple sensors, multiple NPW velocities v can be obtained from the TDOA of sensor i and sensor j. ij The weighted calculation formula is:

[0030]

[0031]

[0032] Where, d ij D is the distance between sensor i and sensor j. ij The distance between the leakage source and the center of the sensor;

[0033] After obtaining the NPW velocity and TDOA between the two sensors in step three, the leak location is calculated using a positioning model. In a multi-sensor scenario, there are multiple TDOAs, and Δt = [Δt] i2 ,Δt ij ,Δt 12 ,Δt 1j This is used to calculate the leak location. A weighted scheme is used to obtain the final leak location. The formula is:

[0034]

[0035]

[0036] Where, N p x is the number of sensor pairs. i For the i-th calculated leak location, α i Leakage location result x i The assigned weight, d i Let x be the distance between the two sensor nodes in the i-th pair. leak This is the weighted leak location result.

[0037] Preferably, the leak location process in step three includes the following steps:

[0038] Step a: When classifying the i-th pressure segment, obtain the classification result y from the first stage. i ;

[0039] Step b: Calculate the arrival time difference Δt between each pair of sensors in the n pressure sensor pairs;

[0040] Step c: If y i To represent one of the leak-free classes, first calculate the negative pressure wave propagation velocity v for each sensor pair based on Δt. ij Where i and j represent two different sensors; then the weighted sum v is obtained. ij To update the current speed vc The formulas are updated to formulas (7) and (8);

[0041] Step d: If y i If a leak is indicated, the weighted TDOA method is used, utilizing the updated NPW velocity v. c The location of the leak is calculated using formulas (6) and (9).

[0042] Beneficial effects

[0043] This invention provides a method for pipeline leak detection and location based on BiLSTM. Compared with existing technologies, it has the following advantages:

[0044] This invention proposes a deep learning-based pipeline leak detection and disturbance-assisted localization method. Unlike traditional methods that only focus on detecting transient leak pressure changes, this invention proposes a pressure sequence classification scheme based on BiLSTM deep learning. This scheme can not only identify leaks but also typical periodic non-leakage pressure disturbances. Furthermore, it proposes a disturbance-assisted localization method that does not use empirical constants as NPW velocity to calculate leak location but instead uses non-leakage disturbances to update the NPW velocity online. The proposed method is data-driven, requiring only pressure signals. This method has high detection accuracy, few false alarms, and significantly reduces leak location errors. Attached Figure Description

[0045] Figure 1 This is an overall flowchart of the present invention;

[0046] Figure 2 This is a bidirectional LSTM structure used in the training of the BiLSTM classifier in an embodiment of the present invention. Detailed Implementation

[0047] 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.

[0048] Example:

[0049] Please see Figure 1-2 A method for detecting and locating pipeline leaks based on BiLSTM includes the following steps:

[0050] Step 1: Collect pressure wave signals from different sensors, preprocess them, and classify them into "leakage" or "no leakage" waves;

[0051] Step 2: When "no leakage" is reported in Step 1, the NPW velocity is estimated online by calculating the time delay of pressure disturbances from different sensors;

[0052] Step 3: When a "leak" is reported in Step 1, use the TDOA method to locate the leak at the newly updated NPW rate.

[0053] The process of the method proposed in this invention is as follows: Figure 1 As shown. In the first stage, pressure wave signals from different sensors are collected, preprocessed, and classified as "leaking" or "no-leakage" waves. In the second stage, when the first stage reports "no-leakage," the NPW velocity is estimated online by calculating the time delay of the pressure disturbances from different sensors. On the other hand, when "leakage" is reported, the leak is located using the TDOA method with the newly updated NPW velocity.

[0054] Step one specifically includes: data preprocessing, feature extraction, BiLSTM classifier training, result pooling, and decision-making.

[0055] Data Preprocessing: In practical applications, sensors installed along the pipeline may have different sampling rates and be subject to noise contamination, leading to errors in subsequent TDOA calculations. To ensure synchronization and remove high-frequency noise from n sensors P... r =[P r 1 , ···· P r n The original pressure sequence was interpolated and low-pass filtered, with a sampling period of 0.1s after interpolation. Maximum overlap discrete wavelet transform was used to filter the signal, employing the Donohue and Johnston universal threshold and horizontal correlation threshold. The wavelet function was selected as "db10" and the wavelet transform level was 4. Then, the filtered data P... f Slice the image and prepare for feature extraction.

[0056] Feature Extraction: To improve feature representation and classification performance, a similarity-based feature extraction scheme is proposed. A sliding window is used to select a segment of pressure wave and calculate its similarity to typical features. The calculated similarity is used as the feature, and the feature extracted from the i-th part of the signal from sensor j is represented as f. I =[f i1 f i2 f i3 The corresponding sensor feature sequence is written as F = [f] T 1,…,f T 1,…,f T 1] T .

[0057] Feature extraction includes typical feature description and similarity calculation through dynamic time warping. Typical feature description: the most representative feature in the corresponding class should be selected, and the pressure segment that is most similar to the class but different from the class should be selected.

[0058] Step S1: Construct a similarity matrix W. Assume a feature has a length of t, and there are r leaks, q pumps, and u valves whose pressure patterns are represented by P. leak P pump and P valve Concatenate them to form a matrix P = [P leak T Ppump T Pvalve T ] T Where the dimension of P is n×t, n=r+q+u, the Gaussian model is applied to retrieve the n×n similarity matrix W=[ω ij ], where the elements are represented as:

[0059]

[0060] Formula (1) represents the similarity between two pressure sections.

[0061] Step S2: Select typical features; the leakage feature is selected as the i-th row P of matrix P. i :

[0062]

[0063] In formula (2), the first cumulative term represents the similarity between the i-th leaking part and other leaking parts, including itself, and the second cumulative term represents the similarity between the i-th leaking part and non-leaking parts. Similarly, the characteristics of pumps and valves can be determined in the same way.

[0064] In feature extraction, the similarity calculation method using dynamic time warping works as follows: When two sequences have the same length, traditional similarity calculation based on inner product yields good results. However, the lengths of typical features and the pressure segments for comparison are rarely the same. Therefore, a dynamic time warping algorithm is used to calculate similarity. The similarity calculation based on warped signals is defined as a Gaussian function of the dynamic time warp distance:

[0065]

[0066] Among them, f i For the i-th pressure segment P i Its typical characteristics P s By applying warped signal similarity, the presence of a typical cross section relative to each feature can be effectively indicated, i.e., associated with a leak, pump, or valve.

[0067] The specific method for training a BiLSTM classifier is as follows:

[0068] BiLSTM is a recurrent neural network with feedforward and backward layers. In BiLSTM, the current output y t It depends on the state of the past and the next moment. For example... Figure 2 As shown, the current output y t It is forward h t and backward h t The outputs of the forward and backward layers are jointly determined. The forward layer outputs h. t It is the current input x t The previous feedforward layer output h t-1 and its cellular state C t-1 The function is called a function, therefore, past states must be considered when determining the output. Similarly, the output h of the feedback layer... t It is determined by the current input x t The next step is to output h to the next layer. t+1 and its unit state C t+1 The decision is made, including the next state. By adopting such a structure that considers the past and the next state, the current output is determined, which includes time-related information from the input data. BiLSTM can be trained using the Backpropagation Time Trial (BPTT) algorithm.

[0069] To perform classification using BiLSTM, this invention selects a training set from the labeled feature sequence F and the corresponding label Y, where the feature sequence F and the corresponding label Y are:

[0070]

[0071] Among them, the element y in Y i This indicates the class label to which the corresponding feature belongs. For example, Y = C ∈ {0, 1, 2, 3} represents {leakage, pump start, valve status, normal status}.

[0072] To select a training set from the feature matrix F and label vector Y, such as the training set for a leakage event, the following procedure is applied. Assuming the i-th sliding window overlaps with a known leakage portion, the selected training set is written as:

[0073]

[0074] Matrix F i It contains a selected feature sequence centered at i, with a length of 2τ+1. iThe label is τ. The value of τ determines the length of the sequence used to train the classifier. When τ = 50, there are 101 points in the sequence. Assuming a sliding window step size δ = 5s and a window size w = 35s, the duration of the time series covered by the selected feature sequence is calculated as T = 2τ × δ + w = ​​535s. Therefore, a 535s pressure wave is used to train the BiLSTM classifier for leak detection.

[0075] Result Pooling and Decision Making: In multi-sensor scenarios, each classifier produces its own result. To make a final decision based on multiple results, this invention employs a voting mechanism. The class with the most votes is selected as the final decision. Using the voting mechanism can correct individual erroneous results and improve classification accuracy.

[0076] The leak location model in step three is as follows:

[0077]

[0078] Where x represents the distance between the leak point and sensor 1, d represents the distance between the two sensors, represents the time difference between the negative pressure wave and the two sensors, and represents the propagation speed of the negative pressure wave.

[0079] TDOA Calculation: Various signal processing techniques can be used to obtain the time difference of arrival, each with its own unique advantages and disadvantages. This invention employs a cross-correlation-based method, which is simple and has low complexity. Since pressure waves are typically distorted when reaching different sensors, directly calculating the relationship between two distorted waves may not accurately yield the time difference of arrival. Therefore, this invention does not directly calculate the relationship between two pressure sequences; instead, it first calculates the relationship between the pressure wave and its own characteristics, and then compares the two coefficient sequences to find the time difference of arrival.

[0080] In step two, the NPW velocity is calculated using a weighted average. With multiple sensors, multiple NPW velocities v can be obtained from the TDOA of sensor i and sensor j. ij The weighted calculation formula is:

[0081]

[0082]

[0083] Where, d ij D is the distance between sensor i and sensor j. ij The distance between the leakage source and the center of the sensor pair is the distance between the two factors. Both of these factors will negatively affect the estimation accuracy. When calculating the weighted velocity vc, the value vij generated by the sensor pair with a shorter distance between the sensors and a closer distance to the leakage source is given more weight.

[0084] After obtaining the NPW velocity and TDOA between the two sensors in step three, the leak location is calculated using the localization model. In a multi-sensor scenario, there are multiple TDOAs, and Δt = [Δt] i2 ,Δt ij ,Δt 12 ,Δt 1j This is used to calculate the leak location. A weighted scheme is used to obtain the final leak location. The formula is:

[0085]

[0086]

[0087] Where, N p x is the number of sensor pairs. i For the i-th calculated leak location, α i Leakage location result x i The assigned weight, d i Let x be the distance between the two sensor nodes in the i-th pair. leak This is the weighted leak location result.

[0088] The leak location process in step three includes the following steps:

[0089] Step a: When classifying the i-th pressure segment, obtain the classification result y from the first stage. i ;

[0090] Step b: Calculate the arrival time difference Δt between each pair of sensors in the n pressure sensor pairs;

[0091] Step c: If y i To represent one of the leak-free classes, first calculate the negative pressure wave propagation velocity v for each sensor pair based on Δt. ij Where i and j represent two different sensors; then the weighted sum v is obtained. ij To update the current speed v c The formulas are updated to formulas (7) and (8);

[0092] Step d: If y i If a leak is indicated, the weighted TDOA method is used, utilizing the updated NPW velocity v. c The leak location is calculated using formulas (6) and (9). The results from sensor pairs with larger distances will be less dominant in the final xleak result.

[0093] Furthermore, any content not described in detail in this specification is existing technology known to those skilled in the art.

[0094] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0095] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for detecting and locating pipeline leaks based on BiLSTM, characterized in that, Includes the following steps: Step 1: Collect pressure wave signals from different sensors, preprocess them, and classify them into "leaking" or "no-leaking" waves. This includes: data preprocessing, feature extraction, BiLSTM classifier training, and result pooling and decision-making. The specific method for data preprocessing is to process the data from n sensors P... r =[P r 1 , ···· P r n The original pressure sequence was interpolated and low-pass filtered. The sampling period after interpolation was 0.1s. Maximum overlap discrete wavelet transform was used to filter the signal, employing the Donohue and Johnstone universal threshold and horizontal correlation threshold. The wavelet function was selected as "db10" and the wavelet transform level was 4. Then, the filtered data P... f Slice the image and prepare for feature extraction; The specific method for feature extraction involves selecting a segment of pressure wave using a sliding window, calculating its similarity to typical features, and using the calculated similarity as a feature. The feature extracted from the i-th part of the signal from sensor j is represented as f. I =[f i1 f i2 f i3 The corresponding sensor feature sequence is written as F=[ f T 1,…, f T 1,…, f T 1] T ; The feature extraction includes canonical feature description and similarity calculation through dynamic time warping. The canonical feature description includes the following steps: Step S1: Construct a similarity matrix W. Assume a feature has a length of t, and there are r leaks, q pumps, and u valves whose pressure patterns are represented by P. leak P pump and P valve Concatenate them to form a matrix P=[P leak T Ppump T Pvalve T ] T Where the dimension of P is n×t, n=r+q+u, the Gaussian model is applied to retrieve the n×n similarity matrix. The elements are represented as: ; (1) Step S2: Select typical features; the leakage feature is selected as the i-th row P of matrix P. i : (2) The first cumulative term in equation (2) represents the similarity between the i-th leaking part and other leaking parts, including itself, and the second cumulative term represents the similarity between the i-th leaking part and the non-leaking part. Step 2: When "no leakage" is reported in Step 1, the NPW velocity is estimated online by calculating the time delay of pressure disturbances from different sensors; Step 3: When a "leak" is reported in Step 1, use the TDOA method to locate the leak at the newly updated NPW speed.

2. The method for detecting and locating pipeline leaks based on BiLSTM according to claim 1, characterized in that: The similarity calculation method using dynamic time warping in the feature extraction is as follows: A dynamic time warping algorithm is used to calculate similarity, and the similarity calculation based on the warped signal is defined as a Gaussian function of the dynamic time warping distance. (3) Among them, f i For the i-th pressure segment P i Its typical characteristics P s The similarity.

3. The method for detecting and locating pipeline leaks based on BiLSTM according to claim 2, characterized in that: The specific method for training the BiLSTM classifier is as follows: The training set is selected from the labeled feature sequence F and the corresponding label Y. The feature sequence F and the corresponding label Y are: (4) Among them, the element y in Y i This indicates the class label to which the corresponding feature belongs.

4. The method for detecting and locating pipeline leaks based on BiLSTM according to claim 3, characterized in that: The leakage location model in step three is as follows: (6) Where x represents the distance between the leak point and the first sensor in a pair of sensors, and d represents the distance between the pair of sensors. This represents the time difference between the arrival of the negative pressure wave at the two sensors, and v represents the propagation speed of the negative pressure wave.

5. The method for detecting and locating pipeline leaks based on BiLSTM according to claim 4, characterized in that: In step two, the NPW velocity is calculated using a weighted average. With multiple sensors, multiple NPW velocities v can be obtained from the TDOA of sensor i and sensor j. ij The weighted calculation formula is: (7) (8) Where, d ij D is the distance between sensor i and sensor j. ij The distance from the disturbance source to the midpoint of the line connecting sensor i and sensor j; After obtaining the NPW velocity and TDOA between the two sensors in step three, the leak location is calculated using a localization model. In a multi-sensor scenario, there are multiple TDOAs. The formula for calculating the leak location is as follows: A weighted scheme is used to obtain the final leak location. (9) Where, N p x is the number of sensor pairs. i For the i-th calculated leak location, α i Leakage location result x i The assigned weight, d i Let x be the distance between the two sensor nodes in the i-th pair. leak This is the weighted leak location result.

6. The method for detecting and locating pipeline leaks based on BiLSTM according to claim 5, characterized in that: The leakage location process in step three includes the following steps: Step a: When classifying the i-th pressure segment, obtain the classification result y from the first stage. i ; Step b: Calculate the arrival time difference between each pair of sensors in the n pressure sensor pairs. ; Step c: If y i This indicates one of the leak-free classes, first based on Calculate the negative pressure wave propagation speed v for each sensor pair ij Where i and j represent two different sensors; then the weighted sum v is obtained. ij To update the current speed v c The updated formulas are formula (7) and formula (8); Step d: If y i If a leak is indicated, the weighted TDOA method is used, utilizing the updated NPW velocity v. c The location of the leak is calculated using formulas (6) and (9).

Citation Information

Patent Citations

  • Natural gas pipeline leakage detection method based on LSTM recurrent neural network

    CN111022941A

  • Home appliance and control method therefor

    CN111033473A