# Machine Learning-Based Sine-Cosine Algorithm for Wastewater Quality Assessment Using Activated Carbon

Authors: Hadeel Alsolai; Mashael M. Asiri; Rana Alabdan; Mohammed Abdullah Al-Hagery; Anwer Mustafa Hilal; Mohammed Rizwanullah; Abdelwahed Motwakel; Ishfaq Yaseen
Journal: Adsorption Science & Technology
 (2022)

---

## Abstract

Activated carbon is one of the most highly proven adsorbents for organic chemicals from wastewater. It acts as a filter and adsorbs various chemicals from the wastewater. It has large pore size and strong adsorptive capacity. The quality of wastewater is generally determined by chemical oxygen demand (COD), biochemical oxygen demand (BOD5), total suspended solids (TSSs), total phosphorus (TP), and total nitrogen (TN). Wastewater contaminant measurement is significant for saving aquatic life and reusing treated water. Adsorption of contaminants that contribute for wastewater quality indicators uses machine learning algorithm for prediction. Many research works have been done, and the issues are inefficiency and time consuming in the adsorption of contaminants by activated carbon in wastewater management. To overcome these issues, this paper introduces hybrid technique of Voting-Based Extreme Learning Machine with sine cosine algorithm (VELM-SCA). The accuracy of VELM-SCA algorithm in classification of water quality status produced improved accuracy is 0.97.


---

## Body

## 1. Introduction

Removal of dissolved chemical components and pollutants from the wastewater plant by surface phenomenon is called as adsorption. The wastewater treatment is a complicated process that ensures effective purification of wastewater. The adsorption of the organic pollutant to maintain the reduction of pollutant level in the wastewater treatment plant is an essential one. In the wastewater, treatment of plants depends to the indicator values of parameters which describe the quality of wastewater. For maintaining adequate level of indicators of wastewater quality in the aspect of reducing the pollutant in wastewater, many techniques are available for predicting both quality and quantity of influent wastewater. The wastewater quality indicator parameters are total nitrogen (TN), total phosphorus (TP), biochemical oxygen demand (BOD5), total suspended solids (TSS), and chemical oxygen demand (COD).United nation sustainable goal 6 that states “ensure access to water and sanitation for all” motivates us to research on wastewater treatment. Survey points that one person out of every three does not have safe drinking infrastructure. Water is basic necessities for all living creature. It is essential to monitor wastewater and its contaminants present in it.Adsorption utilizes carbon-based material like activated carbon, and biochar was one of the prominent methods in the wastewater treatment [1]. To implement this, so many existing algorithms like random forest (RF), decision tree (DT), Gradient Boosting algorithm (GBA) are available. The issues in the existing algorithms are high efficiency but inaccurate in the reduction of pollutant in the wastewater plants. To overcome this issue, this paper promotes hybrid technique of Voting-Based Extreme Learning Machine with sine cosine algorithm (VELM-SCA). It produces high variation in the prediction of carbon in the wastewater plants and gives high variation in quality and quantity of reduction of the pollutant in the wastewater. The concept of voting ELM is a majority voting system which classified the adsorption of carbon in the wastewater. To improve the accuracy rate, this voting approach is used [2]. For improving the exploitation sine-cosine, the algorithm (SCA) allows to select the prediction of carbon by using search operations in a mathematical function of the sine and cosine [3].Machine learning algorithm plays a powerful tool in elaborating the complicated multivariate and interpretation for optimizing the adsorption of the dissolved component in the wastewater system. The algorithms like response to surface methodology (RSM), and boosted regression tree (BRT) and general regression neural network (GRNN) were applied in the prediction of carbon in the wastewater model [4, 5]. This paper [6] proposed the polluted natural environment for a long period because of the usage of persistent contaminants which can easily enter into the surface and groundwater. The most powerful and reusable adsorbent is the activated carbon for wastewater treatment [7]. The main contributions of this paper are as follows:
(1)
Implementing the hybrid technique of the proposed method by using VELM based on the concepts of prediction of carbon absorption in the wastewater by taking decision making of the majority of the voting system(2)
To improve the accuracy of sine-cosine, a mathematical function-based optimization algorithm is implementedThe paper has been organized as follows: Section2 describes the review of the literature, Section 3 introduces the prediction of wastewater treatment using VELM-SCA, Section 4 discusses the experimented results, and Section 5 concludes the paper with future directions.


## 2. Review of Literature

Adsorption is the removal of the organic and inorganic pollutants on the surface of the adsorbents as well as in wastewater treatment. In recent years, searching for low-cost adsorbents in the pollutant component which are available in the water and wastewater treatment and activated carbon plays a vital role in the adsorption of pollutant material [8]. Adsorbents are categorized into two types, namely, natural and synthetic adsorbents. Natural adsorbents are clays, charcoal, zeolites, clay minerals, and ores. Synthetic adsorbents are formed from household wastage, agricultural product wastage, industrial wastage, polymeric adsorbents, and sewage sludge.Activated carbon acts as an adsorbent for both natural and synthetic adsorbents because of it is an easily available product and cheap, enhancing the properties of adsorption capabilities. Similarly, granular activated carbon (GAC) and powdered activated carbons (PAC) are commonly available adsorbents in the removal of organic and inorganic and removal of industrial wastage water in the land surface area [9]. In the carbon-based adsorbent, predicting the capacity of adsorption is by (Q, mg/g), and it is compared with various influencers of properties of carbon-based properties which are total carbon content (C, wt.%), the molar ratio of oxygen to carbon (O/C), the molar ratio of hydrogen to carbon (H/C),molar ratio of oxygen and nitrogen to carbon [(O+N)/C], ash content (ash, wt.%), point of zero charges (pHpzc), and Brunauer-Emmett-Teller surface area (SBET, m2/g) [1]. This paper [10] proposed the sine-cosine algorithm (SCA) for improving the metaheuristic search. In improving the concept of ELM, this voting ELM can be implemented. This VELM has difference between samples of class forming various vector set values. The multiple independent ELMs are impended for taking majority voting method for making decisions [11]. Table 1 shows the survey on activated carbon in various techniques.Table 1
Survey on techniques used in activated carbon.
AuthorApplicationsAravind et.al (2021) [12]Using morphological operator for activated carbon for dye removalAlshabib et.al (2021) [13]Removal of methylene blue from wastewater using DFT in activated carbonWang et.al (2021) [14]Adsorption of dyes on an activated carbonZhu et.al (2021) [1]Carbon-based materials for tetracycline and sulfamethoxazole adsorptionF. Yang et.al (2020) [15]Biochar derived dissolved organic matter on adsorption of sulfamethoxazoleLi et.al (2020) [16]Magnetic biochar in water treatmentXiang et.al (2019) [17]Carbon-based materials as adsorbents for antibiotic removalHasan, et.al (2019) [18]Activated carbon composite and its testing for methyl orange removalKaetzl et.al (2019) [19]Biochar using wastewater treatment


## 3. Proposed Methodology

Nowadays, domestic wastage and industrial wastage pollute the eco-friendly environment, which has been adsorbed by activated carbon. This wastage contains soluble and insoluble content and chemicals. In this proposed work, we implement the hybrid of Voting-Based Extreme Learning Machine with sine-cosine algorithm (VELM-SCA) to improve the efficiency in the prediction of wastewater treatment plants [20–29]. The architecture of the proposed work (VELM-SCA) is given in Figure 1.Figure 1
Architecture of VELM-SCA.Figure1 describes three phases, namely, data collection, preprocessing, and analysis of VELM-SCA.


### 3.1. Data Collection

In this work, the data were collected from the wastewater treatment plant (WWTP) in Busan, Korea, for three years from January 2008 to December 2010 [19], which are total nitrogen (TN) and total phosphorous (TP) elements, chemical oxygen demand (COD), and biochemical demand (BCD).


### 3.2. Preprocessing

To enhance the quality in the prediction of carbon in the wastewater, plant needed normalization as a preprocessing technique. Data normalization is based on linear normal function by using:(1)nori,j=verij−MinkMaxk−Mink,wherenori,j is the normalized value for each data point; verij is the sample data and Mink,Maxk.


### 3.3. Analysis of VELMSCA

#### 3.3.1. Evolutionary-Based Voting ELM

Extreme learning machine (ELM) is based on the structure of input layer-single hidden layer with feed forward neural network. This voting-based ELM employs the concept of multiple independent ELM training models, and the final output decision is based on majority voting. The main advantage of using this VELM is the improvement in high quality of detecting available of carbon in the wastewater plant. In addition to this, it lowered the variance. The Algorithm1 steps of VELM are given below:Algorithm 1: VELMSA.
Input: sample of training data setS=an,bn, n=1,2⋯,N with label of bn∈1,2,⋯,C;wt is the water quality indicator of wastewater plant t; w is the total number of organic materials in the wastewater at t; p is the crossover probability and its mutation.Output: prediction of carbon in the wastewater plant using max voting decision.Step 1: randomly select the water quality indicator parameterwtStep 2: evaluate fitness value ofwt usingfit=∑k=1Kweightkacck/∑k=1Kweightk.(2)Step 3: choose the next parameter of water quality indicatorwt. Crossover and mutation on wt are used. Repeat the following steps until the criteria of genetic algorithm (GA) is met.(1) Probability of crossoverprobc is determined by 1−probcw members of wt, and its fitness value is selected probabilistically to wt+1.(2) Probability of chromosomes isprobm in wt+1 for the mutation, and store the weights of wt1opt,wt2opt,⋯.,wtkopt which are the outputs, and predict its label of chemical component in the wastewater plant.Step 4: voting-based ELM is the produced output taken as decision making of multiple ELMs by usingφwta,S=argmaxj=1c∑k=1KwtkoptDk,j.(3)Algorithm1 describes that as per Equation 3, S contains samples of S=an,bn and n=1,2,3⋯,N, where bn is class label. Here, assume that a is an input and b is predicted by φwta,S. As per voting based ELM, it predicts output of multiple ELM training models. Ifφwta,Spredicts thekthclassifier, thenDk,j∈0,1andk=1,2,3⋯, andKand its ensembled decision (max voting) is defined byφwta,S=argmaxj=1c∑k=1KwtkoptDk,j.


#### 3.3.2. Sine-Cosine Algorithm (SCA)

For getting the best prediction of carbon adsorption in the wastewater plant, this SCA function is implemented. It is based on the mathematical function of sine and cosine. SCA algorithm employs searching process by using sine or cosine equation as(2)Xif=Xif+rnd1×sinsinrnd2×rnd3Xdf−Xif,(3)Xif=Xif+rnd1×coscosrnd2×rnd3Xdf−Xif.Combining Equations (2) and (3) as
(4)Xif=Xif+rnd1×sinsinrnd2×rnd3Xdf−Xififrnd4<0.5Xif+rnd1×coscosrnd2×rnd3Xdf−Xififrnd4≥0.5,whereXdis the destination solution,Xifis current solution || that indicates random variables ofrnd1,rnd2,rnd3,and,rnd4which contains absolute values. The parameter rnd1 is a random variable to determine the path of next solution, and it may be towards or outside between Xif and Xdf. That is switch between exploration and exploitation. The update of rnd1 is given by
(5)rnd1=c−itcT,wherec is a constant value; T is maximum number of iterations; and it is the current iteration. The random variable rnd2 is used to identify the next movement towards destination solution or best solution Xdf. Also, random variable rnd3 adds the random weight to Xdf, and it is stochastically emphasized rnd3>1 or deemphasize rnd3<1. The random variable rnd4 is used to switch between the function sine and cosine using Equation (4).The algorithm 2 describes the SCA algorithm.Algorithm 2: SCA.
Step 1: initialize the random population solutions,X1,X2,⋯,Xn.Step 2: by using Equation (4), the value of rnd1 is used to switch from explore to exploit. It gradually decreases from 2 to 0.Step 3: whilef<fmaxit do.Step 4: compute the fitness valuefitfor each solution.Step 5: expressXdf that has the best fitness value fitd.Step 6: updaternd1,rnd2,rnd3,andrnd4values.Step 7: use Equation (4) to update XifStep 8: end whileStep 9: outputXdf.Algorithm2 describes that the concept of SCA is randomly choose the solution from the set of solution with various dimensions. For every solution it computes fitness values. The output of best solution of SCA is best fitness.


#### 3.3.3. Proposed Hybrid of Voting ELM with Sine-Cosine Algorithm (VELM-SCA)

VELM-SCA enhances the accuracy and efficiency in terms of classification of the wastewater quality and reduces the computation time for both training and testing dataset. Procedure for VELM-SCA is given below.Algorithm 3: VELM-SCA.
Input: sample of training datasetS=an,bn, n=1,2⋯,N with label of bn∈1,2,⋯,C;wt is the water quality indicator of wastewater plant t; w is the total number of organic materials in the wastewater at t; p is the crossover probability and its mutation.Output: prediction of carbon in the wastewater plant.Step 1: randomly select the water quality indicator parameterwtStep 2: evaluate fitness value ofwt using Equation (2).Step 3: choose the next parameter of water quality indicatorwt. Crossover and mutation on wt are calculated.Step 4: using Algorithm2, determine the best fitness fitd.Step 5: update the best solution out of all water quality indicator parameter value.Step 6: update the position of adsorption of carbon in the wastewater plant by usingIfrnd3>1, then rnd3+Xdf. It merges all related carbon particle.Step 7: Elsernd3<1 discard that particle.Step 8: End.Algorithm3 describes that the training of the dataset S=an,bn, with input parameter values. Calculate the fitness for each parameter and choose the best fitness that denotes the carbon content in the wastewater plant. Update the value and choose the next set of data. Update the position of carbon particle using new random variable rnd3>1, and it merges all related carbon particle.


## 3.1. Data Collection

In this work, the data were collected from the wastewater treatment plant (WWTP) in Busan, Korea, for three years from January 2008 to December 2010 [19], which are total nitrogen (TN) and total phosphorous (TP) elements, chemical oxygen demand (COD), and biochemical demand (BCD).


## 3.2. Preprocessing

To enhance the quality in the prediction of carbon in the wastewater, plant needed normalization as a preprocessing technique. Data normalization is based on linear normal function by using:(1)nori,j=verij−MinkMaxk−Mink,wherenori,j is the normalized value for each data point; verij is the sample data and Mink,Maxk.


## 3.3. Analysis of VELMSCA

### 3.3.1. Evolutionary-Based Voting ELM

Extreme learning machine (ELM) is based on the structure of input layer-single hidden layer with feed forward neural network. This voting-based ELM employs the concept of multiple independent ELM training models, and the final output decision is based on majority voting. The main advantage of using this VELM is the improvement in high quality of detecting available of carbon in the wastewater plant. In addition to this, it lowered the variance. The Algorithm1 steps of VELM are given below:Algorithm 1: VELMSA.
Input: sample of training data setS=an,bn, n=1,2⋯,N with label of bn∈1,2,⋯,C;wt is the water quality indicator of wastewater plant t; w is the total number of organic materials in the wastewater at t; p is the crossover probability and its mutation.Output: prediction of carbon in the wastewater plant using max voting decision.Step 1: randomly select the water quality indicator parameterwtStep 2: evaluate fitness value ofwt usingfit=∑k=1Kweightkacck/∑k=1Kweightk.(2)Step 3: choose the next parameter of water quality indicatorwt. Crossover and mutation on wt are used. Repeat the following steps until the criteria of genetic algorithm (GA) is met.(1) Probability of crossoverprobc is determined by 1−probcw members of wt, and its fitness value is selected probabilistically to wt+1.(2) Probability of chromosomes isprobm in wt+1 for the mutation, and store the weights of wt1opt,wt2opt,⋯.,wtkopt which are the outputs, and predict its label of chemical component in the wastewater plant.Step 4: voting-based ELM is the produced output taken as decision making of multiple ELMs by usingφwta,S=argmaxj=1c∑k=1KwtkoptDk,j.(3)Algorithm1 describes that as per Equation 3, S contains samples of S=an,bn and n=1,2,3⋯,N, where bn is class label. Here, assume that a is an input and b is predicted by φwta,S. As per voting based ELM, it predicts output of multiple ELM training models. Ifφwta,Spredicts thekthclassifier, thenDk,j∈0,1andk=1,2,3⋯, andKand its ensembled decision (max voting) is defined byφwta,S=argmaxj=1c∑k=1KwtkoptDk,j.


### 3.3.2. Sine-Cosine Algorithm (SCA)

For getting the best prediction of carbon adsorption in the wastewater plant, this SCA function is implemented. It is based on the mathematical function of sine and cosine. SCA algorithm employs searching process by using sine or cosine equation as(2)Xif=Xif+rnd1×sinsinrnd2×rnd3Xdf−Xif,(3)Xif=Xif+rnd1×coscosrnd2×rnd3Xdf−Xif.Combining Equations (2) and (3) as
(4)Xif=Xif+rnd1×sinsinrnd2×rnd3Xdf−Xififrnd4<0.5Xif+rnd1×coscosrnd2×rnd3Xdf−Xififrnd4≥0.5,whereXdis the destination solution,Xifis current solution || that indicates random variables ofrnd1,rnd2,rnd3,and,rnd4which contains absolute values. The parameter rnd1 is a random variable to determine the path of next solution, and it may be towards or outside between Xif and Xdf. That is switch between exploration and exploitation. The update of rnd1 is given by
(5)rnd1=c−itcT,wherec is a constant value; T is maximum number of iterations; and it is the current iteration. The random variable rnd2 is used to identify the next movement towards destination solution or best solution Xdf. Also, random variable rnd3 adds the random weight to Xdf, and it is stochastically emphasized rnd3>1 or deemphasize rnd3<1. The random variable rnd4 is used to switch between the function sine and cosine using Equation (4).The algorithm 2 describes the SCA algorithm.Algorithm 2: SCA.
Step 1: initialize the random population solutions,X1,X2,⋯,Xn.Step 2: by using Equation (4), the value of rnd1 is used to switch from explore to exploit. It gradually decreases from 2 to 0.Step 3: whilef<fmaxit do.Step 4: compute the fitness valuefitfor each solution.Step 5: expressXdf that has the best fitness value fitd.Step 6: updaternd1,rnd2,rnd3,andrnd4values.Step 7: use Equation (4) to update XifStep 8: end whileStep 9: outputXdf.Algorithm2 describes that the concept of SCA is randomly choose the solution from the set of solution with various dimensions. For every solution it computes fitness values. The output of best solution of SCA is best fitness.


### 3.3.3. Proposed Hybrid of Voting ELM with Sine-Cosine Algorithm (VELM-SCA)

VELM-SCA enhances the accuracy and efficiency in terms of classification of the wastewater quality and reduces the computation time for both training and testing dataset. Procedure for VELM-SCA is given below.Algorithm 3: VELM-SCA.
Input: sample of training datasetS=an,bn, n=1,2⋯,N with label of bn∈1,2,⋯,C;wt is the water quality indicator of wastewater plant t; w is the total number of organic materials in the wastewater at t; p is the crossover probability and its mutation.Output: prediction of carbon in the wastewater plant.Step 1: randomly select the water quality indicator parameterwtStep 2: evaluate fitness value ofwt using Equation (2).Step 3: choose the next parameter of water quality indicatorwt. Crossover and mutation on wt are calculated.Step 4: using Algorithm2, determine the best fitness fitd.Step 5: update the best solution out of all water quality indicator parameter value.Step 6: update the position of adsorption of carbon in the wastewater plant by usingIfrnd3>1, then rnd3+Xdf. It merges all related carbon particle.Step 7: Elsernd3<1 discard that particle.Step 8: End.Algorithm3 describes that the training of the dataset S=an,bn, with input parameter values. Calculate the fitness for each parameter and choose the best fitness that denotes the carbon content in the wastewater plant. Update the value and choose the next set of data. Update the position of carbon particle using new random variable rnd3>1, and it merges all related carbon particle.


## 3.3.1. Evolutionary-Based Voting ELM

Extreme learning machine (ELM) is based on the structure of input layer-single hidden layer with feed forward neural network. This voting-based ELM employs the concept of multiple independent ELM training models, and the final output decision is based on majority voting. The main advantage of using this VELM is the improvement in high quality of detecting available of carbon in the wastewater plant. In addition to this, it lowered the variance. The Algorithm1 steps of VELM are given below:Algorithm 1: VELMSA.
Input: sample of training data setS=an,bn, n=1,2⋯,N with label of bn∈1,2,⋯,C;wt is the water quality indicator of wastewater plant t; w is the total number of organic materials in the wastewater at t; p is the crossover probability and its mutation.Output: prediction of carbon in the wastewater plant using max voting decision.Step 1: randomly select the water quality indicator parameterwtStep 2: evaluate fitness value ofwt usingfit=∑k=1Kweightkacck/∑k=1Kweightk.(2)Step 3: choose the next parameter of water quality indicatorwt. Crossover and mutation on wt are used. Repeat the following steps until the criteria of genetic algorithm (GA) is met.(1) Probability of crossoverprobc is determined by 1−probcw members of wt, and its fitness value is selected probabilistically to wt+1.(2) Probability of chromosomes isprobm in wt+1 for the mutation, and store the weights of wt1opt,wt2opt,⋯.,wtkopt which are the outputs, and predict its label of chemical component in the wastewater plant.Step 4: voting-based ELM is the produced output taken as decision making of multiple ELMs by usingφwta,S=argmaxj=1c∑k=1KwtkoptDk,j.(3)Algorithm1 describes that as per Equation 3, S contains samples of S=an,bn and n=1,2,3⋯,N, where bn is class label. Here, assume that a is an input and b is predicted by φwta,S. As per voting based ELM, it predicts output of multiple ELM training models. Ifφwta,Spredicts thekthclassifier, thenDk,j∈0,1andk=1,2,3⋯, andKand its ensembled decision (max voting) is defined byφwta,S=argmaxj=1c∑k=1KwtkoptDk,j.


## 3.3.2. Sine-Cosine Algorithm (SCA)

For getting the best prediction of carbon adsorption in the wastewater plant, this SCA function is implemented. It is based on the mathematical function of sine and cosine. SCA algorithm employs searching process by using sine or cosine equation as(2)Xif=Xif+rnd1×sinsinrnd2×rnd3Xdf−Xif,(3)Xif=Xif+rnd1×coscosrnd2×rnd3Xdf−Xif.Combining Equations (2) and (3) as
(4)Xif=Xif+rnd1×sinsinrnd2×rnd3Xdf−Xififrnd4<0.5Xif+rnd1×coscosrnd2×rnd3Xdf−Xififrnd4≥0.5,whereXdis the destination solution,Xifis current solution || that indicates random variables ofrnd1,rnd2,rnd3,and,rnd4which contains absolute values. The parameter rnd1 is a random variable to determine the path of next solution, and it may be towards or outside between Xif and Xdf. That is switch between exploration and exploitation. The update of rnd1 is given by
(5)rnd1=c−itcT,wherec is a constant value; T is maximum number of iterations; and it is the current iteration. The random variable rnd2 is used to identify the next movement towards destination solution or best solution Xdf. Also, random variable rnd3 adds the random weight to Xdf, and it is stochastically emphasized rnd3>1 or deemphasize rnd3<1. The random variable rnd4 is used to switch between the function sine and cosine using Equation (4).The algorithm 2 describes the SCA algorithm.Algorithm 2: SCA.
Step 1: initialize the random population solutions,X1,X2,⋯,Xn.Step 2: by using Equation (4), the value of rnd1 is used to switch from explore to exploit. It gradually decreases from 2 to 0.Step 3: whilef<fmaxit do.Step 4: compute the fitness valuefitfor each solution.Step 5: expressXdf that has the best fitness value fitd.Step 6: updaternd1,rnd2,rnd3,andrnd4values.Step 7: use Equation (4) to update XifStep 8: end whileStep 9: outputXdf.Algorithm2 describes that the concept of SCA is randomly choose the solution from the set of solution with various dimensions. For every solution it computes fitness values. The output of best solution of SCA is best fitness.


## 3.3.3. Proposed Hybrid of Voting ELM with Sine-Cosine Algorithm (VELM-SCA)

VELM-SCA enhances the accuracy and efficiency in terms of classification of the wastewater quality and reduces the computation time for both training and testing dataset. Procedure for VELM-SCA is given below.Algorithm 3: VELM-SCA.
Input: sample of training datasetS=an,bn, n=1,2⋯,N with label of bn∈1,2,⋯,C;wt is the water quality indicator of wastewater plant t; w is the total number of organic materials in the wastewater at t; p is the crossover probability and its mutation.Output: prediction of carbon in the wastewater plant.Step 1: randomly select the water quality indicator parameterwtStep 2: evaluate fitness value ofwt using Equation (2).Step 3: choose the next parameter of water quality indicatorwt. Crossover and mutation on wt are calculated.Step 4: using Algorithm2, determine the best fitness fitd.Step 5: update the best solution out of all water quality indicator parameter value.Step 6: update the position of adsorption of carbon in the wastewater plant by usingIfrnd3>1, then rnd3+Xdf. It merges all related carbon particle.Step 7: Elsernd3<1 discard that particle.Step 8: End.Algorithm3 describes that the training of the dataset S=an,bn, with input parameter values. Calculate the fitness for each parameter and choose the best fitness that denotes the carbon content in the wastewater plant. Update the value and choose the next set of data. Update the position of carbon particle using new random variable rnd3>1, and it merges all related carbon particle.


## 4. Result and Discussion

### 4.1. Performance Metric Measures

The metric measures for implementing VELM-SCA of Spearman’s rank correlation coefficient (SPCC), the coefficient of determination (R2), root mean square error (RMSE), and mean absolute error (MAE) are discuss in the following sections.


#### 4.1.1. Spearman’s Rank Correlation Coefficient (SPCC)

It is the relationship the between actual and predicted variables that is in relationship between positive or negative. The formula is(6)SRCC=1−6∑d2n3−n,whered is the difference in ranks between two variables, and n is the number of samples. The range of values is between -1 and +1.


#### 4.1.2. Coefficient of Determination (R2)

It explains the fraction of variations in its output, and it is defined by(7)R2=ExplainedvariationsTotalnumberofvariations.The maximum and minimum values ofR2 are 1 and 0. The higher the value it indicates, the best the model.


#### 4.1.3. Mean Absolute Error (MAE)

The MAE is defined as an average of absolute differences between the model outputs and theactual outputs. The MAE can be calculated using the following formula:(8)MAE=y^−y,wherey^ is the predicted value, and y is the actual value.


#### 4.1.4. Root Mean Square Error (RMSE)

It is an error prediction measure. It calculates the overall error of this system, and it can be calculated as(9)RMSE=∑n=1Ny∧−y2N.In this work, VELM-SCA, the metric measures its performance based on accuracy, specificity, and sensitivity, and precision and F-score evaluation matrices were employed.(10)accuracy=TP+TNTP+TN+FP+FN,precision=TPTP+FP,recall=TPTP+FN,F1−Score=2∗precision∗recallprecision+recall.Table2 shows that performance metric measures of VELM-SCA.Table 2
VELM-SCA metric measures.
AlgorithmSRCCR2MAERMSEVELM0.890.822.434.56SCA0.910.931.673.87VELM-SCA0.960.971.222.45From Table2, it seems that the performance of evaluation is based on SRCC, RMSE, MAE, andR2implemented in VELM, SCA, and our proposed work (VELM-SCA) algorithms. For the SRCC shows strongly correlation of 0.96. In RMSE, VELM got 4.56, SCA got 3.87, and VELM-SCA got 2.45. For the R2 value, proposed work VELM-SCA got 0.97. For the mean absolute error, VELM got 2.43, SCA got 1.67, and VELM-SCA got 1.22.From the above Table3, the accuracy of VELM-SCA (proposed work) is higher as compared to other classifier algorithms of VELM and SCA. In Table 3, the next higher accuracy is SCA which is also closer to VELM-SCA. Figure 2 shows the computation time for CO2 adsorption in various algorithms like VELM, SCA, and VELM-SCA.Table 3
Metric measures’ report.
ParameterVELMSCAVELM-SCATP156180140TN12314870FP856030FN754525Accuracy0.690.880.97Precision0.780.890.95Recall0.740.930.96Figure 2
Computation time.Figure2 shows that the proposed work needs less computation time for the adsorption of carbon. Table 4 shows that parameter selection. In the wastewater plants, these parameters are used to predict the parametric values in the dataset.Table 4
Selection of parametric values.
Influent parametersEffluent parametersInfluent of CODEffluent of CODInfluent of pHEffluent of ECInfluent of NEffluent of pHInfluent of SO4Effluent of NInfluent of PO4Effluent of SO4Influent of ECEffluent of PO4Table4 shows that in the influent parameter values of wastewater quantity and quality, the ranges of variation were established [20].The parametric values in Table 5 indicate substantial variation in TN, TP,BOD, COD, TSS, and Q values. These indicators of wastewater quality constitute input data for the models of VELM-SCA describing the changes in carbon, nitrogen, phosphorus, and biochemical changes in the compounds of bioreactors.Table 5
Range of values of parameters describing influent wastewater.
ParametersMinimumMaximumAverageTN (mg/dm3)19.89970.4TP (mg/dm3)3.838.613.55BOD (mg/dm3)40.5792378COD (mg/dm3)1692520930.1TSS (mg/dm3)821145440Q (mg/dm3)269836688338758By using the Table5 parametric values, our proposed work VELM-SCA predicted activated carbon-based TN, TP, BOD, COD, and TSS values using mean absolute error (MAE), mean relative error (MAPE), and coefficient of determination(R2). The analysis of these parameters are shown in Table 6.Table 6
Parametric values of MAE, MAPE, andR2 using hybrid of VELM-SCA.
Influent indicatorsVELMSCAVELM-SCAMAEMAPER2MAEMAPER2MAEMAPER2TN5.049.670.468.1711.540.344.238.450.46TP1.3112.770.482.6117.770.461.4512.760.46BOD44.2213.690.5249.1215.910.7640.3212.410.52COD121.3415.090.45149.3415.120.69106.2410.090.42TSS56.0515.030.5977.0525.030.4744.0511.030.42The analysis of Table4 shows that TN prediction activated carbon based on VELM inMAE=5.04mg/dm3and SCA inMAE=8.17mg/dm3, and fusion of VELM-SCA givesMAE=4.23mg/dm3, similar for MAPE and VELM inMAPE=99.67mg/dm3, and SCA inMAPE=11.54mg/dm3and hybrid of VELM-SCA givesMAPE=8.45mg/dm3. In addition, TP prediction activated carbon based on VELM inMAE=1.31mg/dm3and SCA inMAE=2.61mg/dm3, and hybrid of VELM-SCA givesMAE=1.45mg/dm3, similar for MAPE and VELM inMAPE=12.77mg/dm3and SCA inMAPE=17.77mg/dm3, and hybrid of VELM-SCA givesMAPE=12.76mg/dm3. Prediction of wastewater quality requires parametric indicators of TN, and TP shown that our proposed work VELM-SCA gives better performance. Similarly, for other indicators of BOD and COD, TSS also shows that the lowest prediction errors were observed for the VELM-SCA approach. Figure 3 shows the probability of prediction based on carbon in the wastewater plant for our proposed work.Figure 3
Probability prediction of carbon.From Figure3, it seems that our proposed work VELM-SCA gives the better probability prediction of wastewater treatment for plants. Table 6 shows the effectiveness of various machine learning algorithm in terms of various influent indicators by using
(11)Effectiveness=N−LN×100,whereN is the total number of testing data, and L is the total number of losing test data.From Table7, it seems that the effectiveness of our proposed work produces better result compared with other existing algorithms. Figure 4 shows the VELM-SCA model for predicting the influent water based on activated carbon with various indicators.Table 7
Effectiveness.
EffectivenessAlgorithmsTNTPBODCODTSSVELM7545774568SCA5443454882VELM -SCA9178929390Figure 4
Statistical analysis of prediction of various indicators.In Figure4, it seems that our proposed work gives effective prediction of WWTP that measured various indicators for the treatment of plants, which is the convergence curves of VELM-SCA for all datasets. Our proposed work has a fast convergence compared with other two algorithms.


## 4.1. Performance Metric Measures

The metric measures for implementing VELM-SCA of Spearman’s rank correlation coefficient (SPCC), the coefficient of determination (R2), root mean square error (RMSE), and mean absolute error (MAE) are discuss in the following sections.


### 4.1.1. Spearman’s Rank Correlation Coefficient (SPCC)

It is the relationship the between actual and predicted variables that is in relationship between positive or negative. The formula is(6)SRCC=1−6∑d2n3−n,whered is the difference in ranks between two variables, and n is the number of samples. The range of values is between -1 and +1.


### 4.1.2. Coefficient of Determination (R2)

It explains the fraction of variations in its output, and it is defined by(7)R2=ExplainedvariationsTotalnumberofvariations.The maximum and minimum values ofR2 are 1 and 0. The higher the value it indicates, the best the model.


### 4.1.3. Mean Absolute Error (MAE)

The MAE is defined as an average of absolute differences between the model outputs and theactual outputs. The MAE can be calculated using the following formula:(8)MAE=y^−y,wherey^ is the predicted value, and y is the actual value.


### 4.1.4. Root Mean Square Error (RMSE)

It is an error prediction measure. It calculates the overall error of this system, and it can be calculated as(9)RMSE=∑n=1Ny∧−y2N.In this work, VELM-SCA, the metric measures its performance based on accuracy, specificity, and sensitivity, and precision and F-score evaluation matrices were employed.(10)accuracy=TP+TNTP+TN+FP+FN,precision=TPTP+FP,recall=TPTP+FN,F1−Score=2∗precision∗recallprecision+recall.Table2 shows that performance metric measures of VELM-SCA.Table 2
VELM-SCA metric measures.
AlgorithmSRCCR2MAERMSEVELM0.890.822.434.56SCA0.910.931.673.87VELM-SCA0.960.971.222.45From Table2, it seems that the performance of evaluation is based on SRCC, RMSE, MAE, andR2implemented in VELM, SCA, and our proposed work (VELM-SCA) algorithms. For the SRCC shows strongly correlation of 0.96. In RMSE, VELM got 4.56, SCA got 3.87, and VELM-SCA got 2.45. For the R2 value, proposed work VELM-SCA got 0.97. For the mean absolute error, VELM got 2.43, SCA got 1.67, and VELM-SCA got 1.22.From the above Table3, the accuracy of VELM-SCA (proposed work) is higher as compared to other classifier algorithms of VELM and SCA. In Table 3, the next higher accuracy is SCA which is also closer to VELM-SCA. Figure 2 shows the computation time for CO2 adsorption in various algorithms like VELM, SCA, and VELM-SCA.Table 3
Metric measures’ report.
ParameterVELMSCAVELM-SCATP156180140TN12314870FP856030FN754525Accuracy0.690.880.97Precision0.780.890.95Recall0.740.930.96Figure 2
Computation time.Figure2 shows that the proposed work needs less computation time for the adsorption of carbon. Table 4 shows that parameter selection. In the wastewater plants, these parameters are used to predict the parametric values in the dataset.Table 4
Selection of parametric values.
Influent parametersEffluent parametersInfluent of CODEffluent of CODInfluent of pHEffluent of ECInfluent of NEffluent of pHInfluent of SO4Effluent of NInfluent of PO4Effluent of SO4Influent of ECEffluent of PO4Table4 shows that in the influent parameter values of wastewater quantity and quality, the ranges of variation were established [20].The parametric values in Table 5 indicate substantial variation in TN, TP,BOD, COD, TSS, and Q values. These indicators of wastewater quality constitute input data for the models of VELM-SCA describing the changes in carbon, nitrogen, phosphorus, and biochemical changes in the compounds of bioreactors.Table 5
Range of values of parameters describing influent wastewater.
ParametersMinimumMaximumAverageTN (mg/dm3)19.89970.4TP (mg/dm3)3.838.613.55BOD (mg/dm3)40.5792378COD (mg/dm3)1692520930.1TSS (mg/dm3)821145440Q (mg/dm3)269836688338758By using the Table5 parametric values, our proposed work VELM-SCA predicted activated carbon-based TN, TP, BOD, COD, and TSS values using mean absolute error (MAE), mean relative error (MAPE), and coefficient of determination(R2). The analysis of these parameters are shown in Table 6.Table 6
Parametric values of MAE, MAPE, andR2 using hybrid of VELM-SCA.
Influent indicatorsVELMSCAVELM-SCAMAEMAPER2MAEMAPER2MAEMAPER2TN5.049.670.468.1711.540.344.238.450.46TP1.3112.770.482.6117.770.461.4512.760.46BOD44.2213.690.5249.1215.910.7640.3212.410.52COD121.3415.090.45149.3415.120.69106.2410.090.42TSS56.0515.030.5977.0525.030.4744.0511.030.42The analysis of Table4 shows that TN prediction activated carbon based on VELM inMAE=5.04mg/dm3and SCA inMAE=8.17mg/dm3, and fusion of VELM-SCA givesMAE=4.23mg/dm3, similar for MAPE and VELM inMAPE=99.67mg/dm3, and SCA inMAPE=11.54mg/dm3and hybrid of VELM-SCA givesMAPE=8.45mg/dm3. In addition, TP prediction activated carbon based on VELM inMAE=1.31mg/dm3and SCA inMAE=2.61mg/dm3, and hybrid of VELM-SCA givesMAE=1.45mg/dm3, similar for MAPE and VELM inMAPE=12.77mg/dm3and SCA inMAPE=17.77mg/dm3, and hybrid of VELM-SCA givesMAPE=12.76mg/dm3. Prediction of wastewater quality requires parametric indicators of TN, and TP shown that our proposed work VELM-SCA gives better performance. Similarly, for other indicators of BOD and COD, TSS also shows that the lowest prediction errors were observed for the VELM-SCA approach. Figure 3 shows the probability of prediction based on carbon in the wastewater plant for our proposed work.Figure 3
Probability prediction of carbon.From Figure3, it seems that our proposed work VELM-SCA gives the better probability prediction of wastewater treatment for plants. Table 6 shows the effectiveness of various machine learning algorithm in terms of various influent indicators by using
(11)Effectiveness=N−LN×100,whereN is the total number of testing data, and L is the total number of losing test data.From Table7, it seems that the effectiveness of our proposed work produces better result compared with other existing algorithms. Figure 4 shows the VELM-SCA model for predicting the influent water based on activated carbon with various indicators.Table 7
Effectiveness.
EffectivenessAlgorithmsTNTPBODCODTSSVELM7545774568SCA5443454882VELM -SCA9178929390Figure 4
Statistical analysis of prediction of various indicators.In Figure4, it seems that our proposed work gives effective prediction of WWTP that measured various indicators for the treatment of plants, which is the convergence curves of VELM-SCA for all datasets. Our proposed work has a fast convergence compared with other two algorithms.


## 4.1.1. Spearman’s Rank Correlation Coefficient (SPCC)

It is the relationship the between actual and predicted variables that is in relationship between positive or negative. The formula is(6)SRCC=1−6∑d2n3−n,whered is the difference in ranks between two variables, and n is the number of samples. The range of values is between -1 and +1.


## 4.1.2. Coefficient of Determination (R2)

It explains the fraction of variations in its output, and it is defined by(7)R2=ExplainedvariationsTotalnumberofvariations.The maximum and minimum values ofR2 are 1 and 0. The higher the value it indicates, the best the model.


## 4.1.3. Mean Absolute Error (MAE)

The MAE is defined as an average of absolute differences between the model outputs and theactual outputs. The MAE can be calculated using the following formula:(8)MAE=y^−y,wherey^ is the predicted value, and y is the actual value.


## 4.1.4. Root Mean Square Error (RMSE)

It is an error prediction measure. It calculates the overall error of this system, and it can be calculated as(9)RMSE=∑n=1Ny∧−y2N.In this work, VELM-SCA, the metric measures its performance based on accuracy, specificity, and sensitivity, and precision and F-score evaluation matrices were employed.(10)accuracy=TP+TNTP+TN+FP+FN,precision=TPTP+FP,recall=TPTP+FN,F1−Score=2∗precision∗recallprecision+recall.Table2 shows that performance metric measures of VELM-SCA.Table 2
VELM-SCA metric measures.
AlgorithmSRCCR2MAERMSEVELM0.890.822.434.56SCA0.910.931.673.87VELM-SCA0.960.971.222.45From Table2, it seems that the performance of evaluation is based on SRCC, RMSE, MAE, andR2implemented in VELM, SCA, and our proposed work (VELM-SCA) algorithms. For the SRCC shows strongly correlation of 0.96. In RMSE, VELM got 4.56, SCA got 3.87, and VELM-SCA got 2.45. For the R2 value, proposed work VELM-SCA got 0.97. For the mean absolute error, VELM got 2.43, SCA got 1.67, and VELM-SCA got 1.22.From the above Table3, the accuracy of VELM-SCA (proposed work) is higher as compared to other classifier algorithms of VELM and SCA. In Table 3, the next higher accuracy is SCA which is also closer to VELM-SCA. Figure 2 shows the computation time for CO2 adsorption in various algorithms like VELM, SCA, and VELM-SCA.Table 3
Metric measures’ report.
ParameterVELMSCAVELM-SCATP156180140TN12314870FP856030FN754525Accuracy0.690.880.97Precision0.780.890.95Recall0.740.930.96Figure 2
Computation time.Figure2 shows that the proposed work needs less computation time for the adsorption of carbon. Table 4 shows that parameter selection. In the wastewater plants, these parameters are used to predict the parametric values in the dataset.Table 4
Selection of parametric values.
Influent parametersEffluent parametersInfluent of CODEffluent of CODInfluent of pHEffluent of ECInfluent of NEffluent of pHInfluent of SO4Effluent of NInfluent of PO4Effluent of SO4Influent of ECEffluent of PO4Table4 shows that in the influent parameter values of wastewater quantity and quality, the ranges of variation were established [20].The parametric values in Table 5 indicate substantial variation in TN, TP,BOD, COD, TSS, and Q values. These indicators of wastewater quality constitute input data for the models of VELM-SCA describing the changes in carbon, nitrogen, phosphorus, and biochemical changes in the compounds of bioreactors.Table 5
Range of values of parameters describing influent wastewater.
ParametersMinimumMaximumAverageTN (mg/dm3)19.89970.4TP (mg/dm3)3.838.613.55BOD (mg/dm3)40.5792378COD (mg/dm3)1692520930.1TSS (mg/dm3)821145440Q (mg/dm3)269836688338758By using the Table5 parametric values, our proposed work VELM-SCA predicted activated carbon-based TN, TP, BOD, COD, and TSS values using mean absolute error (MAE), mean relative error (MAPE), and coefficient of determination(R2). The analysis of these parameters are shown in Table 6.Table 6
Parametric values of MAE, MAPE, andR2 using hybrid of VELM-SCA.
Influent indicatorsVELMSCAVELM-SCAMAEMAPER2MAEMAPER2MAEMAPER2TN5.049.670.468.1711.540.344.238.450.46TP1.3112.770.482.6117.770.461.4512.760.46BOD44.2213.690.5249.1215.910.7640.3212.410.52COD121.3415.090.45149.3415.120.69106.2410.090.42TSS56.0515.030.5977.0525.030.4744.0511.030.42The analysis of Table4 shows that TN prediction activated carbon based on VELM inMAE=5.04mg/dm3and SCA inMAE=8.17mg/dm3, and fusion of VELM-SCA givesMAE=4.23mg/dm3, similar for MAPE and VELM inMAPE=99.67mg/dm3, and SCA inMAPE=11.54mg/dm3and hybrid of VELM-SCA givesMAPE=8.45mg/dm3. In addition, TP prediction activated carbon based on VELM inMAE=1.31mg/dm3and SCA inMAE=2.61mg/dm3, and hybrid of VELM-SCA givesMAE=1.45mg/dm3, similar for MAPE and VELM inMAPE=12.77mg/dm3and SCA inMAPE=17.77mg/dm3, and hybrid of VELM-SCA givesMAPE=12.76mg/dm3. Prediction of wastewater quality requires parametric indicators of TN, and TP shown that our proposed work VELM-SCA gives better performance. Similarly, for other indicators of BOD and COD, TSS also shows that the lowest prediction errors were observed for the VELM-SCA approach. Figure 3 shows the probability of prediction based on carbon in the wastewater plant for our proposed work.Figure 3
Probability prediction of carbon.From Figure3, it seems that our proposed work VELM-SCA gives the better probability prediction of wastewater treatment for plants. Table 6 shows the effectiveness of various machine learning algorithm in terms of various influent indicators by using
(11)Effectiveness=N−LN×100,whereN is the total number of testing data, and L is the total number of losing test data.From Table7, it seems that the effectiveness of our proposed work produces better result compared with other existing algorithms. Figure 4 shows the VELM-SCA model for predicting the influent water based on activated carbon with various indicators.Table 7
Effectiveness.
EffectivenessAlgorithmsTNTPBODCODTSSVELM7545774568SCA5443454882VELM -SCA9178929390Figure 4
Statistical analysis of prediction of various indicators.In Figure4, it seems that our proposed work gives effective prediction of WWTP that measured various indicators for the treatment of plants, which is the convergence curves of VELM-SCA for all datasets. Our proposed work has a fast convergence compared with other two algorithms.


## 5. Conclusion

The prediction of wastewater treatment plants used the adsorption of unwanted influent indicators using activated carbon. In this work, VELM-SCA uses the predicting influent indicators in the wastewater and identify the maximum and minimum point values with boundary set values. It also implemented various parameters like total phosphorous (TP), total nitrogen (TN), BOD, COD, and TSS. VELM-SCA accurately predicts the unwanted influent indictors and filtered it using activated carbon with minimum error prediction and also proves the efficient and robust performance. The accuracy of VELM-SCA algorithm in classification of water quality status that produced highest accuracy is 0.97. Our proposed work VELM-SCA outperforms the best result compared with existing classifier. In future to work this will be extended by using various ML algorithms and also upgrade our work in various influent and Effluent indicators for predicting the wastewater treatment for plants.



---

*Source: 3410872-2022-05-09.xml*