Qualitative Evaluation of Wastewater Treatment Plant Performance by Neural Network Model Optimized by Genetic Algorithm

: The adverse effects of improper disposal of collected and treated wastewater have become inevitable. To achieve the desired environmental standards, in addition to the construction of wastewater treatment plants, there is also a need to evaluate the continuous performance of treatment systems. In Iran, treated wastewater is mostly used in agriculture. Therefore, the use of wastewater with poor quality characteristics can endanger health. In this study, the neural network model's efficiency was investigated to predict the performance of the Perkandabad wastewater treatment plant in Mashhad in Iran. To achieve this, first, the factors affecting the TBOD parameter were identified as one of the quality indicators of the effluent. In the next step, using a genetic algorithm and network input factors, the performance of the treatment plant was predicted and evaluated. The highest correlation coefficient for the TBOD parameter was 0.89%. The results show that among the input parameters in the model, the amount of organic matter pollution load has the greatest effect on this prediction.


INTRODUCTION
Today, population growth and industrial development have led to increased water consumption and, as a result, higher wastewater production and environmental pollution [1,2]. Improper disposal of urban and industrial wastewater causes adverse environmental effects. The implementation of wastewater projects in urban and rural areas is considered necessary and fundamental for environment preservation efforts [3]. The most important objectives during the construction of wastewater treatment systems include different aspects, such as maintaining public health, environmental protection, prevention of pollution of water resources, and reuse of treated wastewater [4]. The quality of effluent from the treatment plant is important both in terms of its uses in sectors such as agriculture and industry, and its final disposal site [5]. The quality primarily depends on important factors like the principles and parameters used during the design of the plant itself, accuracy in the design, and how it is used. Therefore, accurate design and proper management of wastewater treatment plants are among the most important factors in the water and wastewater sector. Currently, the operation of many wastewater treatment plants in our country is facing problems due to various factors, such as improper design, quantitative and qualitative changes in wastewater, process conditions, fluctuations in weather conditions during seasons, etc. Therefore, the use of methods that can predict the performance and efficiency of wastewater treatment plants and help to overcome the aforementioned problems is of particular importance. Based on these predictions, short-term and long-term management solutions can be provided. The operators can take the necessary measures before the problems occur and exercise proper control of the operations. One of the most widely used forecasting methods in the field of water and wastewater treatment is the artificial neural network method [6].
It is important to emphasize that the establishment of wastewater treatment plants alone does not address all environmental concerns, but the performance of treatment plants must be constantly monitored to achieve the desired environmental standards [7]. Wastewater treatment involves a set of complex physical, chemical, and biological processes whose dynamics are nonlinear and sometimes variable with time and can directly interfere with the operation of the treatment plant [8]. Among the common parameters used to evaluate the performance of wastewater treatment plants is the amount of oxygen required for biochemical processes (BOD), the amount of oxygen required for chemical processes (COD), the concentrations of suspended and soluble solids, and the pH of the effluent from the treatment plant [9]. The use of water from wastewater treatment plants can, in some cases, help solve the water shortage crisis in sectors such as agriculture and industry, but only if the number of effluent pollutants complies with the standards [10].
In 2004, Oliveira Esquerre et al. used a neural network to obtain a satisfactory prediction of the BOD effluent from a wastewater treatment plant in Brazil. In this study, researchers first tried to predict the BOD parameter at the inlet and outlet of the treatment plant using linear regression models. They did not consider the use of linear regression to model the aeration lagoon treatment system in an industrial treatment plant suitable for the output parameters, therefore, the use of regression models for aeration lagoons was not recommended. The researchers then applied interesting neural network models to the paper industry wastewater treatment system in Brazil, which had an aerated lagoon, and evaluated the neural network model for aerated lagoon systems and similar systems [11]. Cao et al. [12] used an artificial neural network to predict the effect of changes in the parameters of an anaerobic B-2 system on its performance and used a parallel multi-population genetic algorithm to optimize the weights of the artificial neural network. The results of these researchers showed that the combination of these methods could provide a good tool for predicting changes in the performance of an anaerobic system. The researchers also e-ZBORNIK

23/2022
Dadar, S., Pezeshki, A., Đurin, B., Dogančić, D. Qualitative evaluation of wastewater treatment plant performance by neural network model optimized by genetic algorithm concluded that due to the adaptations of these tools to different environmental conditions, they could be extended to other treatment systems. Abu Qdais et al. [13], used an artificial neural network and genetic algorithm as a tool to simulate and optimize the biogas production process in the digester of the Russaifah biogas plant in Jordan.
Fang et al. [14] developed a comprehensive dynamic model (including a mechanical model, a neural network model, and a genetic algorithm) to simulate the performance of a municipal wastewater treatment plant with significant fluctuations in inlet flow, and the neural network weights were optimized by genetic algorithm. Gueguim Kana et al. [15] modeled and optimized biogas produced from wastewater, including sawdust, cow dung, banana foliage, rice bran, and paper, using a neural network using a genetic algorithm. The results of this study showed the effectiveness of the neural network model-genetic algorithm for nonlinear system behavior and optimization of biogas production [15]. Pieuleac et al. (2013) in the paper [16] developed a neural network optimization method and genetic algorithm and applied it to a real electro-coagulation process. Validation of optimization results using experimental data showed an error of less than 11%.
This research has been used to develop and evaluate the efficiency of the neural network model and genetic algorithm in evaluating the performance of a large and important treatment plant in Mashhad and estimating the quality factors of its effluent.

One of the most important municipal wastewater treatment plants in Mashhad is
Perkandabad wastewater treatment plant No. 1 (Figure 1), which is located on the southern bank of the seasonal river. The nominal capacity of this treatment plant is 15,200 cubic meters per day and the population covered by it is 100,000 residents. The treatment process used in this treatment plant is an aerated lagoon with complete mixing, and the raw wastewater is treated by passing through the waste collection unit, aeration lagoons, sedimentation ponds, execution pond, and disinfection unit. Due to the discharge of effluent from the Perkandabad No. 1 treatment plant into the river at certain times of the year, the design of this treatment plant is based on surface water discharge.

Qualitative evaluation of wastewater treatment plant performance by neural network model optimized by genetic algorithm
The parameters examined for wastewater quality assessment were BOD5 (biochemical oxygen demand in 5 days), COD (chemical oxygen demand), TSS (total suspended solids), and pH. Meteorological data was also used, including average daily air temperature, sunshine duration, and daily rainfall.
To start modeling the neural network, first, the data was randomly divided for testing. The input and output data and the model architecture are shown in Figure 2. The most complex artificial network, which often includes the parameters considered in this research, is the artificial MLP network. Given that according to the Kolmogorov theorem, the maximum number of layers of a nonlinear network is 3 layers, one of which is the output layer, so having 2 layers can solve the problem.
Before entering the features into the model, the corresponding weight was considered for each parameter. In this study, vectors [0,1] were defined for the model so that if the weight of the property is zero, this property will be practically ineffective in the system. Assuming that there are n neurons in each layer in this model, it involves examining the structure of n2+n different states (n states in the first layer and n states in the second layer) but given that there is a layer deletion mode, then there is a total of n+1 state. Statistical indicators used in this analysis include correlation coefficient, root mean square of relative error, and absolute mean percentage of relative error. Based on quantitative and qualitative data of incoming wastewater, process conditions, meteorological information, and, finally, the effluent were determined as the factors affecting the performance of the treatment plant. The next step was the prediction of the concentrations of parameters in the effluent based on the determining factors and the neural network model. To achieve higher accuracy in the refinery modeling, a genetic algorithm was used to optimize the neural network. Finally, the concentration of each of the three parameters in the effluent was predicted and the statistical criteria of correlation coefficient R, mean relative root squared prediction error (rRMSPE), and the mean absolute percentage of relative error (rMAPE) were measured with their actual amount, and thus the model was evaluated [17]. It should be noted that the percentage of two indicators, rRMSPE and rMAPE, should not be higher than 20%.
The correlation coefficient:

RESULTS
In this study, the genetic algorithm sought the optimal answer for 450 generations and evaluated 150 possible answers in the search space in each generation. For the BOD parameter, the results of 5 model runs are summarized in the effluent. The maximum and minimum values of the correlation coefficient of the results obtained from the model were equal to 0.93, 0.86, and 1.08, respectively, the average of which was calculated to be a suitable number due to the semi-modern nature of the treatment plant (Table 1). Examination of the number of selected neurons in the first and second hidden layers showed that in 16% of cases, the network had two hidden layers, with the average number of neurons in the first layer being 16 and in the second layer 11. In the remaining 84%, the network had only one hidden layer, with an average of 14 neurons. On average, the best network structure had two hidden layers with an average number of neurons in the first layer of 15 and 2 in the second layer. Furthermore, the network had only one hidden layer with 11 neurons at the maximum value of the correlation coefficient (R). GA-ANN model with a maximum correlation coefficient of 0.93 and rRMSPE and rMAPE error rates of 10% and 7% has been an efficient model in predicting the concentration of the TBOD parameter and has provided accurate results. This means that it can be used in modeling treatment plants. Due to biological treatment, parameters affecting the growth and activity of microorganisms such as input TCODin/TBODin ratio, dissolved oxygen content, aeration lagoon temperature, and input TBOD load were also prioritized in the model predictions. Based on the results obtained from the optimized artificial network model, the factors affecting the performance of the mentioned treatment were determined by the TBOD parameter. In Table 2, a summary of the results is seen, along with the weight of each parameter.

23/2022
Dadar, S., Pezeshki, A., Đurin, B., Dogančić, D. In the above table, two parameters (discharge and pollution load) are among the input parameters that play an important role in predicting the quality of wastewater. Based on the available data, it was observed that the flow rate was higher than the designed flow rate in most cases, and one of the available solutions could be to reduce the input flow rate. Among process parameters, dissolved oxygen (DO) and lagoon temperature had high priority in predicting effluent TBOD. In general, the type of aeration system and its rate can be directly linked to dissolved oxygen. Lagoon temperature, as well as TSS precipitation rate, was effective. One of the best ways to improve the performance of the treatment plant was the use of a deep aeration system instead of surface aeration, which effectively increases the concentration of dissolved oxygen, increases the temperature of the aeration lagoon content, and creates the desired mixing. Since the aeration lagoon system is situated in the open, it is practically and directly impossible to take effective action to control the effect of air temperature (TAIR) on the treatment system. However, by using deep aerators instead of surface aerators, the effect of air temperature on the temperature of the aeration lagoon content can be reduced. Because the air is more in contact with the surface of the aeration lagoon, the highest heat energy loss occurs in surface aerators. According to the test results of this study, the most important parameter in predicting the quality of wastewater was the amount of inflow. Based on the statistics and information from the project, the inlet flow rate to the treatment plant in the following years can be obtained with a good approximation in the mentioned project, with the rate of increase of TBOD and TSS input concentration for every 10 years being equal to 5%. Therefore, considering this increasing rate, the concentration of TBOD and TSS of wastewater entering the treatment plant each year in the period 2021-2025 is estimated to be 1.005. To predict the quality of the effluent, assuming no corrective action to improve the performance of the treatment plant, the model was implemented in two modes. In the first case scenario, the network structure and the weight of the features were considered following the case where the model had the maximum correlation coefficient. In the second case, the average number of neurons in each layer and the mean weight of the features in 15 times of model execution were considered for the structure and weight of the features. In the first case, the implementation of the model about the TBOD parameter provided better results, which are summarized in Figure  3.

Qualitative evaluation of wastewater treatment plant performance by neural network model optimized by genetic algorithm
These concentrations are much higher than the standard TBOD parameter in the effluent. Therefore, it is necessary to implement appropriate strategies to improve the quality of the effluent as soon as possible and ensure the efficiency of the solutions and the real improvement of the quality of the effluent during different stages according to the model predictions.

CONCLUSION
The present study was conducted to evaluate the performance of the Mashhad wastewater treatment plant and to estimate the quality factors of incoming wastewater and effluent to develop and evaluate the efficiency of the optimized artificial intelligence network model. In general, based on the results of the conducted study, the results were as follows. In semimechanical treatment plants, various factors affect the performance of the system. In general, these factors can be divided into three groups: quantitative and qualitative parameters of incoming wastewater, process parameters, and climate parameters. Based on the obtained results, the most important factors affecting the performance of the Mashhad treatment plant were inlet flow rate, TCODin/TBODin ratio, temperature and load of organic matter in the incoming wastewater, and among the process factors, the amount of dissolved oxygen, temperature and pH in lagoon content and several active aerators. Climate factors affecting the performance were air temperature and the number of sunny hours. The neural network model was optimized by a genetic search algorithm with a complete search, and the results were obtained in the maximum correlation coefficient for the TBOD parameter equal to 0.89 and the corresponding rRMSPE and rMAPE for the qualitative parameter equal to 10% and 7%, respectively. The neural network model singled out important parameters in predicting the concentration of TBOD parameter in the effluent-the discharge rate and a load of organic matter pollution of incoming wastewater, among process factors-dissolved oxygen concentration, lagoon content temperature, and several active aerators and from climatic conditions-air temperature. The inlet discharge of the studied treatment plant in comparison to other inlet characteristics had a higher weight in predicting the concentration of the TBOD parameter of the effluent. Therefore, to improve the performance of the said treatment plant, necessary measures should be taken to reduce and control the inlet flow to different units of the treatment plant.