Explainable deep learning for multi-horizon water quality forecasting: cross-continental transferability for environmental decision support
Abstract
Forecasting river water quality is central to proactive environmental decision-making, yet skill is rarely benchmarked against simple references or evaluated across river networks that differ structurally in climate and pollution regime. Using 48 years of records from 141 stations of a Brazilian regulatory network (CETESB) and 3,782 to 6,696 European stations of the Global River Water Quality Archive, we benchmarked an attention-based long short-term memory (LSTM) network for multi-horizon forecasting against a random forest and persistence. The LSTM was more accurate for dissolved oxygen (one-step \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$R^2_{\log }$$\end{document}, the coefficient of determination on the \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\log (1+x)$$\end{document} scale, 0.659 versus 0.605, or 0.639 for a tuned random forest), but differences were small for the other nutrient and oxygen parameters. Heavily censored trace metals were reframed as classifiers of concentrations at or above time-invariant harmonized reporting limits; zinc and nickel were predicted no better than by station-specific detection frequencies, and exceedances of lead, cadmium and mercury could not be forecast usefully (PR-AUC \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\le 0.07$$\end{document}). Attention weights and Shapley-value-based attributions disagreed on the temporal allocation of importance (Spearman \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\rho =0.37$$\end{document} for dissolved oxygen). Zero-shot transfer to Europe was parameter-specific: nearly intact for nitrate (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$R^2_{\log }$$\end{document} 0.555 versus 0.598 in-domain) but a failure for dissolved oxygen (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$-0.576$$\end{document}) that neither a global offset nor removing the station embeddings (\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$-0.169$$\end{document}) fully corrected. Because dissolved oxygen was overestimated at low-oxygen European sites, an alert rule needed an additional 1.67 mg L\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$^{-1}$$\end{document} of margin to flag 90% of violations. Predictive accuracy and decision-relevant robustness are related but distinct properties of forecasting models intended for transfer across monitoring networks.