# Fault Classification and Localization Scheme for Power Distribution Network
## 3 Support Vector Machines for Fault Classification and Location  
In statistical theory, support vector machines (SVMs) were initially established as (SVC) to solve classification and pattern recognition problems. When employing SVMs, the input datasets are mapped into a high dimensional space to establish the hyperplane. The hyperplane is defined as a separating margin line between two different classes of data [21]. The hyperplane is determined by solving the quadratic programming optimization problem given by:  
\[min\frac{1}{2}|\mathbf{w}|^{2}+C\left(\sum_{i=1}^{l}\zeta_{i}\right) \tag{9}\]  
subject to  
\[y_{1}(w\cdot x_{i}+b)\geq 1-\zeta_{i},\ \zeta_{i}\geq\forall i\]  
where \(x_{i}\) denotes the \(ith\) term of the class data, \(C\) is the pre-determined constant, \(\zeta_{i}\) is the loss function, and \(y_{i}\) is the classification output, which is given by \([+1,-1]\). The optimization problem in (9) can be solved by using the dual form expressed as:  
\[maxL_{D}=\sum_{i}\alpha_{i}-\frac{1}{2}\sum_{i,j}\alpha_{i}\alpha_{j}y_{i}y_{ j}(x_{i}^{T}x_{j}) \tag{10}\]  
subject to \(0\leq\alpha_{i}\leq C\ \forall i,\ \sum_{i}y_{i}\).  
In most practical cases, the data are not displaced linearly and thus cannot be separated using a linear hyperplane. For such cases, kernel functions are used to determine an optimal hyperplane. The commonly used kernel functions are quadratic, polynomial, radial bias function (RBF), and sigmoid [22]. The application of SVMs can be extended to solve regression problems. In the present work, we used four (4) SVCs to classify different faults on different phases and on the ground. The classification training matrix of the SVCs is depicted in Table 1. In Table 1, SVC\({}_{\text{A}}\), SVC\({}_{\text{B}}\), SVC\({}_{\text{C}}\), and SVC\({}_{\text{G}}\) correspond to classifying the fault in phases A, B, C, and the ground, respectively. Furthermore, the parameters of the SVC classifiers are optimized by using the particle swarm optimization (PSO) technique. The fitness \(f\) of the PSO technique is determined by calculating the mean square error (MSE) value, expressed as:  
\[f=\sqrt{\frac{1}{N}\sum_{k=1}^{N}[y^{\Lambda}(k)-y(k)]^{2}} \tag{11}\]  
where \(y(k)\) denotes the discrete signal, \(y^{\Lambda}(k)\) is the forecasted SVC output, and the number of data samples is denoted by \(N\). The optimal SVC values are selected using the PSO technique during the training procedure. The architecture design for selecting optimal SVM parameters for classification is depicted in Figure 3. The process begins with establishing the training data using the fault current magnitude. Thereafter, the data are processed to determine the PSO parameters. Subsequently, the data are used to train the SVM for classification and regression. The evaluation of fitness is determined by using the (MSE) technique. Lastly, a decision is determined, if the best parameters are not determined, the data are reprocessed, otherwise the parameters are used to implement the SVM technique.  
Figure 3: PSO parameter selection design.  
In the present work, we use support vector regression (SVR) to estimate the fault position along the distribution power line. The SVR problem can be solved by determining the quadratic optimization problem and introducing a set of dual variables \(\alpha_{i},\alpha_{i}^{*}\) and thereafter constructing the Lagrange function. The optimal mapping into the high-dimensional space is achieved by computing the dot product using the kernel function. Therefore, the mathematical formulation is expressed as in (11):  
\[max\ W(\alpha,\alpha^{*})=\frac{1}{2}\sum_{i,j=1}^{l}(\alpha_{i}-\alpha_{i}^{* })\left(\alpha_{j}-\alpha_{j}^{*}\right)K\big{(}X_{i},X_{j}\big{)}+\sum_{i,j=1} ^{l}(\alpha_{i}^{*}-\alpha_{i})y_{i}-\frac{1}{2C}\sum_{i=1}^{l}\alpha_{i}^{2}- \alpha_{i}^{*2} \tag{12}\]  
where \(K\big{(}X_{i},X_{j}\big{)}\) denotes the kernel function. In the present work, we choose the RBF function.