Network Intrusion Detection Using Machine Learning: A Comparative Study of Logistic Regression, KNN, and Random Forest
Year: 2025
Type: article
Abstract: Network Intrusion Detection Systems (NIDS) play a critical role in defending networks against unauthorized access and cyber threats. This paper presents a real-time, web-enabled NIDS built using machine learning techniques to effectively identify and categorize network-based attacks. The system is trained on the NSL-KDD dataset, a refined alternative to earlier datasets, addressing issues like redundancy and class imbalance. We implement and evaluate three supervised learning algorithms—Logistic Regression, K-Nearest Neighbors (KNN), and Random Forest. The workflow includes comprehensive preprocessing, class balancing, and hyperparameter tuning via grid search with cross-validation. Among the models tested, Random Forest achieved the highest detection performance, showing excellent accuracy with minimal false positives. While KNN also produced reliable results, it was comparatively slower. Logistic Regression delivered quick and interpretable outcomes but struggled with complex intrusion patterns. This work contributes a practical, browser-accessible NIDS platform that brings together machine learning capabilities and real- time threat detection.
Authors: Tejashree H Y, Komala R
Language: English
Subfield: Computer Networks and Communications
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7082351290
FWCI:
Cites:
Cited by:
Related to:
