## 6 Decision Algorithm  
The neural network toolboxes in MATLAB [60] are used to accomplish the training process. Table 2 shows how input datasets are standardized and separated into 162 sets for training and 90 sets for validation before the training process begins. The PNN's behavior can be significantly influenced by the input pattern. As a result, the goal of this study is to use an algorithm's input pattern to detect and distinguish between external and internal power transformer failures. The maximal coefficients of the 1/4 cycle DWT are used as training input patterns. The PNN's output variables are labeled 1 or 2, referring to external and internal defects, respectively. The internal fault will occur if the PNN's output value is 1. If this output value is 2, on the other hand, an external error will occur. Case 1: The maximum DWT coefficients capable of detecting a fault. A PNN structure comprises four input neurons and one output neuron, while the radial basis layer has 162 neurons (the number of neurons is always equal to the number of training sets). The input patterns for post-fault differential current waveforms are the maximum coefficients details (cD1) from DWT in the first scale at the 1/4 cycle of phase A, B, C, and zero sequence, as illustrated in Figure 9. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \begin{tabular}{c} **The Total** \\ **Number of** \\ **Datasets** \\ \end{tabular} & \multicolumn{2}{c}{**Internal Faults**} & \multicolumn{2}{c}{**External Faults**} \\ \cline{2-6}  & \begin{tabular}{c} **HV** \\ \end{tabular} & \begin{tabular}{c} **LV** \\ \end{tabular} & \begin{tabular}{c} **HV** \\ \end{tabular} & \
\begin{tabular}{c} **HV** \\ \end{tabular} &
\begin{tabular}{c} **LV** \\ \end{tabular} \\ \hline Training & 252 & 81 & 81 & 45 & 45 \\ \hline Validation & 168 & 54 & 54 & 30 & 30 \\ \hline Case Studies & 84 & 27 & 27 & 15 & 15 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The total number of PNN datasets. Figure 9: PNN input pattern (maximum coefficients (cD1) in scale 1 of differential current signal): (**a**) case of an internal malfunction; (**b**) case of an external fault. Case 2: The maximum ratio attained using the DWT division method  
As illustrated in Figure 10a, the input patterns are the maximum ratio obtained from a division algorithm between the differential current coefficient from DWT and the zero sequence for post-fault differential current waveforms. In Figure 10b,c, a PNN structure consists of three neurons inputs and one neuron output, while the number of neurons in the radial basis layer is 162 (owing to the fact that the number of neurons is always equal to the number of training sets). During the training process [8], a normalization method uses a z-score method that has a mean of 0 and a standard deviation of 1. The z-score measures the distance of a data point from the mean in terms of the standard deviation. The standardized dataset has a mean of 0 and a standard deviation of 1, and retains the shape properties of the original dataset (same skewness and kurtosis). The z-score of a value x is \(z=\frac{(x-y)}{\sigma}\). The PNN begins with the random initial weight and increasing spread in the radial basis layer,  
Figure 10: PNN Input pattern of the maximum ratio in scale 1 of differential current signal: (**a**) the maximum ratio obtained using the division procedure provided in scale 1; (**b**) internal; (**c**) external. Following the training procedure, the decision algorithm is used to distinguish between the different types of power transformer faults. As demonstrated in Tables 4 and 5, case studies are modified in order to verify the decision algorithm's capabilities. The results have two studied cases. Each studied case has 84 sets. There are 54 sets for the internal winding fault (there are 27 sets for low-voltage winding and 27 sets for high-voltage winding) and 30 sets for the external short circuit (there are 15 sets for low-voltage winding and 15 sets for high-voltage winding).