Abstract
Ground temperature prediction is critical for ensuring the long-term operational stability and energy efficiency of ground-source heat pump (GSHP) systems, which are essential for the sustainable utilization of shallow geothermal energy and the stability of the underground ecological environment. However, existing models are predominantly developed for shallow depths (typically within 5 m) for agricultural or permafrost applications, leaving the 50–100 m depth range relevant to GSHP systems underexplored. This study addresses this gap by constructing differentiated prediction models for two typical data types: multi-parameter short-period data and single-parameter long-period data. For Sample I, random forest and support vector regression (SVR) models were developed with hyperparameters optimized by the Sparrow Search Algorithm. For Sample II, ARIMA and SARIMA models were established. A standardized preprocessing workflow integrating box plot-based outlier detection, Newton interpolation, and Min-Max normalization was applied to both datasets. The results show that random forest significantly outperforms SVR, while SARIMA with seasonal components substantially improves upon ARIMA by capturing annual ground temperature periodicity. These findings provide quantitative guidance for model selection in GSHP engineering, particularly for the 50–100 m depth range, enabling accurate prediction of deep ground temperature for thermal balance assessment and early warning of thermal imbalance risks, thereby supporting the sustainable operation of GSHP systems and the efficient utilization of shallow geothermal energy.
1. Introduction
Ground temperature prediction is an important research direction in ground temperature field studies and is critical for ensuring the long-term stable operation of ground-source heat pump (GSHP) systems. In terms of the system operation mechanism, a GSHP exchanges heat periodically with the soil through buried pipes, and this continuous energy input or output inevitably leads to the dynamic evolution of the ground temperature field. If heat accumulates or dissipates unidirectionally over a long period, the original thermal equilibrium state of the soil will be disrupted, causing system efficiency degradation or even failure. Therefore, long-term prediction of ground temperature enables a scientific assessment of the thermal balance state of the system after years of operation and helps determine whether the ground temperature field can still be maintained within a reasonable range of dynamic stability. Accordingly, operation strategies and adjustment plans can be formulated in advance to effectively mitigate soil thermal accumulation or thermal attenuation effects, thereby ensuring the energy efficiency and operational reliability of the system throughout its entire life cycle.
Currently, ground temperature prediction mainly relies on modeling and analysis that combine algorithmic models with measured data, and the acquisition of monitoring data typically requires the deployment of temperature sensors at different depths underground. Common monitoring methods include distributed optical fiber temperature sensing [1,2], borehole temperature logging [3], and resistivity thermometry [4]. Among these, distributed optical fiber temperature sensing uses optical fibers as the sensing medium, enabling continuous temperature monitoring along the entire measurement path, and offers advantages such as high spatial resolution and strong immunity to electromagnetic interference. Borehole temperature logging performs point-wise or continuous measurements in boreholes using specialized temperature probes and is suitable for deep ground temperature detection. Resistivity thermometry indirectly retrieves the temperature distribution based on the correlation between the electrical resistivity of rock or soil and temperature. However, these methods have notable limitations in practical engineering applications. On the one hand, the installation of temperature sensors involves borehole drilling, equipment burial, and cable laying, resulting in high initial investment and subsequent maintenance costs. Especially in large-scale GSHP systems with widely distributed buried pipes and numerous boreholes, economic feasibility and field operability face severe challenges. On the other hand, sensors buried in complex underground environments for extended periods are prone to drift or failure over time due to factors such as soil corrosion, water infiltration, and mechanical compression, requiring periodic calibration and maintenance. Consequently, the reliability and continuity of long-term monitoring data are difficult to guarantee effectively.
In terms of algorithmic prediction, existing studies have widely adopted data-driven models [5,6] for ground temperature prediction, establishing mapping relationships between temperature and influencing factors by mining temporal patterns and deep correlations in historical data. For instance, King et al. [7] developed a prediction model for undisturbed ground temperature using artificial neural network (ANN) and multiple regression approaches, demonstrating that the combined method can effectively capture the nonlinear relationships between meteorological variables and subsurface thermal conditions. Asadzadeh et al. [8] systematically investigated the impact of various meteorological parameters on daily soil temperature variations using multiple machine learning models, providing a comparative assessment of model performance under different climatic conditions and identifying the most influential input variables for accurate prediction. In the context of cold-region engineering, Liu et al. [9] conducted a multisite evaluation of physics-informed deep learning for permafrost prediction on the Qinghai–Tibet Plateauu, integrating physical constraints with deep neural networks to enhance model generalizability across different observation sites. Their prediction results demonstrate that the proposed method can accurately simulate permafrost temperature profiles, confirming the effectiveness of physics-informed deep learning in permafrost ground temperature prediction. Furthermore, Farhangmehr et al. [10] proposed a spatiotemporal CNN-LSTM deep learning model for predicting soil temperature under diverse large-scale regional climatic conditions. Their results demonstrated that the hybrid architecture, which combines convolutional neural networks for spatial feature extraction and long short-term memory networks for temporal dependency modeling, achieved superior prediction accuracy compared to conventional approaches, highlighting the significant advantages of deep learning methods in capturing the complex spatiotemporal evolution of soil temperature fields.
At a broader level, Dashtgoli et al. [11] systematically reviewed 183 studies on AI applications in deep geothermal energy, covering eight domains including prediction, reservoir modeling, and system optimization. Their review revealed that ANNs remain the most widely applied for prediction tasks, while tree-boosting methods (RF, GBM, XGBoost) are increasingly used for nonlinear geothermal datasets, and LSTMs are applied to time-series forecasting in monitoring and heat flow prediction. This indicates that existing deep geothermal prediction algorithms are diverse but have not been specifically tailored to the 50–100 m depth range relevant to GSHP systems. Ma et al. [12] further reviewed machine learning methods specifically for underground temperature prediction, emphasizing the performance of neural networks and their variants in multi-source data fusion and indirect geothermometer optimization, while identifying challenges such as inadequate spatiotemporal dynamic representation and limited model generalizability. Meanwhile, Kirschstein et al. [13] conducted a literature review on the regeneration of shallow borehole heat exchanger fields, noting that ongoing long-term heating or cooling of the ground caused by unbalanced loads leads to performance decline and in the worst case to system shutdown, and that enhanced regeneration can increase system efficiency and compensate unbalanced loads.
The sustainability of GSHP systems hinges on maintaining the long-term thermal balance of the subsurface environment. Saleem et al. [14] conducted a systematic review of thermal energy storage-integrated GSHP systems and noted that prolonged GSHP operation may lead to a decline in the geothermal potential of the soil and its thermal imbalance. When the heat extracted from the ground persistently exceeds the heat replenished, soil thermal accumulation or attenuation occurs, leading to a decline in system efficiency and compromising the sustainable utilization of shallow geothermal energy. Therefore, accurate prediction of deep ground temperature evolution is not merely a technical necessity but a prerequisite for ensuring the environmental and operational sustainability of GSHP systems.
Nevertheless, a closer examination of the aforementioned studies indicates that most existing efforts have concentrated on shallow ground temperature prediction (generally within 5 m depth), and their objectives are primarily oriented toward agricultural meteorology, permafrost engineering, or surface energy balance analysis, rather than the deeper ground temperature evolution relevant to GSHP systems. In practical engineering, however, the buried pipe depth of shallow GSHP systems typically ranges from 50 m to 100 m, far beyond the prediction depth range of existing models. Shallow prediction models generally rely on three assumptions: (1) surface meteorological conditions are the dominant boundary conditions; (2) the subsurface medium is homogeneous; and (3) the temperature field evolves naturally without artificial disturbance. These assumptions do not hold for the 50–100 m depth range relevant to GSHP systems. First, the influence of surface meteorological conditions on deep ground temperature exhibits significant attenuation and phase lag, so the surface boundary conditions that dominate shallow models are no longer the primary drivers at greater depths. Second, the thermophysical parameters of deep rock and soil vary with depth, stratigraphic structure, and water content, so the homogeneity assumption is no longer valid. Third, the artificial thermal disturbance caused by GSHP operation generates a complex three-dimensional unsteady temperature field, whose evolution characteristics differ fundamentally from those of the natural shallow temperature field. Because these assumptions are not satisfied, may not be directly applicable to the 50–100 m depth range relevant to GSHP systems without further validation. Therefore, developing ground temperature prediction models specifically for this depth range remains an important research direction that requires further exploration.
To achieve accurate prediction of soil temperature, this study uses field-measured data from two GSHP projects with different monitoring conditions to construct different prediction models. Project A provides multi-parameter short-period data, while Project B provides single-parameter long-period data. Random forest and SVR models are developed for Project A, and ARIMA and SARIMA models are established for Project B. The prediction performance of these models is compared under a unified evaluation framework. The objectives of this study are: (1) to develop a standardized preprocessing workflow for GSHP monitoring data that integrates outlier detection, missing value imputation, and normalization; (2) to construct differentiated prediction models adapted to the specific characteristics of each dataset; (3) to compare the prediction accuracy of ensemble learning, kernel-based, and seasonal time-series methods; and (4) to provide quantitative guidance for model selection in GSHP engineering, particularly for the 50–100 m depth range relevant to GSHP systems. The results of this study are expected to support long-term thermal balance evaluation and operation regulation of GSHP systems, thereby contributing to the sustainable utilization of shallow geothermal energy.
2. Materials and Methods
2.1. Research Objects and Data Sources
This study includes two data samples. Sample I is obtained from ground-source heat pump Project A, which is equipped with an intelligent remote monitoring platform capable of real-time collection of outdoor meteorological data, system operating parameters, and soil temperature at different depths. Sample II is obtained from another ground-source heat pump Project B, which is equipped only with a ground temperature monitoring system capable of real-time monitoring of soil temperature variations.
Project A has a total above-ground building area of 23,000 m2, with a design cooling load of 1900 kW and a design heating load of 1800 kW. A total of 408 borehole heat exchangers are buried underground, with a spacing of 5 m between adjacent buried pipes. Every six boreholes form a horizontal loop and are connected to the manifold through steel-to-plastic transition joints nearby. The system is equipped with a ground temperature-monitoring device. The locations of the monitoring boreholes and the layout of the pipe groups are shown in Figure 1. The borehole diameter is 150 mm, with an effective depth of 100 m. A single U-type PE pipe of Φ32 × 3.0 is installed in each borehole. The heat exchange pipes are made of high-density polyethylene HDPE100, and the backfill material is original slurry backfill.
Figure 1.
Layout diagram of ground temperature monitoring system for buried pipes in Project A.
Project B uses double U-type polyethylene pipes for the buried pipes, with a total of 326 boreholes, each with a depth of 120 m. Temperature sensors are installed at 10 m intervals in the monitoring boreholes. The locations of the monitoring boreholes are shown in Figure 2, where the superscript denotes the monitoring borehole number.
Figure 2.
Layout diagram of ground temperature monitoring system for buried pipes in Project B.
2.2. Data Preprocessing
2.2.1. Data Cleaning and Outlier Processing
The actual operation process of GSHP systems is complex, and data acquisition and storage equipment are prone to failures during operation, resulting in uneven data quality. To improve data quality and ensure the reliability of subsequent analysis, data cleaning techniques need to be introduced. The core objective of data cleaning is to improve the quality of raw data, mainly involving two aspects: missing value processing and outlier identification.
Missing values are usually caused by manual entry errors, acquisition instrument failures, or storage device failures, manifesting as incomplete data records. Since most algorithms cannot directly handle data containing missing values, specific methods need to be adopted: when the missing proportion is low and does not affect the analysis quality, samples containing missing values can be directly deleted; if the missing proportion is too high or the data acquisition cost is high, interpolation and other methods need to be used for imputation. In actual decision-making, statistical knowledge and domain expert experience should be combined. Commonly used missing value imputation methods include Lagrange interpolation [15] and Newton interpolation [16]. Considering that Newton interpolation does not require recalculating the entire polynomial when adding new interpolation nodes, but only needs to add new terms on the original basis, resulting in higher computational efficiency, this study selects Newton interpolation for missing value imputation. Outliers refer to values that significantly deviate from normal patterns or system operating states, characterized by exceeding reasonable ranges, remaining fixed for a long time, etc., and their occurrence frequency is usually assumed to be 5–10% of the total data volume. Outliers arise from various causes, including sensor failure, equipment malfunction, or extreme operating conditions. Since outliers significantly affect the performance of most algorithms, specialized methods are required for identification, elimination, or replacement.
Commonly used outlier identification methods include the 3-sigma rule [17] and the interquartile range method [18], both of which assume that the data approximately follow a normal distribution. As shown in Figure 3, the 3-sigma rule is based on the random error assumption and determines the normal fluctuation range of the data by calculating the standard deviation σ. For normally distributed data: approximately 68.27% of the data fall within the interval (μ − σ, μ + σ), approximately 95.45% fall within (μ − 2σ, μ + 2σ), and approximately 99.73% fall within (μ − 3σ, μ + 3σ); data beyond the range of (μ − 3σ, μ + 3σ) (accounting for less than 0.3%) are considered outliers.
Figure 3.
Schematic diagram of the 3-sigma rule. Based on Straker [17].
The interquartile range method determines the outlier identification boundaries by calculating the 25th percentile (Q1) and the 75th percentile (Q3) of the data, obtaining the interquartile range IQR = Q3 − Q1, and establishing the outlier judgment interval as [Q1 − 1.5 × IQR, Q3 + 1.5 × IQR]. Samples falling outside this range are identified as outliers.
The box plot, which is the graphical representation of the interquartile range (IQR) method, as shown in Figure 4, is a highly advantageous tool for data visualization and statistical analysis, with its core advantages reflected in two aspects:
Figure 4.
Schematic diagram of the interquartile range (IQR) method. Based on Dovoedo [18].
- A non-parametric nature, conforming to the true distribution of the data. The box plot can accurately characterize the degree of data dispersion without assuming that the data follow a specific statistical distribution, and without requiring complex preprocessing or stringent condition verification. It preserves the original characteristics of the data to the greatest extent and intuitively presents the true distribution patterns of the data.
- Strong robustness against interference, enabling reliable identification of outliers. The box plot identifies outliers based on quartiles and the interquartile range. Even when up to 25% of the data exhibit extreme fluctuations, the quartiles remain largely unaffected, demonstrating good robustness against extreme values and yielding objective and reliable outlier identification results.
Considering the diverse types and complex structures of actual operational data, this study adopts the box plot as the core method for outlier detection, which not only ensures the accuracy and stability of data analysis results but also faithfully reproduces the actual distribution characteristics of the dataset.
2.2.2. Data Normalization
Normalization is a data preprocessing technique that maps data of different dimensions to a unified numerical range, typically [0, 1] or [−1, 1]. This step aims to eliminate the order-of-magnitude differences among data, ensuring that each feature contributes equally during model training and thereby avoiding prediction bias caused by inconsistent data magnitudes. Since ground temperature prediction requires a large number of input parameters with diverse types, and the units and orders of magnitude of the physical quantities involved vary considerably, abnormal results may occur during the prediction process, and the training time may be prolonged. Therefore, normalizing each physical quantity is of great benefit for reducing modeling difficulty and improving prediction accuracy. In this study, the Min–Max normalization method [19] is adopted, which applies a linear transformation to the original data and maps the data values to the range [0, 1]. The transformation can be expressed as:
where x and y denote the data before and after normalization, respectively; xmax and xmin denote the maximum and minimum values of the original data before normalization, respectively.
2.3. Algorithm Selection and Overall Modeling Framework
2.3.1. Algorithm Selection Rationale
The selection of prediction algorithms for both samples was guided by the intrinsic characteristics of the data rather than by empirical preference. Table 1 summarizes the comparative suitability of candidate algorithms across key dimensions including sample size requirements, non-linearity handling, interpretability, and computational cost.
Table 1.
Comparison of candidate algorithms for ground temperature prediction.
For Sample I, the dataset contains 631 data groups with multiple operational and meteorological parameters, representing a small-sample, multi-feature regression problem. Deep learning methods were excluded because they require very large labeled datasets to avoid overfitting. XGBoost also performs well on small-to-moderate datasets, but its performance is comparable to random forest in this setting, while random forest provides feature importance directly through the ensemble structure with fewer hyperparameters and lower computational cost. Although XGBoost can be interpreted using SHapley Additive exPlanations (SHAP), this requires an additional post-hoc analysis step. Random forest offers strong robustness to noise and the ability to handle nonlinear relationships among multiple parameters [20], while SVR is theoretically well-suited for small-sample, high-dimensional regression [30]. Based on these considerations, random forest and SVR were selected for comparative modeling of Sample I. For Sample II, the dataset contains 1275 daily records forming a long-term, single-variable time series. Tree-based and kernel-based methods do not explicitly model temporal autocorrelation. ARIMA is a classical statistical model for non-seasonal time series, and SARIMA extends it by incorporating seasonal structures. Given that the ACF analysis confirmed a significant 365-day periodicity, SARIMA is theoretically the most appropriate model, with ARIMA retained as a non-seasonal baseline.
Based on the comparison in Table 1, the workflow adopted in this study follows a standard data-mining procedure: data preprocessing, algorithm screening, model training, and validation. The contribution lies in applying this procedure to two distinct GSHP monitoring datasets and comparing the performance of representative algorithms. The workflow includes three main steps: (1) characterizing the available monitoring data in terms of sample size, feature dimensionality, and temporal coverage; (2) screening candidate algorithms according to their requirements for sample size, data dimensionality, and temporal structure; and (3) training and comparing the selected candidates under a unified evaluation protocol. This procedure is summarized in Figure 5 and is applied separately to Sample I and Sample II.
Figure 5.
Algorithm workflow diagram.
2.3.2. Overall Modeling Flowchart
The overall workflow of the proposed data characteristics-oriented prediction framework is illustrated in Figure 5. The framework consists of four core modules: data preprocessing, differentiated modeling, hyperparameter optimization/order identification, and model validation.
2.4. Detailed Modeling for Sample I: SVR and RF
2.4.1. Input Parameter Selection and Data Partitioning
The Pearson correlation coefficient was adopted for preliminary feature screening because it is computationally efficient and provides a straightforward measure of linear dependence between each candidate input and the target ground temperature. Although GSHP thermal processes are inherently nonlinear, many operational and meteorological parameters exhibit monotonic or approximately linear relationships with ground temperature over the monitoring period. Therefore, Pearson correlation serves as an effective first-step filter to remove weakly correlated variables and reduce input dimensionality, thereby improving modeling efficiency and reducing the risk of overfitting. The retained features are then fed into random forest and SVR models, which are capable of capturing nonlinear relationships that Pearson correlation alone cannot represent.
For Sample I, the Pearson correlation coefficient method was adopted for preliminary feature screening, and the results are shown in Figure 6. The soil temperatures at depths of 60 m, 80 m, and 100 m exhibit the strongest correlation with shallow soil temperatures at depths of 1–5 m, followed by the soil temperature at 9 m depth, the ground heat exchanger inlet/outlet temperature, the user-side supply water temperature, the outdoor temperature, and the user-side heating (cooling) capacity. These parameters were selected as model inputs, and the soil temperatures at 60 m, 80 m, and 100 m were used as output targets. The Sample I dataset contains 631 data groups. The first 70% (441 groups) were used as the training set and the remaining 30% (190 groups) as the test set, split in chronological order.
Figure 6.
Correlation heatmap of various influencing parameters.
2.4.2. Support Vector Regression (SVR)
The support vector machine (SVM) has been applied in various geoscience problems, such as fault identification using 3-D seismic data [31]. Support vector regression (SVR) is a kernel-based method that extends the support vector machine to regression problems. As shown in Figure 7, it maps the original inputs into a high-dimensional feature space and then seeks a regularized regression hyperplane to approximate the target values [30]. The model performance is mainly controlled by three factors: the penalty coefficient C, the insensitive loss parameter ε, and the kernel function type. The ε-insensitive loss treats predictions within a tolerance band of width 2ε as error-free, which helps reduce the influence of noise and outliers. Considering the nonlinear relationships between ground temperature and its influencing factors, the radial basis function (RBF) kernel was adopted because of its strong nonlinear mapping capability and wide applicability [32]. The hyperparameters C, ε, and γ were optimized using the Sparrow Search Algorithm (SSA) [33].
Figure 7.
Schematic diagram of the Support Vector Regression (SVR) algorithm. Based on Vapnik [30].
2.4.3. Random Forest (RF)
Random forest is an ensemble learning method that constructs multiple decision trees via bootstrap sampling and random feature selection, and aggregates their outputs by averaging for regression tasks [20]. It is robust to noise and outliers, requires no complex preprocessing, and provides feature importance for variable selection. The main hyperparameters include the number of trees, maximum depth, minimum samples per split and leaf, and maximum features. These were also optimized using SSA [33]. The workflow diagram of the RF algorithm is shown in Figure 8.
Figure 8.
Workflow diagram of the random forest algorithm. Based on Breiman [20].
2.4.4. Hyperparameter Optimization (SSA)
The prediction performance of both SVR and random forest depends on the configuration of their hyperparameters. For SVR with the RBF kernel, the key hyperparameters are the penalty coefficient C, the insensitive loss parameter ε, and the kernel parameter γ. For random forest, the main hyperparameters include the number of trees, maximum depth, minimum samples per split and leaf, and the maximum number of features considered at each split. Manual tuning of these parameters is time-consuming and may not yield a globally optimal configuration. Therefore, the Sparrow Search Algorithm (SSA) was employed for automated hyperparameter optimization [33]. SSA is a swarm intelligence algorithm that simulates the foraging behavior of sparrows, including three roles: discoverers, followers, and vigilantes. It balances global exploration and local exploitation through the position updates of these three groups.
The optimization process was carried out as follows. First, the hyperparameters to be optimized were encoded into the position vector of each sparrow individual. For SVR with the RBF kernel, a three-dimensional encoding was used, corresponding to C, ε, and γ. For random forest, a six-dimensional encoding was used, corresponding to the number of trees, maximum depth, minimum samples per split, minimum samples per leaf, maximum features, and the sampling parameter. Second, the population was initialized randomly within the parameter bounds. Third, the fitness of each individual was evaluated using the root mean square error (RMSE) obtained from K-fold cross-validation. Fourth, the positions of discoverers, followers, and vigilantes were updated iteratively according to the SSA rules. Finally, the position with the best fitness value was decoded as the optimal hyperparameter combination. The SSA was run for a maximum of 50 iterations with a population size of 20.
2.5. Detailed Modeling for Sample II: ARIMA and SARIMA
2.5.1. ARIMA Model
ARIMA(p, d, q) combines autoregressive, differencing, and moving average components [24]. The differencing order d was determined by the Augmented Dickey–Fuller (ADF) test [34]. The orders p and q were identified by ACF and PACF analysis, and the optimal combination was selected by the Akaike Information Criterion (AIC) [35]. In this study, ARIMA(1,1,2) was determined as the optimal model. The flowchart adopted is shown in Figure 9.
Figure 9.
Flowchart of the ARIMA-based time series forecasting procedure.
2.5.2. SARIMA Model
SARIMA extends ARIMA by incorporating seasonal autoregressive, seasonal differencing, and seasonal moving average terms [25], denoted as SARIMA(p, d, q)(P, D, Q)s. The seasonal period s was identified as 365 days based on ACF analysis and the physical annual cycle of ground temperature. The seasonal orders P, D, and Q were determined by SACF/SPACF analysis and AIC, yielding SARIMA(1,1,2)(0,1,1)365. The choice of s = 365 is supported by the physical mechanism: at depths of 50–100 m, ground temperature is predominantly controlled by the annual solar radiation cycle, and the ACF showed a significant peak at a lag of 365 days. The monitoring data span approximately 3.5 years, covering more than three complete annual cycles.
The selection of an appropriate seasonal period is critical for model performance. To avoid subjective bias, the autocorrelation function (ACF) was employed to quantitatively identify the periodic characteristics of the daily ground temperature time series, as shown in Figure 10.
Figure 10.
ACF diagram of the ground temperature time series.
As can be seen from the figure, the autocorrelation coefficient decays periodically with increasing lag days. It first drops to zero at a lag of approximately 80 days, then enters the negative correlation range and reaches a negative peak between 150 and 200 days, after which it gradually recovers to about 0.6 at a lag of around 365 days, significantly exceeding the 95% confidence interval. This result quantitatively verifies that ground temperature is affected by the annual cycle of solar radiation and exhibits a significant seasonal fluctuation characteristic with a period of 365 days. Therefore, selecting the seasonal period s = 365 in the SARIMA model has sufficient statistical support and can effectively characterize the periodic evolution of ground temperature.
The seasonal orders P, D, and Q were determined by SACF/SPACF analysis and AIC, yielding SARIMA(1,1,2)(0,1,1)365.
2.6. Model Evaluation Metrics
To quantitatively evaluate the prediction performance of the models, this study adopts the mean relative error (MRE), the root mean square error (RMSE), and the coefficient of determination (R2) as evaluation metrics. The definitions of these metrics are presented as follows.
MRE represents the average level of relative error between predicted values and actual values. It eliminates the influence of dimensions and facilitates comparison across different models. RMSE quantifies the deviation between predicted values and actual values and is sensitive to large errors. A smaller RMSE indicates higher prediction accuracy. R2 reflects the ability of the model to explain the variability in the data. Its value typically ranges from 0 to 1, with values closer to 1 indicating a better fit. Their definitions are expressed as follows:
where n is the number of samples, yi is the actual value of the i-th sample, and is the predicted value of the i-th sample, and is the mean of the actual values. A smaller RMSE or MRE indicates higher prediction accuracy, while an R2 closer to 1 indicates a better fit.
2.7. Validation Strategy
The prediction task in this study is one-step-ahead forecasting. For Sample II, the first 120 points were used for model identification, points 121–1125 for training, and points 1126–1275 for testing. The data were split strictly in chronological order, and no random shuffling was applied. During testing, the model at time t uses only observations up to t to predict t + 1, and the true observation is then incorporated before moving to the next step. This setting mimics real-time monitoring and avoids the use of any future information. Conventional K-fold cross-validation was not adopted because random partitioning would break the temporal structure of the time series and allow future information to leak into the training process. Residual diagnostics (Ljung–Box test) and walk-forward validation were not performed, mainly because the available sample size for Sample II (1275 daily records, approximately 3.5 years) is insufficient for robust statistical testing at a seasonal lag of 365 days.
3. Results
3.1. Prediction Results for Sample I
Based on the prediction results of the model on the test set, prediction accuracy metrics are calculated, and the specific calculation results are presented in Table 2.
Table 2.
Calculation results of prediction metrics (Random forest, SVR).
As can be seen from the table, at depths of 60 m, 80 m, and 100 m, the MRE values of the random forest model are 0.008, 0.012, and 0.011, respectively; the RMSE values are 0.016, 0.019, and 0.018, respectively; and the R2 values are 0.935, 0.951, and 0.940, respectively. In contrast, the MRE values of the SVR model are 0.049, 0.065, and 0.061, respectively; the RMSE values are 0.049, 0.051, and 0.052, respectively; and the R2 values are 0.907, 0.920, and 0.918, respectively. Compared with the SVR model, the random forest model reduces the MRE by 83.67%, 81.54%, and 81.97% at the three depths, respectively; reduces the RMSE by 67.35%, 62.75%, and 65.38%, respectively; and improves the R2 by 3.09%, 3.37%, and 2.39%, respectively. Therefore, the prediction accuracy of the random forest model is higher than that of the SVR model, while the overall prediction accuracy of the SVR model remains within an acceptable range.
From Figure 11, it can be seen that the ground temperature prediction errors of the random forest algorithm at the three depths are mainly concentrated within a narrow interval of −0.06 to 0.06 °C, meaning stronger prediction stability. The coverage rates of errors within this interval at depths of 60 m, 80 m, and 100 m reach 99.15%, 99.02%, and 99.18%, respectively, and the overall error concentration is significantly higher than that of the SVR algorithm. In terms of error peaks, the frequencies are highest in the 0.00–0.02 °C interval at depths of 60 m and 100 m, with values of 31.27% and 29.63%, respectively; the peak at 80 m depth lies in the −0.02 to 0.00 °C interval, reaches 28.94%. The error distribution at 100 m depth is more uniform, indicating that the random forest algorithm maintains good consistency in controlling prediction errors at different depths.
Figure 11.
Absolute prediction error distribution resulted from the random forest model.
As shown in Figure 12, the errors of the SVR algorithm are mainly distributed in the range of −0.08 to 0.08 °C, which is notably wider than that of the random forest. The error coverage rates at depths of 60 m, 80 m, and 100 m are 98.23%, 97.91%, and 98.24%, respectively, slightly lower overall than those of the random forest. In terms of peaks, the frequencies at depths of 60 m and 100 m are highest in the interval of 0.00–0.02 °C, at 29.35% and 24.52%, respectively; the peak at 80 m depth lies in the interval of −0.02 to 0.00 °C, at 23.87%.The overall accuracy and stability are inferior to those of the random forest, but its prediction accuracy remains within an acceptable range.
Figure 12.
Absolute prediction error distribution resulted from the SVR model.
As shown in Figure 13, the predicted ground temperature curves of the random forest model at depths of 60 m, 80 m, and 100 m are in close agreement with the measured curves overall, meaning that the model can accurately capture the variation patterns of ground temperature at each depth. At 60 m depth, the predicted curve fits the measured curve most tightly with the smallest local fluctuation deviations. As the depth increases to 80 m and 100 m, the local amplitude deviations between the predicted and measured values become slightly larger, but good trend synchronization and phase coherence are still maintained, while the overall error is controlled within a small range. This indicates that the random forest model can effectively characterize the dynamic evolution of ground temperature fields at different depths, exhibiting stable generalization ability and prediction accuracy.
Figure 13.
Ground temperature prediction results resulted from the random forest model.
As shown in Figure 14, the predicted ground temperature curves of the SVR model at depths of 60 m, 80 m, and 100 m are generally consistent with the measured values in overall trend and can basically capture the periodic fluctuation characteristics of the ground temperature. However, there are obvious differences in local fitting accuracy. At the depth of 60 m, the predicted curve fits the measured curve relatively well and can reflect the main peak and valley variations. As the depth increases to 80 m and 100 m, the amplitude deviations and phase shifts between the predicted and measured values gradually increase, while some sample points exhibit obvious peak underestimation or valley overestimation. The synchronization of local fluctuations is weaker than that of the random forest model.
Figure 14.
Ground temperature prediction results obtained from the SVR model.
By comparing the prediction performance of the random forest and SVR models, the random forest model demonstrates superior fitting accuracy at all three depths, with higher overlap between the predicted and measured curves and smaller local fluctuation deviations. In particular, for the prediction of deep ground temperatures at 80 m and 100 m, the random forest model shows a significantly better ability to capture abrupt temperature changes and high-frequency fluctuations, and can more accurately reproduce the dynamic evolution of the ground temperature field. In contrast, although the SVR model can capture the overall trend, its ability to characterize complex nonlinear fluctuations is insufficient, and local errors are more pronounced.
3.2. Prediction Results for Sample II
Based on the prediction results of the model on the test set, prediction accuracy metrics are calculated, and the specific calculation results are presented in Table 3.
Table 3.
Calculation results of prediction metrics (ARIMA, SARIMA).
Compared with the ARIMA model, the SARIMA model reduces the MRE by 27.91%, reduces the RMSE by 15.91%, and improves the R2 by 3.21%. This indicates that the SARIMA model, which incorporates seasonal factors, can more accurately capture the periodic characteristics of the ground temperature time series, with prediction accuracy and fitting performance significantly superior to those of the ARIMA model.
Figure 15 presents the absolute error distribution of the ARIMA model prediction results. As can be seen from the figure, the ground temperature prediction errors of the ARIMA model are mainly distributed within the range of −0.08 to 0.08 °C, with 96.37% of the prediction errors falling within this range. The highest frequency of errors occurs in the interval of −0.04 to 0.02 °C, accounting for 20.12%, and the overall error distribution exhibits a certain degree of skewness.
Figure 15.
Absolute prediction error distribution resulted from the ARIMA model.
Figure 16 presents the absolute error distribution of the SARIMA model prediction results. As can be seen from the figure, the ground temperature prediction errors of the SARIMA model are mainly distributed within the range of −0.06 to 0.06 °C, with 98.84% of the prediction errors falling within this range. Compared with the ARIMA model, the error coverage range is narrower and the concentration is higher. The highest frequency of errors occurs in the interval of −0.04 to 0.02 °C, accounting for 21.35%, and the overall error distribution shows no obvious skewness. Compared with the ARIMA model, the SARIMA model exhibits a more concentrated prediction error distribution and better stability, with a stronger ability to capture the periodic characteristics of the time series.
Figure 16.
Absolute prediction error distribution resulted from the SARIMA model.
As shown in Figure 17 and Figure 18, both the ARIMA and SARIMA models can effectively capture the complete evolution trend of the periodic variation in ground temperature. The predicted curves are highly consistent with the measured curves overall, and the long-term variation patterns of ground temperature can be well reproduced. The ARIMA model can accurately capture the temperature variation trend. In the stable stage from sample 150 to 250, the predicted values fit the measured values closely, but small amplitude deviations occur during the rapid temperature decline stage and the later recovery peak stage. Its ability to synchronize local fluctuations and depict details is slightly weaker, and a slight lag is observed at some peak points, reflecting its limitations in handling non-stationary and periodic time series.
Figure 17.
Ground temperature prediction results of the ARIMA model.
Figure 18.
Ground temperature prediction results of the SARIMA model.
Based on the trend prediction capability of the ARIMA model, the SARIMA model further enhances the fitting accuracy of periodic fluctuations by introducing seasonal terms, and the overlap between the predicted and measured curves is significantly improved. In particular, the characterization of abrupt temperature change points, peaks, and valleys is closer to the measured data, and the local fluctuation deviations are significantly smaller than those of the ARIMA model. The SARIMA model responds more promptly to rapid temperature changes and exhibits better detail restoration capability and stability. Overall, because the SARIMA model fully considers the periodic characteristics of the ground temperature series, it outperforms the ARIMA model in both overall trend fitting and local fluctuation capture, and is more suitable for predicting ground temperature time series with obvious seasonal periodic variation.
4. Discussion
4.1. Comparison and Discussion of Model Performance
For Sample I, random forest can divide the input space into multiple local response regions through tree-based splitting. This is useful when the effects of operational and meteorological variables vary across different operating conditions. Bootstrap aggregation then reduces the variance associated with individual trees, which may explain the stable prediction errors observed across the three depths. In contrast, SVR estimates a single kernel-based regression function. Its regularization term and ε-insensitive loss balance fitting accuracy against model smoothness; consequently, rapid local temperature changes may be smoothed when the selected kernel and hyperparameters do not adequately represent these patterns. This mechanism is consistent with the larger SVR errors at 80 m and 100 m.
In the case of Sample II, the selected SARIMA(1,1,2)(0,1,1)365 model includes first-order and seasonal differencing, allowing it to remove both short-term non-stationarity and the repeating annual component before modeling the residual series. Its seasonal MA(1) term also incorporates error information from the same period in the previous year. By comparison, ARIMA(1,1,2) models only non-seasonal temporal dependence and cannot explicitly use annual lag information. It can therefore reproduce the general trend but may show delayed fitting of local peaks and troughs during rapid temperature changes. This difference in temporal representation is consistent with the lower MRE and more concentrated residual distribution obtained by SARIMA.As described in Section 2.7, the reported R2 corresponds to rolling one-step-ahead forecasting and therefore represents short-term operational prediction rather than a long-horizon forecast.
4.2. Practical Implications
Accurate prediction of deep ground temperature can support the long-term operation of GSHP systems. Persistent imbalance between heat extraction and heat injection may gradually shift the subsurface temperature field, reducing heat-exchange efficiency. For projects with short-term multivariable monitoring, the random forest model can support early assessment of temperature changes using operational and meteorological data. For long-term single-variable records, SARIMA can help distinguish recurring seasonal variation from persistent temperature drift.
These predictions can support decisions on load adjustment and thermal-regeneration measures when an imbalance is identified. Maintaining a more stable subsurface thermal condition may improve GSHP operating efficiency and reduce associated electricity use. Although carbon emissions were not quantified in this study, improved operational efficiency has the potential to reduce indirect emissions and support the sustainable use of shallow geothermal energy.
4.3. Limitations and Future Work
This study has several limitations. The models are data-driven and do not explicitly represent hydrogeological processes such as groundwater flow or spatial variations in geological conditions, which may limit their transferability across sites. In addition, the monitoring period for Sample II covers only about 3.5 annual cycles, so the SARIMA results demonstrate predictive performance within the available dataset but do not establish long-term forecasting reliability. Future work should therefore test hybrid data-driven and physics-informed models using longer records from sites with different geological conditions, and evaluate their performance in real-time operation.
5. Conclusions
This study shows that the prediction performance of deep ground temperature models in GSHP systems depends strongly on the structure of the available data. For Sample I, which included multiple operational and meteorological variables over a relatively short monitoring period, random forest outperformed SVR, achieving R2 values above 0.93 at all depths, with most prediction errors within ±0.06 °C. For Sample II, which comprised a single long-term temperature series, SARIMA(1,1,2)(0,1,1)365 outperformed ARIMA(1,1,2), with R2 values of 0.996 and 0.965, respectively. These results indicate that random forest is more suitable for multivariable monitoring data, whereas SARIMA is advantageous when long-term seasonal temperature records are available.
The findings provide a practical basis for selecting prediction models in GSHP operation. Reliable temperature forecasts can help identify emerging subsurface thermal imbalance and support timely load management or thermal-regeneration measures. By maintaining ground thermal balance, improving operating efficiency, and reducing associated energy use and carbon emissions, the model comparison and selection strategy adopted in this study supports the sustainable utilization of shallow geothermal energy.
Author Contributions
Conceptualization, S.Z. and K.Z.; methodology, H.J.; software, H.J.; validation, X.Z., S.Z. and K.Z.; formal analysis, Z.L.; investigation, Z.L.; resources, X.Z.; data curation, Z.L.; writing—original draft preparation, Z.L.; writing—review and editing, H.J.; visualization, S.Z.; supervision, K.Z.; project administration, X.Z.; funding acquisition, S.Z. All authors have read and agreed to the published version of the manuscript.
Funding
This study was funded by the Key Laboratory of Shallow Geothermal Energy, Ministry of Natural Resources of the People’s Republic of China, No. KLSGE202601-03.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Dataset available on request from the authors.
Conflicts of Interest
Author Hanbing Jia was employed by Inner Mongolia AsiaInfo Venture Development Co., Ltd., Ulanqab, China. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
References
- Song, S.L.; Wang, Y.G.; Wang, H.F.; Lu, X.H.; Ma, Z.M.; Wang, L. Application of Optical Fiber Temperature Measurement Technology in Ground Temperature Field Monitoring. Shandong Land Resour. 2018, 3, 56–59. (In Chinese) [Google Scholar]
- Kłonowski, M.R.; Nermoen, A.; Thomas, P.J.; Wyrwalska, U.; Pratkowiecka, W.; Ładocha, A.; Midttømme, K.; Brytan, P.; Krzonkalla, A.; Maćko, A.; et al. Borehole Optical Fibre Distributed Temperature Sensing vs. Manual Temperature Logging for Geothermal Condition Assessment: Results of the OptiSGE Project. Sensors 2024, 24, 7419. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Gelman, S.E.; Burns, E.R. Three-dimensional temperature maps of the Williston Basin, USA: Implications for deep hot sedimentary and enhanced geothermal resources. Geothermics 2025, 125, 103196. [Google Scholar] [CrossRef] [Scilit]
- Eltayieb, M.; Werthmüller, D.; Drijkoningen, G.; Slob, E. Feasibility Study of Controlled-Source Electromagnetic Method for Monitoring Low-Enthalpy Geothermal Reservoirs. Appl. Sci. 2023, 13, 9399. [Google Scholar] [CrossRef] [Scilit]
- Bilgili, M. Prediction of soil temperature using regression and artificial neural network models. Meteorol. Atmos. Phys. 2010, 110, 59–70. [Google Scholar] [CrossRef] [Scilit]
- Ozturk, M.; Salman, O.; Koc, M. Artificial neural network model for estimating the soil temperature. Can. J. Soil Sci. 2011, 91, 551–562. [Google Scholar] [CrossRef] [Scilit]
- King, M.; Kim, B.-J.; Yune, C.-Y. Prediction model of undisturbed ground temperature using artificial neural network (ANN) and multiple regressions approach. Geothermics 2024, 119, 102945. [Google Scholar] [CrossRef] [Scilit]
- Asadzadeh, F.; Emami, S.; Elbeltagi, A.; Akiner, M.E.; Rezaverdinejad, V.; Taran, F.; Salem, A. Investigating the impact of meteorological parameters on daily soil temperature changes using machine learning models. Sci. Rep. 2025, 15, 19988. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Liu, Y.; Ran, Y.; Li, X.; Che, T.; Wu, T. Multisite evaluation of physics-informed deep learning for permafrost prediction in the Qinghai-Tibet Plateau. Cold Reg. Sci. Technol. 2023, 216, 104009. [Google Scholar] [CrossRef] [Scilit]
- Farhangmehr, V.; Imanian, H.; Mohammadian, A.; Cobo, J.H.; Shirkhani, H.; Payeur, P. A spatiotemporal CNN-LSTM deep learning model for predicting soil temperature in diverse large-scale regional climates. Sci. Total Environ. 2025, 968, 178901. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Dashtgoli, D.S.; Giustiniani, M.; Busetti, M.; Cherubini, C.; Alessandrini, G.; Narsilio, G.A. Artificial Intelligence in Deep Geothermal Energy: Trends, Insights, and Future Perspectives. Renew. Energy Focus 2026, 56, 100781. [Google Scholar] [CrossRef] [Scilit]
- Ma, X.; Zhang, Q.J.; Yin, W.B.; Chen, Q.W.; Jiang, Y.X. Current research on machine learning-based methods for underground temperature prediction. Comput. Tech. Geophys. Geochem. Explor. 2026, 48, 67–77. (In Chinese) [Google Scholar]
- Kirschstein, X.; Ohagen, M.; Reber, J.; Vardon, P.J.; Bishara, N. Regeneration of shallow borehole heat exchanger fields: A literature review. Energy Build. 2024, 317, 114381. [Google Scholar] [CrossRef] [Scilit]
- Saleem, A.; Ambreen, T.; Ugalde-Loo, C.E. Energy storage-integrated ground-source heat pumps for heating and cooling applications: A systematic review. J. Energy Storage 2024, 102, 114097. [Google Scholar] [CrossRef] [Scilit]
- Deepa, V.A.; Beena, T.L.A. Enhancing data imputation in complex datasets using Lagrange polynomial interpolation and hot-deck fusion. Sci. Temper 2025, 16, 3727–3735. [Google Scholar] [CrossRef] [Scilit]
- Carnicer, J.M.; Khiar, Y. Central orderings for the Newton interpolation formula. BIT Numer. Math. 2019, 59, 371–386. [Google Scholar] [CrossRef] [Scilit]
- Straker, D. Measuring Spread. Available online: http://www.syque.com/quality_tools/toolbook/Variation/measuring_spread.htm (accessed on 17 November 2021).
- Dovoedo, Y.H.; Chakraborti, S. Boxplot-Based Outlier Detection for the Location-Scale Family. Commun. Stat.-Simul. Comput. 2015, 44, 1492–1513. [Google Scholar] [CrossRef] [Scilit]
- Islam, M.J.; Ahmad, S.; Haque, F.; Reaz, M.B.I.; Bhuiyan, M.A.S.; Islam, M.R. Application of Min-Max Normalization on Subject-Invariant EMG Pattern Recognition. IEEE Trans. Instrum. Meas. 2022, 71, 2521612. [Google Scholar] [CrossRef] [Scilit]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Scilit]
- Shmuel, A.; Glickman, O.; Lazebnik, T. A comprehensive benchmark of machine and deep learning models on structured data for regression and classification. Neurocomputing 2025, 655, 131337. [Google Scholar] [CrossRef] [Scilit]
- Sahoo, B.B.; Jha, R.; Singh, A.; Kumar, D. Application of Support Vector Regression for Modeling Low Flow Time Series. KSCE J. Civ. Eng. 2019, 23, 923–934. [Google Scholar] [CrossRef] [Scilit]
- Parmezan, A.R.S.; Souza, V.M.A.; Batista, G.E.A.P.A. Evaluation of statistical and machine learning models for time series prediction: Identifying the state-of-the-art and the best conditions for the use of each model. Inf. Sci. 2019, 484, 302–337. [Google Scholar] [CrossRef] [Scilit]
- Attri, S.D.; Jiang, M.; Tinjum, J.M.; Fratta, D.; Aydin, O. Predictive analytics and statistical time series imputation of subsurface temperatures for a campus-scale geothermal exchange field. Geothermics 2026, 134, 103528. [Google Scholar] [CrossRef] [Scilit]
- Aksoy, M.M.; Mowla, N.; Bilgili, M.; Pinar, E.; Durhasan, T.; Asadi, D. Forecasting near-surface air temperature via SARIMA and LSTM: A regional time-series study. J. Atmos. Sol.-Terr. Phys. 2025, 275, 106604. [Google Scholar] [CrossRef] [Scilit]
- Chang, J.; Lu, Y.; Xu, Q.; Zhang, H. Comparative Study of ARIMAX and BP Neural Network Models in the Prediction of Spodoptera frugiperda Occurrence. In Proceedings of the 2023 IEEE 7th Information Technology and Mechatronics Engineering Conference (ITOEC), Chongqing, China, 15–17 September 2023. [Google Scholar]
- Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016. [Google Scholar]
- Duan, H.-S.; Meng, X.; Tang, J.; Qiao, J.-F. Time-series prediction using a regularized self-organizing long short-term memory neural network. Appl. Soft Comput. 2023, 145, 110553. [Google Scholar] [CrossRef] [Scilit]
- Sharma, G.; Anand, V.; Gupta, S. Harnessing the Strength of ResNet50 to Improve the Ocular Disease Recognition. In Proceedings of the 2023 World Conference on Communication & Computing (WCONF), Raipur, India, 14–16 July 2023. [Google Scholar]
- Vapnik, V. The Nature of Statistical Learning Theory; Springer: New York, NY, USA, 1995. [Google Scholar]
- Ren, K.; Zou, G.; Zhang, S.; Peng, S.; Gong, F.; Liu, Y. Fault identification and reliability evaluation using an SVM model based on 3-D seismic data volume. Geophys. J. Int. 2023, 234, 755–768. [Google Scholar] [CrossRef] [Scilit]
- Onyelowe, K.C.; Kamchoom, V.; Hanandeh, S.; Ebid, A.M.; Villagran, J.A.V.; Pérez, R.G.M.; Benavides, F.U.C.; Awoyera, P.; Avudaiappan, S. Impact of lightweight clay aggregate with slag and biomedical waste ash on self-compacting concrete using machine learning approach. Sci. Rep. 2025, 15, 13983. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Xue, J.; Shen, B. A novel swarm intelligence optimization approach: Sparrow search algorithm. Syst. Sci. Control Eng. 2020, 8, 22–34. [Google Scholar] [CrossRef] [Scilit]
- Chigeto, A.D. Relative responses of trade in goods and services to currency devaluation: Evidence from Ethiopia. Heliyon 2024, 10, e30223. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Yaman, A.; Cengiz, M.A. Comparative evaluation of score criteria for dynamic Bayesian Network structure learning. PLoS ONE 2025, 20, e0336250. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.

















