Research on IoT Sensor Data Correlation and Anomaly Detection Based on Self-Attention Mechanisms
Xiaoming Yan, Hehe Zhang, Yinlu Di, Linxi Xie · 2025
Since a dynamic environment leads to the generation of large-scale data from a diverse collection of sensors, efficient data analysis and anomaly detection are crucial to guarantee system performance and reliability given the increasing development of Internet of Things (IoT) networks. In this paper, we present an IoT Sensors data correlation and anomaly detection model based on self-attention mechanism, which is innovative on the basis of existing time series analysis and deep learning model. The model integrates a multi-layer self-attention-based architecture and hybrid encoder-decoder framework that can simultaneously extract temporal and spatial correlations in sensor data. We propose a new type of attention scoring function that can handle irregularities in sensor data improving on the traditional attention mechanism to better deal with missing values and sensor noise. The model further enhances this aspect by incorporating a dynamic attention mechanism that focuses on the most relevant sensor data sequences for data correlation and isolates anomalous patterns more effectively. To train the model, we followed a two-stage training process where we first fitted the model to learn how to perform anomaly detection in an unsupervised manner and then fine-tuned the model in a supervised manner to maximize the accuracy of the model for anomaly detection. The experimental results demonstrate that the accuracy and computational efficiency of the proposed model for anomaly detection on real IoT datasets outperforms traditional machine learning and deep learning models.