# Convolutional Graph Network-Based Feature Extraction to Detect Phishing Attacks
## 3 Materials and Methods
### Extracting Features Based on Graph Convolution Network  
Feature extraction based on a graph convolutional network is performed with an algorithm with five main components, including the elimination of multiples, feature initialization, gradient computation, graph construction, and a neural network. The basic aim is to iteratively explore a collection of optimum features causing the highest decrease in the loss of optimization. Step 1: Feature initialization  
Feature initialization is based on a matrix of features with n << p or \(XeR^{n\times p}\). First, we define the bias feature (for instance, a column with amounts equal to 1) in X and index it with zero. The sum of the features' numbers is p + 1, and basic features have similar index numbers. The chosen feature set (S = [0]) is initialized as the bias feature. The bias feature functions as the basic feature selected for beginning the process of feature selection. Step 2: Construction of similarity graph  
To construct the similarity graph, the Manhattan similarity criterion is used based on the selected features in the set (S). The Manhattan similarity is measured between two data samples (\(i\) and \(j\)) in the form of vectors. \(X_{i}eR^{|s|}\) and \(X_{j}eR^{|s|}\) are redefined and calculated. All the dataset features are of the non-binary categorical type, and as a result, it is possible to use the Manhattan distance criterion. It is calculated by comparing the structural similarity between two vectors. To calculate the Manhattan similarity between two vectors with equal lengths, first, the number of corresponding locations with similar values is calculated. Then, this value is divided by the length of the vector. Each row of the correlation matrix represents a vector of zeros and ones. This vector actually reflects the degree of communication between the nodes. As a result, it is possible to calculate the degree of Manhattan similarity between both nodes. The Manhattan distance is referred to as the \(L1\) distance. When \(u\) = (\(x1\), \(y1\)) and \(v\) = (\(x2\), \(y2\)) are two points, the Manhattan distance between u and v is represented by Equation (2):  
\[\text{MH (a, b)}=|x1-x2|+|y1-y2| \tag{2}\]  
Instead of 2 dimensions, when points have n dimensions, like a = (x1, x2, \(\ldots\), xn) and b = (y1, y2, \(\ldots\), yn) after that, Equation (2) can be generalized by describing the Manhattan distance among \(a\) and \(b\) as follows [45]:  
\[\text{MH (a, b)}=|x1-x2|+|y1-y2|+\ldots+|xn-yn|=\sum_{i=1}^{n}|x_{i}-y_{i}| \tag{3}\]  
Step 3: Finding neighboring nodes  
1. Graph dimensions and structural featuresThe first step in the graph construction phase is the creation of a structural feature graph. We have a collection of nodes that represent data samples. In addition, there is another set of nodes that represent feature values. A node is added for each value of each feature. Based on the feature value (\(V\)) and data sample (\(R\)), the set of nodes in the graph is formed. 2. Calculation of transition probability matrix  
In the next stage, a feasibility matrix of transitions is computed. The matrix row and column numbers rely on data instances and feature numbers:  
\[P_{A}= \begin{bmatrix}P_{v}&A\\ B&O\end{bmatrix}  \tag{4}\]  
\(P_{v}\) means the probability of the nodes corresponding to the data sample;  
\(A\) means the relation of the data sample with the \(V\)s (feature node);  
\(B\) means the connection of the \(v\) with the sample data;  
\(O\) means that the relation between the \(V\) and \(V\) in the matrix is null because each V is not related to itself. In the next step, an \(R_{A}\) matrix is calculated in the form of a distance matrix based on the neighborhood random walk (NRW) method:  
\[R_{A}^{l}=\sum_{\gamma=1}^{l}C(1-C)^{\gamma}P_{A}^{\gamma} \tag{5}\]  
\[(\gamma=2~{}~{}C=0.2)\]  
\[R_{A}^{2}=0.16P_{A}+0.128~{}P_{A}^{2} \tag{6}\]  
The higher the entry number of the \(R_{A}\) matrix, the closer the two nodes are to each other.