Network Intrusion Detection Using Machine Learning: A Comparative Study of Logistic Regression, KNN, and Random Forest

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.

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2025-09-20
DOI
https://doi.org/10.5281/zenodo.17164378
Primary Topic
Data Analysis with R
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Network Intrusion Detection Using Machine Learning: A Comparative Study of Logistic Regression, KNN, and Random Forest

Zenodo (CERN European Organization for Nuclear Research)
Data Analysis with R
article

Network Intrusion Detection Using Machine Learning: A Comparative Study of Logistic Regression, KNN, and Random Forest

article en

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.

Zenodo (CERN European Organization for Nuclear Research)
Maine Classical Association (US)
Life in Land
Openalex Percentile: Top 33%
Data Analysis with R
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Network Intrusion Detection Using Machine Learning: A Comparative Study of Logistic Regression, KNN, and Random Forest · Zenodo (CERN European Organization for Nuclear Research) (2025) | TGRS Research Map | TGRS