Abstract
The Intrusion Detection Systems (IDSs) are very important tools for defending a network against emerging cyber threats. This study proposes the hybrid intrusion detection system model of extreme gradient boosting (XGBoost) and KMeans++ clustering algorithm to balance the trade-off between accuracy, efficiency, and robustness in detecting malicious traffic. XGBoost algorithms are good for structured problems where classification problems occur, whereas KMeans++ helps you to get more clustering accuracy by helping centroid initialization. For enhancing the performance of the model some feature extraction steps and data preprocessing steps like normalization, encoding, Synthetic Minority Over-sampling Technique (SMOTE) based imbalance data balancing were considered. The system was trained and validated on Canadian Institute for Cybersecurity Intrusion Detection System (CICIDS) 2017 and put to test in various metrics: accuracy, precision, recall, F1-score, ROC-AUC and false positive rate. Comparative analysis was performed using traditional machine learning models such as SVM, Decision Tree, Random Forest, Naive Bayes and deep learning architectures which include CNN, LSTM and Auto-Encoder. It was found to be high detection accuracy of 99.87% with very low FPR by far i.e. 0.1%. The model provided high recall and precision in different types of attack and successful overfitting resistance could be confirmed using 10-fold cross-validation, XGBoost regularization and structure clustering. This work shall play an important role in improving hybrid models to minimize alert fatigue with trustworthy threat classification in the real operational traffic.
Keywords
Intrusion Detection Systems, XGBoost, KMeans , CICIDS2017, CNN, RNN, LSTM, SVM,Downloads
References
- E.U.H. Qazi, M.H. Faheem, T. Zia, HDLNIDS: Hybrid Deep-Learning-Based Network Intrusion Detection System. Applied Sciences, 13(8), (2023) 4921. https://doi.org/10.3390/app13084921
- M. Boutassetta, A. Makhlouf, N. Messaoudi, A. Benmachiche, I. Boutabia (2026). Hybrid IDS Using Signature-Based and Anomaly-Based Detection. arXiv preprint arXiv:2601.11998. https://doi.org/10.48550/arXiv.2601.11998
- P.M.S. Makhdoomi, M. Ikhlas, A. Khursheed, F. Hilal, Z. Ahmad Najar, J. Hameed, S. Sharma, Network-Based Intrusion Detection: a Comparative Analysis of Machine Learning Approaches for Improved Security. Journal of Cyber Security Technology, 10(1), (2026) 1-28. https://doi.org/10.1080/23742917.2024.2447119
- S.B. Sharma, A.K. Bairwa (2025). Leveraging AI for Intrusion Detection in IOT Ecosystems: a Comprehensive Study. IEEE Access, IEEE, 13, (2025) 66290-66317. https://doi.org/10.1109/ACCESS.2025.3550392
- I.F. Kilincer, F. Ertam, A. Sengur, A Comprehensive Intrusion Detection Framework Using Boosting Algorithms. Computers & Electrical Engineering, 100, (2022) 107869. https://doi.org/10.1016/j.compeleceng.2022.107869
- A. Sagu, N.S. Gill, P. Gulia, P.K. Shukla, A. Sabry, M.M. Hassan, Scalable and Interpretable Deep Learning‐Based Intrusion Detection Framework for Secure Internet of Things Networks. Security and Privacy, 9(1), (2026) e70179. https://doi.org/10.1002/spy2.70179
- A. Paya, S. Arroni, V. García-Díaz, A. Gómez, Apollon: A Robust Defense System against Adversarial Machine Learning Attacks in Intrusion Detection Systems. Computers & Security, 136, (2024) 103546. https://doi.org/10.1016/j.cose.2023.103546
- P.R. Kanna, P. Santhi, Hybrid Intrusion Detection using Mapreduce based Black Widow Optimized Convolutional Long Short-Term Memory Neural Networks. Expert Systems with Applications, 194, (2022) 116545. https://doi.org/10.1016/j.eswa.2022.116545
- A. Alharthi, M. Alaryani, S. Kaddoura A comparative study of machine learning and deep learning models in binary and multiclass classification for intrusion detection systems. Array, 26, (2025) 100406. https://doi.org/10.1016/j.array.2025.100406
- Z.I. Khan, M.M. Afzal, K.N. Shamsi, A Comprehensive Study on CIC-IDS2017 Dataset for Intrusion Detection Systems. International Research Journal of Advanced Engineering Hub, 2(02), (2024) 254–260.
- L. Ashiku, C. Dagli, Network Intrusion Detection System using Deep Learning. Procedia Computer Science, 185, (2021) 239–247. https://doi.org/10.1016/j.procs.2021.05.025
- Y. Pourardebil Khah, M. Hosseini Shirvani, H. Motameni A Hybrid Machine Learning Approach For Feature Selection In Designing Intrusion Detection Systems (IDS) Model For Distributed Computing Networks. The Journal of Supercomputing, 81(1), (2025) 1–49. https://doi.org/10.1007/s11227-024-06677-7
- M. Sajid, K.R. Malik, A. Almogren, T.S. Malik, A.H. Khan, J. Tanveer, A.U. Rehman, Enhancing intrusion detection: A hybrid machine and deep learning approach. Journal of Cloud Computing, 13(1), (2024) 123. https://doi.org/10.1186/s13677-024-00685-x
- J. Huang, Z. Chen, S. Z. Liu, H. Zhang, H.X. Long, Improved Intrusion Detection based on Hybrid Deep Learning Models and Federated Learning. Sensors, 24(12), (2024) 4002. https://doi.org/10.3390/s24124002
- A. Fenjan, M.T. Almashhadany, S.R. Ahmed, H.A. Fadel, R. Sekhar, P. Shah, B.S. Veena, Adaptive intrusion detection system using deep learning for network security. In Proceedings of the Cognitive Models and Artificial Intelligence Conference, (2024) 279–284. https://doi.org/10.1145/3660853.3660928
- H.M. Saleh, H. Marouane, A. Fakhfakh Stochastic gradient descent intrusion detection for wireless sensor network attack detection system using machine learning. IEEE Access, 12, (2024) 3825–3836. https://doi.org/10.1109/ACCESS.2023.3349248
- X. Chen, W. Qiu, L. Chen, Y. Ma, J. Ma Fast and practical intrusion detection System based on Federated Learning for VANET. Computers & Security, 142, (2024) 103881. https://doi.org/10.1016/j.cose.2024.103881
- A. A. Najar A robust DDoS intrusion detection system using a convolutional neural network. Computers & Electrical Engineering, 117, (2024) 109277. https://doi.org/10.1016/j.compeleceng.2024.109277
- R. Mohammad, F. Saeed, A.A. Almazroi, F.S. Alsubaei, A.A. Almazroi, Enhancing intrusion detection systems using a deep learning and data augmentation approach. Systems, 12(3), (2024) 79. https://doi.org/10.3390/systems12030079
- X. Gou, M. G. Johar, J. Tham, Network intrusion monitoring based on margin distance pruning and RF algorithm. Results in Engineering, 26, (2025) 104769. https://doi.org/10.1016/j.rineng.2025.104769
- U. Ahmed, M. Nazir, A. Sarwar, T. Ali, E. H. Aggoune, T. Shahzad, M. A. Khan, Signature-based intrusion detection using machine learning and deep learning approaches empowered with fuzzy clustering. Scientific Reports, 15(1), (2025) 1726. https://doi.org/10.1038/s41598-025-85866-7
- K.C. Santos, R.S. Miani, F. de Oliveira Silva, Evaluating the impact of data preprocessing techniques on the performance of intrusion detection systems. Journal of Network and Systems Management, 32(2), (2024) 36. https://doi.org/10.1007/s10922-024-09813-z
- A.O. Widodo, B. Setiawan, R. Indraswari, Machine learning-based intrusion detection on multiclass imbalanced dataset using SMOTE. Procedia Computer Science, 234, (2024) 578–583. https://doi.org/10.1016/j.procs.2024.03.042
- J. Li, M.S. Othman, H. Chen, Optimizing IoT intrusion detection system: Feature selection versus feature extraction in machine learning. Journal of Big Data, 11(1), (2024) 36. https://doi.org/10.1186/s40537-024-00892-y
- I. Sharafaldin, A. Habibi Lashkari, A.A. Ghorbani, A detailed analysis of the cicids2017 data set. In International conference on information systems security and privacy, (2018) 172-188. https://doi.org/10.1007/978-3-030-25109-3_9
- N. Alsabilah, D.B. Rawat, Joint rough set theory and XGBoost based Learning for Network Intrusion Detection System. IEEE Internet of Things Journal, IEEE, 12(7), (2025) 7930-7937. https://doi.org/10.1109/JIOT.2025.3528452
- G.S. Fuhnwi, M. Revelle, C. Izurieta, Improving Network Intrusion Detection Performance: An Empirical Evaluation using Extreme Gradient Boosting (XGBoost) with Recursive Feature Elimination. In 2024 IEEE 3rd International Conference on AI in Cybersecurity (ICAIC), (2024) 1–8. https://doi.org/10.1109/ICAIC60265.2024.10433805
- M. Mynuddin, S.U. Khan, Z.U. Chowdhury, F. Islam, M.J. Islam, M.I. Hossain, D.M. Ahad, Automatic Network Intrusion Detection System using Machine Learning and Deep Learning. In 2024 IEEE International Conference on Artificial Intelligence and Mechatronics Systems (AIMS), (2024) 1–9. https://doi.org/10.1109/AIMS61812.2024.10512607
- N. Nigar, R. Mustafa, Enhanced Intrusion Detection via Hybrid Data Resampling and Feature Optimization. IEEE Access, 13, (2025) 149100-149120. https://doi.org/10.1109/ACCESS.2025.3602562
- R. Panigrahi, S. Borah, A Detailed Analysis of CICIDS2017 Dataset for Designing Intrusion Detection Systems. International Journal of Engineering & Technology, 7(3.24), (2018) 479–482.
- X. Hu, X. Meng, S. Liu, L. Liang, An Improved Algorithm for Network Intrusion Detection Based on Deep Residual Networks. IEEE Access, 12, (2024) 66432-66441. https://doi.org/10.1109/ACCESS.2024.3398007
- J. Henriques, F. Caldeira, T. Cruz, P. Simoes, Combining K-means and Xgboost Models for Anomaly Detection using Log Datasets. Electronics, 9(7), (2020) 1164. https://doi.org/10.3390/electronics9071164
Articles

