Robust Inverse Framework using Knowledge-guided Self-Supervised Learning: An application to Hydrology

Rahul Ghosh, Arvind Renganathan, Kshitij Tayal, Xiang Li, Ankush Khandelwal, Xiaowei Jia, Christopher J. Duffy, John Nieber, Vipin Kumar

Abstract

Accurate streamflow prediction is critical for water management and flood forecasting, yet it relies heavily on precise knowledge of basin-specific physical characteristics (e.g., soil depth, slope, vegetation). These attributes are often sparsely measured, noisy, or entirely unavailable. This paper presents Knowledge-guided Self-Supervised Learning (KGSSL), a novel framework designed to solve the inverse problem in hydrology: inferring static physical characteristics from dynamic meteorological drivers and streamflow responses. By leveraging the physical principle that basin characteristics are time-invariant, KGSSL employs a contrastive learning approach to extract robust basin "fingerprints." Our results demonstrate that KGSSL improves attribute reconstruction by 16% and enhances downstream streamflow prediction accuracy by up to 35% in data-scarce scenarios.

Introduction

In environmental science, predicting a system's response to external drivers is known as the "forward problem." In hydrology, this involves using meteorological data (drivers) and basin characteristics to predict streamflow (response). However, while meteorological data is widely available, high-resolution maps of basin characteristics are often incomplete or inaccurate. Measuring subsurface properties like rock permeability or soil porosity across vast geographical areas is logistically and financially prohibitive.

Comparison of (a) Forward and (b) Inverse modeling approaches.

This research addresses the inverse problem: working backward from observed weather and streamflow to infer the underlying physical properties of the landscape. Inverse problems are notoriously "ill-posed," meaning multiple combinations of physical attributes could theoretically yield the same streamflow response. To overcome this, we introduce the KGSSL framework, which constrains the search space using physical domain knowledge.

Methodology

The KGSSL framework integrates deep learning with physical constraints to create a robust inference engine. The architecture is built around three primary components:

1. The Sequence Encoder

The model utilizes a Bidirectional Long Short-Term Memory (LSTM) network to process time-series data. By analyzing sequences of weather and streamflow, the encoder generates a latent embedding—a numerical "fingerprint"—that represents the unique identity of a river basin.

2. Knowledge-guided Contrastive Loss ($L_{Cont}$)

The core innovation of KGSSL is the application of a contrastive loss (InfoNCE) based on the principle of time-invariance. While weather and streamflow fluctuate daily, the physical characteristics of a basin (like its slope or soil type) remain constant over decadal scales. The model is trained to ensure that different time windows from the same basin produce near-identical embeddings, while windows from different basins are mapped to distinct regions of the embedding space.

3. Multi-Objective Optimization

To ensure the learned embeddings are both physically meaningful and accurate, the framework optimizes three distinct losses:

  • Reconstruction Loss ($L_{Rec}$): An autoencoder-style objective that ensures the embedding retains sufficient information to reconstruct the original input sequences.
  • Pseudo-Inverse Loss ($L_{Inv}$): A supervised component that utilizes available (even if noisy) ground-truth data to guide the learning process toward realistic physical values.
The KGSSL framework architecture, illustrating the sequence encoder and the integration of contrastive, reconstruction, and inverse losses.

Experimental Setup and Datasets

The framework was evaluated using the CAMELS dataset (Catchment Attributes and MEteorology for Large-sample Studies), which includes 531 basins across the United States. The dataset provides 20 years of daily meteorological drivers and streamflow observations, alongside 27 static characteristics categorized into climatology, soil/geology, and geomorphology/land-cover.

Results and Discussion

Superior Reconstruction and Denoising

KGSSL outperformed standard LSTM-based inverse models by 16% in reconstructing basin characteristics. Notably, the model achieved a correlation greater than 0.8 for 20 out of the 27 tested attributes. A key finding was the model's ability to act as a filter; even when 90% of the training characteristics were corrupted with heavy Gaussian noise, the framework remained stable, effectively "denoising" the data to find the true physical signal.

Impact on Forward Modeling

To test the utility of the inferred attributes, they were integrated into a state-of-the-art streamflow prediction model (EA-LSTM). In scenarios where ground-truth basin data was missing, the KGSSL-inferred attributes allowed the model to outperform baseline predictions by 35%. This suggests that the AI-inferred "identity" of a basin is often more functionally accurate than coarse, simplified spatial averages found in traditional maps.

Predictability Hierarchy

The model's performance varied across attribute types. It excelled at inferring topographic and climate-related features (e.g., elevation, forest fraction) which have a direct and strong impact on the water cycle. Conversely, it faced challenges with deep geological features (e.g., rock permeability), which have a more subtle and indirect influence on surface streamflow.

Conclusion

KGSSL demonstrates that self-supervised learning, when guided by physical constraints like time-invariance, can effectively solve complex inverse problems in environmental science. While the model currently faces limitations in detecting deep subsurface features, it provides a powerful tool for filling data gaps in hydrology. Future work will focus on a unified framework that trains the inverse and forward models simultaneously, potentially allowing for real-time modulation of streamflow predictions based on dynamically inferred landscape features. This "identity-based" approach holds promise for other fields where static system properties must be inferred from dynamic observations, such as ecosystem modeling or planetary science.

Summary updated

BibTeX
@inproceedings{ghosh2022robust,
  author = {Rahul Ghosh and Arvind Renganathan and Kshitij Tayal and Xiang Li and Ankush Khandelwal and Xiaowei Jia and Christopher J. Duffy and John Nieber and Vipin Kumar},
  title = {{Robust Inverse Framework using Knowledge-guided Self-Supervised Learning: An application to Hydrology}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2022},
  doi = {10.1145/3534678.3539448},
}
Figure