Generalized Anomaly Detection

Suresh Singh, Minwei Luo, Yu Li

Abstract

Standard anomaly detection (AD) typically assumes a single "normal" class. However, real-world applications often involve multiple distinct categories that constitute normalcy. This paper investigates the "Multi-Class Anomaly Detection" (MCAD) problem and introduces DeepMAD (Deep Multi-class Anomaly Detection). DeepMAD utilizes a contrastive learning framework to treat known normal classes as mutual anomalies during training, resulting in more compact and discriminative feature representations. Our results demonstrate that DeepMAD consistently outperforms traditional one-class methods across various benchmarks and a novel real-world recycling dataset.

Introduction

Anomaly detection is a critical task in machine learning, traditionally framed as a "one-class" problem: a model is trained on a single type of normal data to identify deviations. In practice, "normalcy" is often heterogeneous. For instance, a smart recycling system must recognize glass, plastic, and paper as normal, while flagging general waste as anomalous.

Training a single one-class model on a diverse union of categories often leads to a wide, low-density distribution that allows anomalies to go undetected. Conversely, simply ensembling independent detectors for each category can lead to an accumulation of false positives. This paper addresses these challenges by proposing a mathematically grounded approach to multi-class normalcy.

Methodology and Theoretical Challenges

The authors evaluate three primary strategies for MCAD:

  1. The Ensemble Approach: Training $m$ independent one-class detectors and combining their outputs via Dempster-Shafer theory.
  2. The Union Approach: Training a single detector on the union of all $m$ normal categories.
  3. DeepMAD: A two-stage contrastive approach. First, it initializes class centers using autoencoders. Second, it performs contrastive training where each class encoder maps samples to a tight sphere around its center while pushing samples from the other $m-1$ normal classes away.
Figure 1: Theoretical formulation of the ensemble approach, showing the probability distributions for $m$ independent detectors across normal and anomalous sets.

A key theoretical finding is the Product Rule Trap: as the number of normal classes $m$ increases, the performance of independent ensembles (Algorithm 1) degrades. This occurs because false positive rates effectively multiply, eventually reducing the classifier's performance to that of random guessing. The authors argue that reducing the variance of the normal class distribution is essential for improving the Area Under the Curve (AUC).

Experimental Evaluation

The researchers benchmarked DeepMAD against state-of-the-art methods like DROCC and DeepSVDD using CIFAR-10, fMNIST, and CIFAR-100. They also introduced the RECYCLE dataset, featuring five categories of recyclables and a separate "trash" set for anomalies.

Key Results

DeepMAD demonstrated superior performance and stability across all tested scenarios. On the CIFAR-10 dataset, DeepMAD maintained higher AUC ranges and lower variance compared to competitors, particularly as the complexity of the "normal" set increased.

Figure 2: Performance comparison (AUC) on CIFAR-10 across different splits of normal (in) and anomalous (out) classes. DeepMAD (bottom row) consistently achieves the highest scores.

In the RECYCLE dataset, DeepMAD achieved a remarkable 0.98 AUC, significantly outperforming both DROCC (0.90) and DeepSVDD (0.90). This highlights the effectiveness of using labels of known normal data to "contrast" classes against each other, creating sharper decision boundaries than purely unsupervised methods.

Conclusion and Future Work

DeepMAD provides a robust framework for generalized anomaly detection by leveraging the internal structure of multi-class normal data. While it represents a significant step forward, the authors note that high-dimensional datasets like CIFAR-100 remain challenging, with AUC values often staying below 0.7. Future research will focus on failure analysis in high-dimensional spaces, scaling to larger numbers of categories, and exploring scenarios where class labels for normal data are unavailable during training.

Summary updated

BibTeX
@inproceedings{singh2022generalized,
  author = {Suresh Singh and Minwei Luo and Yu Li},
  title = {{Generalized Anomaly Detection}},
  booktitle = {ICONIP},
  year = {2022},
  doi = {10.1007/978-3-031-30111-7\_31},
}
Figure