Title: GENERATIVE ENSEMBLES FOR ROBUST ANOMALY DETECTION Anonymous

Abstract: Deep generative models are capable of learning probability distributions over large, high-dimensional datasets such as images, video and natural language. Generative models trained on samples from p(x) ought to assign low likelihoods to out-of-distribution (OoD) samples from q(x), making them suitable for anomaly detection applications. We show that in practice, likelihood models are themselves susceptible to OoD errors, and even assign large likelihoods to images from other natural datasets. To mitigate these issues, we propose Generative Ensembles, a model-independent technique for OoD detection that combines density-based anomaly detection with uncertainty estimation. Our method outperforms the Outof-DIstribution detector for Neural networks (ODIN) and Variational Information Bottleneck (VIB) baselines on image datasets, and achieves comparable performance to a classification model on the Kaggle Credit Fraud dataset.

1. INTRODUCTION:

Knowing when a machine learning (ML) model is qualified to make predictions on an input is critical to safe deployment of ML technology in the real world. When training and test distributions differ, neural networks may provide -with high confidence -arbitrary predictions on inputs that they are unaccustomed to seeing. To mitigate these Out-of-Distribution (OoD) errors, we require methods to determine whether a given input is sampled from a different stochastic generator than the one used to train the model.

OoD detection techniques have broad applications beyond safe deployment of ML technology. As datasets for ML grow ever larger and trend towards automated data collection, we require scalable methods for identifying outliers and quantifying noise before we can attempt to train models on that data. Identifying anomalies in data is a crucial feature of many data-driven applications, such as credit fraud detection and monitoring patient data in medical settings.

Generative modeling algorithms have improved dramatically in recent years, and are capable of learning probabilistic models over large, high-dimensional datasets such as images, video, and natural language (Vaswani et al., 2017; Wang et al., 2018) . A generative model p θ (x), parameterized by random variable θ and trained to approximate data distribution p(x), ought to assign low likelihoods to samples from any distribution q(x) that differs from p(x). Density estimation does not presuppose a specific "alternate" distribution at training time, making it an attractive alternative to classification-based anomaly detection methods.

In this work, we apply several classes of generative models to OoD detection problems and demonstrate a significant shortcoming to high-dimensional density estimation models: the anomaly detection model itself may be mispecified. Explicit likelihood models can, in practice, realize high likelihoods to adversarial examples, random noise, and even other natural image datasets. We also illustrate how GAN discriminators presuppose a particular OoD distribution, which makes them particularly fragile at OoD classification. We propose Generative Ensembles, which combine density estimation with uncertainty estimation to detect OoD in a robust manner. Generative Ensembles are model-independent and are trained independently of the task-specific ML model of interest. Our method outperforms task-specific OoD baselines on the majority of evaluated OoD tasks and demonstrate competitive results with discriminative classification approaches on the Kaggle Credit Fraud dataset.

2. GENERATIVE ENSEMBLES:

We consider several classes of generative modeling techniques in our experiments. Autoregressive Models and Normalizing Flows (NF) are fully-observed likelihood models that construct a tractable log-likelihood approximation to the data-generating density p(x) (Uria et al., 2016; Dinh et al., 2014; Rezende & Mohamed, 2015) . Variational Autoencoders (VAE) are latent variable models that maximize a variational lower bound on log density (Kingma & Welling, 2013; Rezende et al., 2014) . Finally, Generative Adversarial Networks (GAN) are implicit density models that minimize a divergence metric between p(x) and generative distribution q θ (x) (Goodfellow et al., 2014) . We refer to a GAN's generative distribution as q θ (x) (in lieu of p θ (x)) because from the GAN discriminator's point of view, the outputs of the generator are OoD and depend on θ.

Although log p(x) and its lower bounds are proper scoring methods (Lakshminarayanan et al., 2017) , we approximate them in practice with continuous-valued neural network function approximators log p θ (x). Neural networks have non-smooth predictive distributions, which makes them susceptible to malformed inputs that exploit idiosyncratic computation within the model (Szegedy et al., 2013) .

Likelihood function approximators are no exception. When judging natural images, we assume an OoD input x ∼ q(x) should remain OoD within some L P -norm, and yet a Fast Gradient Sign Method (FGSM) attack (Goodfellow et al., 2015) on the predictive distribution can realize extremely high likelihood predictions (Nguyen et al., 2015) . Conversely, a FGSM attack in the reverse direction on an in-distribution sample x ∼ p(x) creates a perceptually identical input with low likelihood predictions (Kos et al., 2018) . To make matters worse, we show in Figure 1 that likelihood models can be fooled by OoD samples that are not even adversarial by construction, such as SVHN test images on a likelihood model trained on CIFAR-10. Concurrent work by Nalisnick et al. (2018) also show this phenomena and present additional analyses on why generative models systematically assign higher likelihoods to SVHN. 2017), we elect to use independently trained ensembles instead of a Bayesian Dropout approximation (Gal & Ghahramani, 2016) . For generative models that admit exact likelihoods (or variational approximations), the ensemble can be used to implement the Watanabe-Akaike Information Criterion (WAIC), which consists of a density estimation score with a Bayesian correction term for model bias (Watanabe, 2010) :

WAIC(x) = E θ [log p θ (x)] -Var θ [log p θ (x)]

(1)

2.1. OOD DETECTION WITH GAN DISCRIMINATORS:

We describe how to construct Generative Ensembles based on implicit density models such as GANs, and highlight the importance of OoD detection approaches that do not presuppose a specific OoD distribution. A discriminative model tasked with classifying between p(x) and q(x) is fragile to inputs that lie in neither distribution. Figure 2b illustrates a simple 2D density modeling task where individual GAN discriminators -when trained to convergence -learn a discriminative boundary that does not adequately capture p(x).

However, unlike discriminative anomaly classifiers on a static datasets, which model p(x)/q(x), the likelihood ratio p(x)/q θ (x) implicitly assumed by a GAN discriminator is uniquely randomized by GAN training dynamics on θ. By training an ensemble of GANs we can estimate the posterior distribution over model decision boundaries p(x)/q θ (x), or equivalently, the posterior distribution over alternate distributions q θ (x). In other words, we can use uncertainty estimation on randomly sampled discriminators to de-correlate the OoD classification errors made by a single discriminator (Figure 2c ). To ensure that the GAN discriminators form a clear discriminative boundary between p(x) and q θ (x), we train the discriminators an additional 10k steps to convergence. Each of these boundaries fails to enclose the true data distribution. (c) Predictive uncertainty over an ensemble of discriminators "fences in" the shared, low-variance region corresponding to p(x).

3. RELATED WORK:

We can categorize existing OoD detection techniques in Table 1 using two criteria: (1) Does it assume a specific anomaly distribution? (2) Is the technique specific to the model, or does it only depend on the inputs to the model?

A common approach to OoD detection (a.k.a. anomaly detection) is to label a dataset of anomalous data and train a binary classifier on that label. Alternatively, a classification task model may be augmented with a "None of the above" class. The classifier then learns a decision boundary (likelihood ratio) between p(x) and q(x). However, the discriminative approach to anomaly detection requires the anomaly distribution to be specified at training time; this is a severe flaw when anomalous data is rare (e.g. medical seizures) or non-stationary (e.g. generated by an adversary).

3.1. UNCERTAINTY ESTIMATION:

OoD detection is closely related to the problem of uncertainty estimation, whose goal is to yield calibrated confidence measures for a model's predictive distribution p θ (y|x). Well-calibrated uncertainty estimation integrates several forms of uncertainty into p θ (y|x): model mispecification un- certainty (OoD detection of invalid inputs), aleatoric uncertainty (irreducible input noise for valid inputs), and epistemic uncertainty (unknown model parameters for valid inputs). In this paper, we study OoD detection in isolation; instead of considering whether p θ (y|x) should be trusted for a given x, we are trying to determine whether x should be fed into p θ (y|x) at all.

Predictive uncertainty estimation is a model-dependent OoD technique because it depends on taskspecific information (such as labels and task model architecture) in order to yield an integrated estimate of uncertainty. ODIN (Liang et al., 2017) , MC Dropout (Gal & Ghahramani, 2016) and DeepEnsemble (Lakshminarayanan et al., 2017) model a calibrated predictive distribution for a classification task. Variational information bottleneck (VIB) (Alemi et al., 2018b) performs divergence estimation in latent space to detect OoD, but is technically a model-dependent technique because the latent code is trained jointly with the downstream classification task.

One limitation of model-dependent OoD techniques is that they may discard information about p(x) in learning the task-specific loss function p θ (y|x). Consider a contrived binary classification model on images that learns to solve the task perfectly by discarding all information except the contents of the first pixel (no other information is preserved in the features). Subsequently, the model yields confident predictions on any distribution that happens to preserve identical first-pixel statistics. In contrast, density estimation in data space x considers the structure of the entire input manifold, without bias towards a particular downstream task or task-specific compression.

In our work we estimate predictive uncertainty of the scoring model itself. Unlike predictive uncertainty methods applied to the task model's predictions, Generative Ensembles do not require task-specific labels to train. Furthermore, model-independent OoD detection aids interpretation of predictive uncertainty by isolating the uncertainty component arising from OoD inputs.

3.2. ADVERSARIAL DEFENSE:

Song et al. ( 2017) make the observation that adversarial examples designed to fool a downstream task have low likelihood under an independent generative model. They propose a "data purification" pipeline where inputs are first modified via gradient ascent on model likelihood, before passing it to the unmodified classifier. Their evaluations are restricted to L p -norm attacks on in-distribution inputs to the task model, and do not take into account that the generative model itself may be susceptible to OoD errors. In fact, a preprocessing step with gradient ascent on model likelihood has the exact opposite of the desired effect when the input is OoD to begin with.

Our work considers adversarial defense in a broader OoD context. Although adversarial attacks literature typically considers small L p -norm modifications to input (demonstrating the alarming sensitivity of neural networks), there is no such restriction in practice to the degree with which an input can be perturbed in a test setting. Adversarial defense is nothing more than making ML models robust to OoD inputs; whether they come from an attacker or not is irrelevant. We evaluate our methods on simple OoD transformations (flipping images), common ML datasets, and the adversaraial setting where a worst-case input is created from a single model in the ensemble. He et al. (2017) demonstrate that ensembling adversarial defenses does not completely mitigate local sensitivity of neural networks. It is certainly plausible that sufficient search over a Generative Ensemble's predictions can find OoD inputs with both low variance and high likelihood. The focus of our work is to measure the extent to which uncertainty estimation improves robustness to model mispecification error, not to present a provably secure system. Having said that, model-independent OoD detection is easy to obfuscate in a practical ML security setting since the user only has access to the task model. Furthermore, a Generative Ensemble's WAIC estimate can be made more robust by sampling additional models from the posterior over model parameters.

4. EXPERIMENTAL RESULTS:

Following the experiments proposed by Liang et al. (2017) and Alemi et al. (2018b) , we train OoD models on MNIST, Fashion MNIST, CIFAR-10 datasets, and evaluate anomaly detection on test samples from other datasets. In line with the aforementioned works, we measure anomaly detection capability based on AUROC over several quantities shown in Table 2 . Our proposed quantities include single Wasserstein GAN (WGAN) discriminators (Arjovsky et al., 2017) with fine-tuning (D), ensemble variance of discriminators (Var(D)), likelihood models (log p θ (x)), and WAIC estimated using an ensemble of likelihood models. We follow the protocol as suggested by Lakshminarayanan et al. ( 2017) to use 5 independent models with different parameter initializations, trained on the full training set (no bootstrap). For likelihood estimators based on variational autoencoders (VAE), we also evaluate the rate term D KL (q θ (z|x) p(z)), which corresponds to information loss between the latent inference distribution and prior.

For MNIST and Fashion MNIST datasets, we use a VAE to predict a 16-sample Importance Weighted AutoEncoder (IWAE) bound. We extend the VAE example code1 from Tensorflow Probability (Dillon et al., 2017) to use a Masked Autoregressive Flow prior (Papamakarios et al., 2017) , and train the model for 5k steps. Additional architectural details are found in Appendix B.

Our WGAN model's generator and discriminator share the same architecture with the VAE decoder and encoder, respectively. The discriminator has an additional linear projection layer to its prediction of the Wasserstein metric. To ensure D represents a meaningful discriminative boundary between the two distributions, we freeze the generator and fine-tune the discriminator for an additional 4k steps on stationary p(x) and q θ (x). We also include Gaussian noise adversarially perturbed by FGSM on a single model (Adversarial).

For CIFAR-10 WGAN experiments, we change the first filter size in the discriminator from 7 to 8. For log-likelihood estimation, we train a vanilla GLOW model (Kingma & Dhariwal, 2018) for 250k steps, as we require a more powerful generative model to obtain good results.

The baseline methods are model-dependent and learn from the joint distribution of images and labels, while our methods use only images. For the VIB baseline, we use the rate term as the threshold variable. The experiments in Alemi et al. (2018b) make use of (28, 28, 5) "location-aware" features concatenated to the model inputs, to assist in distinguishing spatial inhomogeneities in the data. In this work we train vanilla generative models with no special modifications, so for fair comparison we also train VIB without location-aware features. For CIFAR-10 experiments, we train VIB for 26 epochs and converge at 75.7% classification accuracy on the test set. All other experimental parameters for VIB are identical to those in Alemi et al. (2018b) .

Despite being trained on strictly less data (no labels), our methods -in particular Generative Ensembles -outperform ODIN and VIB on most OoD tasks. The VAE rate term appears to be quite effective, outperforming likelihood and WAIC estimation in data space. It is robust to adversarial inputs on the same model, because the FGSM perturbation primarily minimizes the (larger) distortion component of the approximate likelihood. The performance of VAE rate versus VIB rate also suggests that latent codes learned from generative objectives are more useful for OoD detection that latent codes learned via a classification-specific objective.

4.1. FAILURE ANALYSIS:

In this section we discuss the experiments in which Generative Ensembles performed poorly, and suggest simple fixes to address these issues.

Table 2 : We train models on MNIST, Fashion MNIST, and CIFAR-10 and compare OoD classification ability to baseline methods using the threshold-independent Area Under ROC curve metric (AUROC). D corresponds to single WGAN discriminators with 4k fine-tuning steps on stationary p(x), q(x). Var(D) is uncertainty estimated by an ensemble of discriminators. Rate is the D KL term in the VAE objective. log p θ (x) is a single likelihood model (VAE, GLOW). WAIC is the Watanabe-Akaike Information Criterion as estimated by the Generative Ensemble. ODIN results reproduced from Liang et al. (2017) In an earlier draft of this work, a VAE trained on Fashion MNIST performed poorly on all OoD datasets when using log p θ (x) and WAIC metrics. This was surprising, since the same metrics performed well when the same VAE architecture was trained on MNIST. To explain this phenomenon, we show in Figure 3 inputs and VAE-decoded outputs from Fashion MNIST and MNIST test sets. Fashion MNIST images are reconstructed properly, while MNIST images are are barely recognizable after decoding.

A VAEs training objective can be interpreted as the sum of a pixel-wise autoencoding loss (distortion) and a "semantic" loss (rate). Even though Fashion MNIST appears to be better reconstructed in a semantic sense, the distortion values between the FMNIST and MNIST test datasets are numerically quite similar, as shown in Figure 3 . Distortion terms make up the bulk of the IWAE predictions in our models, thus explaining why log p θ (x) was not very discriminative when classifying OoD MNIST examples. Higgins et al. (2016) propose β-VAE, a simple modification to the standard VAE objective: p(x|z) + β • D KL (q θ (z|x) p(z)). β controls the relative balance between rate and distortion terms during training. Setting β < 1 is a commonly prescribed fix for encouraging VAEs to approach the "autoencoding limit" and avoid posterior collapse (Alemi et al., 2018a) . At test time, this results in higher-fidelity autoencoding at the expense of higher rates, which seems to be a more useful signal for identifying outliers than the total pixel distortion (also suggested by 

4.2. CREDIT CARD ANOMALY DETECTION:

We consider the problem of detecting fraudulent credit card transactions from the Kaggle Credit Fraud Challenge (Dal Pozzolo et al., 2015) . A conventional approach to fraud detection is to include a small fraction of fraudulent transactions in the training set, and then learn a discriminative classifier. Instead, we treat fraud detection as an anomaly detection problem where a generative model only sees normal credit card transactions at training time. This is motivated by realistic test scenarios, where an adversary is hardly restricted to generating data identically distributed to the training set.

We compare single likelihood models (16-sample IWAE) and Generative Ensembles (ensemble variance of IWAE) to a binary classifier baseline that has access to a training set of fraudulent transactions in Table 3 . The classifier baseline is a fully-connected network with 2 hidden ReLU layers of 512 units, and is trained using a weighted sigmoid cross entropy loss (positive weight=580) with Dropout and RMSProp (α = 1e-5). The VAE encoder and decoder are fully connected networks with single hidden layers (32 and 30 units, respectively) and trained using Adam (α = 1e-3).

Unsurprisingly, the classifier baseline performs best because fraudulent test samples are distributed identically to fraudulent training samples. Even so, the single-model density estimation and Generative Ensemble achieve reasonable results. 

A TERMINOLOGY AND ABBREVIATIONS p(x):

Training data distribution q(x)

OoD data distribution p θ (x)

Learned approximation of true distribution with parameters θ. May be implicitly specified, i.e. a fully-observed density model q θ (x)

Learned approximation of OoD distribution with parameters θ. May be implicitly specified, i.e. via a GAN discriminator that learns p(x)/q θ (x) 

B VAE ARCHITECTURAL DETAILS:

We use a flexible learned prior p θ (z) in our VAE experiments, but did not observe a significant performance difference compared to the default mixture prior in the base VAE code sample. We use an alternating chain of 6 MAF bijectors and 6 random permutation bijectors. Each MAF bijector uses TensorFlow Probability's default implementation with the following parameter: Models are trained with Adam (α = 1e-3) with cosine decay on learning rate.

:

https://github.com/tensorflow/probability/blob/master/tensorflow_ probability/examples/vae.py

Figures and Tables:

Figure 1: Left: density estimation models are not robust to OoD inputs. A GLOW model (Kingma & Dhariwal, 2018) trained on CIFAR-10 assigns much higher likelihoods to samples from SVHN than samples from CIFAR-10. Right: We use ensembles of generative models to implement the Watanabe-Akaike Information Criterion (WAIC), which combines density estimation with uncertainty estimation. Histograms correspond to predictions over test sets from each dataset.

Figure 2: In this toy example, we learn generative models for a 2D multivariate normal with identity covariance centered at (5, 5). (a) Explicit density models such as Normalizing Flows concentrate probability mass at the data distribution (b) Four independently trained GANs learn random discriminative boundaries, each corresponding to a different implied generator distribution. To ensure that the GAN discriminators form a clear discriminative boundary between p(x) and q θ (x), we train the discriminators an additional 10k steps to convergence. Each of these boundaries fails to enclose the true data distribution. (c) Predictive uncertainty over an ensemble of discriminators "fences in" the shared, low-variance region corresponding to p(x).

Figure 3: Top: Inputs and decoded outputs from a VAE trained on Fashion MNIST(β = 1) for Fashion MNIST (left) and MNIST (right). Although Fashion MNIST inputs appear to be better reconstructed (suggesting higher likelihoods), they have comparable distortions to MNIST. The bottom row shows that Fashion MNIST and MNIST test samples have comparable rate-distortion scatter plots and IWAE histograms.

s h i f t a n d l o g s c a l e f n = t f b . m a s k e d a u t o r e g r e s s i v e d e f a u l t t e m p l a t e ( h i d d e n l a y e r s = ( 5 1 2 , 5 1 2 ) )

Categorization of several OoD detection techniques, based on whether they depend on a specific model/task, and whether they assume a specific anomaly distribution.

Table content: <table><tr><td/><td>Model-Dependent</td><td>Model-Independent</td></tr><tr><td>OoD</td><td>Auxiliary "Other" class</td><td>Binary classification (likelihood ratio)</td></tr><tr><td>Dependent</td><td/><td>Adversarial Training</td></tr><tr><td>OoD</td><td>Hendrycks &amp; Gimpel (2016)</td><td>Density Estimation</td></tr><tr><td>Independent</td><td>Gal &amp; Ghahramani (2016)</td><td>Generative Ensembles (ours)</td></tr><tr><td/><td>Liang et al. (2017)</td><td/></tr><tr><td/><td>Lakshminarayanan et al. (2017)</td><td/></tr><tr><td/><td>Alemi et al. (2018b)</td><td/></tr></table>

. Best results for each task shown in bold.

Table content: <table><tr><td>Train Dataset</td><td>OoD Dataset</td><td colspan="2">ODIN VIB D</td><td colspan="4">Var(D) Rate log p θ (x) WAIC</td></tr><tr><td>MNIST</td><td>Omniglot</td><td>100</td><td colspan="2">97.1 56.1 80.3</td><td colspan="2">99.1 98.2</td><td>100</td></tr><tr><td/><td>notMNIST</td><td>98.2</td><td colspan="2">98.6 93.1 99.6</td><td colspan="2">99.9 100</td><td>100</td></tr><tr><td/><td colspan="2">Fashion MNIST N/A</td><td colspan="2">85.0 83.1 99.9</td><td colspan="2">94.7 100</td><td>100</td></tr><tr><td/><td>Uniform</td><td>100</td><td colspan="2">76.6 95.6 100</td><td colspan="2">99.3 100</td><td>100</td></tr><tr><td/><td>Gaussian</td><td>100</td><td>99.2 0.6</td><td>100</td><td>100</td><td>100</td><td>100</td></tr><tr><td/><td>HFlip</td><td>N/A</td><td colspan="2">63.7 41.5 57.7</td><td colspan="2">90.0 84.9</td><td>86.1</td></tr><tr><td/><td>VFlip</td><td>N/A</td><td colspan="2">75.1 44.7 60.9</td><td colspan="2">89.3 81.9</td><td>80.7</td></tr><tr><td/><td>Adversarial</td><td>N/A</td><td colspan="2">N/A 30.8 100</td><td>100</td><td>0</td><td>100</td></tr><tr><td colspan="2">Fashion MNIST Omniglot</td><td>N/A</td><td colspan="2">94.3 19.4 83.5</td><td colspan="2">97.7 56.8</td><td>79.6</td></tr><tr><td/><td>notMNIST</td><td>N/A</td><td colspan="2">89.6 22.3 96.0</td><td colspan="2">99.7 92.0</td><td>98.7</td></tr><tr><td/><td>MNIST</td><td>N/A</td><td colspan="2">94.1 70.1 74.7</td><td colspan="2">97.1 42.3</td><td>76.6</td></tr><tr><td/><td>Uniform</td><td>N/A</td><td>79.6 0</td><td>82.7</td><td colspan="2">95.6 100</td><td>100</td></tr><tr><td/><td>Gaussian</td><td>N/A</td><td>89.3 0</td><td>99.8</td><td colspan="2">89.2 100</td><td>100</td></tr><tr><td/><td>HFlip</td><td>N/A</td><td colspan="2">66.7 58.0 54.1</td><td colspan="2">72.4 59.4</td><td>62.3</td></tr><tr><td/><td>VFlip</td><td>N/A</td><td colspan="2">90.2 69.6 69.6</td><td colspan="2">87.1 66.8</td><td>74.0</td></tr><tr><td/><td>Adversarial</td><td>N/A</td><td>N/A 0</td><td>100</td><td>100</td><td>0</td><td>100</td></tr><tr><td>CIFAR-10</td><td>CelebA</td><td>N/A</td><td colspan="2">73.5 56.5 74.3</td><td colspan="2">N/A 99.7</td><td>99.9</td></tr><tr><td/><td>SVHN</td><td>N/A</td><td colspan="2">52.8 68.9 61.4</td><td colspan="2">N/A 7.5</td><td>100</td></tr><tr><td/><td>ImageNet32</td><td>81.6</td><td colspan="2">70.1 47.1 62.9</td><td colspan="2">N/A 93.8</td><td>95.6</td></tr><tr><td/><td>Uniform</td><td>99.2</td><td colspan="2">54.0 100 100</td><td colspan="2">N/A 100</td><td>100</td></tr><tr><td/><td>Gaussian</td><td>99.7</td><td colspan="2">45.8 100 100</td><td colspan="2">N/A 100</td><td>100</td></tr><tr><td/><td>HFlip</td><td>N/A</td><td colspan="2">50.6 52.0 50.3</td><td colspan="2">N/A 50.1</td><td>50.0</td></tr><tr><td/><td>VFlip</td><td>N/A</td><td colspan="2">51.2 60.9 52.3</td><td colspan="2">N/A 50.6</td><td>50.4</td></tr></table>

Table 2, column 7). Re-training the ensemble with β = .1 encourages a higher distortion penalty during training, and thereby fixes the OoD detection model.

Table content: <table/>

Comparison of density-based anomaly detection approaches to a classification baseline on the Kaggle Credit Card Fraud Dataset. The test set consists of 492 fraudulent transactions and 492 normal transactions. Threshold-independent metrics include False Positives at 95% True Positives (FPR@95%TPR), Area Under ROC (AUROC), and Average Precision (AP). Density-based models (Single IWAE, WAIC) are trained only on normal credit card transactions, while the classifier is trained on normal and fraudulent transactions. Arrows denote the direction of better scores.OoD detection is a critical piece of infrastructure for ML applications where the test data distribution is not known at training time. We present Generative Ensembles, a simple yet powerful technique for model-independent OoD detection that improves density models with uncertainty estimation.An important future direction of research is that of scalability: learning good generative models of semantically rich, high-dimensional inputs (e.g. video) is an active research area in its own right. An open question is whether an ensemble of weak generative models (where each model may not necessarily generate high-quality samples) can still yield density and uncertainty predictions useful enough for OoD detection. Preliminary evidence on CIFAR-10 are promising; although the ensemble average on the test set is ∼ 3.5 bits/dim and samples from the prior do not resemble any recognizable objects, the ensemble still performs well at OoD detection. In future work we will explore other methods of de-correlating samples from the posterior over model parameters, as well as combining independent scores (D, Rate, log θ p(x), WAIC) into a more powerful OoD model.

Table content: <table><tr><td>Method</td><td colspan="3">FPR@95%TPR ↓ AUROC ↑ AP ↑</td></tr><tr><td>Classifier</td><td>4.0</td><td>99.1</td><td>99.3</td></tr><tr><td colspan="2">Single IWAE 15.7</td><td>94.6</td><td>92.0</td></tr><tr><td>WAIC</td><td>15.2</td><td>94.7</td><td>92.1</td></tr></table>

OoD Input Out-of-Distribution Input. Invalid input to a ML model Anomaly Synonym with OoD Input Epistemic Uncertainty Variance in a model's predictive distribution arising from ignorance of true model parameters for a given input Aleatoric Uncertainty Variance in a model's predictive distribution arising from inherent, irreducible noise in the inputs Predictive Uncertainty Variance of a model's predictive distribution, which takes into account all of the above KL (q θ (z|x) p(z)) term in the VAE objective. Information loss between encoder distribution and prior over latent code IWAE

Table content: <table><tr><td>MNIST</td><td>Dataset of handwritten digits (size: 28x28)</td></tr><tr><td>FashionMNIST</td><td>Dataset of clothing thumbnails (size: 28x28)</td></tr><tr><td>CIFAR-10</td><td>Dataset of color images (size: 32x32x3)</td></tr><tr><td>GAN</td><td>Generative Adversarial Network. See Goodfellow et al. (2014)</td></tr><tr><td>FSGM</td><td>Fast Sign Gradient Method</td></tr><tr><td>WGAN</td><td>Wasserstein GAN. See Arjovsky et al. (2017)</td></tr><tr><td>VAE</td><td>Variational Autoencoder. See Kingma &amp; Welling (2013);</td></tr><tr><td/><td>Rezende et al. (2014)</td></tr><tr><td>Rate</td><td>D Importance Weighted Autoencoder</td></tr><tr><td>GLOW</td><td>A generative model based on normalizing flows. See Kingma</td></tr><tr><td/><td>&amp; Dhariwal (2018)</td></tr><tr><td>ODIN</td><td>Out-of-DIstribution detector for Neural networks. See Liang</td></tr><tr><td/><td>et al. (2017)</td></tr><tr><td>VIB</td><td>Variational Information Bottleneck. See Alemi et al. (2018b)</td></tr><tr><td>WAIC</td><td>Watanabe-Akaike Information Criterion. See Watanabe (2010)</td></tr><tr><td>AUROC</td><td>Area Under ROC Curve</td></tr><tr><td>FPR@95%TPR</td><td>False Positives at 95% True Positives</td></tr><tr><td>AP</td><td>Average Precision</td></tr></table>

Peer review (iclr2019):
 The authors present an OOD detection scheme with an ensemble of generative models. When the exact likelihood is available from the generative model, the authors approximate the WAIC score. For GAN models, the authors compute the variance over the discriminators for any given input. They show that this method outperforms ODIN and VIB on image datasets and also achieves comparable performance on Kaggle Credit Fraud dataset. The paper is overall well-written and easy to follow. I only have a few comments about the work. I think the authors should address the following points in the paper. - What is the size of the ensemble for the experiments? - How does the size of the ensemble influence the measured performance? - It is Fast Gradient Sign Method (FGSM), not FSGM. See [1]. Citing [1] for FGSM would also be appropriate. Quality. The submission is technically sound. The empirical results support the claims, and the authors discuss the failure cases. Clarity. The paper is well-written and easy to follow while providing useful insight and connecting previous work to the subject of study. Originality. To the best my knowledge, the proposed approach is a novel combination of well-known techniques. Significance. The presented idea improves over the state-of-the-art. References [1] I. Goodfellow, J. Shlens, and C. Szegedy, “Explaining and Harnessing Adversarial Examples,” in ICLR, 2015. ------------------- Revision. The rating revised to 6 after the discussion and rebuttal.