Artificial Neural Network-Cuckoo Optimization Algorithm ( ANN-COA ) for Optimal Control of Khorramabad Wastewater Treatment Plant , Iran

In this study a hybrid estimation model ANN-COA developed to provide an accurate prediction of a Wastewater Treatment Plant (WWTP). An effective strategy for detection of some output parameters tested on a hardware setup in WWTP. This model is designed utilizing Artificial Neural Network (ANN) and Cuckoo Optimization Algorithm (COA) to improve model performances; which is trained by a historical set of data collected during a 6 months operation. ANNCOA based on the difference between the measured and simulated values, allowed a quick revealing of the faults. The method could obtain the fault detection and used in solving continuous and discrete optimization problems, successfully. After constructing and modelling the method, selected performance indices including coefficient of Regression, MeanSquare Error, Root-Mean-Square Error and Aggregated Measure used to compare the obtained results. This analysis revealed that the hybrid ANN-COA model offers a higher degree of accuracy for predicting and control the WWTP.


Introduction
Municipal and Industrial wastewaters are accounting for several types of contaminators released into the aquatic environment.Improper operation of a Wastewater Treatment Plant (WWTP) may bring rising concern about environment and public health problems [1].
The developments of a control system for the WWTPs are important to maintain high performance and to keep the process stable [2][3][4].In the last two decades, there has been constantly increasing interest in Artificial Neural Networks (ANNs) as a reliable model for efficient monitoring, predicting performance and controlling the operation and variables of the process in the complicated nonlinear and multivariable processes such as chemical engineering process, bioprocess and wastewater treatment process [5][6][7][8].For any WWTP, the reliable ANN technique is essential in order to avoid process failure [9].To this end, ANNs have been developed to predict WWTP performance with a higher degree of accuracy and solve complex engineering problems more rapidly [10].
ANNs comprise interconnected group of nodes (artificial neuron) with weighted connections (synaptic weights) from the output of one neuron to the input of another to estimate or approximate functions that can depend on a large number of inputs [11][12][13][14].However, ANN is used in many areas of environmental science as a promising tool because 556 of its simplicity in performance but; utilization of optimization algorithms can significantly enhance ANN performance and its limitations such as the slow rate of learning and the risk of entrapment in local minima [10].
As a result, Cuckoo Optimization Algorithm (COA) represent a powerful population-based stochastic approach that can adjust the weights of interconnections and biases of ANN (the process of training) in order to enhance its performance; so that error between the actual and the desired correct output of a ANN is minimized [15].Some researchers have reported the successful use of Hybrid Optimization Algorithms-ANN models in control and prediction of wastewater treatment process [15][16][17][18].
In this study, the evolutionary COA hybrid with the ANN was applied for the first time in the control of a WWTP performance, which is inspired by the lifestyle of a bird family called cuckoo [15].Specific egg laying and breeding of cuckoos are the main parameters of the COA [19].The proposed algorithm has forced some benchmark functions to improve their capability to deal with difficult simulation problems [20].
In the present study, an intelligent system namely hybrid COA-ANN, was developed to control a WWTP performance.The study presents an optimization approach for non-linear identification of WWTP using a hybrid model.The developed model is discussed, and the best examples selected for use in environmental process modeling.The ANN was based on the COA to predict important process stability variables.This study is expected to obtain a control system as the prediction model and controlling system for a WWTP, to keep process stabile with high performance in wastewater treatment.The approach used in this study will make WWTP more reliable, usable and give quicker process response.

Wastewater Treatment Plant (WWTP)
In the model structure the aerated lagoons are taken into consideration.The WWTP studied in this paper is located in Khorramabad, (Iran); consists of static screens, pumping station, anaerobic lagoons, aerated lagoon, sedimentation and chlorination tanks (Figure 1).

Data Used
In a wastewater treatment plant, the most important parameters are biochemical oxygen demand (BOD), chemical oxygen demand (COD) and suspended solid (SS) which can be used to evaluate plant performance.So, to construct the model structure of this study, totally 9 wastewater quality parameters (T, PH, DO, BOD, COD, TSS, TDS, NO3, PO4) were selected as input variables.The output ANN model includes BOD, COD and TSS.142 non-consecutive data were obtained from the daily measurements of 6 months operation of aerated lagoons in the WWTP.All parameters were analyzed according to Standard Methods for the Examination of Water and Wastewater book (SMEWW) [21].

Artificial Neural Network (ANN) Model
Neural Network Toolbox V7.12 of MATLAB mathematical software with a feed forward neural network-back propagation algorithm used to predict and simulate the output parameters [19].The main benefits of the ANN in comparison to other modeling programs are the nonlinearity, adaptively, fault tolerance, uniformity of analysis and design.
Since ANN is characterized by weights (connection strength) and activation (transfer) function components; so three layers of the neural network composed of 12 neurons in hidden layers and the Levenberg-Marquardt (LM) algorithm were used.At first, the available data set was randomly partitioned into train and test sets.About 80% of the available record was selected for training while the remaining 10% was used for testing, and 10% was used to validation.To determine the optimal architecture, ANN was trained with different iteration numbers (epoch) and numbers of neurons in the hidden layer [8].For created neural network the general structure of input, one hidden and one output layer was used.
The hyperbolic tangent sigmoid (Equation 1) used as transfer function between input and hidden layer and linear transfer function (Equation 2) as transfer function between hidden and output layer [19].The functions are shown by the following equations.

tan ( ) 1
x x e sig f x e (1) Training of ANN with back propagation algorithm is an iterative optimization process where the mean squarederror (Equation 3), the error between the predicted (simulated) and actual data is minimized appropriately with BK [19]. Where: During the training step the BP adjusts the weights and bias in each layer to reduce the MSE between the predicted and experimental data until the convergence to the certain value is achieved [19].Although BP has disadvantages because of using gradient descent by getting into the local minimum of the error function [15].

Cuckoo Optimization Algorithm (COA)
There are many heuristic techniques described in the artificial intelligence (AI) to perform various tasks within the supervised learning sample; such as optimizing training, selecting an appropriately sized network, and predicting how much data will be required to achieve a special generalization performance [22,23].One approach to overcome the gradient descent problems with ANNs is adapting evolutionary algorithms such as Cuckoo Optimization Algorithm (COA).Figure 2 shows the flowchart of a COA.

Data Analyze
SPSS (ANOVA 1) used to statistical analysis of the experimental data.To express the error rate and comparison of simulated and real parameters, the regression coefficient (Equation 4), root mean square error (Equation 5) and AM (Equation 6) parameters were used.These parameters were calculated through relationships, respectively: )( ) Where: Measured values (observed) AM or aggregated measure composed of three parameters; MB, NS and rmod (Equation 6): Model Bias (MB) indicates the average difference between observed and simulated parameters and is an indicator of the ability to reconstruct the (simulated) performance of water treatment plants (Equation 7).MB is the most important criterion for comparison of results.A MB of low values indicates a good compliance and zero value indicates the complete compliance between the observed and simulated data [21].
NS represents the quality of the simulation parameters and changes between .A NS of 1 (NS=1) indicates the complete compliance between the observed and simulated data: is calculated as Equation 9.An of 1 meaning that the estimator predicts observations of the parameter with perfect and accuracy correlation.and as the standard deviation of observed and simulated parameters are the correlation coefficient between such data [23] mod min , AM is determined by assuming the MB, NS and .The results for classification of AM are provided in Table 1.

Experimental Data
In this study, the performance data of 6-month operation of aerated lagoons in Khorramabad's municipal wastewater treatment plant, Khorramabad-Iran was used.Values of the WWTP Parameters during 6 months measurements are provided in Table 2.In this study, ANN employed as a flexible nonlinear function approximation to determine the close approximation relationship between desired input and output data.For this, 9 variables including T, pH, DO, BOD, COD, TSS, TDS, NO3 and PO4 were selected as input data.Totals of 142 various experimental data were randomly divided into three subsets: 80% for the training set (the performance of an ANN model depends on the data set for its training), 10% for the validation set and 10% for the test set.
Designing of architecture is the first step in training of ANNs, because of the closely relationship of data processing ability of an ANN to the weights and architecture.The number of neurons in the input and output layers were fixed 9 and 1, respectively (based on the number of inputs and output data in this study).Determining neuron number(s) in the hidden layer is the most important task in the designing of ANN architecture [10].
Based on considering the number of input and output parameters used in this research, the number of neurons in the hidden layer was investigated from 1 to 20 to obtain the optimal number of neurons.Accordingly, a range of models were constructed for which the network performance was evaluated using the results of R and MSE, as shown in Table 2.

Model
No.

Neurons in hidden layers
Network results According to the obtained R and MSE values for both training and testing datasets, model no.5, with 12 hidden neurons (maximum R and minimum MSE), was found to perform better than other constructed models.Therefore, the obtained optimal architecture of ANN model was 9:12:1 for three BOD, COD and TSS target parameters (Figure 3).The Comparison between daily performances of Khorramabad WWTP for effluent BOD5, COD and TSS and ANN model using regression analysis (R) is shown in Figure 5a-c.The maximum regression was 0.63 and 0.54 for Ytr and Yts of BOD, 0.76 and 0.6 for Ytr and Yts of COD, 0.59 and 0.13 for Ytr and Yts of TSS.

COA
The COA algorithm was used to optimize the input space of ANN model with the objective of optimal control of WWTP performance.The values of COA-specific parameters were: maximum number of cuckoos = 50; maximum number of eggs = 9; minimum number of eggs = 2 and ELR = 0.5.The Comparison between daily measured effluent BOD5, COD and TSS and predicted data of them by COA-ANN model is shown in Figure 6a-c.According to this figure, the COA-ANN model resulted in a good fit for the measured variables.In some days, the removal efficiency was low.These days has coincided with the winter season, so the biological activity and settlement of the biomass were decreased as an effect of cold weather.It was subsequently resulted in high effluent turbidity and COD.For this system, BOD, COD and TSS are varied in the range of 192.25 to 227.66 mg/l, 262.25 to 318 mg/l and 116 to 181.5 mg/l, respectively which matches with the recommended values for the response in wastewater treatment systems [24,25].The average of BOD5, COD and TSS removal efficiency was 80.3%, 76.87% and 94.66%, respectively.In some points, the removal efficiency was found to be low in comparison with other days (lower than 50%).This is because of sludge dispersion caused by the operating conditions applied prior to this event.The quality of match between the COA-ANN model and measured concentrations was determined by regression analysis.Figure 7a-c demonstrate the measured versus modelled values for the BOD, COD and TSS.The narrow band of error measures for the three predicted parameters is an indication of the ANN's validity.The model shows enough accuracy for prediction of actual values.Successful application of COA with ANNs has been reported to some few research works [19,20].by Rajabioun [20] which tested on 5 benchmark cost functions.The capability of each bird in dealing with the previous experiences of the COA is known as cuckoo intelligence, an ability that directs the population towards the optimum goal.The goal is determined by an objective function, with the corresponding value of the objective function for each bird determining its fitness.The optimal data has been selected after the evaluation of COA for 100 iterations, to achieve best outputs.The optimized outputs using COA are as follows: BOD = 42.38,COD = 67.58,TSS = 17.64.The mean squared error (MSE) between the predicted and measured data was 30.53 (YtrNet) and 42.3 (YtsNet) for BOD, 26.08 (YtrNet) and 33.35 (YtsNet) for COD and 51.37 (YtrNet) and 45.21 (YtsNet) for TSS.The maximum regression was 0.75 (YtrNet) and 0.7 (YtsNet) for BOD, 0.82 (YtrNet) and 0.76 (YtsNet) for COD, 0.73 (YtrNet) and 0.65 (YtsNet) for TSS.These results confirm the validity of the constructed COA-ANN model in comparison to ANN model for optimization the targets.The COA-ANN results (regressions) are better than those obtained from the ANN.According to the comparative analysis, the performances of the COA-ANN and ANN in modeling the WWTP are presented in Table 4.It is clear from Table 4 that the COA-ANN has smaller MSE and RMSE as well as bigger R than the ANN model.The COA-ANN with an AM of 0.86 (class=excellent) represents the best model.In other words, the COA-ANN achieved better performances than the ANN model.The large quantity of variable information spread in the dataset and the wide concentration ranges, such good prediction performances of COA-ANN model for the parameters was achieved.Therefore, COA-ANN is a good choice for modeling WWTP performance.The COA-ANN model can be effectively applied to the WWTP in order to cope with influent variations.Meanwhile, with the environmental standards maintained, the COA-ANN model can effectively achieve both environmental and economic objectives of WWTP in a real time.

Conclusion
In this study, a novel evolutionary algorithm (COA) suitable for continuous nonlinear optimization problems was introduced to design the COA-ANN model (combination of the ANN and COA).The developed COA-ANN model was used with the available operational input variables (pH, T, DO, BOD, COD, TSS, TDS, NO3 and NO3) for controlling the effluent BOD, COD and TSS during 6 months operation.
The COA-ANN model in this study is expected to have a great application for controlling the WWTP.The comparison of COA with ANN model showed the superiority of COA in fast convergence and optima achievement.COA could find a very good and acceptable estimation of the 3 targets.It should be noted the higher performance of COA-ANN in reaching better results than ANN.Its evidence, COA can be considered as a successful mimicking of nature; suitable for optimization problems of wastewater treatment process with neural networks.
The control method, based on the difference between the measured concentration values and COA-ANN simulations, allowed a quick revealing of the faults.Experimental results showed that the proposed method can obtain the fault detection and used in solving continuous and discrete optimization problems, successfully.The present study demonstrates the capabilities of the COA to optimization of weights and architecture of artificial intelligence (AI) techniques simultaneously.The results demonstrate that COA-ANN presents a good tool to help operator to control the performance of the WWTP.The COA-ANN was found to be faster and superior to ANN technique used to estimate reliability in wastewater treatment.

Acknowledgment
The authors would like to extend their sincere gratitude and appreciation to the health faculty of KhorramAbad for all its support that made this research possible.

Figure 1 .
Figure 1.Schematic diagram of the WWTP

Figure 4 .
Figure 4. Training, validation and test mean squared errors (MSE) for the BOD (a), COD (b) and TSS (c) predicted by the ANN

Figure 6 .
Figure 6.Measured targets values of BOD (a), COD (b) and TSS (c) via predicted values (Outputs) of them by the COA-ANN model