Machine Learning for Effluent Forecasting at a Full-Scale Municipal Wastewater Treatment Plant: Seasonal Performance Deterioration and the Decisive Role of Prediction Horizon
Abstract
Machine learning is widely proposed as a basis for smart wastewater treatment plant (WWTP) management, yet reported performance is rarely benchmarked against trivial alternatives. This study uses six years of monitoring from a municipal WWTP in Serbia serving 18,000 population equivalents, comprising 1017 fully measured days. Total nitrogen removal falls from 79.4% outside summer to 67.4% in June to August (p = 4 × 10−18), in five of six years, while influent load, hydraulic flow and phosphorus removal are unchanged, which points to oxygen limitation. Four model families are benchmarked against persistence and a ten-measurement rolling mean on one chronological hold-out period. Predictive skill depends decisively on forecast horizon: at one step ahead nothing beats both baselines, whereas at five steps nitrogen reaches R2 of 0.516 against 0.388 and 0.320. Chemical oxygen demand (COD) never beats a rolling mean. A random forest identifies nitrogen exceedance of 15 mg/L with an area under the curve of 0.90. Explanation of that model shows it recognises a breach already under way rather than one beginning, which sets the operating conditions for its use. Evaluating on interpolated rather than measured days raises apparent accuracy from R2 of 0.34 to 0.82.