A Novel Model with GA Evolving FWNN for Effluent Quality and Biogas Production Forecast in a Full-Scale Anaerobic Wastewater Treatment Process

SCNU Environmental Research Institute, Guangdong Provincial Key Laboratory of Chemical Pollution and Environmental Safety & MOE Key Laboratory of eoretical Chemistry of Environment, School of Environment, South China Normal University, Guangzhou 510006, China South China Institute of Environmental Science, Ministry of Environmental Protection, Guangzhou 510650, China Jiangsu Co-Innovation Center of Ecient Processing and Utilization of Forest Resources, Nanjing Forestry University, Nanjing 210037, China College of Chemical Engineering, Huaqiao University, Xiamen 361021, Fujian, China Zhongshan Environmental Monitoring Station, Zhongshan 528400, China


Introduction
Because of the economic advantages and low generation of excess sludge, the anaerobic biological treatment process is an e cient process for treating high-concentration organic wastewater, such as paper-mill wastewater, where the complex organic contaminants can be converted into clean energy (methane gas) in the anaerobic treatment process [1][2][3].However, the anaerobic treatment process is a complicated multivariable system and is in uenced by various in uent characteristics and operating conditions, which is di cult to be solved within a short time [4,5].erefore, biogas (methane) production rates are also in uenced by various in uent characteristics and operating conditions [6].
Because of the nonlinearity, uncertainty, and posterity of the anaerobic treatment process, it is di cult to operate and control that process.To increase the steadiness and reliability of the anaerobic treatment process, modeling is a signi cant method, which can be used in controlling, operation, and optimization of the anaerobic treatment process at a reasonable cost [7].In recent years, numerous studies have been carried out and various modeling methods have been developed to control and simulate the anaerobic treatment process [8][9][10][11].However, because of the superficial understanding of the mechanisms associated with the anaerobic treatment process, it is difficult to analyze and estimate more underlying phenomena in anaerobic digestion using conventional mathematical models.erefore, to eliminate the complicacy, difficulty, and applicability, more practical, secure, and simple models are needed to be investigated [4,12].
Because artificial intelligence has logic thought, fast disposal capability, and nonlinear characteristics, it may carry on the free precision to any continual nonlinear function approaching.
e commonly used artificial intelligence methods are the neural network (NN), fuzzy logic (FL), wavelet transform (WT), genetic algorithm (GA), and metaheuristic algorithms [13,14].Hence, the model based on artificial intelligence can achieve precise simulation results in the wastewater treatment process.
In recent years, a variety of models based on the NN for estimating the performance of the anaerobic treatment process have been conducted by many researchers [15].A backpropagation neural network (BPNN) model integrating the additional momentum method with the adaptive learning rate method was developed to estimate the operational status of the upflow anaerobic sludge bed (UASB) [16].e results indicated that the model can predict and optimize the control parameters and propose strategies of the reactor.In addition, another BPNN model based on the Levenberg-Marquardt algorithm was designed by Sridevi et al. [17], which can be used to successfully predict the biodegradation and biohydrogen production in a hybrid UASB reactor treating the distillery wastewater.Above all, the model based on the NN can efficiently simulate and predict the nonlinear characteristic of the anaerobic wastewater treatment system.However, the NN has some defects, such as converging slowly and immersing in local vibration frequently [18,19].erefore, there are many neural network coupling algorithms, such as the wavelet neural network (WNN) and fuzzy neural network (FNN), to be proposed to solve the problems faced by the ordinary NN [20][21][22].e FNN based on fuzzy logic (FL) and NN can realize FL by the NN.In the meantime, the coupled algorithm can capture fuzzy rules effectively and realize fuzzy reasoning by using the NN structure.So if the FNN is applied in the wastewater treatment system, it will more effectively simulate the wastewater treatment system.
Many research studies about modeling the anaerobic wastewater treatment process using the hybrid FNN have been carried out in recent years [23][24][25].Erdirencelebi and Yalpir integrated FL and NN to develop a hybrid FNN model for simulating the anaerobic wastewater treatment process [2].e results illustrated the developed hybrid FNN model could be used for forecasting the effluent quality accurately in a UASB system.In order to monitor degradation of the penicillin-G wastewater in an anaerobic hybrid reactor, a hybrid FNN model was established by Mullai et al. [26] using the adaptive network-based fuzzy inference system (ANFIS).
e simulation results exhibited that the developed hybrid model was effective and the correlation coefficient (R 2 ) of the model for chemical oxygen demand (COD) values was high.erefore, clarification of the place of the present subject in the scheme of the FNN methodology can be considered a particular field of investigation to evaluate real-time effluent quality and biogas (methane) production rates that are necessary to control the anaerobic process and to establish fault diagnosis.Nevertheless, the FNN also has drawbacks, which are no time-frequency localization characteristics and may easily cause the low convergence rate and accuracy.is is exactly the advantage of the wavelet transform (WT).Hanbay et al. [27] have successfully used wavelet packet decomposition and NN for prediction of the anaerobic wastewater treatment plant.Furthermore, on the basis of kernel principal component analysis and WNN, a soft sensor system could realize real-time detection of redox potential, dissolved oxygen, pH, and COD in the wastewater treatment process [28].
Hence, a new system with the fuzzy wavelet neural network (FWNN) was established by integrating advantages of various intelligent techniques. is network could effectively increase the detection rate and reliability of the model by improving the discernment, generalization, and approximation capacities [3,29,30].Such an integrated intelligent system can overcome the shortcomings mentioned above.
erefore, the hybrid FWNN offers a more efficient method for modeling, simulation, control, and operation optimization of the complex process system, such as the wastewater treatment process.
e performance of the anaerobic treatment process is very complicated and makes remarkable changes based on various influent characteristics and operating conditions, such as organic loading rates (OLRs), pH, hydraulic retention time (HRT), and toxic organic compounds.Various potential advantages based on such an artificial intelligencebased model for real-time evaluation of effluent quality and biogas production rates would be fully demonstrated, such as withstanding various shock loads caused by substantial influent fluctuations, optimizing operational parameters of the process for controlling operational cost, providing an online evaluation and estimation of emissions on an energetic basis, and building a continuous early-warning strategy without requiring a complicated model structure.However, studies on modeling biodegradation and biogas (methane) production rates in a full-scale mesospheric internal circulation (IC) anaerobic reactor treating paper-mill wastewater using the FWNN are very limited.
Based on the relationship between the effluent COD and the biogas flow rate under various operating parameters such as influent COD (COD inf ), HRT, OLR, pH in the reactor (pH), and alkalinity in the reactor (ALK), an FWNN model is developed to predict and estimate the effluent quality and biogas production rates based on the existing historical data.e key objective of this study was to develop a novel hybrid genetic algorithm evolving FWNN model for simulating the functioning problem of a full-scale internal circulation (IC) anaerobic wastewater treatment plant.e proposed hybrid model may be used for analyzing the biogas 2 Complexity production rate and effluent quality over the operational time period, which plays an important role in saving energy and eliminating pollutant discharge in the wastewater treatment system.

Reactor System.
A full-scale IC anaerobic treatment plant system was selected for a demonstration site. is treatment system used in the study is located in Guangdong, China.As shown in Figure 1, the wastewater treatment process including four IC reactors was operated to treat approximately 3 × 10 4 m 3 paper-mill wastewater streams per day.Each IC reactor has a diameter of 9 m and a volume of 1100 m 3 .e treatment system is equipped with online flow, pH, DO, ORP, temperature, COD, and gas flow meter (HACH ® ) sensors.e signals delivered from above parameters were also used to control peristaltic pumps, stirrers, and air blower.e model used data from the full-scale sequential system that were collected over a period of 150 days.Other chemical indexes were determined according to standard methods [31,32].

Identification of Model
Parameters. e identification of model parameters is one of the key demands on modeling the anaerobic wastewater treatment processes.
e most appropriate choice of model components, which can exactly display the running state of the anaerobic treatment process, can help improve the management efficiency and reduce functioning costs of the system [6].
OLR is used to measure the biological conversion ability.is parameter is a vital factor, which can significantly influence microbial ecology and performance characteristics of anaerobic treatment systems.
HRT is an important variable in the anaerobic treatment system.It is used to measure the amount of time the wastewater remains in the system.Retention time of the feed in the system is too short, to complete the entire treatment process, and biogas production will not be restrained.
pH is a chief parameter, which significantly affects the performance characteristics of anaerobic treatment systems.pH has a substantial effect on methanogenic bacteria.
ALK is reflected in the solution, to neutralize acids towards the equivalence point of carbonate or bicarbonate in the anaerobic treatment system.In order to control pH in the anaerobic treatment system, it must ensure there is enough ALK, which is effective in preventing the dramatic changes of pH.
COD is used to measure the organic compounds in wastewater.
is parameter refers to substrate utilization proficiency and microbial metabolic activity in the anaerobic treatment systems.
Biogas production rate is usually used to refer to the processing efficiency of the anaerobic treatment system.In the anaerobic treatment system, the most significant operation is to control the effluent superiority and maximize the rate of biogas production by breaking pollutants.erefore, influent COD (COD inf ), HRT, OLR, pH in the reactor (pH), and alkalinity in the reactor (ALK) were selected as the input parameters of the proposed FWNN model.Biogas production rates and effluent COD (COD eff ) were selected as the output parameters of the proposed FWNN model.

Structure of the Proposed FWNN.
e architecture of the FWNN for modeling the anaerobic treatment system is illustrated in Figure 2.For the FWNN, the wavelet was used for the neuron's activation functions on the basis of the fivelayer NN, and fuzzy inference can be realized [33,34].e FWNN includes five layers as follows.
e first layer consists of all input factors that act as the input layer.e layer data of input factors x 1 ; x 2 ; . ..; x n are the input mode.In this layer, there are five input parameters that are COD inf , HRT, OLR, pH, and ALK, so n � 5.
e second layer is the fuzzy layer.e fuzzy layer set theory was employed to processing of linguistic variables, and the selected membership function was the Gaussian function.
e input characteristic variables were translated into fuzzy variables in this layer, which can be defined as follows: where c ij and σ ij are the center and width parameters of the membership functions, respectively, and i and j are the number of input parameters and linguistic variables in the FWNN, respectively.A self-adapted fuzzy c-means clustering has been used in this work.It has been used to address the fuzzy factors, and 18 sets of fuzzy control rules have been established by analyzing the actual database of knowledge.e third layer is the fuzzy rule layer. is layer consists of numeral hidden units representing fuzzy logic rules and numeral fuzzy partitions.e fuzzy rule base is generated from the given input and output data, and the logical inference can be realized, which can be given as follows: where n is the number of fuzzy rules.e fourth layer is the wavelet network.In this layer, a wavelet network is designed using wavelet functions as the activation function of its nerve cells, based on the good local performance of wavelet transformation.e WNNs are used for the consequence of the FWNN.e output of WNNs with the jth wavelet neuron can be given as follows: wo j � w j ψ j (z), F 18 (x 5 )   Complexity is the translation of the WNNs, and w j is the weight of the WNNs.e fifth layer is the output layer.e total output of the FWNN (y) in this layer is defined as follows: In this proposed design, to monitor the anaerobic treatment system's operational status, effluent COD and production rates of biogas (methane) were chosen as the network outputs.

Training Algorithm to Optimize the Proposed FWNN.
A hybrid learning algorithm was applied to train and optimize the network parameters to further improve the prediction capabilities of the network.It has integrated genetic algorithm (GA) into gradient descent algorithm (GDA) to enhance the efficiency and robustness of the network.
GA is a kind of well-rounded global optimization method that owns the features with strong robustness and broad applicability [35].Since the GDA easily falls into the optimum local and is sensitive to the initial values, the initial values of the network's parameters are first determined by a real-coded GA, and then the GDA is used to train the network, thereby greatly accelerating its convergence.In this work, the formulation of the objective function can be defined as follows: where y dk is the desired value, y k is the output value of the FWNN, and n is the sample number.e output of the FWNN according to the s-th chromosome with y k (L) can be defined as follows: GA is an artificial intelligence method, which simulates natural evolution using the three main operations: selection, crossover, and mutation, to produce better fitness for individuals.e goal of the GA for the selection operation is to give population members (or solutions) more reproductive opportunities with better fitness values.Crossover and mutation operations produce new individuals in combining the information contained in two parents, and they can ensure that the new initial chromosomes are always feasible.
e selection of the tournament is used to get the new generation.For the next generation, the member with the better fitness is selected.
Hence, the chromosome can be operated according to the following real-coded set: where us, the optimal initial variables of the FWNN would be finally obtained with the three genetic operations of selection, crossover, and mutation.
e initial population size N pop is 100 in this design, the crossover rate P c is 0.7, and the mutation interval P m is 0.01.

Parameter Updation through Gradient Descent
Algorithm.As the parameters of the network were initialized by the GA, the parameters of the FWNN and model were verified and revised by the GDA [36].Finally, all the parameters of the developed FWNN were made up of the center and width parameters of Gaussian functions, and the dilation, translation, and weight parameters of WNNs were simultaneously optimized according to the following: where y d is the desired value and y is the output value of the FWNN.Accordingly, the parameter values of the FWNN can be given as follows:

Complexity
where η and ξ are the learning rate and the FWNN developed momentum factor, respectively.

Self-Adapted Fuzzy c-Means Clustering.
In this work, according to the characteristics of the anaerobic treatment system, a self-adapted fuzzy c-means (FCM) clustering algorithm was proposed to deal with the fuzzy factors and thus determine the number of the FWNN's fuzzy rules.Objects are strictly divided into clusters based on the fuzzy clustering method, and the best class number is obtained by the valid analysis of clustering [37].e calculating equations are designed as follows: where B(K) represents the sum of weighted Euclidean distances, J m (U, V) is the objective function representing the minimum square sum of weighted Euclidean distances, K is the number of clusters, n is the number of objects, x j is the observed value, and m is the weighted exponent.d ij represent the Euclidean distance and can be designed as follows: u ij are the membership function values and can be represented as follows: v i are the cluster centers, and the formula for their specific calculation is as follows:

Data Collection and Preprocessing.
In order to evaluate the hybrid FWNN model for the anaerobic wastewater process, 150 datasets were collected, the network was trained with 120 datasets, and 30 sets were proved.Standardization, which eliminates data redundancies and effectively organizes the data, has been used to improve the FWNN's performance.In this work, all datasets were converted to the range between 0 and 1 through scaling.

FWNN Development.
Using all these data, the effluent COD and biogas (methane) production rates were predicted using an FWNN model.In addition, the datasets were analyzed using a self-adapted fuzzy c-means clustering, and the optimal clustering number with 18 sets was identified.e structure model shown in Figure 2 was determined based on the analysis of technology and experimental data as well as the forecast target.It included three models of the FWNN (FWNNCOD, FWNNQ, and FWNNCH 4 ) for COD, Q gas , and CH 4 prediction, respectively.For each model, there was a separate rule basis, but the models' input parameters were the same.
A hybrid learning algorithm was applied after initializing the model structure and parameter to train and optimize network parameters.Because the GDA easily falls into local optimum and is sensitive to the initial values, the initial values of parameters of the network were firstly determined by a real-coded GA, and then the GDA was used to train the network, thereby greatly accelerating its convergence.

Simulation of FWNN Model.
ree FWNN-based models were simulated and verified by the experimental data using the MATLAB program.
e initial population size N pop , crossover rate P c , interval of mutation P m , maximum number of generations, learning rate η, and momentum factor ξ are 100, 0.7, 0.01, 200, 0.02, and 0.5, respectively.Figure 3 sketches the training process of the developed FWNN (taking FWNNCOD for example).From Figure 3, it can be easily understood that this network has virtues of good memory, fast convergence ability, and strongly stable capability.Consequently, the new parameters of FWNN models were obtained by repeated training and studying through the hybrid learning algorithm, as shown in Tables 1  and 2.
Figure 4(a) shows the predictive values of the FWNN models according to the testing datasets.As shown in Figure 4(a), it is easily found that the predicted values are in good conformity with those observed values.In this work, in order to assess the performance of models, various indicators were used to analyze and estimate the developed FWNN models, such as the determination coefficient (R 2 ), correlation coefficient (R), root mean square error (RMSE), mean square error (MSE), and mean absolute percentage error (MAPE).As shown in Table 3, the performance indicators of the proposed FWNN models were acquired by comparing the predicted results with real values.
Table 3 clearly shows that using the FWNN, the MAPE values of 2.9083%, 3.3563%, and 4.0660% for COD, Q gas , and CH 4 could be achieved.R 2 values were 0.9647, 0.9681, and 0.9501, respectively, for COD, Q gas , and CH 4 .R values of COD, Q gas , and CH 4 were 0.9822, 0.9839, and 0.9747, respectively.
e RMSE values of 28.7439, 199.2556, and 155.0499 for COD, Q gas , and CH 4 could also be achieved.Simulations on the proposed model showed that this proposed model not only could accomplish parameter calibration rapidly and find out the optimal solutions of parameters accurately but also could improve the converging rate and the stability of the models.
e results  showed a good concordance with the experimental values predicted.As shown in Table 3, for the three FWNN models, the predictive performance of the proposed FWNN models on effluent quality and production rates for biogas was satisfactory with a very high determination coefficient (R 2 ), which were all over 0.95.In other words, a high R 2 showed that only 3.53%, 3.19%, and 4.91% of the total variations for COD, Q gas , and CH 4 were not explained by the proposed FWNN models.In addition, a high R for the three FWNN models illustrates that there was a good concordance of the predicted values with the experimental ones.Accordingly, based on the other small evaluation indicators (MAPE, RMSE, and MSE), it also shows that the predicted model developed had high predictive accuracy and satisfied robustness and fitness, making the system highly adaptable.

Comparisons with FNN, WNN, and NN.
e developed FWNN models were compared with FNN, WNN, and NN models to demonstrate the correctness, efficiency, and benefits of the hybrid network.Based on the comparison of results, as shown in Table 3, it can be seen that FWNN models have lower RMSE (or MSE) and MAPE values and higher R 2 and R values.Taking COD eff for example, when predicting, R, R 2 , MAPE, RMSE, and MSE values were 0.9822, 0.9647, 2.9083%, 28.7439, and 826.2142 using the FWNN, respectively.However, when using the FNN, WNN, and NN models, R values were 0.9645, 0.9351, and 0.8222, respectively; R 2 values were 0.9302, 0.7697, and 0.6760, respectively; MAPE values were 4.077%, 4.4575%, and 8.3163%, respectively; RMSE values were 41.1297, 55.8223, and 88.2468, respectively; and MSE values were 1.6917 E + 3, 3.1161 E + 3, and 7.7875 E + 3, respectively.
Table 3 shows that FWNN models have higher estimation accuracy and better robustness than FNN, WNN, and NN models, showing that FWNN models are more accurate than FNN, WNN, and NN models for predicting effluent quality and biogas (methane) production rates.e results of this study suggest that the FWNN model was highly capable of extracting the dynamic IC system changes.Considering the nonlinearity, complexity, and randomness of the anaerobic treatment process, such a good predictive performance of FWNN models was particularly important for modeling the wastewater treatment process.e FWNN is a good choice for modeling the IC anaerobic treatment process.e simulated models based on the FWNN model can be effectively applied to a full-scale IC anaerobic reactor to cope with influent variations.e results show that anaerobic wastewater treatment can be better described with the FWNN than the FNN, WNN, and NN.Maintaining environmental standards, FWNN models can effectively achieve the IC anaerobic system's environmental and economic goals in real time.In the future, in order to optimize the anaerobic treatment system, a control system will be developed to monitor and control the system based on the FWNN model.

Multidimensional Graphs of Affecting Factors and Regulating Strategies of IC.
Using the partitioning connection weights (PCW) method, the importance of the influencing factors could generally be analyzed.In this work, four-dimensional graphs with two outputs were used for analyzing the importance of input parameters to outputs.   10 Complexity rarely affected the performance of the treatment system.When the OLR exceeded 15 kg COD/m 3 •d or pH was above 7.5, there was a negative effect on the rate of COD removal and the rate of production of CH 4 , and the negative effect on the rate of COD removal and the rate of production of CH 4 caused by the increased OLR was lower than that caused by low pH.Hence, when the OLR of the treatment system was enhanced by shortening HRT or increasing the influent COD, it was conducive to the stability of the treatment system through adding alkali to improve pH values.

Influence of pH and ALK on COD Removal
Rate and CH 4 Production Rate. Figure 5(b) shows the influence of pH and influent COD on the COD removal rate and CH 4 production rate.Whatever pH was in the system, when ALK was low, it is not good for the rate of COD removal and the rate of production of CH 4 .e treatment system also became immovable at low pH.When the ALK exceeded 2500 mg/L and the pH in the treatment system exceeded 7.5, the rate of COD removal and the production of CH 4 increased.erefore, when the influent concentration of COD was high, pH and ALK values were kept higher than 7.5 and 2500 mg/L, respectively.

Conclusion
e proposed research was to establish an artificial intelligence-based model for modeling a full-scale anaerobic wastewater treatment system.Combining the benefits of the NN, FL, and WT, the FWNN could be used successfully to Complexity predict effluent quality and the rate of production of biogas according to the strong nonlinear ship between its inputs and outputs.e FWNN model showed higher estimation accuracy and better robustness compared to FNN, WNN, and NN models and achieved better performance in predicting effluent quality and production rates of biogas with high determination coefficients R 2 over 0.95.Meanwhile, the FWNN model can be used for analyzing the importance of the affecting factors.e proposed hybrid approach will provide a very impactful and cost-effective tool for modeling the anaerobic process that helps engineers monitor operational parameters to improve the performance of anaerobic treatment.

Figure 1 :
Figure 1: Schematic diagram of the full-scale anaerobic process.

Figure 3 :
Figure 3: Training performance of the FWNN based on hybrid GA-GDA algorithms.

3. 5 . 1 .
Influence of pH and OLR on COD Removal Rate and CH 4 Production Rate.

Figure 5 (
a) shows the influence of pH and OLR on the COD removal rate and the CH 4 production rate.From Figure5(a), when pH and OLR values varied from 6.8 to 7.4 and from 5 to 15 kg COD/m 3 •d, the rate of COD removal and the rate of production of CH 4 increased, respectively.e treatment system was particularly sensitive to changes in pH when the OLR was high.However, when the OLR was above 15 kg COD/m 3 •d, changes in pH values

3. 5 . 3 .
Influence of OLR and ALK on COD Removal Rate and CH 4 Production Rate.Figure5(c) shows the influence of OLR and ALK on the treatment system.When the OLR was lower than 15 kg COD/m 3 •d, the treatment system was rarely affected by ALK, and the CH 4 production rate was low.When ALK was higher than 2500 mg/L, especially when it increased from 3000 mg/L to 3500 mg/L, the CH 4 production rate decreased dramatically with the changes of ALK. e COD removal rate was low when the OLR was over 18 kg COD/m 3 •d.If the OLR continuously remained higher, the worsening trend in the treatment system would have occurred.If the OLR remained constant, the COD removal rate rules were obtained with the change of ALK.Moreover, it was shown that the optimal influent OLR was about 15 kg COD/m 3 •d when the treatment system ran in the operating conditions with a pH of 7.5 and alkalinity of 3000 mg/L.

Figure 5 :
Figure 5: Impact of the parameters (a) pH and OLR, (b) ALK and pH, and (c) ALK and OLR on COD removal and CH 4 production rates.

Table 1 :
Parameters of the FNNCOD.

Table 2 :
Wavelet layer parameters of the FWNNCOD.

Table 3 :
Performances of the FWNN, FNN, WNN, and NN in modeling the IC anaerobic system.