Transformer-based classification of IoT network traffic with flow-to-window aggregation
Abstract
The explosive growth of the IoT has led to an increasingly complex and heterogeneous network traffic, posing major challenges for intrusion detection. Most existing machine learning and deep learning approaches model network traffic at the level of individual flows, which limits their ability to capture contextual relationships among concurrent communications. This paper introduces a Transformer-based framework for IoT intrusion detection that aggregates network flows into fixed-duration windows and treats each flow as a token within the input sequence. The self-attention mechanism captures contextual relationships among concurrent flows, enabling effective modeling of temporal dependencies without recurrence. Experiments conducted on the CICIoT2023 dataset show that the proposed model achieves a weighted F1-score of 97.9% and a macro ROC–AUC of 99.6% under temporally blocked cross-validation, while maintaining high computational efficiency. These results demonstrate that flow-to-window aggregation combined with self-attention provides a robust and scalable foundation for IoT network security, suitable for deployment in edge and smart-home environments.
Fields of Study & Subjects
Internet Traffic Analysis and Secure E-voting
Network Security and Intrusion Detection
Software-Defined Networks and 5G
Publication details
- Journal / source
- Internet of Things
- Publisher
- Elsevier BV
- Volume
- 36
- Pages
- 101879–101879
- Publication date
- 21 January 2026
- Language
- EN