OMASGAN: Out-of-Distribution Minimum Anomaly Score GAN for Sample\n Generation on the Boundary

Nikolaos Dionelis, Mehrdad Yaghoobi, Sotirios A. TsaftarisarXiv 2021 · DOI · arXiv

TL;DR

OMASGAN (Out-of-Distribution Minimum Anomaly Score GAN) improves anomaly detection by intentionally generating "strong" synthetic anomalies right on the edge of the normal data distribution. By retraining the model to distinguish these hard-to-classify boundary samples from real data, OMASGAN achieves state-of-the-art performance on standard benchmarks like MNIST and CIFAR-10.

What Problem Does This Paper Address?

Anomaly Detection (AD) is the task of identifying data points that deviate from the "normal" distribution. While Generative Adversarial Networks (GANs) are popular for this, they suffer from a fundamental flaw: they are trained to assign high probability to seen data, but they aren't explicitly trained to assign zero probability to unseen, out-of-distribution (OoD) data. Consequently, GANs often assign high likelihood or low reconstruction error to anomalies, leading to "false negatives" where the model misses the very things it was meant to find.

Furthermore, real-world anomalies are rare. Most AD models are trained only on "normal" data. Without examples of what an anomaly looks like, the model's "boundary" for normality remains fuzzy. Previous attempts to create "pseudo-anomalies" often used weak examples (like blurry images or simple rotations) that don't effectively challenge the model to learn a precise boundary.

Methods

The authors propose a three-task optimization framework:

  1. Task 1: Establishing the Metric. They train a standard f-GAN (a generalized GAN using f-divergences) to learn the underlying distribution of the normal data.
  2. Task 2: Boundary Formation. This is the core innovation. They train a separate "boundary generator" ($B(z)$) to find OoD samples that have the minimum possible anomaly score. These are "strong" anomalies—points that are technically outside the normal distribution but are as close to it as possible. To prevent these points from all clustering in one spot (mode collapse), they include a "dispersion" term to ensure the generated boundary covers the entire shape of the data.
  3. Task 3: Active Negative Retraining. The model is retrained using these boundary samples as "negative" examples. A final discriminator ($J(x)$) is trained to separate the real normal data from these generated boundary anomalies.

For inference, the model uses a combined Anomaly Score (AS) that looks at both the discriminator's output and the statistical divergence from the learned normal distribution.

Datasets

The researchers evaluated OMASGAN using:

  • Synthetic 2D Data: Used to visualize how the model successfully identifies boundaries around complex, multimodal (multi-clustered) data.
  • MNIST: A dataset of handwritten digits.
  • CIFAR-10: A more complex dataset of various objects (planes, cars, birds, etc.).

They primarily used the Leave-One-Out (LOO) methodology, which is more rigorous than standard one-class classification. In LOO, one class is held out as the "anomaly," and the model is trained on all other classes as "normal."

Key Insights and Ideas

  • The "Boundary" is the Key: The most useful anomalies for training aren't random noise; they are the points right on the edge of the manifold. Training on these "adversarial" anomalies forces the model to define the limits of "normality" much more sharply.
  • Flexibility through f-divergence: Unlike previous methods that might require specific, invertible architectures, OMASGAN works with any f-divergence (like KL-divergence or Pearson Chi-Squared). This makes the framework highly adaptable to different GAN formulations.
  • Self-Supervised Negative Augmentation: The model essentially creates its own "hard" training set. It doesn't need humans to define what an anomaly looks like or use manual image transforms (like flipping or rotating); it learns the boundary mathematically.
  • Handling Disconnected Modes: By using a dispersion measure in Task 2, the model can find boundaries for data that exists in several separate clusters, a common challenge for generative models.

Key Results

OMASGAN significantly outperformed existing benchmarks in terms of the Area Under the Receiver Operating Characteristic curve (AUROC):

  • MNIST: Achieved an average AUROC of 0.85, an improvement of at least 0.24 points over other benchmark models (like EGBAD and AnoGAN).
  • CIFAR-10: Achieved an average AUROC of 0.71, outperforming state-of-the-art models by roughly 0.07 points (an 11% relative improvement).
  • Robustness: The model showed much lower variance (standard deviation) in performance across different classes compared to its competitors, suggesting it is more reliable regardless of which specific category is considered "normal."

Limitations and Future Work

  • Computational Complexity: The three-stage training process (Initial GAN -> Boundary Generation -> Retraining) is more computationally expensive than training a single-pass model.
  • Hyperparameter Tuning: While the authors state the model is relatively robust, Task 2 introduces new hyperparameters ($\mu$ and $\nu$) to balance boundary proximity and dispersion, which may require careful tuning for new types of data.
  • Scaling to High Resolution: The experiments were conducted on relatively low-resolution image datasets (MNIST and CIFAR-10). Future work could explore how this boundary-seeking approach scales to high-definition imagery or non-image data like time-series or logs.

Summary updated

Abstract

Generative models trained in an unsupervised manner may set high likelihood\nand low reconstruction loss to Out-of-Distribution (OoD) samples. This\nincreases Type II errors and leads to missed anomalies, overall decreasing\nAnomaly Detection (AD) performance. In addition, AD models underperform due to\nthe rarity of anomalies. To address these limitations, we propose the OoD\nMinimum Anomaly Score GAN (OMASGAN). OMASGAN generates, in a negative data\naugmentation manner, anomalous samples on the estimated distribution boundary.\nThese samples are then used to refine an AD model, leading to more accurate\nestimation of the underlying data distribution including multimodal supports\nwith disconnected modes. OMASGAN performs retraining by including the abnormal\nminimum-anomaly-score OoD samples generated on the distribution boundary in a\nself-supervised learning manner. For inference, for AD, we devise a\ndiscriminator which is trained with negative and positive samples either\ngenerated (negative or positive) or real (only positive). OMASGAN addresses the\nrarity of anomalies by generating strong and adversarial OoD samples on the\ndistribution boundary using only normal class data, effectively addressing mode\ncollapse. A key characteristic of our model is that it uses any f-divergence\ndistribution metric in its variational representation, not requiring\ninvertibility. OMASGAN does not use feature engineering and makes no\nassumptions about the data distribution. The evaluation of OMASGAN on image\ndata using the leave-one-out methodology shows that it achieves an improvement\nof at least 0.24 and 0.07 points in AUROC on average on the MNIST and CIFAR-10\ndatasets, respectively, over other benchmark and state-of-the-art models for\nAD.\n
BibTeX
@misc{dionelis2021omasgan,
  author = {Nikolaos Dionelis and Mehrdad Yaghoobi and Sotirios A. Tsaftaris},
  title = {{OMASGAN: Out-of-Distribution Minimum Anomaly Score GAN for Sample\textbackslash\{\}n Generation on the Boundary}},
  year = {2021},
  eprint = {2110.15273},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.15273},
}
Figure