## 2 Methodology
### Neural Network Model
#### 2.6.4 Model Evaluation  
The performance of the models was analysed using key metrics such as the MSE, the mean absolute error (MAE), and the coefficient of determination (\(R^{2}\)). These metrics provide complementary insights into the performance of the model. MSE quantifies the average squared differences between true and predicted values, penalizing larger errors more heavily than smaller ones. MAE measures the average absolute difference between true and predicted values, treating all deviations equally, providing a more intuitive interpretation of the average error magnitude compared to MSE. The coefficient of determination (\(R^{2}\)) explains the proportion of variance in the true values captured by the model. The mathematical formulations of these error metrics are provided in Equations (2)-(4):  
\[\text{MSE}=\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}, \tag{2}\]  
\[\text{MAE}=\frac{1}{n}\sum_{i=1}^{n}\lvert y_{i}-\hat{y}_{i}\rvert, \tag{3}\]  
\[R^{2}=1-\frac{\sum_{i=1}^{n}(y_{i}-\hat{y}_{i})^{2}}{\sum_{i=1}^{n}(y_{i}- \hat{y})^{2}}, \tag{4}\]  
where \(n\) is the total number of data points, \(y_{i}\) represents the true values, and \(\hat{y}_{i}\) denotes the predicted values. For \(R^{2}\), \(\hat{y}\) is the mean of the true values.  
These metrics were tracked over the training epochs to evaluate the convergence of the model and to detect potential issues such as overfitting, where the model performs well on training data but poorly on validation data, or underfitting, where the model fails to capture the underlying data patterns.  
Figure 6 illustrates the training and validation performance of the FFNN and RNN in predicting both the pressure and the flow rate. As shown in Figure 6b, the RNN model for pressure prediction demonstrates superior convergence and generalization compared to the FFNN model (Figure 6a). The RNN achieves training and validation MSEs of 0.0064 and 0.0093, respectively. Furthermore, MAE stabilizes at 0.04, and the \(R^{2}\) score reaches 0.99, indicating strong predictive performance. In contrast, FFNN achieves a training MSE of 0.01 and a validation MSE of 0.0108, with a final \(R^{2}\) score of 0.98. Although the FFNN demonstrates reasonable accuracy, the RNN consistently achieves lower errors and faster convergence compared to the FFNN. For flow rate prediction, the FFNN outperforms the RNN in terms of error metrics, achieving training and validation MSEs of 0.031 and 0.034, respectively, along with an MAE of 0.0823 and an \(R^{2}\) score of 0.967. In contrast, the RNN converges to training and validation MSEs of 0.049 and 0.052, with a final MAE of 0.115 and an \(R^{2}\) score of 0.9485. However, Figure 6c reveals that the validation MAE of FFNN exhibits spikes caused by fluctuations in the validation MSE, which increases while the training MSE decreases. This instability suggests overfitting and poorer generalization. In contrast, the RNN model (Figure 6d) achieves a final test MSE of 0.049, closely aligned with the training MSE, and an MAE of 0.1156. Unlike the FFNN, the RNN does not exhibit significant fluctuations in validation metrics, indicating better generalization and robustness. Overall,  
the evaluation suggests that the RNN model is better suited for this task, as it demonstrates superior generalization and stability across both prediction tasks.