# Research on Intrusion Detection Based on an Enhanced Random Forest Algorithm
## 5 Conclusions  
1. This paper proposes an improved intrusion-detection model based on the Random Forest algorithm, which solves the problem of the high computational complexity, high consumption of storage resources, and low classification accuracy of the traditional Random Forest caused by the characteristics of high data latitude and sample category imbalance in intrusion detection. Using the vulture search algorithm optimized KPCA to complete the data dimensionality reduction, the introduction of a cost-sensitive learning method to the Random Forest, through experiments, verified that the method proposed in this paper has a better performance compared with the traditional method  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Algorithm** & **Acc\%** & **Sen/\%** & **Spe/\%** & **G-Mean** &
\begin{tabular}{c} **Training** \\ **Time** \\ \end{tabular} & **Test Time** \\ \hline Traditional RF model & 93.11 & 99.30 & 87.51 & 0.932 & 23.89 s & 0.87 s \\ Unbalanced ratio method -RF & 97.47 & 98.05 & 96.55 & 0.9730 & 27.46 s & 1.24 s \\ Youden Threshold method -RF & 97.37 & 97.39 & 97.34 & 0.9736 & 25.92 s & 1.28 s \\ Textual algorithm & 98.70 & 98.39 & 99.21 & 0.9880 & 12.57 s & 0.25 s \\ \hline \hline \end{tabular}
\end{table}
Table 4: Classification and comparison of multiple algorithms.  
Figure 6: Classification and comparison of multiple algorithms.  
and can be completed in a shorter period of time for a small number of categories of samples of high-efficiency detection under the premise of a higher accuracy rate.
2. It is experimentally verified that the method proposed in this paper has better performance compared with traditional methods. In terms of data dimensionality reduction, the B-KPCA algorithm takes only 3.69 s more compared to the PCA algorithm and saves 20.68 s and 16.58 s compared to the ISOMAP algorithm and the LLE algorithm, but the accuracy rate is improved by 7.04%, 9.83%, and 3.98%. Considering the accuracy rate and running time together, the B-KPCA algorithm is better in performance. Moreover, the model in this paper improves the accuracy by 5.59%, 1.23%, and 1.33%, the specificity by 11.7%, 2.66%, and 1.87%, the G-mean by 0.0558, 0.0150, and 0.0144, and the training time and testing time by more than half, compared with the traditional RF model, the imbalanced proportion method-RF, and the Youden threshold method-RF. Considering the above factors, the model in this paper more correctly recognizes the minority class samples.
3. However, during the experimental process, it was realized that the model still has some limitations. The evaluation of our study was based on publicly available datasets and was not tested in a real-world environment. Therefore, future work may focus on real-time environment testing, and on the basis of evaluating the model's performance in a laboratory environment, the model will be tested and validated in an actual real-time environment, which will provide more realistic contexts and data to further validate the model's reliability and practicality.  
Methodology, C.L.; Formal analysis, Z.W.; Writing--original draft, Y.C. All authors have read and agreed to the published version of the manuscript.  
This research received no external funding.  
Publicly available datasets were analyzed for this study. These data can be found here: [[https://research.unsw.edu.au/projects/unsw-nb15-dataset](https://research.unsw.edu.au/projects/unsw-nb15-dataset)]([https://research.unsw.edu.au/projects/unsw-nb15-dataset](https://research.unsw.edu.au/projects/unsw-nb15-dataset)) (accessed on 22 December 2023).  
The authors declare no conflict of interest.