Microsoft Word - 20-2725_s1_ETASR_V9_N3_pp4176-4181 Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4176-4181 4176 www.etasr.com Kote & Wadkar: Modeling of Chlorine and Coagulant Dose in a Water Treatment Plant by Artificial … Modeling of Chlorine and Coagulant Dose in a Water Treatment Plant by Artificial Neural Networks Alka S. Kote Department of Civil Engineering, Dr. D. Y. Patil Institute of Technology, Pune, India alkakote26@gmail.com Dnyaneshwar V. Wadkar Dr. D. Y. Patil Institute of Technology, and AISSMS College of Engineering, Pune, India dvwadkar_civil@yahoo.co.in Abstract—Coagulation and chlorination are complex processes of a water treatment plant (WTP). Determination of coagulant and chlorine dose is time-consuming. Many times WTP operators in India determine the coagulant and chlorine dose approximately using their experience, which may lead to the use of excess or insufficient dose. Hence, there is a need to develop prediction models to determine optimum chlorine and coagulant doses. In this paper, artificial neural networks (ANN) are used for prediction due to their ability to learn and model non-linear and complex relationships. Separate ANN models for chlorine and coagulant doses are explored with radial basis neural network (RBFNN), feed-forward neural network (FFNN), cascade feed forward neural network (CFNN) and generalized regression neural network (GRNN). For modeling, daily water quality data of the last four years are collected from the plant laboratory of WTP in Maharashtra (India). In order to improve performance, these models are established by varying input variables, hidden nodes, training functions, spread factor, and epochs. The best models are selected based on the comparison of performance measures. It is observed that the best performing chlorine dose model using defined statistics is found to be RBFNN with R=0.999. Similarly, the CFNN coagulant dose model with Bayesian regularization (BR) training function provided excellent estimates with network architecture (2-40-1) and R=0.947. Based on the above models, two graphical user interfaces (GUIs) were developed for real-time prediction of chlorine and coagulant dose, which will be useful for plant operators and decision makers. Keywords-artifical neural networks; chlorine dose; coagulant dose; water treatment, modelling I. INTRODUCTION Water treatment consists of many complex physical and chemical processes. The efficiency of these processes is accomplished by examining the quality of outlet water. Generally, in India, WTP operators take necessary remedial measures for water quality improvement using only their experience. This practice is inefficient and time-consuming in monitoring real-time responses [1, 2]. In a WTP, coagulation and disinfection are essential treatment processes as they assure the supply of safe and clear water. Conventionally, chlorine is the most widely used disinfectant, and aluminum sulphate (alum) used as a coagulant due to its high efficiency and low cost. Mainly, two common vital factors, turbidity and applied dosages, decide the effectiveness of chlorination and coagulation [3]. Turbidity provides a shield to microbes, which reduces the efficiency of chlorination. It raises chlorine demand, which results in less availability of residual chlorine in water distribution networks (WDNs) [4, 5]. In India, WDNs are old, have leakage issues responsible for microbial contamination, and there is a tendency of plant operators to apply higher chlorine dose for maintaining the desired residual chlorine in the WDN. The high chlorine dose increases the probability of trihalomethane (THM) formation. Consumption of THM containing water creates adverse effects on human health such as high blood pressure, reproductive system disorders, and cancer inception [6]. A chlorine predictive model will help monitoring the process and avoid complex laboratory analysis, which requires more time and money. Coagulation and chlorination processes show non-linear nature that is hard to express using linear mathematical models [7]. It is difficult to model water treatment processes due to complex interactions among many chemical and physical reactions. Thus, the application of ANNs is considered for the prediction of optimum coagulant and chlorine dose. An ANN is a biologically inspired system consisting of a number of interconnected elements called neurons. These neurons are arranged in input, hidden and output layers. All the layers are well connected like human brain synapses where weights are optimized by using input and output variables [8]. An ANN has the ability to learn and model non-linear and complex relationships. Several studies have been carried out on the prediction of the coagulant dose for particular WTP [9-15]. RBFNNs and GRNNs have shown good performance capabilities for predicting residual chlorine in WTP [16]. Thus, two ANN models are explored for prediction of coagulant and chlorine dose for a major WTP of Pimpri-Chinchwad Municipal Corporation (PCMC), Maharashtra, India. II. MATERIALS AND METHODS A. Study Area The WTP under study is located in PCMC, Maharashtra, India, 18°37'33.87'' N and 73°48'43.76''E. This WTP supplies 428MLD of water to an area of 177km 2 with 117,936 water connections and 59 elevated service reservoirs. Corresponding author: Alka S. Kote Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4176-4181 4177 www.etasr.com Kote & Wadkar: Modeling of Chlorine and Coagulant Dose in a Water Treatment Plant by Artificial … B. Methodology This study presents an ANN-based methodology for the prediction of chlorine and coagulant dose in a WTP. Chlorine dose models were developed with input variables the coagulant dose, outlet water turbidity, and residual chlorine and the chlorine dose as the output variable. Similarly, coagulant dose models are developed with input variables the inlet and outlet water turbidity, and coagulant dose as the output variable. Daily data of inlet and outlet water quality were collected from the plant laboratory over a period of four years (2012-2016). ANN models were developed using MATLAB version 16. Four ANN models are developed: RBFNN, feed-forward neural network (FFNN), cascade feed forward neural network (CFNN) and GRNN by trial and error method with modifying input variables, hidden nodes, training functions, spread factor (SF), and epochs for improving the models’ performance. The establishment of an optimum number of hidden nodes in ANN applications is always a challenging task. There is no precise and easy way to achieve the optimum number of nodes in each layer [17-20]. To build hidden neurons in a hidden layer in this study, information of nodes in both input and output layers is used. During the development of the ANN models, training and testing data are split into 75:30 and 80:20 respectively. Diversified training functions such as Bayesian regularization (BR), Levenberg-Marquardt (LM), resilient back propagation (RP), BFGS Quasi-Newton (BFG), one step secant (OSS), conjugate gradient back propagation (CGB), conjugate gradient back propagation with Fletcher-Powell (CGF), variable learning rate gradient descent (VLRGD), gradient descent (GD), gradient descent with momentum (GDM) are used for the development of FFNN and CFNN models. It has been reported that the SF of 1 and 0.1 provided the best testing performance of the RBFNN and GRNN models respectively [10]. Therefore, in this study, both RBFNN and GRNN models are tried for SF ranging from 0.1 to 15. The performance of these ANN models is quantified by using standard statistics which means (Х̅), standard deviation (σ), skewness (ɣ1), kurtosis (ɣ2) and error statistics such as the coefficient of regression (R), mean square error (MSE), and mean absolute error (MAE). The best performing ANN model is selected for its highest R and lowest MSE and MAE values. Also, the mapping of predicted series with observed series is checked for standard statistics, time series plots and scatter plots. Two GUIs for prediction of chlorine and coagulant dose were developed for the best model in each category. III. RESULTS AND DISCUSSION Based on the above explained methodology, 48 ANN models for prediction of chlorine dose and 44 ANN models for prediction of coagulant dose were developed. The networks were rigorously trained and the performances of the training functions are shown in Table I. It is found that training functions LM and BR are highly effective (R=0.943 and R=0.947 respectively) for FFNN and CFNN. The other training functions showed very poor correlation between the observed and the predicted values. Therefore, LM and BR training functions are used for further development of the best models. TABLE I. TRAINING FUNCTION PERFORMANCE - TRAINING STAGE Training function R LM 0.943 BR 0.947 BFG -0.866 RP 0.142 CGB -0.729 CGF -0.882 OSS 0.016 VLRGD -0.591 GD -0.321 GDM 0.187 A. Chorine Dose ANN Model Chlorine dose ANN models were developed using 1849 data samples of input variables, namely coagulant dose, outlet water turbidity, and residual chlorine and chlorine dose as the output variable. These variables are closely associated with chlorination process. ANN models namely Model I, II and III were developed by varying input variables. 1) Chorine Dose ANN Model I For the development of the ANN Model I, one input variable, viz coagulant dose is adopted. Sixteen FFNN, CFNN, RBFNN, and GRNN models were developed. These models were compared using performance measures and it was observed that all the models resulted in poor performance (R<0.72). Figure 1 shows the plot of the observed and predicted series of FFNN, CFNN, RBFNN, and GRNN chlorine dose models during the testing. Fig. 1. Comparison of best chlorine dose ANN Model I (testing stage) 2) Chorine Dose ANN Model II For the development of ANN Model II, two input variables, coagulant dose and residual chlorine were adopted. Several FFNN, CFNN, RBFNN, and GRNN models were developed and tested to get an appropriate network that provided satisfactory performance. Standard statistics were observed Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4176-4181 4178 www.etasr.com Kote & Wadkar: Modeling of Chlorine and Coagulant Dose in a Water Treatment Plant by Artificial … during the testing stage. σ varied from 0.036 to 0.128, ɣ1 varied from -1.713 to -8.717 and ɣ2 from 17.667 to 89.15. Similarly, error statistics such as MSE varied from 0.001 to 0.020, MAE from 0.015 to 0.120 and R from 0.695 to 0.97. However, there is prominent supremacy in prediction by RBFNN 2 model with an SF of 0.1. The comparison of the best chlorine dose ANN Model II among FFNN, CFNN, RBFNN, and GRNN models is shown in Figure 2. Fig. 2. Comparison of best chlorine dose ANN Model II (testing stage) 3) Chorine Dose ANN Model III For the development of the ANN Model III, three input variables, coagulant dose, outlet water turbidity and residual chlorine were adopted. For RBFNN and GRNN models, the values of SF varied from 0.1 to 15 whereas training functions varied for FFNN and CFNN models and minimum/maximum values of performance parameters were noted. The developed models were tested in order to get an appropriate network that provided satisfactory performance. A comparison of the best chlorine dose ANN Model III among FFNN, CFNN, RBFNN, and GRNN models is shown in Figure 3 where the nature of plot of predicted chlorine dose by RBFNN3 model is closely associated with the observed chlorine dose. The performance of all ANN models is displayed in Table II, indicating minimum and maximum values of standard statistics and error statistics. Standard statistics variation was as follows: σ varied from 0.026 to 1.005, ɣ1 from -10.24 to 1.032 and ɣ2 from 5.309 to 110.45. Similarly, the error statistics variation was: MSE varied from 0.001 to 1.069, MAE varied from 0.009 to 0.98 and R from -0.237 to 0.99. The RBFNN model with SF 0.1 produced the highest R compared to all other ANN models. In RBFNN and GRNN models, it was found that the prediction efficiency increased, with decrease in SF value. Further, FFNN and CFNN models with BR training function produced good prediction when compared to all other training functions. However, these models are less efficient. Fig. 3. Comparison of best chlorine dose ANN Model III (testing stage) TABLE II. MINIMUM AND MAXIMUM VALUES OF STANDARD AND ERROR STATISTICS OF CHORINE DOSE ANN MODEL III Model Min/Max values Standard statistics Error statistics Х̅ σ ɣ1 ɣ2 R MSE MAE RBFNN Min 1.771 0.026 -10.24 7.813 -.237 1.069 0.009 Max 1.949 1.005 1.032 110.45 0.999 0.001 0.391 GRNN Min 1.851 0.138 -3.786 11.231 0.053 0.023 0.099 Max 1.91 0.166 -2.324 28.395 0.477 0.051 0.199 FFNN Min 1.867 0.166 -3.107 5.309 0.239 0.025 0.1 Max 1.918 0.192 -1.035 20.4 0.444 1.028 0.982 CFNN Min 1.882 0.164 -2.263 4.76 0.277 0.035 0.124 Max 1.898 0.234 -0.51 12.078 0.433 0.143 0.344 There is a prominent supremacy in the prediction with SF ranging from 0.1 to 1 in RBFNN models. Therefore, the performance parameters of the best RBFNN models during the training and testing stages are shown in Tables III and IV. Also, it is observed that RBFNN3 model gave better performance than RBFNN2 and RBFNN1. TABLE III. STANDARD STATISTICS OF THE BEST RBFNN MODELS ANN Model Training Testing Х̅ σ ɣ1 ɣ2 Х̅ σ ɣ1 ɣ2 Observed values 1.909 0.208 2.097 12.31 1.954 0.171 2.53 12.39 RBFNN1 1.910 0.137 -1.967 15.71 1.962 0.120 -2.43 12.28 RBFNN2 1.910 0.044 -4.286 62.15 1.954 0.036 -1.71 17.66 RBFNN3 1.910 0.026 -3.027 98.89 1.953 0.026 1.032 21.04 TABLE IV. PARAMETERS OF THE BEST RBFNN MODELS ANN Model Training Testing R MSE MAE R MSE MAE RBFNN1 0.715 0.014 0.068 0.753 0.018 0.077 RBFNN2 0.978 0.002 0.013 0.977 0.001 0.015 RBFNN3 0.989 0.001 0.006 0.999 0.001 0.009 Table III provides the standard statistics Х̅, σ, ɣ1 and ɣ2 of the best ANN models during training and testing. It was found that the RBFNN 3 model showed the lowest σ and higher Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4176-4181 4179 www.etasr.com Kote & Wadkar: Modeling of Chlorine and Coagulant Dose in a Water Treatment Plant by Artificial … positive ɣ2. This lowest σ implies that the data points are near the mean of the database while the higher ɣ2 indicates the set of the database had a heavier tail as compared to a normal distribution. Furthermore, in Table IV the RBFNN3 model delivered excellent performance with R=0.999, MSE=0.001 and MAE=0.009 during testing stage. Time series plot and scatter plots of RBFNN3 model during the testing stage are shown in Figures 4 and 5. It is seen that the observed and predicted series of chlorine dose are close thereby indicating the best model. Overall, the RBFNN model showed excellent prediction results. Fig. 4. Times series plot of RBFNN 3 during testing stage Fig. 5. Scatter plot of RBFNN models during testing stage B. Coagulant Dose ANN Model Regarding coagulant dose ANN models, 44 models were tried using FFNN and CFNN networks considering inlet and outlet water turbidity as input variables. The database of input and output variables required for the ANN modeling consisted of 11688 data points. The training and testing data were divided as 75:30 and 80:20 during model building. The development of ANN models was carried out through several steps of training and testing with various training functions as depicted in Section II (B). It was observed that BR and LM training functions gave good R-values 0.947 and 0.944 respectively whereas RP, OSS and GDM showed poor performance and BFG, CGF, CGB, VLRGD, and GD showed negative correlation, indicating their incapability. Therefore, LM and BR training functions were used for development of FFNN and CFNN models namely FFNN1, FFNN2, CFNN1, and CFNN2. During the development of these models, hidden nodes varied from 15 to 60, and corresponding R was found to range between 0.936 to 0.947. It wass observed that the best performance was produced by a CFNN model using BR training function with hidden node number=40, with R=0.952 for training, R=0.922 for testing, and overall R=0.947. The CFNN model, due to the weighted connections of input layer with the hidden and output layers, mapped the input-output relationship very well. Also, BR training function delivers a decisive benchmark for finishing the training step and counters overtraining of the network. Table V shows the performance of the best models during the testing stage. It is seen that both FFNN and CFNN models perform equally good, however CFNN model showed a slightly better prediction. In the testing stage, the CFNN model showed a reduction in MSE (46.85%). The error statistics of the CFNN model are very near to the observed values. The prediction of coagulant dose by the developed best CFNN2 model during testing stage was carried out with 248 data points. The observed coagulant dose at the WTP is constant for a specific period, which is indicated by the straight line, whereas predicted coagulant dose by CFNN2 model shows variation as shown in Figure 6 TABLE V. PERFORMANCE COMPARISON OF THE BEST ANN MODELS ANN Models Training function Epochs Hidden nodes R MSE FFNN1 Model LM 26 60 0.944 185.09 FFNN2 Model BR 500 50 0.945 113.13 CFNN1 Model LM 36 60 0.943 59.22 CFNN2 Model BR 500 40 0.947 99.28 Fig. 6. Prediction of coagulant dose by the best CFNN2 model during the testing stage It is seen that the predicted values of the coagulant dose do not follow the pattern of the actual coagulant dose from 60 to 90 data points. This could be due to a wide range of data points of inlet water turbidity as well as coagulant dose during the ANN training. Despite the significant variations, the average actual coagulant dose and predicted coagulant dose show a similar trend. Among all the models, the CFNN2 model gave the best performance with R=0.947 and MSE=99.28. Therefore, the CFNN model is more capable and precise in the modeling of the coagulation process. IV. MODEL IMPLEMENTATION The presence of residual chlorine in the WDN is a major concern in India due to water leakage and distribution issues. Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4176-4181 4180 www.etasr.com Kote & Wadkar: Modeling of Chlorine and Coagulant Dose in a Water Treatment Plant by Artificial … Hence, the required residual chlorine at the outlet of WTP is an important aspect for the distribution network. Two GUIs were developed to determine chlorine and coagulant dose using the best performed RBFNN3, and CFNN2 models respectively (Figures 7-8). In the GUI of chlorine dose, the chlorine dose is predicted by using coagulant dose, outlet water turbidity, and residual chlorine. The plant operator can decide the chlorine dose as per desired residual chlorine (0.2mg/L) at the end of WDN. Similarly, in the GUI of coagulant dose, the plant operator can decide the coagulant dose by using inlet water turbidity and outlet water turbidity (less than 5NTU). Fig. 7. Snap shot of the chlorine dose ANN model GUI Fig. 8. Snap shot of coagulant dose ANN model GUI V. CONCLUSION The chlorine and coagulant dose in a WTP are typically determined through laboratory analysis that requires a long experimental time. Thus, GUIs were developed for chlorine and coagulant dose using ANNs. During the ANN development, it was observed that BR training function had better prediction capability than LM, RP, BFG, OSS, CGB, CGF, VLRGD, GD and GDM. Among all chlorine dose ANN models, the RBFNN3 model (R=0.999) delivered the most excellent performance. One of the most important findings of the study is that the decreasing order of SF increases the performance of RBFNN and GRNN models. For the development of coagulant dose models, it was found that the number of input variables increased the performance of ANN models. All FFNN and CFNN models with LM and BR training functions performed well especially for lower values of coagulant dose. However, higher values showed under prediction. CFNN2 model (R=0.947) with BR training function provided the best prediction for the coagulant dose. The GUIs of the best ANN models will be very useful tools to plant operators and managers for deciding the required chlorine and coagulant dose. REFERENCES [1] D. Wu, L. Shang-Lien, “Predicting real-time coagulant dosage in water treatment by artificial neural networks and adaptive-network-based fuzzy inference system”, Engineering Applications of Artificial Intelligence, Vol. 21, pp. 1189–1195, 2011 [2] O. Bello, Y. Hamam, K. Djouani, “Coagulation process control in water treatment plants using multiple model predictive control”, Alexandria Engineering Journal, Vol. 53, No 4, pp. 420-435, 2014 [3] M. S. Gibbs, N. Morgan, H. R. Maier, G. C. Dandy, J. B. Nixon, M. Holmes, “Investigation into the relationship between chlorine decay and water distribution parameters using data-driven methods”, Mathematical and Computer Modelling ,Vol. 44, No. 5-6, pp.485–498, 2006 [4] M. W. LeChevallier, K. K. Au, Water Treatment and Pathogen Control: Process Efficiency in Achieving Safe Drinking Water, IWA Publishing, 2004 [5] J. A. Crump, G. O. Okoth, L. Slutsker, D. O. Ogaja, B. H. Keswick, S. P. Luby, “Effect of point-of-use disinfection, flocculation and combined flocculation disinfection on drinking water quality in western Kenya”, Journal of Applied Microbiology, Vol. 97, No. 1, pp. 225–231, 2004 [6] E. Hood, “Tap Water and Trihalomethanes: Flow of Concerns Continues”, Environmental Health Perspectives, Vol. 113, No. 7, pp. 472-474, 2005 [7] M. M. Hamed, M. G. Khalafallah, E. A. Hassanien, “Prediction of wastewater treatment plant performance using artificial neural networks”, Environmental Modelling, Vol. 19, No. 10, pp. 919-928, 2004 [8] P. Hajela, L. Berke, “Neurobiological computational modes in structural analysis and design”, Computers & Structures, Vol. 41, No. 4, pp. 657– 667, 1991 [9] A. Robenson, S. R. A. Shukor, N. Araiz, “Development of process inverse neural network model to determine the required alum dosage at Segama WTP, Sabah, Malaysia”, Computer Aided Chemical Engineering, Vol. 27, pp. 525–530, 2009 [10] S. Heddam, A. Bermad, N. Dechemi, “Applications of RBF and GRNN for modelling of coagulant dosage in a drinking WTP: the comparative study”, Journal of Environmental Engineering, Vol. 137, No. 12, pp. 1209-1214, 2011 [11] M. J. Kennedy, A. H. Gandomi, C. M. Miller, “Coagulation modelling using ANN to predict both turbidity and dom-parafac component removal”, Journal of Environmental Chemical Engineering, Vol. 3, No. 4A, pp. 2829–2838, 2015 [12] C. L. Chen, P. L. Hou, “Fuzzy model identification and control system design for coagulation chemical dosing of potable water”, Water Supply, Vol. 6, No. 3, pp. 97–104, 2006 [13] L. X. Gao, H. Gu, A. Rahardianto, P. D. Christofides, Y. Cohen, “Self- adaptive cycle to cycle control of inline coagulant dosing in ultrafiltration for pre-treatment of reverse osmosis feed water”, Desalination, Vol. 401, pp. 22–31, 2017 [14] H. R. Maier, N. Morgan, C. W. K. Chow, “Use of artificial neural networks for predicting optimal alum doses and treated water quality parameters”, Environmental Modelling & Software, Vol. 19, No. 5, pp. 485–494, 2004 [15] B. Larmrini, A. Benhammou, M. V. Le Lann, A. Karama, “A neural software sensor for online prediction of coagulant dosage in a drinking WTP ”, Transactions of the Institute of Measurements and Control, Vol. 27, No. 3, pp. 195-213, 2005 [16] D. Wadkar, A. Kote, “Prediction of residual chlorine in a Water treatment plant using Generalized regression neural Network”, International Journal of Civil Engineering and Technology, Vol. 8, No. 8, pp. 1264–1270, 2017 Engineering, Technology & Applied Science Research Vol. 9, No. 3, 2019, 4176-4181 4181 www.etasr.com Kote & Wadkar: Modeling of Chlorine and Coagulant Dose in a Water Treatment Plant by Artificial … [17] F. Khayatian, L. Satro, G. Dallo, “Application of neural networks for evaluating energy performance certificates of residential buildings”, Energy and Buildings, Vol. 125,pp. 45-54, 2016 [18] Hecht-Nielsen, “Theory of the back-propagation neural network”, International Joint Conference on Neural Networks, Washington, USA, August 6, 1989 [19] Y. Najjar, I. Basheer, M. Hajmeer, “Computational neural networks for predictive microbiology methodology”, International Journal of Food Microbiology, Vol. 34, No. 1, pp. 27–49,1997 [20] L. M. Salchenberger, M. Cinar, N. A. Lash, “Neural networks: A new tool for predicting thrift failures”, Decision Sciences, Vol. 23, No. 4, pp. 899–916, 1992