Cyber Behavioral Analysis using Machine Learning
Abstract
Intrusion detection systems are critical for securing modern computer networks against continually evolving cyberattacks. Although machine learning has improved threat identification, achieving both high accuracy and model explainability remains challenging. This research work proposes a stacked ensemble that combines Random Forest, XGBoost, and Long Short-Term Memory (LSTM) models to analyze network behavioral patterns and detect intrusions, validated on the CIC-IDS-2018 dataset. Features are standardized with StandardScaler, class imbalance is addressed with SMOTE, and the operating threshold is tuned using Youden’s J-statistic. The stacked ensemble achieves a test accuracy of 95.09% and a test AUC-ROC of 0.9508, outperforming each individual base model. A SHAP-based explainability analysis quantifies the contribution of network traffic features to the model’s predictions, and the results indicate that the proposed framework provides effective intrusion detection while retaining interpretability useful to security analysts.