WRO-water: A hydrology-guided multi-head attention transformer for runoff prediction and water quality early warning.
Abstract
Predicting runoff and providing water quality early warnings becomes critical for timely monitoring of water resources. In particular, it needs to be robust under varying rainfall conditions, sensor noise and catchment conditions. We propose WRO-Water system, a hydrology-guided multi-head attention Transformer with mass-balance regularization for runoff forecasting, water quality prediction and anomaly-based early warning. The hydrology-guided attention is different from the default Transformer, which only uses content-based self-attention, by making the temporal attention scores dependent on rainfall, antecedent streamflow, evapotranspiration and latent storage behavior. To prevent that hydrologically inconsistent runoff predictions are made, a catchment-scale mass-balance residual is also incorporated as soft physical regularizer during supervised learning. A multitask learning model is developed that combines hydrometeorological variables, static catchment properties and water quality indicators. Evaluation was done with catchment-level partitioning and 10-fold cross-validation to minimize spatial leakage and to test generalization of results to held-out CAMELS catchments where supporting records from USGS and NOAA exists. WRO-Water achieved an NSE of 0.892 ± 0.014, RMSE of 8.31 ± 0.42 mm day-1, MAE of 5.18 ± 0.31 mm day-1, R2 of 0.913 ± 0.013, and correlation of 0.955 ± 0.008 for runoff prediction. For water quality forecasting, the model obtained R2 values of 0.946 ± 0.010 for pH, 0.951 ± 0.009 for dissolved oxygen, 0.938 ± 0.012 for turbidity, 0.932 ± 0.013 for nitrate, and 0.958 ± 0.008 for conductivity. The anomaly detection module achieved F1-scores from 95.09 ± 0.89% to 96.51 ± 0.70%, with early warning lead times of 4.37 ± 0.32 to 5.06 ± 0.34 h. These findings indicate that WRO-Water offers a physically constrained, accurate, and interpretable tool for early warning of water quality and prediction of runoff, and WRO-Water needs to be further validated in other external hydroclimatic regions and through other external monitoring networks.