*Article* **Predictive Model Based on K-Nearest Neighbor Coupled with the Gray Wolf Optimizer Algorithm (KNN\_GWO) for Estimating the Amount of Phenol Adsorption on Powdered Activated Carbon**

**Meriem Zamouche 1,\*, Mouchira Chermat 1, Zohra Kermiche 1, Hichem Tahraoui <sup>2</sup> , Mohamed Kebir <sup>3</sup> , Jean-Claude Bollinger 4, Abdeltif Amrane <sup>5</sup> and Lotfi Mouni 6,\***


**Abstract:** In this work, the adsorption mechanism of phenol on activated carbon from aqueous solutions was investigated. Batch experiments were performed as a function of adsorbent rate, solution temperature, phenol initial concentration, stirring speed, and pH. The optimal operating condition of phenol adsorption were: mass/volume ratio of 0.6 g.L−1, temperature of 20 ◦C and stirring speed of 300 rpm. The equilibrium data for the adsorption of phenol were analyzed by Langmuir, Freundlich, and Temkin isotherm models. It was found that the Freundlich and Temkin isotherm models fitted well the phenol adsorption on the activated carbon and that the adsorption process is favorable. The Langmuir equilibrium isotherm provides a maximum adsorption of 156.26 mg.g−<sup>1</sup> at 20 ◦C. The pseudo-first-order, pseudo-second-order, intraparticle diffusion, and Boyd models were used to fit the kinetic data. The adsorption kinetics data were well described by the pseudo-second-order model. The kinetic was controlled by the external diffusion by macropore and mesopore, as well as by the micropore diffusion. The thermodynamic study revealed the exothermic and spontaneous nature of phenol adsorption on activated carbon with increased randomness at the solid-solution interface. On the other hand, a very large model based on the optimization parameters of phenol adsorption using k-nearest neighbor coupled with the gray wolf optimizer algorithm was launched to predict the amount of phenol adsorption. The KNN\_GWO model showed an advantage in giving more precise values related to very high statistical coefficients (R = 0.9999, R2 = 0.9998 and R2 adj = 0.9998) and very low statistical errors (RMSE = 0, 0070, MSE = 0.2347 and MAE = 0.2763). These advantages show the efficiency and performance of the model used.

**Keywords:** adsorption; phenol; activated carbon; modeling; k-nearest neighbor; gray wolf optimizer

#### **1. Introduction**

Water is the major constituent of our planet and is of great importance for living beings (humans, animals, and plants) for the balance of the aquatic ecosystems. Water is covering about 70% of the earth's surface, which is why we call the earth the Blue Planet. However, 97.5% of this water is salty; it represents the oceans, the seas, and some groundwater, while only 2.5% of all the water on earth is fresh water.

**Citation:** Zamouche, M.; Chermat, M.; Kermiche, Z.; Tahraoui, H.; Kebir, M.; Bollinger, J.-C.; Amrane, A.; Mouni, L. Predictive Model Based on K-Nearest Neighbor Coupled with the Gray Wolf Optimizer Algorithm (KNN\_GWO) for Estimating the Amount of Phenol Adsorption on Powdered Activated Carbon. *Water* **2023**, *15*, 493. https://doi.org/ 10.3390/w15030493

Academic Editors: Andrea G. Capodaglio and Antonio Panico

Received: 14 November 2022 Revised: 18 January 2023 Accepted: 20 January 2023 Published: 26 January 2023

**Copyright:** © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

About 2.1% of the world's freshwater is in the form of polar ice and permanent snow in the mountains, so it is not available for consumption or agricultural uses. The very small remaining percentage of freshwater is estimated at 0.4%, of which one-third is groundwater hidden in the earth's crust and often difficult to access [1]. This low percentage of this vital source has reduced and continues to be threatened year after year, as the consequences of climate change impact the planet, on the one hand, and on the other hand, by pollution caused by industrial and agricultural activities. In addition, urban wastes include many toxic substances that contribute strongly to the degradation of freshwater quality and limited access to water resources.

Water pollution is a major concern and is tied to the top worry of states and organizations for the protection of the aquatic environment. Among the emerging chemicals of concern and greatest risks to the aquatic environment are phenol and phenolic compounds. These tend to enter and persist extensively in the environmental ecosystem, accumulate and exert toxic effects on humans and animals [2].

The presence of phenol in the aquatic environment is mainly due to discharges from the plastics, dyes, pulp, and paper industries [3]. Phenols are also released from the industries of solid fuel gasification, crude oil processing, phytosanitary chemicals, pharmaceutical plants, perfume-manufacturing industries, disinfectants, and insecticides [4]. Due to their wide use, phenols or phenolic compounds are released with the effluents of these industries. This often leads to the contamination of groundwater and surface water. Phenol and phenolic compounds are not easily biodegradable, due to their resistance and complex structure; they constitute a major menace to public health and the aquatic environment [5].

Phenol is toxic to aquatic organisms, plants, and humans at concentrations of 5 μg.L−<sup>1</sup> [6,7]. Intoxication and ingestion of phenol into the human body can occur through the skin, inhalation, or ingestion of phenol-contaminated products (water, foods that have been treated with phenol, etc.). Inhalation of phenol vapors can cause pulmonary edema, while prolonged contact with the skin can cause pulmonary edema and burns. Chronic exposure to phenol causes oral irritation, visual disturbances, diarrhea, deep necrosis, cardiac dysrhythmias, respiratory distress, metabolic acidosis, renal failure, and methemoglobinemia; in the most complicated cases, it causes cardiovascular shock, coma, and can even result in death [6–9]. Therefore, the World Health Organization (WHO) recommends that the maximum allowable concentration of phenol in drinking water should be less than 1 μg.L−<sup>1</sup> [6,8].

Thus, the elimination of this generated toxic pollutant from the industries requires the implementation of reliable and efficient treatment processes. The treatment of water contaminated by phenol is an environmental challenge, and it has been investigated by many authors using several processes; the biological treatment is efficient only for low concentrations of phenols, which are lower than the discharging limits required and not toxic for the microbial flora [4].

However, the choice of such a process is based on its efficiency to remove different large concentrations of pollutants from wastewater with an economical treatment cost. The processes often used are the membrane technique, electrocoagulation, ion exchange, precipitation, flotation, and oxidation processes [10–13]. However, these processes have some limits and weaknesses, such generation of highly toxic byproducts or the high cost. On the other hand, adsorption is an alternative, and very effective, classic technique for the elimination of different kinds of pollution [14–18].

Adsorption has been conducted in this work and seems to be the most appropriate for the removal of phenol from contaminated water. Nevertheless, adsorption remains complex [19], because it is a non-linear process, both time-consuming and expensive compared to digital modeling techniques, especially if dealing with large areas. Recently, many authors have studied the parameters affecting water quality using an artificial intelligence approach [20].

Several works deal with great success in the simulation and prediction approaches of environmental parameters and can be used for management decisions [21], such as: Artificial neural networks [22–24], support vector machine [24,25], multiple linear regressions [23], and adaptive neuro-fuzzy inference System [24].

To evaluate the suggested approach, the machine learning process is considered as one of the advanced methods capable of efficiently solving complex optimization problems [19]. Notably, k-nearest neighbor (KNN) uses many sets of nearest neighbors for processing [19]. The KNN searches for the nearest neighbor match using the pre-processed data and this data is used for the prediction process [19]. Moreover, the use of optimization algorithms remains an effective process methodology for advanced evaluation progression with time consumption [19]. Among these algorithms is the gray wolf optimization algorithm (GWO), a bio-inspired algorithm coupled with a very popular prediction-based classifier, named as KNN algorithm, to categorize data with data made up of datasets [19]. The effectiveness of the prediction process can be actualized with the experience of the data to validate the degree of effectiveness of the properties measured through the optimization process in the product [19].

In our work, powdered activated carbon (PAC) has been considered for elimination of phenol from aqueous solution. Activated carbon adsorption (PAC) is a highly efficient and flexible process for water treatment, and has been successfully used to reduce environmental pollution. The adsorption mechanism of phenol on activated carbon is affected by several factors, including not only the characteristics of the PAC but also the physical and chemical characteristics of the phenol [26].

The main goal of this study is to investigate the adsorption capacity of PAC in the field of wastewater treatment for removing phenol as a toxic molecule using artificial intelligence that will allow the prediction and optimization of parameters that have a significant effect on the phenol removal mechanism.

Isotherm blindness study follow-up: In the end, k-nearest neighbor coupled with the gray wolf optimizer algorithm (KNN\_GWO) was used to create an extended model to overcome traditional methods and to predict the amount of phenol adsorbed on PAC. The GWO algorithm has been used to solve a wide variety of optimization problems such as improving machine-learning performance by optimizing model hyper-parameters. It has been followed by an application executable on windows to facilitate optimization by GWO and prediction by KNN\_GWO. To date and to our knowledge, the prediction of phenol adsorption quantity using KNN\_GWO has never been investigated before.

#### **2. Materials and Methods**

#### *2.1. Reagents*

All chemicals used were of analytical grade and were used as received (from Sigma-Aldrich, St. Louis, Missouri, USA) without further purification: Phenol (99.9%) was used as an adsorbate. Sodium hydroxide (NaOH) (98%) was supplied by Labosi. Hydrochloric acid (HCl) (37%) and sodium thiosulfate (Na2S2O3) were purchased from Panreac, Barcelona, Spain. Sodium bicarbonate (NaHCO3) (99.5%), iodine (I2) (99%), sodium carbonate (Na2CO3) (99.5%) and methylene blue (99%) were supplied by Biochem Chemopharma, Cosne-Cours-sur-Loire, France, and powdered activated carbon (PAC) was supplied by Biochem Chemopharma.

#### *2.2. Solution Preparation*

The stock solution at a concentration of 1 g/L−1, was prepared by dissolving 1 g of phenol powder accurately weighted in one liter of distilled water. The solution was agitated until complete dissolution of phenol. The experimental solutions were obtained by diluting the stock solutions to the desired initial concentrations.

#### *2.3. Adsorption Kinetics Experiments*

The adsorption kinetics were performed in discontinuous mode at a constant temperature of 20 ◦C ± 1 ◦C. The temperature was kept constant by a water bath (Kottermann Labortechnik, Uetze, Germany). Therefore, a mass volume ratio of 0.6 ((g) adsorbent. (L<sup>−</sup>1)

phenol solution) at a concentration of 25 mg.L−<sup>1</sup> was stirred by a stirrer and heating plate (IKAMAG, Snijders, Tilburg, The Netherlands) at 300 rpm. During the adsorption process, a volume of 4 mL was sampled and filtered with a Millipore filter (0.45 μm). The recovered filtrate was immediately analyzed by spectrophotometer (Shimadzu mini 1601, Kyoto, Japan) at a wavelength of 272 nm. The amount of phenol adsorbed (mg.g<sup>−</sup>1) at time t, and the pollutant removal efficiency (%) were calculated by the following equations:

$$\mathbf{q}\_{\rm t} = \frac{(\mathbf{C}\_{\rm 0} - \mathbf{C}\_{\rm t})}{\mathbf{m}} \mathbf{V} \tag{1}$$

$$\mathbf{E}(\%) = \frac{(\mathbf{C\_0} - \mathbf{C\_t})}{\mathbf{C\_0}} \mathbf{100\%} \tag{2}$$

where: qt(mg.g<sup>−</sup>1) is the amount adsorbed at time t, V (L) is the volume of the solution, m (g) is the mass of the adsorbent, C0 and Ct are the initial and residual concentration of the adsorbate in solution (mg.L<sup>−</sup>1), and E (%) is percent removal of pollutant.

To examine the effect of the operating parameters on the amount of phenol removed, the experiments were carried out at different adsorbent rates from 0.4 to 1.6 g.L−1; the temperature of the solution was varied from 20 to 50 ◦C and the stirring speed from 200 to 600 tr.min−1. The effect of the initial concentration of phenol was studied by varying the phenol concentration from 10 to 200 mg.L<sup>−</sup>1, while the pH effect is conducted in the range of pH from 2 to 12. The pH value was adjusted by hydrochloric acid (0.1 N) or sodium hydroxide (0.1 N). The pseudo-first-order and pseudo-second-order kinetic models have been widely used to describe the adsorption rate [27–29], and they are given by following the equations:

$$\frac{d\mathbf{q}}{dt} = \mathbf{k\_1} \left(\mathbf{q\_e} - \mathbf{q\_t}\right) \tag{3}$$

$$\frac{\mathbf{dq\_t}}{\mathbf{dt}} = \mathbf{k\_2} (\mathbf{q\_e} - \mathbf{q\_t})^2 \tag{4}$$

where qt (mg.g−1) is the adsorption capacity at time t (min), k1 is the rate constant of pseudo-first-order adsorption (1.min−1), k2 (g.mg−1.min−1) is the pseudo-second-order rate constant, and qe (mg.g<sup>−</sup>1) is the equilibrium adsorption capacity.

In order to understand the adsorption mechanism of phenol on the PAC and to identify the limiting steps in the adsorption mechanism process, the data kinetics of phenol adsorption on activated carbon were modeled by Weber–Morris intra-particle diffusion [27–29] and Boyd's [27–29] kinetic models, which are expressed as:

$$\mathbf{q\_{\bar{t}}} = \mathbf{K\_D} \sqrt{\mathbf{\bar{t}}} + \mathbf{c\_d} \tag{5}$$

$$\mathbf{B}\_{\rm l} = -\mathbf{0}.\mathbf{4977} - \ln\left(\mathbf{1} - \mathbf{F}\right) \tag{6}$$

KD is the intraparticle diffusion parameter; cd is the thickness of the boundary layer, and F is the extent of exchange at time t, which is expressed in terms:

$$\mathbf{F} = \mathbf{q}/\mathbf{q}\_e \tag{7}$$

#### *2.4. Adsorption Isotherms*

The equilibrium data of adsorption isotherm of phenol on activated carbon at different temperature were modeled by Langmuir [30,31], Freundlich [31], and Temkin [31] isotherms, whose mathematical expressions are expressed as:

$$\mathbf{q\_e} = \frac{\mathbf{q\_m} \mathbf{K\_L} \mathbf{C\_e}}{1 + \mathbf{K\_L} \mathbf{C\_e}} \tag{8}$$

$$\mathbf{q}\_{\mathbf{e}} = \mathbf{K}\_{\mathrm{F}} \mathbf{C}\_{\mathrm{e}}^{\frac{1}{\overline{n}}} \tag{9}$$

$$\Theta = \frac{\mathbf{q\_e}}{\mathbf{q\_m}} = \left(\frac{\mathbf{RT}}{\mathbf{b\_T}}\right) . \ln(\mathbf{A\_T} \mathbf{C\_e}) \tag{10}$$

where Ce is the phenol concentration at equilibrium (mg.L<sup>−</sup>1),qe is the adsorption capacity at equilibrium (mg.g−1), qm is the maximum adsorption capacity (mg.g−1), KL is the Langmuir constant (mg.L<sup>−</sup>1), KF is the Freundlich adsorbent capacity, n is the heterogeneity factor, R is the universal gas constant (8.314 J.mol−1K−1), bT and AT are characteristic constants of the Temkin isotherm, and θ is the recovery rate.

#### *2.5. K-Nearest Neighbor*

K-nearest neighbor (KNN) is a well-known method in machine learning, where it has recently been applied for the classification and parametric estimation analysis of difficultto-evaluate unknown probabilities [19,20]. The KNN is inferred to classify the model, which has an idea of the k nearest neighbor rule [19,20], by proposing a new classification technique based on the distance between distributions [19,20]. The concept of KNN is to classify individual data that contains the nearest neighbor majority [19,20]. On the other hand, the KNN consists of classifiers and regressions for the prediction process [19,20], since the classification involves identifying and classifying groups based on the characteristics of the data [19,20]. In addition, for regression, one needs to use existing data to predict future data [19,20].

In this work, the KNN model was used to create an extended model to overcome traditional methods for predicting the amount of phenol adsorbed onto the best adsorbent (PCA). Another advantage is that the KNN model can easily handle large amounts of noisy data from dynamic and nonlinear systems. For this purpose, the results of the adsorbed quantity of phenol obtained at each instant by the optimization of the adsorption parameters were collected in a single database; the database collected with the dimension [376:7] includes seven parameters considered as inputs and one output parameter. The independent parameters were the contact time of each sample (×1), the phenol concentration (×2), the mass of adsorbent (×3), the stirring speed (×4), the temperature (×5), and the pH of the solution (×6). On the other hand, output (y) was the quantity of adsorbed phenol obtained at each instant.

To obtain the optimal result from KNN, a strategy based on design and optimization was followed. From the start, the database was normalized once in the interval [−1, +1] using MATLAB "mapminmax" function. Then, a small database of size [50:7] was hidden for later use to test the performance of the best obtained model. Therefore, the rest of the size database [326:7] was split in half: 80% of the dataset for training and 20% of validation samples. Subsequently, 11 distance metrics were optimized (Euclidean, Chebychev, Minkowski, Mahalanobis, Cosine, Correlation, Spearman, Hamming, Jaccard, Cityblock, Seuclidean) with their distance weighting functions (equal, inverse and squared inverse). Knowing this, each distance metric was also optimized for its specific parameters (number of neighbors and exponent in the case of "Minkowski" cubic distance metrics).

For this, the gray wolf optimizer (GWO) algorithm was coupled with KNN (KNN\_GWO) to optimize the specific parameters of each distance metric, since this optimization of the algorithm has been used to solve a wide variety of optimization problems [19,21]. Among these solved problems are different machine learning optimization problems, fundamental values, and penalty parameters, which were sent by the GWO to train machine learning using training data [19,21]. This last point was confirmed by some studies that proved that machine learning performance was achieved when hyperparameters were optimized using the GWO algorithm [19,21].

At the end, to evaluate the performance and to select the best model, statistical criteria were used, including: the correlation coefficient (R), coefficient of determination (R2), adjusted coefficient (Radj 2), root mean square error (RMSE), mean square error (MSE) and mean absolute error (MAE). These criteria are calculated considering the following equations [22–25].

$$\mathbf{R} = \frac{\sum\_{i=1}^{\mathbf{N}} \left( y\_{exp} - \overline{y}\_{exp} \right) \left( y\_{pred} - \overline{y}\_{pred} \right)}{\sqrt{\sum\_{i=1}^{\mathbf{N}} \left( y\_{exp} - \overline{y}\_{exp} \right)^2 \sum\_{i=1}^{\mathbf{N}} \left( y\_{pred} - \overline{y}\_{pred} \right)^2}} \tag{11}$$

$$\mathbf{R}\_{\text{adj}}^2 = 1 - \frac{\left(1 - \mathbf{R}^2\right)\left(\mathbf{N} - 1\right)}{\mathbf{N} - \mathbf{K} - 1} \tag{12}$$

$$\mathbf{RMSE} = \sqrt{\left(\frac{1}{\mathbf{N}}\right) \left(\sum\_{i=1}^{\mathbf{N}} \left[\left(y\_{exp} - \overline{y}\_{exp}\right)\right]^2\right)}\tag{13}$$

$$\text{MSE} = \sqrt{\left(\frac{1}{\mathbf{N}}\right) \left(\sum\_{i=1}^{\mathbf{N}} \left[\left(y\_{exp} - y\_{pred}\right)\right]^2\right)}\tag{14}$$

$$\mathbf{MAE} = \sqrt{\left(\frac{1}{\mathbf{N}}\right) \left(\sum\_{i=1}^{\mathbf{N}} \left|y\_{exp} - y\_{pred}\right|\right)}\tag{15}$$

where **N** is the number of data samples; **K** is the number of variables (inputs); *yexp* and *ypred* are the experimental and the predicted values, respectively; and *yexp* and *ypred* are the average values of the experimental and the predicted values, respectively [22–25].

#### **3. Results and Discussions**

#### *3.1. Phenol*

Phenol has a chemical formula C6H5OH with a molecular weight of 94.11 g.mol<sup>−</sup>1. It is a weak acid with pKa = 9.99, a mass density 1.07 g.cm−<sup>3</sup> and an aqueous solubility of 83.11 mg.L−<sup>1</sup> at 293.15 K [18].

#### *3.2. Characterization of PAC*

The powdered active carbon (PAC) used in this study was the same one that was prepared and used previously for the adsorption of ketoprofen [32]. Its characterization results are summarized in the Table 1.



The iodine number estimates the capacity of activated carbon to adsorb molecules of microporous size (less than or equal to that of the iodine molecule, i.e., 0 to 20 Å) [33]. The methylene blue (MB) index is used to estimate the amount of both the mesopores and macropores, which is indicative of a high adsorption ability of larger molecules. The iodine and the methylene blue numbers found were equal to 752 and 244 mg.g<sup>−</sup>1, respectively. It is quite clear that the iodine index is higher than the methylene blue one, which indicates that the surface of the powdered activated carbon is mostly composed of micropores rather than of macro- or mesopores. Thus, this PAC has a strong adsorptive ability for microporous

particles. This finding is coherent, since the phenol molecule is microporous (diameter of phenol = 0.56 nm), therefore it can easily be adsorbed by microporous adsorbents.

#### *3.3. Effect of Operating Parameters*

#### 3.3.1. Effect of the Adsorbent Mass to Volume

To examine the influence of the adsorbent mass on the phenol adsorption, the ratio of activated carbon mass to solution volume was investigated in the range 0.4 to 1.6 g.L−1, while maintaining the solution temperature at 20 ◦C and the phenol concentration at 25 mg.L−1. According to Figure 1, the equilibrium adsorption capacity per gram of adsorbent decreased from 57.57 to 15.14 mg.g−1, when the adsorbent mass to volume ratio increased from 0.4 g to 1.6 g.L−1, while the percentage removal increased from 95.83 to 99.94%. The increase in phenol removal was due to the increase in the adsorption surface area with the disposal of a greater number of adsorption sites [32]. It was also noted that the adsorption was very fast at the beginning, which may be related to the large concentration gradient of phenol and powdered activated carbon; then the equilibrium was achieved due to the saturation of adsorbent sites. For all the studied adsorbent mass to solution volume ratios, a rapid removal of phenol (99.94%) occurred in a few minutes (te ≤ 5 min). Phenol removal increased up to the ratio of 0.6 g.L<sup>−</sup>1, and then did not significantly change. Thus, the optimal mass/volume ratio chosen to continue this work was 0.6 g.L<sup>−</sup>1.

**Figure 1.** Effect of the mass volume ratio of PAC on the removal of phenol. (C0 = 25 mg.L−1, w = 300 rpm, T = 20 ◦C).

#### 3.3.2. Effect of the Initial Concentration of Phenol

To study the effect of the initial concentration of phenol by adsorption on PAC, the initial concentrations of phenol was varied from 10 to 200 mg.L−1. The obtained results, shown in Figure 2, indicate that the amount of adsorbate fixed on the PAC increased from 16.31 to 162.54 mg.g−<sup>1</sup> with the increase in the initial concentration of phenol from 10 to 200 mg.L<sup>−</sup>1. The initial concentration provides a significant driving force required to overcome all mass transfer resistances of all the phenol molecules between the aqueous and the solid phases [34]. It is also shown that the removal yield decreased from 99.94 to 48.92% with increasing the initial concentration of phenol. The increase in the initial phenol concentration enhances the interaction between phenol and the active sites on the surface of the activated carbon, increasing the removal of phenol. This can be attributed to the saturation of the adsorption sites for increasing phenol concentrations [34,35].

**Figure 2.** Percent removal of phenol by PAC as a function of the initial concentration (**a**), amount of phenol adsorbed as a function of time at different phenol initial concentration (**b**) (r = 0.6 g.L−1, w = 300 rpm, T = 20 ◦C).

#### 3.3.3. Effect of Temperature

Temperature is an indicator of the adsorption nature, whether it is an exothermic or an endothermic process [35]. Figure 3 shows that the equilibrium adsorption capacity of PAC decreased from 40.02 to 38.96 mg.g−<sup>1</sup> with an increase of the temperature from 20 to 50 ◦C, on the one hand, and the removal percentage decreased from 99.94 to 94.80%, on the other hand. According to the study carried out by Abdelwahab and Amin [35], the decrease in the removal efficiency for increasing temperatures is due to the weakening of the adsorption forces between the active sites on the surface of the adsorbent and the adsorbate species and probably the damage of the active sites on the adsorbent [35]. The weakening of the adsorption forces results in a decrease in the adsorption efficiency. Consequently, the reduction in the rate of adsorbed phenol with increasing temperature reveals that the adsorption is an exothermic process [34]. The maximum removal was observed at the optimum temperature of 20 ◦C; further increase in temperature is inappropriate as it leads to the decrease in the percentage removal.

**Figure 3.** Percentage of elimination of phenol (**a**) and amount adsorbed of phenol (**b**) by PAC as a function of temperature. (r = 0.6 g.L<sup>−</sup>1, w = 300 rpm, C0 = 25 mg.L<sup>−</sup>1).

#### 3.3.4. Effect of the Stirring Speed

The effect of the stirring speed was evaluated from 200 to 600 rpm. The results obtained are illustrated in Figure 4, showing that the stirring speed did not affect the phenol adsorption, most likely due to the very fast adsorption that was achieved in the first contact minutes. Thus, the speed of 300 rpm was chosen as an optimal; this speed is

sufficient to favor the contact between the PAC particles and the phenol molecules without slowing down the adsorption forces [36].

**Figure 4.** Evolution of the percent removal (**a**) and amount adsorbed of phenol (**b**) at equilibrium as a function of the stirring speed (r = 0.6 g.L<sup>−</sup>1, T = 20 ◦C, C0 = 25 mg.L<sup>−</sup>1).

#### 3.3.5. Effect of the pH

In order to study the influence of this parameter on the phenol adsorption by PAC, pH values in the range of 2 to 12 were considered.

Figure 5 shows that the amount of phenol adsorbed by the PAC remained stable within the range pH of 2–8, with an almost total elimination. Beyond pH 8, phenol percent removal decreased until reaching a value of 57.34% at pH 12.

**Figure 5.** Evolution of the percentage removal (**a**) and amount adsorbed of phenol (**b**) at equilibrium as a function of the pH of the solution (r = 0.6 g.L<sup>−</sup>1, T = 20 ◦C, C0 = 25 mg.L<sup>−</sup>1, w = 300 rpm).

In the pH range between 2 and 8, an almost invariable total elimination has been observed. In this pH range, the surface of PAC is positively charged, since pH < pHPZC = 7.5 (Table 1); while phenol, is neutral when pH < pKa = 9.99. Thus, the adsorption of phenol on the PAC surface is favored by hydrogen bonding, according to Luz-Asunción et al. [37] (Figure 6a).

**Figure 6.** (**a**) Interaction mechanism between AC surface functions and phenol. (**b**) Phenol dissociation at pH > pKa.

It has been reported [37] that the presence of carboxylic and hydroxyl groups on the surface of the adsorbent promotes the removal of phenol by hydrogen bonding. The Boehm titration performed on PAC showed that strong carboxylic acid, and hydroxyl and phenol groups are favored to be adsorbed on the surface of the PAC, increasing the probability that the phenol adsorption occurs by hydrogen bonding.

As mentioned previously [37], phenol is a weak acid with an acid dissociation constant (pKa) equal to 9.99; at pH > pKa it dissociates into phenolate ions (Figure 6b) [38]. Therefore, at pH > pKa, the concentration of negatively charged phenolate ions increases in solution and the surface of the PAC is negatively charged (pH > pHPZC = 7.5), hence, electrostatic repulsions occur between the negative surface charge of the PAC and the phenolate anions in solution, which caused the decrease in adsorption efficiency at pH values above 8.

#### *3.4. Kinetics Study*

The study of adsorption kinetics provides a description for the rate of adsorbate uptake and gives information of the mechanism controlling the rate of adsorption [39]. The kinetics parameters of Lagergren, Blanchard, and Webber and Morris for different concentrations of adsorbate at a 20 ◦C are gathered in Tables 2 and 3.


**Table 2.** Kinetics parameters of Lagergren and Blanchard for different initial concentrations of phenol.


**Table 3.** Kinetics parameters of Weber and Morris for different initial concentrations of phenol.

According to the results assembled in Table 2, the coefficients of correlation obtained by the pseudo-first-order model were very low, showing a bad correlation; the maximum capacities given by the pseudo-first-order model were not in agreement with those obtained experimentally, accounting for the poor fit obtained. On the other hand, the obtained R<sup>2</sup> values for the Blanchard model were very good (≈1); the equilibrium-adsorbed amounts calculated theoretically by this pseudo-second-order model were almost identical to those found experimentally. Consequently, the adsorption process of phenol by PAC was found to be more suitable with the pseudo-second-order model.

The application of the Weber and Morris model to the kinetics data gave more or less acceptable coefficients correlations R2 (>0.902) (Table 3), with some exceptions for the two concentrations of 10 and 20 mg.L<sup>−</sup>1.

The linear plot did not pass through the origin (cd = 0), which indicates that the intra-particle diffusion was not the only mechanism controlling the kinetics adsorption of phenol [40]. The obtained lines were multi linear consisting of two segments; the first linear area represented the external diffusion by macropore and mesopore, while the second segment of the fitting slope represented the micropore diffusion by the intraparticle diffusion [18,41].

The application of Boyd model to the experimental data shows that lines did not cross the origin, which indicates that the extra-particle diffusion was not the limiting stage of the adsorption process of phenol by the PAC.

#### *3.5. Isotherms Study*

Adsorption isotherms of phenol on powdered activated carbon were performed at temperatures ranging from 20◦ to 40 ◦C. Figure 7 shows the variation of the equilibrium adsorbent amount (qe) as a function of the equilibrium adsorbate concentration (Ce). The isotherm plots of phenol adsorption on PAC show that the quantity of phenol adsorbed at equilibrium increased with the increase in the phenol equilibrium concentration; a slowing down was then observed, which corresponds to the equilibrium saturation of the adsorption sites.

Moreover, the obtained isotherms show that the adsorbed amount at equilibrium decreased with the increase of temperature from 20 to 40 ◦C. This decrease in the adsorbed amount suggests a weak adsorption interaction between the PAC surface and phenol, which favors the physisorption nature [42].

To evaluate the adsorption mechanisms, the experimental equilibrium data were fitted by different adsorption isotherm models, namely Langmuir, Freundlich, and Temkin, at different temperatures (Figure 8). The fitting parameters are reported in Table 4.

**Figure 7.** Phenol adsorption isotherms by PAC at different temperatures of 20, 30, and 40 ◦C.

**Table 4.** Fitting parameters by nonlinear regression expression of Langmuir, Freundlich, and Temkin isotherms at different temperatures.


From Table 4, the R<sup>2</sup> obtained by Langmuir was more or less satisfactory (R2 ≤ 0.975). The values of maximum adsorption capacity values determined by Langmuir were in the range from 146.9 to 156.26 mg.g−1. These values were comparable to those reported by Fierro [43], where the obtained maximum adsorption capacities varied from 74 to 137.36 mg.g−<sup>1</sup> for different commercial activated carbon used to adsorb phenol from aqueous solution [43].

The "favorability" of the Langmuir isotherm for an initial concentration C0 is verified by the Hall parameter (RL), which is given by [44,45]:

$$\mathbf{R}\_{\rm L} = \frac{1}{1 + \mathbf{K}\_{\rm L} \* \mathbf{C}\_{0}} \tag{16}$$

where:

C0: initial concentration of phenol (mg.L<sup>−</sup>1)

KL: the constant related to the energy of adsorption (Langmuir constant)

RL: value indicates the adsorption nature to be either unfavorable if RL > 1, linear if RL = 1, favorable if0<RL < 1 and irreversible if RL = 0.

**Figure 8.** Nonlinear fitting of the equilibrium data by Langmuir, Freundlich, and Temkin isotherms at different temperatures (**a**) T = 20 ◦C; (**b**) T = 30 ◦C, (**c**) T = 40 ◦C.

From the results reported in Table 4, the calculated RL parameters were between 0 and 1, indicating that the Langmuir isotherm is favorable [44,45].

The value of the Freundlich parameter n was greater than 1 (n > 4) for all temperature studies, indicating that the adsorption of phenol by PAC is favorable and physical [45,46]. It is in agreement with the findings of adsorption isotherms for different temperatures, since the amount adsorbed at equilibrium was inversely proportional to the temperature.

The correlation coefficients of Freundlich are overall very satisfactory, and they are higher than those obtained by Langmuir, suggesting that the adsorption of phenol by PAC is well described by the Freundlich model.

The Temkin isotherm can model the equilibrium data of phenol adsorption on PAC, due to the satisfactory values obtained for the correlation coefficients. The Temkin constant (bT) related to the adsorption energy was positive at all studied temperatures, which shows that phenol adsorption by powdered activated carbon is exothermic [32].

The results of the modeling equilibrium data reveal that the Langmuir, Freundlich, and Temkin isotherms well fitted the experimental data. It is also concluded that the adsorption is physical, favorable, and may be an exothermic type.

#### *3.6. Thermodynamics Study*

The thermodynamic study of phenol adsorption over PAC was conducted by calculating the Gibbs free energy change (ΔG◦), enthalpy change (ΔH◦), and entropy change (ΔS◦) as function of temperature. The Gibbs free energy of adsorption (ΔG◦) can be expressed as [47,48]:

$$
\Delta \mathbf{G}^{\circ} = -\mathbf{R} \mathbf{T} \ln \mathbf{K}\_{\mathbf{L}}^{\circ} \tag{17}
$$

where R is the universal gas constant (8.314 J.mol<sup>−</sup>1K−1), T the temperature (K), and KL ◦ is the (dimensionless) "thermodynamic" Langmuir constant for the adsorption process.

The value of KL (L.mg<sup>−</sup>1), calculated from Langmuir model (Equation (8)) and given in Table 4 (Section 3.5), should be converted to molar concentration unity considering the standard state C◦ = 1 mol.L−<sup>1</sup> [47,48]:

$$\mathbf{K}\_{\mathbf{L}}^{\diamond} = \mathbf{K}\_{\mathbf{L}} \left( \mathbf{L}.\mathbf{m}\mathbf{g}^{-1} \right) \times \mathbf{1000} \left( \mathbf{m}\mathbf{g}^{-1} \right) \times \mathbf{M}\_{\mathbf{Phenol}} \left( \mathbf{g}.\mathbf{mol}^{-1} \right) \times \mathbf{C}^{\diamond} \left( \mathbf{mol}.\mathbf{L}^{-1} \right) \tag{18}$$

where MPhenol is the phenol molar mass = 94.11 g.mol−<sup>1</sup> and the factor 1000 to convert g to mg.

The enthalpy (ΔH◦) and entropy (ΔS◦) parameters were estimated from the classical relationships [47–49]:

$$
\boldsymbol{\Delta \mathbf{G}}^{\circ} = \boldsymbol{\Delta \mathbf{H}}^{\circ} - \mathbf{T} \boldsymbol{\Delta \mathbf{S}}^{\circ} \tag{19}
$$

$$\text{InK}\_{\text{L}}^{\circ} = \frac{\Delta \text{S}^{\circ}}{\text{R}} - \frac{\Delta \text{H}^{\circ}}{\text{RT}} \tag{20}$$

The plot was drawn between ln KL ◦ versus 1/T and the determined slope and intercept was used to calculated ΔH◦ (kJ.mol<sup>−</sup>1) and ΔS◦ (J.mol<sup>−</sup>1), respectively (see Table 5).

**Table 5.** Thermodynamic parameters of phenol adsorption.


The value of ΔH◦ was negative, indicating that the process of phenol adsorption by PAC is exothermic and the adsorption behavior may be of physical nature [50]. The value of ΔH◦ < 40 kJ.mol<sup>−</sup>1, suggesting a physically driven process [49]. The positive and small value of ΔS◦ indicated that the adsorption proceeds with an increase in the number of species at solid–solution interfaces, showing an increased disorder and randomness at the solid–solution interface during the adsorption of phenol on the activated carbon [51,52]. The variation of ΔG◦ was negative for all the temperatures studied, which confirmed the feasibility and spontaneous nature of the phenol adsorption by PAC [51,53].

#### *3.7. KNN Model*

The goal in this work, as previously reported, was to develop the KNN model. The 11 distance metrics (Euclidean, Chebychev, Minkowski, Mahalanobis, Cosine, Correlation, Spearman, Hamming, Jaccard, Cityblock, Seuclidean) were optimized with their distance weighting functions (equal, inverse and squared inverse). From this, each metric distance was optimized for its specific parameters by GWO (number of neighbors and exponent in the case of cubic "Minkowski" distance metrics).

Table 6 shows the results of optimizing the 11 distance metrics and their weighting functions, distance. It also shows the statistical coefficients and errors (R, R2, R2 adj, RMSE, MSE, MAE) for training data, validation data, and for all data (training+validation) according to specific parameters (num neighbors and exponent). In addition, the GWO settings were used for optimization.

**Table 6.** Performances of the different KNN models tested.



#### **Table 6.** *Cont.*


**Table 6.** *Cont.*

The results of Table 6 show that most of the models have coefficients (R, R2, R2 adj) equal to 1 with very low statistical errors (almost 0) in the learning phase (except distance weight "equal" of each distance, and the "Spearman" distance with the three distance weights, "Equal, Inverse and Inverse Squared", which were very small).

This is why the choice of the best model was based on the coefficients and the statistical errors of the validation phase.

According to the results reported in Table 6, the "Jaccard" distance with distance weight "Squared Inverse" led to the best results for the coefficients and the statistical errors compared to the other models in the validation phase, R, R2, R2 adj, RMSE, MSE, and MAE were 0.9971, 0.9942, 0.9935, 0.0156, 0.0002, and 0.0078, respectively.

This result was confirmed by the statistical coefficients and errors obtained for all the data (the training and validation data): R, R2, R2 adj, RMSE, MSE, and MAE were 0.9999, 0.9998, 0.9998, 0.0070, 0.2347, and 0.2763, respectively. In addition, the statistical coefficients and errors of the learning phase were: R = 1.0000, R<sup>2</sup> = 1.0000, R2 adj = 1.0000, RMSE = 0.0010, MSE = 0.0000, and MAE = 0.0001.

From these results, the model optimized by the distance "Jaccard" with distance weight "Squared Inverse" was considered as the best one, and it is presented graphically in Figure 9.

**Figure 9.** Comparison between experimental and predicted values.

#### 3.7.1. Model Performance Test

In order to test the performance of the KNN\_ GWO model, which was obtained by the distance "Jaccard" with distance weight "Squared Inverse", an interpolation was carried out. For this, a previously cached database containing 50 experimental data points was used, and this database was not used in training the model. The results are presented in Table 7 in terms of coefficients and statistical errors.



Table 7 shows very high coefficients, showing the performance and efficiency of our model.

This result was represented graphically (Figure 10) in terms of the experimental values and the predicted values.

**Figure 10.** Comparison between experimental and predicted values to assess performance.

#### 3.7.2. Residues Study

The method of residuals was used in this work in order to study the relationship of the experimental values with the predicted values, on the one hand, and the efficiency and performance of the selected model, on the other hand [2,8]. For this purpose, the experimental values and the predicted values were plotted in parallel as a function of samples (Figure 11A) for all data (including data training, data validation, and data test performance) [8–10].

On the other hand, the error was calculated by the difference between the experimental values and the predicted values for all data (including data training, data validation, and data test performance). This error was plotted graphically (Figure 11B–D) by three methods (residue, frequency, and instances) [19–21,54,55].

Figure 11A shows the high convergence between the experimental values and the predicted values, confirming once again the effectiveness of the obtained model.

Moreover, Figure 11B shows small errors obtained in the three phases. Indeed, in the training phase, the error did not exceed 2 mg.g<sup>−</sup>1; in the validation phase, the error values were in the intervals [−7–3], and the error values of the test phase were in the intervals [−7–0]. It can be therefore concluded that the errors obtained from our model are very small. This was again confirmed at the examination of Figure 11C and 11D, which shows that a very high frequency was obtained with zero error for the former (Figure 11C) and that most errors were 0, regardless of training, validation, and testing data for the latter (Figure 11D).

From these results and interpretations, the efficiency and performance of our model based on the distance "Jaccard" with distance weight "Squared Inverse" is demonstrated.

**Figure 11.** Residuals relating to the models established by the different techniques according to the estimated values: (**A**) Relationship between experimental data and the predicted data of samples, (**B**) residues relating to the models established, (**C**) frequency distribution of errors, and (**D**) instances distribution of errors.

3.7.3. Optimization of the Optimal Analysis and Validation

An optimization method was run using GWO and PSO to find the optimum of the independent parameters to obtain the maximum adsorption quantity of phenol. The optimization results are displayed in Table 8.



Table 8 shows that the optima obtained by the two algorithms, GWO and particle swarm (PSO), were almost equal (Figure 11A,B). By comparing the predicted values

of adsorbed phenol obtained by the optimal conditions of GWO and PSO with the experimental value, it is seen that the results obtained are the same (Figure 11C), with very small error (0.6687 mg.g−1), confirming again the efficiency and performance of the KNN\_GWO model.

#### **4. Conclusions**

In this study, phenol, which is considered a very hazardous substance, was efficiently removed by powdered activated carbon. The effect of operating parameters on the efficiency removal of phenol by powdered activated carbon revels that the maximum removal (99.94%) of phenol was reached at pH 8, adsorbent rate of 0.6 g.L<sup>−</sup>1, and temperature of 20 ◦C when using an initial concentration of phenol of 20 mg.L<sup>−</sup>1.

Batch adsorption experiments allowed the determination of adsorption isotherm parameters. The results of the equilibrium data modeling show that the Langmuir, Freundlich, and Temkin isotherms fit the experimental data very well. The maximum adsorption capacity values found by Langmuir were 146.9, 150.8, and 156.26 mg.g−<sup>1</sup> for temperature values 20, 30, and 40◦C respectively.

The adsorption kinetic was well described by the pseudo-second-order model, while the intra-particle diffusion was not the only mechanism controlling the kinetics adsorption of phenol; kinetic data was controlled by the external diffusion (by macropore and mesopore) and the micropore diffusion. The thermodynamic study revealed that the adsorption of phenol by activated carbon is spontaneous, exothermic, and physical, and proceeds with an increase randomness at the solid–solution interface.

The KNN\_GWO model showed an advantage of giving more precise values related to very high statistical coefficients (close to 1) and very low statistical errors (close to 0). Moreover, the efficiency of the model was confirmed by several techniques, including test interpolation, residual studies, and by validation of the optimal input conditions. Hence, the results obtained showed a very high efficiency and performance.

**Author Contributions:** Conceptualization, M.Z., M.C., Z.K. and L.M.; methodology, Z.K., M.C. and M.Z.; validation, J.-C.B., A.A., H.T. and L.M.; formal analysis, M.Z. and M.K.; investigation, M.Z.; resources, L.M. and M.K.; data curation, Z.K., M.C. and L.M.; writing—review and editing, L.M., A.A. and J.-C.B.; visualization, M.Z., L.M. and J.-C.B.; supervision, L.M., A.A. and J.-C.B.; project administration, L.M. and M.Z. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The authors wish to thank all who assisted in conducting this work.

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

#### **References**


**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
