Abstract
Reliable streamflow data is essential for flood forecasting and water resource management, yet the vast networks of in-situ sensors providing this data are prone to physical failures and environmental interference. Traditional quality control (QC) relies on labor-intensive manual inspection or rigid rule-based systems that struggle with site-specific nuances. This paper introduces HydroGEM (Hydrological Generalizable Encoder for Monitoring), a foundation model that leverages a hybrid Temporal Convolutional Network (TCN)-Transformer architecture and a two-stage self-supervised training regime. HydroGEM demonstrates superior performance in anomaly detection and data reconstruction across continental scales, achieving high accuracy in zero-shot applications on international datasets without additional training.
Introduction
Monitoring river stage (height) and discharge (flow) is a critical component of modern hydrology. However, the sensors deployed in these environments are subject to a variety of failure modes, including sensor drift, ice interference, debris fouling, and transmission gaps. Currently, the process of cleaning this data—Quality Control—represents a significant operational bottleneck. Domain experts must manually review millions of data points annually because existing automated tools often fail to distinguish between subtle sensor errors and legitimate hydrological events.
Furthermore, most existing machine learning approaches are site-specific, requiring retraining for different geographic regions or river types. HydroGEM addresses these challenges by adopting the "foundation model" paradigm, creating a single, robust architecture capable of generalizing across diverse hydrological regimes.
Methodology
Hybrid Architecture
HydroGEM utilizes a novel Hybrid TCN-Transformer architecture designed to process time-series data at multiple scales:
- Temporal Convolutional Networks (TCNs): These are employed to capture local, short-term patterns, such as sudden spikes or rapid fluctuations.
- Transformer with Cosine Retention Attention: This module handles long-range dependencies, allowing the model to recognize seasonal shifts and gradual sensor drifts that occur over weeks or months.
Two-Stage Training Process
The model's training is divided into two distinct phases to maximize its understanding of hydrological physics:
- Self-Supervised Pretraining: The model was first trained on 6.03 million "clean" sequences using masked reconstruction. This phase forces the model to learn the underlying "grammar" of river behavior.
- Task-Specific Fine-Tuning: The model was then exposed to synthetic anomalies. By using deliberately simplified training anomalies, the researchers forced the model to learn fundamental hydrometric principles rather than simply memorizing specific error signatures.
Hierarchical Normalization and Scale Embeddings
Streamflow can vary by six orders of magnitude between small creeks and major rivers. To address this, HydroGEM uses a three-tier normalization scheme. Crucially, the authors found that standard normalization (which removes scale) can hinder performance, as a river's scale often dictates its behavior (e.g., small streams are typically "flashier"). By re-injecting scale information via embeddings, the model maintains necessary geographical context.
Experimental Setup and Datasets
The model was developed and validated using three primary data sources:
- USGS Streamflow Archive: 10 years of high-quality data from 3,724 United States Geological Survey (USGS) sites served as the training foundation.
- Synthetic Benchmark: A test set of 799 held-out USGS sites featuring 18 types of injected anomalies (e.g., flatlines, spikes, and drifts) based on official operational standards.
- Canadian ECCC Set: To test "zero-shot" generalization, the model was evaluated on data from 100 Environment and Climate Change Canada (ECCC) stations. This represents a completely different national network with distinct instrumentation and climatic conditions.
Key Results
HydroGEM significantly outperformed traditional baselines and demonstrated remarkable cross-border generalizability:
- Detection Accuracy: The model achieved an F1 score of 0.792 for anomaly detection, a 36.3% improvement over the Isolation Forest baseline.
- Data Reconstruction: HydroGEM reduced reconstruction error by 68.7% compared to corrupted raw data, providing reliable estimates for missing or flagged values.
- Zero-Shot Generalization: On the Canadian ECCC dataset, the model achieved a Tolerant F1 of 0.70 without any prior exposure to Canadian hydrological data.
- Operational Reliability: The model maintained a 96.8% preservation rate for clean data, ensuring that legitimate hydrological events are not erroneously "corrected."
Discussion and Future Work
While HydroGEM represents a major step forward, certain challenges remain. The model occasionally struggles to distinguish between sensor malfunctions and anthropogenic noise, such as sudden dam releases. Additionally, different national agencies (USGS vs. ECCC) have varying philosophies regarding data correction, particularly during ice-affected periods. Currently, HydroGEM’s suggested reconstructions align more closely with USGS standards.
Future iterations of the model may integrate auxiliary meteorological data, such as precipitation and temperature, to better differentiate between flash floods and sensor errors. There is also significant potential to extend this foundation model framework to other water quality parameters, including pH, turbidity, and dissolved oxygen.
Summary updated