Multi-Class Anomaly Detection

Suresh Singh, Minwei Luo, Yu Li

TL;DR

This paper tackles the challenge of anomaly detection when the "normal" class actually comprises multiple distinct categories (e.g., different types of cells or objects). They demonstrate that a single, jointly trained anomaly detector for all normal categories outperforms using multiple independent detectors. They also introduce DeepMAD, a novel deep learning approach that achieves state-of-the-art results on this multi-class anomaly detection problem.

What Problem Does This Paper Address?

Traditional anomaly detection methods typically assume a single, well-defined "normal" class. However, many real-world scenarios involve a normal class that is inherently composed of multiple sub-categories. For instance, in medical diagnostics, a "normal" blood sample might contain various types of healthy cells (monocytes, neutrophils, basophils, etc.). Similarly, a recycling facility needs to identify various types of recyclable materials as "normal" while distinguishing them from actual trash. The challenge is to effectively detect anomalies when the normal data distribution is multimodal. The paper highlights that simply applying existing one-class anomaly detectors independently to each normal category and then combining their decisions leads to suboptimal performance.

Methods

The paper proposes two main strategies for multi-class anomaly detection:

  • Algorithm 1 (Using m Single-Class Anomaly Detectors): This approach trains m separate one-class anomaly detectors, one for each of the m normal classes. During testing, an input is classified as anomalous only if all m detectors flag it as such.
  • Algorithm 2 (Training a single classifier by combining all m classes): This method simplifies the problem by combining the training data from all m normal classes into a single dataset and training a single one-class anomaly detector on this combined data.

The authors theoretically prove that Algorithm 2 generally yields higher performance (measured by AUC) than Algorithm 1, especially as the number of normal classes increases.

They then introduce DeepMAD, a novel deep learning algorithm that builds upon the principles of Algorithm 1 but with significant improvements. DeepMAD trains m autoencoders, one for each normal class. Crucially, for each autoencoder, it uses the examples from the other m-1 normal classes as anomalous data during training. This forces the autoencoder to learn features that are discriminative not only for the target normal class but also for distinguishing it from other normal classes, effectively learning more compact and robust representations.

Datasets

The paper evaluates their methods on several standard datasets and introduces a new one:

  • CIFAR-10: A widely used image dataset. They consider scenarios with 2, 5, and 9 normal classes.
  • fMNIST: A dataset of fashion items. Similar to CIFAR-10, they test with 2, 5, and 9 normal classes.
  • CIFAR-100: A more complex image dataset. They use its 20 super-classes and test a 2-normal-class scenario.
  • RECYCLE: A newly introduced dataset created by the authors. It contains 5 classes of recyclable items (glass bottles, plastic bottles, cans, crushed cans, cardboard boxes) and a class of assorted trash. They use this to study scenarios with 4 normal classes and 1 anomaly, and also 5 normal classes with trash as the anomaly.

Key Insights and Ideas

  • Joint training is superior: Combining all normal class data to train a single anomaly detector (Algorithm 2) is theoretically and empirically better than training multiple independent detectors and combining their outputs (Algorithm 1). This is because the errors of individual detectors compound in Algorithm 1.
  • Distinguishing between normal classes is key: The core challenge in multi-class anomaly detection is not just distinguishing normal from anomalous, but also distinguishing between the different types of normal data.
  • DeepMAD's novel training: By treating other normal classes as "anomalous" during the training of each individual class's detector, DeepMAD learns more discriminative features that are robust to variations within the normal data distribution. This leads to more compact representations and better performance.
  • Impact of class combinations: The performance of anomaly detection algorithms can be highly sensitive to which specific classes are designated as normal. DeepMAD shows more consistent performance across different class combinations compared to other methods.

Key Results

  • DeepMAD outperforms baselines: Across CIFAR-10, fMNIST, and RECYCLE datasets, DeepMAD consistently achieves higher AUC values compared to DROCC and DeepSVDD, and their multi-class adapted versions (DROCC(m) and DeepSVDD(m)). For example, on CIFAR-100, DeepMAD shows about a 10% improvement in AUC.
  • Algorithm 2 beats Algorithm 1: The paper provides theoretical proof and empirical evidence that training a single classifier on combined normal data (Algorithm 2) is superior to using multiple independent classifiers (Algorithm 1).
  • Low variance for DeepMAD: DeepMAD demonstrates notably lower variance in its AUC scores across different class combinations, indicating more stable and reliable performance.

Limitations and Future Work

  • AUC below 0.7: The paper acknowledges that for many cases, AUC values remain below 0.7, indicating room for improvement. Addressing this is a major thrust for future work.
  • Feature analysis: The authors have taken a first step in analyzing the learned feature vectors to understand where algorithms fail. They hope this methodology can be extended by others.
  • Scalability to very few classes: While the paper focuses on multi-class settings, the performance implications for scenarios with a very small number of normal classes (e.g., 2) might warrant further investigation.
  • Code availability: The authors have made their code available at https://anonymous.4open.science/r/DeepMAD-16D4/, which is crucial for reproducibility and further research.

Summary updated

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