# Fitness-Based Grey Wolf Optimizer Clustering Method for Spam Review Detection

Authors: Sakshi Shringi; H. Sharma; D. L. Suthar
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Customers nowadays rely heavily on online reviews when making buying decisions. Various internet websites, including Amazon, Yelp, Google Plus, BookMyShow, Facebook, Twitter, and others, allow users to generate massive amounts of data. The information is gathered through feedback/reviews, comments, and tweets. Companies can leverage this information to improve the quality of their products. Spam reviews are created pretentiously by some businesses and people to promote or degrade the popularity of any product, organization, or person due to their reliance on these online reviews. Thus, identifying spam or nonspam review by the naked eye is nearly impossible. Classifying the reviews manually is also highly speculative. Hence, to overcome this issue, a fitness-based Grey Wolf Optimizer (FGWOK) clustering method is proposed in this paper to identify spam reviews. The fitness-based grey wolf optimization (GWO) is used to obtain the optimal cluster heads in the proposed method. In the fitness-based GWO, the position of the grey wolves is updated in two phases. In the first phase, all the search agents update their position using the contemporary GWO, and in the second phase, the fitness is evaluated to update the position. To prove that the proposed strategy is effective, three spam data sets, namely synthetic spam reviews, movie reviews, and Yelp hotel and restaurant reviews, have been used in our work. The reported results are compared with the existing state-of-art metaheuristic clustering methods like a genetic algorithm (GA), differential evolution (DE), particle swarm optimization (PSO), cuckoo search (CS),k-Means, and artificial bee colony clustering (ABCK) method. The experimental and statistical analysis results show that the proposed FGWOK algorithm outperforms current methodologies.


---

## Body

## 1. Introduction

The growth of e-commerce and the Internet has exploded in recent years. The exponential growth of these industries has given rise to Internet reviews, and people’s dependence on them has skyrocketed. The following are some examples of situations where online reviews are critical:(1)
When we want to purchase something from an online retailer, product and seller reviews are crucial.(2)
When it comes to purchasing software, online reviews are very useful.(3)
People use online movie reviews to guide them in selecting whether or not to watch a film.Owing to the advent of e-commerce, online consumer reviews have become a significant factor in our decision to buy something online. As every consumer who purchases a similar product has an opinion about it, it is expressed in a review. It is impossible to tell whether a review is authentic or genuine just by looking at it. Several e-commerce platforms, including Amazon, Flipkart, Myntra, eBay, and others, allow users to write product reviews. These reviews can be of any type, influencing the buyer’s decision. As a result, online reviews can improve or deteriorate the reputation of any brand product. As a result, predicting spam reviews is a must.Jindal et al. [1] classified spam reviews into three types.(1)
Untruthful reviews: Hyper spam refers to reviews that are written with the intent of deceiving readers or review mining systems by writing unworthy positive reviews for a specific target object to promote it falsely while defaming spam refers to reviews that are written with the intent of destroying the image of another specific object.(2)
Nonreviews: Reviews with ads and extraneous information.(3)
Review on brands: Instead of focusing on the goods, these reviews mostly promote a brand.The most crucial task is to identify untruthful reviews. The following are some examples of untruthful reviews:Review 1:“Fantastic Product. I have not seen a better HP LaserJet Pro with such cool features. It has wifi, lan connectivity. I can print from my phone laptop any device wireless to the machine. And it shows up instantly. Moreover, the whole setup process was a breeze. I would not have got a better HP Laserjet product with MFP capabilities at this price. Hats off!”Review 2:“The copy quality of the printer is horrible, scan quality is just ok and print quality acceptable. It does not have an led light on the display, so its going to be more difficult and annoying for you to operate this printer”.The user’s ability to distinguish between spurious and genuine reviews is critical. As a result, certain standard approaches are proposed, such asn-grams, bag of words, filtering, and parts of speech [2]. A speech or text sample in n-gram consists of a continuous succession of n characteristics. The main disadvantage of n-grams is that the feature spaces that they represent are quite sparse. Individual words are considered a feature in the bag of word-based methods for classifying spam reviews, ignoring the meaning of words [3]. As a result, such methods are less effective at detecting spam. Researchers employed a variety of alternative methods for spam identification, including unigram-based methods [4,5], lexical [6], and syntactical feature-based methods [7].Moreover, machine-learning methods that are supervised, unsupervised, and semisupervised are widely used to detect spam reviews. Saeed et al. [8] designed a method that compared the predicted accuracy of multiple machine-learning methods for phishing emails. Tingmin et al. [9] suggested a new deep learning-based strategy for detecting Twitter spam. Chang et al. [10] compared and contrasted various techniques for detecting fraudulent hotel reviews. They used Internet reviews as a research object and a rumored model to determine whether or not these reviews were authentic. They used text mining to extract three primary characteristics from review content: important attribute word, specific quantifier, and noun-verb ratio to create the rumored model. The support vector machine (SVM) method was chosen as a comparison model. Mukherjee et al. [11] developed a way for identifying the spurious reviewers who have an impact on consumer products. Li et al. [12] introduced two-view co-training techniques based on machine-learning for detecting product review spam.An analysis of the impact of motivated review efforts was presented by Petrescu et al. [13]. His findings show that posting positive reviews of the product by the users is highly biased due to these motivating campaigns. Michael Luca [14], by using a data set from Yelp.com and restaurant data from the Washington State Department of Revenue, demonstrated how Internet reviews affect restaurant demand. Through his work, he came to three significant conclusions: First, a one-star improvement in Yelp rating results in a 5% to 9% increase in sales; second, such ratings do not impact chain restaurants; third, growing Yelp penetration results in decline in chain restaurant markets. Mesleh et al. [15] created a text classification classifier based on SVMs that employ the chi-square approach to extract significant feature vectors during the preprocessing phase. Catal and Guldan [16] showed that multiple classifier problems (MCPs) are used in a high-performance model. This model combines the strengths of five high-performing individual classifiers and operates the majority vote aggregation technique to detect fake negative reviews. Xie et al. [17] suggested an approach for detecting spam based on temporal emulations that are strongly associated. To deal with the problem of latent aspect mining, a solution called sparse aspect coding model (SACM) was presented by Xu et al. [18]. The latent variables used to model the observed review text and entire rating in SACM are the user-intrinsic aspect-interest and item-intrinsic aspect-quality. For hotel reviews, a novel multitext summarising technique was developed by Hu et al. [19]. This technique aids in the identification of the top-k most informative sentences. Sasaki and Shinnou [20] proposed a spam detection method that uses a spherical k-means algorithm to locate disjoint clusters automatically. This technique is based on the vector space concept used for text clustering. Yang et al. [21] demonstrated the trade-off between accuracy and efficiency using a two-layered spam detection flow. To identify spam in Twitter, McCord and Chuah [22] employed four standard classifiers: Random Forest, Nave Bayesian, SVM, and KNN neighbor. They found that the Random Forest classifier performed the best, with 95.7% precision and 95.7% F-measure values. Mateen et al. [23] proposed a combined method for disclosing spammer’s Twitter platform. This method uses content-based as well as graph-based features for identifying spam.To detect web spam, Singh and Singh [24] combined the effectiveness of correlation-based feature selection (CFS) technique and particle swarm optimization (PSO). Singh and Batra [25] proposed a spam detection method based on ensemble learning. This method employs a quotient filter for efficient searching, and for similarity searching, it employs locality-sensitive hashing. Bindu et al. [26] applied unsupervised approaches to the Twitter data set to detect spam. On graphs, URLs, and community-based features, this technique was used. Li et al. [27]used de-noising auto-encoder and synthetic minority over-sampling strategies in deep belief network (DBN) machine learning to classify web spam. Liu et al. [28] used a hybrid technique based on fuzzy-redistribution and asymmetric sampling to detect spam tweets. Miller et al. [29] classified spam tweets using clustering methods such as stream clustering methods and other approaches such as streamKM++ and denStream. To detect spam reviews, Narayan et al. [30] proposed a semisupervised PU-learning-based approach. Inuwa-Dutse et al. [31] determined the accounts that post spam on Twitter. Singh et al. [32] proposed a model for detecting and preventing fake reviews and spam.Wu et al. [33] developed a hybrid spam filtering approach. To filter spam, this technology employs rule-based processing and back-propagation neural networks. By incorporating a redesigned scheme that assigns weight to features, Asghar et al. [34] were able to attain a 96% accuracy. The experiment was carried out using a feature weighting technique based on rules that classified the review sentence as spam or ham. Wu et al. [35] suggested a hybrid PU-learning-based Spammer Detection (hPSD) model based on product reviews to identify hidden spam users. This algorithm can also detect multitype spammers by recognizing only a tiny percentage of positive data, ideal for real-world applications. A hybrid method for feature selection was proposed by Rajamohana et al. [36], which uses cuckoo search (CS) along with harmony search to increase the processing rate and prediction accuracy. The Naive Bayes classifier was employed to classify the review into spam and nonspam.To classify spam, recently, some algorithms have also been employed, which are metaheuristics. Salehi et al. [37] detected e-mail spam using genetic algorithms (GAs). Idris et al. detected e-mail spam using two algorithms: differential evolution (DE) [38] and negative selection algorithms. Idris et al. [39] used a combined method based on PSO [40] and negative selection for detecting e-mail spam. Shekhawat et al. [41] proposed a model that uses Spider Monkey Optimization (SMO) with k-Means to classify twitter sentiments. Saini et al. [42] classified spam using a hybrid clustering method based on artificial bee colony (ABC) [43] algorithm. Rajamohana et al. [44] proposed a model that uses adaptive binary flower pollination algorithm (BFPA), a global optimization technique for feature extraction, and Naive Bayes (NB) classifier as the objective function to increase the classification accuracy. Pereira et al. [45] proposed a hybrid technique using the efficiency of local search and evolutionary algorithms to have a suitable search mechanism and to balance the difference in the population. As the metaheuristic strategies are stochastic and often traps in the local optima, an effective solution is always required to identify the optimal cluster heads (CHs) and adequately explore the search region without stagnating at some local optimal point.To reduce the large dimensionality of the feature set and select optimum feature subsets, a hybrid strategy combining improved binary PSO and shuffling frog leaping algorithm is presented by Rajamohana et al. [46]. This helps to ignore the fake reviews. In another research, they also used hybrid improved binary particle swarm optimization (iBPSO), and CS is for selecting optimum features [47].Therefore, in this paper, to classify the spam and nonspam reviews, a novel metaheuristic method based on clustering has been proposed. The paper is sectioned in the following manner: The Grey Wolf Optimization (GWO) andk-Means are described in section 2. The proposed method, fitness-based Grey Wolf Optimizer clustering (FGWOK), is described in section 3. Section 4 illustrates the experimental results, and we have concluded our work in section 5.


## 2. Preparatory

### 2.1.K-Means Clustering

To organize the items of a set among segregated groups or clusters, thek-Means data clustering approach [48] arranges n data points into k clusters by iteratively reducing the distance between data points and the k CHs. Either the Euclidean distance [49] or the cosine measure [50] can be used to calculate distance. The k-Means approach produces a partitioning that reduces the squared error between data points and the cluster’s empirical mean. Choosing the value of k for a data set with an uncertain number of classes is a difficult task in k-Means clustering. The elbow technique [51], information criteria method [52], silhouette method [53], and others can be used to pick k value in such instances.The pseudo-code ofk-Means is given in Algorithm 1:Algorithm 1:k-Means Algorithm.
Input:P:n objects data setk: the number of clustersOutput:k-clusters setMechanism:Randomly initialize thek CHsAssign each data point to the cluster that is closest to it.Each cluster’s new CHCi is calculated using the formula: Ci=1/ni∑∀qiϵRiqi,i=1,2,…,k.whereqi denotes the data points that belong to the cluster Ri; ni is the number of documents in cluster Ri


### 2.2. Brief Overview of Grey Wolf Optimizer

The GWO algorithm developed by Mirjalili [54] is a population-based metaheuristic algorithm designed to explore and construct a heuristic (partial search algorithm), to find an optimal solution for an optimization problem. All the algorithms with randomization and local search capacity are known as metaheuristic algorithms [55]. Metaheuristic algorithms can relatively handle issues with a considerable population [56]. Unlike other optimization algorithms, metaheuristic algorithms do not ensure obtaining the optimal solution. Still, they are capable of computing suboptimal, good-quality solutions and take feasible execution time [57]. GWO is one such type of metaheuristic algorithm that mimes grey wolves’ attacking behavior and management hierarchy. In GWO, to fabricate the management hierarchy, the colony of wolves is divided into primarily four main classes, alpha α, beta β, omega ω, and delta δ. The alpha wolf is the leader and is considered the best one. They are responsible for making decisions for hunting, time to sleep, waking up time, and so on. Beta is the second-level wolf. They are the auxiliary wolves that help alpha wolves in decision-making and other activities. Delta is the third-best, and it is responsible for sacrifice. These wolves are accountable for dominating other wolves. Omega is the lowest-ranked grey wolf. They are considered weaklings and are ready to sacrifice. All other wolves are delta wolves.The working of GWO can be described in the following four steps:(1)
Encircling prey.(2)
Hunting.(3)
Attacking prey.(4)
Search prey.


#### 2.2.1. Mathematical Model

In this subsection, the mathematical model for encircling the prey, hunting, attacking, and searching the prey is illustrated.


#### 2.2.2. Encircling the Prey

At first, the grey wolves encircle the prey which can mathematically be given as(1)D=C.Gpt−Gt,(2)Gt+1=Gpt−A∗D,(3)a=2−2tI,(4)A=2∗a∗r1−a,(5)C=2∗r2,where current iteration is indicated by t, vector A and C indicates coefficient vectors. Gp and G indicate the prey position and grey wolf position, respectively. A is a vector that linearly decreases from 2 to 0 over the course of iterations. r1 and r2 are random vectors in the range [0,1]. Initially, vector A has a maximum value, which decreases gradually as the iterations increase, which can be calculated by equation (3). I indicate the maximum number of iterations.


#### 2.2.3. Hunting

To mathematically simulate the hunting behavior of grey wolves, theα, β, and δ are considered as the best solution which possesses the optimal information about where the prey is. Based on this information, other grey wolves update their positions using the following equations [54]:(6)G1=Gαt−A1∗Dα,(7)G2=Gβt−A2∗Dβ,(8)G3=Gδt−A3∗Dδ,where,(9)Dα=C1.Gαt−GDβ=C2.Gβt−GDδ=C3.Gδt−G,Gt+1=G1+G2+G33.


#### 2.2.4. Search Prey (Exploration)

The exploitation and exploration behavior in the GWO algorithm depends on theA and C parameters. A lies randomly in the range of [−a, a]. The wolf shows exploration behavior when A >1 and C >1.


#### 2.2.5. Attack on Prey (Exploitation)

The attack on prey leads to exploitation. Exploitation occurs ifA <1 and C <1.The steps of GWO algorithm are described in Algorithm 2.Algorithm 2: GWO.
Input: Number of search agentsNumber of MaxofGenerationfitness functionOutput: Best Solution Gα (t)Initialize the populationGp (p = 1, 2, …, n);Initializeα, A, and C;Calculate the fitness of each wolf:Gα (t) = the first-best known as the leaderGβ (t) = the second-best who assist αGδ (t) = the third-best is the subordinatewhilet<Max of Generationdoforeach wolf doModify the position of the current wolf by (8)end forModifyα, A, and CCompute the fitness of individual wolfModifyGα (t), Gβt,Gδ (t)t = t+1end whilereturnGα (t)


## 2.1.K-Means Clustering

To organize the items of a set among segregated groups or clusters, thek-Means data clustering approach [48] arranges n data points into k clusters by iteratively reducing the distance between data points and the k CHs. Either the Euclidean distance [49] or the cosine measure [50] can be used to calculate distance. The k-Means approach produces a partitioning that reduces the squared error between data points and the cluster’s empirical mean. Choosing the value of k for a data set with an uncertain number of classes is a difficult task in k-Means clustering. The elbow technique [51], information criteria method [52], silhouette method [53], and others can be used to pick k value in such instances.The pseudo-code ofk-Means is given in Algorithm 1:Algorithm 1:k-Means Algorithm.
Input:P:n objects data setk: the number of clustersOutput:k-clusters setMechanism:Randomly initialize thek CHsAssign each data point to the cluster that is closest to it.Each cluster’s new CHCi is calculated using the formula: Ci=1/ni∑∀qiϵRiqi,i=1,2,…,k.whereqi denotes the data points that belong to the cluster Ri; ni is the number of documents in cluster Ri


## 2.2. Brief Overview of Grey Wolf Optimizer

The GWO algorithm developed by Mirjalili [54] is a population-based metaheuristic algorithm designed to explore and construct a heuristic (partial search algorithm), to find an optimal solution for an optimization problem. All the algorithms with randomization and local search capacity are known as metaheuristic algorithms [55]. Metaheuristic algorithms can relatively handle issues with a considerable population [56]. Unlike other optimization algorithms, metaheuristic algorithms do not ensure obtaining the optimal solution. Still, they are capable of computing suboptimal, good-quality solutions and take feasible execution time [57]. GWO is one such type of metaheuristic algorithm that mimes grey wolves’ attacking behavior and management hierarchy. In GWO, to fabricate the management hierarchy, the colony of wolves is divided into primarily four main classes, alpha α, beta β, omega ω, and delta δ. The alpha wolf is the leader and is considered the best one. They are responsible for making decisions for hunting, time to sleep, waking up time, and so on. Beta is the second-level wolf. They are the auxiliary wolves that help alpha wolves in decision-making and other activities. Delta is the third-best, and it is responsible for sacrifice. These wolves are accountable for dominating other wolves. Omega is the lowest-ranked grey wolf. They are considered weaklings and are ready to sacrifice. All other wolves are delta wolves.The working of GWO can be described in the following four steps:(1)
Encircling prey.(2)
Hunting.(3)
Attacking prey.(4)
Search prey.


### 2.2.1. Mathematical Model

In this subsection, the mathematical model for encircling the prey, hunting, attacking, and searching the prey is illustrated.


### 2.2.2. Encircling the Prey

At first, the grey wolves encircle the prey which can mathematically be given as(1)D=C.Gpt−Gt,(2)Gt+1=Gpt−A∗D,(3)a=2−2tI,(4)A=2∗a∗r1−a,(5)C=2∗r2,where current iteration is indicated by t, vector A and C indicates coefficient vectors. Gp and G indicate the prey position and grey wolf position, respectively. A is a vector that linearly decreases from 2 to 0 over the course of iterations. r1 and r2 are random vectors in the range [0,1]. Initially, vector A has a maximum value, which decreases gradually as the iterations increase, which can be calculated by equation (3). I indicate the maximum number of iterations.


### 2.2.3. Hunting

To mathematically simulate the hunting behavior of grey wolves, theα, β, and δ are considered as the best solution which possesses the optimal information about where the prey is. Based on this information, other grey wolves update their positions using the following equations [54]:(6)G1=Gαt−A1∗Dα,(7)G2=Gβt−A2∗Dβ,(8)G3=Gδt−A3∗Dδ,where,(9)Dα=C1.Gαt−GDβ=C2.Gβt−GDδ=C3.Gδt−G,Gt+1=G1+G2+G33.


### 2.2.4. Search Prey (Exploration)

The exploitation and exploration behavior in the GWO algorithm depends on theA and C parameters. A lies randomly in the range of [−a, a]. The wolf shows exploration behavior when A >1 and C >1.


### 2.2.5. Attack on Prey (Exploitation)

The attack on prey leads to exploitation. Exploitation occurs ifA <1 and C <1.The steps of GWO algorithm are described in Algorithm 2.Algorithm 2: GWO.
Input: Number of search agentsNumber of MaxofGenerationfitness functionOutput: Best Solution Gα (t)Initialize the populationGp (p = 1, 2, …, n);Initializeα, A, and C;Calculate the fitness of each wolf:Gα (t) = the first-best known as the leaderGβ (t) = the second-best who assist αGδ (t) = the third-best is the subordinatewhilet<Max of Generationdoforeach wolf doModify the position of the current wolf by (8)end forModifyα, A, and CCompute the fitness of individual wolfModifyGα (t), Gβt,Gδ (t)t = t+1end whilereturnGα (t)


## 2.2.1. Mathematical Model

In this subsection, the mathematical model for encircling the prey, hunting, attacking, and searching the prey is illustrated.


## 2.2.2. Encircling the Prey

At first, the grey wolves encircle the prey which can mathematically be given as(1)D=C.Gpt−Gt,(2)Gt+1=Gpt−A∗D,(3)a=2−2tI,(4)A=2∗a∗r1−a,(5)C=2∗r2,where current iteration is indicated by t, vector A and C indicates coefficient vectors. Gp and G indicate the prey position and grey wolf position, respectively. A is a vector that linearly decreases from 2 to 0 over the course of iterations. r1 and r2 are random vectors in the range [0,1]. Initially, vector A has a maximum value, which decreases gradually as the iterations increase, which can be calculated by equation (3). I indicate the maximum number of iterations.


## 2.2.3. Hunting

To mathematically simulate the hunting behavior of grey wolves, theα, β, and δ are considered as the best solution which possesses the optimal information about where the prey is. Based on this information, other grey wolves update their positions using the following equations [54]:(6)G1=Gαt−A1∗Dα,(7)G2=Gβt−A2∗Dβ,(8)G3=Gδt−A3∗Dδ,where,(9)Dα=C1.Gαt−GDβ=C2.Gβt−GDδ=C3.Gδt−G,Gt+1=G1+G2+G33.


## 2.2.4. Search Prey (Exploration)

The exploitation and exploration behavior in the GWO algorithm depends on theA and C parameters. A lies randomly in the range of [−a, a]. The wolf shows exploration behavior when A >1 and C >1.


## 2.2.5. Attack on Prey (Exploitation)

The attack on prey leads to exploitation. Exploitation occurs ifA <1 and C <1.The steps of GWO algorithm are described in Algorithm 2.Algorithm 2: GWO.
Input: Number of search agentsNumber of MaxofGenerationfitness functionOutput: Best Solution Gα (t)Initialize the populationGp (p = 1, 2, …, n);Initializeα, A, and C;Calculate the fitness of each wolf:Gα (t) = the first-best known as the leaderGβ (t) = the second-best who assist αGδ (t) = the third-best is the subordinatewhilet<Max of Generationdoforeach wolf doModify the position of the current wolf by (8)end forModifyα, A, and CCompute the fitness of individual wolfModifyGα (t), Gβt,Gδ (t)t = t+1end whilereturnGα (t)


## 3. Proposed Clustering Method for Spam Review Detection

### 3.1. Drawbacks of GWO

The conventional GWO search equation indicates that the search directions are dependent on the leading wolves. Leader wolves are sometimes caught in traps, especially at local solutions, when a multimodal problem has a lot of slopes. When the pack’s leader wolves become stuck at these local optima in the normal GWO, it is tough for the group to escape due to the search’s reliance on leading wolves [58]. Premature convergence is caused by stagnation at local optima. By exploring the solution space more quickly, the collaboration and information exchange mechanism amongst the individual wolves can help to alleviate these concerns from the algorithm [59]. This shows that the conventional GWO is not an efficient algorithm [60]. As it is impractical to design a fully efficient population-based stochastic algorithm, there arises a deliberation for creating a comparatively efficient GWO algorithm.


### 3.2. Proposed Fitness-Based Grey Wolf Optimizer (FGWOK) Clustering Method

Maintaining variation in early and later rounds of any random number-based search algorithm can help balance exploration of the entire search space and exploitation of the near-optimal solution region. The search space in GWO is explored based on (4) and (5). In GWO, A and C values affect the exploration and exploitation. If the value of both A and C is greater than 1, then exploration is high, and if the value of both A and C is less than 1, then exploitation occurs. To create a balance between exploration and exploitation, in this paper, we propose a new position update process influenced by the onlooker bee phase [43] of the ABC algorithm. Sharma et al. used this phase to design fitness-based differential evolution (FBDE), and the results are highly motivating [61]. In the ABC algorithm’s employed bee phase, the employed bees look for food and evaluate their fitness by equatiods 10. In equation 10, fi and fiti are objective and fitness values in the ith solution, respectively.(10)fiti=11+fi,iffi≥0,1+absfi,iffi<0.In the Onlooker bee phase, using this fitness, the probabilitypi is calculated using equation (11). In this equation, maxfit is the maximum fitness in the swarm.(11)pi=0.9∗fitimaxfit+0.1.The ABC algorithm’s position update equation is provided in equation (12).(12)vij=xij+ϕijxij−xkj,where k∈1,2,…,N and j∈1,2,…,d are randomly chosen indices. k must be different from i. ϕij is a random number between [−1, 1]. The coefficient ϕij in equation (12), is a uniform random number in the range [−1, 1], and xkj represents a randomly selected solution in the swarm. In the basic ABC, only one dimension is updated at a time in the employed or onlooker bee phase. This updation occurs during the onlooker bee phase and is dependent on a probability that is a function of fitness. The position update (12) of FGWO is inspired from the onlooker bee phase of ABC. Only the identified food sources updated their position (one dimension at a time) in the onlooker bee phase. Therefore, the solution search dominated by equation (12) enables better exploitation, that is, a better candidate receives more chances to update itself in its proximity.This paper introduces a fitness-based Grey Wolf Optimizer using thek-Means (FGWOK) clustering mechanism to identify the spam reviews. The FGWOK helps in identifying spam reviews by the following phases:(1)
Preprocessing of data.(2)
Feature extraction phase.(3)
Feature Selection using chi-square.(4)
Fitness based GWO clustering method.(5)
Testing the proposed clustering method.Figure1 illustrates the flowchart of the proposed method.Figure 1
Proposed clustering method flowchart.


### 3.3. Preprocessing of Data

The online reviews collected from social media have noise in the form of unwanted and vague words, stop words, URLs, and so on, which are not desired in feature extraction. The removal of such uncertain words is executed in two different phases, performed through python natural language toolkit (NLTK) [62]:


#### 3.3.1. Phase 1

Eliminates all the noise and word with uncertainty by the following steps:(1)
Conversion of all reviews in lowercase.(2)
Remove special symbols from the online reviews such as ®,@, #, etc.(3)
Remove stop words from reviews that do not consist of any relevant information such as with, at, of, to With the help of the NLTK library.(4)
Replace multiple white spaces and add single white spaces in their place.(5)
Remove all numbers from the reviews.(6)
Remove few punctuations from the reviews such as hyphen, braces, slash, and quotation marks.


#### 3.3.2. Phase 2

In this phase, the paragraphs are divided into sentences by applying lexical analysis or tokenization. After tokenization, the words are reduced to their root form by using lemmatization, like “changing” is altered to “change”.


### 3.4. Feature Extraction Phase

Once the preprocessing phase is complete, relevant features are extricated with the help of Linguistic Inquiry and Word Count (LIWC 2015) [63]. The LIWC program has the main text analysis module in addition to a group of built-in dictionaries. The work of LIWC is to read the text given and count the percentage of words reflecting various emotions, styles of thinking, concerns of society, and even parts of speech. The features provided by LIWC are generally 93.


### 3.5. Feature Selection Using Chi-Square

In this phase, the relevant attributes are selected from the 93 extracted features given by LIWC. Feature selection plays an important role due to the following reasons:(1)
Eliminates the repetitive data.(2)
Picks relevant attributes/variables.(3)
Minimizes the occurrence of overfitting.(4)
Minimizes the training time.Ninety-three features were selected using the LIWC tool. The features may be irrelevant and may cause the problem of overfitting [64]. As the number of features increases, the training time [4] also increases [65]. To eliminate the redundant and irrelevant features, the chi-square feature selection method used for text classification is implemented [66]. It is one of the simplest tools for univariate feature selection by performing the univariate statistical analysis for classification. The feature interactions are neglected in this process. It is mainly used for categorical data and is extensively used for text data. The chi-square method is majorly used for categorical features in a data set. The chi-square is calculated amongst each feature and the target and the feature with the highest chi-square value is selected.The chi-square score is given by the following equation:(13)Ch=Observed frequency−Expected frequency2Expected frequency,where, observed frequency = total number of class observations.Expected frequency = number of expected class observations without any relation between feature and the target. The relevant features are selected using the chi-square method for all three data sets.


### 3.6.k-Means Fitness-Based GWO (The Proposed Clustering Mechanism)

To classify the reviews into spam and nonspam, the proposed method finds out optimal CHs with the help of GWO. Spam reviews are classified using the following steps:(1)
Within the search space, randomly initialize the population of grey wolf optimizer.(2)
Position of the search agents represents the cluster-head coordinates of spam and nonspam reviews.(3)
For each search agent, the fitness is calculated using accuracy as the objective function.(4)
Use fitness-based grey wolf optimizer to optimize the clusters.Algorithm 3 shows the steps of the proposed mechanism.Algorithm 3: Proposed clustering method.
Input:Number of clustersData setOutput: Optimum Cluster HeadDefine number of features (f)−d Dimension of search agents (d) = 2 ∗ f−N Number of search agents−R Number of Runs−MaxIter Number of max. IterationsApply chi-square on the data set to get best ‘f’ features.fori=1toRdoInitialize Alpha, Beta, and Delta position to zero.Initialize Alpha, Beta, and Delta score to minus infinity (-∞)fori=1toNdoGenerate a random Cluster Head within the search space and assign it toith search agent.end forfori=1to MaxIterdofori=1toNdoCalculate the fitness ofith search agent.Update the position of Alpha, Beta, and Delta.end forend forUpdate the value ofafori=1toNdofori=1toddoCalculate the vectors A1, A2, and A3 form (5)Calculate the vectors C1, C2, and C3 form (7)EvaluateG1,G2 and G3 from equations (8), (9) and (10) respectively.Calculate the new position ofith search agent along dth dimension from (11)end forend fors = 1, i = 1Calculate the fitness using (10)Calculatepi using (11)whiles≤ N doifpi>rand0,1thenvij=xij+ϕijxij−xkj,j is randomly selected dimensionCompute the fitness ofviPerform greedy selection betweenvi and Gi using (9)s = s+1end ifi = i+1ifi>Ntheni = 1end ifReturn the solution with best fitnessend whileend forReturn Optimum Cluster Head


## 3.1. Drawbacks of GWO

The conventional GWO search equation indicates that the search directions are dependent on the leading wolves. Leader wolves are sometimes caught in traps, especially at local solutions, when a multimodal problem has a lot of slopes. When the pack’s leader wolves become stuck at these local optima in the normal GWO, it is tough for the group to escape due to the search’s reliance on leading wolves [58]. Premature convergence is caused by stagnation at local optima. By exploring the solution space more quickly, the collaboration and information exchange mechanism amongst the individual wolves can help to alleviate these concerns from the algorithm [59]. This shows that the conventional GWO is not an efficient algorithm [60]. As it is impractical to design a fully efficient population-based stochastic algorithm, there arises a deliberation for creating a comparatively efficient GWO algorithm.


## 3.2. Proposed Fitness-Based Grey Wolf Optimizer (FGWOK) Clustering Method

Maintaining variation in early and later rounds of any random number-based search algorithm can help balance exploration of the entire search space and exploitation of the near-optimal solution region. The search space in GWO is explored based on (4) and (5). In GWO, A and C values affect the exploration and exploitation. If the value of both A and C is greater than 1, then exploration is high, and if the value of both A and C is less than 1, then exploitation occurs. To create a balance between exploration and exploitation, in this paper, we propose a new position update process influenced by the onlooker bee phase [43] of the ABC algorithm. Sharma et al. used this phase to design fitness-based differential evolution (FBDE), and the results are highly motivating [61]. In the ABC algorithm’s employed bee phase, the employed bees look for food and evaluate their fitness by equatiods 10. In equation 10, fi and fiti are objective and fitness values in the ith solution, respectively.(10)fiti=11+fi,iffi≥0,1+absfi,iffi<0.In the Onlooker bee phase, using this fitness, the probabilitypi is calculated using equation (11). In this equation, maxfit is the maximum fitness in the swarm.(11)pi=0.9∗fitimaxfit+0.1.The ABC algorithm’s position update equation is provided in equation (12).(12)vij=xij+ϕijxij−xkj,where k∈1,2,…,N and j∈1,2,…,d are randomly chosen indices. k must be different from i. ϕij is a random number between [−1, 1]. The coefficient ϕij in equation (12), is a uniform random number in the range [−1, 1], and xkj represents a randomly selected solution in the swarm. In the basic ABC, only one dimension is updated at a time in the employed or onlooker bee phase. This updation occurs during the onlooker bee phase and is dependent on a probability that is a function of fitness. The position update (12) of FGWO is inspired from the onlooker bee phase of ABC. Only the identified food sources updated their position (one dimension at a time) in the onlooker bee phase. Therefore, the solution search dominated by equation (12) enables better exploitation, that is, a better candidate receives more chances to update itself in its proximity.This paper introduces a fitness-based Grey Wolf Optimizer using thek-Means (FGWOK) clustering mechanism to identify the spam reviews. The FGWOK helps in identifying spam reviews by the following phases:(1)
Preprocessing of data.(2)
Feature extraction phase.(3)
Feature Selection using chi-square.(4)
Fitness based GWO clustering method.(5)
Testing the proposed clustering method.Figure1 illustrates the flowchart of the proposed method.Figure 1
Proposed clustering method flowchart.


## 3.3. Preprocessing of Data

The online reviews collected from social media have noise in the form of unwanted and vague words, stop words, URLs, and so on, which are not desired in feature extraction. The removal of such uncertain words is executed in two different phases, performed through python natural language toolkit (NLTK) [62]:


### 3.3.1. Phase 1

Eliminates all the noise and word with uncertainty by the following steps:(1)
Conversion of all reviews in lowercase.(2)
Remove special symbols from the online reviews such as ®,@, #, etc.(3)
Remove stop words from reviews that do not consist of any relevant information such as with, at, of, to With the help of the NLTK library.(4)
Replace multiple white spaces and add single white spaces in their place.(5)
Remove all numbers from the reviews.(6)
Remove few punctuations from the reviews such as hyphen, braces, slash, and quotation marks.


### 3.3.2. Phase 2

In this phase, the paragraphs are divided into sentences by applying lexical analysis or tokenization. After tokenization, the words are reduced to their root form by using lemmatization, like “changing” is altered to “change”.


## 3.3.1. Phase 1

Eliminates all the noise and word with uncertainty by the following steps:(1)
Conversion of all reviews in lowercase.(2)
Remove special symbols from the online reviews such as ®,@, #, etc.(3)
Remove stop words from reviews that do not consist of any relevant information such as with, at, of, to With the help of the NLTK library.(4)
Replace multiple white spaces and add single white spaces in their place.(5)
Remove all numbers from the reviews.(6)
Remove few punctuations from the reviews such as hyphen, braces, slash, and quotation marks.


## 3.3.2. Phase 2

In this phase, the paragraphs are divided into sentences by applying lexical analysis or tokenization. After tokenization, the words are reduced to their root form by using lemmatization, like “changing” is altered to “change”.


## 3.4. Feature Extraction Phase

Once the preprocessing phase is complete, relevant features are extricated with the help of Linguistic Inquiry and Word Count (LIWC 2015) [63]. The LIWC program has the main text analysis module in addition to a group of built-in dictionaries. The work of LIWC is to read the text given and count the percentage of words reflecting various emotions, styles of thinking, concerns of society, and even parts of speech. The features provided by LIWC are generally 93.


## 3.5. Feature Selection Using Chi-Square

In this phase, the relevant attributes are selected from the 93 extracted features given by LIWC. Feature selection plays an important role due to the following reasons:(1)
Eliminates the repetitive data.(2)
Picks relevant attributes/variables.(3)
Minimizes the occurrence of overfitting.(4)
Minimizes the training time.Ninety-three features were selected using the LIWC tool. The features may be irrelevant and may cause the problem of overfitting [64]. As the number of features increases, the training time [4] also increases [65]. To eliminate the redundant and irrelevant features, the chi-square feature selection method used for text classification is implemented [66]. It is one of the simplest tools for univariate feature selection by performing the univariate statistical analysis for classification. The feature interactions are neglected in this process. It is mainly used for categorical data and is extensively used for text data. The chi-square method is majorly used for categorical features in a data set. The chi-square is calculated amongst each feature and the target and the feature with the highest chi-square value is selected.The chi-square score is given by the following equation:(13)Ch=Observed frequency−Expected frequency2Expected frequency,where, observed frequency = total number of class observations.Expected frequency = number of expected class observations without any relation between feature and the target. The relevant features are selected using the chi-square method for all three data sets.


## 3.6.k-Means Fitness-Based GWO (The Proposed Clustering Mechanism)

To classify the reviews into spam and nonspam, the proposed method finds out optimal CHs with the help of GWO. Spam reviews are classified using the following steps:(1)
Within the search space, randomly initialize the population of grey wolf optimizer.(2)
Position of the search agents represents the cluster-head coordinates of spam and nonspam reviews.(3)
For each search agent, the fitness is calculated using accuracy as the objective function.(4)
Use fitness-based grey wolf optimizer to optimize the clusters.Algorithm 3 shows the steps of the proposed mechanism.Algorithm 3: Proposed clustering method.
Input:Number of clustersData setOutput: Optimum Cluster HeadDefine number of features (f)−d Dimension of search agents (d) = 2 ∗ f−N Number of search agents−R Number of Runs−MaxIter Number of max. IterationsApply chi-square on the data set to get best ‘f’ features.fori=1toRdoInitialize Alpha, Beta, and Delta position to zero.Initialize Alpha, Beta, and Delta score to minus infinity (-∞)fori=1toNdoGenerate a random Cluster Head within the search space and assign it toith search agent.end forfori=1to MaxIterdofori=1toNdoCalculate the fitness ofith search agent.Update the position of Alpha, Beta, and Delta.end forend forUpdate the value ofafori=1toNdofori=1toddoCalculate the vectors A1, A2, and A3 form (5)Calculate the vectors C1, C2, and C3 form (7)EvaluateG1,G2 and G3 from equations (8), (9) and (10) respectively.Calculate the new position ofith search agent along dth dimension from (11)end forend fors = 1, i = 1Calculate the fitness using (10)Calculatepi using (11)whiles≤ N doifpi>rand0,1thenvij=xij+ϕijxij−xkj,j is randomly selected dimensionCompute the fitness ofviPerform greedy selection betweenvi and Gi using (9)s = s+1end ifi = i+1ifi>Ntheni = 1end ifReturn the solution with best fitnessend whileend forReturn Optimum Cluster Head


## 4. Experimental Results and Discussion

The effectiveness of the fitness-based grey wolf optimizer using thek-Means (FGWOK) clustering method is tested on the synthetic spam review, movie review, and Yelp review data sets. We have used MATLAB 2016a to simulate all the experiments. The experiments were performed on a system with the configuration of 20.21 GHz Intel(R) Core(TM) i7 processor and size of RAM 16 GB.


### 4.1. Performance Analysis of Proposedk-Means Fitness-Based Grey Wolf Optimizer (FGWOK)

To train a model, usingk-Means, as the number of samples of the training data increases, the computational time and space also increase, due to the Mean computed in each iteration. In the proposed FGWOK, to reduce this computational complexity of taking mean in each iteration, we randomly shift a CH, to get a new combination of CHs. This helps to find the optimal set of CHs within a given time or iteration.The proposed fitness-based GWOK is compared with the existing nature-inspired algorithms, like CS algorithm, DE algorithm, PSO algorithm, GA, and ABC clustering algorithm (ABCK) for validating the accuracy and computational time of the proposed method. The population size (N) is 50, and the maximum iteration (MaxIter) is 1000 for all the algorithms. The average value of accuracy and computational time for 30 runs, with dimension, equals twice the number of features (f), on all three data sets is presented in Table 1. It can be seen that the accuracy of the fitness-based grey wolf optimizer using k-Means is better than the other methods.Table 1
Parameters for fitness-based GWO clustering method.
S. No.ParameterPSODEGACSABCKFGWOK1.Population (N)5050505050502.Maximum iteration1000100010001000100010003.Dimension (d)2∗f2∗f2∗f2∗f2∗f2∗f4.Inertia weight (w)0.8—————5.Crossover rate (CR)—0.5—0.8——6.Cognitive constantc12————7.Social constantc22—————8.Mutation rate (F)—0.80.3———9.ProbabilityProbi for CS———0.25——10.Step scaling factorα———0.01——


### 4.2. Experimental Analysis of Proposed Fitness-Based GWO Clustering Method (FGWOK)

Synthetic spam reviews, Yelp hotel and restaurant reviews, and movie reviews data sets are used to test the proposed method. A brief description of all three data sets is given in Table2.Table 2
Data set description.
S. NO.Data set usedTotal reviewsSpam reviewsNonspam reviews1.Synthetic spam reviews4781633152.Movie reviews8544399845463.Yelp hotel and restaurant reviews495237091243


#### 4.2.1. Synthetic Spam Reviews Data set

The synthetic spam data set was unlabelled [67] and was retrieved from the Database and Information System Laboratory, University of Illinois (TripAdvisor Data set). The spamming methods known as, synthetic review method for spamming have been used to generate spam reviews [68]. This method generated 479 reviews, out of which 316 reviews were spam and 163 reviews generated were nonspam.


#### 4.2.2. Movie Review

The movie review data set is generated from the popular site IMDB. This data set has a total of 8544 reviews, out of which 3998 were spam reviews and 4546 reviews were nonspam.


#### 4.2.3. Yelp Hotels and Restaurant Reviews Data set

Yelp hotels and restaurant review data set is extracted throughYelp.com, consisting of 85 hotels and 130 restaurant reviews, in the areas of Chicago [69, 70]. The reviews of both popular and disliked hotels and restaurants are considered in the data set. There is a total of 4952 reviews, out of which 3709 are spam and 1243 are nonspam.These data sets are noisy. Therefore, we preprocess the data sets to remove the noise as described in section3.3. After preprocessing, 93 features are extracted from these data sets using the LIWC 2015 tool. As all the features may not be of relevance, the chi-square feature selection method, as described in section 3.5 is applied to these 93 features to obtain the best features. The optimum number of features selected from all three data sets is given in Table 3.Table 3
Feature selected.
S. No.Data set usedOptimum features selected1.Synthetic spam reviews202.Yelp reviews213.Movie reviews11For measuring the efficacy of the proposed clustering method, we have evaluated the classification accuracy. The values of precision and recall are also evaluated to check the performance of FGWOK and to compare it with other existing techniques, as classification accuracy alone can be deceptive if the number of instances is not equal in each class.


### 4.3. Results and Discussion

For computing the values of accuracy, precision, and recall, a confusion matrix sizedn∗n is generated. The confusion matrix has n number of classes with Cij representing the number of patterns predicted in i by j.The values used in Table4 have the following significance:TP represents precisely predicted spam reviews.TN represents precisely predicted ham review predicted correctly.FP represents imprecisely predicted ham reviews.FN represents imprecisely predicted spam review.Table 4
Confusion matrix.
SpamNonspamSpamTPTNNonspamFPFNTable5 illustrates the value of precision and recall for the three data sets over original and optimal features. The mean and standard deviation values for original features before feature selection, on all three data sets is described in Table 6.Table 5
Comparative analysis of measure of mean values of precision and recall of proposed method with other methods for original and optimum features data set
Data setMethodOriginal data setOptimal data setPrecision (%)Recall (%)Precision (%)Recall (%)Synthetic spam reviewsk-Means55.1957.9560.6162.69PSO59.5760.0162.3260.61DE59.3361.0661.2662.16GA57.0959.8560.0961.89CS59.5760.8560.1762.99ABCK60.8561.7463.7865.66FGWOK72.8175.7077.2979.81Movie reviewk-Means52.0353.0254.5155.64PSO53.0254.3255.2256.10DE51.1253.2454.0854.89GA52.6754.0454.9756.21CS55.1556.4356.8457.82ABCK55.1456.7358.6759.26FGWOK60.0763.7464.1267.88Yelp hotel and restaurant reviewk-Means70.1984.7274.2788.97PSO69.8787.3970.7889.66DE67.9080.4270.0587.83GA64.7288.2485.1390.95CS70.4289.9571.0692.98ABCK71.4791.8474.2699.32FGWOK75.1894.9778.0199.81Table 6
Comparative analysis to measure mean and standard deviation values of Accuracy of the proposed method with other methods over data sets with original features.
Data setMethodAccuracy (%)Computational time (s)MeanSTDMeanSTDSynthetic spam reviewsk-Means70.281.04300.711.45PSO68.471.05317.871.89DE70.571.02290.821.58GA68.670.951295.641.57CS70.630.84289.491.86ABCK72.610.539299.021.59FGWOK77.820.317279.431.44Movie reviewk-Means59.561.264844.232.28PSO58.241.184891.051.96DE60.491.254894.491.88GA58.671.124875.622.15CS60.071.244929.781.97ABCK60.121.234783.261.68FGWOK64.091.194011.291.37Yelp hotel and restaurant reviewk-Means60.241.712539.121.92PSO59.251.252584.492.37DE59.741.402674.342.58GA59.611.222785.122.05CS60.121.342589.731.76ABCK63.441.182496.181.63FGWOK72.630.972317.121.07Using confusion matrix, the value of accuracy, precision, and recall can be calculated by equations (14), (15), and (16), respectively.(14)Precision=TPTP+FP,(15)Recall=TPTP+FN,(16)Accuracy=TP+TNTP+TN+FP+FN.The mean and standard deviation values for optimum feature selected after feature selection, on all three data sets is described in Table7 and compared with other existing nature-inspired algorithms. From the table, we can see that the proposed fitness-based grey wolf optimizer clustering method outperforms other existing methods in respect of accuracy.Table 7
Comparative analysis to measure mean and standard deviation values of accuracy of the proposed method with other methods over data sets with optimum features.
Data setMethodAccuracy (%)Computational time (s)MeanSTDMeanSTDSynthetic spam reviewsk-Means72.680.405292.731.44PSO70.240.563311.071.69DE73.850.410287.671.58GA71.670.852293.661.65CS74.630.712288.021.68ABCK75.660.412294.151.39FGWOK82.680.394265.011.21Movie reviewk-Means61.660.5874823.632.11PSO61.580.7464852.951.95DE61.220.8024845.491.81GA60.960.6774863.352.05CS62.040.5914914.741.87ABCK60.560.5244654.191.68FGWOK65.910.3914241.221.37Yelp hotel and restaurant reviewk-Means64.520.7152511.421.65PSO60.390.6092534.441.32DE60.420.2752474.301.22GA60.250.4482726.701.03CS61.950.6652534.821.31ABCK74.650.2162427.161.20FGWOK78.510.1462234.070.812The boxplots of accuracy and computational time (seconds) for all the three data sets over the optimal features are depicted in Figures2 and 3, respectively. The x-axis represents the method name and the y-axis represents the parameter under evaluation. From the box plots, we can see that the accuracy of the proposed fitness-based GWO clustering method is high as compared to other metaheuristic algorithms. The proposed method also takes less time for execution as compared to other methods, thus proving the efficacy of our algorithm.Figure 2
Box plots of accuracy of proposed grey wolf-based clustering method and other nature-inspired algorithms of (a) synthetic spam review data set, (b) movie review data set, and (c) Yelp hotels and restaurant review data set.
(a)(b)(c)Figure 3
Box plots of computational time of proposed grey wolf-based clustering method and other nature-inspired algorithms of (a) synthetic spam review data set, (b) movie review data set, and (c) Yelp hotels and restaurant review data set.
(a)(b)(c)So, through experiments, it is proved that the FGWOK is an efficient and robust algorithm to solve the spam review detection problem. So this algorithm can be considered as an prominent solution to solve the spam review detection problem. Furthermore, Table8 contains description of the symbols used in the article.Table 8
Description of symbols.
S. No.SymbolDescription1.CiCluster head2.DDistance between the grey wolf and prey3.GPosition of grey wolf4.GpPosition of prey5.A, CCo-efficient vectors of GWO6.fitiFitness value in theith solution7.fiObjective value in theith solution8.piProbability9.vijPosition update equation of ABC10.ChChi-square11.sCurrent iteration12.dDimension of search agents13.NNumber of search agents14.RNumber of runs


## 4.1. Performance Analysis of Proposedk-Means Fitness-Based Grey Wolf Optimizer (FGWOK)

To train a model, usingk-Means, as the number of samples of the training data increases, the computational time and space also increase, due to the Mean computed in each iteration. In the proposed FGWOK, to reduce this computational complexity of taking mean in each iteration, we randomly shift a CH, to get a new combination of CHs. This helps to find the optimal set of CHs within a given time or iteration.The proposed fitness-based GWOK is compared with the existing nature-inspired algorithms, like CS algorithm, DE algorithm, PSO algorithm, GA, and ABC clustering algorithm (ABCK) for validating the accuracy and computational time of the proposed method. The population size (N) is 50, and the maximum iteration (MaxIter) is 1000 for all the algorithms. The average value of accuracy and computational time for 30 runs, with dimension, equals twice the number of features (f), on all three data sets is presented in Table 1. It can be seen that the accuracy of the fitness-based grey wolf optimizer using k-Means is better than the other methods.Table 1
Parameters for fitness-based GWO clustering method.
S. No.ParameterPSODEGACSABCKFGWOK1.Population (N)5050505050502.Maximum iteration1000100010001000100010003.Dimension (d)2∗f2∗f2∗f2∗f2∗f2∗f4.Inertia weight (w)0.8—————5.Crossover rate (CR)—0.5—0.8——6.Cognitive constantc12————7.Social constantc22—————8.Mutation rate (F)—0.80.3———9.ProbabilityProbi for CS———0.25——10.Step scaling factorα———0.01——


## 4.2. Experimental Analysis of Proposed Fitness-Based GWO Clustering Method (FGWOK)

Synthetic spam reviews, Yelp hotel and restaurant reviews, and movie reviews data sets are used to test the proposed method. A brief description of all three data sets is given in Table2.Table 2
Data set description.
S. NO.Data set usedTotal reviewsSpam reviewsNonspam reviews1.Synthetic spam reviews4781633152.Movie reviews8544399845463.Yelp hotel and restaurant reviews495237091243


### 4.2.1. Synthetic Spam Reviews Data set

The synthetic spam data set was unlabelled [67] and was retrieved from the Database and Information System Laboratory, University of Illinois (TripAdvisor Data set). The spamming methods known as, synthetic review method for spamming have been used to generate spam reviews [68]. This method generated 479 reviews, out of which 316 reviews were spam and 163 reviews generated were nonspam.


### 4.2.2. Movie Review

The movie review data set is generated from the popular site IMDB. This data set has a total of 8544 reviews, out of which 3998 were spam reviews and 4546 reviews were nonspam.


### 4.2.3. Yelp Hotels and Restaurant Reviews Data set

Yelp hotels and restaurant review data set is extracted throughYelp.com, consisting of 85 hotels and 130 restaurant reviews, in the areas of Chicago [69, 70]. The reviews of both popular and disliked hotels and restaurants are considered in the data set. There is a total of 4952 reviews, out of which 3709 are spam and 1243 are nonspam.These data sets are noisy. Therefore, we preprocess the data sets to remove the noise as described in section3.3. After preprocessing, 93 features are extracted from these data sets using the LIWC 2015 tool. As all the features may not be of relevance, the chi-square feature selection method, as described in section 3.5 is applied to these 93 features to obtain the best features. The optimum number of features selected from all three data sets is given in Table 3.Table 3
Feature selected.
S. No.Data set usedOptimum features selected1.Synthetic spam reviews202.Yelp reviews213.Movie reviews11For measuring the efficacy of the proposed clustering method, we have evaluated the classification accuracy. The values of precision and recall are also evaluated to check the performance of FGWOK and to compare it with other existing techniques, as classification accuracy alone can be deceptive if the number of instances is not equal in each class.


## 4.2.1. Synthetic Spam Reviews Data set

The synthetic spam data set was unlabelled [67] and was retrieved from the Database and Information System Laboratory, University of Illinois (TripAdvisor Data set). The spamming methods known as, synthetic review method for spamming have been used to generate spam reviews [68]. This method generated 479 reviews, out of which 316 reviews were spam and 163 reviews generated were nonspam.


## 4.2.2. Movie Review

The movie review data set is generated from the popular site IMDB. This data set has a total of 8544 reviews, out of which 3998 were spam reviews and 4546 reviews were nonspam.


## 4.2.3. Yelp Hotels and Restaurant Reviews Data set

Yelp hotels and restaurant review data set is extracted throughYelp.com, consisting of 85 hotels and 130 restaurant reviews, in the areas of Chicago [69, 70]. The reviews of both popular and disliked hotels and restaurants are considered in the data set. There is a total of 4952 reviews, out of which 3709 are spam and 1243 are nonspam.These data sets are noisy. Therefore, we preprocess the data sets to remove the noise as described in section3.3. After preprocessing, 93 features are extracted from these data sets using the LIWC 2015 tool. As all the features may not be of relevance, the chi-square feature selection method, as described in section 3.5 is applied to these 93 features to obtain the best features. The optimum number of features selected from all three data sets is given in Table 3.Table 3
Feature selected.
S. No.Data set usedOptimum features selected1.Synthetic spam reviews202.Yelp reviews213.Movie reviews11For measuring the efficacy of the proposed clustering method, we have evaluated the classification accuracy. The values of precision and recall are also evaluated to check the performance of FGWOK and to compare it with other existing techniques, as classification accuracy alone can be deceptive if the number of instances is not equal in each class.


## 4.3. Results and Discussion

For computing the values of accuracy, precision, and recall, a confusion matrix sizedn∗n is generated. The confusion matrix has n number of classes with Cij representing the number of patterns predicted in i by j.The values used in Table4 have the following significance:TP represents precisely predicted spam reviews.TN represents precisely predicted ham review predicted correctly.FP represents imprecisely predicted ham reviews.FN represents imprecisely predicted spam review.Table 4
Confusion matrix.
SpamNonspamSpamTPTNNonspamFPFNTable5 illustrates the value of precision and recall for the three data sets over original and optimal features. The mean and standard deviation values for original features before feature selection, on all three data sets is described in Table 6.Table 5
Comparative analysis of measure of mean values of precision and recall of proposed method with other methods for original and optimum features data set
Data setMethodOriginal data setOptimal data setPrecision (%)Recall (%)Precision (%)Recall (%)Synthetic spam reviewsk-Means55.1957.9560.6162.69PSO59.5760.0162.3260.61DE59.3361.0661.2662.16GA57.0959.8560.0961.89CS59.5760.8560.1762.99ABCK60.8561.7463.7865.66FGWOK72.8175.7077.2979.81Movie reviewk-Means52.0353.0254.5155.64PSO53.0254.3255.2256.10DE51.1253.2454.0854.89GA52.6754.0454.9756.21CS55.1556.4356.8457.82ABCK55.1456.7358.6759.26FGWOK60.0763.7464.1267.88Yelp hotel and restaurant reviewk-Means70.1984.7274.2788.97PSO69.8787.3970.7889.66DE67.9080.4270.0587.83GA64.7288.2485.1390.95CS70.4289.9571.0692.98ABCK71.4791.8474.2699.32FGWOK75.1894.9778.0199.81Table 6
Comparative analysis to measure mean and standard deviation values of Accuracy of the proposed method with other methods over data sets with original features.
Data setMethodAccuracy (%)Computational time (s)MeanSTDMeanSTDSynthetic spam reviewsk-Means70.281.04300.711.45PSO68.471.05317.871.89DE70.571.02290.821.58GA68.670.951295.641.57CS70.630.84289.491.86ABCK72.610.539299.021.59FGWOK77.820.317279.431.44Movie reviewk-Means59.561.264844.232.28PSO58.241.184891.051.96DE60.491.254894.491.88GA58.671.124875.622.15CS60.071.244929.781.97ABCK60.121.234783.261.68FGWOK64.091.194011.291.37Yelp hotel and restaurant reviewk-Means60.241.712539.121.92PSO59.251.252584.492.37DE59.741.402674.342.58GA59.611.222785.122.05CS60.121.342589.731.76ABCK63.441.182496.181.63FGWOK72.630.972317.121.07Using confusion matrix, the value of accuracy, precision, and recall can be calculated by equations (14), (15), and (16), respectively.(14)Precision=TPTP+FP,(15)Recall=TPTP+FN,(16)Accuracy=TP+TNTP+TN+FP+FN.The mean and standard deviation values for optimum feature selected after feature selection, on all three data sets is described in Table7 and compared with other existing nature-inspired algorithms. From the table, we can see that the proposed fitness-based grey wolf optimizer clustering method outperforms other existing methods in respect of accuracy.Table 7
Comparative analysis to measure mean and standard deviation values of accuracy of the proposed method with other methods over data sets with optimum features.
Data setMethodAccuracy (%)Computational time (s)MeanSTDMeanSTDSynthetic spam reviewsk-Means72.680.405292.731.44PSO70.240.563311.071.69DE73.850.410287.671.58GA71.670.852293.661.65CS74.630.712288.021.68ABCK75.660.412294.151.39FGWOK82.680.394265.011.21Movie reviewk-Means61.660.5874823.632.11PSO61.580.7464852.951.95DE61.220.8024845.491.81GA60.960.6774863.352.05CS62.040.5914914.741.87ABCK60.560.5244654.191.68FGWOK65.910.3914241.221.37Yelp hotel and restaurant reviewk-Means64.520.7152511.421.65PSO60.390.6092534.441.32DE60.420.2752474.301.22GA60.250.4482726.701.03CS61.950.6652534.821.31ABCK74.650.2162427.161.20FGWOK78.510.1462234.070.812The boxplots of accuracy and computational time (seconds) for all the three data sets over the optimal features are depicted in Figures2 and 3, respectively. The x-axis represents the method name and the y-axis represents the parameter under evaluation. From the box plots, we can see that the accuracy of the proposed fitness-based GWO clustering method is high as compared to other metaheuristic algorithms. The proposed method also takes less time for execution as compared to other methods, thus proving the efficacy of our algorithm.Figure 2
Box plots of accuracy of proposed grey wolf-based clustering method and other nature-inspired algorithms of (a) synthetic spam review data set, (b) movie review data set, and (c) Yelp hotels and restaurant review data set.
(a)(b)(c)Figure 3
Box plots of computational time of proposed grey wolf-based clustering method and other nature-inspired algorithms of (a) synthetic spam review data set, (b) movie review data set, and (c) Yelp hotels and restaurant review data set.
(a)(b)(c)So, through experiments, it is proved that the FGWOK is an efficient and robust algorithm to solve the spam review detection problem. So this algorithm can be considered as an prominent solution to solve the spam review detection problem. Furthermore, Table8 contains description of the symbols used in the article.Table 8
Description of symbols.
S. No.SymbolDescription1.CiCluster head2.DDistance between the grey wolf and prey3.GPosition of grey wolf4.GpPosition of prey5.A, CCo-efficient vectors of GWO6.fitiFitness value in theith solution7.fiObjective value in theith solution8.piProbability9.vijPosition update equation of ABC10.ChChi-square11.sCurrent iteration12.dDimension of search agents13.NNumber of search agents14.RNumber of runs


## 5. Conclusion

In this paper, a novel clustering approach, fitness-based grey wolf optimizer withk-Means, is proposed for the classification of spam reviews. The proposed method is tested on three different data sets: synthetic spam reviews, movie reviews, and Yelp hotels and restaurant reviews. The proposed method is compared with k-Means, PSO, DE, GA, CS, and ABCK. The experimental results demonstrate that the proposed clustering method with a new position update process, influenced by the onlooker bee phase of ABC, for detecting spam outperforms the existing nature-inspired methods like PSO, DE, GA, CS, and ABCK. Boxplots show the consistency of the proposed method. The chi-square feature selection method is used for finding the optimum features. In the future, some new optimization strategies can be employed in combination with other feature-selection methods such as wrapper-based, Pearson’s correlation, to attain higher accuracy for the given data sets.



---

*Source: 6499918-2022-04-29.xml*