Toward sustainable wastewater treatment: Transformer ensembles and multitask learning for energy consumption and quality management
Wastewater treatment plants (WWTPs) are among the most energy-intensive components of urban infrastructure and bear strict regulatory responsibilities for wastewater quality. These dual challenges, minimizing energy consumption and maintaining environmental compliance, are deeply interrelated and must be managed simultaneously to achieve sustainable plant operation. This study proposes a framework that comprises two customized components. The first component employs a voting ensemble model based on transformer architecture to predict energy consumption. It processes heterogeneous feature domains — including hydraulic, wastewater, and climatic variables — through parallel attention-driven streams. The outputs from these streams are then aggregated using a weighted voting mechanism to produce the final prediction. Second, a multitask Bidirectional Gated Recurrent Unit (Bi-GRU) forecasts wastewater quality indicators concurrently (ammonia, Biochemical Oxygen Demand (BOD), and Chemical Oxygen Demand (COD)), capturing shared temporal dependencies and reducing model complexity. A hybrid preprocessing strategy is applied, incorporating domain-aware outlier detection (z-score and Interquartile Range (IQR)), K-Nearest Neighbors (KNN) Imputation, and feature selection using Extreme Gradient Boosting (XGBoost). Experimental results showed that. The voting ensemble model achieved the best results for energy consumption prediction with 31.61 of Root Mean Squared Error (RMSE). The multitask Bi-GRU achieved the best results for wastewater quality indicators with RMSE at 6.1689, 48.0323, and 88.2214 for ammonia, BOD, and COD, respectively. This work is among the first to integrate transformer ensembles and multitask learning in a unified WWTP forecasting system. Simultaneously addressing energy efficiency and water quality assurance, this offers a practical, scalable, and intelligent decision-support tool for sustainable wastewater management.
Authors
- Michael McCann (ORCID: https://orcid.org/0000-0002-8431-2639)
- Saeed Hamood Alsamhi (ORCID: https://orcid.org/0000-0003-2857-6979)
- Sherif Mostafa (ORCID: https://orcid.org/0000-0002-2520-4005)
- Shaker El–Sappagh (ORCID: https://orcid.org/0000-0001-9705-1477)
- Marwa E. Saleh
- Niall O’Brolchain
- Hager Saleh
- Abdulaziz AlMohimeed (ORCID: https://orcid.org/0009-0005-9862-6398)
- John G. Breslin (ORCID: https://orcid.org/0000-0001-5790-050X)
Institutions
- Beni-Suef University (EG)
- Suez University (EG)
- Ollscoil na Gaillimhe – University of Galway (IE)
- Benha University (EG)
- Imam Mohammad ibn Saud Islamic University (SA)
- Korea University (JP)
- Atlantic Technological University (IE)
- Galala University
- Ibb University (YE)
- Minia University (EG)
Publication Details
- Journal
- Engineering Applications of Artificial Intelligence
- Published
- 2025-09-25
- DOI
- https://doi.org/10.1016/j.engappai.2025.112338
- Citations
- 4
- Primary Topic
- Neural Networks and Applications
- Type
- article
- Field-Weighted Citation Impact
- 9.92