Correlation-Aware Deep Generative Model for Unsupervised Anomaly Detection

Haoyi Fan, Fengbin Zhang, Ruidong Wang, Liang Xi, Zuoyong Li

This paper presents CADGMM (Correlation-aware Deep Gaussian Mixture Model), a novel framework for unsupervised anomaly detection that shifts the focus from individual data points to the relationships between them.

TL;DR

CADGMM improves unsupervised anomaly detection by using a dual-encoder architecture that captures both individual sample features and the complex correlations between samples via a graph structure. By combining Graph Attention Networks (GAT) with a Gaussian Mixture Model (GMM), it creates more robust "normal" profiles and achieves state-of-the-art results on standard benchmarks.

What Problem Does This Paper Address?

Anomaly detection is the "needle in a haystack" problem of machine learning: identifying rare patterns that deviate from the norm. Most existing unsupervised methods (like standard Autoencoders or Isolation Forests) treat data samples as independent and identically distributed (i.i.d.).

However, in complex real-world data, "normal" behavior is often defined by how samples relate to one another. For example, in a sensor network, a single reading might look normal in isolation but becomes an anomaly when compared to its neighbors. By ignoring these correlations, traditional models struggle to capture the underlying structure of the data manifold, leading to higher false-positive rates or missed detections in high-dimensional spaces.

Methods

The authors propose a three-stage pipeline to incorporate relational context into a generative framework:

  1. Graph Construction: Since the input data is often unstructured (not a natural graph), the model first uses a K-Nearest Neighbors (K-NN) algorithm in the feature space to build a graph. Each data point is a node, and edges represent similarities between neighbors.
  2. Dual-Encoder Architecture: This is the core innovation. Instead of a single encoder, CADGMM uses two:
  3. Feature Encoder: A standard Multi-Layer Perceptron (MLP) that processes the raw attributes of a sample.
  4. Graph Encoder: A Graph Attention Network (GAT) that aggregates information from a sample’s neighbors.
  5. The outputs of both are fused into a single low-dimensional latent representation.
  6. Density Estimation (GMM): The latent vector is passed to a decoder for reconstruction and simultaneously to an Estimation Network. This network predicts the parameters of a Gaussian Mixture Model. Anomaly scores are then calculated based on "energy"—essentially the negative log-likelihood of a sample belonging to the estimated normal distribution.

Datasets

The model was evaluated on three widely recognized anomaly detection benchmarks:

  • KDD99: A massive dataset for network intrusion detection (approx. 494,000 samples).
  • Arrhythmia: A small, high-dimensional medical dataset (452 samples, 274 features) used to detect heart abnormalities.
  • Satellite: Earth observation data (6,435 samples) where the goal is to distinguish specific land types from others.

Key Insights and Ideas

  • Relational Context as a Regularizer: By forcing the model to consider neighbors via the GAT, the latent space becomes more structured. Normal samples, which tend to have similar neighbors, cluster more tightly, while anomalies (which may have "weird" neighbors or be isolated) are pushed further away.
  • Robustness to "Polluted" Training Data: One of the most impressive findings is that CADGMM remains stable even when the training set contains up to 5% anomalies (noise). Traditional models like OC-SVM see their performance crater under these conditions, but CADGMM’s graph-based approach helps it ignore these "lonely" anomalous nodes.
  • End-to-End Joint Optimization: Unlike two-step methods that perform dimensionality reduction and then clustering, CADGMM optimizes reconstruction, graph representation, and GMM density estimation simultaneously in one loss function.

Key Results

CADGMM consistently outperformed classic baselines (OC-SVM, Isolation Forest) and recent deep learning models (DAGMM, ALAD, AnoGAN).

  • KDD99: Achieved an F1-score of 96.71%, a significant jump over the previous state-of-the-art deep model, DAGMM (93.69%).
  • Arrhythmia: On this notoriously difficult small dataset, it reached an F1 of 57.14%, outperforming the next best deep model (ALAD) by nearly 6 percentage points.
  • Visual Evidence: t-SNE visualizations of the latent space show that CADGMM produces much more compact and clearly separated clusters for normal vs. abnormal data compared to models that ignore sample correlations.

Limitations and Future Work

  • Graph Scalability: The K-NN graph construction and GAT layers introduce more computational overhead than simple MLPs. For extremely large datasets, the $O(N^2)$ or $O(N \log N)$ cost of finding neighbors could become a bottleneck.
  • Batch Dependency: The graph is constructed based on the samples within a training batch. The authors noted that batch size (e.g., 1024 for KDD99) is a critical hyperparameter to ensure the graph has enough "context."
  • Future Directions: The authors suggest exploring more sophisticated graph structures beyond K-NN and testing the model on even more complex, unstructured data types like video or logs.

Summary updated

BibTeX
@inproceedings{fan2020correlation,
  author = {Haoyi Fan and Fengbin Zhang and Ruidong Wang and Liang Xi and Zuoyong Li},
  title = {{Correlation-Aware Deep Generative Model for Unsupervised Anomaly Detection}},
  booktitle = {PAKDD},
  year = {2020},
  url = {https://openreview.net/forum?id=MCh9uFiBOF},
}

Loading related content...

Figure