1. Introduction
The activated sludge process has been used worldwide for the biological wastewater treatment system [
1]. One of the critical steps is to separate activated sludge from liquid before discharge. Thus, SVI (mL/g), an indicator of solid separation, is an important operational parameter. It is defined as ‘the volume (in mL) occupied by 1 g of activated sludge after settling the aerated liquid for 30 min [
2]. Many researchers have developed the SVI model using Artificial Neural Networks (ANNs) [
3,
4,
5]. Unfortunately, there are no deterministic explainable models to predict SVI and interpret the result due to the unexplainable behavior of microorganisms causing the sludge bulking (settling) problem and uninterpretability of the neural network model. A common problem in the activated sludge system is poor solid separation at the secondary clarification stage [
6]. Excess growth of filamentous organisms makes activated solids difficult to settle in secondary clarifiers, leading to a potential violation of the total solids regulatory limit. The recurrent neural network (RNN) model was used to predict SVI from big data generated at the Nine Springs Wastewater Treatment Plant (WWTP), Madison, Wisconsin. The model will aid in predicting potential settling issues and providing possible reasons for higher SVI prediction. This model will significantly enhance the activated sludge system performance in WWTPs.
Control of the activated sludge process is difficult for many WWTPs due to the complexity of the biological and chemical reactions and variations in the influent water quality and flow rate [
7]. The activated sludge process control can be improved by evaluating the causes of higher SVI and taking preventive measures. Several variables can impact the settleability of sludge in the clarifiers, such as filamentous bacteria, rain events, and water temperature. Filamentous bacteria such as
Sphaerotilus natans (
S. natans) and
Microthrix parvicella (
M. parvicella) impact sludge settleability because these bacteria create more buoyant flocs [
8]. Moreover, a balance between floc- and filamentous-forming bacteria is required. There are still many causes leading to problems in the activated sludge process. Therefore, sludge settling problems occurring in the activated sludge process can be avoided by taking the right action through the real-time monitoring system, Explainable Artificial Intelligence (AI) algorithms, and proactive measures.
In recent years, predictive modeling approaches have been increasingly applied in many industries [
9]. Modeling with RNNs is a current trend in deep learning neural networks algorithms [
10]. The advantage of RNN algorithms is the capability to handle sequential data with a variable dataset [
11]. However, the more accuracy of the model like RNN, makes the model utmost difficult to interpret [
12]. SVI is one of the most important parameters that monitors the activated sludge settling performance in WWTPs. RNN models can be used to predict SVI in the activated sludge system with a validated dataset and then applied to an explainable function to interpret the result, allowing operators to take preventive measures before the sludge settling issue arises during the operation of the activated sludge process.
1.1. Sludge Volume Index (SVI)
Operators use SVI to determine and compare mixed liquor settleability [
13]. It mathematically relates settled sludge volume in the settleometer to mixed liquor suspended solids (MLSS) concentration. SVI relates sludge volume in milliliters to MLSS concentration in grams per liter as follows [
14]:
where SSV30 (in units of milliliters per liter) is the volume of sludge that settles in a graduated cylinder of mixed liquor in 30 min and mixed liquor suspended solids (MLSS) (mg/L) is the MLSS concentration in aeration basins. The common range for an SVI at a conventional activated sludge system is between 50 and 150 [
15]. Optimum SVI must be determined for each WWTP experimentally. SVI is an excellent indicator of the settling characteristics of the sludge. However, SVI varies with the characteristics and concentration of the mixed-liquor solids. Thus, observed values at a given WWTP should not be compared with those reported for other plants or in the literature. Typical SVI values for a good settling sludge with 1500–3500 mg/L of mixed liquor concentrations range from 80 to 120 [
15]. Filamentous bulking increases SVI even if the MLSS concentration is the same. Therefore, SVI is a good indicator of filamentous bulking.
1.2. Activated Sludge Process
The activated sludge process is a biological wastewater treatment process where microorganisms biodegrade organics present in wastewater as a carbon source. The settleability of the activated sludge depends on the size, density, and shape of the flocs and the competency of the secondary clarifier. Settleability can be affected by the extent of the filamentous bacteria population. These bacteria can form strings as they grow rather than forming flocs. Excess growth of these filamentous organisms can cause a bulking condition, resulting in poor settling and taking up more sludge blanket volume in the secondary clarifier. This condition may be triggered by several factors, such as inadequate dissolved oxygen (DO) and nutrient imbalance, leading to solids loss in the clarifier effluent due to poor solid separation [
16]. Therefore, the control of sludge bulking is crucial in the activated sludge process.
1.3. Filamentous Bulking
Filamentous bulking is the number one cause of effluent non-compliance in the United States (U.S.). Filamentous bulking and foaming are serious issues in an activated sludge operation, affecting most WWTPs [
16]. A bulking sludge settles slowly and does not settle compactly, causing subsequent solids overflow at the secondary clarifier. An operational target SVI often used for operation is <150 mL/g, although each WWTP has unique SVI values for safe operation, varying from <100 mL/g to >300 mL/g, depending on the hydraulic considerations and the capacity and performance of the secondary clarifier. For example, a bulking sludge may be acceptable if the secondary clarifier is sufficiently large.
1.4. Recurrent Neural Network (RNN)
The RNN is a natural generalization of feedforward neural networks to sequences. Given a sequence of inputs (
x1, …,
xt), a standard RNN computes a series of outputs (
y1, …,
yt) by iterating the following equation [
17]:
The RNN can easily map sequences to sequences whenever the alignment between the inputs and the outputs are known ahead of time. However, it is unclear how to apply an RNN to problems whose input and output sequences have different lengths with complicated and non-monotonic relationships. In
Figure 1 [
18], an RNN, A, has an input
xt and output
ht. A loop allows information to persist and pass from one step of the network to the next, in which traditional neural networks cannot handle this.
The most straightforward strategy for general sequence learning is to map the input sequence to a fixed-sized vector using one RNN and then map the vector to the target sequence with another RNN.
1.5. Shortcomings of Previous Predictive Models
Monitoring and controlling wastewater treatment processes have increased consideration and led to several models for the biological treatment processes in WWTPs such as Activated Sludge Models (ASM1, ASM2, ASM2d, and ASM3) [
19]. Still, the complex structures of these models involving large numbers of parameters that must be identified make them inappropriate for monitoring purposes [
20]. For instance, the model ASM1 contained 13 non-linear differential equations and 19 parameters, which are very difficult for computation [
21].
Harrou et al. (2018) have studied a monitoring strategy using deep learning approaches, deep belief networks (DBNs), and a one-class support vector machine (OCSVM). However, when the data are highly noisy, false alarms might be generated during the fault detection task. As a result, deeper learning algorithms such as deep neural networks (DNNs), artificial neural networks (ANNs), and recurrent neural networks (RNNs) should be proposed to achieve complex input information in WWTPs.
Many researchers have recently developed various types of predictive models. Zhao et al. (2020) found that with the development of AI technology, the number of research publications of AI application to wastewater treatment was 19 times greater in 2019 than in 1995, and papers had 36 more citations on average. However, most AI applications in WWTP are limited to ANN models. RNN models have not so far been applied to WWTP operations.
1.6. Explainable Artificial Intelligence
As predictive algorithms play an important role in our lives, they become increasingly complex. Explaining why an algorithm makes certain decisions is ever more crucial [
22]. Accuracy and interpretability are two main factors of successful predictive models. Typically, a decision must be made in favor of complex black box models such as Recurrent Neural Networks (RNN) for accuracy versus less accurate but more interpretable traditional models such as the logistics regression model [
23]. However, the highest accuracy for big datasets is often attained by complex models that experts struggle to explain. Several approaches have been developed to help users understand the predictions of complex models. Still, it is often unclear how these approaches are related and when one technique is preferable over another [
24].
SHAP (SHapley Additive exPlanation) values are a unified measure of feature importance [
24]. In other words, SHAP assigns each input/feature an importance value for a particular prediction. They interpret how to get from the base value
E[
f(
z)] that would be forecasted when the unknown featured to the current output
f(
x) occurred.
Figure 2 shows the diagram for a single ordering. The SHAP values start from averaging the −
i values through all possible orderings. The calculation of SHAP values determine the importance of a feature by comparing what a model predicts with and without feature. The calculation is made in every possible order because the order of a model can affect a prediction. Therefore, it is suitable for non-linear or complex time-series data, which the order of data affects a prediction output.
3. Results
The first dataset is from 1996 to 2020, the original dataset from the Nine Springs WWTP. After data analysis, the second and third datasets were created. The second dataset is the dataset between 2001 and 2020 because the data in 2000 was found to have a significant error in the dataset. The third dataset is the data from 2010 to 2020, in which the out-of-range (50 to 150 mL/g) SVI data were removed. The result shows that the second and third datasets are more suitable for applying in the model.
Figure 10 shows the normal distribution used to determine if the data distribution departs from the normal distribution. Kurtosis and Skewness tests were also calculated.
Figure 10a shows that the Kurtosis of the first dataset was far from 0, implying that the distribution had heavier tails. Skewness measures the asymmetry of the distribution. If the skewness is between −0.5 and 0.5, the data are symmetrical. If the skewness is between −1 and 0.5 or between 0.5 and 1, the data are moderately skewed. If the skewness is less than −1 or greater than 1, the data are highly skewed. Therefore, the first dataset was very highly skewed.
Data visualization was performed to determine the appropriateness of the dataset. The data in 2000 appears to have a high error. Thus, the second dataset from 2001 to 2020 was used for modeling.
Figure 10b shows the normal distribution and Kurtosis and Skewness values. The Kurtosis was closer to 0, which was decreased from 9.77 in the first dataset to 1.35 in the second dataset. The Skewness value displays that the second dataset is symmetrical. Lastly, the third dataset’s Kurtosis and Skewness values were calculated.
Figure 10c shows that the dataset has the asymmetry of the distribution and symmetry of the dataset. The result has the Kurtosis of 0.03 and the Skewness of 0.12.
The next step, the probability plot, was conducted in
Figure 11.
Figure 11a shows that the first dataset was far from the normal probability plot and had a high standard deviation (std) of 26.69, indicating that the dataset had significant errors.
Figure 11b,c shows an excellent inline of the probability plot for the second and third datasets. The standard deviations decreased to 14.36 and 12.63, respectively.
The next step was the RNN model development.
Figure 12 shows the train and validation error of the training and testing of the third dataset. The model performed well in the sample fit. The model fit can be ended when the train and test error is low and close to each other. The figure shows two lines of train results. The test errors were very close to each other.
Figure 13,
Figure 14 and
Figure 15 show the prediction results of the SVI model. The blue line is the original SVI data, and the green line is predicted. Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) are the most common metrics used to measure the accuracy of a model. RMSE is a quadratic scoring rule that measures the magnitude of errors, i.e., the square root of the average of squared differences between the prediction and original values. MAE is used to measure the average magnitude of the errors in the predictions. It calculates the absolute differences between the prediction and actual values over the test data where all individuals have equal weight. Therefore, both MAE and RMSE can be used to express average model prediction. The metrics range from 0 to ∝.
Figure 13 shows that the prediction of the first set of data. The prediction has a low RMSE of 4.161 and MAE of 3.284. The prediction of the second dataset after data analysis results in lower RMSE (3.360) and MAE (2.156) values in
Figure 14. However,
Figure 15 shows that even though the data are more stable, the model’s RMSE and MAE were similar or slightly higher than the previous model. Thus, the RNN model can perform well even if the data fluctuate. Data visualization and analysis can help determine the error in the dataset and the system’s poor performance.
The next step is to interpret the prediction result of the models.
Figure 16,
Figure 17 and
Figure 18 show the explainable function applied to the first prediction models.
Figure 16 shows that organic loading, BOD
5, and flow rate are the most impact input parameters to the SVI prediction, followed by TP, TKN, TSS, and NH
3N.
Figure 17 shows that when SVI is 114.6, organic loading and flow rate lowered the predicted SVI value, and TP, TSS, NH
3N, TKN, and BOD
5 increased the SVI value. Lastly, the explainable function can help determine input parameters that affect each output value in
Figure 18. Lastly,
Figure 19 shows the accuracy of the model using Mean Absolute Error (MAE) for training and testing set. The figure shows the lines are very low and close to each other, which means the model has a good performance. The most important finding is that the organic loading and TP in mass (concentration × flow rate) affect the SVI value most, implying that the WWTP might not be able to supply a proper amount of oxygen in response to the condition change. Thus, the real-time aeration control is thought to achieve a stable SVI.
Similar to the second and third models, organic loading, BOD5, and flow rate were the most related parameters to SVI prediction, followed by TKN, TP, NH3N, and TSS. Depending on the operation condition, the principal parameters affecting the prediction varied. Therefore, applying this explainable function along with model prediction would assist the WWTP operation by closely monitoring the system, visualizing and controlling the system, making a model prediction, interpreting the result, and providing a faulty alarm.
4. Discussion
The results showed the model’s ability to predict SVI despite significant fluctuation in the dataset. The RMSE was ~3 and MAE was ~2 in the SVI range from 50 to 150. However, the RMSE and MAE are still not low enough to conclude that a model is good because it is scale-dependent. A good model can be determined by looking at training and testing errors. The result shows that the second and third models were an excellent in-sample fit, associated with low error measures.
The Explainable Artificial Intelligence (AI) algorithm was useful in explaining the causes of high SVI values. The result can be interpreted in the graph and shows what causes SVI higher or lower for each instance and what the most related parameters to output prediction are. However, the validation of the explainable algorithm needs to be further evaluated with other models. Therefore, it can be concluded that an RNN model with explainable AI can predict SVI and give an operator a suggestion such as which parameters affect higher SVI under widely varying daily conditions.
For the Nine Spring WWTP dataset, organic loading, influent BOD5, and flow rate most affected SVI prediction. It can be caused by oxygen control in an aeration system because aeration impacts BOD5 and SVI. Therefore, aeration control should be thoroughly monitored in an aeration system. Although it was possible to determine which parameter(s) caused higher SVI, reasons and corrective measures must be investigated further for individual WWTPs. The developed method can be applied to other WWTPs, but causative reasons may differ depending on the treatment process, characteristics of raw wastewater, air supply system, DO setpoint and control method, etc., suggesting different solutions for higher SVI.