Machine learning for Swiss river flow estimation

September 1, 2021
Share this project


River flow is a key component of the terrestrial water cycle and of special relevance for ecosystems and societies. Dependable information on river flow is essential for advancing both environmental research, and water resources management as well as for anticipating and mitigating floods and droughts.

To date, observations at gauging stations constitute the most accurate way to measure this quantity along river systems. However, observation networks only monitor a small number of locations, leaving many gaps on maps of regional river flow.

The proposed project MACH-Flow aims to bridge this gap by advancing our capabilities for estimating daily river flow at ungauged locations in Switzerland using data science methods. To this end, MACH-Flow will expand upon recent advances for modeling water-cycle variables by fusing sparse in situ observations with spatially continuous predictor variables using machine learning.

A special focus will be on making existing methods fit for application at the national scale, by tackling conceptual hurdles that arise when modeling daily river flow at the very high spatial resolution (i.e. 200×200 to 500×500 meters) that is relevant for water management. In particular, the MACH-Flow project will develop a machine-learning based reconstruction of spatially resolved daily river flow covering all of Switzerland. This product will be the first of its type and be relevant for a range of practical and scientific applications.



SDSC Team:
William Aeberhard
Michele Volpi

PI | Partners:

ETH Zurich, Institute for Atmospheric and Climate Science:

  • Dr. Lukas Gudmundsson
  • Dr. Etienne Fluet
  • Prof. Sonia I. Seneviratne

More info

WSL, Hydrological Forecasts Group:

  • Dr. Massimiliano Zappa
  • Dr. Michael Schirmer

More info



Accurately predicting river discharge, in particular at ungauged locations, is crucial for water resource management as well as drought and flood monitoring. Traditional hydrological models are generally calibrated on data from a single river catchment. They perform quite well when forecasting at this particular location (satisfactory temporal prediction) but they often generalize poorly at other locations (unsatisfactory spatial prediction). The main goal of this project is to develop models which can predict in space as well as in time. To this end we make use of data from many river gauging stations within a river network and model them jointly.

Proposed Approach / Solution

We are currently developing two models in parallel. The first one is a recurrent neural network with long short-term memory (LSTM) cells, following the hydrological state-of-the-art architectures. Here, all gauging stations are considered independent and they share parameters (Figure 1). An extension we are currently developing is with a loss function based on a generalization of the continuous rank probability score (a kind of energy score). This in principle allows to build ensemble predictions which would quantify predictive uncertainty. The second model builds on first principles with an additive model with ridge-penalized cubic B-splines. This model includes engineered features for both short- and long-term effects of precipitation and temperature. We have an optional independent module which can incorporated to this additive model. This module routes water through a river network, the latter seen as direct graph. We have illustrated with a benchmark hydrological model that such spatio-temporal routing can only improve predictions, and this mainly for more downstream locations (Figure 2). A future research avenue is to combine this water routing module (graph-based convolutions) with a recurrent neural network.


First, our LSTM neural network is on par with state-of-the-art hydrological models for Switzerland, albeit with much less inputs. This allows us to reconstruct river discharge at a national scale back to the early 1960s, which is the earliest time for which precipitation and temperature data products are available. This reconstruction is important for the hydrological community as its low computation cost allows one to test various climate change scenarios. Second, the routing model, to be released as an independent module, is useful for the community as it can be easily added to any local prediction model to improve downstream predictions. In principle it can predict improve predictions even with discharge data only available at a single station. Finally, a version of our additive model will be soon added to the ensemble of models used operationally on the drought monitoring platform maintained by our partners at WSL.

Figure 1: Figure 7 from Kraft et al. (2024), spatially contiguous reconstruction of runoff from 1962 to 2023. The maps represent the yearly catchment-level runoff quantiles relative to the reference period (1971 to 2000) empirical distribution. The bottom bars show the national decadal deviation in mm/year of the national-level runoff relative to the reference period (1971 to 2000).
Figure 2: Routed predicted discharge in m^3/s on November 25, 2012 (day with minimum average discharge over our training time window). The routing module here is applied on the (unrouted) local predictions from the benchmark model PREVAH (Viviroli et al., 2009).




  • Kraft, B., Aeberhard, W. H., Zappa, M., Schirmer, M., Seneviratne, S. I., and Gudmundsson, L. (2024). CH-RUN: A data-driven spatially contiguous runoff monitoring product for Switzerland. Submitted to Hydrology and Earth System Sciences

Additional resources


  1. Ghiggi, G., Humphrey, V., Seneviratne, S. I., and Gudmundsson, L. (2021). G-RUN ENSEMBLE: A multi-forcing observation-based global runoff reanalysis. Water Resources Research, 57 (5), 1-13.
  2. Jia, X. et al. (2021). Physics-Guided Recurrent Graph Model for Predicting Flow and Temperature in River Networks. Proceedings of the 2021 SIAM International Conference on Data Mining (SDM), 612-620. The Society for Industrial and Applied Mathematics:
  3. Asadi, P., Davison, A. C., and Engelke, S. (2015). Extremes on river networks. Ann. Appl. Stat. 9 (4), 2023-2050. Extremes on river networks:


Related Pages

More projects


In Progress
Interpretable and Robust Machine Learning for Mobility Analysis
No items found.


In Progress
Feature Learning for Bayesian Inference
No items found.


In Progress
Personalized epidural electrical stimulation of the lumbar spinal cord for clinically applicable therapy to restore mobility after paralyzing spinal cord injury
No items found.


In Progress
Directed Imitation During Vocal Learning
No items found.


Latest news

Smartair | An active learning algorithm for real-time acquisition and regression of flow field data
May 1, 2024

Smartair | An active learning algorithm for real-time acquisition and regression of flow field data

Smartair | An active learning algorithm for real-time acquisition and regression of flow field data

We’ve developed a smart solution for wind tunnel testing that learns as it works, providing accurate results faster. It provides an accurate mean flow field and turbulence field reconstruction while shortening the sampling time.
The Promise of AI in Pharmaceutical Manufacturing
April 22, 2024

The Promise of AI in Pharmaceutical Manufacturing

The Promise of AI in Pharmaceutical Manufacturing

Innovation in pharmaceutical manufacturing raises key questions: How will AI change our operations? What does this mean for the skills of our workforce? How will it reshape our collaborative efforts? And crucially, how can we fully leverage these changes?
Efficient and scalable graph generation through iterative local expansion
March 20, 2024

Efficient and scalable graph generation through iterative local expansion

Efficient and scalable graph generation through iterative local expansion

Have you ever considered the complexity of generating large-scale, intricate graphs akin to those that represent the vast relational structures of our world? Our research introduces a pioneering approach to graph generation that tackles the scalability and complexity of creating such expansive, real-world graphs.

Contact us

Let’s talk Data Science

Do you need our services or expertise?
Contact us for your next Data Science project!