Abstract
Recent advances in differentiable modeling, a genre of physics-informed machine learning that trains neural networks (NNs) together with process-based equations, has shown promise in enhancing hydrologic models' accuracy, interpretability, and knowledge-discovery potential. Current differentiable models are efficient for NN-based parameter regionalization, but the simple explicit numerical schemes paired with sequential calculations (operator splitting) can incur large numerical errors whose impacts on models' representation power and learned parameters are not clear. Implicit schemes, however, cannot rely on automatic differentiation to calculate gradients due to potential issues of gradient vanishing and memory demand. Here we propose a "discretize-then-optimize" adjoint method to enable differentiable implicit numerical schemes for the first time for large-scale hydrologic modeling. The adjoint model demonstrates comprehensively improved performance, with Kling-Gupta efficiency coefficients, peak-flow and low-flow metrics, and evapotranspiration that moderately surpass the already-competitive explicit model. Therefore, the previous sequential-calculation approach had a detrimental impact on the model's ability to represent hydrologic dynamics. Furthermore, with a structural update that describes capillary rise, the adjoint model can better describe baseflow in arid regions and also produce low and peak flows that outperform even pure machine learning methods such as long short-term memory networks. The adjoint model rectified some parameter distortions but did not alter spatial parameter distributions, demonstrating the robustness of regionalized parameterization. Despite higher computational expenses and modest improvements, the adjoint model's success removes the barrier for complex implicit schemes to enrich differentiable modeling in hydrology.
Introduction: The Conflict of Flexibility and Rigor
Environmental modeling has long faced a fundamental trade-off: the flexible, data-driven power of machine learning versus the rigorous, interpretable accuracy of numerical physics. Differentiable Modeling (DM) has emerged as a promising middle ground, where neural networks (NNs) are trained in tandem with physical equations. In these setups, the NN typically estimates physical parameters—such as soil permeability—across diverse regions, while the physical equations ensure the model adheres to fundamental laws like the conservation of mass.
However, a significant hurdle remains. Most current DMs rely on explicit numerical schemes (e.g., the simple Euler method) because they are easily integrated with standard Automatic Differentiation (AD) tools like PyTorch or TensorFlow. Unfortunately, these simple schemes introduce "numerical demons"—errors that accumulate over time. To compensate, neural networks often learn "distorted" parameters that lack physical meaning just to minimize the error between predictions and observations.
Methodology: Exorcising Numerical Demons
To address these limitations, this research introduces a "discretize-then-optimize" adjoint method. This approach allows differentiable hydrologic models to utilize complex implicit numerical schemes for the first time. Unlike explicit schemes, implicit schemes are highly stable and accurate but require iterative solvers (like Newton-Raphson), which are notoriously difficult to differentiate using standard AD due to memory demands and "vanishing gradients."
The proposed adjoint method bypasses these issues by solving the physical equations to convergence first and then solving a separate, efficient "adjoint equation" to calculate gradients. The researchers implemented this in $\delta$HBV.adj, a differentiable version of the HBV (Hydrologiska Byråns Vattenbalansavdelning) model. This model was further enhanced with a "capillary rise" module to better represent upward water movement in arid regions.
Experimental Setup and Datasets
The study was conducted using the CAMELS (Catchment Attributes and Meteorology for Large-sample Studies) dataset, covering 671 basins across the contiguous United States (CONUS). The models were trained on 15 years of data (1980–1995) and tested on a subsequent 15-year period (1995–2010). Beyond streamflow, the models were validated against independent MODIS evapotranspiration data and the Baseflow Index (BFI) to ensure the internal physical processes were accurately represented.
Key Insights: Beyond the Machine Learning Ceiling
The transition from explicit to implicit schemes revealed that numerical choices are, in effect, physical assumptions. Explicit models often create an artificial "competition" for water based on the order of flux calculations. Implicit schemes solve these simultaneously, removing this bias and rectifying parameter distortions. For instance, the implicit model corrected the "wilting point" parameter, which the explicit model had been underestimating to mask numerical leaks.
One of the most significant findings is the challenge to the "performance ceiling" of pure machine learning. It has often been assumed that Long Short-Term Memory (LSTM) networks represent the upper limit of hydrologic prediction accuracy. However, this study demonstrates that a numerically rigorous, physics-informed model can actually surpass LSTMs in predicting high-impact events like peak flows.
Results and Performance
The adjoint model ($\delta$HBV.adj) demonstrated superior performance across multiple metrics:
- Overall Efficiency: Achieved a median Kling-Gupta Efficiency (KGE) of 0.75, compared to 0.73 for the explicit version.
- Peak Flow: The adjoint model (with structural updates) achieved a peak-flow RMSE of 2.47 mm/day, outperforming the pure LSTM's 2.56 mm/day.
- Baseflow Index: Spatial correlation improved significantly (0.83 vs. 0.76), indicating a better grasp of slow-cycle water dynamics.
- Internal Consistency: Improved correlation with MODIS data suggests the model is achieving results for the correct physical reasons.
Conclusion and Future Directions
While the adjoint implicit model is 5 to 10 times more computationally expensive than its explicit counterpart, its success removes a major barrier to using complex numerical schemes in differentiable modeling. The researchers suggest a hybrid workflow: using cheaper explicit models for initial exploration and hyperparameter tuning, followed by the adjoint model for final refinement.
Despite the added complexity, the robustness of regionalized parameterization remains intact—spatial parameter patterns were consistent across models. This work paves the way for more sophisticated physical representations in the next generation of hydrologic models.
Summary updated