Spatiotemporal Conditioning With Dynamic Multihead Attention for IoT Intrusion Detection

Shifa Shoukat, Tianhan Gao, Danish Javeed, Muhammad Adil, Prabhat Kumar · IEEE Internet of Things Journal · 2025

The rapid proliferation of Internet of Things (IoT) devices has transformed modern infrastructures, yet their inherently distributed and dynamic nature poses significant challenges for cybersecurity. Traditional intrusion detection systems (IDS) often rely on static models or linear temporal analysis, which makes them insufficient to identify and respond to evolving threats that manifest across both spatial and temporal dimensions. Furthermore, existing attention-based mechanisms tend to treat spatial and temporal dependencies separately and apply fixed attention weights, limiting their adaptability in complex IoT environments. To address these limitations, we propose, a novel IDS framework incorporating a Spatio-Temporal Conditioning with Dynamic Multi-Head Attention (STC-MHA-DW) mechanism. This module captures contextual interdependencies across both spatial features and temporal windows by leveraging head-wise adaptive projections, enabling the model to dynamically reweight attention based on surrounding threat context. The temporal encoder is built using a dual-stage gated mechanism that processes both short-term fluctuations and long-term dependencies, while the attention layer refines representations through localized spatio-temporal salience. We also introduce a scalable, cloud-native deployment architecture using microservices and containerization to ensure efficient performance under dynamic network loads. Experimental evaluations show that the proposed ids achieves the highest detection accuracy of 99.84%, precision of 99.47%, recall of 98.83%, and f1-score of 99.14% with a very low false alarm rate, outperforming existing models.

Read the paper · More papers on PaperTik