This is an early access version, the complete PDF, HTML, and XML versions will be available soon.
Open AccessArticle
LSTM-Based Neural Network Controllers as Drop-In Replacements for PI Controllers in a Wastewater Treatment Plant
by
Muhammad Adil
Muhammad Adil *
and
Ramon Vilanova
Ramon Vilanova
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 () and dissolved oxygen () 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, ) and considerably reducing control errors. For instance, under storm influent conditions, the controller reduced the Integral of Squared Error () and Integral of Absolute Error () 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 controller was directly applied to additional aerated reactors ( and ) without retraining, replacing fixed aeration and demonstrating adaptability while reducing design effort. Plant-wide evaluation with the loop and three dissolved oxygen loops (–), all controlled by LSTM-based PI controllers, under storm influent conditions, showed further reductions in the Effluent Quality Index () and the Overall Cost Index () 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.
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
Article Access Statistics
For more information on the journal statistics, click
here.
Multiple requests from the same IP address are counted as one view.