Title : From sewage to sustainability: Machine learning based predictive modelling of biogas production in energy-positive wastewater treatment plants
Abstract:
As demand for cleaner energy grows, wastewater-derived biogas provides cities with a scalable and affordable solution for sustainable energy. By turning waste into a useful resource, biogas serves as an environmentally friendly substitute for fossil fuels in multiple applications, such as electricity production or vehicle fuel, while supporting the circular economy.
Wastewater treatment (WWT) plants require significant amounts of energy and are characterized by complex, nonlinear, and time-varying behaviour of biological and physicochemical processes. At a global scale, WWT energy consumption faces challenges in accurate quantification. Moreover, conventional proportional–integral–derivative (PID) control systems, while historically reliable, struggle to cope with fluctuating influent characteristics, seasonal variability, operational disturbances, and multivariable process interactions. These limitations directly affect treatment performance, energy efficiency, and regulatory compliance. Concurrently, the ongoing digitalization of WWT infrastructure, along with the integration of advanced technologies such as IoT devices, AI, and digital twins, is reshaping the water sector by improving monitoring, management, and decision-making transparency.
In this context, the present research article, developed within the PAID-06-25 project funded by the Vice-Rectorate for Research of the Universitat Politècnica de València (Spain), delves into the design and implementation of a machine learning–based tool to predict and model biogas production in energy-positive wastewater treatment plants. In line with this, WWTP energy demand has been characterized by evaluating emerging energy valorization techniques from waste and exploring the role of demand flexibility for the deployment of energy-positive wastewater treatment plants. Limitations and opportunities of the existing data-driven energy models for WWT have been identified, and their suitability for capturing nonlinear relationships, identifying hidden patterns, and learning system dynamics from historical and real-time data has been assessed.
A comprehensive modeling framework to disaggregate the energy demand of WWTPs by processes and end uses has been implemented using hybrid modeling approaches that combine mechanistic process knowledge with data-driven learning. This enhances model interpretability and robustness while promoting the transition of WWTPs toward energy-positive infrastructures aligned with circular economy principles. Finally, the ML-predictive model has been validated using real operational data from wastewater treatment facilities located in Spain, evaluating different operational scenarios, including energy recovery from waste and strategies for exploiting electricity demand flexibility.
Results show the effectiveness of ML applications for forecasting influent loads, predicting efluent quality, optimizing aeration, reducing energy consumption, and enabling predictive maintenance. By adopting innovative strategies and utilizing emerging technologies, wastewater utilities can effectively exploit biogas production and reframe wastewater sludge as a valuable resource while improving energy efficiency, enhancing operational reliability, and supporting decision-making in WWTPs.

