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
- Zahra Jahani Keleshteri (ORCID: https://orcid.org/0009-0001-4299-8054)
Institutions
- University of Tehran (IR)
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