🤖 AI Summary
To address key challenges in anomaly detection for wireless sensor networks (WSNs)—including label scarcity, limited anomalous samples, insufficient spatiotemporal dependency modeling, and severe class imbalance—this paper proposes a two-stage learning framework. In the first stage, unsupervised contrastive pretraining enhances spatiotemporal representation learning; in the second stage, cache-assisted few-shot sampling and a dual-graph discriminative joint loss enable low-resource fine-tuning. The core model, MTAD-RD, integrates RetNet with graph attention mechanisms to support multi-granularity spatiotemporal modeling and efficient sequential inference. Evaluated on multiple real-world public WSN datasets, the method achieves an F1-score of 90.97%, substantially outperforming existing supervised approaches. This work is the first to systematically combine contrastive learning and few-shot learning for WSN anomaly detection, advancing both methodology and practical applicability under extreme data constraints.
📝 Abstract
Detecting anomalies in the data collected by WSNs can provide crucial evidence for assessing the reliability and stability of WSNs. Existing methods for WSN anomaly detection often face challenges such as the limited extraction of spatiotemporal correlation features, the absence of sample labels, few anomaly samples, and an imbalanced sample distribution. To address these issues, a spatiotemporal correlation detection model (MTAD-RD) considering both model architecture and a two-stage training strategy perspective is proposed. In terms of model structure design, the proposed MTAD-RD backbone network includes a retentive network (RetNet) enhanced by a cross-retention (CR) module, a multigranular feature fusion module, and a graph attention network module to extract internode correlation information. This proposed model can integrate the intermodal correlation features and spatial features of WSN neighbor nodes while extracting global information from time series data. Moreover, its serialized inference characteristic can remarkably reduce inference overhead. For model training, a two-stage training approach was designed. First, a contrastive learning proxy task was designed for time series data with graph structure information in WSNs, enabling the backbone network to learn transferable features from unlabeled data using unsupervised contrastive learning methods, thereby addressing the issue of missing sample labels in the dataset. Then, a caching-based sample sampler was designed to divide samples into few-shot and contrastive learning data. A specific joint loss function was developed to jointly train the dual-graph discriminator network to address the problem of sample imbalance effectively. In experiments carried out on real public datasets, the designed MTAD-RD anomaly detection method achieved an F1 score of 90.97%, outperforming existing supervised WSN anomaly detection methods.