Hierarchical Leak Detection and Localization Method in Natural Gas Pipeline Monitoring Sensor Networks

In light of the problems of low recognition efficiency, high false rates and poor localization accuracy in traditional pipeline security detection technology, this paper proposes a type of hierarchical leak detection and localization method for use in natural gas pipeline monitoring sensor networks. In the signal preprocessing phase, original monitoring signals are dealt with by wavelet transform technology to extract the single mode signals as well as characteristic parameters. In the initial recognition phase, a multi-classifier model based on SVM is constructed and characteristic parameters are sent as input vectors to the multi-classifier for initial recognition. In the final decision phase, an improved evidence combination rule is designed to integrate initial recognition results for final decisions. Furthermore, a weighted average localization algorithm based on time difference of arrival is introduced for determining the leak point’s position. Experimental results illustrate that this hierarchical pipeline leak detection and localization method could effectively improve the accuracy of the leak point localization and reduce the undetected rate as well as false alarm rate.


Introduction
In the present age, natural gas has become one of the most important energy resources in the World, which primarily depends on the pipeline transportation. However, with the widespread demand for natural gas supplies, the pipeline leak detection problem has become increasingly prominent [1,2]. Conventional leak detection methods mainly rely on periodical inspections conducted by maintenance personnel, which needs intensive human involvement, but periodical inspection does not provide real time monitoring of the pipeline. Accordingly, a leak may not be detected in time and this may bring about a great deal of economic losses and environmental pollution. Real time pipeline monitoring systems based on wired or wireless sensors have been studied in [3][4][5]. The wire-based techniques connect the sensors along the pipelines with wires. Monitoring information measured by each sensor is transmitted to the monitoring control center through these wires. Nevertheless, the wire-based monitoring systems are vulnerable to damage in any part of the networks and the deployment cost in an underground scenario is very expensive. Wireless sensor networks (WSNs) [6,7], on the other hand, are a much more robust and efficient option to monitor pipelines. Since 2006, many studies have been carried out on WSNs for pipeline monitoring. Jawhar et al. [8] proposed a framework for pipeline infrastructure monitoring using WSNs and designed a routing protocol for transmitting the information from sensor nodes to the sink. Guo et al. [9] put forward a distributed sensing data propagation algorithm based on graded residual energy used in pipeline monitoring sensor networks. The algorithm can achieve balanced energy consumption among sensor nodes and prolong the network lifetime. Ivan et al. [10] described a system called PipeNet used for detecting and localizing leaks and failures in water transmission pipelines. The system is composed of a host of sensor nodes with perception, computation and wireless communication capacities by self-organization. According to the acoustic signals, velocity (flow) signals and pressure transient signals captured by nodes, the system can diagnose the current state of the pipeline more accurately [10].
Although some monitoring systems based on WSNs have been developed in the last several years, research on information processing in this type of networks is relatively scarce. Yu et al. [11] analyzed the features of monitoring information in pipeline networks in detail. Imad et al. [12] presented a model of in-network information processing for pipeline monitoring based on WSNs, but did not give any specific algorithms. This is mainly because monitoring information shows uncertainty and diversity in expressive form, huge amounts in numbers and complicated relationships [11]. Consequently, so far there has not been a kind of method which can effectively process monitoring information of natural gas pipelines. This mainly reflects the following aspects [13,14]: in the first place, under urban area circumstances, sensors may be affected by background noise so that detection information has great ambiguity. This is due to the fact that noise may submerge the useful signals, which will result in a false diagnosis by the monitoring system. In addition, the information provided by single-type sensors is always incomplete or inaccurate as a result of their own deficiencies and environmental interference, so each node may integrate several different types of sensors, such as acoustic sensor, flow sensor and pressure sensor and so on. Thus we need to design a reliable method for multi-source information processing. Moreover, to avoid the monitoring blind zone, when a node is out of action, the detection range among nodes should have a certain degree of overlap. In this case, multiple nodes detect the pipeline leak simultaneously when a leak occurs, but affected by the monitoring position, different nodes may generate conflicting diagnosis results, which make it difficult for the monitoring system to make a right decision, so we need to devise a conflicting results solution method for making a reliable decision according to the diagnosis results from different nodes, avoiding the false alarm problem.
In view of the issues above, in this paper we analyze the benefits and drawbacks of existing methods and propose a novel hierarchical pipeline leak detection and localization method. At different levels, we adopt different detection methods to process leak information. The effectiveness of the new method is verified by simulation experiments. Our results demonstrate that the hierarchical method can detect pipeline leaks and localize leak points accurately and effectively.
The rest of the paper is organized as follows: in Section 2, we review some of existing methods for pipeline leak detection and localization. The preliminaries, including the architecture of pipeline monitoring sensor networks and hierarchical leak detection and localization model, are briefly illustrated in Section 3. Section 4 describes the algorithm in detail. Section 5 evaluates the performance of hierarchical leak detection and localization method through simulation experiments. Finally, Section 6 concludes this paper.

Existing Leak Detection and Localization Methods
Existing pipeline leak detection and localization methods can be divided into three categories based on signal processing, model estimation and knowledge.

Negative Pressure Wave
When a leak happens along the pipeline, the liquid density of the leak point declines immediately due to the fluid medium losses and the pressure drops. Then the pressure wave source spreads out from the leak point to the leak upstream and downstream ends. Taking the pressure before the leak as the reference criterion, the wave generated by such a leak is called the negative pressure wave. When the negative pressure wave reaches the pipeline terminal end, it will cause the drop of first the station inlet pressure and then the station outlet pressure. The pressure reduction signal is collected by pressure sensors installed on both ends of the pipeline. As the locations of the leak are different, different time difference of the negative pressure wave are captured. Based on the different time difference that pressure sensors on both sides detect, pipeline length and negative pressure wave velocity, the leak point can be determined [15,16]. The negative pressure wave method is not dependent on system hardware and it also does not need to set up the mathematical model, which means less calculation costs. However, it requires that the leak be quick and abrupt, since especially in the case of a slow leak, there is no obvious negative pressure wave.

Mass Balance
The working principle of mass balance method for leak detection is straightforward [17,18]: if a leak occurs, the mass balance equation (accounting for the input and output mass flow rates and also the line pack variable rate) presents a systematic deviation. Although simple and certainly reliable, the primary difficulty in implementing this principle in practice derives from the huge variations experienced by the line pack term. This effect implies a very long detection time and, therefore, a frequently unacceptable leaked mass before an alarm is declared. Although the principle of mass balance method is simple, this method is very sensitive to arbitrary disturbances and dynamics of the pipeline, which may lead to false detection issues.

Pressure Point Analysis
Pressure point analysis (PPA) is one of the more popular system diagnosis methods that are available [19]. The PPA method detects leaks by monitoring pipeline pressure at a single point along the line and comparing it with a running statistical trend constructed from previous pressure measurements. The combination of selective filtering and software thresholds determines whether the behavior of successive measurements contains evidence of a leak. The PPA method just requires pressure signals from one or several detection points, so the advantages of this method are costeffectiveness and easy maintenance. Additionally, PPA can detect small leaks which cannot be detected by other methods. However, it is difficult for this method to localize leak points. Therefore, the application range of PPA is too narrow.

Acoustic Correlation Analysis
This method adopts the sound generated by pipeline leak as signal source, installs acoustic sensors along the pipeline to detect sound in leak point and uses signal processing technology for leak detection and localization [20,21]. Due to the limitations of object detection and the application environment, it is absolutely necessary to deploy many acoustic sensors along the pipeline for long distance detection. This method has the advantages of high detection and localization accuracy. Especially, this method does not need to set up complex mathematical model and could detect small leaks.

Spectral Analysis Response
The principle of spectral analysis response for pipeline leak detection is as follows: when a minileak occurs along the pipeline, it will generate a leak signal such as an ultrasonic wave. By extracting the characteristic parameters of leak signals for further analysis, we could obtain the corresponding relationship between ultrasonic spectrum and leak parameters such as aperture of leak point and pipeline inner pressure to judge the state and tendency of the leak point, thereby significantly enhancing the accuracy of the leak detection. Generally, spectral analysis response methods are based on Fast Fourier Transform (FFT) [22,23]. The accuracy of spectral analysis mainly depends on the eigenvalue problem, which can be solved by a filter diagonalization method (FDM) [24,25].

State Observer
The working principle of a state observer for pipeline leak detection is as follows: the state equations of pressure and flow amount are set up. Two pressure extremes are detected as inputs, proper algorithms are adopted for leak point detection and localization according to the error signal from measured and observed values. However, this method supposes that both pressure extremes are not affected by the size of the leak, so it is only suitable for the case of small leaks.

System Identification
This method can effectively distinguish the pipeline model and judge whether a leak happens by comparing it with pipeline actual value. In the case of pipeline integrity, both a fault sensitive model and a fault free model are built. For the fault sensitive model, correlation analysis is used for leak detection. For the fault free model, proper algorithms are introduced for leak point localization. Like the state observer method, this method supposes that both pressure extremes are not affected by the magnitude of the leak. Apart from that, it also needs to exert an M-sequence stimulus signal on the pipeline. [26] This method first sets up discrete state space models of pressure and flow. Pressure and flow at the head and end of the pipeline are used as inputs. The whole pipeline is divided into several sections and three sorts of states (pressure, flow and leak amount) are set at each section point. Then an appropriate discriminate criterion is adopted for leak point detection and localization. However, this method has to acquire mean value and variance of process noise in advance and the degrees of accuracy of detection and localization are related to the number of sections.

Impedance Method [27]
The principle of the impedance method for leak detection can be given as follows: the hydraulic impedance is defined as the ratio of the head fluctuation to the discharge and the characteristic impedance is defined according to the pipe parameters and propagation constant. When the pipe friction is neglected, the final formulation of the pipe impedance with a leak is a function of hydraulic impedance. Therefore, the leak point position is determined by calculating the value of hydraulic impedance for each point where a leak could be detected. The impedance method is mainly used for linear pipelines with less curves and bends, because complicated pipelines with many curves bring difficulties and major uncertainties in the calculation of characteristic impedance and in the statement of boundary conditions.

Standing Wave Difference Method
Standing wave difference method (SWDM) is a promising leak detection method for water pipeline transmission systems, which is based on the technology used in electrical engineering to determine leak point position [28]. Its principle is that SWDM utilizes sinusoidal excitation of the pipeline at one end using an oscillator and simultaneous measurement of head and discharge. Every discontinuity of the pipe impedance (i.e., the ratio between head fluctuation and discharge) reflects incident waves, creating residual standing waves. The distance between the excitation site and pipeline discontinuity is determined by the analysis of the respective resonance frequencies.

Support Vector Machine
The method based on support vector machine (SVM) for leak detection and localization is to monitor the parameters at a number of sensor nodes in the pipeline networks under consideration and to feed these parameters' values into a SVM trained to predict leak size and leak location [29,30]. The SVM is trained on a number of samples representing the presence of leaks of various sizes and locations in the pipeline monitoring networks.

Pattern Recognition
The detection principle of the pattern recognition method is based on transient feature extraction and structural pattern recognition for the negative pressure wave caused by a pipeline leak [31,32]. Since it is quite different from that caused by adjusting pumps and valves, describing the negative pressure wave by pattern recognition method and building classification system of wave structure are able to effectively distinguish between normal adjustment states and leak states. This type of detection method can effectively reduce the false alarm rate and the missing detection rate, and improve the accuracy of leak detection.

Expert System
A leak diagnosis expert system based on leak mechanism is a type of complex nonlinear distributed parameter control system [33,34]. The whole reasoning process is how to synthetically utilize experience knowledge, leak pattern, leak mechanism model and physics laws. The system first completes the breadth search for the most serious abnormal phenomenon of the pipeline. Then it carries out the depth-first search, accomplishing effective qualitative diagnosis based on experience knowledge to determine whether a leak happens.

Architecture of Pipeline Monitoring Sensor Networks
Natural gas pipeline monitoring sensor networks are made up of a great number of sensor nodes, the sinks and a control and management center. The whole networks adopt a sort of clustering structure, which is described as Figure 1. The sensor nodes, installed along the pipeline, are in charge of signal collecting and data preprocessing. Then the processing results are sent to the sink via a multi-hop route. The monitoring networks take an in-tube communication mode for message exchange between sensor nodes. The sink, as the cluster leader, is responsible for managing sensor nodes in its cluster, combining preprocessing results for final decision and localizing leak position if a leak has occurred. Finally, the diagnosis result is sent to the control and management center, which judges whether a leak warning alarm should be announced.

Hierarchical Leak Detection and Localization Model
According to the architecture of monitoring networks and the monitoring information features, we set up a hierarchical model for leak detection and localization as follows: in the first place, the original leak signals are easily disturbed by background noise and transmission route, which may lead to the ambiguity of detection information. In order to diminish the disturbance impact and improve the detection precision, wavelet transform technology is introduced to cope with original leak signals and the leak characteristic parameters are extracted as well. Secondly, SVM multiple classifiers are employed to integrate the leak characteristic parameters in monitoring networks. This kind of classifiers not only could enhance the ability of anti-interference, but also could accurately recognize the current state of a pipeline. Thirdly, due to the influence of monitoring position, sensor nodes in different positions may generate conflicting results, which makes it difficult for the monitoring networks to provide a correct decision. To solve this problem, a recognition result from a single node, which is regarded as the independent evidence, will be combined with results from other nodes at the sink to increase the focal degree of the correct proposition. Furthermore, if there has been a leak along the pipeline, the position of the leak point can be precisely determined by the localization results among nodes.
Based on the analysis above, the process of leak detection and localization is divided into three parts, shown as Figure 2. At sensor nodes, we use wavelet transform technology to deal with original leak signals as well as obtain characteristic parameters of the signals in both the time and frequency domains. Then, we build the model of SVM multiple classifiers and acquire the recognition results of each node. At the sink, we design an improved evidence combination rule based on the degree of reliability for the final decision making from the recognition results of several nodes, and judge the state of the pipeline. If the state corresponds to a leak, a weighted average localization algorithm based on time difference of arrival (TDOA) is introduced to precisely calculate the position of the leak point. The whole model adopts a hierarchical configuration, in which the result from the former level is regarded as the input of the next level. Thus the model is able to separately achieve multiple different levels of leak information processing, which ensures the accuracy and reliability of the diagnosis results. In this study, wavelet in series db is adopted to transform the original signals. This sort of wavelet has the following advantages: (i) it is sensitive to the leak signals and can highlight the singular characteristics of signals; (ii) it can reduce the signal distortion and ensure perfect signal reconstruction as well as good performance of time-frequency analysis.
(2) Determination of Decomposition Scale We make the discrete wavelet transform for leak signals with background noise. Generally, the larger the decomposition scale is, the more favorable it is to eliminate the noise [35]. However, some important local singular characteristics may be lost if the decomposition scale is too large. According to the frequency characteristics of detection signals, we suppose that signal sampling frequency is f s and the lowest identification frequency is f min . Thus the maximum decomposition scale n should satisfy the following relationship expression:

) Wavelet Denoising Method of Threshold Selection
After calculating the maximum decomposition scale n, we decompose the leak signals into n levels. Considering that wavelet spectrums of leak signals and noise signals have different performance characteristics in every scale, we select an appropriate threshold by a heuristic method. For the points whose value is less than the threshold value, its coefficient is set to 0, while for the points whose value is more than the threshold value, its coefficient is set to the difference between the point value and the threshold value. Then we reconstruct the decomposed signals and obtain the single mode signals without noise.

(4) Characteristic Parameters Calculation
We carry out the time domain analysis for single mode signals and extract the characteristic parameters which can completely reflect pipeline leak, such as peak value, average amplitude, variance, root amplitude and so on.

Leak Initial Recognition Based on SVM Multiple Classifiers
At sensor nodes, the leak recognition model is built based on SVM multiple classifiers because the SVM method is able to detect small leaks and slow leaks which could not be detected by the traditional methods. Also, the SVM method avoids the large sample requirements of traditional classification methods [36,37]. To build a model of SVM multiple classifiers includes designing the following aspects: input vector, classification principle, inner product function, penalty coefficient. Sensor nodes in the networks adopt the same structure of SVM multiple classifiers, shown in Figure 3. Where X i (i = 1,2,…,N) denote the input characteristic parameters, and Y j (j = 1,2,…,M) denote the output results from SVM multiple classifiers. (

1) Selection of Input and Output Variables
Related studies have demonstrated that (i) peak value, (ii) average amplitude, (iii) variance and (iv) mean square root are parameters which can reflect the fluctuation of stress waves caused by pipeline leaks; (v) peak factor, (vi) pulse factor and (vii) margin factor are parameters which can reflect the impact of dramatic changes of stress waves; (viii) skewness factor and (ix) kurtosis factor are parameters which can reflect the changes of amplitude distribution of stress waves [38]. Consequently, the nine parameters mentioned above are selected as characteristic input vectors of the SVM multiple classifiers.
Owing to the fact that a single SVM only resolves the two-classifier problem, we set up a SVM model composed by several classifiers to distinguish different states of the pipeline. According to the application requirements analysis for leak detection, the pipeline has three types of recognition states: normal, small leak and big leak. As a result, we need to construct three SVMs to correspond with the three kinds of states. For the ith SVM, the recognition output of ith pipeline state is +1 while the outputs of other two states are both −1. Namely, the number of output variables is 3. When the pipeline states are normal, small leak and big leak, output variables of multiple classifiers are (+1, −1, −1), (−1, +1, −1) and (−1, −1, +1), respectively.
(2) Classification Principle and Parameters Optimization The classification principle of SVM multiple classifiers is based on structural risk minimization principle and kernel function method [39]. The expression of discriminant function is: where x i and x represent training and measured samples, respectively; y = {−1, +1} is the classification label. α denotes Lagrange coefficient vector, which satisfies that 0 ≤ α i ≤ C and ∑ 0, i = 1,2,…,n, where C is the penalty factor. In Equation (2), b denotes the classification threshold value and k(x i ,x) is the kernel function. In this paper RBF kernel function is adopted and its expression is: where γ is the parameter of the kernel function. Simulation experiments show that RBF kernel function has better classification results than others.
In the aspect of parameter selection, both C and γ are important parameters, which are able to directly affect classification precision. Here, a bilinear search method is used to work out the optimal parameters. Its principle is that different values of parameters combinations (C, γ) have different properties to correspond with, so we use logC and logγ as the coordinates of parameter space and parameter combination (C, γ) for maximum learning precision will occur in the vicinity of the straight line log log log . The specific algorithm is as follows: (i) we calculate the optimal for maximum learning precision from linear SVM; (ii) for the SVM with RBF kernel function, we fix . If satisfies log log log , we train the SVM for obtaining the optimal parameter values. (

3) Probability Output of SVM Multiple Classifiers
The standard SVM output is a hard decision output so that it is likely to cause excessive dependence on the voting method [40]. However, it needs a SVM with soft decision output in practical application. Therefore, in order to get posterior probability output, we utilize a sigmoid function to map the SVM output f(x) to the interval (0, 1). The expression of posterior probability output is: where the parameters G and H could be obtained from the following Equation: min ( log( ) (1 ) log (1  )) where , and y i is the classification label of sample i.

Final Decision Based on Improved Evidence Combination Rule
According to the practical output requirement of pipeline leak detection, we set up the decision model based on an improved evidence combination rule.
(1) Frames of Discernment Let θ be the frame of discernment, containing N exclusive and exhaustive hypotheses, and let 2 θ denote its power set. In this paper, frames of discernment in pipeline monitoring sensor networks are θ = {A 1 , A 2 , A 3 }, where A 1 , A 2 and A 3 respectively represent the normal, small leak and big leak states.
(2) Basic Probability Assignment (BPA) A basic probability assignment is a function m from 2 θ to [0, 1] verifying: For any A, m(A) represents the belief that one is willing to commit to A, given a certain piece of evidence. Therefore, how to assign the values of m(A i ) is the main problem to be dealt with. Here we propose the concept of error upper bound in SVM classification recognition: if a set of training samples could be divided by an optimal classification surface, the upper bound of classification error rate of testing samples is the ratio of average support vector number of training samples to total number of training samples. That is: where E sv and E t respectively denote the average support vector number and total number of training samples. Equation (7) precisely reflects the uncertainty of sample x by the SVM method, which corresponds to Θ in frames of discernment. As a consequence, we employ the following method to assign BPA values of A i (i = 1,2,…,N).
For the ith point in the sample set, the probability output of initial recognition results could be calculated by trained SVM multiple classifiers. The BPA value corresponding to A j in initial recognition results is: where is the posterior probability output of jth two-classification SVM and it could be calculated by Equation (4). The term s j denotes the number of support vector corresponding to the jth SVM. l is the total number of training samples. Θ denotes the uncertainty of recognition result. The normalization result of m(A) is shown as follows: In this way, we can get the BPA function corresponding to ith test sample point. In the practical process of pipeline leak detection, the closer the sensor node is to the leak point, the more reliable the detection result is. In contrast, the result is less reliable when the sensor node is farther from the leak point as a result of more interference in leak signals. In order to reduce the effect of the unreliable evidence on combination result and promote the degree of focus of the correct proposition, the BPA function values produced as outputs from SVM multiple classifiers need to be preprocessed before evidence combination. Here the preprocessing method is based on node reliability degree: we suppose the distance between the ith node and the leak point is d i and the degree of reliability of the node closest to the leak point is 1. The reliability degrees of other nodes are given as follows: where p is the impact factor of reliability degree. After a great deal of experimental research, p = 8 in this paper. In order to meet the requirement of the sum of BPA function of each proposition is 1, we process the BPA function via reliability degree expression: Suppose m 1 and m 2 respectively represent the BPA function of the same frame of discernment, focal elements of which are A i and B j . The combination rule of A and B are shown: where ∑ denotes the conflict weight.

(4) Decision Making Based on Maximum Trust Degree
According to evidence combination results from Equation (12), we adopt maximum trust degree method to make final decision.
If the following relationship expression is satisfied: A 1 is the decision result, where, ε 1 and ε 2 are threshold values. In this paper ε 1 = 0.15 and ε 2 = 0.1.

Principle of Time Difference of Arrival
The localization method based on time difference of arrival (TDOA) is described as follows [41]: Several sensor nodes are placed at fixed points to make up the sensor array in accordance with some geometric relationship. These nodes measure and calculate the relative time difference of signal waves transmitting to each sensor node. Then time differences are substituted into the equations which satisfy the geometric relationship of sensor array for solving the leak point coordinate. Furthermore, leak signals will lose some energy during the process of propagation, that is to say, signal intensity will decline with the increase of the distance between leak point and sensor position. According to this feature, the leak source region can be roughly determined via the signal intensity received by sensor nodes and leak points can be accurately localized by analyzing the signal attenuation characteristics. Figure 4 shows the principle of TDOA localization through two sensor nodes. The location Equation of leak point is: where X denotes the distance between the leak point and the nearest node. Because all the nodes in the monitoring networks have definite location coordinates, the location of the leak point could be determined according to X. L is the distance between upstream and downstream nodes, the value of which is certain when the networks are deployed. α denotes the wave propagation speed and the value of α is able to be obtained from engineering handbook or practical measurement. Δt denotes time difference of leak signal arriving at upstream and downstream nodes, which is the key problem of time of arrival localization.

Process of Leak Point Localization
Leak point localization is accomplished at the sink. The localization process is divided into three parts: signals grouping, determination of time difference and weighted average localization. (1) Signals Grouping Related research shows that with the increase of the transmission distance, the energy of leak signals will gradually decline, which reflects in the decrease of average amplitude of the signal waveform. Suppose there are N sensor nodes near the leak point detecting the abnormal signals when the leak happens. The distances between neighboring nodes are all D 0 , and the distance between leak point and two nearest nodes from both sides are X 1 and X 2 , respectively (shown in Figure 5). All the sensor nodes, which detect the leak signals, send single mode signals, their own ID and location to the sink. Suppose X 1 < X 2 , the characteristic function method is used to calculate the RMS amplitude of each signal, and the Equation is: where ΔT denotes signal sampling time. We compare all the signals' average amplitude V i (i = 1,2,…,N) and obtain that: As can be seen from Figure 5, node i is the closest to the leak point, so its amplitude V i is the largest. In contrast, node 1 is the farthest to the leak point, so the amplitude V 1 is the smallest. Then the signals above are divided into two groups according to an interval grouping criterion. One group contains the signals collected by sensor nodes on the left of the leak point, whereas the other includes the signals collected by nodes on the right of the leak point. That is: where S i (i = 1,2,…,N) denotes the signal sent to the sink by node i. If N U and N W respectively denote the signal numbers in group U and W, the number of signal pairs can be obtained from the following Equation: ( 1) ( 1) (2) Determination of Time Difference The original leak signal is generally a sort of continuity signal, so it is definitely difficult to obtain the exact time when nodes receive the leak signals. In this situation, we adopt cross correlation analysis for signals to get the time difference of the signal arriving at upstream and downstream nodes.
Suppose cross correlation function R AB (τ) between wave A(t) and wave B(t+τ) with delay time τ is expressed as follows: where T denotes the finite time interval. It will be seen from the Equation (19) that if τ is a variable, According to Equation (19), R AB (τ) is an integral in a limited time range. In the practical application, data sampling only utilizes the limited part of each wave while wave amplitude of unused part is set to 0. Namely, if i > n, a i = b i = 0; if j > 0 and i + j > n, a i+j = 0; if j < 0 and i − j > n, b i−j = 0. As a consequence, when | | increases, the number of items in (19) becomes increasingly less and the amplitude of R AB (τ j ) declines gradually. Eventually, when | | > n, a i+j = b i-j = 0 and R AB (τ j ) = 0. When τ j = τ', R AB (τ j ) arrives at the maximum as a result of the same phase between A and B. Thus we obtain the delay time at the peak point of R AB (τ j ).
For any functions A(t) and B(t) with a delay time τ j , the cross correlation function R AB (τ) of A(t) and B(t+τ') includes the maximum value at τ j = τ', so this kind of method is applicable to localization of continuous leak signals. For instance, node A receives the signal wave A(t) whereas node B receives the wave B(t+τ') with a delay time τ' relative to A(t), hence leak signal arrival time difference from the leak point to upstream and downstream nodes could be acquired at the peak of R AB (τ). Namely, Δt AB = τ'.
Equation (14) is used to calculate the position coordinates of leak point according to Δt AB , where wave velocity α is also an important parameter. Practically, the spread velocity of the signal wave is affected by many complicated factors, so α is determined by actual measurement in the experiment.
(3) Weighted Average Localization All the single mode signals are divided into N P pairs by signal grouping algorithm, which can generate N P coordinates according to cross correlation time difference localization method. However, it may generate errors during the process of signal processing. Therefore N P kinds of localization results are not quite similar. In order to minimize the interference of errors and improve the localization accuracy, weighted average localization algorithm is introduced to work out position coordinates of leak point. The localization Equation is shown as follows: where P leak represents the final position coordinate of leak point. P j denotes position coordinate of leak point calculated by signals in pair j. μ j is the weight factor, which signifies credibility of leak point position determined by signals in pair j. It can be seen from signal attenuation theory and network deployment mode that the farther the distance between two sensor nodes is, the greater the attenuation of received signal is, which results in the decline of μ j . Therefore, μ j is inversely proportional to the distance between two sensor nodes. To maintain the precision of final position of leak point, the sum of μ j (1 ≤ j ≤ N P ) should be 1. Hence the Equation of weight factor μ j is: (22) where L j denotes the distance between two nodes in pair j. And Con is a constant, which is used to assure that the sum of μ j is 1. When values of N P and L j are certain, Con could be acquired from the following Equation:

Experimental Facilities
The outside diameter of the pipeline is 160 mm, the wall thickness of the pipeline is 6 mm and the length of the pipeline is 25 m. The pipeline is filled with a high pressure gas and the pressure is 0.2 Mpa. The leak process is simulated by a leak valve. There are five nodes with the same spacing placed near the leak point. The coordinates of nodes and leak point are 0, 5 m, 10 m, 15 m, 20 m and 12 m, respectively. To make it simple, all nodes are equipped with acoustic sensors. We set the sampling number at 2,048 during a sampling process, sampling frequency is 1 MHz, sampling instant is 2.048 × 10 −6 s and wave velocity is 4,870 m/s.

Result of Leak Detection Experiment
When a leak happens along the pipeline, signal waves received by the five sensor nodes are shown in Figure 6. As can be seen from the Figure 6, the original signals are continuous acoustic emission signals mixed with a great deal of noise and other interference, so it is difficult to distinguish the leak characteristics from these signals. Additionally, the average amplitudes of original signals obviously decline with the increasing distances between sensor nodes and the leak point. In order to further analyze the leak signals, we use multi-scale wavelet transform algorithm to divide the original signals into five levels. The results are shown in Figures 7-11, where we can see that the signals in the fourth and fifth levels have obvious periodical variation, which can reflect leak characteristics. The signals in the fifth level contain the most energy of the original signals. Therefore, we take the high frequency signals in the fifth level as single mode signals to extract leak characteristic parameters. The results of five original signals dealt with by wavelet transform are shown in Figure 12. Each signal waveform in Figure 12 corresponds to high frequency signal in the fifth level in Figures 7-11. Consequently, the operation above fulfills the preprocessing of original signals, which includes decomposing the signals in multi-scale, eliminating the effect by background noise and extracting the signal ingredients with leak characteristics for further data processing.      Then, characteristic parameters are calculated according to the single mode signals. As characteristic input vectors, they are sent to SVM multiple classifiers for initial recognition. In this paper, 120 groups of data are selected independently as the sample set, which contains 40 groups of large leak state sample, 40 groups of small leak state sample and 40 groups of normal state sample. Among the sample set, 20 groups of each type of pipeline state (60 groups in total) are randomly chosen as the training sample set and the others make up the testing sample set. Table 1 gives the signal examples of three sorts of states: groups 1 and 2 are signals in normal state; groups 3 and 4 are signals in small leak state; groups 5 and 6 are signals in large leak state. We use SVM toolbox in Matlab to train classifiers. Then test samples are sent to multiple classifiers for pipeline state recognition. Output results are normalized finally. When there is a small leak happening along the pipeline, basic probability assignments determined by SVM multiple classifiers as the initial recognition results are shown in Table 2. From Table 2, uncertainty degrees in leak detection become increasingly large with the increase of distances between sensor nodes and leak point. In addition, the initial recognition result of Node 4 disagrees with that of others so that it is difficult to make a decision according to Equation (13). There are two factors contributing to the phenomenon. One is that sensor nodes have self problems which may lead to the error in characteristic input vectors of SVM multiple classifiers. The other is that the number of samples is so small that the samples could not include all the possible situations and this can cause recognition error of classifiers. To resolve evidence conflict problems, we use an improved evidence combination rule for the final decision. It can be seen from Table 3 that after evidence combination, the degree of support of proposition A 2 rises to 0.4638. Comparing with the result of single node, the support degree has increased by 37%. In the meantime, the uncertainty degree declines to 0.044, which meets the requirement of Equation (13). Therefore, the diagnosis result supports proposition A 2 , which is "small leak".

Result of Leak Point Localization Experiment
In this part, we use signal mode signals extracted from the original leak signals as the processing objects. According to the process of leak point localization algorithm in Section 4.2, five sensor nodes send their signal preprocessing results to the sink.
Then the sink compares the average amplitudes of single mode signals and divides the signals into two groups S 1 and S 2 . S 1 = {1,2,3} and S 2 = {4,5}, where signals in group S 1 come from the sensor nodes on the left of the leak point, while signals in group S 2 are from the sensor nodes on the right of the leak point. According to the Equation (18), N P = 6. The six pairs of signals are (1,4), (1,5), (2,4), (2,5), (3,4) and (3,5), respectively. The cross-correlation results of above signal pairs are shown in Figure 13. It can be seen from the Figure 13 that the cross-correlation function of each pair of signals has obvious maximum value. According to the cross-correlation TDOA principle, the position and error of leak point calculated by each pair of signal is shown in Table 4. In light of the node distance and the value of N P , we obtain μ 1 = 0.11, μ 2 = 0.09, μ 3 = 0.17, μ 4 = 0.11, μ 5 = 0.34 and μ 6 = 0.17. After weight average combination, the final coordinate of the leak point is: (24) Accordingly, the absolute error is 0.21 m and the relative error is 1.75%. It is thus clear that weighted average localization method can effectively enhance position accuracy.

Conclusions
In this paper we study the features of leak monitoring information and the structure of pipeline monitoring sensor networks, and present a type of pipeline leak detection and localization method based on a hierarchical model. At sensor nodes, to remove the noise disturbance and dispersion phenomena, wavelet transformation technology is first used to decompose the original leak signals, obtaining single mode signals and characteristic leak parameters. Then we set up a SVM multiple classifiers model for the initial recognition of the pipeline state. To enhance the classification effect and avoid a slow convergence rate, a bilinear search method is utilized to select optimal model parameters, which is of great importance for the recognition result. Moreover, a sigmoid function converts the initial recognition results to probability values, achieving the objectivation of the BPA function. At the sink, an improved evidence combination rule is designed for making final decision according to the recognition results from different nodes. The new rule can tackle the evidence conflict problem and increase the degree of focus of the correct proposition. To get the accurate position of a leak point, a weighted average localization algorithm based on cross-correlation TDOA is introduced. Through weighted combination of localization results of multiple groups of nodes, the position accuracy of the leak point is dramatically improved. Experimental results show that hierarchical method can obviously increase the accuracy of pipeline leak recognition (the focal degree of the right proposition has increased from 0.2344 to 0.4638) and avoid the problem of difficult decision making. Additionally, weighted average localization remarkably reduces the process error which is beneficial to localization accuracy (the maximum relative error has decreased from 4.75% to 1.75%). In this paper, we mainly focus on the linear pipeline without considering other pipeline cases. Hence in the future, we plan to carry out a large amount of research on leak detection and localization approaches of pipelines with special structures such as zig-zag or bent pipelines. Besides, we will do a number of experiments to exploit the feasibility and validity of our approach used in pipelines of other materials such as water and oil as well as underground pipelines, finally extending our method to industrial applications.