An Edge-Deployable IP-Agnostic Machine Learning Framework for Intrusion Detection in MQTT-Based IoT Networks
Abstract
: The Message Queuing Telemetry Transport (MQTT) protocol is widely used in the Internet of Things (IoT). However, IoT networks are exposed to several cyberattacks due to the protocol’s inherent security limitations. Machine learning (ML) based Intrusion Detection Systems (IDSs) provide an additional layer of security, but recent studies have often suggested implementing heavy Deep Neural Networks (DNNs) which have significant latency and are impractical for deployment on resource limited edge gateways in IoT applications. To fill this gap, this paper presents a computationally efficient, IP-agnostic, and explainable ML-based IDS tailored for edge deployment. The proposed architecture utilizes a Two-Stage Hybrid Feature Selection method (ANOVA F-test and SHAP) to effectively reduce the dimensionality to 20 behavioral features. Moreover, the framework uses SMOTE to synthetically oversample minority attack classes on a unified training manifold and integrates a lightweight LightGBM classifier with a Bayesian Optimizer framework (Optuna) to automatically tune the hyperparameters. Experimental evaluations on an imbalanced MQTT intrusion dataset demonstrate that our LightGBM model has an IP-agnostic multiclass accuracy of 87.82% and a macro-recall of 90.79%. Importantly, the Optuna-LightGBM model achieves an optimal balance between accuracy, low memory footprint, and low single-packet inference latency, enabling practical deployment on resource-constrained edge gateways. Finally, SHAP is integrated into the system to offer summaries of the impacts of features across the entire system. This system offers a secure and transparent solution with high accuracy for edge computing, while also being efficient and low in computation.