A Causal Approach to Detecting Multivariate Time-series Anomalies and Root Causes

Wenzhuo Yang, Kun Zhang, Steven C. H. Hoi

Abstract

Detecting anomalies and the corresponding root causes in multivariate time series plays an important role in monitoring the behaviors of various real-world systems, e.g., IT system operations or manufacturing industry. Previous anomaly detection approaches model the joint distribution without considering the underlying mechanism of multivariate time series, making them computationally hungry and hard to identify root causes. In this paper, we formulate the anomaly detection problem from a causal perspective and view anomalies as instances that do not follow the regular causal mechanism to generate the multivariate data. We then propose a causality-based framework for detecting anomalies and root causes. It first learns the causal structure from data and then infers whether an instance is an anomaly relative to the local causal mechanism whose conditional distribution can be directly estimated from data. In light of the modularity property of causal systems (the causal processes to generate different variables are irrelevant modules), the original problem is divided into a series of separate, simpler, and low-dimensional anomaly detection problems so that where an anomaly happens (root causes) can be directly identified. We evaluate our approach with both simulated and public datasets as well as a case study on real-world AIOps applications, showing its efficacy, robustness, and practical feasibility.

Introduction

In complex systems such as power plants, IT infrastructure (AIOps), or manufacturing lines, monitoring hundreds of variables simultaneously is standard practice. Traditional multivariate anomaly detection usually falls into two categories: univariate methods that miss relational anomalies, or joint modeling using deep learning. While powerful, these "black-box" joint models are computationally expensive and struggle to provide explainable root causes when an alarm is triggered.

This paper introduces a conceptual shift: viewing anomalies not merely as rare data points, but as violations of the causal mechanism that generates the data. By decomposing complex system behaviors into individual "local causal mechanisms," we can achieve state-of-the-art detection accuracy while simultaneously pinpointing the specific origin of failures.

Methodology

The proposed framework operates in three main stages:

  1. Causal Discovery: The system learns the "blueprint" of the data—a Directed Acyclic Graph (DAG)—using algorithms like FGES or PC. This identifies which variables influence others.
  2. Local Mechanism Modeling: Utilizing the modularity property of causal systems, the joint distribution is factored into simpler, low-dimensional conditional distributions: $P(\text{variable} | \text{its parents})$. These local relationships are modeled using Conditional Variational Autoencoders (CVAEs).
  3. Anomaly & Root Cause Scoring:
    • Detection: An anomaly score is calculated based on how much a new data point deviates from its predicted local causal mechanism.
  4. Root Cause Analysis (RCA): To distinguish between the source of a problem and its propagated symptoms, the framework uses a PageRank-like algorithm (RS score) that penalizes variables likely reacting to upstream failures.
Overview of the causal framework, showing the graph structure, time series, and conditional distributions used to identify anomalies.

Key Insights

  • Divide and Conquer: Breaking a high-dimensional problem into many low-dimensional "local" problems makes the model more robust to noise and easier to train.
  • Mechanism Violations: Instead of asking if a data point is rare, the model asks if it follows the system's rules. This allows it to catch subtle anomalies that stay within "normal" marginal ranges but violate system logic.
  • Iterative Refinement: The framework addresses the challenge of learning a clean causal graph from noisy training data by iteratively detecting and removing training anomalies to refine the graph.

Results and Evaluation

The causal approach was evaluated against robust benchmarks including SWaT, WADI, and NASA datasets (SMAP/MSL). It consistently outperformed established baselines like DAGMM, OmniAnomaly, and USAD.

  • Accuracy: On the SWaT dataset, the model achieved an F1-score of 0.918, significantly higher than the 0.79-0.84 range of most deep learning competitors.
  • Nonlinear Superiority: In nonlinear simulated environments, the causal method maintained an F1-score of ~0.75, while joint-distribution models saw performance drop to ~0.45.
  • Root Cause Identification: In simulated tests, the model's "Top 3" hit ratio for root causes exceeded 95% in linear settings and 76% in nonlinear settings.
Distribution of the causality-based conditional reconstruction error, where the anomaly (black triangle) is clearly distinguishable from normal data.

Conclusion

By reframing anomaly detection as a causal inference problem, this framework provides a scalable and interpretable solution for multivariate time-series monitoring. It effectively handles high-dimensional data by leveraging the modularity of causal systems, offering both superior detection performance and precise root cause identification. Future work will explore advanced discovery methods to handle latent variables and non-stationary environments more gracefully.

Summary updated

Abstract

Detecting anomalies and the corresponding root causes in multivariate time series plays an important role in monitoring the behaviors of various real-world systems, e.g., IT system operations or manufacturing industry. Previous anomaly detection approaches model the joint distribution without considering the underlying mechanism of multivariate time series, making them computationally hungry and hard to identify root causes. In this paper, we formulate the anomaly detection problem from a causal perspective and view anomalies as instances that do not follow the regular causal mechanism to generate the multivariate data. We then propose a causality-based framework for detecting anomalies and root causes. It first learns the causal structure from data and then infers whether an instance is an anomaly relative to the local causal mechanism whose conditional distribution can be directly estimated from data. In light of the modularity property of causal systems (the causal processes to generate different variables are irrelevant modules), the original problem is divided into a series of separate, simpler, and low-dimensional anomaly detection problems so that where an anomaly happens (root causes) can be directly identified. We evaluate our approach with both simulated and public datasets as well as a case study on real-world AIOps applications, showing its efficacy, robustness, and practical feasibility.
BibTeX
@inproceedings{yang2023causal,
  author = {Wenzhuo Yang and Kun Zhang and Steven C. H. Hoi},
  title = {{A Causal Approach to Detecting Multivariate Time-series Anomalies and Root Causes}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=f25VGPzATcn},
}
Figure