Leakage detection based on variational mode decomposition and long short-term memory neural network

In the process of long-term continuous operation, fluid transportation pipelines are prone to leakage accidents. Therefore, this study investigates the detection of small-sized leaks with a leakage aperture of 13 mm in pipes with a diameter of 100 mm. The experimental investigation is conducted under the following operating conditions: volume flow of 25-80 m3/h, pressure of 100-200 kPa. The variations in volume flow and pressure signals during leak occurrences are analysed. To mitigate the interference caused by noise, the variational mode decomposition (VMD) method is introduced. The VMD effectively reduces noise interference in the signals. Furthermore, the denoised signals are utilized to establish a long short-term memory neural network (LSTM). The LSTM model achieves a high accuracy rate of 91.67% for the entire dataset.


Introduction
Fluid pipeline transportation technology is widely used in various fields such as water conservancy engineering, petrochemical industry, and power energy, and it is the preferred method for conveying water resources.However, during pipeline operation, factors such as pipeline corrosion and geological damage can lead to leakage accidents, resulting in significant economic losses and environmental pollution [1][2][3].Therefore, the development of pipeline leak detection technology is urgently needed to minimize economic losses.
Several studies have been performed on the leakage detection over various conditions [4][5][6][7][8].Lang et al. [9] proposed an improved local mean decomposition signal analysis for reducing the noise interference, and used the least squares twin support vector machine to recognize pipeline leaks.Based on empirical mode decomposition (EMD), Guo et al. [10] established an adaptive noise cancellation to reduce the noise interference in water-supply pipeline leak detection, and this model can rebuilding the noise-removed signal automatically and efficiently.Gao et al. [11] established a Particle Swarm Optimization algorithm optimized Support Vector Machine (POS-SVM) and effectively achieved the leakage detection in oil-gas pipeline, with an accuracy more than 90%.Banjara et al. [12] carried out a leakage detection experiment in 2 m long pipe, and utilized machine learning model for the identification and localization of leakage which obtained a high classification accuracy of 99.46%.
In conclusion, an amount of research has been conducted on leakage detection, resulting in valuable finding.However, noise interference remains a significant challenge in leakage detection that requires further investigation and resolution.In addition, it is imperative to conduct more experimental research under diverse conditions, particularly focusing on small leakage aperture, and develop a predictive model for leakage detection.
Therefore, this study aims to address these issues by conducting an experimental investigation on leakage detection with small leakage aperture.The study employs variational mode decomposition (VMD) to mitigate the impact of noise interference and establishes a long short-term memory neural network (LSTM) for accurate leakage detection.

Experimental loop
Figure 1 presented the diagram of the experimental loop, which was primarily composed of a liquid water storage tank, a centrifugal pump (IHG100-160-W304), two electromagnetic flowmeters (KDLD-100), an air valve, a check valve, two butterfly valves, and two ball valves.All the components and connecting pipes were made of 304 stainless steel.
The experimental setup employed a pipe diameter of 100 mm, wherein two high-frequency pressure sensors (HM90A-H2-3-V2-F2-W1) were strategically positioned in the experimental loop at a distance of 10 m from each other.Furthermore, four leakage points, each with a diameter of 13 mm, were deliberately introduced between the pressure sensors, with an equal spacing of 2 m.
The leakage was controlled by a ball valve, allowing for the simulation of leakage phenomena in water pipeline.To monitor and collect all measured signals, a data acquisition system (DAQ-9178, NI9203, NI9220) was employed, with a sampling frequency of 2000 Hz.

Experimental process and conditions
During the experiment, water was pumped from a liquid water storage tank using a centrifugal pump.The flow rate was set using the centrifugal pump, and water was injected into the experimental loop.Once the flow rate stabilized, the experimental parameters, including pressure P and volume flow Q, were recorded.Subsequently, a specific leakage point was opened, and the experimental data were recorded before and after the leakage point was opened.After completing the data collection for that particular leakage point, the leakage point was closed.Once the data stabilized again, a new leakage point was opened, and the data before and after its opening were recorded.This process was repeated until data for all four leakage points were recorded.This marked the completion of the experimental data collection for that particular flow rate.The flow rate was then adjusted, and the aforementioned procedure was repeated until the entire experiment was completed.The experimental conditions are summarized in Table 1.

Units Range
Pressure kPa 100-200 Volume flow m 3 /h 25-80 Inner diameter of main pipe mm 100 Leakage aperture mm 13

Data processing
The pressure signals obtained from measurements are susceptible to significant noise interference due to various factors such as environmental conditions, pump vibrations, and fluid friction inside the pipe.This noise interference makes it challenging to detect variations in the pressure signal during leakage events, resulting in detection failures.Therefore, it is necessary to employ denoising techniques specifically tailored for the leakage signal.
The variational mode decomposition (VMD) [13] is utilized to denoise the leakage signal.VMD is an adaptive decomposition method that decomposes a signal into multiple intrinsic mode functions (IMFs).Each IMF component exhibits a specific bandwidth sparsity in the frequency domain.The VMD can filer out external high-frequency noise and extract effective leakage signals, the decomposition process is as follows: where, K is the predetermined number of modal components, u k (t) represents the k-th decomposed modal component; ω k corresponds to the central frequency of the k-th modal component; x(t) denotes the original data sequence; δ(t) represents the unit step function; ||•|| denotes the L 2 norm; ∂ t is the partial derivative at time t.
To solve the constrained variational model expression, we introduce the Lagrange multiplier operator λ(t) and a quadratic penalty factor α.This transforms the problem of finding the optimal solution into an unconstrained problem.
VMD employs the alternating direction multiplier method to solve the variational problem described in Equation ( 2), and ultimately obtains the optimal solution for Equation (1).For detailed steps, please refer to the reference [13].
In this study, the number of IMFs is set to 10 for decomposing the pressure signal.Typical results for the decomposition of the pressure data at volume flow Q = 70 m 3 /h are shown in Figure 2, and a comparison between the original signal and the denoised signal is presented in Figure 3.It is observed that IMF10 effectively makes the variability of the signal more pronounced and reduces the noise interference, therefore, IMF10 is chosen as the denoised signal.

Identification of leakage signal
The pressure leakage signal at Q = 65 m 3 /h is presented in Figure 4, illustrating that under leak-free conditions, the pressure signal maintains a stable waveform pattern.However, when a leakage phenomenon occurs, the upstream and downstream pressure signals at the leakage point experience instantaneous oscillations before promptly reverting to their normal state.
Additionally, due to the substantially smaller area of the leakage point (with an inner diameter of 13 mm) accounting for only 1.69% of the pipe's cross-sectional area (with an inner diameter of 100 mm), the fluid pressure within the pipe does not exhibit a notable decrease once the pressure signal stabilizes following the occurrence of a leak.This observation suggests that while the leakage phenomenon indeed influences the pressure signal, the impact of small-sized leaks is not prominent, resulting in challenges in leakage detection.
Moreover, as illustrated in Figure 5, the effect of leakage on the volume flow is minimal.This finding demonstrates that small-sized leaks do not induce significant fluctuations in the volume flow.

Long short-term memory neural network
Long Short-Term Memory (LSTM) is a neural network model that improves upon the basic recurrent neural network (RNN) by addressing the issues of gradient vanishing and exploding during the training process of long sequences [14].The signal data obtained in this project exhibits characteristics such as large data volume and long cycles, making it a typical example of long sequence data suitable for LSTM modeling.
LSTM model is consisted of several LSTM cells, each cell including input gate (i t ), forget gate (f t ) and output gate (o t ), the typical structure of LSTM as shown in Figure 6. the input gate (i t ) controls the amount of information flowing into the memory cell (C t ) at the current time step.The forget gate (f t ) adjusts the influence of the previous time step's information (C t-1 ) on the current time step's memory cell (C t ), thereby enabling the retention and forgetting of sequence information.The output gate (o t ) regulates the influence of the current time step's memory cell (C t ) on the output value (h t ).The specific calculation process is as follows: ,  ( ) ReLU , 0 ( ) 0, 0 Where, h t-1 represents the output of neurons from the previous time step; x t is the current input value; W and b represent the weight and bias of the respective gate; t C  is the candidate cell state.

Training and testing of leakage detection model
In this study, a total of 156 data sets were collected, comprising both leakage and non-leakage conditions.The data were then divided into a training set and a testing set in a 9:1 ratio.The training set was used to train the leakage detection model, which employed a bidirectional LSTM layer, while the testing set was used to assess the accuracy of model.The model building process involved the following steps: First, the experimental data (including volume flow signal, upstream pressure signal, and downstream pressure signal) was input into the training model, with each signal comprising a length of 5,000 data points.Subsequently, the data was trained in a bidirectional LSTM layer, using the "adam" solver.After training, the data flowed through a fully connected layer, softmax layer, and was compared with actual values in the output layer.Based on precision comparisons, the model employed the back propagation (BP) algorithm to update weights and thresholds, minimizing the difference between the predicted output and the actual output.Finally, this process iterated until the model demonstrated satisfactory performance on the training data.To prevent overfitting, the data were reshuffled during each iteration, and the parameters for the LSTM model were set as shown in Table 2.
After training, the model was evaluated using the testing set's data.The results showed that the accuracy of the testing set data was 100% and the accuracy of the entire dataset was 91.67%.These results demonstrate that the model exhibits high accuracy and generalization ability.

Conclusions
The present study investigates the characteristics of leakage phenomenon in a pipe with a small-sized leak, where the pipe has an inner diameter of 100 mm and a leakage aperture of 13 mm.The main findings are summarized as follows: (1) When a leakage phenomenon occurs, the pressure signals upstream and downstream of the leakage points undergo instantaneous oscillations and quickly return to normal.Additionally, smallsized leaks do not result in significant fluctuations in the volume flow.
(2) The variational mode decomposition (VMD) method proves effective in denoising the leakage signal.In particular, Among each IMFs, IMF10 successfully captures the characteristics features of the leakage signal.Therefore, IMF10 is chosen as the denoised signal.
(3) The proposed LSTM model demonstrates its effectiveness in leakage detection, achieving a high accuracy of 91.67% for the entire dataset.

Figure 1 .
Figure 1.Diagram of the experimental loop.

Figure 2 .
Figure 2. Typical results of pressure data decomposition.

Figure 3 .
Figure 3. Compare of original signal and denoised signal.

Figure 5 .
Figure 5. Leakage signal of volume flow.

Table 2 .
Parameter settings in the LSTM model