2.3.6. Stopping Criteria and ANN Model Validation

The following are conditions for the neural network to stop: 1. Meet the accuracy requirements; 2. Complete the maximum number of iterations.

Backpropagation works by minimizing a cost function. The mean squared error (*MSE*) is the most common cost function.

Validation data were used to validate the performance of the trained model once the training phase of the model was completed. Additionally, the validation set was used to determine the optimum number of hidden layer nodes and the optimum internal parameters (learning rate, momentum, and initial weights). The *MSE* was used to validate the performance of the ANN in terms of the different number of hidden layer nodes according to Equation (4).

$$MSE = \frac{\sum\_{i=1}^{m} \left( y\_i - \hat{y}\_i \right)^2}{m} \tag{4}$$

The evaluation parameters metrics of root mean square error (*RMSE*) [40], correlation coefficient (*R*), and mean absolute error (*MAE*) were utilized to assess the performance of the models by comparing the target and output values of networks.

$$RMSE = \sqrt{\frac{\frac{m}{i=1} \left(y\_i - \hat{y}\_i\right)^2}{m}} \tag{5}$$

$$R = \sqrt{\frac{\left(\sum\_{i=1}^{m} (y\_i - \overline{y}) \left(\hat{y}\_i - \overline{\hat{y}}\right)\right)^2}{\sum\_{i=1}^{m} (y\_i - \overline{y})^2 \bullet \sum\_{i=1}^{m} \left(\hat{y}\_i - \overline{\hat{y}}\right)^2}}\tag{6}$$

$$MAE = \frac{1}{m} \sum\_{i=1}^{m} |\mathbf{y}\_i - \mathbf{\hat{y}}\_i| \tag{7}$$

The *RMSE*, *R*, and *MAE* values were calculated in all stages: training; validating; and testing. Where *yi*, *y*ˆ*<sup>i</sup>* are the observed value and predicted values, *y*, *y*ˆ are the average observed and predicted values, and *m* is the total number of points in each dataset, respectively. Using this parameter aids in selecting the best structure and network and provides the possibility of understanding the proximity of the model.

After model construction, the variable parameters of the experimental trials were entered as the new input model, and the actual results were compared with the model. Microsoft Excel 2016 software was used to analyze the correlation coefficient between the actual results and the output of the neural network model.
