Graph Neural Network-Based Anomaly Detection in Multivariate Time Series

Ailin Deng, Bryan Hooi

Introduction

Modern Cyber-Physical Systems (CPS), such as water treatment plants, power grids, and data centers, rely on thousands of interconnected sensors to maintain operational integrity. Monitoring these systems for faults or cyberattacks presents a massive, high-dimensional anomaly detection challenge. Traditional deep learning methods, including Autoencoders and Generative Adversarial Networks (GANs), often treat multivariate time series as flat vectors. This approach fails to explicitly model the complex, non-linear relationships between specific sensors—such as how a valve opening affects a downstream pressure gauge. Consequently, these models struggle to detect subtle anomalies that violate inter-sensor dependencies and offer limited explainability to human operators.

The Graph Deviation Network (GDN) Framework

To address these limitations, this paper introduces the Graph Deviation Network (GDN). GDN is designed to learn the underlying topology of a system and use that knowledge to forecast expected behavior, flagging anomalies when actual readings deviate from these predictions.

The four-stage pipeline of the Graph Deviation Network (GDN).

The GDN architecture operates in four primary stages:

  1. Sensor Embeddings: Each sensor is assigned a trainable, multidimensional embedding vector. This allows the model to capture the unique characteristics and "personality" of individual sensors rather than treating them as identical data streams.
  2. Graph Structure Learning: Instead of requiring a pre-defined schematic, GDN learns a directed graph from the data. It computes similarity between sensor embeddings and connects each sensor to its Top-$K$ most related peers, deducing operational dependencies purely from behavior.
  3. Graph Attention-Based Forecasting: A Graph Attention Network (GAT) predicts future values for each sensor based on a sliding window of past data from its learned neighbors. The model fuses sensor embeddings into the attention mechanism, allowing it to apply different weights based on the specific types of sensors involved.
  4. Graph Deviation Scoring: The model compares predictions to actual readings. To handle naturally noisy sensors, errors are normalized using robust statistics (median and Interquartile Range). The scores are then aggregated using a max function to identify time steps where at least one sensor severely deviates from expectations.

Experimental Setup and Datasets

The model was evaluated on two real-world physical testbed datasets containing simulated cyber-physical attacks:

  • SWaT (Secure Water Treatment): A testbed with 51 sensors and approximately 12% anomalous data.
  • WADI (Water Distribution): A larger, more complex extension of SWaT featuring 127 sensors and approximately 6% anomalous data.

Results and Key Insights

GDN significantly outperformed six deep learning baselines, including MAD-GAN and LSTM-VAE. On the SWaT dataset, GDN achieved an F1-score of 0.81 (compared to 0.77 for the best baseline). On the more challenging WADI dataset, GDN reached an F1-score of 0.57, representing a 54% relative improvement over the next best model.

Beyond performance metrics, GDN provides built-in explainability. When an anomaly is flagged, operators can identify the specific sensor with the highest error and examine the learned graph to see which neighboring sensors influenced the prediction. This allows for a clear understanding of which physical relationship was violated during an attack.

Explainability in action: The learned graph structure (left) and the deviation between predicted and observed values (right) during an anomaly.

Visualization of the learned embeddings using t-SNE further validated the model, showing that sensors with similar physical functions naturally clustered together in the embedding space. Ablation studies confirmed that every component—the learned graph, the embeddings, and the attention mechanism—is essential for the model's success.

Conclusion

The Graph Deviation Network demonstrates that system topology can be learned from scratch to improve anomaly detection in industrial settings. By combining graph neural networks with sensor embeddings, GDN provides a robust and explainable framework for monitoring complex multivariate time series. Future work may involve developing online training methods to allow the model to adapt to natural operational shifts and wear-and-tear over time.

Summary updated

BibTeX
@inproceedings{deng2021graph,
  author = {Ailin Deng and Bryan Hooi},
  title = {{Graph Neural Network-Based Anomaly Detection in Multivariate Time Series}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i5.16523},
}
Figure