## 4 Algorithm Design
### Leak Detection Algorithm
#### 4.1.3 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 \(\theta\) be the frame of discernment, containing \(N\) exclusive and exhaustive hypotheses, and let \(2^{\theta}\) denote its power set. In this paper, frames of discernment in pipeline monitoring sensor networks are \(\theta=\{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^{\theta}\) to [0, 1] verifying:  
\[ \begin{cases}m(\Phi)=0\\ \sum_{\alpha\leq\theta}m(A)=1\end{cases}  \tag{6}\]  
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:  
\[E(P(error))\leq\frac{E_{sv}}{E_{t}-1} \tag{7}\]  
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 \(\Theta\) 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 \(i\)th 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:\[m_{i}(A_{j}) = \frac{1}{1+\exp(Gf(x_{j})+H)}\frac{s_{j}}{l-1}+\frac{1}{k-1} \tag{8}\] \[\left[\sum_{m=1,m_{i}}^{3}\frac{\exp(Gf(x_{j})+H)}{1+\exp(Gf(x_{j}) +H)}\frac{s_{m}}{l-1}\right]\] \[m_{i}(\Theta) = \frac{1}{k-1}(\sum_{m=1}^{3}\frac{\exp(Gf(x_{j})+H)}{1+\exp(Gf(x_{ j})+H)}\frac{s_{m}}{l-1})\]  
where \(\frac{1}{1+\exp{(Gf(x_{j})+H)}}\) is the posterior probability output of \(i\)th two-classification SVM and it could be calculated by Equation (4). The term \(s_{j}\) denotes the number of support vector corresponding to the \(j\)th SVM. \(l\) is the total number of training samples. \(\Theta\) denotes the uncertainty of recognition result. The normalization result of \(m(A)\) is shown as follows:  
\[m_{i}^{\prime}(A_{j})=m_{i}(A_{j})/\sum_{j=1}^{k}m_{i}(A_{j}) \tag{9}\]  
In this way, we can get the BPA function \(m_{i}^{\prime}\) corresponding to \(i\)th 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 \(i\)th 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:  
\[\left\{ \begin{aligned} & d_{\min}=\min(d_{i})\\ & Cred_{i}=\sqrt[d_{\min}/d_{i}\end{aligned} \right. \tag{10}\]  
where \(p\) is the impact factor of reliability degree. After a great deal of experimental research, \(p=8\) in this paper.