# Connected Vehicles Security: A Lightweight Machine Learning Model to Detect VANET Attacks
## 4 Materials and Methods
### Feature Selection  
Using a suitable feature selection technique is essential to reduce the computational overhead and increase prediction accuracy. Feature selection is a useful technique for lightweight detection models [73]. This procedure greatly improves the performance of classification models by reducing the number of features, considering those that have a strong effect, and ignoring the rest. Feature selection methods can be used for different aspects to enhance prediction--as an example, to eliminate redundant features, [PERSON] et al. [74] proposed a genetic algorithm-based feature selection approach and demonstrated its effectiveness on a real dataset. [PERSON] et al. [75] proposed a feature selection method to reduce the number of features to enhance intrusion detection systems. More relevant work can be seen in [76; 77]. Choosing a computationally efficient feature selection technique would be a wonderful first step towards improving the prediction performance and accuracy when working with VANETs that exhibit rapid changes in topology and fast mobility. The information gain feature selection technique was used in this study. It is a widely used method for choosing pertinent features since it is easy to calculate and comprehend. This method calculates how much the features and the class label depend on one another [78]. It quantifies the amount of information a feature offers to a class. This feature selection technique was implemented using Orange software to compute each feature weight. Accordingly, 61 of 79 features were chosen based on their weights. This technique was employed to identify the most informative features. Only features with considerable weights were selected, whereas the other features were ignored. In our scenario, all features with weights less than 0.1 were dropped. As an example, Table 7 lists the computed weights for the top six features that resulted in the highest weights. Table 8 lists the ignored features with their calculated weights; accordingly, 18 features were dropped.  
\begin{table}
\begin{tabular}{c c} \hline
**Features** & **Weight (Score)** \\ \hline Destination Port & 1.093 \\ \hline Bwd Packet Length Mean & 1.073 \\ \hline Avg Bwd Segment Size & 1.073 \\ \hline Total Length of Bwd Packets & 1.065 \\ \hline Subflow Bwd Bytes & 1.065 \\ \hline Bwd Packet Length Max & 1.053 \\ \hline \end{tabular}
\end{table}
Table 7: Feature Weight.  
\begin{table}
\begin{tabular}{c c c c} \hline
**Feature** & **Weight** & **Feature** & **Weight** \\ \hline FIN Flag Count & 0.093 & CWE Flag Count & 0.000 \\ \hline URG Flag Count & 0.085 & Bwd PSH Flags & 0.000 \\ \hline Fwd PSH Flags & 0.082 & Bwd URG Flags & 0.000 \\ \hline SYN Flag Count & 0.082 & Fwd Avg Bytes Bulk & 0.000 \\ \hline Idle Std & 0.054 & Fwd Avg Packets Bulk & 0.000 \\ \hline Active Std & 0.041 & Fwd Avg Bulk Rate & 0.000 \\ \hline RST Flag Count & 0.000 & Bwd Avg Bytes Bulk & 0.000 \\ \hline ECE Flag Count & 0.000 & Bwd Avg Packets Bulk & 0.000 \\ \hline Fwd URG Flags & 0.000 & Bwd Avg Bulk Rate & 0.000 \\ \hline \end{tabular}
\end{table}
Table 8: The Removed Features.