OpenHydroNet

repository·main·Indexed 43 days ago

https://github.com/google-research/flood-forecasting

An open-source implementation of riverine flood-forecasting models used by Google FloodHub. It provides tools to train, evaluate, and fine-tune global hydrological models using the Caravan dataset, featuring architectures like Mean-Embedding-Forecast-LSTM and Handoff-Forecast-LSTM.

Tokens
14K
Snippets
22
Records
65
Agent score
55%

What's inside OpenHydroNet

  1. Explore the googlehydrology.modelzoo package submodules

    main

    The googlehydrology.modelzoo package provides a collection of state-of-the-art riverine flood forecasting models. It is organized into several specialized submodules that handle different aspects of the model architecture and forecasting logic:

    • googlehydrology.modelzoo.basemodel: Likely contains the base classes or interfaces for models in the zoo.
    • googlehydrology.modelzoo.fc: Likely contains Fully Connected layer implementations or configurations.
    • googlehydrology.modelzoo.handoff_forecast_lstm: Implements the Handoff-Forecast-LSTM model architecture.
    • googlehydrology.modelzoo.head: Likely contains the model 'heads' used for specific output tasks.
    • googlehydrology.modelzoo.mean_embedding_forecast_lstm: Implements the Mean-Embedding-Forecast-LSTM model architecture.
    • googlehydrology.modelzoo.positional_encoding: Provides mechanisms for encoding positional information within the models.
  2. Explore the googlehydrology.evaluation package submodules

    main

    The googlehydrology.evaluation package provides tools for evaluating riverine flood forecasting models. It is organized into several specialized submodules:

    • googlehydrology.evaluation.evaluate: Core evaluation logic.
    • googlehydrology.evaluation.metrics: Implementation of various forecasting performance metrics.
    • googlehydrology.evaluation.plots: Tools for visualizing evaluation results and model performance.
    • googlehydrology.evaluation.tester: Utilities for testing evaluation components.
    • googlehydrology.evaluation.utils: Helper functions for evaluation tasks.
  3. Get started with OpenHydroNet

    main

    OpenHydroNet is a Python package for riverine flood forecasting. To begin using the project, follow these primary resources:

    • Quickstart Guide: Provides step-by-step instructions for installation, setting up required datasets, and using the command-line interface.
    • Tutorial: A guided walkthrough for training your first model.
    • Model Zoo: A list of all available forecasting models implemented in the repository.
    • API Documentation: Detailed technical reference for all modules, classes, and functions.

    The source code is hosted on GitHub at https://github.com/google-research/flood-forecasting/.

  4. Explore the googlehydrology.utils package submodules

    main

    The googlehydrology.utils package provides utility functions and support modules for the OpenHydroNet riverine flood forecasting models. The package is organized into several specialized submodules:

    • googlehydrology.utils.cmal_deterministic: Deterministic CMAL implementations.
    • googlehydrology.utils.config: Configuration management.
    • googlehydrology.utils.configutils: Utilities for handling and manipulating configurations.
    • googlehydrology.utils.errors: Custom error definitions and exception handling.
    • googlehydrology.utils.logging_utils: Utilities for managing application logging.
    • googlehydrology.utils.lstm_utils: Utilities specifically for LSTM (Long Short-Term Memory) model operations.
    • googlehydrology.utils.samplingutils: Utilities for data sampling and processing.
  5. Explore the googlehydrology.datasetzoo package submodules

    main

    The googlehydrology.datasetzoo package provides tools for managing and loading hydrological datasets. It is organized into several specialized submodules:

    • googlehydrology.datasetzoo.caravan: Likely related to specific dataset collections or workflows.
    • googlehydrology.datasetzoo.datasetregistry: Manages the registration and lookup of available datasets.
    • googlehydrology.datasetzoo.mfdata_loader: Handles loading of Multi-Feature (MF) data.
    • googlehydrology.datasetzoo.multimet: Likely handles multi-meteorological data formats or loading.
  6. Explore the googlehydrology.datautils package submodules

    main

    The googlehydrology.datautils package provides utility functions for data processing in the OpenHydroNet forecasting models. It is organized into several specialized submodules:

    • googlehydrology.datautils.scaler: Likely contains tools for feature scaling and normalization.
    • googlehydrology.datautils.union_features: Likely used for combining or managing feature sets.
    • googlehydrology.datautils.utils: General purpose utility functions.
    • googlehydrology.datautils.validate_samples: Tools for validating data samples before model ingestion.
  7. Critical Warning: Avoid Historical Benchmarking with Pre-trained Weights

    main

    🚨 CRITICAL METHODOLOGICAL CAVEAT 🚨

    These models were trained on the FULL historical data period (1982-2023) with NO temporal holdout/test split.

    Do NOT use these weights to evaluate temporal forecasting performance on historical datasets (1982-2023). Doing so will result in invalid, artificially inflated performance metrics due to data leakage (in-sample evaluation).

    • Fine-Tuning (Transfer Learning): Initialize a network with these weights and train on localized, instrumented datasets.
    • Spatial Generalization (PUB): Evaluate the model on spatially held-out basins (basins completely excluded from the original training list).
    • Future Inference: Run forward-looking inference on data generated strictly after the training period cutoff (post-2023).
  8. Use submodules in googlehydrology.training

    main

    The training package is composed of the following functional submodules:

    • googlehydrology.training.basetrainer: Contains the base classes and logic for defining training loops.
    • googlehydrology.training.logger: Handles logging of training metrics and progress.
    • googlehydrology.training.loss: Provides implementations of loss functions used during training.
    • googlehydrology.training.regularization: Implements regularization techniques to prevent overfitting.
    • googlehydrology.training.train: Contains the high-level training execution logic.
  9. Mean-Embedding-Forecast-LSTM model

    main
    The Mean-Embedding-Forecast-LSTM is the current production model for Google FloodHub (as of December 2025). It uses separate embedding networks for hindcast and forecast inputs, aggregating them using masked means before passing them into respective LSTMs for the hindcast and forecast periods.