# Detecting Fake Accounts on Instagram Using Machine Learning and Hybrid Optimization Algorithms
## 3 Materials and Methods
### Feature Selection Using Optimization Methods
#### 3.2.2 Grey Wolf Optimization (GWO) Algorithm  
[PERSON] et al. (2016) proposed the Grey Wolf Optimization (GWO) algorithm, which is inspired by the method adopted by grey wolves in searching, encircling, and attacking prey through a hierarchical formulation of their members. The hierarchy consists of alpha, beta, delta, and omega wolves. The top of the hierarchical order is the alpha wolf that makes the decisions and instructs the other wolves. The next in the hierarchy is the beta wolf, which follows the instructions of the alpha wolf and gives instructions to the other wolves. The third in the hierarchy is the delta wolves. The lowest in the hierarchy is the omega wolf that follows the instructions of all the wolves above in the hierarchy. Each wolf in the hierarchy plays a different role by looking for danger and alerting the others or guarding the other wolves from potential danger. A mathematical model is used to optimize the hunting behavior of grey wolves. Since alpha (\(\alpha\)) is the top wolf in the hierarchy, we model the most appropriate solution as alpha (\(\alpha\)). As a result, among the best solutions, we name the second and third ones as beta (\(\beta\)) and delta (\(\delta\)). The rest of the candidate solutions of omega (\(\omega\)) are considered. In the grey wolf optimizer algorithm, \(\alpha\), \(\beta\), and \(\delta\) guide the hunting process (optimization) whereas \(\omega\) wolves follow these three groups. The equations representing the encircling behavior are given by (3) and (4). \[x^{t+1}=x_{p}^{t}-b.d \tag{3}\]  
\[d=\left|e.x_{p}^{t}-x^{t}\right| \tag{4}\]  
In Equations (3) and (4), t represents the number of iterations, b and e represent coefficients, \(x_{p}^{t}\) is the prey's positions vector, and \(x^{t}\) represents the position vector of a grey wolf. Then, b and e are calculated according to Equations (5) and (6). \[b=2*a*r_{1}-a \tag{5}\]  
\[e=2.r_{2} \tag{6}\]In Equations (5) and (6), a decrease from 2 to 0 linearly over iterations--proportional to the number of iterations for each dimension--is given by Equation (7), and \(r_{1}\) and \(r_{2}\) are random vectors in the interval [0, 1]. \[a=2-t\cdot\frac{2}{\max_{i}} \tag{7}\]  
where \(t\) is the iteration number, _ter_ is the optimization's total number of iterations. Alpha (\(\alpha\)) represents the optimal solution as it is on the top of the hierarchy, beta (\(\beta\)) and delta (\(\delta\)) represent the second-best and third-best solutions, respectively. The three best solutions prompt omega (\(\omega\)) to change its position according to the positions of alpha, beta, and delta. The positions are updated according to Equation (8). \[x^{t}=\frac{x_{1}^{t}+x_{2}^{t}+x_{3}^{t}}{3} \tag{8}\]  
In Equation (8), \(x_{1}^{t},~{}x_{2}^{t},~{}x_{3}^{t}\) are the three best solutions at a given iteration t and are given by Equation (9):  
\[x_{1}^{t}=x_{a}^{t}-b_{1}.d_{a}x_{2}^{t}=x_{\beta}^{t}-b_{2}.d_{\beta}x_{3}^{t} =x_{\delta}^{t}-b_{3}.d_{\delta} \tag{9}\]  
In Equation (9), \(b_{1},~{}b_{2},~{}b_{3}\) are calculated as in Equation (5) and \(d_{\alpha},~{}d_{\beta},~{}d_{\delta}\) as given in Equation (4) can be described by Equation (10). \[d_{\alpha}=\left|e_{1}.x_{\alpha}^{t}-x^{t}\right|d_{\beta}=\left|e_{2}.x_{ \beta}^{t}-x^{t}\right|d_{\delta}=\left|e_{3}.x_{\delta}^{t}-x^{t}\right| \tag{10}\]  
where \(e_{1},~{}e_{2},~{}e_{3}\) are calculated based on Equation (6). Binary GWO for Feature Selection  
Feature selection can be considered a binary problem by either selecting a feature or discarding it and, thus, Binary GWO is described to select the features. According to [35], the updating mechanism of wolves is a function of three positions, namely \(x_{1}^{t},x_{2}^{t},~{}x_{3}^{t}\), which represent the best three solutions. Equation (8) is modified to transform the result into a binary choice, as given by Equation (11).