Comparative analysis of machine learning models for network intrusion detection: a focus on execution speed and performance

Authors

  • Idris Ibraheem
  • Muhammad Tijjani Jidda
  • Ahmed Abiodun Abdulrasaq
  • Samuel Kwabla Segbefia

DOI:

https://doi.org/10.53704/

Keywords:

Network Intrusion Detection System (NIDS), Machine Learning, XGBoost, Random Forest, Support Vector Machines, Cybersecurity

Abstract

As cyber threats grow more complex, the need for Network Intrusion Detection Systems (NIDS) that are effective and capable of real-time processing becomes inevitable. Traditional rule-based systems are effective against known threats; however, they tend to struggle with novel and more sophisticated attacks. This study evaluates three widely used machine learning models, Random Forest (RF), XGBoost, and Support Vector Machines (SVM), to identify an optimal balance between detection accuracy and computational efficiency. Using the UNSW-NB15 dataset and feature selection based on XGBoost’s importance ranking, this study compares these models across accuracy, precision, recall, F1-score, and execution time. The results show that an optimised XGBoost model achieved the highest accuracy (87.18%), the lowest training time (35.2s), and a prediction time of 0.16s, making it an effective practical choice for real-time NIDS deployments. Random Forest achieved comparable accuracy (86.95%) but at a higher computational cost, whereas SVM’s high computational cost makes it unsuitable for large-scale use. Feature Importance Analysis shows packet duration, source/destination bytes, and TCP flags as key indicators of network intrusion. These findings provide critical insights for cybersecurity practitioners focusing on efficient, adaptive threat detection. Hyperparameter optimisation for XGBoost was performed via grid search; the absence of k-fold cross-validation across all models is acknowledged as a scope limitation. Future work will explore deep learning architectures, hybrid models, and adversarial defence mechanisms to further advance NIDS performance.

References

1. Jacob SL, Habibullah PS. A systematic analysis and review on intrusion detection systems using machine learning and deep learning algorithms. J Comput Cogn Eng. 2024. doi:10.47852/bonviewJCCE42023249.

2. Alzahrani AO, Alenazi MJF. Designing a network intrusion detection system based on machine learning for software defined networks. Future Internet. 2021. doi:10.3390/fi13050111.

3. Golande SV, Sanket V, Aniket P, Vivekanand K, Vedant P. An efficient network intrusion detection and classification system using machine learning. Int J Adv Res Sci Commun Technol. 2024. doi:10.48175/IJARSCT-22045.

4. Leon M, Tijana M, Punnekkat S. Comparative evaluation of machine learning algorithms for network intrusion detection and attack classification. IEEE Int Joint Conf Neural Netw. 2022. doi:10.1109/IJCNN55064.2022.9892293.

5. Hossain A, Islam S. Ensuring network security with a robust intrusion detection system using ensemble-based machine learning. Array. 2023. doi:10.1016/j.array.2023.100306.

6. Himthani P, Dubey GP. Application of machine learning techniques in intrusion detection systems: a systematic review. In: Proceedings of the Third International Conference on Sustainable Computing (SUSCOM 2021). Singapore: Springer Nature; 2022. p. 97–105. doi:10.1007/978-981-16-4538-9_10.

7. Talukder A, Islam M, Uddin A, Hasan KF, Sharmin S. Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction. J Big Data. 2024. doi:10.1186/s40537-024-00886-w.

8. Zhang C, Jia D, Wang L, Wang W, Liu F. Comparative research on network intrusion detection methods based on machine learning. Comput Secur. 2022. doi:10.1016/j.cose.2022.102861.

9. Maseer ZK, Yusof R, Bahaman N, Mostafa SA, Mohd Foozy CF. Benchmarking of machine learning for anomaly-based intrusion detection systems in the CICIDS2017 dataset. IEEE Access. 2021. doi:10.1109/ACCESS.2021.3056614.

10. Rege PR, Aarti K, Anishkumar D, Rahul S, Rupali SK. Exploring machine learning's role in intrusion detection systems for network security. In: 2024 International Conference on Emerging Smart Computing and Informatics (ESCI). 2024. doi:10.1109/ESCI59607.2024.10497357.

11. Sun Y, Liu Z, Li G, Wang H. A hybrid CNN–LSTM model for network intrusion detection. IEEE Access. 2020;8:137361–137371. doi:10.1109/ACCESS.2020.3009843.

12. Alashjaee AM. Deep learning for network security: an Attention-CNN-LSTM model for accurate intrusion detection. Sci Rep. 2025;15:21856. doi:10.1038/s41598-025-07706-y.

13. Zhang Y, Muniyandi RC, Qamar F. A review of deep learning applications in intrusion detection systems: overcoming challenges in spatiotemporal feature extraction and data imbalance. Appl Sci. 2025;15(3):1552. doi:10.3390/app15031552.

14. Sajid M, Malik KR, Almogren A, Malik TS, Khan AH, Tanveer J, Rehman AU. Enhancing intrusion detection: a hybrid machine and deep learning approach. J Cloud Comput. 2024;13(1):123. doi:10.1186/s13677-024-00685-x.

15. Buyuktanir B, Altinkaya ?, Karatas Baydogmus G, et al. Federated learning in intrusion detection: advancements, applications, and future directions. Clust Comput. 2025;28:473. doi:10.1007/s10586-025-05325-w.

16. Hernandez-Ramos JL, Karopoulos G, Chatzoglou E, Kouliaridis V, Marmol E, Gonzalez-Vidal A, Kambourakis G. Intrusion detection based on federated learning: a systematic review. ACM Comput Surv. 2025;57(12):1–65. doi:10.1145/3731596.

17. Agrawal S, Sarkar S, Aouedi O, Yenduri G, Piamrat K, Alazab M, et al. Federated learning for intrusion detection system: concepts, challenges and future directions. Comput Commun. 2022;195:346–361. doi:10.48550/arXiv.2106.09527.

18. Ghosh S, Jameel ASMM, Gamal AE. FetFIDS: a feature embedding attention-based federated network intrusion detection algorithm. arXiv Preprint. 2025. arXiv:2508.09056. doi:10.48550/arXiv.2508.09056.1. Jacob SL, Habibullah PS. A systematic analysis and review on intrusion detection systems using machine learning and deep learning algorithms. J Comput Cogn Eng. 2024. doi:10.47852/bonviewJCCE42023249.

2. Alzahrani AO, Alenazi MJF. Designing a network intrusion detection system based on machine learning for software defined networks. Future Internet. 2021. doi:10.3390/fi13050111.

3. Golande SV, Sanket V, Aniket P, Vivekanand K, Vedant P. An efficient network intrusion detection and classification system using machine learning. Int J Adv Res Sci Commun Technol. 2024. doi:10.48175/IJARSCT-22045.

4. Leon M, Tijana M, Punnekkat S. Comparative evaluation of machine learning algorithms for network intrusion detection and attack classification. IEEE Int Joint Conf Neural Netw. 2022. doi:10.1109/IJCNN55064.2022.9892293.

5. Hossain A, Islam S. Ensuring network security with a robust intrusion detection system using ensemble-based machine learning. Array. 2023. doi:10.1016/j.array.2023.100306.

6. Himthani P, Dubey GP. Application of machine learning techniques in intrusion detection systems: a systematic review. In: Proceedings of the Third International Conference on Sustainable Computing (SUSCOM 2021). Singapore Springer Nature; 2022. p. 97–105. doi:10.1007/978-981-16-4538-9_10.

7. Talukder A, Islam M, Uddin A, Hasan KF, Sharmin S. Machine learning-based network intrusion detection for big and imbalanced data using oversampling, stacking feature embedding and feature extraction. J Big Data. 2024. doi:10.1186/s40537-024-00886-w.

8. Zhang C, Jia D, Wang L, Wang W, Liu F. Comparative research on network intrusion detection methods based on machine learning. Comput Secur. 2022. doi:10.1016/j.cose.2022.102861.

9. Maseer ZK, Yusof R, Bahaman N, Mostafa SA, Mohd Foozy CF. Benchmarking of machine learning for anomaly-based intrusion detection systems in the CICIDS2017 dataset. IEEE Access. 2021. doi:10.1109/ACCESS.2021.3056614.

10. Rege PR, Aarti K, Anishkumar D, Rahul S, Rupali SK. Exploring machine learning's role in intrusion detection systems for network security. In: 2024 International Conference on Emerging Smart Computing and Informatics (ESCI). 2024. doi:10.1109/ESCI59607.2024.10497357.

11. Sun Y, Liu Z, Li G, Wang H. A hybrid CNN–LSTM model for network intrusion detection. IEEE Access. 2020;8:137361–137371. doi:10.1109/ACCESS.2020.3009843.

12. Alashjaee AM. Deep learning for network security: an Attention-CNN-LSTM model for accurate intrusion detection. Sci Rep. 2025;15:21856. doi:10.1038/s41598-025-07706-y.

13. Zhang Y, Muniyandi RC, Qamar F. A review of deep learning applications in intrusion detection systems: overcoming challenges in spatiotemporal feature extraction and data imbalance. Appl Sci. 2025;15(3):1552. doi:10.3390/app15031552.

14. Sajid M, Malik KR, Almogren A, Malik TS, Khan AH, Tanveer J, Rehman AU. Enhancing intrusion detection: a hybrid machine and deep learning approach. J Cloud Comput. 2024;13(1):123. doi:10.1186/s13677-024-00685-x.

15. Buyuktanir B, Altinkaya ?, Karatas Baydogmus G, et al. Federated learning in intrusion detection: advancements, applications, and future directions. Clust Comput. 2025;28:473. doi:10.1007/s10586-025-05325-w.

16. Hernandez-Ramos JL, Karopoulos G, Chatzoglou E, Kouliaridis V, Marmol E, Gonzalez-Vidal A, Kambourakis G. Intrusion detection based on federated learning: a systematic review. ACM Comput Surv. 2025;57(12):1–65. doi:10.1145/3731596.

17. Agrawal S, Sarkar S, Aouedi O, Yenduri G, Piamrat K, Alazab M, et al. Federated learning for intrusion detection system: concepts, challenges and future directions. Comput Commun. 2022;195:346–361. doi:10.48550/arXiv.2106.09527.

18. Ghosh S, Jameel ASMM, Gamal AE. FetFIDS: a feature embedding attention-based federated network intrusion detection algorithm. arXiv Preprint. 2025. arXiv:2508.09056. doi:10.48550/arXiv.2508.0

Downloads

Published

2026-09-16

How to Cite

Comparative analysis of machine learning models for network intrusion detection: a focus on execution speed and performance. (2026). Fountain Journal of Natural and Applied Sciences, 15(1). https://doi.org/10.53704/

Similar Articles

1-10 of 38

You may also start an advanced similarity search for this article.