# A CNN-Based Downscaling Model for Macau Temperature Prediction Using ERA5 Reanalysis Data
## 3 CNN Model Construction and Training
### Model Evaluation Criteria  
Mean square error (_MSE_), Root Mean Square Error (_RMSE_), Mean Absolute Error (_MAE_), Mean Relative Error (_MRE_), and Pearson correlation coefficient are commonly used evaluation metrics for forecasting tasks, which describe the gap between actual and predicted values. In this study, these five metrics will be used to compare the performance of the models [24].  
_MSE_ is a widely used measure of model prediction accuracy in regression analysis [25]. It quantifies the degree of model fit by calculating the average of the squares of the errors between the predicted and true values, and the _MSE_ is calculated as follows:  
\[MSE=\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y_{i}})^{2} \tag{5}\]  
Specifically, for a dataset containing \(n\) samples, let \(y_{i}\) be the true value of the _i-th_ sample and \(\hat{y_{i}}\) be the corresponding predicted value.  
The _MSE_ gives a higher weight to larger errors because the errors are squared during the calculation. This makes the _MSE_ more sensitive to outliers, and a large prediction error can significantly increase the value of the _MSE_[26]. Therefore, the _MSE_ can effectively reflect the overall error of the model but may exaggerate the inaccuracy of the model in datasets where outliers are present [27].  
The _RMSE_ is the square root of the _MSE_ and is also used to assess the predictive performance of regression models [28]. It is closely related to the _MSE_ but has the same magnitude as the original data, making it more intuitive in interpreting model errors. The _RMSE_ is calculated as follows:  
\[RMSE=\sqrt{\frac{1}{n}\sum_{i=1}^{n}(y_{i}-\hat{y_{i}})^{2}} \tag{6}\]  
The _RMSE_ combines the prediction errors of all samples, and it is able to balance the effects of different sample errors due to the squaring and squaring operations performed on the errors. Similar to _MSE_, _RMSE_ is sensitive to larger errors, but it more directly reflects the average degree of deviation between the model's predicted and true values [29]. In practice, the smaller the _RMSE_, the higher the predictive accuracy of the model [30].  
_MAE_ is another commonly used regression model assessment metric, which measures the predictive accuracy of a model by calculating the average of the absolute errors between the predicted and true values [31]. For a given dataset, the _MAE_ is calculated as follows:  
\[MAE=\frac{1}{n}\sum_{i=1}^{n}|y_{i}-\hat{y_{i}}| \tag{7}\]  
Unlike _MSE_ and _RMSE_, _MAE_ treats all errors equally and does not consider the direction of the error but only focuses on the magnitude of the error [26]. This makes the _MAE_ relatively less sensitive to outliers and more robust to the average prediction error of the model [32].  
_MRE_ is a statistical metric used to measure the relative error between the predicted or estimated value and the true value [33]. In many fields such as data analytics, machine learning, engineering, etc., _MRE_ is a useful metric when it is necessary to assess the accuracy of model prediction results or estimation methods. It can reflect the degree of deviation of the predicted value relative to the true value, and \(MRE\) is more concerned with the proportion of the error in the true value than \(MAE\)[34].  
\[MRE=\frac{1}{n}\sum_{i=1}^{n}\left|\frac{\dot{y}_{i}-y_{i}}{y_{i}}\right| \tag{8}\]  
The Pearson correlation coefficient is a statistical measure of the strength and direction of the linear relationship between two continuous variables, taking values in the range [\(-1\), 1]. In machine learning, it is commonly used to assess the trend consistency between the predicted and true values of a regression model [35].  
\[r=\frac{\sum_{i=1}^{n}\left(x_{i}-\overline{x}\right)\left(y_{i}-\overline{y} \right)}{\sqrt{\sum_{i=1}^{n}\left(x_{i}-\overline{x}\right)^{2}}\sqrt{\sum_{i =1}^{n}\left(y_{i}-\overline{y}\right)^{2}}} \tag{9}\]