Source-linked AI summary

A Survey on GANs for Anomaly Detection

Federico Di Mattia, Paolo Galeone, Michele De Simoni, Emanuele Ghelfi

arXiv:1906.11632v2cs.LGstat.ML

TL;DR

Anomaly detection must identify unseen patterns that depart from normal behavior. This paper surveys and empirically evaluates GAN-based methods, implementing them in a shared TensorFlow codebase. The authors report verifying the approach’s effectiveness, identifying differences from original papers and public code, and providing a modular toolkit; AnoGAN results were not reproduced because of computational demands.

  • Problem

    Identifying unseen patterns that depart from normal behavior is a challenging anomaly-detection problem across several research areas.

    Source: §1 · p. 1
  • Method

    The paper surveys principal GAN-based anomaly-detection methods and implements and evaluates them in a shared TensorFlow framework and codebase.

    Source: §4 · p. 8
  • Results

    The authors report verifying GAN-based anomaly detection’s effectiveness while finding differences between original papers and publicly available code.

    Source: §4 · p. 8
  • Takeaways & Limitations

    The work provides a modular, ready-to-go open-source toolkit for anomaly detection using GANs.

    Source: §4 · p. 8

    AnoGAN results were not reproduced because its computational requirements made training and testing intensively time-consuming.

    Source: §3.2 · p. 7

Abstract

from arXiv · show

Anomaly detection is a significant problem faced in several research areas. Detecting and correctly classifying something unseen as anomalous is a challenging problem that has been tackled in many different manners over the years. Generative Adversarial Networks (GANs) and the adversarial training process have been recently employed to face this task yielding remarkable results. In this paper we survey the principal GAN-based anomaly detection methods, highlighting their pros and cons. Our contributions are the empirical validation of the main GAN models for anomaly detection, the increase of the experimental results on different datasets and the public release of a complete Open Source toolbox for Anomaly Detection using GANs.

1. Introduction

The introduction frames GAN-based anomaly detection as modeling normal behavior and scoring deviations, then introduces GANs, conditional GANs, and BiGAN as foundations for the surveyed approaches.

1. Introduction

  • GAN-based anomaly detection models normal behavior adversarially and detects anomalies by measuring an anomaly score.The introduction says the surveyed approaches build on Adversarial Feature Learning and BiGAN.Source: §1 · p. 1

1.1. GANs

  • GANs train a generator to capture the data distribution and a discriminator to distinguish training data from generated samples in a min-max game.Source: §1.1 · p. 1

1.2. Conditional GANs

  • Conditional GANs feed auxiliary information y to the generator, discriminator, or both to condition generation or discrimination.Source: §1.2 · pp. 1–2

1.3. BiGAN

  • BiGAN adds an encoder that learns the inverse of the generator, jointly mapping between latent space and data space.Its discriminator distinguishes pairs (G(z), z) and (x, E(x)); Figure 1 depicts its structure.Source: §1.3 · p. 2, Figure 1 · p. 2

2. GANs for anomaly detection

The survey reviews image-focused GAN anomaly detectors, from AnoGAN’s per-sample latent search to encoder-based alternatives EGBAD and GANomaly. It describes their detection mechanisms and trade-offs, including test-time cost and how anomaly scores are formed.

2. GANs for anomaly detection

  • AnoGAN, EGBAD, and GANomaly are successive GAN-based approaches, with EGBAD reported faster than AnoGAN and GANomaly surpassing EGBAD on evaluation metrics and execution speed.The analyzed architectures focus mostly on images.Source: §2 · p. 2

2.1. AnoGAN

  • AnoGAN trains on positive samples and iteratively searches latent space for a reconstruction matching each query; the terminal loss is its anomaly score, requiring Γ optimization steps per input.Its search minimizes a weighted residual and discriminator loss; higher, unbounded scores indicate greater anomaly likelihood.Source: §2.1 · pp. 2–3

Pros

  • AnoGAN demonstrated GAN-based anomaly detection and introduced a latent-to-input mapping scheme used to define its anomaly score.The survey lists these as AnoGAN’s contributions.Source: Pros · p. 3

Cons

  • AnoGAN’s per-input optimization hurts test-time performance, while its objective does not learn the inverse mapping and its score is not probabilistic.The score has no upper bound.Source: Cons · p. 3, §2.1 · p. 3

2.2. EGBAD

  • EGBAD brings BiGAN to anomaly detection by jointly learning an encoder and generator, enabling anomaly scoring without AnoGAN’s Γ inference-time optimization steps.Its contribution is to learn the encoder during adversarial training.Source: §2.2 · p. 3

2.3. GANomaly

  • GANomaly uses an encoder-decoder reconstruction path followed by a second encoder; anomalous inputs are reconstructed as normal, making image differences highlight anomaly locations.The second encoder helps learn image representations that support reconstruction.Source: §2.3 · pp. 3–4
  • GANomaly combines three generator losses that optimize different parts of the architecture and uses an encoder loss for its test-time anomaly score.The survey identifies this combination and score as contributions of the approach.Source: §2.3 · pp. 4–5, Cons · p. 5

2.3.1. PROS AND CONS Pros

  • GANomaly’s learned encoder avoids AnoGAN-style test-time search; its autoencoder structure is described as faster, while latent- and image-space anomaly scores may disagree.The survey also lists score interpretability and contextual-loss localization among its stated advantages.Source: §2.3.1 · p. 5, Cons · p. 5

3. Experiments

The authors reimplemented GAN-based anomaly detectors in TensorFlow and evaluated them on four datasets, reporting empirical results while noting implementation differences and computational constraints.

3. Experiments

  • The evaluation reimplemented the algorithms in TensorFlow and released a publicly available anomaly-detection toolbox.The experiments used the best empirically obtained results, which do not necessarily come from theoretically correct configurations.Source: §3 · p. 5

3.2. Results

  • BiGAN/EGBAD’s correct implementation performed worse than version 2’s reference architecture, despite known errors in that architecture.The authors report their version 1 correct implementation had worse results than version 2, which used the reference architecture containing known errors.Source: §3 · p. 6

3.1.1. DATASETS

  • Experiments used MNIST, Fashion-MNIST, CIFAR-10, and KDD99; the KDDCUP99 10-percent subset treated normal connections as anomalies because anomalies were more prevalent.For MNIST and Fashion-MNIST, each class was considered anomalous in turn, with the remaining classes treated as normal.Source: §3.1.1 · p. 6

3.1.2. METHODOLOGY

  • For each class, the methodology shuffled the combined dataset, assigned 80% to training and 20% to testing, and evaluated on normal and anomalous examples.The authors followed the methodology in Zenati et al.’s official code.Source: §3.1.2 · p. 6

3.2. Results

  • All tests used AUPRC, and model selection was applied to BiGAN and GANomaly but not AnoGAN, whose per-image latent search required 500 training steps.AnoGAN results were not reproduced because its training and testing were considered too time-consuming.Source: §3.2 · pp. 6–7
  • Figure 5 reports MNIST and Fashion-MNIST AUPRC for BiGAN/EGBAD and GANomaly using each model’s best result across the tested training types.The BiGAN/EGBAD tests varied training and testing losses, while GANomaly used a leaner set of combinations.Source: Figure 5 · p. 7, §3.2 · p. 7

4. Conclusions

The paper evaluates GAN-based anomaly-detection algorithms in a unified TensorFlow codebase and provides a modular, publicly available toolbox.

4. Conclusions

  • The authors implemented and evaluated state-of-the-art GAN-based anomaly-detection algorithms.Source: §4 · p. 8
  • The three major works were unified under TensorFlow and one codebase, enabling analysis of their effectiveness and differences from their original papers and public code.Source: §4 · p. 8
  • The work provides a modular, ready-to-go anomaly-detection toolkit for users seeking an out-of-the-box solution.The toolbox is publicly released.Source: §4 · p. 8

A. Additional Results

Additional experiments examine BiGAN/EGBAD and GANomaly pipeline combinations, GANomaly on CIFAR-10, and an omitted EGBAD encoder activation.

A. Additional Results

  • The additional results cover BiGAN/EGBAD and GANomaly training-testing combinations on MNIST and Fashion-MNIST, plus GANomaly on CIFAR-10.Source: A. Additional Results · p. 9
  • The authors tested adding a Leaky ReLU activation to the first encoder layer because it was absent from the published EGBAD code.Source: A. Additional Results · p. 9
  • The tests found that the network performed better without the added activation function.Source: A. Additional Results · p. 9

A.1. Version 1

Version 1 used an alternate BiGAN test pipeline and architecture, added an encoder activation missing from the published EGBAD code, and reported configuration combinations.

A.1. Version 1

  • Version 1 used a different BiGAN architecture and test pipeline from the later results.Source: §A.1 · p. 9
  • Testing ran twice for BiGAN/EGBAD and GANomaly: during training for model selection and again after training as a standalone phase.Source: §A.1 · p. 9
  • Version 1 inserted a Leaky ReLU after the encoder’s first convolutional layer, which the authors say was missing from the original EGBAD work.Tables 4 and 5 show the BiGAN/EGBAD and GANomaly configurations with testing performed separately.Source: §A.1 · p. 9, Table 4 · p. 9, Table 5 · p. 9

A.1.1. MNIST

The MNIST section presents results for BiGAN/EGBAD and GANomaly, with figures describing their evaluation measures and training or testing configurations.

A.1.1. MNIST

  • The section presents results for both BiGAN/EGBAD and GANomaly on MNIST..Source: §A.1.1 · p. 10
  • Figure 6 reports BiGAN/EGBAD performance on MNIST using AURPC across configurations with and without residual loss and with BCE or feature-matching (FM) training and testing metrics.The caption labels the configurations b(r)tb, b(r)tf, f(r)tb, and f(r)tf.Source: Figure 6 · p. 10
  • Figure 7 presents GANomaly results on MNIST, with tests using a BCE metric and training using BCE and FM losses.The AURPC measure is specified by the figure-caption continuation.Source: Figure 7 · p. 10, §A.1.1 · p. 10

A.1.2. FASHION-MNIST

The Fashion-MNIST section presents results for BiGAN/EGBAD and GANomaly, with figure captions specifying evaluation measures and training or testing configurations.

A.1.2. FASHION-MNIST

  • The section presents results for BiGAN/EGBAD and GANomaly on Fashion-MNIST..Source: §A.1.2 · p. 11
  • Figure 8 reports BiGAN/EGBAD performance on Fashion-MNIST using AURPC across configurations with and without residual loss and with BCE or FM training and testing metrics.The caption labels the configurations b(r)tb, b(r)tf, f(r)tb, and f(r)tf.Source: Figure 8 · p. 11
  • Figure 9 presents GANomaly results on Fashion-MNIST, tested with a BCE metric and trained with BCE and FM losses, using AURPC..Source: Figure 9 · p. 11

A.1.3. CIFAR10

The CIFAR10 section presents GANomaly results, with the figure caption specifying its test metric and training losses.

A.1.3. CIFAR10

  • The section identifies Figure 10 as presenting results on CIFAR10..Source: §A.1.3 · p. 12
  • Figure 10 presents GANomaly results on CIFAR10, with tests using a BCE metric and training using BCE and FM losses..Source: Figure 10 · p. 12

A.2. Version 2

Version 2 returns to the original EGBAD and reports much better results, while describing differences in testing and activation-function choices.

A.2. Version 2

  • The original EGBAD version in Appendix A.2 is reported to have much better results, even without an activation function in the first convolutional layer..Source: §A.2 · p. 13
  • Testing is applied only once during model selection in training..Source: §A.2 · p. 13
  • Leaky ReLU is omitted, as in the original EGBAD paper..Source: §A.2 · p. 13
  • The section refers readers to Sections 1.3 and 2.3 for the training and testing pipelines..Source: §A.2 · p. 13

A.2.1. MNIST

The appendix presents anomaly-detection results for BiGAN/EGBAD and GANomaly on MNIST and Fashion-MNIST, and for GANomaly on CIFAR10.

A.2.1. MNIST

  • MNIST plots report BiGAN/EGBAD performance by AUPRC and GANomaly results using BCE testing with BCE- and feature-matching-loss training.The BiGAN/EGBAD plot compares settings with and without residual loss and varies training and testing metrics.Source: Figure 11 · p. 13, §A.2.1 · p. 13, Figure 12 · p. 14

A.2.2. FASHION-MNIST

  • Fashion-MNIST plots show BiGAN/EGBAD performance and GANomaly results using BCE testing with BCE- and feature-matching-loss training.The BiGAN/EGBAD plot compares settings with and without residual loss and varies training and testing metrics.Source: Figure 13 · p. 15, Figure 14 · p. 15, §A.2.2 · p. 15

A.2.3. CIFAR10

  • The CIFAR10 plot presents GANomaly results using BCE testing and training with either BCE loss or feature-matching loss.Source: Figure 15 · p. 16
Loading 1906.11632v2…