Forecasting Oxygen Demand in Treatment Plant Using Artificial Neural Networks

Modeling the wastewater treatment plant is difficult due to nonlinear properties of most of its different processes. Due to the increasing concerns over environmental effects of treatment plants considering the poor operation, fluctuations in process variables and problems of linear analyses, algorithms developed using artificial intelligence methods such as artificial neural networks have attracted a great deal of attention. In this research, first using regression analysis, the parameters of biological oxygen demand, chemical oxygen demand, and pH of the input wastewater were chosen as input parameter among other different parameters. Next, using error analysis, the best topology of neural networks was chosen for prediction. The results revealed that multilayer perception network with the sigmoid tangent training function, with one hidden layer in the input and output as well as 10 training nodes with regression coefficient of 0.92 is the best choice. The regression coefficients obtained from the predictions indicate that neural networked are well able to predict the performance of the wastewater treatment plant in Yazd.


INTRODUCTION
To better and more efficiently control the performance of wastewater treatment plants, one can use a powerful mathematical tool, which is the basis for the recorded information associated with some essential parameters of wastewater during operational periods of the treatment plant. Traditional modeling which was used for biological processes and linear programming was based on writing equations for the rate of growth of microorganisms and formation of products  Daghighi, 2017). Use of methods capable of predicting the performance and efficiency of wastewater treatment plants especially based on quantitative and qualitative changes of the input wastewater is of great importance. Based on these predictions, the operator can adopt the necessary measures before incidence of problem, thereby applying suitable control and operation, preventing discharge of contaminated wastewater into the environment, returning the wastewater to the beginning of the treatment line (Eggen et al., 2014;Moles et al., 2003;Daghighi at al., 2017;Mahadevan et al., 2003). Artificial neural networks (ANNs) are among the methods for advanced statistical prediction, which have found extensive uses across all scientific fields. Neural network belongs to advanced statistical methods capable of predicting nonlinear and complex relations between inputs and outputs. Thus, to control the performance of wastewater treatment plants better and more efficiently, one can use a powerful mathematical tool, where the basis of the recorded information is related to some major parameters of wastewater during the treatment plant operational periods. Various research has been conducted about prediction with neural networks in different subjects. Haghiri et al (2018) modeled Wastewater Treatment Plant in Ardabil using ANN. In this study an optimal multi-objectivedesign of neural networks was performed for modeling and optimizing the coagulator materials used in water treatment in Water Treatment Plant in Ardabil province,this research has been welcomed significantly by the Water Treatment Plant in Ardabil province. Han and Qiao (2012) employed ANN for predicting the efficiency of treatment plant. In this research work, ANN modeling was evaluated for predicting the efficiency of this treatment plant, which is equipped with active sludge system with diffusion aeration. Cao et al (2008) utilized ANNfor predicting the changes in parameters of an anaerobic system. To optimize the weights of the ANN, they used multi-population genetic algorithm. Mjalli et al (2007) employed ANN models to predict the values of BOD, COD, and TSS parameters of the wastewater of Doha treatment plant with active sludge system. They found that ANN enjoys a very high accuracy in predicting and estimating the operational parameters of wastewater treatment plants.

Case Study
The wastewater treatment plant in Yazd is located in the northwest of the town, 15 km ways from it, close to Yazd Wastewater Pond. It has an area of about 250 hectares. Based on these studies, the treatment plant has been designed in two stages. Its construction operations began in July 2012 and were exploited in the first half of 2017. The covered population in the year of origin (2012) was 24900 people, while in the goal year (2026), it will be 60000 citizens.

II. METHODS AND MATERIALS
An ANN is an idea which has been inspired by biological nervous system for information processing. ANN processes information like the brain. The key element in this idea is the new structure of information processing system. This system consists of numerous highly interlinked neurons, which operate together for solving a problem. ANNs, like humans, learn through examples. An ANN is adjusted for performing a certain task such as pattern recognition and information grouping along a learning process. In biological systems, learning occurs with adjustments in synaptic links among the nerves. This method also applies to ANNs (Dawson &Wilby, 2001). Fig. 1 represents a general schema of ANNs. Based on the figure, every network consists of an input layer, one or several middle layer, and one output layer. Each layers is composed of some neurons. Every neuron receives the information from an input series, which act as dendrites in real neurons. After processing, that neuron delivers it to its output which indeed plays the role of synapses of a nervous cell. The output of this neuron is then used as the input for the next neuron. The number of neurons in the input and output layers is determined in proportion with the problem for which the network is used. Regarding the middle layer, the number of neurons is specified by the user through trial and error.

Input data
The output data in this research is chemical oxygen demand (COD), while the input data include the treatment plant's input flow rate (Qin), its output flow rate (Qout), the biological oxygen demand of the treatment plant's input wastewater (BOD5in), the chemical oxygen demand of the treatment plant's input wastewater (CODin), pH of the treatment plant's input wastewater (pHin), the plant's output wastewater (pHout), and total suspended solids of the plant's input wastewater (TSSin). In the stepwise multiple linear model, the most effective parameters are incorporated in the model. According to the regression coefficient, three equations were estimated for the COD of the output wastewater as follows: Model 1, with regression coefficient 0.619, CODout= 11.091 + 0.071BODin According to Table 1 and in Model 3, the BOD of the input wastewater into the treatment plant has the maximum impact on the output. Next, using the three mentioned parameters in Model 3, prediction was performed.

Error analysis
To obtain the best topology, the criterion used is error and regression coefficient between observational and computational data. For this purpose, the Eq. 1 have been used.
Eq. 1 where r is the regression coefficient between the observational data (x) and computational data (d), N represents the number of data, ̅ and ̅ are the mean values of the computational and observational data, respectively. r value is always between -1 and 1. The closer its value to 1, the more complete the correlation is between the two variables in a direct fashion.
Eq. 2 where MSE is the mean squared error, P represents the number of elements being processed in the output, N shows the number of data in the data series, yij indicates the network output for sample i in the elements being processed j, and dij is the output related to the prediction parameter for sample i in the element being processed j.

Neural network design
Network design means selecting the number of training nodes, number of hidden layers, and type of training function. This is because the experience of this research proved that these factors affect the prediction accuracy. In this research, for prediction out of 3, 10, 25, 50, 100, 500, and 1000 training nodes, 1, 2, and 3 hidden layers in the input and output as well as sigmoid function, sigmoid tangent, linear sigmoid tangent, and linear sigmoid functions have been used. The utilized network is multilayer perceptron and the training rule is momentum. A total of 84 models were specified for this research. In order to select the best scenario, error analysis method was used. For this purpose, the network was trained by different scenarios and the prediction error was calculated. The number of hidden layers, number of nodes, and type of training function with the minimum error were considered as the best options. Based on the obtained results, the effect of these factors on the prediction accuracy is very considerable. The following diagrams reveal the regression coefficients between predicted as well as observational data and the number of different layers and nodes for the four functions utilized. ://dx.doi.org/10.22161/ijaers.5.3.8  ISSN: 2349-6495(P) | 2456-1908(O) www.ijaers.com Page | 53  /dx.doi.org/10.22161/ijaers.5.3.8  ISSN: 2349-6495(P) | 2456-1908(O) www.ijaers.com Page | 54 tangent function has the minimum sensitivity to node change, while the sigmoid function is the most sensitive one. In addition, the sigmoid tangent function has the minimum sensitivity to changes in the number of layers, while the sigmoid function is most sensitive. Based on the results, sigmoid tangent function is the best function, while the linear sigmoid is the worst function. The following figures demonstrate the training error analysis, validation, and test for the best neural network scenario.

IV. CONCLUSION
Use of ANNs can be very valuable for predicting the output COD of treatment plant. As the quantitative and qualitative properties of the input wastewater to the treatment plant, temperature, and other influential parameters in designing wastewater treatment plants are different with those of other treatment plants, it is not possible to employ a neural network trained in a certain treatment plant for other similar plants. It can be stated that a neural network in a treatment plant is considered acceptable when it is trained by correct and acceptable data of the same treatment plant. Further, all factors affecting the networks including number of nodes, number of layers, type of training function, type of network, and type of training rule should have also been investigated. The results of this research indicated that if all factors influencing the neural networks are examined, these networks are able to predict the chemical oxygen demand of the output wastewater leaving wastewater treatment plant in Yazd with a regression coefficient over 92%.