A Transfer Learning Framework for Anomaly Detection in Multivariate IoT Traffic Data

Mahshid Rezakhani, Tolunay Seyfi, Fatemeh Afghah

Introduction

The rapid expansion of the Internet of Things (IoT) has generated a continuous stream of multivariate time-series data, creating a critical need for robust anomaly detection to identify security threats and equipment failures. However, two primary challenges hinder the deployment of effective detection systems: data scarcity and concept drift. Labeling network traffic is resource-intensive, and models trained on one environment often fail when deployed in another due to shifts in statistical properties. Traditional machine learning models are typically static, requiring extensive retraining to adapt to new domains. To address these issues, this paper presents CTAL-VAE, an unsupervised transfer learning framework designed to detect anomalies across diverse IoT environments with minimal labeled data.

Methodology

The Contrastive Target-Adaptive LSTM-VAE (CTAL-VAE) framework integrates several advanced deep learning techniques to achieve high performance in cross-domain scenarios.

Core Architecture: LSTM-VAE

At its foundation, the model utilizes a Long Short-Term Memory (LSTM) network within a Variational Autoencoder (VAE) structure. The LSTM components capture the complex temporal dependencies inherent in IoT traffic flows, while the VAE learns a probabilistic representation of "normal" behavior. Anomalies are identified by calculating reconstruction errors; data points that the model cannot accurately reconstruct are flagged as potential threats.

Domain-Specific Adaptors

To facilitate transfer learning, the authors introduced lightweight adaptor layers at the input and output stages. When transitioning from a source domain to a target domain, the core LSTM-VAE parameters are frozen. Only these adaptors are fine-tuned, allowing the model to bridge the gap between different sensor types or data formats without the computational cost of full retraining.

Contrastive Learning and Triplets

The framework's primary innovation is the use of contrastive learning with "triplet ensembles." During training, the model processes an anchor sample, a positive (perturbed) version of that anchor, and a negative (different) sample. This approach forces the model to map similar normal behaviors closely in the latent space while pushing anomalous behaviors further away. This results in a much sharper decision boundary between benign and malicious traffic.

Experimental Setup

The framework was evaluated using two distinct, modern IoT datasets to simulate real-world domain transfer:

  • Source Domain (WUSTL-IIOT-2021): An industrial IoT testbed monitoring water storage tanks, characterized by 93% benign traffic and specific attacks like DDoS and SQL injection.
  • Target Domain (ACI-IoT-2023): A simulated military and home automation environment. This dataset is significantly more aggressive (95% attacks) and features different traffic patterns, providing a rigorous test for the model's adaptability.

To preserve contextual integrity, the researchers employed receiver-side analysis, grouping traffic flows by destination IP rather than analyzing random packets. This method ensures that the model learns the specific interaction patterns of individual devices.

Results and Discussion

CTAL-VAE demonstrated superior performance when transferred from the industrial source to the military target domain. Key findings include:

  • High Accuracy: The model achieved 90% accuracy, significantly outperforming standard VAEs (82%) and basic Autoencoders (79%).
  • Robustness in Imbalanced Data: The framework showed a high Matthews Correlation Coefficient (MCC) and sensitivity, indicating it could effectively identify true positives even in the target dataset's attack-heavy environment.
  • Few-Shot Efficiency: Remarkably, the model reached these performance levels using only five triplet examples from the target domain. This proves that CTAL-VAE can align itself to new environments with minimal data requirements, making it highly practical for edge deployment.

Conclusion

CTAL-VAE offers a scalable solution for IoT security by combining the temporal modeling of LSTMs with the discriminative power of contrastive learning. By utilizing domain-specific adaptors and few-shot learning, the framework overcomes the traditional barriers of data scarcity and concept drift. While the current model excels at detection, future work will focus on multi-class classification to identify specific attack types and developing a fully online version for real-time, continuous adaptation in dynamic IoT landscapes.

Summary updated

BibTeX
@inproceedings{rezakhani2025transfer,
  author = {Mahshid Rezakhani and Tolunay Seyfi and Fatemeh Afghah},
  title = {{A Transfer Learning Framework for Anomaly Detection in Multivariate IoT Traffic Data}},
  booktitle = {ICC},
  year = {2025},
  doi = {10.1109/icc52391.2025.11161334},
}
Figure