Next Article in Journal
Neural ODE-Based Frequency Stability Assessment and Control of Energy Storage Systems
Previous Article in Journal
In-Season Physical and Physiological Variations in Junior Basketball: A Longitudinal Analysis
Previous Article in Special Issue
Application of Machine Learning Models in Optimizing Wastewater Treatment Processes: A Review
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Article

LSTM-Based Neural Network Controllers as Drop-In Replacements for PI Controllers in a Wastewater Treatment Plant

Advanced Systems for Automation and Control (ASAC) Group, Escola d’Enginyeria, Universitat Autònoma de Barcelona, 08193 Bellaterra, Spain
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(22), 12046; https://doi.org/10.3390/app152212046 (registering DOI)
Submission received: 22 October 2025 / Revised: 9 November 2025 / Accepted: 10 November 2025 / Published: 12 November 2025

Abstract

Wastewater Treatment Plants (WWTPs) rely on automatic control strategies to regulate pollutant concentrations and comply with environmental standards. Among them, Proportional Integral (PI) controllers are widely adopted for their simplicity and robustness, yet their effectiveness is limited by the nonlinear and time-varying dynamics of biological processes. In this work, Long Short-Term Memory (LSTM)-based Artificial Neural Network (ANN) PI controllers are proposed as data-driven replacements for conventional PIs in key WWTP feedback loops. Using the Benchmark Simulation Model No. 1 (BSM1), ANN controllers were trained to replicate the behavior of default nitrate and nitrite nitrogen (SNO,2) and dissolved oxygen (SO,5) loops, under both time-agnostic and time-aware strategies with three- and four-input configurations. The four-input time-aware model delivered the best results, reproducing PI behavior with high accuracy (coefficient of determination, R20.99) and considerably reducing control errors. For instance, under storm influent conditions, the SO,5 controller reduced the Integral of Squared Error (ISE) and Integral of Absolute Error (IAE) by 84.7% and 68.4%, respectively, compared with the default PI. Beyond loop-level improvements, a Transfer Learning (TL) extension was explored: the trained SO,5 controller was directly applied to additional aerated reactors (SO,3 and SO,4) without retraining, replacing fixed aeration and demonstrating adaptability while reducing design effort. Plant-wide evaluation with the SNO,2 loop and three dissolved oxygen loops (SO,3SO,5), all controlled by LSTM-based PI controllers, under storm influent conditions, showed further reductions in the Effluent Quality Index (EQI) and the Overall Cost Index (OCI) by 0.84% and 1.47%, respectively, highlighting simultaneous gains in effluent quality and operational economy. Additionally, the actuator and energy analyses showed that the LSTM-based controllers produced realistic and smooth control signals, maintained consistent energy use, and ensured stable overall operation, confirming the practical feasibility of the proposed approach.
Keywords: Artificial Neural Networks (ANNs); Benchmark Simulation Model No. 1 (BSM1); data-driven process control; Long Short-Term Memory (LSTM); Operational Cost Index (OCI); Proportional–Integral (PI) control; transfer learning Artificial Neural Networks (ANNs); Benchmark Simulation Model No. 1 (BSM1); data-driven process control; Long Short-Term Memory (LSTM); Operational Cost Index (OCI); Proportional–Integral (PI) control; transfer learning

Share and Cite

MDPI and ACS Style

Adil, M.; Vilanova, R. LSTM-Based Neural Network Controllers as Drop-In Replacements for PI Controllers in a Wastewater Treatment Plant. Appl. Sci. 2025, 15, 12046. https://doi.org/10.3390/app152212046

AMA Style

Adil M, Vilanova R. LSTM-Based Neural Network Controllers as Drop-In Replacements for PI Controllers in a Wastewater Treatment Plant. Applied Sciences. 2025; 15(22):12046. https://doi.org/10.3390/app152212046

Chicago/Turabian Style

Adil, Muhammad, and Ramon Vilanova. 2025. "LSTM-Based Neural Network Controllers as Drop-In Replacements for PI Controllers in a Wastewater Treatment Plant" Applied Sciences 15, no. 22: 12046. https://doi.org/10.3390/app152212046

APA Style

Adil, M., & Vilanova, R. (2025). LSTM-Based Neural Network Controllers as Drop-In Replacements for PI Controllers in a Wastewater Treatment Plant. Applied Sciences, 15(22), 12046. https://doi.org/10.3390/app152212046

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop