## 5 Result and Discussion  
In this paper, two separate artificial multilayer perceptron neural networks are designed to classify the type of flow regimes and predict the volume percentages independent of the thickness of the scale in the pipe. The inputs of both networks are the characteristics introduced in the previous section- extracted from the recorded signals from both the TD and the SD. In total, 126 simulations were performed in this study, of which about 70% (88 samples), 15% (19 samples), and 15% (19 samples) were used for training, validation, and testing data, respectively. The structure of the classifier network to identify the type of flow regimes is shown in Figure 5. To show the performance of this network, the confusion matrix is plotted for train, validation, and test data in Figure 6. It is very important to say that the output of this network consists of three numbers, 1, 2, and 3, which represent the annular, stratified, and homogeneous regimes, respectively. In addition, the thresholds for the output of this network are defined in such a way that if the output was between 0.5 to 1.5, the output number would be equal to 1, if the output number was between 1.5 to 2.5, the output would return to 2 and if the output was between 2.5 to 3.5, the network declares a homogeneous regime in the output. Figure 5: Structure of classifier network. Another network has been implemented with the aim of predicting volume percentages; the structure of this network is shown in Figure 7. To obtain the optimal network structure, various networks with one, two, three, and four hidden layers and with the different number of neurons in each layer and different activating functions including linear, log-sigmoid (Logsig), Heaviside, and hyperbolic tangent sigmoid (Tansig) were examined; which is the most optimal structure for both classifier and predictor networks is shown in Table 1. This table includes the number of input neurons, the number of hidden layers, and the number of neurons in each hidden layer, as well as the type of activation function and the number of the epoch. To show the performance of the predictor network, a fitting diagram and the error diagram were used for the three data sets of training, validation, and testing (Figure 8). The fitting diagram shows both the desired output and the output of the designed network on a graph. The more the two diagrams match, the higher the accuracy of the designed network. The error diagram also shows the difference between the desired output and the network output for each of the data. One of the most important parameters in determining the accuracy of predictor networks is determining the accuracy measurement criteria. In this research, criteria named root mean square error (RMSE) and mean relative error (MRE), with the following equations, have been applied. The calculated values for these criteria are listed in Table 2.  
\[MRE\%=100\times\frac{1}{N}\sum_{j=1}^{N}\left|\frac{X_{j}(Exp)-X_{j}(Pred)}{X_ {j}(Pred)}\right| \tag{6}\]  
\[RMSE=\left[\frac{\sum_{j=1}^{N}\left(X_{j}(Exp)-X_{j}(Pred)\right)^{2}}{N} \right]^{0.5} \tag{7}\]  
where N is the amount of data and '_X_ (_Exp_)' and '_X_ (_Pred_)' stands for the experimental and predicted (ANN) values, respectively. Figure 6: Confusion matrix to show the classification network performance for (**a**) training, (**b**) validation and (**c**) testing data. \begin{table}
\begin{tabular}{c c c} \hline \hline \multirow{2}{*}{**ANN Kind**} & \multicolumn{2}{c}{**MLP**} \\ \cline{2-3}  & **Classifier** & **Predictor** \\ \hline No. of neurons in input layer & 6 & 6 \\ \hline No. of neurons in the 1 st hidden layer & 15 & 22 \\ \hline No. of neurons in the 2 nd hidden layer & 11 & 16 \\ \hline No. of neurons in the 3 rd hidden layer & - & 10 \\ \hline No. of neurons in the output layer & 1 & 1 \\ \hline No. of epoch & 680 & 530 \\ \hline Activation function used for each hidden neuron & Tansig & Tansig \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The characteristics of designed networks.