Machine Learning Algorithms for Intrusion Detection: A Comparative Analysis

Oduwole Omolara Oluwakemi *

Computer Science Program, National Mathematical Centre, Abuja, Nigeria.

Muhammad, Umar Abdullahi

Department of Computer Science, Federal University of Technology, Owerri, Nigeria.

Kene Tochukwu Anyachebelu

Department of Computer Science, Nasrawa State University, Keffi, Nasarawa State, Nigeria.

*Author to whom correspondence should be addressed.


Abstract

Network intrusion has remained one of the most persistent and critical threats to computer networks for several decades. To reduce the severity of network intrusions, network intrusion detection systems have proved effective. This study undertakes a comparative examination of machine learning algorithms used for intrusion detection, addressing the escalating challenge of safeguarding networks from malicious attacks in an era characterised by the proliferation of network-related applications. Given the limitations of conventional security tools in combating intrusions effectively, the adoption of machine learning has emerged as a promising avenue for strengthening detection capabilities. The research evaluates the efficacy of three distinct machine learning algorithms - Convolutional Neural Networks (CNN), Recurrent Neural Networks (RNN), and Naive Bayes - in identifying diverse attack categories, including Denial of Service (DoS), Probe, Remote to Local, and User to Root. This research adopts an experimental research design. The NSL-KDD dataset consists of several attributes that provide the features of network-based intrusion detection systems. Conducted on the NSL-KDD dataset, the analysis identifies CNN and RNN as stronger performers than Naive Bayes, particularly in terms of detection accuracy. The CNN algorithm achieved an accuracy rate of 96.55%. The Naive Bayes algorithm, although having a lower accuracy of 91.30%, still demonstrated acceptable performance in detecting DoS attacks. While CNN demonstrated strong performance in attack detection, its slightly lower Receiver Operating Characteristic scores compared with RNN indicate a nuanced difference in discriminatory power. In contrast, Naive Bayes, while computationally efficient, exhibited lower accuracy and F1 scores because of its assumption of feature independence. These findings are useful to researchers and practitioners in intrusion detection systems, offering insights into algorithmic choices. Overall, this study contributes to ongoing efforts to strengthen network security and supports the development of safer technological systems.

Keywords: Intrusion detection system, machine learning, convolutional neural networks, recurrent neural networks, naive bayes


How to Cite

Oluwakemi, O. O., Abdullahi, M. U., & Anyachebelu, K. T. (2026). Machine Learning Algorithms for Intrusion Detection: A Comparative Analysis. Mathematics and Computer Science: Research Updates Vol. 12, 161–183. https://doi.org/10.9734/bpi/mcsru/v12/6324