# A Novel Deep Learning Framework for Intrusion Detection Systems in Wireless Network
## 5 Applying the HRC Strategy to an IDS
### Compare with Other Approaches  
Two popular approaches used for classifications in IDS recently are Bayesian, which was applied in the contributions [21], and histogram gradient boosting, a type of histogram-based ensemble algorithm introduced in the research of [71]. We performed an experiment on these two approaches and obtained the results shown in Figures 20 and 21 and Tables 4 and 5. According to the results in Figure 18 (our proposed strategy) and classification reports in Table 2 (our proposed strategy), the Bayesian model shows the lowest accuracy in prediction, with a score of only about 0.88, compared to the Histogram Gradient Boosting model, which scored nearly 0.99, and our HRC strategy, which scored 0.91. The histogram gradient boosting model, despite reaching the highest accuracy score, has a very low F1 score in the two categories with the fewest sample numbers, Botnet and Evil Twin, while archiving a perfect F1 score in the \"Normal\" category. This happens because the effect of heavily imbalanced data on the model makes the model biased \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Type of Traffic** & **Precision** & **Recall** & **F1 Score** & **Support** \\ \hline Normal & 1.00 & 0.88 & 0.93 & 368,581 \\ \hline Website spoofing & 0.00 & 0.00 & 0.00 & 0 \\ \hline Evil Twin & 0.00 & 0.00 & 0.00 & 0 \\ \hline Botnet & 0.00 & 0.00 & 0.00 & 0 \\ \hline Malware & 0.00 & 0.00 & 0.00 & 0 \\ \hline
**Accuracy** & – & – & 0.88 & 368,581 \\ \hline
**Macro average** & 0.20 & 0.18 & 0.19 & 368,581 \\ \hline
**Weighted** & \multirow{2}{*}{\(1.00\)} & \multirow{2}{*}{\(0.88\)} & \multirow{2}{*}{\(0.93\)} & \multirow{2}{*}{\(368,581\)} \\
**average** & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Classification report of the Bayesian approach. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multicolumn{2}{c}{**Hybrid Model**} & \multirow{2}{*}{**Accuracy**} & \multicolumn{5}{c}{**F1 Score**} & \multirow{2}{*}{**Params**} \\ \hline
**Detector** & **Classifier** & & **Normal** & **WSP** & **ETW** & **BN** & **MW** \\ \hline \multirow{8}{*}{LSTM} & CNN1D & 0.83 & 0.89 & 0.82 & 0.79 & 0.73 & 0.82 & 82,808 \\ \cline{2-8}  & DNN & 0.91 & 0.94 & 0.84 & 0.92 & 0.39 & 0.87 & 244,678 \\ \cline{2-8}  & GRU & 0.91 & 0.94 & 0.84 & 0.92 & 0.39 & 0.87 & 235,908 \\ \cline{2-8}  & LSTM & 0.91 & 0.94 & 0.84 & 0.92 & 0.39 & 0.87 & 316,372 \\ \cline{2-8}  & LR & 0.81 & 0.94 & 0.89 & 0.00 & 0.42 & 0.60 & 234,751 \\ \cline{2-8}  & SVC & 0.91 & 0.94 & 0.84 & 0.85 & 0.69 & 0.87 & 234,751 \\ \cline{2-8}  & XGBoost & 0.73 & 0.92 & 0.10 & 0.29 & 0.05 & 0.00 & 234,775 \\ \hline \multirow{8}{*}{CNN1D} & CNN1D & 0.78 & 0.83 & 0.78 & 0.68 & 0.65 & 0.72 & 15,076 \\ \cline{2-8}  & DNN & 0.90 & 0.94 & 0.88 & 0.88 & 0.44 & 0.77 & 23,828 \\ \cline{2-8}  & GRU & 0.90 & 0.94 & 0.88 & 0.88 & 0.43 & 0.77 & 78,132 \\ \cline{2-8}  & LSTM & 0.90 & 0.94 & 0.97 & 0.79 & 0.67 & 0.77 & 95,540 \\ \cline{2-8}  & LR & 0.90 & 0.94 & 0.90 & 0.79 & 0.75 & 0.77 & 13,919 \\ \cline{2-8}  & SVC & 0.90 & 0.94 & 0.87 & 0.80 & 0.70 & 0.77 & 13,919 \\ \cline{2-8}  & XGBoost & 0.78 & 0.93 & 0.12 & 0.26 & 0.07 & 0.00 & 13,943 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: _Cont._toward the major category, which is very well-known to occur in almost every classification algorithm if no assisting methods are used. Our proposed HRC strategy itself can significantly reduce the bias caused by this problem without requiring assisting methods or modifying the data ratio, thus showing an advantage over the other approaches. This is one of the two primary goals of our contribution. The aim is to increase the prediction accuracy among categories in the case of imbalanced data. Therefore, despite the overall accuracy of the prediction not reaching an excellent score, the strategy helps significantly reduce the prediction gap (Precision, Recall, and F1 score) between the minor categories (in our experiment, the Botnet and Evil twins) and the overwhelming major Normal category.