NARA Discovery
Article Details
← Back to Search Results
Journal Article

Smarter Chemical Oxygen Demand (COD) Prediction in Urban Wastewater Treatment Based on Post-Hoc Residual-Correction: A Comparative Machine Learning Analysis

Rabab Abdelfattah; Moustafa M. Zagho; Sajim Ahmed; Ahmed Sherif; Ahmad A. Imam; Mostafa H. Sliem; Ramy F. Elsalhy
Water, Air, & Soil Pollution · Vol. 237, Issue 20 · 2026

Abstract

Accurate prediction of water quality is essential for the sustainable management of water resources. The composition and concentration of pollutants in urban sewage vary significantly and are highly complex, making it challenging to control the process parameters in wastewater treatment plants (WWTPs). To meet effluent regulatory standards, increasing the input of chemicals and aeration becomes necessary, resulting in higher treatment costs and energy consumption. In this context, machine learning models (ML) have proven effective in predicting and controlling the performance of WWTPs using historical data. The dataset for this study was collected from an urban sewage WWTP in Saudi Arabia over a 17-month period, with a daily record. The main goal of this work is to present the proposed Post-Hoc Residual Correction (PHRC) framework and evaluate its performance against various ML models in predicting the effluent chemical oxygen demand (E-COD) of an urban sewage WWTP. The PHRC framework is a targeted ensemble refinement approach that aims to improve the accuracy of the best-performing base model by learning and correcting its systematic prediction errors. The mean squared error (MSE), root mean squared error (RMSE), mean absolute error (MAE), and the coefficient of determination (R $$^{2}$$ 2 ) were used to evaluate the models’ performance. The performance of PHRC framework was compared to the performance of multiple ML models, including Decision Tree, LightGBM, Random Forest (RF), XGBoost, Gradient Boosting, CatBoost, and Linear Stack. The PHRC model demonstrated the highest predictive performance for urban sewage treatment plants, achieving an $$R^2$$ R 2 of 0.9498 between observed and predicted values in the test dataset. In contrast, the other models yielded lower $$R^2$$ R 2 values: Decision Tree (0.6825), LightGBM (0.8219), Random Forest (0.8543), XGBoost (0.8892), Gradient Boosting (0.8987), CatBoost (0.9205), and Linear Stack (0.9259). Error density comparisons further emphasized the robustness of this stacked architecture in real-world applications. Overall, this study presents a suite of predictive tools suitable for industrial use in urban sewage treatment plants. Notably, our proposed PHRC model not only aligns with core wastewater chemistry but also shows potential for broader application across various sewage sources. Its strong predictive capability, achieved by learning and correcting systematic errors, offers significant practical advantages.

Bibliographic Information

JournalWater, Air, & Soil Pollution
PublisherSpringer
Publication Date2026-10-01
Publication Year2026
Volume237
Issue20
Document TypeJournal Article
Print ISSN0049-6979
eISSN1573-2932
DOI10.1007/s11270-026-09831-4

Access Information

NARA Access Coverage1971-01-01~Current
Journal Homepagehttps://www.springer.com/journal/11270
Publisher PageOpen Publisher Page
Full-text access depends on NARA's subscribed coverage and institutional access.