Network Security Real-Time Intrusion Detection: A Machine Learning Framework with Logistic Regression and SSE Streaming for Low-Latency Threat Classification
Abstract
This study presents a comprehensive real-time intrusion detection system (IDS) using machine learning classification techniques. The proposed system employs a Logistic Regression model trained on 50,000 network traffic samples from the NF-UQ-NIDS-v2 dataset, achieving 87.94% testing accuracy with 89.39% sensitivity for attack detection. The system processes real-time packets through a Flask-based web dashboard with Server-Sent Events (SSE) streaming, capable of analyzing 24,000+ concurrent samples for mixed benign and attack classification. Using 41 network traffic features with standardized preprocessing and stratified data splitting, the model achieves an ROC-AUC of 0.9502, demonstrating excellent discriminative ability between benign and malicious patterns. This work addresses the critical network security challenge of low-latency, high-accuracy traffic analysis in real-time operational environments, providing an accessible yet robust IDS framework.