Next Article in Journal
Bacterioplankton Community Structure and Its Relationship with Environmental Factors in the Coastal Waters Around the Changli Gold Coast National Nature Reserve in Northern China
Previous Article in Journal
Evaluation of the Artificial Neural Networks—Dynamic Infrared Rain Rate near Real-Time (PDIR-Now) Satellite’s Ability to Monitor Annual Maximum Daily Precipitation in Mainland China
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Applying Machine Learning Approach to Design Operational Control Strategies for a Wastewater Treatment Plant in Typical Scenarios

1
School of Environmental and Municipal Engineering, Qingdao University of Technology, Qingdao 266033, China
2
Qingdao West Coast Public Utilities Group Co., Ltd., Qingdao 266555, China
3
School of Information and Control Engineering, Qingdao University of Technology, Qingdao 266033, China
*
Author to whom correspondence should be addressed.
Water 2025, 17(3), 310; https://doi.org/10.3390/w17030310
Submission received: 2 January 2025 / Revised: 20 January 2025 / Accepted: 21 January 2025 / Published: 23 January 2025

Abstract

:
When confronted with different influent conditions, WWTPs often lack targeted and effective operational control strategies. For the three typical scenarios of low C/N, low water temperature and high water temperature, 441 carbon source dosage and DO concentration coordination control strategies were designed under the premise of ensuring the effluent water quality meets the standard. The purpose was to provide clear operational guidance for the efficient operation of WWTPs in different scenarios. To determine the optimal strategy, the effluent quality prediction model based on LSTM and GRU was constructed for testing. The results showed that: (1) the LSTM-GRU model is better than SVR and RF in predicting effluent COD and TN; (2) In the low C/N scenario, the carbon source dosage should be controlled between 0.23 t/h and 0.26 t/h, with the DO concentration ranging from 2.0 mg/L to 2.6 mg/L; (3) In the low water temperature scenario, the carbon source dosage should be controlled between 0.25 t/h and 0.27 t/h, with the DO concentration ranging from 2.6 mg/L to 2.8 mg/L; (4) In the high water temperature scenario, the carbon source dosage should be controlled between 0.20 t/h and 0.27 t/h, with the DO concentration ranging from 2.0 mg/L to 2.5 mg/L.

1. Introduction

Water pollution has continually been a major risk and challenge facing the world. With advancements in water treatment technology, the processes involved have become increasingly intricate. The urban wastewater treatment system represents a complex and highly nonlinear industrial control process, characterized by time delays and time-varying attributes [1]. At present, most WWTPs still rely on extensive management models. These are mainly based on manual experience and traditional process parameters. For example, the staff judges the amount of carbon sources to be added based on their experience. However, this method may not be accurate enough and has lags, because changes in water quality and quantity can lead to changes in the amount of carbon sources required. In addition, traditional monitoring methods are time-consuming. Moreover, test results are easily affected by environmental factors. Consequently, it becomes difficult for WWTPs to predict changes in water quality parameters and concentrations in advance, and to implement corresponding controls [2,3]. Especially in typical scenarios, such as low C/N (such as C/N = 3) [4,5], low water temperatures, and rainstorms, challenges arise for WWTPs. The extensive regulation mode, lacking a scientific operation strategy, exacerbates these challenges [6]. It not only increases the risk of discharging substandard effluent but also leads to low efficiency and high treatment costs. Thus, there is an urgent need to develop operational control strategies tailored to these typical scenarios.
Research on the operational control strategies of WWTPs is based on the premise that COD and TN effluent meet the standard. Therefore, achieving accurate and real-time prediction of effluent quality is crucial for advancing research on WWTPs’ operational control strategies. Mechanism models have been widely used in the simulation of wastewater treatment processes under different operational schemes [4]. However, the application of these models is often complex, involving intricate mathematical formulas and cumbersome operations to describe the treatment process and design parameters [7]. In the water treatment industry, promoting the informatization and intelligent construction of wastewater treatment has become the focus topic of many experts and researchers. In recent years, a variety of machine learning algorithms have been widely used in water quality prediction, including SVM [8,9], RF [10], FNN [11], CNN [12], LSTM [13], and GRU. These algorithms have stronger non-linear relationship expression ability, which can learn the complex dynamic changes in the wastewater treatment process and achieve accurate prediction of the wastewater treatment effect. At the same time, they are driven by data and can extract key features from large datasets. They can reflect the interaction relationship between various factors in the sewage treatment process and provide a scientific basis for the formulation of operational strategies.
To realize the scientific operation and control of WWTPs, this study established the stacked LSTM-GRU model to predict the effluent quality of the WWTP, and realized the accurate prediction of the effluent COD and TN. With the help of the LSTM-GRU model, the carbon source dosage and DO concentration in the three typical scenarios of low C/N, low water temperature, and high water temperature are coordinated to develop a quantitative and scientific operation strategy. The main contributions of this study are as follows:
  • Constructing an effluent quality prediction model for WWTPs applying LSTM-GRU;
  • Achieving synergistic regulation of carbon source dosage and DO concentration in three typical operational scenarios;
  • Providing a scientific basis for regulating operational parameters of WWTPs in typical scenarios.

2. Related Works

Low C/N is one of the typical scenarios of WWTPs. When treating wastewater with low C/N, denitrification becomes difficult due to the lack of carbon sources [14]. Usually, measures such as increasing carbon source dosage, increasing aeration rate, and adding chemicals are taken to ensure denitrification efficiency. These additional measures not only increase the operation cost but also may have a negative impact on the subsequent treatment process. Therefore, how to optimize the operation parameters and reduce the cost under the premise of ensuring the treatment effect has become an important research topic. Secondly, the ambient temperature, as an unalterable external factor, also has an important impact on the effect of wastewater treatment. Significant differences in microbial metabolic rates under different water temperatures lead to changes in treatment effects [15]. Different operational control strategies are needed for different water temperature conditions. However, improper operational control strategies will lead to an increase in operating costs. Therefore, it is particularly important to carry out strategic research on WWTPs in different typical scenarios to achieve more targeted regulation. At present, the main parameters for the operational control of the WWTP are DO [16,17] and the carbon source dosage. These two control parameters not only directly affect the treatment effect but also affect the cost of WWTP. DO concentration directly affects the activity of aerobic microorganisms, and then affects the removal efficiency of organic matter and ammonia nitrogen. The external carbon source [18], such as methanol and sodium acetate, is the key factor to promote the denitrification process, which helps to improve the TN removal efficiency. Therefore, reasonable control of carbon source dosage and DO concentration is very important to ensure the treatment effect and reduce energy consumption.
The water quality prediction technology can realize the early warning of water quality and ensure that the effluent of the wastewater treatment system meets the standard. It can also optimize the processing flow and operation parameters for engineers or intelligent control systems [19]. In the current research field of water quality prediction, there are mainly two types of models: mechanism prediction model [20,21] and data-driven prediction model [22]. Although the mechanism model can reveal the internal mechanism of water quality change in theory, its practical application faces many challenges [23], such as complex parameter calibration, high calculation cost and poor adaptability to complex working conditions. The data-driven prediction model shows significant advantages in practical applications. The wastewater treatment process is nonlinear, complex and multi-factor coupling [24]. Machine learning algorithms, especially SVM, RF, and extreme learning machine models [25], can capture these nonlinear relationships in a large amount of operation data and water quality data, and effectively predict the water quality data at a certain time in the future. Based on the prediction results, the operation management personnel can timely adjust the operation parameters, such as carbon source dosage and aeration rate, to cope with the changes of different working conditions. Wang et al. [26] used RF model, XGBoost model and LightGBN model to predict total suspended solids and Total Phosphorus (TP) in the effluent from WWTP in Sweden. LSTM model can capture the long-term dependence in time series data and is widely used in water quality prediction [27]. Meng et al. [28] designed an improved LSTM-OBE algorithm, which combines the minimum trace optimal boundary ellipsoid algorithm with LSTM to predict the effluent biochemical oxygen demand. The results show that the MAE and RMSE of LSTM-OBE algorithm are 0.06 and 0.07, which are lower than other machine learning models. As a simplified version of the LSTM model, the GRU [29] model is widely used in many fields, such as speech recognition [30], time series prediction [31,32], and so on, due to its simple structure, fewer parameters, superior performance and other characteristics.
Based on a review of relevant studies, two key research gaps have been identified. First, operational control in WWTPs primarily relies on manual experience, lacking scientifically grounded and detailed strategies. This limitation becomes particularly evident under conditions of low influent C/N and extreme water temperatures. In the context of carbon peaking and carbon neutrality goals, the current control methods struggle to meet these objectives. Second, while most research focuses on developing predictive models using various machine learning techniques, studies on the practical application of these models remain insufficient. There is a lack of research integrating predictive models with real-world control challenges in the daily operation of WWTPs.
The key novelty statements of this study are as follows. First, a deep learning-based effluent quality prediction model is established and validated. The proposed stacked LSTM-GRU model effectively processes time-series monitoring data from a WWTP in Rizhao City, accurately predicting effluent COD and TN concentrations in a timely manner. Additionally, the prediction model is applied to determine optimal operational control strategies, including carbon source dosage and DO concentration, under low C/N, low water temperature, and high water temperature scenarios. The primary objective is to develop scientifically sound and practical control strategies that ensure compliance with discharge standards while minimizing operating costs.

3. Materials and Methods

3.1. Data Collection and Preprocessing

This study takes a WWTP in Rizhao as the study object. It is located in the urban area of Rizhao and mainly collects residential wastewater from neighboring towns. The WWTP is divided into two phases, with a total design scale of 50,000 m3/d. It adopts the improved Anaerobic-Anoxic-Oxic nitrogen and phosphorus removal process, and the treatment diagram of the treatment processes is shown in Figure 1. After treatment, the wastewater is discharged into the nearby rivers. The final effluent COD concentration and TN concentration are subject to the standards of COD ≤ 50 mg/L and TN ≤ 15 mg/L, respectively. The wastewater treatment process uses sodium acetate (Shijiazhuang Haoshengkai Environmental Tech Co., Ltd., Shijiazhuang, China) as an additional carbon source and uses maglev blowers (ESURGING (Tianjin) Technology Co., Ltd., Tianjin, China) to provide oxygen to the aeration tank. In China, high MLSS concentrations are a widespread and common phenomenon in WWTPs. This is primarily driven by the increasing effluent quality requirements, particularly for low C/N influents, where achieving low effluent TN concentrations remains a significant challenge. To enhance nitrogen removal efficiency, most WWTPs maintain high MLSS concentrations in aeration tanks by adopting a high internal recirculation ratio. However, this practice can lead to potential sludge washout issues due to the elevated MLSS levels. To address these issues, advanced treatment units are typically implemented. These units mainly rely on the addition of coagulants and flocculants to further improve effluent quality.
The WWTP has more than 800 data points and more than 30 core equipment and instruments. Based on the internet of things technology, the collected data is transmitted to the cloud server through the data transmission unit. In this study, nine indicators set as input variables of the prediction model, including the influent flow, influent COD concentration, influent TN concentration, influent NH3-N concentration, influent TP concentration, MLSS concentration, NO3-N concentration, DO concentration and carbon source dosage, as shown in Table 1. These nine indicators affect the effluent quality and wastewater treatment costs, and the detailed reason is as follows. The size of the influent indicators will directly affect the processing capacity and efficiency of the treatment facility. For example, the influent COD concentration will affect the removal effect of organic matter. The size of the process indicators reflects the running status and processing effect of the treatment facility. Process control indicators, such as DO, can reflect the chemical and biological reaction status during the treatment process. Effluent COD and TN concentration are the output variables of the prediction model, as these two indicators are the prior management indicators for natural water bodies. This study collected the relevant data of the WWTP from October 2020 to September 2023, and the data recording interval was one hour.
Data preprocessing includes data cleaning, filling in null and abnormal values, data normalization, and dataset splitting. In this study, abnormal values are identified by using box plot. The mean difference method is used to fill in null and abnormal values; that is, the average value in the dataset is used as a substitute for the abnormal or missing value to interpolate it. The min-max normalization method [33] was used to normalize the data; the calculation equation is as follows:
x i = x x min x max x min
where x i is the normalized value of the characteristic variable, x is the original value before normalized, x min is the minimum value of the dataset being normalized, and x max is the maximum value of the dataset being normalized.
There are 26,136 samples after preprocessing. The dataset is divided into three parts by random sampling in proportion, which are training set, validation set, and test set, and the proportion is 8:1:1. The data preprocessing process is shown in Figure 2.

3.2. Typical Scenarios Settings

Based on the historical data of the WWTP in 2021, this study selects three typical scenarios of the WWTP: low C/N, high water temperature and low water temperature. The main cause of low C/N is the decrease in influent COD, while the overall influent TN concentration remains stable. This study sets the influent C/N to 3, the influent TN concentration to the 2021 average of 36.7 mg/L, and the influent COD concentration to 110 mg/L. Other model input indicators are taken as the 2021 annual average, as shown in Table 2. For the scenario of low water temperature, this study takes the operating indicators of the WWTP from January to March 2021 and uses the corresponding average value as the preset input data for this scenario. For the scenario of high water temperatures, this study takes the operating indicators of the WWTP from July to September 2021 and uses the corresponding average value as the preset input data for this scenario.
Maintain the inflow operation indicators and process indicators for three typical scenarios unchanged, and set process control indicators such as carbon source dosage and DO concentration. The carbon source dosage of the WWTP in 2021 is between 0.25~0.38 t/h, and the DO concentration is between 2.5~4.0 mg/L. Based on the characteristics of the operating parameters and historical data of the WWTP, the data range of carbon source dosage is set to 0.2~0.4 t/h, and the control step is set to 0.01 t/h. The data range for DO concentration in the aerobic tank is set at 2.0~4.0 mg/L, with a control step size of 0.1 mg/L. Arrange and combine 21 sets of carbon source dosage and 21 sets of DO concentration regulation schemes to form 441 different regulation schemes. The specific control schemes for carbon source dosage and DO content are shown in Table 3. In the constructed LSTM-GRU model, the two are synergistically regulated to simulate the effluent COD and TN concentrations corresponding to different operational control strategies.

3.3. Model Construction

LSTM neural network is a RNN model which is often used to process sequential data. Its core idea is to selectively forget or update information through the control of the door in the process of transmitting information. Compared with traditional RNN, LSTM introduces three gating units—forget gate, input gate, output gate—and a memory cell [34], which can better capture and process long-term dependent data. The structure of neurons is shown in Figure 3a.
GRU neural network is a variant of RNN. Compared with traditional RNN, GRU introduces two gating units—update gate and reset gate—which can better capture and process long-term dependent data. The structure of neurons is shown in Figure 3b. The gating mechanism of GRU is relatively simple, which makes GRU faster in training and easier to avoid overfitting.
LSTM neural network has more “gates” than GRU neural network, and the structural parameters of GRU neural network are fewer than LSTM, so the combination of LSTM and GRU can achieve powerful learning ability with fewer network parameters [35]. To accurately predict the effluent COD concentration and TN concentration of the WWTP, a water quality prediction model based on LSTM-GRU neural network is constructed in this study. The model includes input layer, output layer and hidden layer. The hidden layer of the model consists of multiple LSTM and GRU units. The ability of the model to analyze data is mainly related to the number of hidden layers. According to the complexity of the WWTP dataset, this study sets the hidden layer of the model as four layers, and the first two layers are LSTM layer, which can better deal with the long sequence relationship of the model; the latter two layers are GRU layer, which reduces the calculation amount of the model to a certain extent and improves the efficiency of the model. The system architecture of water quality prediction model based on LSTM-GRU neural network is shown in Figure 4. In this study, Python (3.13.1) language is used for algorithm programming and TensorFlow (2.18.0) deep learning framework is used for model construction. The operating system is Ubuntu 20.04 LTS and the device model is Dell Precision 7920 Tower.
HRT affects the overall efficiency of the wastewater treatment system and usually does not change significantly. When building the water quality prediction model, it is necessary to match the residence time of the WWTP with the time step of the model to ensure that the model can accurately reflect the changes of the effluent quality. The residence time of the WWTP is mainly spent in the secondary treatment biological reaction tank and secondary sedimentation tank. According to historical data in Table 4, the residence time of the biological reaction tank of the WWTP is 15.68 h, 0.83 h in the selection area, 1.65 h in the anaerobic area, 4.4 h in the anoxic area and 8.8 h in the aerobic area. The secondary sedimentation tank is radial flow type with a residence time of 3.5 h. The residence time of high-density sedimentation tank is 0.7 h. The primary treatment process is mainly physical reaction, and its residence time is short, so it is ignored. Finally, the actual HRT of the WWTP is 19.88 h. After rounding up, the time step of the effluent quality prediction model is set to 20, that is, the output data of the next time is predicted through the input data of the previous 20 h.

3.4. Evaluation Metrics

To verify the superiority of the constructed LSTM-GRU water quality prediction model, this study selects the commonly used Support Vector Regression (SVR) model and RF model for comparative analysis. The SVR model is an extension of the linear regression model, which can be used to solve nonlinear regression problems. The RF model is based on statistical principles, which can process high-dimensional data without feature selection. To evaluate the performance of the model, three performance evaluation indexes are selected, which are RMSE, MAE, and MAPE [36].
RMSE = 1 N t = 1 N y t Y t 2
MAE = 1 N t = 1 N y t Y t
MAPE = 100 % N t = 1 N y t Y t y t
where, y t represents the actual value of the sample, Y t is the predicted value, and N is the total number of samples.

4. Results and Discussion

4.1. Modeling Results

(a)
Model Validation
This study validated the accuracy and effectiveness of the stacked LSTM-GRU model by comparing it with SVR and RF models. From Table 5, it can be seen that for the prediction of effluent COD concentration, the RMSE values of SVR, RF, and stacked LSTM-GRU models are 3.311, 2.466 and 1.988, respectively. The RMSE of the stacked LSTM-GRU increased by 39.96% compared to SVR and 19.38% compared to RF. For a prediction of effluent TN concentration, the RMSE of SVR, RF, and stacked LSTM-GRU are 1.327, 1.144 and 0.698, respectively. The RMSE of the LSTM-GRU increased by 47.40% compared to SVR and 38.99% compared to RF. For the better evaluation of the fitting degree of each model, this study calculated the MAPE of each model. For the prediction of effluent COD concentration, the MAPE values of SVR, RF, and stacked LSTM-GRU models are 16.87%, 15.96% and 13.07%, respectively. For the prediction of effluent TN concentration, the MAPE values of SVR, RF, and LSTM-GRU models are 9.67%, 7.73% and 5.60%, respectively. Table 5 shows that the stacked LSTM-GRU model outperforms the SVR and RF models. The conclusions of this study are similar to those of related research [19,37], demonstrating the successful applicability of ML in predicting the effluent quality of WWTPs.
The results of the SVR model indicate that the wastewater system of the WWTP is relatively complex and not a simple linear correlation. The prediction performance of the random forest model has a significant improvement compared to the SVR model. This indicates that statistical prediction models are better than linear regression models in predicting effluent quality. Compared to SVR and RF, the stacked LSTM-GRU model has shown good performance in predicting effluent COD concentration and effluent TN concentration. As a variant of recurrent neural networks, the stacked LSTM-GRU model effectively solves the problem of gradient vanishing caused by long-term dependencies, resulting in better performance in model prediction results.
(b)
Model Testing
To further test the model performance of the effluent quality prediction model, this study applies the LSTM-GRU water quality prediction model to the test set. The result is shown in Figure 5. It can be seen that the actual values and predicted values of effluent COD and effluent TN demonstrate good agreement. This indicates that the prediction model can capture and reflect the change of effluent quality and has high accuracy. Moreover, the predicted value keeps the same fluctuation trend as the actual value. Specifically, when the actual value of effluent COD shows a fluctuating upward trend, the predicted value also shows a similar upward trend in this period, and the rising range is close to the actual value. This shows that the prediction model can better capture the change trend of effluent COD. Some data points in the effluent COD prediction results showed high predicted values, but the overall performance of the model was good.

4.2. Scenario Analysis

The corresponding values of low C/N, low water temperature and high water temperature scenarios were input into the stacked LSTM-GRU prediction model to analyze the corresponding effluent effects. The simulation results of effluent COD and effluent TN concentrations under different operational control strategies for the three typical scenarios are shown in Figure 6.
According to Figure 6a,b, in the low C/N scenario, the effluent COD concentration is greatly affected by the carbon source. The highest effluent COD concentration is 15.59 mg/L, corresponding to carbon source dosage and DO concentration of 0.34 t/h and 3.3 mg/L, respectively. With the increase of carbon source dosing, effluent COD concentration shows a trend of first increasing and then decreasing. When the carbon source dosage is between 0.26 and 0.38, with the increase of DO concentration, the effluent COD concentration shows a trend of first increasing and then decreasing. The highest effluent TN concentration is 9.41 mg/L, corresponding to 0.20 t/h of carbon source dosage and 4.0 mg/L of DO concentration. As the carbon source dosage increases, the effluent TN gradually decreases, especially when the DO concentration is greater than 2.8 mg/L. With the increase of DO concentration, the effluent TN concentration changes little. The original set values of the two control indicators in this scenario are 0.29 t/h and 3.2 mg/L, respectively, corresponding to high effluent quality. According to Figure 6, the carbon source dosage can be controlled at 0.23~0.26 t/h. There is room for further reduction in DO concentration, which can be maintained within the range of 2.0~2.6 mg/L.
In the low water temperature scenario, the highest effluent COD concentration is 14.64 mg/L, corresponding to carbon source and DO of 0.20 t/h and 4.0 mg/L, respectively. The highest effluent TN concentration is 10.55 mg/L, corresponding to carbon source dosage and DO of 0.28 t/h and 2.0 mg/L, respectively. Individually, as the carbon source dosage increases, the effluent COD shows two different trends. When the DO concentration is below 2.8 mg/L, the effluent COD concentration increases with the increase of carbon source dosage. When the DO concentration is higher than 2.8 mg/L, the effluent COD concentration decreases with the increase of carbon source dosage. The effluent TN gradually decreases with the increase of carbon source dosage. And in some areas, it shows a trend of first increasing and then decreasing. As the DO concentration increases, the effluent COD shows an upward trend when the carbon source dosage is below 0.27 t/h, and a downward trend when it is above 0.27 t/h. The effluent TN is bounded by a carbon source dosage of 0.30 t/h, with a decreasing trend followed by an increasing trend below 0.30 t/h and a decreasing trend above 0.30 t/h. In the low water temperature scenario, the original set values of the two variables are 0.32 t/h and 3.0 mg/L, respectively. For this scenario, as the carbon source dosage and DO concentration decrease simultaneously, the effluent COD and TN both show a decreasing trend. Therefore, according to Figure 6, the DO concentration can be maintained at 2.6~2.8 mg/L, and the carbon source dosage can be controlled at 0.25~0.27 t/h.
According to Figure 6e,f, in the high water temperature scenario, the highest effluent COD concentration is 17.70 mg/L. At this time, the corresponding carbon source dosage and DO are 0.4 t/h and 2.0 mg/L, respectively. Similarly, the highest effluent TN concentration is 9.73 mg/L, and the corresponding carbon source dosage and DO are 0.32 t/h and 2.0 mg/L, respectively. Observing the trends, as the carbon source dosage increases, the overall effluent COD concentration shows an upward trend. Conversely, with the increase of DO concentration, the overall effluent COD concentration shows a downward trend. Meanwhile, both an increase in carbon source dosage and an increase in DO concentration result in a downward trend in the overall effluent TN concentration. Initially, the set values for these two variables are 0.29 t/h for carbon source dosage and 3.5 mg/L for DO. While it is true that increasing these control variables can lead to varying degrees of reduction in effluent COD and TN concentrations, it also results in higher drug and energy consumption costs. Therefore, it is suggested to control the carbon source dosage at 0.20~0.27 t/h and the DO concentration at 2.0~2.5 mg/L.

5. Conclusions

To ensure stable treatment efficiency, wastewater treatment plants (WWTPs) must maintain consistent performance, particularly under conditions of influent quality fluctuations and environmental changes. This study proposes operational control strategies for three typical scenarios: low C/N, low water temperature, and high water temperature. These strategies are developed based on the stacked LSTM-GRU prediction model, which was validated using monitoring data from a WWTP in Rizhao City. The optimal control strategies for carbon source dosage and DO concentration were identified. The key findings are as follows:
(1)
The LSTM-GRU model accurately predicts effluent COD and TN concentrations. Compared to the SVR and RF models, it demonstrates superior predictive performance, with lower RMSE values of 1.988 and 0.698, respectively;
(2)
Based on the LSTM-GRU model, optimal control strategies for carbon source dosage and DO concentration under the three scenarios were determined, as summarized in Table 6.
The water quality prediction model constructed in this study has only been verified in a WWTP so far. The water quality characteristics, treatment processes, and operating conditions of different WWTPs may vary, and these factors may affect the predictive performance of the model. With the continuous improvement of computing power and technological breakthroughs, in the future, the strong nonlinear capability of machine learning could provide more opportunities to solve the simulation, optimization, and control problems of wastewater treatment processes. For instance, applying machine learning methodology in predicting free nitrous acid and nitrogen removal rate of anammox processes.

Author Contributions

Conceptualization, H.L., H.J. and C.L.; methodology, H.L. and S.M.; validation, X.G. and H.S.; analysis, H.L. and X.L.; data curation, X.G., H.J. and H.S.; writing—original draft preparation, H.L.; writing—review and editing, H.L., X.L. and H.J. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data that support the findings of this study are available on request from the corresponding author [S.M.].

Conflicts of Interest

Author Hao Jiang was employed by Qingdao West Coast Public Utilities Group Co., Ltd. All authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
CNNConvolutional Neural Network
CODChemical Oxygen Demand
DODissolved Oxygen
XGBoosteXtreme Gradient Boosting
FNNFuzzy Neural Network
GRUGated Recurrent Unit
HRTHydraulic Retention Time
LightGBNLight Gradient Boosting Machine
Low C/NLow Carbon to Nitrogen Ratio
LSTMLong Short-Term Memory
MAEMean Absolute Error
MAPEMean Absolute Percentage Error
MLSSMixed Liquor Suspended Solid
NH3-NAmmonia Nitrogen
NO3-NNitrate Nitrogen
OBEOptimal Boundary Ellipsoid
RFRandom Forest
RMSERoot Mean Square Error
RNNRecurrent Neural Network
SVMSupport Vector Machine
SVRSupport Vector Regression
TNTotal Nitrogen
TPTotal Phosphorus
WWTPWastewater Treatment Plant

References

  1. Ding, H.L.; Tang, M.Y.; Huang, Q.; Yang, P.; Liu, Z.; Bi, X.J.; Nair, A.; Wang, X.D. Soft sensor enabled real-time chemical dosing control systems for wastewater treatment: From hybrid model to full-scale application. J. Water Process. Eng. 2024, 63, 105431. [Google Scholar] [CrossRef]
  2. Xie, Y.F.; Chen, Y.Q.; Wei, Q.; Yin, H.L. A hybrid deep learning approach to improve real-time effluent quality prediction in wastewater treatment plant. Water Res. 2024, 250, 121092. [Google Scholar] [CrossRef]
  3. Martínez, R.; Vela, N.; El Aatik, A.; Murray, E.; Roche, P.; Navarro, J.M. On the use of an iot integrated system for water quality monitoring and management in wastewater treatment plants. Water 2020, 12, 1096. [Google Scholar] [CrossRef]
  4. Sundui, B.; Calderon, O.; Abdeldayem, O.M.; Lázaro-Gil, J.; Rene, E.R.; Sambuu, U. Applications of machine learning algorithms for biological wastewater treatment: Updates and perspectives. Clean Technol. Environ. Policy 2021, 23, 127–143. [Google Scholar] [CrossRef]
  5. Fan, Z.; Zhou, X. Decoding the role of extracellular polymeric substances in enhancing nitrogen removal from high-ammonia and low-c/n wastewater in a sequencing batch packed-bed biofilm reactor. Polymers 2023, 15, 1510. [Google Scholar] [CrossRef] [PubMed]
  6. Holloway, T.G.; Williams, J.B.; Ouelhadj, D.; Cleasby, B. Process stress, stability and resilience in wastewater treatment processes: A novel conceptual methodology. J. Clean Prod. 2021, 282, 124434. [Google Scholar] [CrossRef]
  7. Zankov, D.; Madzhidov, T.; Varnek, A.; Polishchuk, P. Chemical complexity challenge: Is multi-instance machine learning a solution? Wiley Interdiscip. Rev.-Comput. Mol. Sci. 2024, 14, e1698. [Google Scholar] [CrossRef]
  8. Szelag, B.; Zaborowska, E.; Makinia, J. An algorithm for selecting a machine learning method for predicting nitrous oxide emissions in municipal wastewater treatment plants. J. Water Process. Eng. 2023, 54, 103939. [Google Scholar] [CrossRef]
  9. Chawla, P.; Cao, X.Y.; Fu, Y.C.; Hu, C.M.; Wang, M.; Wang, S.Q.; Gao, J.Z. Water quality prediction of salton sea using machine learning and big data techniques. Int. J. Environ. Anal. Chem. 2023, 103, 6835–6858. [Google Scholar] [CrossRef]
  10. Zhao, G.Y.; Suzuki, S.; Deng, J.H.; Fujita, M. Machine learning estimation of biodegradable organic matter concentrations in municipal wastewater. J. Environ. Manag. 2022, 323, 116191. [Google Scholar] [CrossRef] [PubMed]
  11. Mokarram, M.; Pourghasemi, H.R.; Pham, T.M. Enhancing water quality monitoring through the integration of deep learning neural networks and fuzzy method. Mar. Pollut. Bull. 2024, 206, 116698. [Google Scholar] [CrossRef] [PubMed]
  12. Haq, K.; Harigovindan, V.P. Water quality prediction for smart aquaculture using hybrid deep learning models. IEEE Access 2022, 10, 60078–60098. [Google Scholar]
  13. Zhang, L.; Jiang, Z.; He, S.; Duan, J.; Wang, P.; Zhou, T. Study on water quality prediction of urban reservoir by coupled ceemdan decomposition and lstm neural network model. Water Resour. Manag. 2022, 36, 3715–3735. [Google Scholar] [CrossRef]
  14. Wang, R.; Liu, J.J.; Zhang, Q.; Li, X.Y.; Wang, S.Y.; Peng, Y.Z. Robustness of the anammox process at low temperatures and low dissolved oxygen for low c/n municipal wastewater treatment. Water Res. 2024, 252, 121209. [Google Scholar] [CrossRef] [PubMed]
  15. Liu, Z.G.; Zhang, Y.; Zhou, W.; Wang, W.; Dai, X.H. Comparison of nitrogen and phosphorus removal between two typical processes under low temperature in a full-scale municipal wastewater treatment plant. Water 2022, 14, 3874. [Google Scholar] [CrossRef]
  16. Ateunkeng, J.G.; Boum, A.T.; Bitjoka, L. Improvement of effluent quality and operational cost reduction of a wastewater treatment plant using intelligent computational hybrid control schemes. Clean Technol. Environ. Policy 2024. [Google Scholar] [CrossRef]
  17. Rajaei, M.; Nazif, S. Improving wastewater treatment plant performance based on effluent quality, operational costs, and reliability using control strategies for water and sludge lines. Process Saf. Environ. Protect. 2022, 167, 398–411. [Google Scholar] [CrossRef]
  18. Lan, S.H.; Lai, Y.S.; Wang, L.Y.; Liu, W.B.; Liu, J.H.; Liu, D.J.; Li, K.; Cao, Q.L.; Wei, K.; Lan, H.X. Treatment of nitrate-nitrogen-containing wastewater via aerobic denitrifying bacteria using different carbon sources. BioResources 2022, 17, 1972–1987. [Google Scholar] [CrossRef]
  19. Cechinel, M.; Neves, J.; Fuck, J.; Andrade, R.; Spogis, N.; Riella, H.G.; Padoin, N.; Soares, C. Enhancing wastewater treatment efficiency through machine learning-driven effluent quality prediction: A plant-level analysis. J. Water Process. Eng. 2024, 58, 104758. [Google Scholar] [CrossRef]
  20. Choi, K.W.; Chan, S.N.; Lee, J. The waterman system for daily beach water quality forecasting: A ten-year retrospective. Environ. Fluid Mech. 2023, 23, 205–228. [Google Scholar] [CrossRef]
  21. Libera, D.A.; Sankarasubramanian, A. Multivariate bias corrections of mechanistic water quality model predictions. J. Hydrol. 2018, 564, 529–541. [Google Scholar] [CrossRef]
  22. Kashani, M.H.; Nikpour, M.R.; Jalali, R. Water quality prediction using data-driven models case study: Ardabil plain, iran. Soft Comput. 2023, 27, 7439–7448. [Google Scholar] [CrossRef]
  23. Quaghebeur, W.; Torfs, E.; De Baets, B.; Nopens, I. Hybrid differential equations: Integrating mechanistic and data-driven techniques for modelling of water systems. Water Res. 2022, 213, 118166. [Google Scholar] [CrossRef] [PubMed]
  24. Cheng, Q.; Kim, J.; Wang, Y.; Ren, X.; Guo, Y.; Park, J.; Park, S.; Lee, S.; Zheng, G.; Wang, Y.; et al. Novel ensemble learning approach for predicting cod and tn: Model development and implementation. Water 2024, 16, 1561. [Google Scholar] [CrossRef]
  25. Ladouali, S.; Katipoglu, O.M.; Bahrami, M.; Kartal, V.; Sakaa, B.; Elshaboury, N.; Keblouti, M.; Chaffai, H.; Ali, S.; Pande, C.B.; et al. Short lead time standard precipitation index forecasting: Extreme learning machine and variational mode decomposition. J. Hydrol.-Reg. Stud. 2024, 54, 101861. [Google Scholar] [CrossRef]
  26. Wang, D.; Thunéll, S.; Lindberg, U.; Jiang, L.L.; Trygg, J.; Tysklind, M. Towards better process management in wastewater treatment plants: Process analytics based on shap values for tree-based machine learning methods. J. Environ. Manag. 2022, 301, 113941. [Google Scholar] [CrossRef]
  27. Gao, Z.; Chen, J.; Wang, G.; Ren, S.; Fang, L.; Yinglan, A.; Wang, Q. A novel multivariate time series prediction of crucial water quality parameters with long short-term memory (lstm) networks. J. Contam. Hydrol. 2023, 259, 104262. [Google Scholar] [CrossRef]
  28. Zhou, M.; Zhang, Y.; Wang, J.; Xue, T. Lstm-obe based interval prediction of effluent bod for wastewater treatment. IFAC-PapersOnLine 2023, 56, 8488–8493. [Google Scholar] [CrossRef]
  29. Tian, Q.Q.; Luo, W.; Guo, L. Water quality prediction in the yellow river source area based on the deeptcn-gru model. J. Water Process. Eng. 2024, 59, 105052. [Google Scholar] [CrossRef]
  30. Shin, H.S.; Hong, J.K. Performance analysis of a chunk-based speech emotion recognition model using rnn. Intell. Autom. Soft Comput. 2023, 36, 235–248. [Google Scholar] [CrossRef]
  31. Raj, K.M.; Vairavel, K.S. Quality index metrics with bi-gru-based water quality prediction. Energy Sources Part A-Recovery Util. Environ. Eff. 2024, 46, 171–187. [Google Scholar]
  32. Jrhilifa, I.; Ouadi, H.; Jilbab, A.; Mounir, N. Forecasting smart home electricity consumption using vmd-bi-gru. Energy Effic. 2024, 17, 35. [Google Scholar] [CrossRef]
  33. Hanadé Houmma, I.; El Mansouri, L.; Hadria, R.; Emran, A.; Chehbouni, A. Retrospective analysis and version improvement of the satellite-based drought composite index. A semi-arid tensift-morocco application. Geocarto Int. 2022, 37, 3069–3090. [Google Scholar] [CrossRef]
  34. Sang, S.; Li, L. A novel variant of lstm stock prediction method incorporating attention mechanism. Mathematics 2024, 12, 945. [Google Scholar] [CrossRef]
  35. Hong, J.C.; Liang, F.W.; Yang, H.X.; Zhang, C.; Zhang, X.Y.; Zhang, H.Q.; Wang, W.; Li, K.R.; Yang, J.S. Multi- forword-step state of charge prediction for real-world electric vehicles battery systems using a novel lstm-gru hybrid neural network. eTransportation 2024, 20, 100322. [Google Scholar] [CrossRef]
  36. An, W.; Gao, B.; Liu, J.; Ni, J.; Liu, J. Predicting hourly heating load in residential buildings using a hybrid ssa–cnn–svm approach. Case Stud. Therm. Eng. 2024, 59, 104516. [Google Scholar] [CrossRef]
  37. Wu, X.Y.; Zheng, Z.; Wang, L.; Li, X.G.; Yang, X.Y.; He, J. Coupling process-based modeling with machine learning for long-term simulation of wastewater treatment plant operations. J. Environ. Manag. 2023, 341, 118116. [Google Scholar] [CrossRef] [PubMed]
Figure 1. The schematic diagram of the treatment processes.
Figure 1. The schematic diagram of the treatment processes.
Water 17 00310 g001
Figure 2. The block diagram of data preprocessing.
Figure 2. The block diagram of data preprocessing.
Water 17 00310 g002
Figure 3. Schematic diagram of LSTM neurons and GRU neurons.
Figure 3. Schematic diagram of LSTM neurons and GRU neurons.
Water 17 00310 g003
Figure 4. System architecture of water quality prediction model based on the stacked LSTM-GRU model.
Figure 4. System architecture of water quality prediction model based on the stacked LSTM-GRU model.
Water 17 00310 g004
Figure 5. LSTM-GRU model testing results.
Figure 5. LSTM-GRU model testing results.
Water 17 00310 g005
Figure 6. Effluent results of different operational control strategies in three typical scenarios.
Figure 6. Effluent results of different operational control strategies in three typical scenarios.
Water 17 00310 g006
Table 1. Data statistics of indicators after preprocess.
Table 1. Data statistics of indicators after preprocess.
Variable PropertiesIndicator AttributeIndicatorsUnitDesign MaximumMinimumAverage
Input variableInfluent indicatorsInfluent flowm3/h2083.32261.41533.91897.3
Influent COD concentrationmg/L450.0421.050.1175.6
Influent TN concentrationmg/L55.055.115.733.7
Influent NH3-N concentrationmg/L45.045.04.127.0
Influent TP concentrationmg/L5.05.70.62.3
Process indicatorsMLSS concentrationmg/L4000.07859.91674.25580.7
NO3-N concentrationmg/L/9.01.12.8
Process control indicatorsDO concentrationt/h/6.11.93.1
Carbon source dosagemg/L/0.60.10.3
Output variabledataEffluent COD concentrationmg/L5026.52.512.5
Effluent TN concentrationmg/L1513.23.19.0
Table 2. Model input data in different typical scenarios.
Table 2. Model input data in different typical scenarios.
ScenariosInfluent IndicatorsProcess Control Indicators
Influent FlowCODNH3-NTPTNNO3-NMLSS
(m3/h)(mg/L)(mg/L)(mg/L)(mg/L)(mg/L)(mg/L)
Low C/N212711027.53.236.72.885727
low water temperature211035128.83.136.12.916129
high water temperature221318419.62.528.72.264660
Table 3. Different control schemes for carbon source dosage and DO concentration.
Table 3. Different control schemes for carbon source dosage and DO concentration.
Operational Control StrategyCarbon Source Dosage (t/h)DO Concentration (mg/L)Operational Control StrategyCarbon Source Dosage (t/h)DO Concentration (mg/L)
Scheme 10.202.0Scheme 4210.204.0
Scheme 20.212.0Scheme 4220.214.0
…………
Scheme 210.402.0Scheme 4390.384.0
Scheme 220.202.1Scheme 4400.394.0
……Scheme 4410.404.0
Table 4. The design and historical hydraulic retention time of the WWTP.
Table 4. The design and historical hydraulic retention time of the WWTP.
SectionHRT (h)
DesignHistorical
Biological reaction tankSelection area0.830.83
Anaerobic area1.651.65
Anoxic area3.34.4
Aerobic area8.88.8
Secondary sedimentation tank3.53.5
High-density sedimentation tank1.10.7
Summation19.1819.88
Table 5. Calculation results of model evaluation metrics.
Table 5. Calculation results of model evaluation metrics.
ModelRMSEMAEMAPE
Effluent CODSVR3.3111.98916.87%
RF2.4661.67215.96%
LSTM-GRU1.9881.38313.07%
Effluent TNSVR1.3271.0639.67%
RF1.1440.7817.73%
LSTM-GRU0.6980.4715.60%
Table 6. Operational control strategies under three typical scenarios.
Table 6. Operational control strategies under three typical scenarios.
Typical ScenariosCarbon Source Dosage (t/h)DO Concentration (mg/L)
Low C/N0.23~0.262.0~2.6
Low water temperature0.25~0.272.6~2.8
High water temperature0.20~0.272.0~2.5
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, H.; Liu, C.; Guo, X.; Sun, H.; Li, X.; Jiang, H.; Miao, S. Applying Machine Learning Approach to Design Operational Control Strategies for a Wastewater Treatment Plant in Typical Scenarios. Water 2025, 17, 310. https://doi.org/10.3390/w17030310

AMA Style

Li H, Liu C, Guo X, Sun H, Li X, Jiang H, Miao S. Applying Machine Learning Approach to Design Operational Control Strategies for a Wastewater Treatment Plant in Typical Scenarios. Water. 2025; 17(3):310. https://doi.org/10.3390/w17030310

Chicago/Turabian Style

Li, Han, Chao Liu, Xiao Guo, Haotian Sun, Xuefei Li, Hao Jiang, and Sheng Miao. 2025. "Applying Machine Learning Approach to Design Operational Control Strategies for a Wastewater Treatment Plant in Typical Scenarios" Water 17, no. 3: 310. https://doi.org/10.3390/w17030310

APA Style

Li, H., Liu, C., Guo, X., Sun, H., Li, X., Jiang, H., & Miao, S. (2025). Applying Machine Learning Approach to Design Operational Control Strategies for a Wastewater Treatment Plant in Typical Scenarios. Water, 17(3), 310. https://doi.org/10.3390/w17030310

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