Groundwater is essential for water resources but faces over-extraction and supply-demand imbalance. Precisely comprehending alterations in groundwater is crucial for sustainable development. Groundwater levels demonstrate a delayed reaction to meteorological circumstances, frequently neglected in current research, diminishing predictive accuracy. This study investigates the lag effect of precipitation and evapotranspiration on groundwater forecasting in Hebei Province, China. We performed a lag analysis utilizing long-term data to ascertain correlations between groundwater levels and climatic variables. Two groundwater prediction models using the random forest algorithm were developed, one incorporating the lag effect and the other excluding it. The Shapley Additive exPlanations (SHAP) method assessed the significance of each element and its influence on model variations. Research reveals a notable lag in groundwater response: shallow groundwater reacts to precipitation after 4.55 months and to evapotranspiration after 9.21 months; deep groundwater responds after 5.91 and 9.63 months, respectively. The inclusion of the lag effect resulted in higher accuracy of the model, with an average reduction of 35.7% in MAE and 18.20% in RMSE. The improved model more accurately captured the influence of meteorological factors on groundwater levels, potentially providing more scientific decision support for the rational allocation and sustainable use of water resources.

  • A significant lag effect of precipitation and evapotranspiration on groundwater levels has been found in Hebei, China.

  • Considering the lag effect of groundwater response to meteorological factors can enhance the prediction accuracy.

  • The contribution of variables on groundwater level is quantified by SHAP and found affected by the lag effect.

Water shortage has emerged as a worldwide issue in recent decades, mostly caused by the depletion of freshwater resources resulting from the combined impact of human activity and climate change. Groundwater is a crucial freshwater resource that plays a vital role in promoting sustainable societal development and preserving the ecological equilibrium of the environment (Sun et al. 2023). The North China Plain, which is a significant region for grain and cotton production in China, possesses a mere 1.7% of the country's water resources. As a result, more than 70% of the extracted groundwater is utilized for agricultural irrigation (Zhang et al. 2013b; Wang et al. 2023b). Overexploitation of water resources beyond their sustainable limit leads to various issues, including the deterioration of ecosystems and the decline of biodiversity (Foster et al. 2004; Wang et al. 2023a). Hence, accurately forecasting the fluctuating patterns of groundwater is crucial for effectively managing and optimally utilizing groundwater resources (Zhang et al. 2019).

An essential focus and problem in groundwater predictions have always been to scientifically comprehend the influence of different driving variables on groundwater levels (Eshtawi et al. 2015). However, the factors that affect the groundwater system are intricate. The climate is the main factor responsible for fluctuations in groundwater levels, providing the main source of recharge to groundwater and affecting the processes of groundwater (Wang et al. 2018; Di Nunno & Granata 2020). As a result, groundwater changes display cyclical and seasonal patterns that resemble the climate (Yan et al. 2018). Zhang et al. (2013a) stated that alterations in rainfall play a significant role in causing abnormalities in the flow of groundwater. Lubczynski (2011) observed that evapotranspiration (ET) decreases the overall recharge of groundwater, limiting the flow of groundwater and the replenishment of groundwater resources. Nazarieh et al. (2018) determined that the disparity between the infiltration caused by precipitation (P) and irrigation, and the ET, is equivalent to the quantity of water that seeps into the lower layers of soil. These findings suggest that climate change has a significant effect on the replenishment of groundwater, mainly through changes in P and ET.

Integrating influence factors into the prediction model has been a prominent topic in previous studies, aiming to accurately understand the fluctuating patterns of groundwater (Zhang et al. 2017). In the field of hydrometeorological science, machine learning models have been widely applied in related statistics and predictions (Podgorski & Berg 2020), groundwater potential prediction (Naghibi et al. 2016), and groundwater storage prediction (Chen et al. 2019). Azizi et al. (2024) employed artificial neural networks to forecast future groundwater levels in the Sahneh Plain by analyzing temperature and P, thereby uncovering patterns of change. Di Nunno & Granata (2020) assessed the impact of rainfall and ET on the forecast of groundwater levels and validated the dependability of the NARX-BR network. Gong et al. (2016) compared the accuracy of the model by analyzing various hydrologic data, including P, temperature, and lake level, using different combinations. These studies largely rely on factors that change in real time with groundwater levels, with little consideration given to the delayed response of groundwater to these factors.

While P and ET are commonly used by scholars to forecast groundwater levels, their effects on infiltration can cause a significant delay in groundwater recharge (De Vries & Simmers 2002). Previous research has indeed verified the existence of a substantial delay in the relationship between groundwater levels and meteorological (MET) factors (Wang 2011; Qi et al. 2015; Niu et al. 2023). Furthermore, this lag effect demonstrates spatial diversity. However, most current studies on predicting groundwater levels do not consider the delayed impact of climate influences on groundwater levels, which might lead to decreased accuracy.

This study aims to improve the accuracy of groundwater level predictions by incorporating the lag effect of climate on groundwater levels and utilizing the random forest (RF) model and the SHapley Additive exPlanation (SHAP) technique. Due to the cyclical variation of groundwater levels throughout the year in Hebei Province, which is largely influenced by seasonal irrigation (Tsuchihara et al. 2023), we treat the month as a separate variable to capture this trend. We incorporate the delayed impact of climatic elements on groundwater levels by utilizing P, ET, and time as independent variables, while the groundwater level serves as the dependent variable. We create a forecast model using the RF model, a well-utilized method in hydrological research (Mital et al. 2020; Diniz et al. 2021; Rao et al. 2022), to assess the importance of incorporating the lag effect into groundwater estimates. Ultimately, we employ the SHAP technique to assess the significance and efficacy of each factor in relation to changes in groundwater levels, both before and after considering the lag effect.

Study area

Hebei Province is situated in the northern region of the North China Plain (113°27′N–119°50′N, 36°05′E–42°40′E), covering a total area of 188,800 km2. It features a temperate continental monsoon climate, with an average annual P of 484.5 mm and ET of 1,801.3 mm (Liu et al. 2007). The research area has a topography characterized by elevated terrain in the northwest and lower terrain in the southeast, as shown in Figure 1, with a multitude of lakes and rivers. Despite the advantages brought by the South-to-North Water Diversion Project, more than 70% of the fertile land in Hebei Province still depends on overextracted groundwater for irrigation because of the limited availability of surface water resources (Guan et al. 2023). In 2021, the amount of water used for agriculture in Hebei was 9.714 billion cubic meters, accounting for 53.4% of the overall water consumption. The province has many zones where groundwater extraction exceeds sustainable levels due to excessive extraction. Prior to 2014, these zones encompassed more than 91% of the flat region, with areas of groundwater depletion spanning 5,233 km² (Guan et al. 2023).
Figure 1

Location and land cover of the study area.

Figure 1

Location and land cover of the study area.

Close modal

Data

Measured groundwater level data

Over the past few years, a significant number of groundwater observation wells have been set up in the research region. These wells have been classified into two categories: shallow and deep groundwater sites, depending on their average water level in relation to the first impermeable layer. Specifically, the groundwater levels were measured relative to the sea level. The groundwater level data collected for this study covers the time period from 2018 to 2022, with measurements taken every 4 h. Following a quality assessment, stations displaying extended aberrant records were excluded, while those with small irregularities were rectified. A total of 972 shallow and 885 deep groundwater sites were ultimately chosen in Hebei Province. Subsequently, the monthly mean groundwater level was computed for each location to acquire the monthly groundwater level data of Hebei Province.

P data

The P data are obtained from the Integrated Surface Hourly (ISH) dataset provided by the National Oceanic and Atmospheric Administration (NOAA). This study utilized daily P data from all stations across China and employed the inverse distance weighting method to interpolate nationwide daily P raster data. The data pertaining to the study area in Hebei Province were obtained by applying a mask, with a spatial resolution of 1 km.

Evapotranspiration data

The ERA5 reanalysis package, offered by the European Centre for Medium-Range Meteorological Forecasts (ECMWF), encompasses a comprehensive dataset of global climate and MET information spanning 80 years (Hersbach et al. 2023). This study aggregated data at four-hour intervals and retrieved data using a mask specific to Hebei Province. Subsequently, the data underwent spatial downsampling using the cubic spline interpolation technique, yielding monthly ET data for Hebei Province spanning from 2018 to 2022, with a geographical resolution of 1 km.

Lag cross-correlation analysis

The variation in climatic conditions over time influences groundwater recharge, flow, and consumption, which, in turn, affects the dynamic changes in groundwater levels. Nevertheless, the diverse lithology and climatic features of groundwater systems result in notable disparities in the delayed reaction of the groundwater level to MET influences (Wang 2011). Thus, this study utilizes time-series MET data, including P and ET, as explanatory factors. The cross-correlation function is used to determine the lag terms for each pair of time series that result in the highest cross-correlation coefficients (Niu et al. 2023). The cross-correlation coefficient can be mathematically represented as follows:
(1)
In this formula, the sample covariance and the standard deviations , can be expressed as follows:
(2)
(3)
(4)
Its mean value is:
(5)
(6)

In this formula, n is the number of samples of and . k represents the corresponding lag time, with months. When , it indicates no lag, meaning that the groundwater level and MET data are synchronized. The cross-correlation coefficient ranges from −1 to 1, with values closer to an absolute value of 1 suggesting a higher degree of correlation. For this investigation, sites that have a lag cross-correlation coefficient higher than 0.5 are regarded as having notable lag effects (Niu et al. 2023).

To evaluate the impact of lag threshold selection on the determination of the proportion of significant lag sites, a sensitivity analysis experiment was conducted in this study. The lag threshold was set to range from 0.1 to 0.9, with an increment of 0.1. For each lag threshold, we calculated the proportions of sites where the absolute values of lagged correlation coefficients between rainfall and groundwater levels, as well as evapotranspiration and groundwater levels, exceeded the specified threshold. The results are presented in Figure 2. The proportion was calculated using the following formula:
where P represents the proportion of significant lag sites, is the number of sites meeting the lag threshold condition, and is the total number of sites.
Figure 2

Sensitivity analysis of significant lag ratios under different lag thresholds. At the threshold of 0.5, the results become stable and less sensitive to further changes.

Figure 2

Sensitivity analysis of significant lag ratios under different lag thresholds. At the threshold of 0.5, the results become stable and less sensitive to further changes.

Close modal
Figure 3

Technical roadmap. ① Lag analysis: significant lag points (Lag Correlation Coefficient (LCC) > 0.5) are identified by calculating the LCC, and the Lag Duration (LD) is determined. ② Input data: includes spatiotemporal data such as P, evaporation, and month. ③ Prediction model: the RF model is trained using 80% of the data for groundwater level prediction, with the remaining 20% used for validation. ④ Result analysis: SHAP values are applied to interpret the prediction results, illustrating the spatial distribution of groundwater level predictions and the key driving factors.

Figure 3

Technical roadmap. ① Lag analysis: significant lag points (Lag Correlation Coefficient (LCC) > 0.5) are identified by calculating the LCC, and the Lag Duration (LD) is determined. ② Input data: includes spatiotemporal data such as P, evaporation, and month. ③ Prediction model: the RF model is trained using 80% of the data for groundwater level prediction, with the remaining 20% used for validation. ④ Result analysis: SHAP values are applied to interpret the prediction results, illustrating the spatial distribution of groundwater level predictions and the key driving factors.

Close modal

As the lag threshold increased from 0.1 to 0.5, the proportion of significant lag sites decreased significantly. For rainfall, the proportion dropped from 98.1 to 15.1%, while for evapotranspiration, it decreased from 86.3 to 19.1%. Under low threshold conditions, although a large amount of lag information is retained, the analysis results lack distinction and exhibit poor robustness. When the lag threshold approaches 0.5, the two lag ratio curves tend to level off, indicating that the proportion of significant lag sites becomes less sensitive to threshold changes, resulting in more stable outcomes.

RF model

The RF model has been extensively utilized in hydrometeorological science for statistical analysis and forecasting purposes, including groundwater potential prediction and storage prediction. The algorithm, proposed by Breiman (2001), is an ensemble learning technique specifically developed to address classification and regression problems. It combines predictions from multiple decision tree models to improve accuracy and consistency through methods such as voting or averaging. By using different subsets of data, the process generates a range of models, and their predictions are combined to provide the final output (Cao et al. 2023). RF is effective at handling high-dimensional data. It introduces randomness in the selection of both samples and features and can also assess the importance of different variables. These features provide RF with a distinctive advantage in its algorithm (Adhikary & Dash 2017).

Choosing the appropriate input variables is essential for optimizing the performance of a machine learning model. This study utilizes P, ET, and monthly groundwater level data as simulation factors to construct a model that predicts groundwater levels. The impact of vegetation and crop cultivation on groundwater levels is influenced by the months of the year, as groundwater levels exhibit cyclical variations at different times (Xu et al. 2005). This study builds a RF model using Python's sklearn package (https://scikit-learn.org/). The model is trained using 80% of the input data, as illustrated in Figure 3, while the remaining 20% is used to validate the accuracy of the predictions. Prior to training, the input and target data undergo standardization by utilizing the maximum and lowest values of each kind. This process ensures that all variables in the model are equally important. The prediction model for groundwater level Y, given groundwater affecting factor X, is as follows:
(7)
where RF(X) represents the prediction made by the RF for the given input feature X, N is the number of decision trees in the RF ensemble, and Treei (X) represents the prediction made by the ith decision tree in the ensemble for the input feature X.

SHapley Additive exPlanation

SHAP is a comprehensive method for attributing features, which combines game theory and local explanations (Abba et al. 2023). Machine learning models can be integrated with it to attain significant predictions (Lundberg et al. 2018). The SHapley value of each input variable represents its individual impact on the output, measuring the connection between the input variables and the output, thus improving the accuracy of predictions (Yang & Chui 2021). The greater the absolute value of a SHAP value, the more significant the feature's impact on the model's prediction; a positive SHAP value indicates that the feature drives the prediction upward, whereas a negative SHAP value suggests that the feature exerts a downward influence on the prediction. The representation of SHAP is as follows:
(8)
where g (z) is the explanatory model, z represents a particular feature involved in the calculation, M is the number of input features, and is the SHAP value for each feature. For feature i, the SHapley value must be calculated for all possible feature combinations, including different orders, and then compute the weighted sum.

In this study, SHAP was used to interpret the importance and effects of factors in the groundwater level prediction model, thereby evaluating the role of groundwater response lags in water level prediction. The kernel SHAP explainer from the SHAP library in Python was employed to perform this analysis.

Model evaluation metrics

The assessment measures employed in this study are the coefficient of determination (R²), root mean squared error (RMSE), and mean absolute error (MAE). MAE and RMSE are metrics that quantify the range of measurement mistakes in the estimates. They provide a quantitative indicator of the error (Zhang et al. 2008). The model's accuracy increases as these numbers decrease. The R2 value represents the extent to which the independent variables explain the variation in the dependent variable, with a range of 0–1. A higher value of R² indicates a stronger fit of the model.
(9)
(10)
(11)
where is the actual observed value of the ith site and is the estimated or predicted value of the ith site. n is the number of sites participating in the validation.

Hysteresis analysis of the groundwater level response

Statistical results of response lag

The degree of the lag impact of P and ET on shallow and deep groundwater varies in different geographical locations. Figure 4 displays the frequency distribution of the lag correlation coefficients between the observed groundwater level data and the data for P and ET. In general, there is a positive relationship between groundwater levels and P and a negative relationship between groundwater levels and ET. The mean lag correlation coefficients between shallow groundwater and P and ET are 0.334 and −0.315, respectively. At 15.08 and 19.06% of the groundwater monitoring sites, significant lag effects are identified. The average lag correlation coefficients between P and deep groundwater are 0.432, while the coefficients between ET and deep groundwater are −0.428. At 36.59% of the sites, substantial lag effects are found for P, while at 35.62% of the sites, significant lag effects are observed for ET.
Figure 4

Histogram of groundwater lag correlation coefficients: (a) for the shallow layer and (b) for the deep layer. The dashed line represents an LCC absolute value of 0.5, which is the threshold for determining whether the lag is significant.

Figure 4

Histogram of groundwater lag correlation coefficients: (a) for the shallow layer and (b) for the deep layer. The dashed line represents an LCC absolute value of 0.5, which is the threshold for determining whether the lag is significant.

Close modal

Spatial distribution of response lag

Figure 5 depicts the spatial distribution of P and ET lag effects on groundwater levels. The sites with higher lag coefficients are primarily located in the impermeable surface regions of central and southern Hebei Province, which correspond to places where shallow groundwater is being excessively extracted. Human actions have a profound impact on these locations. Overabundant agricultural irrigation leads to the depletion of groundwater levels and a persistent fall in water levels. Urbanization impedes the process of rainwater seeping into the ground, causing a delay in the replenishment of P and intensifying the lag effects. Simultaneously, these impermeable surfaces lack abundant vegetation and have poor transpiration rates, resulting in a reduced movement of water and exacerbating the delay in ET's impact on groundwater levels.
Figure 5

Spatial distribution of groundwater lag effects.

Figure 5

Spatial distribution of groundwater lag effects.

Close modal

Shallow groundwater in the study area experiences an average delay of 4.55 months compared to P, as shown in Figure 5(a), and an average delay of 9.21 months compared to ET, as shown in Figure 5(c). Locations with extended latency periods are still concentrated in proximity to areas where excessive extraction occurs, where sites in the northern agricultural and grassland regions experience shorter latency periods. These areas generally exhibit high soil permeability and dense organic layers, facilitating the rapid absorption and storage of P. This enables water to swiftly enter into the groundwater layer. In addition, the presence of a large amount of vegetation enhances the permeability of the soil by means of its root system, which speeds up the processes of water penetration and ET. As a result, the time it takes for groundwater levels to respond to MET conditions is reduced.

Deep groundwater, being situated at greater depths in the geological layers and having a less direct link to surface water, exhibits a slower reaction to changes in P and ET compared to shallow systems as shown in Figure 5(e)–5(h). The majority of deep groundwater lag sites are located in the impermeable regions of southeastern Hebei, which coincide with places where deep groundwater is being excessively extracted. Excessive extraction reduces the levels of deep groundwater, lengthening the channels through which water flows and increasing the time it takes for water to seep into the earth. This intensifies the effects of P and ET. Human activities also modify hydrological conditions, diminishing the immediate reaction of groundwater. The replenishment of deep groundwater occurs, on average, 5.91 months after P and 9.63 months after ET. The sites with shorter ET lag times are primarily located in the grassland and woodland regions of northern Hebei. These places experience less human involvement and have more fractured rocks, which enable faster contact between groundwater and the surface.

Classifications of response lag

This study categorizes all sites into four groups based on their lag characteristics: MET lag (when both elements exhibit significant latency), dominant P lag, dominant ET lag, and sites with insignificant lag. These categories are illustrated in Figure 6.
Figure 6

Distribution of sites with different lag characteristics.

Figure 6

Distribution of sites with different lag characteristics.

Close modal

The sites experiencing substantial latency are primarily located in central and southern Hebei Province, as well as the northern mountainous forest regions (Figure 6). Human extraction activities have altered the hydrological processes in the shallow overexploited areas. This disruption of the normal management of groundwater systems has led to a slower infiltration process and more noticeable delays in response. Furthermore, forested areas possess dense soil and vegetation cover, which can retain water effectively in their root systems and soil layers. As a result, the impacts of P and ET are delayed in reaching the groundwater system, leading to noticeable lag effects.

P and ET lag sites are more extensively spread than MET lag sites, which are located primarily in the eastern and southeastern boundaries of Hebei. This could be attributed to the elevated levels of yearly P and ET in these areas. In order to assess the predictive accuracy of models that take into account lag effects, both real-time and lag parameters are utilized as independent variables for sites that experience substantial delays.

Groundwater level prediction and accuracy evaluation

Comparison of model accuracy before and after considering lag effects

This study uses RF to build two prediction models in order to assess the influence of lag effects on prediction accuracy. In the model that takes into account the delayed impacts of groundwater, the groundwater level is utilized as the dependent variable. The independent variables include the observation period (measured in months) and the P and ET that occurred before each measurement, corresponding to the lag durations at each location. The model, which does not take into account lag effects, utilizes synchronous temporal components of each site's groundwater level as explanatory variables. Both models utilize data from the time period of 2018–2021 as the training set and take the data at different locations for each month of 2022 as the validation set. After training the models with the optimal parameters, their performance is presented in Table 1 for both the validation and test set.

Table 1

Accuracy assessment of different prediction models

Model typeShallow groundwater
Deep groundwater
R2MAERMSER2MAERMSE
Validation RF model without lag Effects 0.990 0.732 1.345 0.982 1.253 2.043 
RF model with lag effects 0.990 0.701 1.311 0.982 1.240 2.026 
Test RF model without lag effects 0.951 2.332 4.783 0.930 6.031 8.197 
RF model with lag effects 0.983 1.521 3.470 0.966 3.825 7.467 
Model typeShallow groundwater
Deep groundwater
R2MAERMSER2MAERMSE
Validation RF model without lag Effects 0.990 0.732 1.345 0.982 1.253 2.043 
RF model with lag effects 0.990 0.701 1.311 0.982 1.240 2.026 
Test RF model without lag effects 0.951 2.332 4.783 0.930 6.031 8.197 
RF model with lag effects 0.983 1.521 3.470 0.966 3.825 7.467 

The RF model, which takes into account the lag effects of MET elements, demonstrates superior accuracy on the test set. A detailed percentage improvement comparison is provided in Table 2, which highlights that R² improves by 3.37% for shallow groundwater and 3.87% for deep groundwater. Meanwhile, MAE is reduced by 34.78 and 36.58%, respectively, and RMSE decreases by 27.45 and 8.91%, respectively.

Table 2

Percentage improvement of predictive metrics for the test set

Shallow groundwater improvement (%)Deep groundwater improvement (%)
R2 +3.37 +3.87 
MAE −34.78 −36.58 
RMSE −27.45 −8.91 
Shallow groundwater improvement (%)Deep groundwater improvement (%)
R2 +3.37 +3.87 
MAE −34.78 −36.58 
RMSE −27.45 −8.91 

The groundwater level forecast model, which took into account lag effects, demonstrated strong performance in 2022. The value of mean R² for the prediction of shallow groundwater is 0.983, while, for deep groundwater, it is 0.966. These values indicate a 3% enhancement compared to the model that did not consider lag effects. Figure 7 depicts the spatial arrangement of absolute errors in estimates of shallow groundwater for January 2022. The mean error across all sites is −1.61 m, while more than 70% of data points had an absolute error within 2.2 m. The majority of sites with inaccuracies above 5 m are located in the southwestern region of Hebei. In January 2022, the average discrepancy for deep groundwater measurements was 3.75 m, and 70% of the locations had a deviation of less than 5.5 m. The southern overextraction areas of Hebei had a higher concentration of major mistakes, which can be attributed to increased human activity that has made the groundwater system more complex and led to oscillations in water levels. These factors have resulted in a reduction in the accuracy of predictions.
Figure 7

Spatial distribution of absolute errors in predictions of (a) shallow groundwater and (b) deep groundwater. (c) The probability density of absolute errors. In the central and southern regions of Hebei Province, where groundwater levels are deeper, the absolute prediction errors are significantly larger.

Figure 7

Spatial distribution of absolute errors in predictions of (a) shallow groundwater and (b) deep groundwater. (c) The probability density of absolute errors. In the central and southern regions of Hebei Province, where groundwater levels are deeper, the absolute prediction errors are significantly larger.

Close modal
Figure 8 displays the box plots representing the improvement in accuracy after taking into account the lag effect. After accounting for lag effects, the values of R² of forecast accuracy increased by 0.23, 0.13, and 0.19 for sites affected by MET lag, P lag, and ET lag, respectively. The sites with enhanced precision are primarily situated in close proximity to places where excessive extraction has occurred. This suggests that taking into account, the time delay effects can provide a more precise representation of the intricate geological formations and the penetration processes of groundwater in these regions, thereby improving the accuracy of model predictions.
Figure 8

Improvement of accuracy after considering lag effects: (a) increase of R2, (b) decrease of MAE, and (c) decrease of RMSE.

Figure 8

Improvement of accuracy after considering lag effects: (a) increase of R2, (b) decrease of MAE, and (c) decrease of RMSE.

Close modal

In contrast, sites that show weak improvement in accuracy are primarily found in the forested mountainous regions of Hebei Province. The vegetation coverage in these places is extensive, and variations in groundwater level are mostly driven by direct natural P, resulting in less substantial delayed effects. Hence, incorporating lag effects into the model does not substantially enhance accuracy. In addition, the hydrological conditions in mountainous forest areas remain steady due to low human activity, resulting in predictable fluctuations in groundwater levels. This high prediction accuracy is achieved even without considering lag effects.

Time-series comparison before and after considering lag effects

Several representative sites are chosen to compare the observed groundwater levels with the forecasts generated by the two models. As depicted in Figure 9, the forecasts that do not take into account lag effects have a comparable pattern to the actual observations. However, there is a greater absolute inaccuracy in the monthly water levels, resulting in an overall underestimation. On the other hand, the forecasts for both deep and shallow locations, taking into account the delay effects, present a better agreement to the actual values, with data points uniformly spread around the 1:1 line. This suggests that the model that takes into account lag variables is more accurate in predicting outcomes because it captures the cumulative impacts and time delays of influencing factors. The model that does not consider lag may fail to account for these intricate temporal linkages, resulting in higher prediction errors.
Figure 9

Comparison of groundwater in a monthly scale. Images (a) and (c) are averaged time series at shallow sites and deep sites, respectively. Images (b) and (d) are scatter plots of averaged predictions at shallow sites and deep sites, respectively.

Figure 9

Comparison of groundwater in a monthly scale. Images (a) and (c) are averaged time series at shallow sites and deep sites, respectively. Images (b) and (d) are scatter plots of averaged predictions at shallow sites and deep sites, respectively.

Close modal

Spatial prediction comparison before and after considering lag effects

As illustrated in Figure 10, when considering July 2022 as a case study, the spatial distribution of forecast results is more evenly spread out when lag effects are not taken into account. However, they fail to consider the local variations in space produced by human activities and geological variables, such as locations where excessive extraction occurs at different depths and regions with localized low groundwater levels. On the other hand, when taking into account the lag effects, the predicted findings show a higher level of accuracy in terms of both the spatial distribution and the values of the groundwater level compared to the measured data. They also demonstrate the persistent diverse features in specific regions, such as the fragmented areas where shallow groundwater is excessively extracted in the central plains. This illustrates that lag effects can accurately capture the influence of intricate environmental characteristics on groundwater levels.
Figure 10

Spatial patterns of groundwater level from measured data and predicted models in the plain area (July 2022). Images (a) and (d) are measured data for shallow and deep groundwater, respectively. Images (b) and (e) are predicted data without lag effect for shallow and deep groundwater, respectively. Images (c) and (f) are predicted data with lag effect for shallow and deep groundwater, respectively.

Figure 10

Spatial patterns of groundwater level from measured data and predicted models in the plain area (July 2022). Images (a) and (d) are measured data for shallow and deep groundwater, respectively. Images (b) and (e) are predicted data without lag effect for shallow and deep groundwater, respectively. Images (c) and (f) are predicted data with lag effect for shallow and deep groundwater, respectively.

Close modal

Model interpretation based on the SHAP method

Factor feature importance assessment

This study conducts a comparison of the feature importance of different parameters on groundwater, before and after taking into account lag effects. The comparison is based on two models that are created in Section 4.2.1. The results of this comparison are illustrated in Figure 11. After accounting for lag effects, the significance of P and ET in the shallow groundwater model greatly increases, whereas time becomes the least influential element. This suggests that the model that takes into account the lag more precisely represents the delayed reaction of groundwater levels to MET conditions, accurately capturing the actual influence of P and ET on groundwater levels. When lag effects are considered, the role of the month as a precise time marker is diminished, and now it primarily reflects broad seasonal fluctuations in groundwater levels rather than capturing specific temporal dynamics. This shift highlights the importance of delayed responses across months, reducing the reliance on the month as a precise time-resolved variable.
Figure 11

SHAP factor weights in different groundwater models.

Figure 11

SHAP factor weights in different groundwater models.

Close modal

The significance of P and ET is more prominent for deep groundwater compared to shallow groundwater. Upon careful consideration of lag effects, it is evident that P exerts the greatest influence on groundwater levels. Deep groundwater is less impacted by human activities and possesses a more stable hydrogeological system, resulting in MET elements playing a more substantial role in influencing deep groundwater. ET primarily takes place in the soil surface and the vegetation layer. Deep groundwater, which is located at larger depths compared to shallow groundwater, is essentially unaffected by surface water supplies. Hence, ET exerts a diminished influence on deep groundwater. On the other hand, P is crucial for supplying water to deep groundwater, which significantly influences fluctuations in deep groundwater levels.

Based on the spatial distribution analysis, as depicted in Figure 12, the areas where groundwater levels are notably affected by time are primarily concentrated in the plains. These regions consist primarily of agricultural fields that have been significantly affected by human activity. As a result of the cyclical nature of agricultural irrigation, groundwater levels display consistent fluctuations over time. In regions where shallow groundwater is excessively extracted, the SHAP values for P and ET are consistently higher. This suggests that variations in climatic parameters have a notably substantial influence on fluctuations in groundwater levels. Deep groundwater displays a comparable pattern. In the regions of Hengshui and Xingtai where excessive extraction occurs, MET conditions have a greater impact on the hydrological system compared to other areas. This might potentially worsen the instability and vulnerability of the hydrological system in these regions.
Figure 12

Distribution of SHAP values.

Figure 12

Distribution of SHAP values.

Close modal

Comparison of factor effects based on SHAP

Using sites in Xinji, Shijiazhuang, from the deep groundwater overextraction area as an example, a SHAP value summary plot is created to compare the effects of explanatory variables on groundwater levels before and after considering lag effects (Figure 13). The groundwater in this area is impacted by human activities and exhibits consistent seasonal fluctuations. The decrease in irrigation since autumn results in a consistent increase in groundwater levels by the end of the year. The model that does not consider lag effects demonstrates that the month has a notable and favorable influence on groundwater levels. Nevertheless, it is implausible and does not accurately reflect the underlying consequences that high ET values have a beneficial influence on groundwater levels.
Figure 13

Comparison of SHAP values (a) without lag and (b) with lag (Xinji, Shijiazhuang).

Figure 13

Comparison of SHAP values (a) without lag and (b) with lag (Xinji, Shijiazhuang).

Close modal

Upon taking lag effects into account, the temporal scatter points exhibit a uniform distribution around the center axis, suggesting a minimal influence on groundwater levels and diminished overall significance. This demonstrates that the model efficiently mitigates noise originating from the time variable and more accurately captures MET influences. The distribution of P points is predominantly located on the positive axis, signifying a favorable influence on groundwater levels. This is because higher amounts of P result in greater water infiltration and the subsequent recharge of groundwater. Similarly, the concentration of ET points in the negative zone suggests that higher ET leads to increased water loss and a reduction in groundwater levels. This is consistent with actual situations in the real world, indicating that taking into account lag effects offer a more precise explanation of how factors affect groundwater levels.

Utilizing P and ET data from Hebei Province from 2018 to 2022, this study thoroughly examines the delayed impacts of shallow and deep groundwater in relation to MET variables and their influence on the accuracy of model predictions. Initially, we evaluate these delayed impacts by the calculation of time-lag correlation coefficients. In this study, we employ a RF model and incorporate SHAP analysis to uncover the alterations in feature importance and the influence of different explanatory variables on fluctuations in groundwater levels. These changes are observed both before and after considering the impacts of lag. In order to enhance the precision of groundwater fluctuations modeling, we incorporate the influence of irrigation into the model, given that irrigation exhibits seasonal variations. Using P, ET, and time as input variables, the RF model is constructed to incorporate the lag effects of these elements, with groundwater level as the output variable. Our study utilizes SHAP analysis to assess the correlation and efficacy of each element in connection to changes in groundwater level, taking into account the lag effects.

The average lag time for shallow groundwater in response to P and ET is 4.55 and 9.21 months, respectively. P exhibits a positive correlation with groundwater levels, meaning that higher levels of P lead to an increase in groundwater levels. On the other hand, ET shows a negative correlation, indicating that higher levels of ET resulted in a decrease in groundwater levels. In the study area, sites with significant lag effects, accounting for 15.08% in shallow groundwater and 19.06% in deep groundwater, are mainly concentrated in regions experiencing intensive groundwater overextraction. These areas are characterized by slower recharge rates and longer response times, particularly for deep aquifers, which amplifies the lag effects. The sites are primarily located in the non-porous regions of central and southern Hebei, which coincide with areas where excessive extraction occurs. The lag reactions of deep groundwater are more evident due to their weaker links to surface water. The average lag periods for P and ET are 5.91 and 9.63 months, respectively. Significant lag effects were predominantly observed in the southeastern parts of the study area, where deep groundwater overextraction occurs, likely due to the slower recharge rates of deep aquifers. In contrast, lag effects were less pronounced in the northwestern agriculture and grassland regions, where shallow groundwater systems dominate and respond more quickly to external influences. These findings suggest that extraction depth may play a critical role in influencing lag effects, with broader implications for managing groundwater resources in overextracted regions and understanding lag effects in aquifer systems under similar conditions globally.

Two prediction models are built using RF before and after taking into account lag effects. For 2022, the average R² for predicting shallow groundwater, accounting for lag effects, is 0.983, whereas, for deep groundwater, it is 0.966, indicating a strong predictive capability. Upon comparison, it is shown that taking into account lag effects greatly enhanced the accuracy of predictions. Specifically, R² increased by 0.23, 0.13, and 0.19 average for the MET, P, and ET lag sites, respectively, compared to models that did not account for lag effects. The majority of accuracy enhancements are observed in overextracted locations in shallow groundwater, suggesting that a more thorough consideration of lag effects provides a more accurate representation of the intricate infiltration processes in these regions. By incorporating lag effects, projections based on time series and spatial distribution provide a more accurate representation of groundwater level changes in Hebei Province.

The SHAP results reveal that, in the shallow groundwater model, the significance of P and ET substantially increases when lag effects are taken into account, and conversely, the relevance of the month reduces. When it comes to deep groundwater, all elements are more significant compared to shallow groundwater, with P being the most relevant factor. Geographically, areas where groundwater levels are significantly affected by time are mainly found in flat areas, where MET factors play a more significant role in areas with excessive groundwater extraction. This makes groundwater levels more responsive to rainfall and ET, emphasizing the susceptibility of these systems to MET factors. Upon taking lag responses into account, the relationship between each factor and groundwater levels underwent a shift. By taking into account lag effects, the noise caused by the time variable in groundwater predictions is minimized, and the influence of MET elements is more properly represented. This approach provides a more realistic representation of the impact of each component on groundwater levels.

Due to the complexity of groundwater systems, which vary significantly across different regions, this study aims to provide a framework for lag effect analysis and groundwater level prediction. For groundwater in different regions influenced by various factors, the factors of lag effect are recommended to be chosen according to specific conditions, for example, soil type, geological structure, hydrological conditions, P patterns, and human activities. The framework in this study can be adapted to the specific geographical, climatic, and hydrological conditions, and here, we only presented a case study in a semi-arid area.

Moreover, sustainable groundwater management must not only focus on the immediate availability of water but also consider long-term trends and lag effects. Studies show that groundwater levels exhibit delayed responses to P and evapotranspiration, especially in overexploited areas. In regions such as the southern-central impermeable zones of Hebei Province, which suffer from groundwater overexploitation, measures are urgently needed to mitigate this issue. Incorporating lag effects into predictive models can provide more accurate analyses of groundwater dynamics, helping decision-makers identify potential risks associated with groundwater fluctuations and avoid resource depletion due to overextraction.

This work was supported by the Innovative Training Project for College Students (Grant No. 202310319128Y), the National Natural Science Foundation of China (Grant No. 42201020), and Hebei Province Science and Technology Program for Water Resources (Grant No. 2023-12).

Data cannot be made publicly available; readers should contact the corresponding author for details.

The authors declare there is no conflict.

Abba
S. I.
,
Yassin
M. A.
,
Mubarak
A. S.
,
Shah
S. M. H.
,
Usman
J.
,
Oudah
A. Y.
,
Naganna
S. R.
&
Aljundi
I. H.
(
2023
)
Drinking water resources suitability assessment based on pollution index of groundwater using improved explainable artificial intelligence
,
Sustainability
,
15
(
21
),
15655
.
https://doi.org/10.3390/su152115655
.
Adhikary
P. P.
&
Dash
C. J.
(
2017
)
Comparison of deterministic and stochastic methods to predict spatial variation of groundwater depth
,
Applied Water Science
,
7
(
1
),
339
348
.
https://doi.org/10.1007/s13201-014-0249-8
.
Azizi
E.
,
Yosefvand
F.
,
Yaghoubi
B.
,
Izadbakhsh
M. A.
&
Shabanlou
S.
(
2024
)
Prediction of groundwater level using GMDH artificial neural network based on climate change scenarios
,
Applied Water Science
,
14
(
4
),
77
.
https://doi.org/10.1007/s13201-024-02126-1
.
Breiman
L.
(
2001
)
Random forests
,
Machine Learning
,
45
(
1
),
5
32
.
https://doi.org/10.1023/A:1010933404324
.
Cao
Z.
,
Li
Y.
,
Hu
Y.
,
Lu
Y.
,
Wen
Q.
,
Yang
C.
,
Chen
Y.
&
Guo
J.
(
2023
)
Numerical rainfall forecast correction based on machine learning model
,
South-to-North Water Transfers and Water Science & Technology
,
21
(
5
),
1
10
.
Chen
L.
,
He
Q.
,
Liu
K.
,
Li
J.
&
Jing
C.
(
2019
)
Downscaling of GRACE-derived groundwater storage based on the random forest model
,
Remote Sensing
,
11
(
24
),
2979
.
https://doi.org/10.3390/rs11242979
.
De Vries
J. J.
&
Simmers
I.
(
2002
)
Groundwater recharge: an overview of processes and challenges
,
Hydrogeology Journal
,
10
(
1
),
5
17
.
https://doi.org/10.1007/s10040-001-0171-7
.
Diniz
É. S.
,
Lorenzon
A. S.
,
De Castro
N. L. M.
,
Marcatti
G. E.
,
Dos Santos
O. P.
,
De Deus Júnior
J. C.
,
Cavalcante
R. B. L.
,
Fernandes-Filho
E. I.
&
Hummeldo Amaral
C.
(
2021
)
Forecasting frost risk in forest plantations by the combination of spatial data and machine learning algorithms
,
Agricultural and Forest Meteorology
,
306
,
108450
.
https://doi.org/10.1016/j.agrformet.2021.108450
.
Di Nunno
F.
&
Granata
F.
(
2020
)
Groundwater level prediction in Apulia region (Southern Italy) using NARX neural network
,
Environmental Research
,
190
,
110062
.
https://doi.org/10.1016/j.envres.2020.110062
.
Eshtawi
T.
,
Evers
M.
&
Tischbein
B.
(
2015
)
Potential impacts of urban area expansion on groundwater level in the Gaza Strip: a spatial-temporal assessment
,
Arabian Journal of Geosciences
,
8
(
12
),
10565
10584
.
https://doi.org/10.1007/s12517-015-1971-8
.
Foster
S.
,
Garduno
H.
,
Evans
R.
,
Olson
D.
,
Tian
Y.
,
Zhang
W.
&
Han
Z.
(
2004
)
Quaternary aquifer of the North China Plain – assessing and achieving groundwater resource sustainability
,
Hydrogeology Journal
,
12
(
1
),
81
93
.
https://doi.org/10.1007/s10040-003-0300-6
.
Guan
B.
,
Sun
T.
,
Wang
J.
,
Yan
T.
&
Huang
K.
(
2023
)
Evaluation of the implementation effectiveness of agricultural irrigation water substitution projects in groundwater funnels area: a case study of Hebei Province
,
Water Resources and Hydropower Engineering
, 54 (10),
1
17
.
https://doi.org/10.13928/j.cnki.wrahe.2023.10.013
.
Hersbach
H.
,
Bell
B.
&
Berrisford
P.
(
2023
).
ERA5 hourly data on single levels from 1940 to present. Copernicus Climate Change Service (C3S) Climate Data Store (CDS). https://doi.org/10.24381/cds.adbb2d47
.
Liu
X.
,
Yu
C.
&
Ren
G.
(
2007
)
Variation of evaporation capacity and influence factors in Hebei Province between 1963–2003
,
Arid Land Geography
,
4
,
507
512
.
Lubczynski
M. W.
, (
2011
)
Groundwater evapotranspiration – underestimated role of tree transpiration and bare soil evaporation in groundwater balances of dry lands
. In:
Baba
A.
,
Tayfur
G.
,
Gündüz
O.
,
Howard
K. W. F.
,
Friedel
M. J.
&
Chambel
A.
(eds.)
Climate Change and its Effects on Water Resources
,
Netherlands
:
Springer
, pp.
183
190
.
https://doi.org/10.1007/978-94-007-1143-3_21
.
Lundberg
S. M.
,
Nair
B.
,
Vavilala
M. S.
,
Horibe
M.
,
Eisses
M. J.
,
Adams
T.
,
Liston
D. E.
,
Low
D. K.-W.
,
Newman
S.-F.
,
Kim
J.
&
Lee
S.-I.
(
2018
)
Explainable machine-learning predictions for the prevention of hypoxaemia during surgery
,
Nature Biomedical Engineering
,
2
(
10
),
749
760
.
https://doi.org/10.1038/s41551-018-0304-0
.
Mital
U.
,
Dwivedi
D.
,
Brown
J. B.
,
Faybishenko
B.
,
Painter
S. L.
&
Steefel
C. I.
(
2020
)
Sequential imputation of missing spatio-temporal precipitation data using random forests
,
Frontiers in Water
,
2
,
20
.
https://doi.org/10.3389/frwa.2020.00020
.
Naghibi
S. A.
,
Pourghasemi
H. R.
&
Dixon
B.
(
2016
)
GIS-based groundwater potential mapping using boosted regression tree, classification and regression tree, and random forest machine learning models in Iran
,
Environmental Monitoring and Assessment
,
188
(
1
),
44
.
https://doi.org/10.1007/s10661-015-5049-6
.
Nazarieh
F.
,
Ansari
H.
,
Ziaei
A. N.
,
Izady
A.
,
Davari
K.
&
Brunner
P.
(
2018
)
Spatial and temporal dynamics of deep percolation, lag time and recharge in an irrigated semi-arid region
,
Hydrogeology Journal
,
26
(
7
),
2507
2520
.
https://doi.org/10.1007/s10040-018-1789-z
.
Niu
X.
,
Lu
C.
,
Zhang
Y.
,
Zhang
Y.
,
Wu
C.
,
Saidy
E.
,
Liu
B.
&
Shu
L.
(
2023
)
Hysteresis response of groundwater depth on the influencing factors using an explainable learning model framework with Shapley values
,
Science of the Total Environment
,
904
,
166662
.
https://doi.org/10.1016/j.scitotenv.2023.166662
.
Podgorski
J.
&
Berg
M.
(
2020
)
Global threat of arsenic in groundwater
,
Science
,
368
(
6493
),
845
850
.
https://doi.org/10.1126/science.aba1510
.
Qi
X.
,
Li
W.
,
Yang
L.
,
Shang
H.
&
Yi
F.
(
2015
)
The lag analysis of groundwater level anomaliesto precipitation anomaly of Jinan Baiquan Springs Watershed
,
Earth and Environment
,
43
(
6
),
619
627
.
https://doi.org/10.14050/j.cnki.1672-9250.2015.06.004
.
Rao
P.
,
Wang
Y.
,
Liu
Y.
,
Wang
X.
,
Hou
Y.
,
Pan
S.
,
Wang
F.
&
Zhu
D.
(
2022
)
A comparison of multiple methods for mapping groundwater levels in the Mu Us Sandy Land, China
,
Journal of Hydrology: Regional Studies
,
43
,
101189
.
https://doi.org/10.1016/j.ejrh.2022.101189
.
Sun
J.
,
Hu
L.
,
Chen
F.
,
Sun
K.
,
Yu
L.
&
Liu
X.
(
2023
)
Downscaling simulation of groundwater storage in the Beijing, Tianjin, and Hebei regions of China based on GRACE data
,
Remote Sensing
,
15
(
6
),
1490
.
https://doi.org/10.3390/rs15061490
.
Tsuchihara
T.
,
Yoshimoto
S.
,
Shirahata
K.
,
Nakazato
H.
&
Ishida
S.
(
2023
)
Analysis of groundwater-level fluctuation and linear regression modeling for prediction of initial groundwater level during irrigation of rice paddies in the Nasunogahara alluvial fan, central Japan
,
Environmental Earth Sciences
,
82
(
20
),
473
.
https://doi.org/10.1007/s12665-023-11174-w
.
Wang
Z.
(
2011
)
Discussion on lag time of rainfall penetration recharge to groundwater
,
Hydrology
,
31
(
2
),
42
45
.
Wang
W.
,
Zhang
Z.
,
Duan
L.
,
Wang
Z.
,
Zhao
Y.
,
Zhang
Q.
,
Dai
M.
,
Liu
H.
,
Zheng
X.
&
Sun
Y.
(
2018
)
Response of the groundwater system in the Guanzhong Basin (central China) to climate change and human activities
,
Hydrogeology Journal
,
26
(
5
),
1429
1441
.
https://doi.org/10.1007/s10040-018-1757-7
.
Wang
B.
,
Wang
B.
,
Zhao
X.
,
Li
J.
&
Zhang
D.
(
2023a
)
Study and evaluation of dynamic carrying capacity of groundwater resources in Hebei Province from 2010 to 2017
,
Sustainability
,
15
(
5
),
4394
.
https://doi.org/10.3390/su15054394
.
Wang
D.
,
Zhang
G.
,
Feng
H.
&
Di
F.
(
2023b
)
Impacts of precipitation on groundwater preservation capacity of agricultural regions in north China – all databases
,
Bulletin of Soil and Water Conservation
,
43
(
4
),
276
282
.
Xu
Y.
,
Li
S.
,
Cai
Y.
&
Li
X.
(
2005
)
Land-use and groundwater use in Hebei Plain, China
,
Water and Environment JournaL
,
19
(
2
),
109
114
.
https://doi.org/10.1111/j.1747-6593.2005.tb00558.x
.
Yan
S.
,
Yu
S.
,
Wu
Y.
,
Pan
D.
&
Dong
J.
(
2018
)
Understanding groundwater table using a statistical model
,
Water Science and Engineering
,
11
(
1
),
1
7
.
https://doi.org/10.1016/j.wse.2018.03.003
.
Yang
Y.
&
Chui
T. F. M.
(
2021
)
Modeling and interpreting hydrological responses of sustainable urban drainage systems with explainable machine learning methods
,
Hydrology and Earth System Sciences
,
25
(
11
),
5839
5858
.
https://doi.org/10.5194/hess-25-5839-2021
.
Zhang
H.
,
Shi
X.
,
Yu
D.
,
Wang
H.
,
Zhao
Y.
,
Sun
W.
&
Huang
B.
(
2008
)
Spatial prediction of soil temperatures in China using different methods
,
Geographical Research
,
6
,
1299
1307
.
Zhang
G.
,
Fei
Y.
,
Liu
C.
&
Yan
M.
(
2013a
)
Relationship between decline of shallow groundwater levels and irrigated agriculture on Hufu Plain of North China – all databases
,
Advances in Water Science
,
24
(
2
),
228
234
.
Zhang
G.
,
Fei
Y.
,
Liu
C.
,
Yan
M.
&
Wang
J.
(
2013b
)
Adaptation between irrigation intensity and groundwater carrying capacity in North China Plain
,
Transactions of the Chinese Society of Agricultural Engineering
,
29
(
1
),
1
10
.
Zhang
N.
,
Xiao
C.
,
Liu
B.
&
Liang
X.
(
2017
)
Groundwater depth predictions by GSM, RBF, and ANFIS models: a comparative assessment
,
Arabian Journal of Geosciences
,
10
(
8
),
189
.
https://doi.org/10.1007/s12517-017-2954-8
.
Zhang
X.
,
Wang
Z.
,
Du
F.
,
Hu
Y.
&
Lu
L.
(
2019
)
Study on the influence of groundwater depth on soil water change in shallow buried area of Huaibei Plain
,
Water Saving Irrigation
,
9
,
6
9
.
This is an Open Access article distributed under the terms of the Creative Commons Attribution Licence (CC BY 4.0), which permits copying, adaptation and redistribution, provided the original work is properly cited (http://creativecommons.org/licenses/by/4.0/).