Optimized Machine Learning Framework for Cybersecurity Risk Assessment: Addressing Class Imbalance and Interpretability in Network Intrusion Detection

Nwadiuko Ahanna Chidera, Gilbert Imuetin Osaze Aimufua and Raymond Ternenge Igbudu

Center for Cyberspace Studies, Nasarawa State University Keffi

*Corresponding author’s Email: ahannanwadiuko@gmail.com, doi.org/10.55639/607.020100140


ABSTRACT

Cyber threats are evolving in sophistication and frequency, making traditional risk assessment approaches increasingly inadequate. Conventional intrusion detection systems often struggle with two major challenges: class imbalance and limited model interpretability, which can reduce their effectiveness in practical security operations. This study proposes an enhanced machine learning framework for cybersecurity risk assessment and evaluates it on a synthetic dataset designed to reproduce key characteristics of the CIC-IDS2017 benchmark. The framework incorporates correlation-based feature reduction, ANOVA-driven feature selection, and the Synthetic Minority Over-sampling Technique (SMOTE) to address data imbalance. Six machine learning algorithms—Logistic Regression, Random Forest, XGBoost, LightGBM, K Nearest Neighbors (KNN), and Decision Tree—were trained and fine-tuned using RandomizedSearchCV. LightGBM achieved the highest accuracy (0.983), weighted F1-score (0.982), and macro F1-score (0.951). SHAP (SHapley Additive exPlanations) analysis was employed to identify influential network flow features and improve model interpretability. A risk-scoring mechanism was also developed to convert classification outputs into measurable risk values for continuous monitoring. The evaluation uses a synthetic CIC-IDS2017-like dataset; therefore, the reported performance represents an experimental estimate pending validation on genuine network traffic. The results indicate that combining class-imbalance mitigation, feature selection, and ensemble learning can improve predictive performance and interpretability within the evaluated synthetic intrusion-detection setting.

KEYWORDS
Cybersecurity
Risk
Assessment,
Class
Imbalance,
LightGBM,
Ensemble
Learning,
ML.