Modeling and Optimization of COD Removal from Cold Meat Industry Wastewater by Electrocoagulation Using Computational Techniques

: In this paper, electrocoagulation (EC) treatment for the removal of chemical oxygen demand (COD) from cold meat industry wastewater is modeled and optimized using computational techniques. Methods such as artiﬁcial neural networks (ANNs) and response surface methodology (RSM), based on the Box–Behnken design using three levels, were employed to calculate the best control parameters for pH (5–9), current density (2–6 mA / cm 2 ) and EC time (20–60 min). Analysis of variance (ANOVA) and 3D graphs revealed that pH and current density are the main parameters used for depicting the EC process. The developed models successfully describe the process with a correlation coe ﬃ cient of R 2 = 0.96 for RSM and R 2 = 0.99 for ANN. The models obtained were optimized applying the moth-ﬂame optimization (MFO) algorithm to ﬁnd the best operating conditions for COD removal. ANN-MFO was used and showed superior COD removal (92.91%) under conditions of pH = 8.9, current density = 6.6 mA / cm 2 and an EC time of 38.62 min. The energy consumption with these optimal conditions was 6.92 kWh / m 3 , with an operational cost of $3.14 (USD) / m 3 . These results suggest that the proposed computational model can be used to obtain more e ﬀ ective and economical treatments for this type of e ﬄ uent.


Introduction
Water is one of the most important resources for life, and today the global population needs more water for industry, agricultural fields and personal use [1]. The extensive range of pollutants in wastewater is one of the most significant challenges for food industries. Wastewater from the cold meat industry has high pollutant concentrations in the form of color, fat, albumins, proteins, carbohydrates and chemical oxygen demand [2]. To remove the pollution of wastewater in this industrial sector, biological, chemical and physical treatments have been applied in the past [3]. However, due to the need for more sustainable and environment friendly methods, electrochemical treatments such as electrocoagulation (EC) have been preferred, as a way to remove a great variety of organic pollutants in wastewater for the cold meat industry sector [4]. Electrocoagulation is a process that consists of destabilizing pollutants present in wastewater through the action of a low-voltage direct electric current and by the action of sacrificial metal electrodes that are normally made of aluminum or iron [5]. When aluminum electrodes are used, the treatment starts with the dissolution of aluminum ions (Al 3+ )

Electrocoagulation for Cold Meat Industry Wastewater
To verify the efficiency of adsorption in the removal of organic matter present in cold meat industry wastewater by the EC process, discharge samples were acquired from an industry in the north of Mexico (16 • 3 42.88" N; 93 • 22 9.41" W). Samples were obtained every 24 h for five days, to generate a composed sample. These effluents were refrigerated at 4 • C until the experimentation was performed. The wastewater from the cold meat industry was analyzed at the beginning of the experiment for certain water quality parameters, according to the standard methods [21]. The specific standards for each parameter were the following: pH (pH meter (HANNA instruments, Mexico City, Mexico)), biochemical oxygen demand (BOD) (5210B), chemical oxygen demand (COD) (5220D), color (2120C), turbidity (2130B), total suspended solids (TSS) (2540D) and fats and oils (5520D).
The analysis of the quality of the residual water was carried out to determine the degree of contamination in the water at the beginning of the electrocoagulation treatment. For modeling and optimization by computational methods, the removal of a single parameter such as the COD was considered. This calculation was made with Equation (1) [13]: where R represents the removal efficiency, Y 0 is the initial COD measurement and Y is the final COD measurement. The diagram of the electrochemical cell employed in this work can be seen in Figure 1. This system consisted of a 1200 mL reactor containing 1000-mL samples and two aluminum electrodes, measuring 5.3 cm wide and 12.7 cm long. There was a total contact area of 121.84 cm 2 and a separation of 0.5 cm was maintained between the two electrodes. Aluminum electrodes were used in this study due to their good performance, as mentioned in [13]. A power supply (Extech model 382153) was employed to provide regulated electric power to the EC system. Electrodes were washed using a 10% nitric acid solution before each experiment in order to activate their surfaces for the process. The initial pH of the diverse working solutions was adjusted with 0.1 M NaOH or HCl (analytical grade) to assess the influence of the initial pH (5 to 9) on the adsorption efficiency. The parameters controlled in the experiment were pH, current density (mA/cm 2 ) and electrochemical treatment time (minutes).
where R represents the removal efficiency, Y0 is the initial COD measurement and Y is the final COD measurement. The diagram of the electrochemical cell employed in this work can be seen in Figure 1. This system consisted of a 1200 mL reactor containing 1000-mL samples and two aluminum electrodes, measuring 5.3 cm wide and 12.7 cm long. There was a total contact area of 121.84 cm 2 and a separation of 0.5 cm was maintained between the two electrodes. Aluminum electrodes were used in this study due to their good performance, as mentioned in [13]. A power supply (Extech model 382153) was employed to provide regulated electric power to the EC system. Electrodes were washed using a 10% nitric acid solution before each experiment in order to activate their surfaces for the process. The initial pH of the diverse working solutions was adjusted with 0.1 M NaOH or HCl (analytical grade) to assess the influence of the initial pH (5 to 9) on the adsorption efficiency. The parameters controlled in the experiment were pH, current density (mA/cm 2 ) and electrochemical treatment time (minutes).

ANN Modeling and Optimization
In order to quantify the contribution of proposed parameters in the efficiency of removal of COD from cold meat wastewater, three main factors, each with three levels, were chosen, as shown in Table  1. The ANN modeling of the process parameters for the cold meat industry wastewater was performed by employing the neural network toolbox of MATLAB R2016a (Mathworks Inc., Natick, MA, USA). To obtain the model, a feedforward neural network was applied. As shown in Figure 2, the ANN architecture has one input layer with three neurons (initial pH, current density and electrocoagulation time), an output layer with one neuron (COD removal %). Since the network has only one hidden layer, it is considered a multilayered perceptron (MPL).

ANN Modeling and Optimization
In order to quantify the contribution of proposed parameters in the efficiency of removal of COD from cold meat wastewater, three main factors, each with three levels, were chosen, as shown in Table 1. The ANN modeling of the process parameters for the cold meat industry wastewater was performed by employing the neural network toolbox of MATLAB R2016a (Mathworks Inc., Natick, MA, USA). To obtain the model, a feedforward neural network was applied. As shown in Figure 2, the ANN architecture has one input layer with three neurons (initial pH, current density and electrocoagulation time), an output layer with one neuron (COD removal %). Since the network has only one hidden layer, it is considered a multilayered perceptron (MPL). The hyperbolic tangent sigmoid transfer function (tansig) and pure-linear transfer function (purelin) were designated for the input and output layers, respectively, in order to formulate the activation function and the net input to the node in the output layer. These equations are found in [22]. The whole data set was organized into three groups: a training group (70%), a validation group (15%) and a test group (15%) [12], as shown in Table 2. Finally, in order to determine the number of hidden neurons, iterative tests were performed for a group of neural networks and the mean square error (MSE) was measured. All of the data were normalized using Equation (2); where xi represents the observed value, xmax is the highest value for the variables and xmin is the lowest value [18]. For metaheuristic optimization, the ANN model was employed as the fitness function and was used to measure the performance of individuals in the population [22]. MFO was used as a metaheuristic algorithm to improve the performance of the ANN [17].

RSM Modeling and Optimization
The Box-Behnken design (BBD) was used for the modeling and estimation of the EC process of COD removal from cold meat industry wastewater. The design matrix had the same three factors as the ANN modeling, which were pH (5-9), current density (2-6 mA/cm 2 ), and EC time (20-60 min), each with three levels, and the response variable was the elimination of COD (Y1). The prediction of response values obtained by correlation of the three independent variables was made by applying a second-order polynomial equation 3, where Y represents response (COD removal efficiency, %); b0 is The hyperbolic tangent sigmoid transfer function (tansig) and pure-linear transfer function (purelin) were designated for the input and output layers, respectively, in order to formulate the activation function and the net input to the node in the output layer. These equations are found in [22]. The whole data set was organized into three groups: a training group (70%), a validation group (15%) and a test group (15%) [12], as shown in Table 2. Finally, in order to determine the number of hidden neurons, iterative tests were performed for a group of neural networks and the mean square error (MSE) was measured. All of the data were normalized using Equation (2); where x i represents the observed value, x max is the highest value for the variables and x min is the lowest value [18]. For metaheuristic optimization, the ANN model was employed as the fitness function and was used to measure the performance of individuals in the population [22]. MFO was used as a metaheuristic algorithm to improve the performance of the ANN [17].

RSM Modeling and Optimization
The Box-Behnken design (BBD) was used for the modeling and estimation of the EC process of COD removal from cold meat industry wastewater. The design matrix had the same three factors as the ANN modeling, which were pH (5-9), current density (2-6 mA/cm 2 ), and EC time (20-60 min), each with three levels, and the response variable was the elimination of COD (Y 1 ). The prediction of response values obtained by correlation of the three independent variables was made by applying a second-order polynomial equation 3, where Y represents response (COD removal efficiency, %); b 0 is the intercept value; b i (i = 1, 2, 3, . . . , n) represents the first model coefficients for X i ; b ii represents the quadratic coefficients of X i ; b ij represents the correlation coefficients for X i X j and ε is the random error. For the numerical optimization of the RSM model, Design-Expert software 10.0.1 (Stat-Ease Inc., Minneapolis, MN, USA) was used. The parameter optimization was carried out by Derringer's desired function methodology. Design-Expert software was used for analysis of variance (ANOVA) and numerical optimization [23].

Evaluation of the Developed Mathematical Models
The correlation coefficient (R), coefficient of determination (R 2 ), adjusted R 2 , mean squared error (MSE) and root mean squared error (RMSE) were the statistical indices used in order to evaluate the predictive capability for the COD removal process present in cold meat wastewater [22].

Operational Cost
The operational cost is one of the main considerations when treating wastewater by EC. It includes the cost of the external chemical (C chem (g/m 3 )), the cost of dissolved electrode (C elect (g/m 3 )) and energy consumption (E con (Kwh/m 3 )). The operational cost incurred during the EC method can be calculated by Equations (4)-(7) [5,24], where V is the volume (L) of cold meat wastewater, F is the Faraday constant (96,485 C/mol), Z is the Al balance (+3), M is the atomic weight for Al (26.98 g/mol), t is the time (s) for electrolysis and I is functional current (Amperes), U denotes cell voltage (Volts). Equation (6) calculates the cost of the chemicals, where Ch is the quantity of chemical used (g) and Vol is the volume of wastewater (m 3 ). The operational cost was evaluated using: (α) with an electricity price of 0.13 USD/KWh, obtained from the Mexican government's energy secretary [24], (β) is the electrode material price 1.64 USD/kg Al, obtained from of the international metals market [25] and (γ) is the cost of the chemicals which can be added, (in this work, sodium hydroxide with a price of 0.4 USD/kg [26]).

Results
The physicochemical parameters of the wastewater obtained at the beginning of the experimentation are shown in Table 3. As can be seen, the wastewater samples were rich in organic matter [27]. The proportion of organic matter, expressed as COD and BOD, was approximately 3482 and 2470 mg/L, respectively. The fat, oil and grease (FOG) concentration is high, at approximately 1114 mg/L. These results are in agreement with those reported by other authors for wastewater from the meat industry [3,28]. The physicochemical parameters found are characteristic of this type of wastewater, generated as a result of meat processing and the cleaning of equipment in the cold meat industry [28]. This wastewater is appropriate for treatment in an electrocoagulation process [4,29].   Table 4. From these results, a hidden layer of 10 neurons was used in this work and a total of 12 moths were used as search agents for 50 iterations. For this investigation, the results for COD removal prediction using the ANN-MFO model are presented in Figure 3, showing the plot of predictions (output values) versus target (experimental) values, which results in R values of 0.9998 for validation, 0.9936 for testing, 1 for training and 0.9945 for the whole data set.

Neural Network Modeling
In  Table 4. From these results, a hidden layer of 10 neurons was used in this work and a total of 12 moths were used as search agents for 50 iterations. For this investigation, the results for COD removal prediction using the ANN-MFO model are presented in Figure 3, showing the plot of predictions (output values) versus target (experimental) values, which results in R values of 0.9998 for validation, 0.9936 for testing, 1 for training and 0.9945 for the whole data set.

RSM Modeling
An empirical model was established in order to understand the interactive correlation between the response and process variables. This model, obtained in terms of coded factors, is given in Equation (8).
Y 1 (%) = 29.40 + 13.52A + 20.64B + 5.82C + 0.22AB + 4.24AC + 0.52BC + 7.75A 2 + 21.25B 2 + 6.44C 2 (8) ANOVA analysis, shown in Table 5, was used to establish the conditioning of the developed model in terms of coded factors. The analysis solution is presented in terms of the sum of the square residuals, F and p values and the degrees of freedom. Finding a p value below (<0.05) shows that the model terms are important [29]. Regarding COD removal, ANOVA results for the factors of initial pH (A), current density (B) and EC time (C) present the best performance. A low p value (0.007) indicates that these parameters are the most important for the EC treatment of cold meat industry wastewater. Terms (A 2 ), (B 2 ) and (C 2 ) have a p value <0.05, implying that these are significant. All other results showed higher p values (>0.05). At a confidence level of 96%, the R 2 adjusted (0.951) value indicates good performance of RSM models [30].  Table 6 displays 17 experiments of EC using cold meat industry wastewater under diferent conditions, using a three-level-three factor Box-Behnken design (BBD) of RSM. This method was employed in the modeling of COD removal efficiency (%) from cold meat industry wastewater. In this case, the results are consistent, because the behavior in the removal efficiency of COD shows similarity to other works reported in the literature [4,24].

Evaluation of the Predictive Performance of Proposed Models
The performances of the RSM and ANN models in predicting the COD removal from cold meat industry wastewater were evaluated using the equations from [22], and with these results the statistical parameters shown in Table 7 were calculated. The R value is higher when using the ANN than when using RSM, showing that the former method gave the best correlation between experimental and predicted values. The R 2 values confirm the better performance of ANN over RSM, and the adjusted R 2 was used to avoid overestimation of the correlation coefficient (R 2 ), demonstrating the significance of the ANN model. To confirm the closeness of the fitted line to the data points, the MSE and RMSE were evaluated, and these values were higher for the RSM model compared to the ANN model. Based on the results obtained in Table 7, ANN was the best model [16].

Effects of the Variables on COD Removal
Tridimensional graphics were used to analyze the interactive effects of all variables, pH (A), current density (mA/cm 2 ) (B) and EC time (min) (C), with the COD removal responses shown in Figure 4. They were obtained from the modeled data, as shown in Table 6.

Effect of pH
In order to analyze the effect of initial pH on the EC treatment of cold meat wastewater, the operating range was varied from five to nine, and the results were represented in 3D graphics (first and second columns, Figure 4a-f). For current density vs. initial pH (Figure 4a) about 85% removal is linked and after 40 min (Figure 4b), there is a slight increase; however, a higher effect in the removal of COD was localized after 40 min (Figure 4c), in the range of eight to nine. Values between five and six are less efficient for all observed cases (Figure 4a-c). For the case of EC time vs. initial pH (Figure 4d,e), the same low performance was observed, with better results achieved by increasing the current to 6 mA/cm 2 (Figure 4f), establishing the optimal area, with pH levels around eight to nine. This may be because pH values of 6.5-8.8 lead principally to the formation of Al(OH) 3 and not to other chemical compounds, which helps remove pollutants by adsorption [31]. The results of this work agree with those found in the literature [31,32].
3D graphics show that initial pH levels (8-9) lead to a higher performance in the EC treatment of the COD (80%-90%). This behavior can be attributed to the fact that the medium pH (5-7), can promote the mechanism reaction of several chemical species which are relatively less absorbent, like Al(OH) 3 , when aluminum electrodes are used. The literature has reported similar results to those obtained in the present work [20,24,31]. For the EC treatment, the pH parameter is decisive; different chemical species can be formed depending on its value. In the anode reaction, the dissolution of the aluminum electrode produces Al 3+ at a high pH. This reacts with other species such as OH − to produce salts of Al(OH) 3 , a chemical species which can be beneficial for the quick adsorption of soluble organic compounds due to its large capacity of retention, which makes the removal process by EC more efficient [11].
Processes 2020, 8, x FOR PEER REVIEW 9 of 13 salts of Al(OH)3, a chemical species which can be beneficial for the quick adsorption of soluble organic compounds due to its large capacity of retention, which makes the removal process by EC more efficient [11]. . Second column EC time vs. initial pH at current density 2 mA/cm 2 (d), 4 mA/cm 2 (e) and 6 mA/cm 2 (f). Third column EC time vs. current density at initial pH 5 (g), pH 7 (h) and pH 9 (i).

Effect of Current Density
To study the effect of current density in COD removal from cold meat industry wastewater, a range between 2 and 6 mA/cm 2 was analyzed. 3D graphics (first and third columns, Figure 4a-c,g-i) show that EC treatment with low values (2 mA/cm 2 to 4 mA/cm 2 ) in current density do not have a good performance, and the best removal is achieved at 5 mA/cm 2 and higher. This parameter achieves its best results at reaction times after 40 min, with an increase in COD removal (Figure 4c). Around 90% at lower times, the removal is lower, as shown in Figure 4a,b. Likewise, the best removals are Figure 4. Three-dimensional surfaces for COD reduction effectiveness: First column current density vs. initial pH at an EC time of 20 min (a), 40 min (b) and 60 min (c). Second column EC time vs. initial pH at current density 2 mA/cm 2 (d), 4 mA/cm 2 (e) and 6 mA/cm 2 (f). Third column EC time vs. current density at initial pH 5 (g), pH 7 (h) and pH 9 (i).

Effect of Current Density
To study the effect of current density in COD removal from cold meat industry wastewater, a range between 2 and 6 mA/cm 2 was analyzed. 3D graphics (first and third columns, Figure 4a-c,g-i) show that EC treatment with low values (2 mA/cm 2 to 4 mA/cm 2 ) in current density do not have a good performance, and the best removal is achieved at 5 mA/cm 2 and higher. This parameter achieves its best results at reaction times after 40 min, with an increase in COD removal (Figure 4c). Around 90% at lower times, the removal is lower, as shown in Figure 4a,b. Likewise, the best removals are achieved at pH levels around 8 to 9 (Figure 4i), obtaining minor results using neutral and acid pH conditions (Figure 4g,h). Current density shows excellent removal capacity when a value of 5.5 mA/cm 2 is used. Once the current density acquires higher values, more hydrogen bubbles are generated at the cathode, augmenting the homogeneous conditions inside the system and favoring the contact between phases, increasing the velocity of COD removal from wastewater [32].

Effect of Electrolysis Time
Electrolysis time is represented by 3D graphs (second and third columns, Figure 4d-f,g-i) for COD removal. It can be observed that the range of action remains constant for the entire observed experimental range, with a slight increase around 60 min for the case of EC time vs. initial pH (Figure 4d,e), finding the best performance when a current density of 6 mA/cm 2 was used ( Figure 4f). Likewise, in the third column (EC time vs. current density), the removal of COD remains invariable until 45 min, when an increase is observed and enhanced using pH 9 (Figure 4i), decreasing removal performance by lowering initial pH for cases of pH 7 ( Figure 4h) and pH 5 (Figure 4g). This tendency in relation to the EC time can be attributed to the better formation of Al 3+ . These ions enable an increase in the sludge at the end of the process [31].

Optimization Process
The optimization process consists in finding the values of pH, current density and EC time, which yield the best COD removal efficiency. Three different methods are proposed: RSM, ANN-MFO and RSM-MFO. RSM is the response surface method alone; ANN-MFO and RSM-MFO are the artificial neural network and response surface method, in which weights have been obtained by the moth-flame optimization algorithm. Table 8 shows the resulting parameters and their corresponding predicted removal efficiency. It can be seen that the ANN-MFO method obtained the highest predicted value, with 92.91, followed by the RSM and RSM-MFO methods, respectively. These results show a consistent and an overall improvement in performance compared to the removal efficiency obtained by the 17 experiments conducted in the laboratory, as previously shown in Table 6.

Operational Cost
In the previous subsection, it is noted that the best removal efficiency was obtained using the highest current density value (6.6 mA/cm 2 ), which means the system requires more electricity and may increase its overall energy consumption. Therefore, it is important to calculate the operational cost for every set of parameters, in order to assess the viability of the proposed computational techniques in terms of price. These calculations were performed as explained in Section 2.5, and the results are shown in Figure 5. The graph includes the operation cost and COD removal of the 17 laboratory experiments, together with the results from the RSM, ANN-MFO and RSM-MFO techniques. It can be observed that these three computational models achieved the maximum COD removal (with the exception of experiment 16). RSM and ANN-MFO obtained a relatively low cost compared to the average cost of the laboratory experiments. It is also shown that the laboratory experiments obtained erratic operation costs and, in many cases (experiments 11 to 15, for example) very low COD removal. These results suggest that these computational techniques are capable of finding the best parameters to maximize COD removal and minimize operation cost, and can be very helpful to perform more precise and sometimes less costly laboratory experiments.

Conclusions
In this work, computational techniques to model and optimize the electrocoagulation process were proposed. COD removal from cold meat industry wastewater is a complex problem and is difficult to predict and describe. Artificial neural networks are tools that can handle such complex problems and are able to propose a computational system to describe the electrocoagulation process. This article showed that a neural network, trained by another artificial intelligence method such as moth-flame optimization, is able to outperform the techniques used in the past, such as response surface methodology. In this study, it was found that the best electrocoagulation parameter configuration was a pH of 8.9, a current density of 6.6 mA/cm 2 and an electrocoagulation time of 38.62 min, which resulted in the maximum COD removal of 92.91%. These results are useful to better plan a future set of experiments or to test a higher-scale electrocoagulation process, and this simulation technique can be applied in diverse treatments of industrial water.
COD removal by electrocoagulation treatment, although a simple process, can be costly in terms of energy. This work showed that the more significant parameters-namely, current density and time-can be fine-tuned to reduce the electricity needed to achieve the same results or even outperform the results obtained in the laboratory, without the use of computational techniques. The model presented in this paper suggests that a high COD removal of 93.18% can be obtained with only an average cost of 3.14 USD/m 3 ., thus allowing significant savings in larger scale wastewater treatment processes.