# Pipeline Leakage localization Based on FBG Hoop Strain Sensors Combined with BP Neural Network
## 4 Leakage Localization Based on BP Neural Network
### Method Validation  
The BP neural network-based leakage detection system is established on the 55-km long-distance pipeline. The parameters of the pipeline are presented in Section 3.2. The pipeline is averagely divided into 50 sections, so there are 51 nodes along the pipeline (inlet and outlet included). The 49 intermediate nodes are considered as the possible leak points. Generally, the input neurons are the sensing points where the FBG hoop strain sensors are installed. However, it is not necessary to employ all of the sensing points, which may bring the problem of over fitting in the BP neural network. In this case study, five averagely divided hoop strain sensors along the pipeline are chosen as the input neurons. It is still worth mentioning for other leakage localization applications, the number of input neurons should be determined by trial to obtain the best localization results. Through leakage analysis using MOC, hoop strain variations of the five sensing points are obtained and shown in Table 1. The first column is the number of leak points, corresponding to the mid-side nodes of the present pipeline. It is noted that the values of hoop strain variations are very close; hence, it is difficult for traditional strain sensors to distinguish the differences. However, as presented in Section 2, the developed FBG hoop strain sensor is characterized by enhanced sensitivity; thus, the measured hoop strain can by amplified. To make the network with good convergence and mapping capability, the following equation is used to normalize the data to [0, 1] before developing the model:  
\[x_{i}^{\prime}=\frac{x_{i}-x_{\min}}{x_{\max}-x_{\min}} \tag{11}\]  
\begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Leak Point**} & \multicolumn{4}{c}{**Hoop Strain Sensing Point**} & \multicolumn{4}{c}{**Loak Point**} & \multicolumn{4}{c}{**Hoop Strain Sensing Point**} \\ \cline{2-11}  & **1** & **2** & **3** & **4** & **5** & & **1** & **2** & **3** & **4** & **5** \\ \hline
2 & 23.04 & 22.63 & 22.22 &  
where \(x_{\max}\) and \(x_{\min}\) are the maximum and minimum of the hoop strain values in Table 1. \(x_{i}\) is the original hoop strain value, and \(x_{i}^{\prime}\) is the normalized value. Then, the structure of the network for leakage localization on this pipeline is established as shown in Figure 7. In the input layer, the five parameters are the five hoop strain sensing points evenly spaced along the pipeline. The variable parameter in the output layer is the leakage point, corresponding to 49 leakage patterns. The number of neurons in the hidden layer can be estimated according to the following empirical formula, and 15 neurons is an optimal selection by trial calculation. In the equations, \(m\) and \(n\) are the number of inputs and outputs, respectively, and \(a\) is a random integer ranging from 0-10. \[ \begin{cases}I<n-1\\ l<\sqrt{m+n}+a\\ I=\log_{2}n\end{cases}  \tag{12}\]  
Therefore, the total sample number is 49, from which 30 samples are randomly selected for BP neural network training, and all of the samples are used as the test parameters for the trained neural network. The purpose of validating all the samples is to guarantee that all of the leakage points can be figured out by the neural network system. In addition, measurement noise will be superimposed to test its performance for potentially practical leakage localization. Before using the FBG hoop strain sensing signals, a trial test based on the traditional pressure gauges is firstly implemented. Usually, the pressure gauges are installed at the inlet and the outlet of a single straight pipeline. Thus, two pressure variations can be extracted based on MOC calculation under different leak points. For the BP neural network in this case, the input neurons are the two pressure signals and the output neurons are the potential leakage points.