1. Introduction
Distinctive karst landforms originate from the dissolution of soluble carbonate rocks, covering approximately 15.2% of the global land surface. These regions harbor substantial groundwater reserves, serving as a vital freshwater source for nearly 678 million people [
1]. Beyond underpinning socio-economic growth, these water assets sustain unique ecosystems and ecological stability [
2]. Karst springs serve as natural outlets for pressurized groundwater, with their flow dynamics directly reflecting the aquifer’s recharge and discharge properties. However, the combined strain of climate shifts and escalating human activity has led to persistent water table declines, causing reduced spring discharges and even the risk of complete desiccation [
3]. Thus, precise forecasting of spring discharge is paramount for the sustainable management of groundwater resources.
Early research on karst hydrological processes primarily relied on physical mechanisms and numerical modeling techniques. For instance, physically based approaches, such as the double porosity media model, simulate spring discharge dynamics by explicitly characterizing aquifer structures [
4]. Similarly, reservoir-based conceptual models employ vertically connected storage units to simulate the nonlinear response of different subsurface zones [
5]. However, due to the strong spatial heterogeneity and complex coupled processes in karst systems, these traditional models are limited by parameter uncertainties and structural assumptions, making it difficult to accurately depict the system’s highly nonlinear dynamic behavior [
6].
With the rapid development of machine learning techniques, their data-driven nonlinear mapping presents a promising new approach for karst spring discharge prediction. Yousefi et al. [
7] applied the Random Forest algorithm to predict groundwater level changes in the karst aquifer of the Hutuo River alluvial fan in the North China Plain, addressing the limitations of traditional statistical models in this region. Nevertheless, standard machine learning methods typically rely on shallow architectures, which limit their ability to capture long-term dependencies and deep structural features within complex hydrological time series.
Deep learning models, through multi-layer nonlinear transformations, have significantly enhanced the modeling capability for nonlinear dynamic processes [
8]. Cheng et al. [
9] compared the performance of Multi-Layer Perceptrons, Support Vector Regression, and RNNs in predicting karst spring discharge in Northern China, demonstrating that RNNs exhibit superior performance in capturing temporal dependencies. However, standard RNNs suffer from vanishing or exploding gradients when processing long sequences, which limits their ability to learn long-range dependencies [
10,
11]. To mitigate this, Long Short-Term Memory networks (LSTMs) introduce gating mechanisms to regulate information flow, enabling the learning of dependency patterns over extended periods [
11]. Recently, advanced spatiotemporal architectures, including Spatiotemporal Graph Neural Networks (STGNNs), Hierarchical Graph Attention Networks (HGANs), and Transformer-based variants, have been developed to integrate spatial topological learning with temporal sequence modeling [
12,
13]. While these approaches offer significant improvements, they typically rely on homogeneous graph structures or static connection assumptions, which limit their ability to adequately capture the complex, multi-relational heterogeneity inherent in karst aquifer systems. While these recent models, such as Informer [
13] and STGNNs [
12], have advanced long-sequence forecasting, they often overlook the semantic differences between spatial neighbors, temporal proximity, and periodic cycles.
The formation of karst spring discharge is intrinsically a multi-source, multi-scale process driven by the interplay of short-term precipitation events, seasonal climate variations, and spatially heterogeneous recharge [
14,
15,
16,
17]. A theoretical and methodological challenge remains in effectively capturing these diverse dependencies simultaneously. Most existing frameworks fail to explicitly differentiate the distinct physical mechanisms of spatial connectivity, temporal proximity, and annual periodicity, often treating them as uniform inputs. Consequently, there is a lack of a unified framework capable of adaptively decoupling these heterogeneous relationships and dynamically weighing their contributions to the hydrological response.
To tackle this obstacle, we present a Heterogeneous Spatiotemporal Graph Attention Network, abbreviated as H-STGAT. Utilizing a multi-relational graph framework, this approach effectively delineates the intricate dependencies among spatial, temporal, and cyclical dimensions. The primary contributions of this work are outlined below:
- (1)
We propose a novel heterogeneous graph construction strategy that explicitly differentiates between spatial connectivity, temporal proximity, and annual periodicity. This structure overcomes the limitations of homogeneous graphs by preserving the distinct physical meaning of each hydrological dependency.
- (2)
We design a hierarchical attention mechanism to independently extract features within each relationship type while dynamically assigning importance weights across different relationships. This enables the model to automatically identify dominant driving factors under varying hydrological conditions.
- (3)
We demonstrate that by adaptively decoupling complex spatiotemporal correlations, the proposed H-STGAT significantly improves prediction accuracy for Shentou Spring, offering a robust solution for hydrological time series forecasting in spatially complex karst systems.
The rest of the paper is structured to first present the study area and data materials in
Section 2, followed by a detailed explanation of the H-STGAT framework in
Section 3. Subsequently,
Section 4 and
Section 5 display the experimental results and discuss the observations, respectively. Finally,
Section 6 summarizes the study’s conclusions.
3. Model Structure
This study proposes a Heterogeneous Spatiotemporal Graph Attention Network, designated as H-STGAT, which leverages graph-based structures to integrate hydrologic spatial relationships among observation sites, process-dependent hydrological connections, and periodic hydrological patterns. The model employs attention mechanisms to independently learn hydrological features under each relational context, and subsequently adaptively learns weighting criteria for feature fusion, thereby simulating dynamic precipitation-driven spring discharge.
3.1. Network Architecture
The overall architecture of the model is illustrated in
Figure 5. The model input (
Figure 5a) comprises recent observations and corresponding historical data from the same periods in previous years. The recent data, denoted as
, represents a sequence of precipitation and spring discharge values recorded monthly for the past
months from
observation stations. The historical data from the same period, denoted as
, comprises data from the same corresponding months over the past
years. The model updates its input data monthly, ensuring that each prediction is based on the latest continuous observation sequence.
To characterize the spatial hydrological relationships, temporal dependencies, and hydrological periodic patterns, the recent data
and the historical data
are integrated into a comprehensive graph
, where
is the set of nodes and
is the set of edges (
Figure 5b).
The node set is defined as , where represents an observation value from station at time step . This set incorporates both the recent observations and the historical same-period observations. Given stations, recent time steps, and years of historical data, the total number of nodes is .
The edge set comprises three distinct types of edges designed to capture the heterogeneous dependencies inherent in the hydrological system. The first type is spatial edges, , which establish complete connections among nodes from different stations at the same time step. Since subsurface connectivity in karst aquifers is complex and does not strictly decay with Euclidean distance, this fully connected strategy avoids imposing pre-defined geometric assumptions, allowing the model to autonomously learn spatial correlations directly from the data, resulting in a total of edges. The second type is temporal dependency edges, , which sequentially connect nodes from the same station across consecutive months, explicitly modeling the short-term continuity and local trends within the hydrological time series, totaling edges. The third type is cross-year same-month edges, , which connect nodes from the recent months to nodes from the same station and same month in each of the past years. These explicit connections create shortcuts to historical seasonal patterns, facilitating the capture of long-term periodic dependencies driven by the monsoon climate, amounting to edges.
To adaptively extract critical information from the spatial hydrological relationships, hydrological process dependencies, and periodic patterns, the model employs a two-layer graph attention mechanism. First, centered on a recent observation node, its neighboring nodes are categorized into three independent computational channels based on the three edge types: the spatial channel
, the temporal channel
, and the periodic channel
. Within each channel, a graph attention mechanism assigns weights to the neighboring nodes and aggregates their information, generating an intermediate representation for the central node specific to that relational perspective, denoted as
. Subsequently, the second attention layer evaluates the importance of these three channels and fuses the three intermediate representations via a weighted sum, achieving a comprehensively updated representation for the recent observation node. This process is repeated across multiple layers, enabling each recent observation node to progressively aggregate hydrological information from an expanded neighborhood. Finally, a complete features representation matrix
, encompassing all recent observation nodes, is formed (
Figure 5c).
Following this, a weighted average pooling operation is applied to the node representation matrix
to aggregate the global information from all recent observation nodes, producing a graph-level representation vector
. Finally, this vector is passed through a non-linear transformation layer to output the predicted spring discharge value for the next time step,
(
Figure 5d).
3.2. Dual-Level Graph Attention Computation
To adaptively extract features from the multidimensional hydrological relationships embedded in the heterogeneous graph, the core of the model employs a dual-level graph attention mechanism. This mechanism first operates at the node level, learning the importance of neighboring nodes within each independent computational channel. Subsequently, at the channel level, the contributions of the different hydrological relationships to the prediction task are calculated, obtaining a comprehensive feature representation.
In the node-level graph attention computation, we employ the attention mechanism from Graph Attention Networks (GAT) [
21] to calculate the importance of neighboring nodes. For a central recent observation node
, the model calculates attention coefficients
between node
and its neighbors
within each computational channel
(where
) to achieve weighted aggregation. The coefficient
is computed as follows:
where
is the
-dimensional input feature vector of node
.
is a channel-specific linear transformation matrix that projects the node features into a
-dimensional space.
is the trainable attention parameter vector for channel
,
denotes the vector concatenation operation, and ReLU is the non-linear activation function. Based on these computed attention coefficients, the model performs a weighted sum of the neighbor nodes’ features, followed by the ReLU activation function
, to generate the intermediate representation
for node
under channel
.
is given as
After this process is completed for all channels, each central node will possess a set of intermediate representations that encapsulate information from specific hydrological relationships.
Expanding on this, the channel-level attention module is designed to quantify the contribution of various feature channels. The model learns a weight
for each channel to dynamically adjust the contribution of each hydrological relationship in the final node representation. This weight is calculated using
where
is the set of recent observation nodes, while
are learnable parameters shared across all channels. Finally, the complete representation vector
for each recent observation node is obtained by the weighted sum of its intermediate representations across all channels, using the channel weights
.
is given as
This dual-level attention mechanism enables the model to dynamically adjust based on the intrinsic patterns in the data, whether it should rely more on spatial dependencies between stations, temporal dependencies within the observation sequence, or cross-year periodic dependencies for the current prediction step.
3.3. Graph Representation Aggregation and Spring Discharge Prediction
After obtaining the final representation vector
for each recent observation node, it is necessary to aggregate these local features into a global representation vector
that captures the current state of the entire hydrological system. A weighted average pooling strategy is adopted. Specifically, the graph-level representation
is computed by taking a weighted average of the node representation vectors in the matrix
.
is calculated as
where
is a learnable weight assigned to each node
.
Finally, to accurately capture the complex nonlinear relationship between the graph-level representation and the prediction target, a Multilayer Perceptron (MLP) is employed to nonlinearly map
to the predicted spring discharge at the next time step
, which is calculated as
where
and
are the weight matrix and bias vector of the hidden layer, respectively, and
is the hidden layer dimension.
and
are the weight matrix and bias parameter of the output layer, respectively.
3.4. Evaluation Metrics
To evaluate the predictive accuracy of the model, this study employs four performance metrics to quantify the agreement between observed and predicted data. These are the Root Mean Square Error (RMSE) [
22], Mean Absolute Error (MAE) [
22], Mean Absolute Percentage Error (MAPE) [
23], and the Nash–Sutcliffe Efficiency (NSE) [
24]. They are defined as follows:
In the equations above, represents the observed spring discharge value, is the mean of the observed discharges, denotes the predicted value, and is the total number of observations.
The numerical value of NSE falls within the interval and serves to assess the goodness-of-fit between predicted and observed values. An NSE value closer to 1 indicates better model performance. RMSE measures the root mean square deviation between predicted and observed values, indicating their dispersion. MAE represents the mean absolute error. Unlike RMSE, which squares the errors, MAE uses absolute values, thereby assigning equal weight to errors of different magnitudes and making it a more robust metric. MAPE quantifies the mean absolute percentage error between predictions and observations.
4. Experiment
4.1. Experimental Setup
The dataset employed in this work comprises monthly records of precipitation and spring discharge extending from January 1958 through December 2020. To facilitate model development, the data were chronologically partitioned into three subsets: the period from 1958 to 1996 was designated as the training set, the interval from 1997 to 2008 was utilized for validation, and the observations from 2009 to 2020 were reserved for the test set.
The H-STGAT model was trained for 300 epochs using the Adam optimizer with an initial learning rate of 0.001. Training configurations included a Dropout rate of 0.2 and
regularization (
). Other hyperparameter settings and architectural configurations are specified in
Table 3.
To quantify the potential variability in model outputs, an ensemble of 10 independent experimental runs was conducted using different random seeds for initialization. The final results are reported as the mean predictive values accompanied by a 95% confidence interval, which defines the estimated range of uncertainty for the discharge simulations. This probabilistic output provides a quantitative measure of the model’s prediction reliability for water resource management applications.
4.2. Effectiveness of Single-Step Spring Discharge Prediction
Figure 6 depicts the loss trajectories for both the training and validation phases. Initially, the two curves demonstrate a rapid and simultaneous decline, eventually reaching a steady state. Throughout the training duration, the gap between them remains negligible. This pattern of convergence serves as evidence of the model’s robustness and highlights the success of the applied regularization techniques in averting overfitting.
The trained model was employed to predict spring discharge for the ensuing month. To ensure statistical credibility, ten independent experiments were conducted with different random initializations.
Table 4 presents the resulting performance metrics, and
Figure 7 visually compares the observed values with the single-step predictions. On the testing set, the model achieved a peak NSE of 0.7695 and an RMSE of 0.2261 m
3/s. The 95% confidence interval is represented by the shaded area in
Figure 7, confirming that the reported performance is a stable and reliable measure of the model’s predictive capability.
Performance differs between training and test sets due to distributional shifts in the long-term hydrological series: average spring discharge decreased from 6.92 m3/s (1958–1996) to 4.38 m3/s (2009–2020). The model maintained an NSE above 0.76 despite this non-stationarity, demonstrating its capacity to capture fundamental hydrological mechanisms.
Figure 8 illustrates the scatter plots contrasting the observed versus predicted spring discharge across the training, validation, and testing stages. The model yielded
scores of 0.97, 0.78, and 0.77 for the training, validation, and test datasets, respectively. Visually, the plots demonstrate that the majority of data points are tightly clustered along the 1:1 diagonal, indicating a strong alignment between the model predictions and actual measurements. Furthermore, the pink bands represent the 95% confidence intervals, defining the likely range of predictive variability. The narrowness of these intervals underscores the reliability of the forecasting results. In summary, the combination of high
values and the dense concentration of scatter points corroborates the efficacy and robustness of the H-STGAT model for spring discharge prediction.
4.3. Effectiveness of Multi-Step Spring Discharge Prediction
To evaluate the model’s long-term forecasting capability, we performed multi-step predictions for spring discharge up to six months ahead. As shown in
Figure 9, the model’s performance (NSE, RMSE, MAE, MAPE) across these forecasting horizons is demonstrated on the test dataset.
Figure 9 displays the variations in the model’s predictive performance for spring discharge across forecast horizons ranging from 1 to 6 months. Overall, while a slight decline in accuracy is observed as the prediction horizon extends, the model’s performance remains acceptable. Specifically, for short-term forecasts of 1 to 3 months, the Nash–Sutcliffe Efficiency consistently exceeds 0.70, reaching 0.77 for the 1-month-ahead prediction, with RMSE and MAE values of 0.22 and 0.17 m
3/s, respectively. This indicates the model’s effectiveness in capturing the variation patterns of spring discharge and reasonably representing the time-lag relationship between precipitation and groundwater recharge. When the forecast horizon is extended to 6 months, the NSE decreases to 0.67, while RMSE and MAE increase to 0.33 and 0.26 m
3/s. Despite this decline, the model retains adequate trend-capturing ability, demonstrating robust long-term stability.
The observed decline in accuracy can be primarily attributed to the nonlinear storage and multi-scale response characteristics inherent to karst aquifer systems. Spring discharge is governed by the combined effects of precipitation infiltration, aquifer storage, and conduit flow. The precipitation signal attenuates during transmission, and its influence as an external driver diminishes over longer prediction horizons, while the delayed release effect from the groundwater system becomes more pronounced. Furthermore, increased forecast lead times introduce error accumulation, reducing the model’s sensitivity to local fluctuations. Overall, these findings reflect the typical mechanism of karst hydrologic systems characterized by “short-term response and long-term delayed release.”
5. Analysis and Discussion
5.1. Comparison with Other Baseline Models
To rigorously evaluate the predictive performance of the proposed H-STGAT model, a comparative analysis was conducted against a comprehensive set of benchmark models. These baselines encompass: (1) statistical models, specifically ARIMA [
25] and MLR [
26]; (2) ensemble learning, represented by XGBoost [
27], recognized for its efficiency in capturing non-linear patterns in hydrological datasets; (3) recurrent and graph-based architectures, including GRU [
28], LSTM [
11], GCN [
29], and GAT [
21]; (4) the foundational Transformer [
30] architecture and its frontier variants, namely Informer [
13] and Autoformer [
12], designed for capturing complex dependencies in long-sequence time-series.
To ensure the reproducibility of results and account for the stochastic nature of network initialization, all deep learning-based benchmarks were implemented under a unified experimental framework using standard configurations consistent with recent studies. Each model was subjected to 10 independent training iterations with distinct initialization seeds to verify training stability. The metrics reported in
Table 5 represent the optimal performance of the model selected based on the validation set, reflecting the peak capacity of each model for spring discharge forecasting.
As shown in
Table 5, the results indicate that our proposed model achieved the best performance across all evaluation metrics among all the tested models. The traditional ARIMA and MLR models exhibit limited capability in capturing nonlinear hydrological dynamics, achieving relatively low Nash–Sutcliffe Efficiency values. While the tree-based XGBoost outperforms these statistical baselines, it lacks the mechanism to explicitly model the spatiotemporal connectivity between observation stations. Among deep learning approaches, GRU and LSTM models, which primarily focus on temporal dependencies, yield NSE values ranging from 0.65 to 0.67. Although GCN and GAT incorporate spatial correlations, their capacity to model long-term temporal relationships remains insufficient, resulting in NSE values of approximately 0.6718. The Transformer architecture and its advanced variants, such as Informer and Autoformer, leverage powerful attention mechanisms but often treat spatial variables as multivariate channels without incorporating the physical topology of the monitoring network. Consequently, they achieve improved but still suboptimal results compared to the proposed architecture.
This architecture enables the synergistic modeling of complex spatiotemporal lags and nonlinear interactions, encoding spatial proximity and periodic patterns directly into the learning framework. This is particularly well-suited to the characteristics of karst groundwater systems, including slow recharge-discharge dynamics and heterogeneous aquifer properties. Consequently, H-STGAT achieves a substantial improvement with an NSE of 0.7695, while also exhibiting significant reductions in RMSE, MAE, and MAPE. These findings verify the enhanced robustness and predictive accuracy of H-STGAT in simulating the nonlinear precipitation–discharge response, establishing it as a reliable predictive tool for the Shentou Spring catchment and offering a methodological reference for hydrological modeling in comparable karst systems.
5.2. Assessing the Contribution of Hydrological Relationships and Attention Mechanism
To validate the effectiveness of the key components in the proposed H-STGAT model, a series of ablation studies was conducted. These experiments evaluate the impact of removing specific hydrological relationships or attention mechanisms on the model’s performance. The results are summarized in
Table 6.
The results in
Table 6 indicate that the complete H-STGAT model achieves the best performance across all evaluation metrics. Specifically, removing the Hydrological Periodicity Pattern leads to the most significant degradation in performance, with NSE dropping to 0.4792, highlighting that capturing the overall trend and seasonal variations serves as the essential framework for accurate spring discharge prediction. The ablation of Spatial Hydro-relation also results in substantial performance decline, underscoring that spring discharge is primarily driven by spatially distributed precipitation, and effective modeling of the spatial precipitation–discharge relationship significantly enhances simulation accuracy. Similarly, removing the hydrological process dependency causes notable deterioration, confirming the necessity of capturing the “memory” effects of hydrological processes. Furthermore, when the channel-wise attention mechanism is removed and replaced with simple averaging fusion, model performance also declines. This demonstrates that precipitation at different locations and time periods exerts varying influences on spring discharge. Precipitation exhibits spatially heterogeneous and temporally lagged effects on spring discharge, as illustrated in
Figure 4. The attention mechanism in H-STGAT adaptively focuses on feature factors critical to spring discharge in a data-driven manner, thereby improving prediction accuracy. In summary, the ablation study validates that the three integrated hydrological relationships and the attention mechanism are all indispensable components. They operate synergistically to effectively enhance the model’s capability to simulate and predict complex karst hydrological processes.
5.3. Contribution Analysis of Feature Branches in a Hierarchical Attention Mechanism
The H-STGAT model extracts hydrological information from three channels: period, space, and time. The periodic channel reflects interannual variations and dominates the overall trend. The spatial channel reflects the spatial differences in recharge within the basin. And the temporal channel captures the dynamic responses of short-term processes. The model’s attention mechanism adaptively learns the importance weights of each channel. As shown in
Table 7, the weight of the periodic channel is the highest at 0.653, followed by the spatial channel at 0.246, and the temporal channel is the smallest at 0.101. This indicates that the model develops a prediction strategy of “trend-dominated, fluctuation-supplemented” during the learning process. The dominance of the periodic channel warrants merits particular attention. Although explicit variables for climate change and human activities are not direct inputs, the model effectively captures the cumulative impacts of these external stressors by assigning the highest weight to historical periodic patterns. Consequently, the H-STGAT architecture inherently accounts for the long-term trends driven by changing climatic conditions and anthropogenic interventions embedded within the multi-year hydrological time series.
Based on the ablation study results from the previous section, removing the periodic channel led to a 37.7% decrease in NSE, indicating its dominant role in establishing the baseline trend of spring discharge dynamics. This aligns with the hydrological understanding that karst springs exhibit strong seasonal patterns driven by annual precipitation cycles [
1,
14]. Removing the spatial channel resulted in a 16.3% decline in NSE and a 50.6% increase in RMSE, demonstrating that spatial heterogeneity of precipitation recharge is essential for capturing the distributed nature of karst aquifer systems. Eliminating the temporal channel caused a 7.0% drop in NSE, revealing that while short-term process memory contributes to refining predictions, its effect is relatively modest compared to trend and spatial components. When the adaptive attention mechanism was replaced with fixed equal weighting, NSE decreased by 5.0% to 0.7312, validating the effectiveness of learned adaptive weighting in multi-feature integration. These results demonstrate a hierarchical structure in karst spring discharge processes, where seasonal periodicity provides the fundamental framework, spatial precipitation patterns account for watershed-scale variability, and temporal process memory fine-tunes short-term dynamics. This hierarchical characterization provides valuable insights for understanding and modeling complex karst hydrological systems.
5.4. Identification of Spring Catchment Recharge Mechanisms Based on Spatial Attention Weights
The H-STGAT model generates attention values within the spatial channel to quantify the spatial dependency strength among different stations, revealing the spatial intensity of information transmission.
Figure 10 illustrates the spatial attention distribution learned by the model between ten precipitation stations and the spring discharge observation station, providing an intuitive depiction of the regional recharge relationships.
This distribution demonstrates a general consistency with the established hydrogeological conceptualization of the Shentou Spring Basin, offering empirical support for the model’s physical interpretability. Specifically, previous environmental tracer studies that utilizing stable (
,
) and radioactive (
) isotopes have explicitly identified the high-altitude carbonate outcrops of the Guancen Mountains as the principal recharge sources for the deep karst aquifer [
18,
19]. Aligning with this physical reality, the model autonomously assigned the highest attention weights of 0.24 and 0.22 to the Ningwu and Shenchi stations, respectively, which are situated within this core recharge zone. This convergence demonstrates that the H-STGAT model has correctly prioritized the dominant physical driving factors consistent with independent isotopic evidence.
Downgradient from the recharge zone, the model assigns intermediate weights of 0.16 and 0.13 to Youyu and Zuoyun, reflecting their hydrogeological function as lateral flow and transmission belts that facilitate groundwater transit. Conversely, basin margin sites such as Pinglu, Shuozhou, and Shanyin received lower weights ranging from 0.12 to 0.13, while peripheral stations like Kelan and Yingxian were assigned minimal importance of 0.03 and 0.04. This spatial attenuation corresponds to regional geological surveys [
16,
20], which indicate that these areas are characterized by thick quaternary sediment cover or act as discharge zones, thereby limiting their hydraulic connectivity to the deep karst system.
Collectively, this heterogeneous weight distribution—differentiating between distal recharge sources, transmission belts, and discharge areas—demonstrates that the H-STGAT model is capable of capturing spatial patterns that are largely consistent with the inherent recharge–flow–discharge mechanism. This suggests that the model can effectively approximate complex hydrogeological behaviors from spatiotemporal data without requiring explicit prior geological constraints.
5.5. Temporal Attention Mechanism for Capturing Dynamic Hydrological Process Memory
The temporal attention mechanism is designed to characterize the dynamic dependencies between consecutive time steps of precipitation and spring discharge. By constructing temporal edge connections between adjacent months, the model effectively captures the causal relationships and lagged response characteristics between precipitation and spring discharge.
Figure 11 presents a visualization of this mechanism, including the distribution of attention values across different time steps and their average variation trend.
Figure 11 depicts the temporal attention characteristics of the precipitation–discharge relationship, visualizing the relative contribution of precipitation at different time steps to spring discharge prediction and its average trend. The results show that the model allocates the highest importance to inputs occurring 4 to 6 months prior to the current time step. This learned pattern mirrors the statistical lag identified in the cross-covariance analysis (
Section 2.2). Such consistency suggests that the temporal attention mechanism effectively identifies the critical delay period associated with the aquifer’s storage–release processes. By autonomously focusing on these hydrologically relevant time windows, the model demonstrates an ability to align its predictive logic with the physical transit time of groundwater.
5.6. Historical Lookback Period Configuration
The H-STGAT model involves two critical temporal parameters: the Temporal Window Size (T) and the Lookback Years (K). The temporal window was set to T = 12 months based on hydrological principles, as a 12-month window represents a complete hydrological year that effectively captures seasonal variations and semi-annual lag effects. Unlike T, the optimal lookback period K lacks established theoretical guidance and depends on the trade-off between capturing interannual variability and avoiding information redundancy or computational burden. Therefore, we conducted experiments to determine the optimal K value by evaluating model performance under different historical data lengths ranging from 1 to 8 years.
Table 8 presents the experimental results under different lookback period configurations with
T fixed at 12 months.
The results indicate that model performance initially improves with increasing historical length, reaching optimal performance at K = 5 years with an NSE of 0.769, RMSE of 0.226 m3/s, MAE of 0.170 m3/s, and MAPE of 3.81%. This suggests that a five-year historical period effectively captures interannual variability and multi-year climate oscillations without introducing excessive noise from outdated information. When K exceeds 5 years, model accuracy gradually declines, with NSE dropping to 0.726 at K = 8, indicating that excessively long historical inputs introduce outdated hydrological information that weakens the model’s sensitivity to current conditions. Meanwhile, model size expands rapidly from 745 KB at K = 1 to 6520 KB at K = 8, leading to a sharp rise in computational and storage demands. Overall, the combination of T = 12 months and K = 5 years provides the best balance between predictive accuracy and computational efficiency, making it the optimal configuration for the H-STGAT model in this study.