Conference Paper ยท ASREM 2026

XAI-IDS: An Explainable Intrusion Detection Framework for IoT-Enabled Smart Energy Infrastructure

Mostefa Bendjima1, Nasreddine Slimani2

ยน University of Bechar, Algeria  ยท  ยฒ University of Continuing Education, Algiers, Algeria

Abstract

The digitalization of energy infrastructure exposes resource-constrained IoT field devices โ€” smart meters, renewable energy sensors, and building automation nodes โ€” to escalating network intrusion threats, making lightweight and interpretable detection a critical operational requirement. This work presents XAI-IDS, a framework combining Random Forest, XGBoost, and LightGBM with SHAP TreeExplainer to deliver global, local, and per-class feature-level explanations on the RT-IoT2022 benchmark.

All three models achieve macro F1 above 0.98; McNemar's test confirms that pairwise accuracy differences are statistically non-significant (p > 0.05), shifting the primary deployment concern to computational cost rather than predictive performance. A four-feature SHAP consensus โ€” forward payload minimum, destination port, average forward payload, and packet rate โ€” maps directly onto the flow statistics that deviate under attacks targeting IoT protocols such as MQTT. SHAP-guided feature selection reduces input dimensionality by 88% with a macro F1 loss below 0.007, supporting deployment on constrained IoT edge gateways.

Intrusion DetectionIoT Security Smart EnergyExplainable AI SHAPXGBoostLightGBM Edge ComputingFeature Selection

Key Results

0.9944
Best Macro F1 (XGBoost)
1.000
ROC-AUC (XGBoost, OvR)
88%
Dimensionality reduction (81 โ†’ 10 features)
1.97 ms
LightGBM inference latency / sample

Core Contributions

Performance Summary

ModelAccuracyPrecision (Macro)Recall (Macro)F1 (Macro)ROC-AUC
Random Forest0.99830.97170.99360.98150.9999
XGBoost0.99840.99460.99430.99441.0000
LightGBM0.99870.98700.99520.99080.9999

Selected Figures