Abstract
Machine learning (ML) models are widely used in network intrusion detection systems (NIDS), but deployment in security operations centers requires performance that remains reliable under changing traffic distributions. This study evaluates a 60,193-flow sample of CICIDS2017 comprising 78 flow features and 15 traffic classes using Random Forest (RF), histogram-based Gradient Boosting (HGB), and a Multi-Layer Perceptron (MLP). On a stratified in-domain test set, accuracy ranges from 95.32% to 98.63%, while macro-F1 ranges from 0.7885 to 0.9132.
In a temporal hold-out experiment, models trained on Monday–Wednesday and evaluated on Thursday–Friday without retraining achieve binary macro-F1 scores of 0.5859 (RF) and 0.5091 (HGB), compared with the reported in-domain binary RF macro-F1 of 0.9968. Feature selection using Permutation Importance provides similar levels of performance in terms of training/validation data, however, it does not provide increased robustness to changes over time. Additionally, when Destination Port was removed from the RF top-20 subset, the model did not regain its previous level of performance (Macro-F1 = 0.4987). This demonstrates that while a model can perform well on a stratified benchmark split, this does not guarantee that the model will be robust to changes over time. These results apply only to the sampled CICIDS2017 dataset and the specific experiment design employed.
Keywords
Network Intrusion Detection System (NIDS) Feature Importance Permutation Importance Distribution Shift Temporal Hold-Out CICIDS2017References
- D. Manivannan, “A comprehensive analysis of explainable AI-driven machine learning techniques for network intrusion detection systems,” High-Confidence Comput., vol. 6, no. 4, Art. no. 100423, 2026, doi: 10.1016/j.hcc.2026.100423.
- B. Nugraha, A. V. Jnanashree, and T. Bauschert, “A versatile XAI-based framework for efficient and explainable intrusion detection systems,” Ann. Telecommun., vol. 80, pp. 1095–1120, 2025, doi: 10.1007/s12243-025-01118-9.
- S. Neupane et al., “Explainable intrusion detection systems (X-IDS): A survey of current methods, challenges, and opportunities,” IEEE Access, vol. 10, pp. 112392–112415, 2022, doi: 10.1109/ACCESS.2022.3216617.
- S. Hariharan, R. R. Rejimol Robinson, R. R. Prasad, C. Thomas, and N. Balakrishnan, “XAI for intrusion detection system: Comparing explanations based on global and local scope,” J. Comput. Virol. Hack. Tech., vol. 19, no. 2, pp. 217–239, 2023, doi: 10.1007/s11416-022-00441-2.
- O. Subasi, J. Cree, J. B. Manzano, and E. Peterson, “A critical assessment of interpretable and explainable machine learning for intrusion detection,” arXiv preprint arXiv:2407.04009, 2024. [Online]. Available: https://arxiv.org/abs/2407.04009.
- O. Arreche, T. R. Guntur, J. W. Roberts, and M. Abdallah, “E-XAI: Evaluating black-box explainable AI frameworks for network intrusion detection,” IEEE Access, vol. 12, pp. 23954–23988, 2024.
- S. M. Lundberg and S.-I. Lee, “A unified approach to interpreting model predictions,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), 2017, pp. 4765–4774.
- M. T. Ribeiro, S. Singh, and C. Guestrin, “‘Why should I trust you?’: Explaining the predictions of any classifier,” in Proc. 22nd ACM SIGKDD Int. Conf. Knowl. Discovery Data Mining, 2016, pp. 1135–1144.
- V. Z. Mohale and I. C. Obagbuwa, “Evaluating machine learning-based intrusion detection systems with explainable AI: Enhancing transparency and interpretability,” Front. Comput. Sci., vol. 7, Art. no. 1520741, 2025, doi: 10.3389/fcomp.2025.1520741.
- N. Moustafa and J. Slay, “UNSW-NB15: A comprehensive data set for network intrusion detection systems,” in Proc. Mil. Commun. Inf. Syst. Conf. (MilCIS), 2015, pp. 1–6.
- I. Sharafaldin, A. H. Lashkari, and A. A. Ghorbani, “Toward generating a new intrusion detection dataset and intrusion traffic characterization,” in Proc. 4th Int. Conf. Inf. Syst. Secur. Privacy (ICISSP), 2018, pp. 108–116.
- M. Cantone, C. Marrocco, and A. Bria, “Machine learning in network intrusion detection: A cross-dataset generalization study,” IEEE Access, vol. 12, 2024, doi: 10.1109/ACCESS.2024.3472907.
- C. Kılıç and G. Şengül, “SHAP-guided feature selection for cross-dataset generalization in network intrusion detection systems,” IEEE Access, 2026.
- K. K. Eren, K. Küçük, R. A. A. Saleh, M. Z. Konyar, O. M. Hardy, and S. A. Khan, “Distributional drift in IoT intrusion detection systems: Implications for cross-dataset generalisation,” Electronics, vol. 15, no. 11, Art. no. 2307, 2026, doi: 10.3390/electronics15112307.
- A. Kumar and V. L. L. Thing, “Evaluating the explainability of state-of-the-art deep learning-based network intrusion detection systems,” arXiv preprint arXiv:2408.14040, 2024. [Online]. Available: https://arxiv.org/abs/2408.14040.
- S. M. Lundberg et al., “From local explanations to global understanding with explainable AI for trees,” Nat. Mach. Intell., vol. 2, no. 1, pp. 56–67, Jan. 2020.
- D. Arp et al., “Dos and don’ts of machine learning in computer security,” in Proc. 31st USENIX Secur. Symp., 2022, pp. 3971–3988.
- L. Breiman, “Random forests,” Mach. Learn., vol. 45, no. 1, pp. 5–32, Oct. 2001.
- J. H. Friedman, “Greedy function approximation: A gradient boosting machine,” Ann. Statist., vol. 29, no. 5, pp. 1189–1232, Oct. 2001.
- F. Pedregosa et al., “Scikit-learn: Machine learning in Python,” J. Mach. Learn. Res., vol. 12, pp. 2825–2830, 2011.
- M. Chizari, Q. K. A. Mirza, A. Alam, and H. Chizari, “Closed-set heterogeneous domain adaptation for IoT intrusion detection: An anchor-based benchmark across single- and multi-source transfer,” Sensors, vol. 26, no. 11, Art. no. 3610, 2026, doi: 10.3390/s26113610.