BP–ANN Model Coupled with Particle Swarm Optimization for the Efficient Prediction of 2-Chlorophenol Removal in an Electro-Oxidation System

Electro-oxidation is an effective approach for the removal of 2-chlorophenol from wastewater. The modeling of the electrochemical process plays an important role in improving the efficiency of electrochemical treatment and increasing our understanding of electrochemical treatment without increasing the cost. The backpropagation artificial neural network (BP–ANN) model was applied to predict chemical oxygen demand (COD) removal efficiency and total energy consumption (TEC). Current density, pH, supporting electrolyte concentration, and oxidation–reduction potential (ORP) were used as input parameters in the 2-chlorophenol synthetic wastewater model. Prediction accuracy was increased by using particle swarm optimization coupled with BP–ANN to optimize weight and threshold values. The particle swarm optimization BP–ANN (PSO–BP–ANN) for the efficient prediction of COD removal efficiency and TEC for testing data showed high correlation coefficient of 0.99 and 0.9944 and a mean square error of 0.0015526 and 0.0023456. The weight matrix analysis indicated that the correlation of the five input parameters was a current density of 18.85%, an initial pH 21.11%, an electrolyte concentration 19.69%, an oxidation time of 21.30%, and an ORP of 19.05%. The analysis of removal kinetics indicated that oxidation–reduction potential (ORP) is closely correlated with the chemical oxygen demand (COD) and total energy consumption (TEC) of the electro-oxidation degradation of 2-chlorophenol in wastewater.


Introduction
Wastewater produced by various industrial processes contains large quantities of chlorophenol compounds, which are highly toxic and resistant to biological degradation [1]. The compound 2-chlorophenol is a typical chlorophenol compound that is listed as a priority pollutant by the Environmental Protection Agency, given its carcinogenic properties [2,3]. Electro-oxidation, an effective technology that does not require the use of extra reagents, is commonly used to remove chlorophenol compounds from wastewater because of its high efficiency, rapid reaction rate, and environmental friendliness [4,5]. However, the energy cost of the electro-oxidation process limits its application [6].
The establishment of appropriate models for electro-oxidation is essential given the complexity of this process. Modeling of the electrochemical process plays an important role in improving the efficiency of electrochemical treatment and a further understanding of electrochemical treatment without increasing the cost. Empirical models and semi-empirical models, such as pseudo-first-order kinetics [7], pseudo-second-order kinetics [8], a computational fluid dynamics (CFD) model, and response surface methodology (RSM) model, are usually established for the prediction of electrochemical process

Data Set
All electro-oxidation experiments were conducted with a 3 L-capacity laboratory-scale plate cell with a circulating tank. The used datasets were obtained from a previous study [25]. A total of 190 experimental runs (Table A1) were performed in the galvanostatic mode under a current density of 8 mA cm −2 to 25 mA cm −2 , an original pH of 3 to 11, an electrolyte concentration of 0.05mol L −1 to 0.12 mol L −1 , a reaction time of 0 h to 2 h, and ORP values of −68 mV to 500 mV, as shown in Table 1. During the Electro-oxidation, an ORP (SX-630, Sanxin, China) and a pH (SX711, Sanxin, China) probe were installed in the electrolysis bath for online monitoring of ORP/pH. COD was determined according to Chinese standard HJ/T 399-2007 with slight modifications. The solution was measured at a wavelength of 440 nm using a UV-visible spectrophotometer (UV-2910, Hitachi, Japan).
A specific electrical charge (Q sp , Ah L −1 ) was calculated by using the following equation [26]: where j is current density (A cm −2 ), A is the effective area of the electrode (cm 2 ), V is the effective volume of the plate cell (L), and t is the reaction time during the electro-oxidation process (h). TEC (kWh m −3 ) was calculated in a previous study as follows [28]: where Q sp is a specific electrical charge, and U (V) is the cell voltage.

BP-ANN Coupled with PSO
ANNs have different architectures. The ANN used in this study has three layers: an input layer that receives electro-oxidation information, a hidden layer that processes information, and an output layer that calculates COD removal and TEC results [29]. During BP learning, the actual outputs are compared with the target values to derive error signals, which are propagated backward by layers to adjust the weights in all lower layers [30]. The architecture of a neural network and the BP algorithm is presented in Figure 1.
The flowchart of BP-ANN coupled with PSO is shown in Figure 2. The ANN model was developed using MATLAB R2016a software. A total of 190 runs of the electro-oxidation process data were applied to develop the models for the prediction of COD removal efficiency and TEC. The available data were divided into training, validation, and testing subsets, of which 80% (152) were randomly selected for network training, 10% (19) were used for validation, and 10% (19) were applied to test network accuracy. Current density, original pH, electrolyte concentration, oxidation time, and ORP were used as five input parameters, and COD removal efficiency and TEC were considered as the two output. The flowchart of BP-ANN coupled with PSO is shown in Figure 2. The ANN model was developed using MATLAB R2016a software. A total of 190 runs of the electro-oxidation process data were applied to develop the models for the prediction of COD removal efficiency and TEC. The available data were divided into training, validation, and testing subsets, of which 80% (152) were randomly selected for network training, 10% (19) were used for validation, and 10% (19) were applied to test network accuracy. Current density, original pH, electrolyte concentration, oxidation time, and ORP were used as five input parameters, and COD removal efficiency and TEC were considered as the two output.
Two prediction score metrics, the coefficient of correlation (R 2 ), and mean square error (MSE), were computed using the following equations to evaluate the fitting and prediction accuracy of the constructed models [31]:

Removal Kinetics
The apparent reaction rate constants for COD removal were calculated in accordance with Equation (5) [32]: where COD0 and CODt are the COD values of the initial and final pollutant concentrations (mg L −1 ), respectively; t is the electrolysis time (min); and K is the apparent reaction rate constant (min −1 ). The apparent reaction rate constants calculated in accordance with Equation (3) for the current densities of 8, 10,12,14,15,18,20, and 25 mA cm −2 were 0.0072, 0.0107, 0.0118, 0.0160, 0.0202, 0.0212, 0.0224, and 0.0232 min −1 , respectively. The linear relationship between the logarithmic values of COD and electrolysis time is depicted in Figure 3. Table 2 shows that the correlation coefficient R 2 of linear fitting was greater than 0.9989. This result indicates that COD removal satisfies the first-order reaction kinetics equation. Two prediction score metrics, the coefficient of correlation (R 2 ), and mean square error (MSE), were computed using the following equations to evaluate the fitting and prediction accuracy of the constructed models [31]: where f ANN,i , n is the number of samples used for modeling, f exp is the experimental value, and f ANN is the network-predicted value.

Removal Kinetics
The apparent reaction rate constants for COD removal were calculated in accordance with Equation (5) [32]: ln where COD 0 and COD t are the COD values of the initial and final pollutant concentrations (mg L −1 ), respectively; t is the electrolysis time (min); and K is the apparent reaction rate constant (min −1 ). The apparent reaction rate constants calculated in accordance with Equation (3) for the current densities of 8, 10,12,14,15,18,20, and 25 mA cm −2 were 0.0072, 0.0107, 0.0118, 0.0160, 0.0202, 0.0212, 0.0224, and 0.0232 min −1 , respectively. The linear relationship between the logarithmic values of COD and electrolysis time is depicted in Figure 3. Table 2 shows that the correlation coefficient R 2 of linear fitting was greater than 0.9989. This result indicates that COD removal satisfies the first-order reaction kinetics equation.

Removal Kinetics
The apparent reaction rate constants for COD removal were calculated in accordance with Equation (5) [32]: where COD0 and CODt are the COD values of the initial and final pollutant concentrations (mg L −1 ), respectively; t is the electrolysis time (min); and K is the apparent reaction rate constant (min −1 ). The apparent reaction rate constants calculated in accordance with Equation (3) Figure 3. Table 2 shows that the correlation coefficient R 2 of linear fitting was greater than 0.9989. This result indicates that COD removal satisfies the first-order reaction kinetics equation.  Other parameters, such as temperature (T), pH value, and electricity can be obtained when the influent quality and flow rate are held constant in the electrolytic cell. The kinetic constant K is only related to current density (j) under the conditions of the original pH of 3 and Na 2 SO 4 concentration of 0.10 mol L −1 [11].
The relationship between K and J can be inferred from Table 2.
From Equation (5), Equation (7) can be expressed as which describes the relationship among COD, current density, and oxidation time.
The optimal electro-oxidation conditions were initially determined by considering the effective factors of current density, original pH value, and electrolyte concentration. A COD removal efficiency of 100% was obtained with the optimal operating parameters of a current density of 15 mA cm −2 , an original pH of 3, and a Na 2 SO 4 concentration of 0.
The typical multiple regression equation representing the relationship among influential parameters and TEC was obtained and is shown below: The R 2 values for COD removal efficiency and TEC were 0.8878 and 0.93223, respectively. These values reflect a good correlation among COD, TEC, j, pH, t, Na2SO4 concentration, and ORP. ORP The typical multiple regression equation showing the relationship among ORP, current density, original pH, Na 2 SO 4 concentration, reaction time, and COD removal efficiency was obtained as follows: The typical multiple regression equation representing the relationship among influential parameters and TEC was obtained and is shown below: The R 2 values for COD removal efficiency and TEC were 0.8878 and 0.93223, respectively. These values reflect a good correlation among COD, TEC, j, pH, t, Na 2 SO 4 concentration, and ORP. ORP values provide a complete indicator of the effect of current density, electrolyte concentration, pH, and reaction time on the performance of the electro-oxidation system. Therefore, the ORP value can be used as an effective controlling factor for the prediction of COD removal efficiency and the TEC of electro-oxidation.

BP-ANN Prediction of 2-Chlorophenol Removal
The tangent sigmoid was selected as the transfer function for the input layer nodes to the hidden layer, and the purelin was selected as the transfer function for the hidden layer nodes to the output layer. All data were normalized within a range of −1 and 1 before being fed to the networks to increase training speed and facilitate modeling and prediction.
In this study, the numbers of input and output nodes were 5 and 2, respectively, and were equal to the numbers of input and output data. The number of neurons has a considerable effect on network performance. For example, the network cannot achieve the desired error if the number of neurons is too small, or overfitting may occur if the number of neurons is too large. Thus, determining the appropriate number of neurons in the hidden layer is necessary. This number can usually be determined by using the following empirical formula in accordance with Hecht-Nielsen's theorem [33]: where N H is the number of hidden neurons, and N i is the number of input variables, which is 5 in the present work. Equation (11) shows that the node number in the hidden layer was approximately 11. Then, BP networks with different hidden neurons from 6-16 were compared on the basis of the maximization of R 2 and the minimization of MSE for the testing dataset. Table 3 shows that the BP-ANN that contains 6-16 hidden neurons in the prediction of the electro-oxidation process.
The optimal BP-ANN model provided an R 2 and MSE of 0.9344 and 0.0137232 for COD removal efficiency, respectively, and an R 2 and MSE of 0.9355 and 0.013127 for TEC, respectively when the hidden neurons were 10. Under the optimal network, BP-ANN in the prediction of COD removal efficiency and TEC and the correlations between the experimental and predicted sets are illustrated in Figure 5. The error range of COD was (−0.058, 0.249) and TEC (−0.079, 0.391). The network performance is good, but the error range shows that the deviation of individual points is large. The training algorithm also affects the performance of BP networks. A wide variety of training functions with 10 neurons used in the hidden layer was studied to select a good BP network. Table 4 presents the data for R 2 and MSE under different training functions of BP networks. The Levenberg-Marquardt back propagation (trainlm) training algorithm, which maximized the R 2 and minimized the MSE of COD removal efficiency and TEC, was identified as the best training function. efficiency, respectively, and an R and MSE of 0.9355 and 0.013127 for TEC, respectively when the hidden neurons were 10. Under the optimal network, BP-ANN in the prediction of COD removal efficiency and TEC and the correlations between the experimental and predicted sets are illustrated in Figure 5. The error range of COD was (−0.058, 0.249) and TEC (−0.079, 0.391). The network performance is good, but the error range shows that the deviation of individual points is large.  (c) (d) Figure 5. Performance of the BP-ANN predicting COD removal efficiency and TEC between experimental and predicted data sets (COD removal efficiency testing set (a), TEC testing set (b)); correlations between experimental and predicted set (COD removal efficiency testing set (c), TEC testing set (d)).

Optimization of the Weight and Threshold Value of BP-ANN
The PSO-BP-ANN can be optimized for selection purposes by optimizing (1) swarm size, (2) maximum iteration, (3) cognition coefficient C 1 , and (4) social coefficient C 2 (Table A2). Table 5 displayed PSO control parameters, R 2 , and training MSE for the testing dataset. The PSO-ANN containing a swarm size of 50, a maximum iteration of 200, C 1 of 1.5, and C 2 of 1.5 was selected as the best model for the electrochemical process of interest. The optimal PSO-BP-ANN models provided R 2 of 0.99 and 0.9944 for COD removal efficiency and TEC, and MSE values of 0.0015526 and 0.0023456, respectively, for the testing dataset. The performance of the optimal PSO-BP-ANN in the prediction of COD removal efficiency and TEC and the correlations between the experimental and predicted sets are illustrated in Figure 6. The PSO-BP-ANN selected for the efficient prediction of 2-Chlorophenol removal in an electro-oxidation system was containing 10 hidden neurons, trainlm training algorithm, swarm size of 50, maximum iteration of 200, C 1 of 1.5, and C 2 of 1.5.  (c) (d) Figure 6. Performance of the particle swarm optimization BP-ANN (PSO-BP-ANN) predicting COD removal efficiency and TEC between experimental and predicted data sets (COD removal efficiency testing set (a), TEC testing set (b)); correlations between experimental and predicted set (COD removal efficiency testing set (c), TEC testing set (d)).

Assessment of the Importance of Variables
The weight matrix of the neural net can be used to assess the relative importance of various input variables for output variables [31]. The relative importance of input variables on the value of COD removal efficiency and TEC as calculated by particle swarm optimization BP-ANN (PSO-BP-ANN) is shown in Table 6. Sensitivity analysis indicated order of relative importance the operational parameters on the electro-oxidation as: electrolysis time > pH > electrolyte concentration > ORP > current density. The table indicates that all of the variables have strong effects on COD removal efficiency and TEC. Therefore, none of the variables studied in this work should be neglected in the analysis. Figure 6. Performance of the particle swarm optimization BP-ANN (PSO-BP-ANN) predicting COD removal efficiency and TEC between experimental and predicted data sets (COD removal efficiency testing set (a), TEC testing set (b)); correlations between experimental and predicted set (COD removal efficiency testing set (c), TEC testing set (d)).

Assessment of the Importance of Variables
The weight matrix of the neural net can be used to assess the relative importance of various input variables for output variables [31]. The relative importance of input variables on the value of COD removal efficiency and TEC as calculated by particle swarm optimization BP-ANN (PSO-BP-ANN) is shown in Table 6. Sensitivity analysis indicated order of relative importance the operational parameters on the electro-oxidation as: electrolysis time > pH > electrolyte concentration > ORP > current density. The table indicates that all of the variables have strong effects on COD removal efficiency and TEC. Therefore, none of the variables studied in this work should be neglected in the analysis.

Conclusions
In this study, the main object is development and construction of novel model that could make efficient prediction of electro-oxidation removal of 2-Chlorophenol on the basis of batch electro-oxidation experiments. The analysis of removal kinetics indicated that ORP was closely correlated with COD removal efficiency and TEC and was one of the important input parameters of PSO-BP-ANN. PSO-BP-ANN was developed through the optimization of the weights and thresholds of BP-ANN. The PSO-BP-ANN that contained 10 hidden neurons, trainlm training algorithm and possessed a swarm size of 50, maximum iteration of 200, C 1 of 1.5, and C 2 of 1.5 was identified as the best model for predicting 2-chlorophenol degradation through electro-oxidation. The PSO-BP-ANN model provided accurate predictions and R 2 of 0.99 and 0.9944 for COD removal efficiency and TEC, and MSE values of 0.0015526 and 0.0023456 respectively for the testing dataset. The weight matrix revealed that the order of relative importance for the operational parameters of the electro-oxidation is: electrolysis time > pH > electrolyte concentration > ORP > current density. For comparative purposes, performance data for the ANN methodology in various electrochemical processes are summarized in Table A3.

Conflicts of Interest:
The authors declare no conflict of interest.