#
Modeling Method for Aerobic Zone of A^{2}O Based on KPCA-PSO-SCN

^{*}

## Abstract

**:**

^{2}O) sewage treatment process. Therefore, modeling the sewage treatment process and predicting the effluent quality are of great significance. A process modeling method based on Kernel Principal Component Analysis–Particle Swarm Optimization–Stochastic Configuration Network (KPCA-PSO-SCN) is proposed for the A

^{2}O aerobic wastewater treatment process. Firstly, eight auxiliary variables were determined through mechanism analysis, including Chemical Oxygen Demand (COD) and ammonia nitrogen (NH

_{4}

^{+}) and nitrate nitrogen (NO

_{3}

^{−}) of influent water, pH, temperature (T), Mixed Liquor Suspended Solid (MLSS), Dissolved Oxygen (DO) and hydraulic residence time (HRT) in the aerobic zone. Dimensionality reduction was carried out using the kernel principal component analysis method based on the Gaussian function, and the eight-dimensional data were changed to five-dimensional data, which improved the running speed and efficiency of subsequent models. Then, according to the advantages of the particle swarm optimization algorithm, such as low calculation cost and fast convergence, combined with the advantages of stochastic configuration network general approximation performance, the PSO-SCN model was established to predict the three water quality indexes of effluent COD, NH

_{4}

^{+}, and NO

_{3}

^{−}for the aerobic zone. The experimental results proved the effectiveness of the model. Compared with classic water quality prediction algorithm models such as SCN, PSO-BP, RBF, PSO-RBF, etc., the superiority of the PSO-SCN algorithm model was demonstrated.

## 1. Introduction

^{2}O process with the activated sludge process as the core [5].

^{2}O sewage treatment process is denitrification and phosphorus removal. Its core is the activated sludge method, which degrades organic matter in sewage through microorganisms’ adsorption, decomposition, and oxidation. At the same time, nitrogen, phosphorus, and other elements in sewage are removed through a series of biochemical reactions to achieve relevant discharge standards. In the whole process of A

^{2}O wastewater treatment, the biochemical effect of the aerobic zone plays a crucial role. The biochemical reactions at this stage are the most complex, and its main functions are the nitrification of ammonia nitrogen, the absorption of phosphorus, the degradation of organic matter, etc. The sewage treatment capacity in the aerobic zone has an important impact on the effluent quality. Therefore, modeling the aerobic zone can not only timely reflect the sewage treatment effect of its related biochemical zone, but also predict the effluent quality of the A

^{2}O process, to play a warning role in whether the effluent quality meets the standard, which is of great significance. At the same time, the aeration energy consumption of the aerobic zone accounts for 70% of the total energy consumption of the entire A

^{2}O process. The modeling of the aerobic zone also provides a basis for further optimization of aeration volume and saving of aeration energy consumption in the A

^{2}O process.

^{2}O process is complicated and there are many influencing variables, so it is difficult to accurately predict the effluent quality. At the same time, the important parameters of effluent water quality (such as COD, ammonia nitrogen, etc.) can only be obtained after the completion of the process, which has a serious lag, which will lead to substandard sewage discharge.

^{2}O process based on KPCA-PSO-SCN. This method first uses KPCA to reduce the dimensionality of the data, solving the drawbacks of high computational complexity and slow computational speed caused by high dimensionality and then uses PSO to optimize SCN. The effluent COD, NH

_{4}

^{+}, and NO

_{3}

^{-}in the aerobic zone were predicted.

## 2. Selection and Treatment of Auxiliary Variables in A^{2}O Aerobic Zone

^{2}O wastewater treatment process are nitrification of ammonia and nitrogen, absorption of phosphorus, degradation of organic matter, etc. In the actual process, the treatment effect of ammonia nitrogen has a huge impact on the effluent. Therefore, this article focuses on the nitrification of ammonia nitrogen and organic matter degradation in the A

^{2}O aerobic zone for research and modeling. The sewage treatment process in the A

^{2}O aerobic zone is shown in Figure 1.

- Nitration of ammonia nitrogen;

- Degradation of organic matter.

_{4})

_{2}SO

_{4}) as nitrogen sources to simulate urban sewage as much as possible. When the ratio of carbon to nitrogen in sewage is 100:5, the COD in sewage is 500 mg/L and the nitrogen content is about 25 mg/L. The specific ratio is shown in Table 1.

#### 2.1. Data Collection and Selection

- COD;

- 2.
- NH
_{4}^{+};

- 3.
- NO
_{3}^{−};

- 4.
- pH;

- 5.
- T;

- 6.
- MLSS;

- 7.
- DO;

- 8.
- HRT.

^{2}O wastewater treatment simulation equipment. After 180 days of experimentation, a total of 516 sets of experimental data were obtained, and after selecting, 500 valid data samples were retained. Specific data samples can be found in Table S1. Part of the sample data (collected in March 2023 in Northeast China) is shown in Table 3.

#### 2.2. Data Dimensionality Reduction Based on KPCA

- Given a set of input vectors X as the feature matrix, it is mapped to a high-dimensional space using a Gaussian kernel function, ${R}^{d}\to {R}^{k},dk$.

- 2.
- Calculate the covariance matrix C in the high-order space R
^{k}.

- 3.
- Calculate eigenvalues λ and eigenvectors ω through iterative algorithms.

- 4.
- Obtain the projection of x
_{i}from high-dimensional space to low-dimensional space.

- 5.
- Sort the feature vectors according to the size of their eigenvalues, and take the dimensionality-reduced matrix P composed of the first few rows with a cumulative contribution rate greater than 95%.

## 3. Modeling of A^{2}O Aerobic Zone Based on PSO-SCN

#### 3.1. PSO Principle

- Initialize the particle swarm. In D-dimensional space, each particle swarm has two attributes: velocity vector V
_{i}and position vector X_{i}. Random initialization is performed for V_{i}and X_{i}. - Obtaining the optimal position. The objective function is computed by the V
_{i}and X_{i}of the particle to obtain the particle optimal position P_{best}and the global optimal position G_{best}in the space. - Speed and position update.

_{best}, and G

_{best}, represent the optimal position of the particles before updating and the global optimal position.

- 4.
- After reaching the maximum number of iterations, obtain the final P
_{best}and G_{best}.

#### 3.2. SCN Principle

#### 3.3. PSO Optimized SCN Model

- According to the SCN characteristics, randomly initialize the weights and bias, and obtain the weight and bias matrices.
- Take the error (Root Mean Square Error, RMSE) of the SCN model as the objective function, and use the PSO algorithm to optimize the weights and bias matrix, so that the error reaches the required range.
- The optimized weights and bias matrices are put through the selection operation by the supervision mechanism to check whether the network output meets the requirements. If no, increase the hidden layer network nodes and return to step 2 to optimize the optimized weights and bias matrix again. If yes, end.
- Output model.
- The specific optimization process of the PSO-SCN model is shown in Figure 5.

## 4. Experimental Results and Analysis

_{4}

^{+}, and NO

_{3}

^{−}in the effluent of the aerobic zone was carried out, and the variation curves of the root mean square error of the training process of effluent COD, effluent NH

_{4}

^{+}, and effluent NO

_{3}

^{-}concentrations in the aerobic zone, and the results of the model training and prediction were obtained, as shown in Figure 6, Figure 7 and Figure 8. From Figure 6, Figure 7 and Figure 8a, it can be seen that the training error of the network gradually decreases with the increase in the structure, and when the number of nodes in the implicit layer is 285, 376, and 279, respectively, the root-mean-square error between the training set and the test set reaches less than 0.01, which satisfies the error tolerance set in the model. From Figure 6, Figure 7 and Figure 8b,c, it can be seen that the training error as well as the prediction error of the model for COD, NH

_{4}

^{+}, and NO

_{3}

^{−}of the effluent water are small, and the fitting degree is high.

_{COD}is better than PSO-SCN. However, comparing the prediction time, PSO-BP takes longer, and for models with stronger real-time requirements such as water quality prediction, models with smaller time are more suitable. Although RBF takes significantly less time than the PSO-SCN model, its prediction accuracy is larger than the PSO-SCN model. From the NSE results, the average predicted results for E

_{COD}, E

_{NH4}

^{+}, and E

_{NO3}

^{−}for each model are −0.84991, 0.760064, 0.582304, 0.51689, and 0.606145, respectively. From the average, it can be seen that PSO-SCN is superior to SCN, RBF, PSO-RBF, and lower than PSO-BP. However, combining RMSE and prediction time, the PSO-SCN model is more superior.

## 5. Conclusions

^{2}O aerobic zone modeling method, a modeling method of the aerobic zone of the A

^{2}O wastewater treatment process based on KPCA-PSO-SCN is proposed to realize the prediction of effluent COD, effluent NH

_{4}

^{+}, and effluent NO

_{3}

^{−}concentration in the aerobic zone. The modeling method is characterized as follows:

- Eight auxiliary variables that have a large impact on the effluent results were identified through the mechanistic reaction process in the aerobic zone. The KPCA method based on the Gaussian kernel function was used to downscale the sample data of the auxiliary variables, and the number of principal components with a cumulative contribution rate of more than 95% was selected to downscale the eight-dimensional data to five dimensions, which preserved the sample characteristics and improved the running speed and efficiency of the PSO-SCN algorithm.
- For the characteristics of the SCN algorithm with less manual intervention and more general approximation, but insufficient optimization of node weights and biases, the particle swarm optimization algorithm with smaller computational cost and faster convergence speed is selected to optimize the weights and bias of the SCN algorithm. The effectiveness of the algorithm was verified by experimental data.
- The classical water quality prediction algorithms such as SCN, PSO-BP, RBF, and PSO-RBF were compared, and the superiority of the PSO-SCN algorithm was verified in terms of RMSE, NSE and prediction time.

^{2}O aerobic zone, and in future research, the whole process of wastewater treatment is considered to be modeled in order to achieve the clarity of the various stages and indexes in the A

^{2}O process, and at the same time, it is also considered to combine the part of the A

^{2}O wastewater treatment process that consumes the largest amount of energy, i.e., the aeration energy, with the effluent water quality, and to create a multi-objective optimization model, which is used to guarantee the effluent quality at the same time and to ensure the quality of the effluent. It is used to minimize the aeration energy consumption while ensuring the effluent water quality.

## Supplementary Materials

^{2}O aerobic zone experimental data.

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Ministry of Housing and Urban-Rural Development of the People’s Republic of China. 2021 Urban-Rural Construction Statistical Yearbook; China Planning Press: Beijing, China, 2021. [Google Scholar]
- Khan, A.U.; Rehman, M.U.; Zahoor, M.; Shah, A.B.; Zekker, I. Biodegradation of Brown 706 Dye by Bacterial Strain Pseudomonas aeruginosa. Water
**2021**, 13, 2959. [Google Scholar] [CrossRef] - Ikram, M.; Naeem, M.; Zahoor, M.; Hanafiah, M.M.; Oyekanmi, A.A.; Ullah, R.; Farraj, D.A.A.; Elshikh, M.S.; Zekker, I.; Gulfam, N. Biological Degradation of the Azo Dye Basic Orange 2 by Escherichia coli: A Sustainable and Ecofriendly Approach for the Treatment of Textile Wastewater. Water
**2022**, 14, 2063. [Google Scholar] [CrossRef] - Zekker, I.; Rikmann, E.; Tenno, T.; Vabamäe, P.; Kroon, K.; Loorits, L.; Saluste, A.; Tenno, T. Effect of concentration on anammox nitrogen removal rate in a moving bed biofilm reactor. Environ. Technol.
**2012**, 33, 2263–2271. [Google Scholar] [CrossRef] [PubMed] - Zhang, Q.H.; Yang, W.N.; Ngo, H.H.; Guo, W.S.; Jin, P.K.; Dzakpasu, M.; Yang, S.J.; Wang, Q.; Wang, X.C.; Ao, D. Current status of urban wastewater treatment plants in China. Environ. Int.
**2016**, 92–93, 11–22. [Google Scholar] [CrossRef] - Eckenfelder, W.W.; Conor, D. Biological Waste Treatment; Pergamon Press: New York, NY, USA, 1961. [Google Scholar]
- Mckinney, R.E. Mathematics of complete-mixing activated sludge. J. Sanit. Eng. Divis.
**1962**, 88, 87–114. [Google Scholar] [CrossRef] - Henze, M.; Grady, C.P.; Gujor, W.; Marais, G.V.R.; Matsuo, T. Activated Sludge Model No. 1; Scientific and Technical Reports; International Association on Water Pollution Research and Control: London, UK, 1986. [Google Scholar]
- Henze, M.; Gujer, W.; Mino, T.; Matsuo, T.; Wentzel, M.C.; Marais, G.V.R. Activated Sludge Model No. 2; Scientific and Technical Report No. 3; International Association on Water Pollution Research and Control: London, UK, 1995. [Google Scholar]
- Gujer, W.; Henze, M.; Mino, T.; Loosdrecht, M. Activated sludge model No. 3. Water Sci. Technol.
**1999**, 39, 183–193. [Google Scholar] [CrossRef] - Iacopozzi, I.; Innocenti, V.; Marsili-Libelli, S.; Giusti, E. A modified activated sludge model No. 3 (ASM3) with two-step nitrification-denitrification. Environ. Model. Softw.
**2007**, 22, 847–861. [Google Scholar] [CrossRef] - Rieger, L.; Koch, G.; Kühni, M.; Gujer, W.; Siegrist, H. The EAWAG Bio-P module for activated sludge model No. 3. Water Res.
**2001**, 35, 3887–3903. [Google Scholar] [CrossRef] - Jeppsson, U.; Rosen, C.; Alex, J.; Copp, J.; Gernaey, K.V.; Pons, M.N.; Vanrolleghem, P.A. Towards benchmark simulation model for plant-wide control strategy performance evaluation of WWTPs. Water Sci. Technol.
**2006**, 53, 287–295. [Google Scholar] [CrossRef] - Jeppsson, U.; Pons, M.N.; Nopens, I.; Alex, J.; Copp, J.B.; Gernaey, K.V.; Rosen, C.; Steyer, J.P.; Vanrolleghem, P.A. Benchmark simulation model No. 2: General protocol and exploratory case studies. Water Sci. Technol.
**2007**, 56, 67–78. [Google Scholar] [CrossRef] - Flores-Alsina, X.; Corominas, L.; Snip, L.; Vanrolleghem, P.A. Including greenhouse gas emissions during benchmarking of wastewater treatment plant control strategies. Water Res.
**2011**, 45, 4700–4710. [Google Scholar] [CrossRef] [PubMed] - Wan, J.; Huang, M.; Ma, Y.; Guo, W.; Wang, Y.; Zhang, H.; Li, W.; Sun, X. Prediction of effluent quality of a paper mill wastewater treatment using an adaptive network-based fuzzy inference system. Appl. Soft Comput.
**2011**, 11, 3238–3246. [Google Scholar] [CrossRef] - Han, H.G.; Qiao, J.F. Prediction of activated sludge bulking based on a self-organizing RBF neural network. J. Process Control
**2012**, 22, 1103–1112. [Google Scholar] [CrossRef] - Qiao, J.F.; Han, H.G. A repair algorithm for radial basis function neural network and its application to chemical oxygen demand modeling. Int. J. Neural Syst.
**2010**, 20, 63–74. [Google Scholar] [CrossRef] - Yang, Y.; Kim, K.R.; Kou, R.; Li, Y.; Fu, J.; Zhao, L.; Liu, H. Prediction of effluent quality in a wastewater treatment plant by dynamic neural network modeling. Process Saf. Environ. Protect.
**2022**, 158, 515–524. [Google Scholar] [CrossRef] - Kusiak, A.; Zeng, Y.; Zhang, Z. Modeling and analysis of pumps in a wastewater treatment plant: A data-mining approach. Eng. Appl. Artif. Intell.
**2013**, 26, 1643–1651. [Google Scholar] [CrossRef] - Canete, J.F.D.; Sazorozco, P.D.; Baratti, R.; Mulas, M.; Ruano, A. Soft-sensing estimation of plant effluent concentrations in a biological wastewater treatment plant using an optimal neural network. Expert Syst. Appl.
**2016**, 63, 8–19. [Google Scholar] [CrossRef] - Bagheri, M.; Mirbagheri, S.A.; Bagheri, Z. Modeling and optimization of activated sludge bulking for a real wastewater treatment plant using hybrid artificial neural networks-genetic algorithm approach. Process Saf. Environ. Protect.
**2015**, 95, 12–25. [Google Scholar] [CrossRef] - Liu, Y.; Tian, W.; Xie, J.; Huang, W.; Xin, K. LSTM-Based Model-Predictive Control with Rationality Verification for Bioreactors in Wastewater Treatment. Water
**2023**, 15, 1779. [Google Scholar] [CrossRef] - Ren, X.; Wang, F.; Zhang, Y.; Wang, J.; Miao, H. Characterization and Disinfection by Product Formation of Dissolved Organic Matter in Anaerobic–Anoxic–Oxic Membrane Bioreactor (AAO-MBR) Process. Water
**2023**, 15, 1076. [Google Scholar] [CrossRef] - Li, X.; Jia, R.; Zhang, R.; Yang, S.; Chen, G. A KPCA-BRANN based data-driven approach to model corrosion degradation of subsea oil pipelines. Reliab. Eng. Syst. Saf.
**2022**, 219, 108231. [Google Scholar] [CrossRef] - Huang, Y.; Xiang, Y.; Zhao, R.; Chen, Z. Air quality prediction using improved PSO-BP neural network. IEEE Access
**2020**, 8, 99346–99353. [Google Scholar] [CrossRef] - Yang, X.; Maihemuti, B.; Simayi, Z.; Saydi, M.; Na, L. Prediction of Glacially Derived Runoff in the Muzati River Watershed Based on the PSO-LSTM Model. Water
**2022**, 14, 2018. [Google Scholar] [CrossRef] - Wang, D.; Li, M. Stochastic configuration networks: Fundamentals and algorithms. IEEE Trans. Cybern.
**2017**, 47, 3466–3479. [Google Scholar] [CrossRef] [PubMed] - Wang, D.; Li, M. Deep stochastic configuration networks with universal approximation property. In Proceedings of the 2018 International Joint Conference on Neural Networks (IJCNN), Rio de Janeiro, Brazil, 8–13 July 2018; pp. 1–8. [Google Scholar]

**Figure 6.**E

_{COD}concentration prediction. (

**a**) Error plot; (

**b**) training set RMSE; (

**c**) testing set RMSE.

**Figure 7.**E

_{NH4}

^{+}concentration prediction. (

**a**) Error plot; (

**b**) training set RMSE; (

**c**) testing set RMSE.

**Figure 8.**E

_{NO3}

^{−}concentration prediction. (

**a**) Error plot; (

**b**) training set RMSE; (

**c**) testing set RMSE.

Carbon Source | Nitrogen Source | |||
---|---|---|---|---|

Raw Material (g/L) | COD Content (mg/L) | Raw Material (g/L) | Nitrogen Content (mg/L) | |

Glucose | 0.3 | 250 | - | |

Milk powder | 0.3 | 250 | Trace neglect | |

(NH_{4})_{2}SO_{4} | - | 1.18 | 25 | |

Total | - | 500 | - | 25 |

Indicator Symbols | Unit | Description | ||
---|---|---|---|---|

Model Input Variables | Aerobic tank influent water quality indicators | I_{COD} | mg/L | COD concentration of influent water |

I_{NH4}^{+} | mg/L | Influent ammonia nitrogen concentration | ||

I_{NO3}^{−} | mg/L | Concentration of nitrate nitrogen in influent water | ||

Water quality indicators in aerobic tanks | pH | - | - | |

T | °C | Temperature | ||

MLSS | g/L | Mixed liquor suspended solid | ||

DO | mg/L | Dissolved oxygen concentration | ||

other | HRT | h | hydraulic retention time | |

Model Output Variables | Aerobic tank effluent water quality indicators | E_{COD} | mg/L | COD concentration of effluent |

E_{NH4}^{+} | mg/L | Ammonia nitrogen concentration in effluent | ||

E_{NO3}^{−} | mg/L | Nitrate nitrogen concentration in effluent |

I_{COD} | I_{NH4}^{+} | I_{NO3}^{−} | pH | T | MLSS | DO | HRT | E_{COD} | E_{NH4}^{+} | E_{NO3}^{−} |
---|---|---|---|---|---|---|---|---|---|---|

46.50 | 0.76 | 13.49 | 6.97 | 17.50 | 3.50 | 7.53 | 7 | 40.3 | 0.28 | 13.75 |

45.60 | 1.82 | 10.31 | 6.74 | 17.60 | 4.30 | 7.78 | 8 | 38.6 | 1.01 | 10.64 |

46.4 | 2.62 | 13.40 | 6.81 | 18.30 | 3.30 | 8.15 | 6 | 41.4 | 0.79 | 18.44 |

42.1 | 2.39 | 24.31 | 6.54 | 19.00 | 3.20 | 7.62 | 8 | 36.8 | 1.43 | 25.37 |

56.2 | 4.19 | 32.70 | 6.30 | 19.80 | 3.80 | 7.52 | 9 | 46.8 | 2.71 | 33.69 |

60.3 | 7.75 | 14.44 | 7.14 | 20.00 | 4.20 | 7.29 | 11 | 59.2 | 4.67 | 14.44 |

… | … | |||||||||

40.5 | 4.35 | 4.70 | 7.08 | 20.60 | 4.52 | 7.02 | 13 | 39.2 | 1.66 | 5.43 |

41 | 7.65 | 13.66 | 6.93 | 19.50 | 4.21 | 7.14 | 12 | 38.7 | 5.27 | 12.58 |

Symbol | Description | Value | Unit |
---|---|---|---|

c | Kernel function parameters | 2.5 | - |

Con | Accumulated contribution rate | 95 | % |

Model Parameter | Value | |
---|---|---|

SCN | Maximum number of hidden nodes | 500 |

Maximum number of random configurations | 250 | |

Training tolerance | 0.01 | |

Random weight range | [0.5, 1,5, 10, 30, 50, 100, 150, 200, 250] | |

PSO | Particle swarm dimension | 10 |

Number of particles | 20 | |

Evolutionary frequency | 50 |

Model | RMSE | NSE | Prediction Time (s) | ||||
---|---|---|---|---|---|---|---|

E_{COD} | E_{NH4}^{+} | E_{NO3}^{−} | E_{COD} | E_{NH4}^{+} | E_{NO3}^{−} | ||

SCN | 2.3458 | 1.0974 | 1.6535 | −1.51918 | −0.72963 | −0.30092 | 8.83 |

PSO-BP | 0.35598 | 0.61494 | 0.52357 | 0.85265 | 0.64262 | 0.784922 | 12.71 |

RBF | 0.59504 | 0.82213 | 0.51919 | 0.846274 | 0.29246 | 0.60818 | 2.55 |

PSO-RBF | 0.5821 | 0.7833 | 1.0526 | 0.60607 | 0.2546 | 0.69002 | 38.08 |

PSO-SCN | 0.43999 | 0.58946 | 0.46382 | 0.72875 | 0.95011 | 0.72875 | 3.53 |

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. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Lu, W.; Tian, X.; Ma, Y.; Guan, Y.; Liu, L.; Shi, L.
Modeling Method for Aerobic Zone of A^{2}O Based on KPCA-PSO-SCN. *Water* **2023**, *15*, 3692.
https://doi.org/10.3390/w15203692

**AMA Style**

Lu W, Tian X, Ma Y, Guan Y, Liu L, Shi L.
Modeling Method for Aerobic Zone of A^{2}O Based on KPCA-PSO-SCN. *Water*. 2023; 15(20):3692.
https://doi.org/10.3390/w15203692

**Chicago/Turabian Style**

Lu, Wenxia, Xueyong Tian, Yongguang Ma, Yinyan Guan, Libo Liu, and Liwei Shi.
2023. "Modeling Method for Aerobic Zone of A^{2}O Based on KPCA-PSO-SCN" *Water* 15, no. 20: 3692.
https://doi.org/10.3390/w15203692