Abstract
The rapid expansion of Wireless Sensor Networks (WSNs) in large-scale and critical infrastructures has increased the need for efficient and real-time network security solutions. Traditional rule-based and single-model intrusion detection systems often struggle to scale when handling high-dimensional and continuously evolving network traffic. To address these challenges, this paper proposes a hybrid machine learning-based anomaly detection framework for identifying malicious activities in network traffic. The proposed approach integrates multiple supervised classification algorithms, including Decision Tree, Random Forest, k-Nearest Neighbors, Support Vector Machine, and Naïve Bayes, to enable comparative evaluation and robust intrusion detection. To improve scalability and computational efficiency, optimization strategies such as intelligent data sampling and a fast-converging LinearSVC variant are employed. The framework incorporates standardized feature scaling and persistent model storage to support seamless deployment. In addition, an interactive web-based dashboard developed using Streamlit enables real-time visualization and classification of newly uploaded network traffic data. Experimental results demonstrate that the proposed framework achieves high detection accuracy, improved precision, recall, and F1-score, while maintaining practical feasibility for continuous and real-time network security monitoring.