Explainable stacked ensemble learning with dispersion-based reliability assessment for nutrient prediction in wastewater treatment plants

Accurate prediction of nutrient concentrations in wastewater treatment plants (WWTPs) is essential for improving process control, regulatory compliance, and operational efficiency. However, the highly nonlinear and dynamic nature of biological treatment processes limits the predictive accuracy, interpretability, and reliability assessment of conventional machine learning models. To address these challenges, this study proposes an explainable stacked ensemble learning framework for predicting ammonium (T 1 _NH 4 ) and phosphate (T 1 _PO 4 ) concentrations from high-frequency supervisory control and data acquisition (SCADA) data collected at the Agtrup WWTP, Denmark. The proposed approach integrates domain-informed feature engineering, automated feature selection, heterogeneous ensemble learning (Extreme Gradient Boosting (XGBoost), Light Gradient Boosting Machine (LightGBM), Random Forest (RF), Gradient Boosting Regressor (GBR), Ridge Regression (RR), and Multilayer Perceptron (MLP)), linear stacking, SHapley Additive exPlanations (SHAP)-based model interpretation, and a dispersion-based reliability assessment that quantifies prediction disagreement among heterogeneous ensemble members. Rather than estimating probabilistic predictive uncertainty, the proposed reliability assessment identifies operating conditions where greater disagreement among base learners indicates reduced prediction confidence, thereby supporting risk-aware operational decision-making. The framework was evaluated using more than 525,000 observations under a time-aware validation strategy. The stacked ensemble consistently outperformed all individual models, achieving validation coefficient of determination (R 2 ) values of 0.930 and 0.890, root mean square error (RMSE) values of 0.358 and 0.193 mg/L, and mean absolute error (MAE) values of 0.226 and 0.119 mg/L for T1_NH 4 and T1_PO 4 , respectively. Residual diagnostics confirmed stable predictive behavior across the evaluated operating conditions, while SHAP analysis identified maximum control factor (MAX_CF), inlet process phase indicator (PROCESSPHASE_INLET), and metal dosing-related variables as the most influential predictors. The proposed framework provides an interpretable and reliable data-driven approach for nutrient prediction and offers practical decision support for monitoring and optimizing wastewater treatment plant operations.

Authors

Institutions

Publication Details

Journal
Environmental Management Engineering and Technology
Published
2026-10-27
DOI
https://doi.org/10.1016/j.jemet.2026.100015
Primary Topic
Water Quality Monitoring and Analysis
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Explainable stacked ensemble learning with dispersion-based reliability assessment for nutrient prediction in wastewater treatment plants

Zahra Jahani Keleshteri
Environmental Management Engineering and Technology
Water Quality Monitoring and Analysis
article

Explainable stacked ensemble learning with dispersion-based reliability assessment for nutrient prediction in wastewater treatment plants

Zahra Jahani Keleshteri
article en

Abstract

Accurate prediction of nutrient concentrations in wastewater treatment plants (WWTPs) is essential for improving process control, regulatory compliance, and operational efficiency. However, the highly nonlinear and dynamic nature of biological treatment processes limits the predictive accuracy, interpretability, and reliability assessment of conventional machine learning models. To address these challenges, this study proposes an explainable stacked ensemble learning framework for predicting ammonium (T 1 _NH 4 ) and phosphate (T 1 _PO 4 ) concentrations from high-frequency supervisory control and data acquisition (SCADA) data collected at the Agtrup WWTP, Denmark. The proposed approach integrates domain-informed feature engineering, automated feature selection, heterogeneous ensemble learning (Extreme Gradient Boosting (XGBoost), Light Gradient Boosting Machine (LightGBM), Random Forest (RF), Gradient Boosting Regressor (GBR), Ridge Regression (RR), and Multilayer Perceptron (MLP)), linear stacking, SHapley Additive exPlanations (SHAP)-based model interpretation, and a dispersion-based reliability assessment that quantifies prediction disagreement among heterogeneous ensemble members. Rather than estimating probabilistic predictive uncertainty, the proposed reliability assessment identifies operating conditions where greater disagreement among base learners indicates reduced prediction confidence, thereby supporting risk-aware operational decision-making. The framework was evaluated using more than 525,000 observations under a time-aware validation strategy. The stacked ensemble consistently outperformed all individual models, achieving validation coefficient of determination (R 2 ) values of 0.930 and 0.890, root mean square error (RMSE) values of 0.358 and 0.193 mg/L, and mean absolute error (MAE) values of 0.226 and 0.119 mg/L for T1_NH 4 and T1_PO 4 , respectively. Residual diagnostics confirmed stable predictive behavior across the evaluated operating conditions, while SHAP analysis identified maximum control factor (MAX_CF), inlet process phase indicator (PROCESSPHASE_INLET), and metal dosing-related variables as the most influential predictors. The proposed framework provides an interpretable and reliable data-driven approach for nutrient prediction and offers practical decision support for monitoring and optimizing wastewater treatment plant operations.

Environmental Management Engineering and TechnologyVol. 1(4)
University of Tehran (IR)
Clean water and sanitation, Responsible consumption and production
Openalex Percentile: Top 10%
Water Quality Monitoring and Analysis
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon