Federated Variational Learning for Anomaly Detection in Multivariate Time Series

Kai Zhang, Yushan Jiang, Lee Seversky, Chengtao Xu, Dahai Liu, Houbing Song

TL;DR

This paper introduces FedAnomaly, a novel federated learning framework for detecting anomalies in multivariate time series data from Cyber-Physical Systems (CPS). By combining Variational Autoencoders (VAEs) with Convolutional Gated Recurrent Units (ConvGRUs) in a federated setting, FedAnomaly effectively captures complex temporal and feature dependencies while preserving data privacy and handling distributed data.

What Problem Does This Paper Address?

Detecting anomalies in multivariate time series data generated by Cyber-Physical Systems (CPS) is crucial for monitoring system health and preventing failures. However, this task is challenging due to several factors:

  • High Dimensionality and Complexity: CPS generate data with numerous interconnected sensors, leading to complex, non-linear, and dynamic time series.
  • Lack of Labeled Data: Supervised learning methods, which require ample labeled data, are often impractical because anomalies are rare and difficult to label.
  • Data Privacy and Distribution: Sensor data collected at the edge is often privacy-sensitive and large in volume, making centralized training on a main server infeasible.

Existing unsupervised anomaly detection methods often struggle to capture both temporal and feature-level dependencies simultaneously or fail to address the distributed and privacy-sensitive nature of CPS data.

Methods

FedAnomaly tackles these challenges by proposing a federated unsupervised anomaly detection framework. The core components are:

  • Convolutional Gated Recurrent Unit (ConvGRU): This novel sequence learning model is designed to jointly capture both feature-level dependencies (interactions between different sensor metrics) and temporal dependencies (patterns over time) within multivariate time series. It achieves this by incorporating 1D convolutional kernels into the standard GRU architecture for input-to-state and state-to-state transitions.
  • Variational Autoencoder (VAE): A VAE is used as the generative model. It learns a latent representation of normal time series patterns. Anomalies are detected by measuring how far new observations deviate from these learned normal patterns, typically through reconstruction error.
  • Federated Learning (FL): To address data privacy and distribution issues, FedAnomaly employs a federated learning approach. This allows multiple edge devices (clients) to collaboratively train a global model without sharing their raw data. Clients train local models on their data, and only model updates (gradients) are sent to a central aggregator, which then updates the global model. This ensures data remains decentralized and private.

The framework combines these elements by using ConvGRU within a VAE architecture (ConvGRU-VAE) and then deploying this model in a federated learning setup.

Datasets

The paper evaluates FedAnomaly on three real-world multivariate time series datasets:

  • SMAP (Soil Moisture Active Passive satellite): Telemetry data from a spacecraft.
  • MSL (Mars Science Laboratory rover): Telemetry data from a spacecraft.
  • SWaT (Secure Water Treatment): Data from a scaled-down water treatment testbed, representing a realistic CPS environment.

The SWaT dataset is noted as being particularly useful due to its clear labels and identified root causes for anomalies. The paper also mentions that for SMAP and MSL, due to data heterogeneity, an individual model is applied to each channel, rather than stacking all channels.

Key Insights and Ideas

  • Joint Feature and Temporal Dependency Capture: The ConvGRU architecture is a key innovation, enabling the model to simultaneously learn how different sensor readings relate to each other and how these relationships evolve over time. This is crucial for understanding complex system behaviors.
  • Federated Learning for Privacy and Scalability: Applying federated learning to anomaly detection is a significant step towards building practical, privacy-preserving systems for CPS. It allows for training on large, distributed datasets without centralizing sensitive information.
  • VAE for Unsupervised Anomaly Detection: The VAE's ability to learn a probabilistic representation of normal data makes it well-suited for unsupervised anomaly detection, where anomalies are defined as deviations from the norm.
  • Impact of Hyperparameters: The experiments reveal that factors like window length and hidden size significantly influence detection performance and latency, highlighting the need for careful tuning.

Key Results

  • Outperforms Baselines: FedAnomaly generally outperforms several state-of-the-art anomaly detection models (including AE, LSTM-VAE, DAGMM, MAD-GAN, OmniAnomaly, and USAD) in terms of F1 scores across the SMAP, MSL, and SWaT datasets in non-federated settings.
  • Federated Performance: While FedAnomaly performs relatively worse on SMAP and MSL in federated settings (attributed to data heterogeneity), it achieves comparable performance to non-federated settings on SWaT and surpasses most baselines in terms of precision and recall.
  • Latency Analysis: The study shows that larger hidden sizes generally lead to better detection rates with looser latency constraints, suggesting a trade-off between model capacity and detection speed.
  • Window Length Impact: Window lengths of 10 and 20 were found to be optimal for detecting anomalous patterns, segments, and achieving good response speed on the SWaT dataset.

Limitations and Future Work

  • Data Heterogeneity in Federated Settings: The paper acknowledges that data heterogeneity across different entities (clients) in federated learning can impact performance, particularly for datasets like SMAP and MSL.
  • Threshold Selection: While the current threshold selection method is effective, the authors suggest that more sophisticated rules could further improve performance.
  • Future Work: The authors plan to investigate solutions to tackle the data heterogeneity problem in federated deep generative models for time series anomaly detection. They also aim to explore more advanced threshold selection strategies.

Summary updated

BibTeX
@inproceedings{zhang2021federated,
  author = {Kai Zhang and Yushan Jiang and Lee Seversky and Chengtao Xu and Dahai Liu and Houbing Song},
  title = {{Federated Variational Learning for Anomaly Detection in Multivariate Time Series}},
  booktitle = {Ipccc},
  year = {2021},
  doi = {10.1109/ipccc51483.2021.9679367},
}
Figure