Dataset-Sensitive Evaluation of Classical Machine Learning Models for Binary Intrusion Detection Using NSL-KDD, CICIDS2017 and UNSW-NB15

Authors

DOI:

https://doi.org/10.33003/fjs-2026-1023-6436

Keywords:

Intrusion, Machine Learning, Random Forest, NSL-KDD, CICIDS2017, UNSW-NB15

Abstract

Machine learning (ML) is an important approach to network intrusion detection, although classifier performance varies across datasets and evaluation conditions. This study compares three classical ML classifiers, Decision Tree (DT), Random Forest (RF), and Support Vector Machine (SVM) with a radial basis function (RBF) kernel, for binary intrusion detection using the NSL-KDD, CICIDS2017, and UNSW-NB15 datasets. Normal and attack traffic were represented as classes 0 and 1, respectively. NSL-KDD and UNSW-NB15 were evaluated using their predefined training and testing partitions, while CICIDS2017 was randomly sampled to 500,000 records, cleaned to 499,478 records, and divided using a stratified 80:20 split. Each model was evaluated over five runs using the same data partitions, with different random seeds where applicable. Performance was measured using accuracy, macro precision, macro recall, macro F1-score, weighted F1-score, false alarm rate (FAR), training time, and testing time. DT achieved the highest accuracy on NSL-KDD (79.39%), while RF performed best on UNSW-NB15 (87.08%) and CICIDS2017 (99.88%). RF recorded the lowest FAR on NSL-KDD (2.72%) and CICIDS2017 (0.0676%), whereas DT achieved the lowest on UNSW-NB15 (24.92%). DT generally had the shortest training time, while SVM incurred the highest computational cost, particularly on CICIDS2017 (4,627.49 seconds) and UNSW-NB15 (1,687.92 seconds). The findings indicate that classifier performance and computational requirements are dataset-dependent, highlighting the need to consider both predictive effectiveness and computational efficiency when selecting intrusion detection models.

References

Ahmad, M., Riaz, Q., Zeeshan, M., Tahir, H., Haider, S. A., & Khan, M. S. (2021). Intrusion detection in Internet of Things using supervised machine learning based on application and transport layer features using UNSW-NB15 data-set. EURASIP Journal on Wireless Communications and Networking, 2021, Article 10. https://doi.org/10.1186/s13638-021-01893-8

Al-Imran, M., & Ripon, S. H. (2021). Network intrusion detection: An analytical assessment using deep learning and state-of-the-art machine learning models. International Journal of Computational Intelligence Systems, 14, Article 200. https://doi.org/10.1007/s44196-021-00047-4

Al-Riyami, S., Lisitsa, A., & Coenen, F. (2021). Cross-datasets evaluation of machine learning models for intrusion detection systems. In X.-S. Yang, S. Sherratt, N. Dey, & A. Joshi (Eds.), Proceedings of the 6th International Congress on Information and Communication Technology (ICICT 2021) (pp. 815–828). Springer. https://doi.org/10.1007/978-981-16-2102-4_73

Alharthi, A., Alaryani, M., & Kaddoura, S. (2025). A comparative study of machine learning and deep learning models in binary and multiclass classification for intrusion detection systems. Array, 26, 100406. https://doi.org/10.1016/j.array.2025.100406

Bace, R., & Mell, P. (2001). Intrusion detection systems (NIST Special Publication 800-31). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-31

Buczak, A. L., & Guven, E. (2016). A survey of data mining and machine learning methods for cyber security intrusion detection. IEEE Communications Surveys & Tutorials, 18(2), 1153–1176. https://doi.org/10.1109/COMST.2015.2494502

Canadian Institute for Cybersecurity. (n.d.). Intrusion detection evaluation dataset (CIC-IDS2017). University of New Brunswick. https://www.unb.ca/cic/datasets/ids-2017.html

Gao, X., Shan, C., Hu, C., Niu, Z., & Liu, Z. (2019). An adaptive ensemble machine learning model for intrusion detection. IEEE Access, 7, 82512–82521. https://doi.org/10.1109/ACCESS.2019.2923640

Gamage, S., & Samarabandu, J. (2020). Deep learning methods in network intrusion detection: A survey and an objective comparison. Journal of Network and Computer Applications, 169, 102767. https://doi.org/10.1016/j.jnca.2020.102767

Hakke, D. G., Dixit, A. Y., Thorat, S., Malande, G. S., & Panpatte, A. K. (2025). Performance evaluation of machine learning-based intrusion detection using NSL-KDD, UNSW-NB15 and CICIDS2017 datasets. International Journal of Applied Mathematics, 38(3S), 447–469. https://doi.org/10.12732/ijam.v38i3s.160

Khalifa, S. M. M. M. (2025). NSL-KDD dataset [Data set]. Zenodo. https://doi.org/10.5281/zenodo.17424143

Le Jeune, L., Goedemé, T., & Mentens, N. (2021). Machine learning for misuse-based network intrusion detection: Overview, unified evaluation and feature choice comparison framework. IEEE Access, 9, 63995–64015. https://doi.org/10.1109/ACCESS.2021.3075066

Maseer, Z. K., Yusof, R., Bahaman, N., Mostafa, S. A., & Foozy, C. F. M. (2021). Benchmarking of machine learning for anomaly-based intrusion detection systems in the CICIDS2017 dataset. IEEE Access, 9, 22351–22370. https://doi.org/10.1109/ACCESS.2021.3056614

Moustafa, N., & Slay, J. (2015). UNSW-NB15: A comprehensive data set for network intrusion detection systems (UNSW-NB15 network data set). In 2015 Military Communications and Information Systems Conference (MilCIS) (pp. 1–6). IEEE. https://doi.org/10.1109/MilCIS.2015.7348942

mrwellsdavid. (n.d.). UNSW_NB15 [Data set]. Kaggle. https://www.kaggle.com/datasets/mrwellsdavid/unsw-nb15

Scarfone, K. A., & Mell, P. M. (2007). Guide to intrusion detection and prevention systems (IDPS) (NIST Special Publication 800-94). National Institute of Standards and Technology. https://doi.org/10.6028/NIST.SP.800-94

Sharafaldin, I., Lashkari, A. H., & Ghorbani, A. A. (2018). Toward generating a new intrusion detection dataset and intrusion traffic characterization. In Proceedings of the 4th International Conference on Information Systems Security and Privacy (ICISSP 2018) (Vol. 1, pp. 108–116). SCITEPRESS. https://doi.org/10.5220/0006639801080116

Tavallaee, M., Bagheri, E., Lu, W., & Ghorbani, A. A. (2009). A detailed analysis of the KDD CUP 99 data set. In 2009 IEEE Symposium on Computational Intelligence for Security and Defense Applications (pp. 1–6). IEEE. https://doi.org/10.1109/CISDA.2009.5356528

Tripathy, S. S., & Behera, B. (2024). A review of various datasets for machine learning algorithm-based intrusion detection system: Advances and challenges. International Journal of Intelligent Systems and Applications in Engineering, 12(4), 3833–3857. https://www.ijisae.org/index.php/IJISAE/article/view/6936

University of New Brunswick. (2017). CICIDS2017 dataset. Retrieved from https://www.unb.ca/cic/datasets/ids-2017.html

Experimental workflow for the comparative evaluation of machine learning models for intrusion detection

Downloads

Published

04-12-2026

How to Cite

Chijioke, N. S., & Olayinka, T. C. (2026). Dataset-Sensitive Evaluation of Classical Machine Learning Models for Binary Intrusion Detection Using NSL-KDD, CICIDS2017 and UNSW-NB15. FUDMA Journal of Sciences, 10(23SI), 217-226. https://doi.org/10.33003/fjs-2026-1023-6436

Most read articles by the same author(s)