Spatiotemporal Modeling of Surface Water–Groundwater Interactions via Multi-Task Transformer-Based Learning
Abstract
1. Introduction
2. Materials and Methods
2.1. Study Area
2.2. Simulation Target and Hydrological Inputs
2.3. Conceptual Model of Surface Water–Groundwater Coupling in the HRB
2.4. Construction of a Coupled Surface Water–Groundwater Model Based on a Multi-Task Learning Framework
2.4.1. Multi-Task Learning Framework
2.4.2. Multi-Task Learning Framework Based on Recurrent Neural Networks
2.4.3. Multi-Task Learning Framework Based on Temporal Fusion Transformer
2.5. Self-Organizing Map (SOMs)
2.6. Experimental Design
2.7. Hyperparameter Optimization
2.8. Model Evaluation Metrics
3. Results
3.1. Analysis of HRB Runoff Simulation Results
3.2. Cluster Analysis of Groundwater Observation and Analysis of Simulation Results
4. Discussion
4.1. Temporal Analysis of Attention Weights in Runoff Prediction
4.2. Factors Influencing the Coupled Surface Water–Groundwater Model
5. Conclusions
- (1)
- The proposed MTL framework demonstrated significant advantages over single-task learning (STL) approaches in simulating coupled hydrological processes. By jointly optimizing surface runoff and groundwater-level prediction tasks, the MTL framework improved Nash–Sutcliffe efficiency (NSE) and coefficient of determination (R2) by 15–20% across all model configurations using the 2001–2012 HRB datasets.
- (2)
- The Transformer-based Temporal Fusion Transformer (TFT) algorithm outperformed both GRU and LSTM models in simulating surface runoff and groundwater-level dynamics under both STL and MTL frameworks. Notably, within the MTL setting, the MT-TFT model, which incorporates the groundwater-level simulation task, achieved superior performance in surface runoff prediction (NSE = 0.73; R2 = 0.75), substantially surpassing all STL models.
- (3)
- Analysis of the model’s attention mechanism revealed that higher attention weights were consistently assigned to time steps with greater precipitation. These weights further increased as the forecast horizon shortened, thereby enhancing the accuracy of near-term multi-step predictions.
- (4)
- The clustering results of the SOM revealed distinct spatial distribution characteristics and temporal variation patterns in groundwater time-series dynamics among different categories of observation wells. The SOM effectively distinguished observation wells based on their geometric proximity to the Heihe River. Wells located farther away exhibited lower Permutation Entropy in groundwater time-series dynamics, relatively lower temporal complexity, and higher simulation accuracy in the model, and vice versa.
- (5)
- Pearson linear correlation analysis between groundwater observations and runoff discharge under varying time lags indicates distinct lag-dependent relationships in the mid-stream HRB. Autocorrelation of monthly runoff data showed a cyclical pattern, with correlations shifting from significantly positive to negative and back to positive as lags increased from 1 to 12 months. Spatially, groundwater-level variations exhibited a negative correlation with river discharge in the main stem of the Heihe River, which became more pronounced with increasing geographic distance.
Supplementary Materials
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
| MTL | Multi-Task Learning |
| STL | Stingle-Task Learning |
| SW-GW | Surface Water–Groundwater |
| RNNs | Recurrent Neural Networks |
| GRU | Gated Recurrent Unit |
| LSTM | Long Short-Term Memory |
| CNNs | Convolutional Neural Networks |
| TFT | Temporal Fusion Transformer |
| GRN | Gated Residual Network |
| VSN | Variable Selection Network |
| SCEs | Static Covariate Encoders |
| TFD | Temporal Fusion Decoder |
| SEL | Static Enrichment Layer |
| TSL | Temporal Self-Attention Layer |
| PFL | Position-wise Feed-forward Layer |
| ELU | Exponential Linear Unit |
| GLUs | Gated Linear Units |
| RMSE | Root Mean Square Error |
| NSE | Nash–Sutcliffe Efficiency |
| R2 | Coefficient of Determination |
| HRB | Heihe River Basin |
| IoT | Internet of Things |
| PRMSs | Precipitation–Runoff Modeling Systems |
| SOM | Self-Organizing Map |
References
- Aeschbach-Hertig, W.; Gleeson, T. Regional strategies for the accelerating global problem of groundwater depletion. Nat. Geosci. 2012, 5, 853–861. [Google Scholar] [CrossRef]
- Kuang, X.; Liu, J.; Scanlon, B.R.; Jiao, J.J.; Jasechko, S.; Lancia, M.; Biskaborn, B.K.; Wada, Y.; Li, H.; Zeng, Z.; et al. The changing nature of groundwater in the global water cycle. Science 2024, 383, eadf0630. [Google Scholar] [CrossRef] [PubMed]
- Scanlon, B.R.; Jolly, I.; Sophocleous, M.; Zhang, L. Global impacts of conversions from natural to agricultural ecosystems on water resources: Quantity versus quality. Water Resour. Res. 2007, 43, W03437. [Google Scholar] [CrossRef]
- Siebert, S.; Burke, J.; Faures, J.M.; Frenken, K.; Hoogeveen, J.; Döll, P.; Portmann, F.T. Groundwater use for irrigation–a global inventory. Hydrol. Earth Syst. Sci. 2010, 14, 1863–1880. [Google Scholar] [CrossRef]
- Scanlon, B.R.; Fakhreddine, S.; Rateb, A.; de Graaf, I.; Famiglietti, J.; Gleeson, T.; Grafton, R.Q.; Jobbagy, E.; Kebede, S.; Kolusu, S.R.; et al. Global water resources and the role of groundwater in a resilient water future. Nat. Rev. Earth Environ. 2023, 4, 87–101. [Google Scholar] [CrossRef]
- Döll, P.; Hoffmann-Dobrev, H.; Portmann, F.T.; Siebert, S.; Eicker, A.; Rodell, M.; Strassberg, G.; Scanlon, B.R. Impact of water withdrawals from groundwater and surface water on continental water storage variations. J. Geodyn. 2012, 59–60, 143–156. [Google Scholar] [CrossRef]
- Lancia, M.; Yao, Y.; Andrews, C.B.; Wang, X.; Kuang, X.; Ni, J.; Gorelick, S.M.; Scanlon, B.R.; Wang, Y.; Zheng, C. The China groundwater crisis: A mechanistic analysis with implications for global sustainability. Sustain. Horiz. 2022, 4, 100042. [Google Scholar] [CrossRef]
- Gorelick, S.M.; Zheng, C. Global change and the groundwater management challenge. Water Resour. Res. 2015, 51, 3031–3051. [Google Scholar] [CrossRef]
- Sophocleous, M. From safe yield to sustainable development of water resources—The Kansas experience. J. Hydrol. 2000, 235, 27–43. [Google Scholar] [CrossRef]
- Kendy, E.; Gérard-Marchant, P.; Todd Walter, M.; Zhang, Y.; Liu, C.; Steenhuis, T.S. A soil-water-balance approach to quantify groundwater recharge from irrigated cropland in the North China Plain. Hydrol. Process. 2003, 17, 2011–2031. [Google Scholar] [CrossRef]
- Kinzelbach, W.; Bauer, P.; Siegfried, T.; Brunner, P. Sustainable groundwater management--Problems and scientific tool. Epis. -Newsmag. Int. Union Geol. Sci. 2003, 26, 279–284. [Google Scholar] [CrossRef]
- He, Q.; Liu, W.; Li, Z. Land Subsidence Survey and Monitoringin the North China Plain. Geol. J. China Univ. 2006, 12, 195–209. [Google Scholar]
- Aderemi, B.A.; Olwal, T.O.; Ndambuki, J.M.; Rwanga, S.S. A Review of Groundwater Management Models with a Focus on IoT-Based Systems. Sustainability 2022, 14, 148. [Google Scholar] [CrossRef]
- Shen, C. A Transdisciplinary Review of Deep Learning Research and Its Relevance for Water Resources Scientists. Water Resour. Res. 2018, 54, 8558–8593. [Google Scholar] [CrossRef]
- Zhang, J.; Zhu, Y.; Zhang, X.; Ye, M.; Yang, J. Developing a Long Short-Term Memory (LSTM) based model for predicting water table depth in agricultural areas. J. Hydrol. 2018, 561, 918–929. [Google Scholar] [CrossRef]
- Rajaee, T.; Ebrahimi, H.; Nourani, V. A review of the artificial intelligence methods in groundwater level modeling. J. Hydrol. 2019, 572, 336–351. [Google Scholar] [CrossRef]
- Chen, C.; He, W.; Zhou, H.; Xue, Y.; Zhu, M. A comparative study among machine learning and numerical models for simulating groundwater dynamics in the Heihe River Basin, northwestern China. Sci. Rep. 2020, 10, 3904. [Google Scholar] [CrossRef]
- Xiang, Z.; Yan, J.; Demir, I. A Rainfall-Runoff Model With LSTM-Based Sequence-to-Sequence Learning. Water Resour. Res. 2020, 56, e2019WR025326. [Google Scholar] [CrossRef]
- Sun, J.; Hu, L.; Li, D.; Sun, K.; Yang, Z. Data-driven models for accurate groundwater level prediction and their practical significance in groundwater management. J. Hydrol. 2022, 608, 127630. [Google Scholar] [CrossRef]
- Tian, W.; Li, X.; Cheng, G.D.; Wang, X.S.; Hu, B.X. Coupling a groundwater model with a land surface model to improve water and energy cycle simulation. Hydrol. Earth Syst. Sci. 2012, 16, 4707–4723. [Google Scholar] [CrossRef]
- Kratzert, F.; Klotz, D.; Brenner, C.; Schulz, K.; Herrnegger, M. Rainfall–runoff modelling using Long Short-Term Memory (LSTM) networks. Hydrol. Earth Syst. Sci. 2018, 22, 6005–6022. [Google Scholar] [CrossRef]
- Kratzert, F.; Klotz, D.; Herrnegger, M.; Sampson, A.K.; Hochreiter, S.; Nearing, G.S. Toward Improved Predictions in Ungauged Basins: Exploiting the Power of Machine Learning. Water Resour. Res. 2019, 55, 11344–11354. [Google Scholar] [CrossRef]
- Kratzert, F.; Klotz, D.; Shalev, G.; Klambauer, G.; Hochreiter, S.; Nearing, G. Towards learning universal, regional, and local hydrological behaviors via machine learning applied to large-sample datasets. Hydrol. Earth Syst. Sci. 2019, 23, 5089–5110. [Google Scholar] [CrossRef]
- Ma, K.; Feng, D.; Lawson, K.; Tsai, W.P.; Liang, C.; Huang, X.; Sharma, A.; Shen, C. Transferring Hydrologic Data Across Continents–Leveraging Data-Rich Regions to Improve Hydrologic Prediction in Data-Sparse Regions. Water Resour. Res. 2021, 57, e2020WR028600. [Google Scholar] [CrossRef]
- Jiang, S.; Zheng, Y.; Babovic, V.; Tian, Y.; Han, F. A computer vision-based approach to fusing spatiotemporal data for hydrological modeling. J. Hydrol. 2018, 567, 25–40. [Google Scholar] [CrossRef]
- Li, X.; Cheng, G.; Ge, Y.; Li, H.; Han, F.; Hu, X.; Tian, W.; Tian, Y.; Pan, X.; Nian, Y.; et al. Hydrological Cycle in the Heihe River Basin and Its Implication for Water Resource Management in Endorheic Basins. J. Geophys. Res. Atmos. 2018, 123, 890–914. [Google Scholar] [CrossRef]
- Jing, H.; He, X.; Tian, Y.; Lancia, M.; Cao, G.; Crivellari, A.; Guo, Z.; Zheng, C. Comparison and interpretation of data-driven models for simulating site-specific human-impacted groundwater dynamics in the North China Plain. J. Hydrol. 2023, 616, 128751. [Google Scholar] [CrossRef]
- Wen, X.H.; Wu, Y.Q.; Lee, L.J.E.; Su, J.P.; Wu, J. Groundwater flow modeling in the Zhangye Basin, Northwestern China. Environ. Geol. 2007, 53, 77–84. [Google Scholar] [CrossRef]
- Mi, L.; Xiao, H.; Zhang, J.; Yin, Z.; Shen, Y. Evolution of the groundwater system under the impacts of human activities in middle reaches of Heihe River Basin (Northwest China) from 1985 to 2013. Hydrogeol. J. 2016, 24, 971–986. [Google Scholar] [CrossRef]
- Yao, Y.; Zheng, C.; Tian, Y.; Liu, J.; Zheng, Y. Numerical modeling of regional groundwater flow in the Heihe River Basin, China: Advances and new insights. Sci. China Earth Sci. 2015, 58, 3–15. [Google Scholar] [CrossRef]
- Jiang, X.-W.; Wan, L.; Wang, X.-S.; Ge, S.; Liu, J. Effect of exponential decay in hydraulic conductivity with depth on regional groundwater flow. Geophys. Res. Lett. 2009, 36, L24402. [Google Scholar] [CrossRef]
- Miguez-Macho, G.; Fan, Y. The role of groundwater in the Amazon water cycle: 2. Influence on seasonal soil moisture and evapotranspiration. J. Geophys. Res. Atmos. 2012, 117, D15114. [Google Scholar] [CrossRef]
- Pokhrel, Y.N.; Fan, Y.; Miguez-Macho, G.; Yeh, P.J.-F.; Han, S.-C. The role of groundwater in the Amazon water cycle: 3. Influence on terrestrial water storage computations and comparison with GRACE. J. Geophys. Res. Atmos. 2013, 118, 3233–3244. [Google Scholar] [CrossRef]
- Kuang, X.; Jiao, J.J. An integrated permeability-depth model for Earth’s crust. Geophys. Res. Lett. 2014, 41, 7539–7545. [Google Scholar] [CrossRef]
- Yang, K.; He, J.; Tang, W.; Lu, H.; Qin, J.; Chen, Y.; Li, X. China Meteorological Forcing Dataset V1.6 (1979–2018). National Tibetan Plateau / Third Pole Environment Data Center. 2019. Available online: https://data.tpdc.ac.cn/en/data/8028b944-daaa-4511-8769-965612652c49 (accessed on 29 October 2025).
- He, J.; Yang, K.; Tang, W.; Lu, H.; Qin, J.; Chen, Y.; Li, X. The first high-resolution meteorological forcing dataset for land process studies over China. Sci. Data 2020, 7, 25. [Google Scholar] [CrossRef]
- Yang, K.; He, J.; Tang, W.; Qin, J.; Cheng, C.C.K. On downward shortwave and longwave radiations over high altitude regions: Observation and modeling in the Tibetan Plateau. Agric. For. Meteorol. 2010, 150, 38–46. [Google Scholar] [CrossRef]
- Yao, Y.; Huang, X.; Liu, J.; Zheng, C.; He, X.; Liu, C. Spatiotemporal variation of river temperature as a predictor of groundwater/surface-water interactions in an arid watershed in China. Hydrogeol. J. 2015, 23, 999–1007. [Google Scholar] [CrossRef]
- Yao, Y.; Zheng, C.; Tian, Y.; Li, X.; Liu, J. Eco-hydrological effects associated with environmental flow management: A case study from the arid desert region of China. Ecohydrology 2018, 11, e1914. [Google Scholar] [CrossRef]
- Crawshaw, M. Multi-task learning with deep neural networks: A survey. arXiv 2020, arXiv:2009.09796. [Google Scholar] [CrossRef]
- Caruana, R. Multitask learning. Mach. Learn. 1997, 28, 41–75. [Google Scholar] [CrossRef]
- Medsker, L.R.; Jain, L. Recurrent neural networks. Des. Appl. 2001, 5, 2. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Cho, K.; van Merriënboer, B.; Bahdanau, D.; Bengio, Y. On the Properties of Neural Machine Translation: Encoder–Decoder Approaches. Association for Computational Linguistics. 2014, pp. 103–111. Available online: https://aclanthology.org/W14-4012/ (accessed on 29 October 2025).
- Mienye, I.D.; Swart, T.G. A Comprehensive Review of Deep Learning: Architectures, Recent Advances, and Applications. Information 2024, 15, 755. [Google Scholar] [CrossRef]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef] [PubMed]
- Lim, B.; Arık, S.Ö.; Loeff, N.; Pfister, T. Temporal Fusion Transformers for interpretable multi-horizon time series forecasting. Int. J. Forecast. 2021, 37, 1748–1764. [Google Scholar] [CrossRef]
- Rasiya Koya, S.; Roy, T. Temporal Fusion Transformers for streamflow Prediction: Value of combining attention with recurrence. J. Hydrol. 2024, 637, 131301. [Google Scholar] [CrossRef]
- Fayer, G.; Lima, L.; Miranda, F.; Santos, J.; Campos, R.; Bignoto, V.; Andrade, M.; Moraes, M.; Ribeiro, C.; Capriles, P.; et al. A Temporal Fusion Transformer Deep Learning Model for Long-Term Streamflow Forecasting: A Case Study in the Funil Reservoir, Southeast Brazil. Knowl.-Based Eng. Sci. 2023, 4, 73–88. [Google Scholar]
- Francisco, R.; Matos, J.P.; Marinheiro, R.; Lopes, N.; Portela, M.M.; Barros, P. Application of Temporal Fusion Transformers to Run-Of-The-River Hydropower Scheduling. Hydrology 2025, 12, 81. [Google Scholar] [CrossRef]
- Zhou, R.; Wang, Q.; Jin, A.; Shi, W.; Liu, S. Interpretable multi-step hybrid deep learning model for karst spring discharge prediction: Integrating temporal fusion transformers with ensemble empirical mode decomposition. J. Hydrol. 2024, 645, 132235. [Google Scholar] [CrossRef]
- Jiang, M.; Weng, B.; Chen, J.; Huang, T.; Ye, F.; You, L. Transformer-enhanced spatiotemporal neural network for post-processing of precipitation forecasts. J. Hydrol. 2024, 630, 130720. [Google Scholar] [CrossRef]
- Kohonen, T. Self-organized formation of topologically correct feature maps. Biol. Cybern. 1982, 43, 59–69. [Google Scholar] [CrossRef]
- Probst, P.; Wright, M.N.; Boulesteix, A.-L. Hyperparameters and tuning strategies for random forest. WIREs Data Min. Knowl. Discov. 2019, 9, e1301. [Google Scholar] [CrossRef]
- O’Malley, T.; Bursztein, E.; Long, J.; Chollet, F.; Jin, H.; Invernizzi, L. KerasTuner. 2019. Available online: https://github.com/keras-team/keras-tuner (accessed on 2 March 2021).
- Onyutha, C. A hydrological model skill score and revised R-squared. Hydrol. Res. 2021, 53, 51–64. [Google Scholar] [CrossRef]
- Krause, P.; Boyle, D.P.; Bäse, F. Comparison of different efficiency criteria for hydrological model assessment. Adv. Geosci. 2005, 5, 89–97. [Google Scholar] [CrossRef]
- Bandt, C.; Pompe, B. Permutation Entropy: A Natural Complexity Measure for Time Series. Phys. Rev. Lett. 2002, 88, 174102. [Google Scholar] [CrossRef]
- Feng, Z.; Liu, S.; Guo, Y.; Liu, X. Runoff Responses of Various Driving Factors in a Typical Basin in Beijing-Tianjin-Hebei Area. Remote Sens. 2023, 15, 1027. [Google Scholar] [CrossRef]
- Wittenberg, H.; Aksoy, H.; Miegel, K. Fast response of groundwater to heavy rainfall. J. Hydrol. 2019, 571, 837–842. [Google Scholar] [CrossRef]
- Ntona, M.M.; Busico, G.; Mastrocicco, M.; Kazakis, N. Modeling groundwater and surface water interaction: An overview of current status and future challenges. Sci. Total Environ. 2022, 846, 157355. [Google Scholar] [CrossRef] [PubMed]
- Yao, Y.; Tian, Y.; Andrews, C.; Li, X.; Zheng, Y.; Zheng, C. Role of Groundwater in the Dryland Ecohydrological System: A Case Study of the Heihe River Basin. J. Geophys. Res. Atmos. 2018, 123, 6760–6776. [Google Scholar] [CrossRef]
- Wu, H.; Xue, H.; Dong, G.; Gao, J.; Lian, Y.; Li, Z. Runoff variation in midstream Hei River, northwest China: Characteristics and driving factors analysis. J. Hydrol. Reg. Stud. 2024, 53, 101764. [Google Scholar] [CrossRef]















| Dataset | Source | Variables | Spatial Resolution | Temporal Resolution |
|---|---|---|---|---|
| Meteorological Driving Force | China Meteorological Forcing Dataset | Wind | 0.1° | Hourly |
| Precipitation | 0.1° | Hourly | ||
| Temperature | 0.1° | Hourly | ||
| GWL | Water Resources Department of Gansu Province | Groundwater level | In situ | 5 Days |
| Streamflow | Streamflow | In situ | Daily | |
| Land Use | Sentinel-2 | LULC | 30 m | Yearly |
| Model Architecture | Model Algorithm | Simulation Target |
|---|---|---|
| Single-Task Learning | ST-GRU | Surface Runoff |
| ST-LSTM | ||
| ST-TFT | ||
| ST-GRU | Groundwater Dynamics | |
| ST-LSTM | ||
| ST-TFT | ||
| Multi-Task Learning | MT-GRU | Surface Runoff and Groundwater Dynamics |
| MT-LSTM | ||
| MT-TFT |
| Model | NSE | R2 | RMSE (m3/d) |
|---|---|---|---|
| ST-GRU | 0.51 | 0.52 | 39.53 |
| MT-GRU | 0.45 | 0.49 | 41.69 |
| ST-LSTM | 0.40 | 0.42 | 45.66 |
| MT-LSTM | 0.48 | 0.49 | 40.38 |
| ST-TFT | 0.66 | 0.68 | 28.76 |
| MT-TFT | 0.73 | 0.75 | 28.43 |
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. |
© 2025 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 (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Jing, H.; Tian, Y.; Zheng, C. Spatiotemporal Modeling of Surface Water–Groundwater Interactions via Multi-Task Transformer-Based Learning. Hydrology 2025, 12, 291. https://doi.org/10.3390/hydrology12110291
Jing H, Tian Y, Zheng C. Spatiotemporal Modeling of Surface Water–Groundwater Interactions via Multi-Task Transformer-Based Learning. Hydrology. 2025; 12(11):291. https://doi.org/10.3390/hydrology12110291
Chicago/Turabian StyleJing, Hao, Yong Tian, and Chunmiao Zheng. 2025. "Spatiotemporal Modeling of Surface Water–Groundwater Interactions via Multi-Task Transformer-Based Learning" Hydrology 12, no. 11: 291. https://doi.org/10.3390/hydrology12110291
APA StyleJing, H., Tian, Y., & Zheng, C. (2025). Spatiotemporal Modeling of Surface Water–Groundwater Interactions via Multi-Task Transformer-Based Learning. Hydrology, 12(11), 291. https://doi.org/10.3390/hydrology12110291
