Enhanced Network Intrusion Detection and Classification based on Ensemble Learning Techniques: A Study on the NSL-KDD Dataset

Ammar Adel Aladel, Mahmood Mohammed Mahmood, Omer Aldhbbagh

Abstract


This research explores an improved Network Intrusion Detection System (NIDS) on the NSL-KDD dataset using machine learning, deep learning and ensemble learning methods. Our approach involves essential steps such as data preparation, feature engineering with Random Forest, feature reduction, model building, hyperparameter tuning with GridSearchCV, and evaluation. We perform binary and multiclass classification tasks with Naïve Bayes, Logistic Regression, Random Forest, LightGBM, CNN, and LSTM approaches. The findings show ensemble techniques enhance classification accuracy. Random Forest and LightGBM models in binary classification, and CNN and LSTM models in multiclass classification achieved up to 99% and 97.99% and 97.80% accuracy, respectively. Additionally, the proposed stacked ensemble model, with XGBoost as the meta-learner, achieved a final test accuracy of 99.03%, and improved precision, recall, F1-score and ROC-AUC compared to the individual models. Tuning the hyperparameters also improved model stability and accuracy. This research is novel in combining feature selection, hyperparameter-tuned deep learning models and a stacking ensemble to enhance accuracy and stability in intrusion detection. The research also emphasizes the need for interpretability, real-time considerations and transfer learning in future NIDS research.

Keywords


GridSearchCV; hyper parameter tuning; machine learning; network intrusion detection system (NIDS); NSL-KDD dataset

Full Text:

PDF

References


K. R. Alesawi and A. H. Alawadi, “Enhancing Ddos Attack Classification Through Sdn and Machine Learning: a Feature Ranking Analysis,” Kufa J. Eng., Vol. 16, No. 2, pp. 344–366, 2025.

A. Sohail, B. Ayisha, I. Hameed, M. M. Zafar, and A. Khan, “Deep Neural Networks based Meta-Learning for Network Intrusion Detection,” No. February, 2023.

V. Z. Mohale and I. C. Obagbuwa, “A Systematic Review on the Integration of Explainable Artificial Intelligence in intrusion detection systems to enhancing transparency and interpretability in Cybersecurity,” No. January, pp. 1–10, 2025.

M. E. Kahou, J. Yu, J. Perla, and G. Pleiss, “How Inductive Bias in Machine Learning Aligns with Optimality in Economic Dynamics,” arXiv:2406.01898v1, 2024.

I. H. Sarker, H. Janicke, A. Mohsin, A. Gill, and L. Maglaras, “Explainable AI for Cybersecurity Automation, Intelligence and Trustworthiness in Digital Twin: Methods, Taxonomy, Challenges and Prospects,” ICT Express, Vol. 10, No. 4, pp. 935–958, 2024.

S. D. A. Rihan, M. Anbar, and B. A. Alabsi, “Meta-Learner-based Approach for Detecting Attacks on Internet of Things Networks,” Sensors, Vol. 23, No. 19, pp. 1–22, 2023.

B. M. Lake and M. Baroni, “Human-Like Systematic Generalization Through a Meta-Learning Neural Network,” Nature, Vol. 623, No. 7985, pp. 115–121, 2023.

M. sohail Khan, K. DoHyeun, and F. Tila, “Enhanced IoT Composition Architecture based on DIY Business Process Modeling: CoAP based Prototype,” VFAST Trans. Softw. Eng., Vol. 10, No. 2, pp. 61–69, 2022.

N. Dat-Thinh, H. Xuan-Ninh, and L. Kim-Hung, “MidSiot: A Multistage Intrusion Detection System for Internet of Things,” Wirel. Commun. Mob. Comput., Vol. 2022, No. December 2017, 2022.

K. Albulayhi and F. T. Sheldon, “An Adaptive Deep-Ensemble Anomaly-based Intrusion Detection System for the Internet of Things,” 2021 IEEE World AI IoT Congr. AIIoT 2021, No. May 2021, pp. 187–196, 2021.

J. Yang, C. Zhou, S. Yang, H. Xu, and B. Hu, “Anomaly Detection based on Zone Partition for Security Protection of Industrial Cyber-Physical Systems,” IEEE Trans. Ind. Electron., Vol. 65, No. 5, pp. 4257–4267, 2018.

K. Albulayhi, A. A. Smadi, F. T. Sheldon, and R. K. Abercrombie, “Iot Intrusion Detection Taxonomy, Reference Architecture, and Analyses,” Sensors, Vol. 21, No. 19, 2021.

H. Alrubayyi, G. Goteng, M. Jaber, and J. Kelly, “Challenges of Malware Detection in the IoT and a Review of Artificial Immune System Approaches,” J. Sens. Actuator Networks, Vol. 10, No. 4, 2021.

T.-A. Review, A. M. Shhatha, and O. I. Alsaif, “A Comprehensive Analysis of Approaches and Difficulties for Cybersecurity a Comprehensive Analysis of Approaches and Difficulties for Cybersecurity Threats- Article Review,” No. September, 2024.

M. A. Ambusaidi, X. He, P. Nanda, and Z. Tan, “Building an Intrusion Detection System using a Filter-based Feature Selection Algorithm,” IEEE Trans. Comput., Vol. 65, No. 10, pp. 2986–2998, 2016.

S. Jose, D. Malathi, B. Reddy, and D. Jayaseeli, “A Survey on Anomaly based Host Intrusion Detection System,” J. Phys. Conf. Ser., Vol. 1000, No. 1, 2018.

A. Al-Taie and W. R. Baiee, “A Comprehensive Study of Deep Learning Approaches for Predicting Reciprocal Traffic Dynamics and Climate Variability,” Kufa J. Eng., Vol. 16, No. 3, pp. 22–42, 2025.

S. P. K. Gudla, S. K. Bhoi, S. R. Nayak, K. K. Singh, A. Verma, and I. Izonin, “A Deep Intelligent Attack Detection Framework for Fog-based IoT Systems,” Comput. Intell. Neurosci., Vol. 2022, pp. 1–25, 2022.

Y. Zhou, G. Cheng, S. Jiang, and M. Dai, “Building an Efficient Intrusion Detection System based on Feature Selection and Ensemble Classifier,” Comput. Networks, Vol. 174, 2020.

T. Su, H. Sun, J. Zhu, S. Wang, and Y. Li, “BAT: Deep Learning Methods on Network Intrusion Detection using NSL-KDD Dataset,” IEEE Access, Vol. 8, pp. 29575–29585, 2020.

Y. V. Kumar and K. Kamatchi, “Anomaly based Network Intrusion Detection using Ensemble Machine Learning Technique,” en. Int. J. Res. Eng. …, Vol. 6, No. 4, pp. 216–220, 2020.

S. Rajagopal, P. P. Kundapur, and K. S. Hareesha, “A Stacking Ensemble for Network Intrusion Detection using Heterogeneous Datasets,” Secur. Commun. Networks, Vol. 2020, 2020.

R. Qaddoura, A. M. Al-Zoubi, I. Almomani, and H. Faris, “A Multi-Stage Classification Approach for IoT Intrusion Detection based on Clustering with Oversampling,” Appl. SCI., Vol. 11, No. 7, 2021.

H. Alkahtani and T. H. H. Aldhyani, “Intrusion Detection System to Advance Internet of Things Infrastructure-based Deep Learning Algorithms,” Complexity, Vol. 2021, 2021.

K. A. ElDahshan, A. A. A. AlHabshy, and B. I. Hameed, “Meta-Heuristic Optimization Algorithm-based Hierarchical Intrusion Detection System,” Computers, Vol. 11, No. 12, 2022.

N. Thockchom, M. M. Singh, and U. Nandi, “A Novel Ensemble Learning-based Model for Network Intrusion Detection,” Complex Intell. Syst., Vol. 9, No. 5, pp. 5693–5714, 2023.

J. Jose and D. V. Jose, “Deep Learning Algorithms for Intrusion Detection Systems in Internet of Things using CIC-IDS 2017 Dataset,” Int. J. Electr. Comput. Eng., Vol. 13, No. 1, pp. 1134–1141, 2023.

A. Almomani et al., “Ensemble-based Approach for Efficient Intrusion Detection in Network Traffic,” Intell. Autom. Soft Comput., Vol. 37, No. 2, pp. 2499–2517, 2023.

D. F. Abdulqadir, “Security , Privacy and Availability Enhancement of Smart Internet of Things ( IoT ),” 2023.

N. Islam et al., “Towards Machine Learning based Intrusion Detection in IoT Networks,” Comput. Mater. Contin., Vol. 69, No. 2, pp. 1801–1821, 2021.

M. Zhong, Y. Zhou, and G. Chen, “Sequential Model based Intrusion Detection System for IoT Servers using Deep Learning Methods,” Sensors (Switzerland), Vol. 21, No. 4, pp. 1–21, 2021.

Adi Ahmad, Riyan Maulana, and Muhammad Yassir, “Cybersecurity Challenges in the Era of Digital Transformation a Comprehensive Analysis of Information Systems,” J. Informatic, Educ. Manag., Vol. 6, No. 1, pp. 7–11, 2024.

Z. Azam, M. M. Islam, and M. N. Huda, “Comparative Analysis of Intrusion Detection Systems and Machine Learning-based Model Analysis Through Decision Tree,” IEEE Access, Vol. 11, pp. 80348–80391, 2023.

M. M. Taye, “Understanding of Machine Learning with Deep Learning: Architectures, Workflow, Applications and Future Directions,” Computers, Vol. 12, No. 5. 2023.

J. Wu, W. Wang, L. Huang, and F. Zhang, “Intrusion Detection Technique based on Flow Aggregation and Latent Semantic Analysis,” Appl. Soft Comput., Vol. 127, p. 109375, 2022.

H. Alazzam, A. Sharieh, and K. E. Sabri, “A Feature Selection Algorithm for Intrusion Detection System based on Pigeon Inspired Optimizer,” Expert Syst. Appl., Vol. 148, p. 113249, 2020.

M. Wang, Y. Lu, and J. Qin, “A Dynamic MLP-based DDoS Attack Detection Method using Feature Selection and Feedback,” Comput. Secur., Vol. 88, 2020.

I. F. Kilincer, F. Ertam, and A. Sengur, “Machine Learning Methods for Cyber Security Intrusion Detection: Datasets and Comparative Study,” Comput. Networks, Vol. 188, No. October 2020, p. 107840, 2021.

N. Yoshimura, H. Kuzuno, and Y. Shiraishi, “DOC-IDS : A Deep Learning-based Method for Feature,” Sensors, 2022.

A. Shenfield, D. Day, and A. Ayesh, “Intelligent Intrusion Detection Systems using Artificial Neural Networks,” ICT Express, Vol. 4, No. 2, pp. 95–99, 2018.

A. Bellat, K. H. Mansouri, and A. Raihani, “Implementation of Artificial Neural Network for Optimization of a Wind Farm,” Int. J. Tech. Phys. Probl. Eng., Vol. 13, No. 2, pp. 35–39, 2021.

A. Shalaginov, S. Banin, A. Dehghantanha, and K. Franke, Machine Learning Aided Static Malware Analysis: A Survey and Tutorial, Vol. 70, No. August. 2018.

J. Dumoulin et al., “UNICITY: A Depth Maps Database for People Detection in Security Airlocks,” Proc. AVSS 2018 - 2018 15th IEEE Int. Conf. Adv. Video Signal-Based Surveill., 2018.

H. Hussain, P. S. Tamizharasan, and C. S. Rahul, Design Possibilities and Challenges of DNN Models: A Review on the Perspective of end Devices, No. January. Springer Netherlands, 2022.

Y. H. Alagrash, H. S. Mehdy, and R. H. Mahdi, “A Review of Intrusion Detection System Methods and Techniques: Past, Present and Future,” Int. J. Tech. Phys. Probl. Eng., Vol. 15, No. 1, pp. 11–17, 2023.




DOI: https://doi.org/10.32520/stmsi.v15i5.6308

Article Metrics

Abstract view : 30 times
PDF - 3 times

Refbacks

  • There are currently no refbacks.


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.