# A Multi-Leak Identification Scheme Using Multi-Classification for Water Distribution Infrastructure
## 2 Methodology of the Multi-Classification Multi-Leak Identification (MC-MLI) Scheme
### The Adaptive Kernel Design for MC-MLI  
The proposed MC-MLI scheme involves a classification problem to identify multiple leak points. As such, a support vector machine (SVM), recognized for its low computational cost and good classification performance, is suitable for MLI in WDI. Therefore, SVM-based multi-classification is designed and customized with a newly designed adaptive kernel. In most practical problems, data are not linearly separable. Non-linear hyperplanes separating the data of different classes will significantly increase computational cost, which is not practical. Kernel trick is a solution to model linear hyperplanes through mapping the input feature vector into a high-dimension feature space. Conventionally, all features share the same weighting in the kernel trick method. However, the feature importance should not be equal in reality. This means that various features should contribute to the classification to different degrees. The kernel function is not able to discover the feature importance levels. Therefore, an adaptive kernel is designed via incorporating a weighting vector and the feature vector. Correlation is performed on the features to determine their importance levels and weighting values. A higher correlation coefficient value for a feature indicates that it has a higher impact on the classification output. Therefore, a larger weighting value is assigned to that feature. The designed adaptive kernel \(K_{a}(x_{i},x_{j})\) is formulated as:  
\[K_{a}\left(x_{i},x_{j}\right)=\sum_{n=1}^{M}w_{n}k_{n}(x_{i}^{n},\ x_{j}^{n}) \tag{4}\] \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature** & **Symbol** & **Detail** \\ \hline Feature 1 & \(\Delta Q_{M}\) & The difference between mean measured flow rate \(\left(Q_{M,n}\right)\) and mean estimated flow rate \(\left(Q_{M,e}\right)\) \\ \hline Feature 2 & \(\Delta P_{M}\) & The difference between mean measured pressure \(\left(P_{M,n}\right)\) and mean estimated pressure \(\left(P_{M,e}\right)\) \\ \hline Feature 3 & \(\Delta Q_{p-p}\) & The difference in peak-to-peak values between measured flow rate \(\left(Q_{p-p,n}\right)\) and estimated flow rate \(\left(Q_{p-p,e}\right)\) \\ \hline Feature 4 & \(\Delta P_{p-p}\) & The difference in peak-to-peak values between measured pressure \(\left(P_{p-p,n}\right)\) and estimated pressure \(\left(P_{p-p,e}\right)\). \\ \hline Feature 5 & \(\sigma_{Q}\) & The variance of measured flow rate \(\sigma_{Qm}\). \\ \hline Feature 6 & \(\sigma_{P}\) & The variance of measured pressure \(\sigma_{Pm}\). \\ \hline Feature 7 & \(xcorr_{Q}\) & The correlation of measured flow rate and estimated flow rate. \\ \hline Feature 8 & \(xcorr_{P}\) & The correlation of measured pressure and estimated pressure. \\ \hline Feature 9 & \(xcorr_{Q+P}\) & The correlation of measured flow rate and measured pressure. \\ \hline Feature 10 & \(\Delta QT\) & The difference in total flow volume between measured and estimated values. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Ten features for the proposed MC-MLI scheme. where \(x_{i}\) and \(x_{j}\) denote the feature vectors of \(i\)-th and \(j\)-th data samples, respectively, \(k_{n}(. )\) is the radial basis function (RBF) kernel with respect to the \(n\)-th feature entry, for \(n=1,2,\ldots,M\) of the feature vector. \(w_{n}\) represents the weighting of the \(n\)-th feature entry of the feature vector, and it is calculated by:  
\[w_{n}=\frac{\sum_{q=1}^{N}\left(x_{q}^{n}-\overline{x^{n}}\right)\left(y_{q}- \overline{y}\right)}{\sqrt{\sum_{q=1}^{N}\left(x_{q}^{n}-\overline{x^{n}} \right)^{2}\left(y_{q}-\overline{y}\right)^{2}}} \tag{5}\]  
where (\(\overline{}\)) denotes taking the mean value and \(y\) is the class label. \(N\) is the total number of training data samples. Note that the number of training samples of normal cases and leak cases are equal to avoid the classifier being biased. The data for different classes can be linearly separated by hyperplanes after the feature vectors are transformed into high-dimensional feature space using a kernel trick.