Title: DEEP ANOMALY DETECTION WITH OUTLIER EXPOSURE

Abstract: It is important to detect anomalous inputs when deploying machine learning systems. The use of larger and more complex inputs in deep learning magnifies the difficulty of distinguishing between anomalous and in-distribution examples. At the same time, diverse image and text data are available in enormous quantities. We propose leveraging these data to improve deep anomaly detection by training anomaly detectors against an auxiliary dataset of outliers, an approach we call Outlier Exposure (OE). This enables anomaly detectors to generalize and detect unseen anomalies. In extensive experiments on natural language processing and small-and large-scale vision tasks, we find that Outlier Exposure significantly improves detection performance. We also observe that cutting-edge generative models trained on CIFAR-10 may assign higher likelihoods to SVHN images than to CIFAR-10 images; we use OE to mitigate this issue. We also analyze the flexibility and robustness of Outlier Exposure, and identify characteristics of the auxiliary dataset that improve performance.

1. INTRODUCTION:

Machine Learning systems in deployment often encounter data that is unlike the model's training data. This can occur in discovering novel astronomical phenomena, finding unknown diseases, or detecting sensor failure. In these situations, models that can detect anomalies (Liu et al., 2018; Emmott et al., 2013) are capable of correctly flagging unusual examples for human intervention, or carefully proceeding with a more conservative fallback policy.

Behind many machine learning systems are deep learning models (Krizhevsky et al., 2012) which can provide high performance in a variety of applications, so long as the data seen at test time is similar to the training data. However, when there is a distribution mismatch, deep neural network classifiers tend to give high confidence predictions on anomalous test examples (Nguyen et al., 2015) . This can invalidate the use of prediction probabilities as calibrated confidence estimates (Guo et al., 2017) , and makes detecting anomalous examples doubly important.

Several previous works seek to address these problems by giving deep neural network classifiers a means of assigning anomaly scores to inputs. These scores can then be used for detecting outof-distribution (OOD) examples (Hendrycks & Gimpel, 2017; Lee et al., 2018; Liu et al., 2018) . These approaches have been demonstrated to work surprisingly well for complex input spaces, such as images, text, and speech. Moreover, they do not require modeling the full data distribution, but instead can use heuristics for detecting unmodeled phenomena. Several of these methods detect unmodeled phenomena by using representations from only in-distribution data.

In this paper, we investigate a complementary method where we train models to detect unmodeled data by learning cues for whether an input is unmodeled. While it is difficult to model the full data distribution, we can learn effective heuristics for detecting out-of-distribution inputs by exposing the model to OOD examples, thus learning a more conservative concept of the inliers and enabling the detection of novel forms of anomalies. We propose leveraging diverse, realistic datasets for this purpose, with a method we call Outlier Exposure (OE) . OE provides a simple and effective way to consistently improve existing methods for OOD detection.

Through numerous experiments, we extensively evaluate the broad applicability of Outlier Exposure. For multiclass neural networks, we provide thorough results on Computer Vision and Natural Language Processing tasks which show that Outlier Exposure can help anomaly detectors generalize to and perform well on unseen distributions of outliers, even on large-scale images. We also demonstrate that Outlier Exposure provides gains over several existing approaches to out-of-distribution detection. Our results also show the flexibility of Outlier Exposure, as we can train various models with different sources of outlier distributions. Additionally, we establish that Outlier Exposure can make density estimates of OOD samples significantly more useful for OOD detection. Finally, we demonstrate that Outlier Exposure improves the calibration of neural network classifiers in the realistic setting where a fraction of the data is OOD. Our code is made publicly available at https://github.com/hendrycks/outlier-exposure.

2. RELATED WORK:

Out-of-Distribution Detection with Deep Networks. Hendrycks & Gimpel (2017) demonstrate that a deep, pre-trained classifier has a lower maximum softmax probability on anomalous examples than in-distribution examples, so a classifier can conveniently double as a consistently useful outof-distribution detector. Building on this work, DeVries & Taylor (2018) attach an auxiliary branch onto a pre-trained classifier and derive a new OOD score from this branch. Liang et al. (2018) present a method which can improve performance of OOD detectors that use a softmax distribution. In particular, they make the maximum softmax probability more discriminative between anomalies and in-distribution examples by pre-processing input data with adversarial perturbations (Goodfellow et al., 2015) . Unlike in our work, their parameters are tailored to each source of anomalies. Lee et al. (2018) train a classifier concurrently with a GAN (Radford et al., 2016; Goodfellow et al., 2014) , and the classifier is trained to have lower confidence on GAN samples. For each testing distribution of anomalies, they tune the classifier and GAN using samples from that out-distribution, as discussed in Appendix B of their work. Unlike Liang et al. (2018) ; Lee et al. (2018) , in this work we train our method without tuning parameters to fit specific types of anomaly test distributions, so our results are not directly comparable with their results. Many other works (de Vries et al., 2016; Subramanya et al., 2017; Malinin & Gales, 2018; Bevandic et al., 2018 ) also encourage the model to have lower confidence on anomalous examples. Recently, Liu et al. (2018) provide theoretical guarantees for detecting out-of-distribution examples under the assumption that a suitably powerful anomaly detector is available.

Utilizing Auxiliary Datasets. Outlier Exposure uses an auxiliary dataset entirely disjoint from test-time data in order to teach the network better representations for anomaly detection. Goodfellow et al. (2015) train on adversarial examples to increased robustness. Salakhutdinov et al. (2011) pre-train unsupervised deep models on a database of web images for stronger features. Radford et al. (2017) train an unsupervised network on a corpus of Amazon reviews for a month in order to obtain quality sentiment representations. Zeiler & Fergus (2014) find that pre-training a network on the large ImageNet database (Russakovsky et al., 2015) endows the network with general representations that are useful in many fine-tuning applications. Chen & Gupta (2015) ; Mahajan et al. (2018) show that representations learned from images scraped from the nigh unlimited source of search engines and photo-sharing websites improve object detection performance.

3. OUTLIER EXPOSURE:

We consider the task of deciding whether or not a sample is from a learned distribution called D in . Samples from D in are called "in-distribution," and otherwise are said to be "out-of-distribution" (OOD) or samples from D out . In real applications, it may be difficult to know the distribution of outliers one will encounter in advance. Thus, we consider the realistic setting where D out is unknown. Given a parametrized OOD detector and an Outlier Exposure (OE) dataset D OE out , disjoint from D test out , we train the model to discover signals and learn heuristics to detect whether a query is sampled from D in or D OE out . We find that these heuristics generalize to unseen distributions D out . Deep parametrized anomaly detectors typically leverage learned representations from an auxiliary task, such as classification or density estimation. Given a model f and the original learning objective L, we can thus formalize Outlier Exposure as minimizing the objective

E (x,y)∼Din [L(f (x), y) + λE x ∼D OE out [L OE (f (x ), f (x), y)]

] over the parameters of f . In cases where labeled data is not available, then y can be ignored.

Outlier Exposure can be applied with many types of data and original tasks. Hence, the specific formulation of L OE is a design choice, and depends on the task at hand and the OOD detector used. For example, when using the maximum softmax probability baseline detector (Hendrycks & Gimpel, 2017) , we set L OE to the cross-entropy from f (x ) to the uniform distribution (Lee et al., 2018) . When the original objective L is density estimation and labels are not available, we set L OE to a margin ranking loss on the log probabilities f (x ) and f (x).

4. EXPERIMENTS:

We evaluate OOD detectors with and without OE on a wide range of datasets. Each evaluation consists of an in-distribution dataset D in used to train an initial model, a dataset of anomalous examples D OE out , and a baseline detector to which we apply OE. We describe the datasets in Section 4.2. The OOD detectors and L OE losses are described on a case-by-case basis.

In the first experiment, we show that OE can help detectors generalize to new text and image anomalies. This is all accomplished without assuming access to the test distribution during training or tuning, unlike much previous work. In the confidence branch experiment, we show that OE is flexible and complements a binary anomaly detector. Then we demonstrate that using synthetic outliers does not work as well as using real and diverse data; previously it was assumed that we need synthetic data or carefully selected close-to-distribution data, but real and diverse data is enough. We conclude with experiments in density estimation. In these experiments we find that a cutting-edge density estimator unexpectedly assigns higher density to out-of-distribution samples than in-distribution samples, and we ameliorate this surprising behavior with Outlier Exposure. We evaluate out-of-distribution detection methods on their ability to detect OOD points. For this purpose, we treat the OOD examples as the positive class, and we evaluate three metrics: area under the receiver operating characteristic curve (AUROC), area under the precision-recall curve (AUPR), and the false positive rate at N % true positive rate (FPRN ). The AUROC and AUPR are holistic metrics that summarize the performance of a detection method across multiple thresholds.

The AUROC can be thought of as the probability that an anomalous example is given a higher OOD score than a in-distribution example (Davis & Goadrich, 2006) . Thus, a higher AUROC is better, and an uninformative detector has an AUROC of 50%. The AUPR is useful when anomalous examples are infrequent (Manning & Schütze, 1999) Whereas the previous two metrics represent the detection performance across various thresholds, the FPRN metric represents performance at one strict threshold. By observing performance at a strict threshold, we can make clear comparisons among strong detectors. The FPRN metric (Liu et al., 2018; Kumar et al., 2016; Balntas et al., 2016) is the probability that an in-distribution example (negative) raises a false alarm when N % of anomalous examples (positive) are detected, so a lower FPRN is better. Capturing nearly all anomalies with few false alarms can be of high practical value. (Russakovsky et al., 2015) dataset where images are resized and cropped to 64 × 64 resolution. The dataset's images were cropped using bounding box information so that cropped images contain the target, unlike Downsampled ImageNet (Chrabaszcz et al., 2017) . The training set has 100, 000 images and the test set has 10, 000 images.

Places365. The Places365 training dataset (Zhou et al., 2017) WikiText-2 is a corpus of Wikipedia articles typically used for language modeling. We use WikiText-2 as D OE out for language modeling experiments with Penn Treebank as D in . For classification tasks on 20 Newsgroups, TREC, and SST, we treat each sentence of WikiText-2 as an individual example, and use simple filters to remove low-quality sentences.

4.3. MULTICLASS CLASSIFICATION:

In what follows, we use Outlier Exposure to enhance the performance of existing OOD detection techniques with multiclass classification as the original task. Throughout the following experiments, we let x ∈ X be a classifier's input and y ∈ Y = {1, 2, . . . , k} be a class. We also represent the classifier with the function f : X → R k , such that for any x, 1 T f (x) = 1 and f (x) 0.

Maximum Softmax Probability (MSP).:

Consider the maximum softmax probability baseline (Hendrycks & Gimpel, 2017) which gives an input x the OOD score -max c f c (x). Out-ofdistribution samples are drawn from various unseen distributions (Appendix A). For each task, we test with approximately twice the number of D test out distributions compared to most other papers, and we also test on NLP tasks. The quality of the OOD example scores are judged with the metrics described in Section 4.1. For this multiclass setting, we perform Outlier Exposure by fine-tuning a pre-trained classifier f so that its posterior is more uniform on D OE out samples. Specifically, the finetuning objective is

E (x,y)∼Din [-log f y (x)] + λE x∼D OE out [H(U; f (x))],

where H is the cross entropy and U is the uniform distribution over k classes. When there is class imbalance, we could encourage f (x) to match (P (y = 1), . . . , P (y = k)); yet for the datasets we consider, matching U works well enough. Also, note that training from scratch with OE can result in even better performance than fine-tuning (Appendix C). This approach works on different architectures as well (Appendix D).

Unlike Liang et al. (2018) ; Lee et al. (2018) and like Hendrycks & Gimpel (2017) ; DeVries & Taylor (2018), we do not tune our hyperparameters for each D test out distribution, so that D test out is kept unknown like with real-world anomalies. Instead, the λ coefficients were determined early in experimentation with validation D val out distributions described in Appendix A. In particular, we use λ = 0.5 for vision experiments and λ = 1.0 for NLP experiments. Like previous OOD detection methods involving network fine-tuning, we chose λ so that impact on classification accuracy is negligible.

For nearly all of the vision experiments, we train Wide Residual Networks (Zagoruyko & Komodakis, 2016) and then fine-tune network copies with OE for 10 epochs. However we use a pretrained ResNet-18 for Places365. For NLP experiments, we train 2-layer GRUs (Cho et al., 2014) for 5 epochs, then fine-tune network copies with OE for 2 epochs. Networks trained on CIFAR-10 or CIFAR-100 are exposed to images from 80 Million Tiny Images, and the Tiny ImageNet and Places365 classifiers are exposed to ImageNet-22K. NLP classifiers are exposed to WikiText-2. Further architectural and training details are in Appendix B. For all tasks, OE improves average performance by a large margin. Averaged results are shown in Tables 1 and 2 . Sample ROC curves are shown in Figures 1 and 4 . Detailed results on individual D test out datasets are in Table 7 and Table 8 (Nalisnick et al., 2019) . Consequently, density estimates are another means by which to score anomalies (Zong et al., 2018) . We show the ability of OE to improve density estimates on low-probability, outlying data.

PixelCNN++. Autoregressive neural density estimators provide a way to parametrize the probability density of image data. Although sampling from these architectures is slow, they allow for evaluating the probability density with a single forward pass through a CNN, making them promising candidates for OOD detection. We use Pix-elCNN++ (Salimans et al., 2017) as a baseline OOD detector, and we train it on CIFAR-10. The OOD score of example x is the bits per pixel (BPP), defined as nll(x)/num_pixels, where nll is the negative log-likelihood. With this loss we fine-tune for 2 epochs using OE, which we find is sufficient for the training loss to converge.

Here OE is implemented with a margin loss over the log-likelihood difference between in-distribution and anomalous examples, so that the loss for a sample x in from D in and point x out from D OE out is max{0, num_pixels + nll(x in )nll(x out )}.

Results are shown in Table 5 . Notice that PixelCNN++ without OE unexpectedly assigns lower BPP from SVHN images than CIFAR-10 images. For all D test out datasets, OE significantly improves results. Language Modeling. We next explore using OE on language models. We use QRNN (Merity et al., 2018a; b) language models as baseline OOD detectors. For the OOD score, we use bits per character (BPC) or bits per word (BPW), defined as nll(x)/sequence_length, where nll(x) is the negative log-likelihood of the sequence x. Outlier Exposure is implemented by adding the cross entropy to the uniform distribution on tokens from sequences in D OE out as an additional loss term. For D in , we convert the language-modeling version of Penn Treebank, split into sequences of length 70 for backpropagation for word-level models, and 150 for character-level models. We do not train or evaluate with preserved hidden states as in BPTT. This is because retaining hidden states would greatly simplify the task of OOD detection. Accordingly, the OOD detection task is to provide a score for 70-or 150-token sequences in the unseen D test out datasets. We train word-level models for 300 epochs, and character-level models for 50 epochs. We then fine-tune using OE on WikiText-2 for 5 epochs. For the character-level language model, we create a character-level version of WikiText-2 by converting words to lowercase and leaving out characters which do not appear in PTB. OOD detection results for the word-level and character-level language models are shown in 

5. DISCUSSION:

Extensions to Multilabel Classifiers and the Reject Option. Outlier Exposure can work in more classification regimes than just those considered above. For example, a multilabel classifier trained on CIFAR-10 obtains an 88.8% mean AUROC when using the maximum prediction probability as the OOD score. By training with OE to decrease the classifier's output probabilities on OOD samples, the mean AUROC increases to 97.1%. This is slightly less than the AUROC for a multiclass model tuned with OE. An alternative OOD detection formulation is to give classifiers a "reject class" (Bartlett & Wegkamp, 2008) . Outlier Exposure is also flexible enough to improve performance in this setting, but we find that even with OE, classifiers with the reject option or multilabel outputs are not as competitive as OOD detectors with multiclass outputs.

Flexibility in Choosing D OE out . Early in experimentation, we found that the choice of D OE out is important for generalization to unseen D test out distributions. For example, adding Gaussian noise to samples from D in to create D OE out does not teach the network to generalize to unseen anomaly distributions for complex D in . Similarly, we found in Section 4.3 that synthetic anomalies do not work as well as real data for D OE out . In contrast, our experiments demonstrate that the large datasets of realistic anomalies described in Section 4.2.2 do generalize to unseen D test out distributions. In addition to size and realism, we found diversity of D OE out to be an important factor. Concretely, a CIFAR-100 classifier with CIFAR-10 as D OE out hardly improves over the baseline. A CIFAR-10 classifier exposed to ten CIFAR-100 outlier classes corresponds to an average AUPR of 78.5%. Exposed to 30 such classes, the classifier's average AUPR becomes 85.1%. Next, 50 classes corresponds to 85.3%, and from thereon additional CIFAR-100 classes barely improve performance. This suggests that dataset diversity is important, not just size. In fact, experiments in this paper often used around 1% of the images in the 80 Million Tiny Images dataset since we only briefly fine-tuned the models. We also found that using only 50,000 examples from this dataset led to a negligible degradation in detection performance. Additionally, D OE out datasets with significantly different statistics can perform similarly. For instance, using the Project Gutenberg dataset in lieu of WikiText-2 for D OE out in the SST experiments gives an average AUROC of 90.1% instead of 89.3%.

Closeness of D test:

out , D OE out , and D test in . Our experiments show several interesting effects of the closeness of the datasets involved. Firstly, we find that D test out and D OE out need not be close for training with OE to improve performance on D test out . In Appendix A, we observe that an OOD detector for SVHN has its performance improve with Outlier Exposure even though (1) D OE out samples are images of natural scenes rather than digits, and (2) D test out includes unnatural examples such as emojis. We observed the same in our preliminary experiments with MNIST; using 80 Million Tiny Images as D OE out , OE increased the AUPR from 94.2% to 97.0%.

Secondly, we find that the closeness of D OE out to D test in can be an important factor in the success of OE. In the NLP experiments, preprocessing D OE out to be closer to D in improves OOD detection performance significantly. Without preprocessing, the network may discover easy-to-learn cues which reveal whether the input is in-or out-of-distribution, so the OE training objective can be optimized in unintended ways. That results in weaker detectors. In a separate experiment, we use Online Hard Example Mining so that difficult outliers have more weight in Outlier Exposure. Although this improves performance on the hardest anomalies, anomalies without plausible local statistics like noise are detected slightly less effectively than before. Thus hard or close-to-distribution examples do not necessarily teach the detector all valuable heuristics for detecting various forms of anomalies. Real-world applications of OE could use the method of Sun et al. (2018) OE Improves Calibration. When using classifiers for prediction, it is important that confidence estimates given for the predictions do not misrepresent empirical performance. A calibrated classifier gives confidence probabilities that match the empirical frequency of correctness. That is, if a calibrated model predicts an event with 30% probability, then 30% of the time the event transpires.

Existing confidence calibration approaches consider the standard setting where data at test-time is always drawn from D in . We extend this setting to include examples from D test out at test-time since systems should provide calibrated probabilities on both in-and out-of-distribution samples. The classifier should have low-confidence predictions on these OOD examples, since they do not have a class. Building on the temperature tuning method of Guo et al. (2017) , we demonstrate that OE can improve calibration performance in this realistic setting. Summary results are shown in Figure 3 . Detailed results and a description of the metrics are in Appendix G.

6. CONCLUSION:

In this paper, we proposed Outlier Exposure, a simple technique that enhances many current OOD detectors across various settings. It uses out-of-distribution samples to teach a network heuristics to detect new, unmodeled, out-of-distribution examples. We showed that this method is broadly applicable in vision and natural language settings, even for large-scale image tasks. OE can improve model calibration and several previous anomaly detection techniques. Further, OE can teach density estimation models to assign more plausible densities to out-of-distribution samples. Finally, Outlier Exposure is computationally inexpensive, and it can be applied with low overhead to existing systems. In summary, Outlier Exposure is an effective and complementary approach for enhancing out-of-distribution detection systems.

A EXPANDED MULTICLASS RESULTS:

Expanded mutliclass out-of-distribution detection results are in Table 7 and Table 8 Table 8 : NLP OOD example detection for the maximum softmax probability (MSP) baseline detector and the MSP detector after fine-tuning with Outlier Exposure (OE). All results are percentages and the result of 10 runs. Values are rounded so that 99.95% rounds to 100%.

Anomalous Data. For each in-distribution dataset D in , we comprehensively evaluate OOD detectors on artificial and real anomalous distributions D test out following Hendrycks & Gimpel (2017) . For each learned distribution D in , the number of test distributions that we compare against is approximately double that of most previous works.

Gaussian anomalies have each dimension i.i.d. sampled from an isotropic Gaussian distribution. Rademacher anomalies are images where each dimension is -1 or 1 with equal probability, so each dimension is sampled from a symmetric Rademacher distribution. Bernoulli images have each pixel sampled from a Bernoulli distribution if the input range is [0, 1]. Blobs data consist in algorithmically generated amorphous shapes with definite edges. Icons-50 is a dataset of icons and emojis (Hendrycks & Dietterich, 2019) ; icons from the "Number" class are removed. Textures is a dataset of describable textural images (Cimpoi et al., 2014) . Places365 consists in images for scene recognition rather than object recognition (Zhou et al., 2017) . LSUN is another scene understanding dataset with fewer classes than Places365 (Yu et al., 2015) . ImageNet anomalous examples are taken from the 800 ImageNet-1K classes disjoint from Tiny ImageNet's 200 classes, and when possible each image is cropped with bounding box information as in Tiny ImageNet. For the Places365 experiment, ImageNet is ImageNet-1K with all 1000 classes. With CIFAR-10 as D in , we use also CIFAR-100 as D test out and vice versa; recall that the CIFAR-10 and CIFAR-100 classes do not overlap. Chars74K is a dataset of photographed characters in various styles; digits and letters such as "O" and "l" were removed since they can look like numbers. Places69 has images from 69 scene categories not found in the Places365 dataset.

SNLI is a dataset of predicates and hypotheses for natural language inference. We use the hypotheses for D OE out . IMDB is a sentiment classification dataset of movie reviews, with similar statistics to those of SST. Multi30K is a dataset of English-German image descriptions, of which we use the English descriptions. WMT16 is the English portion of the test set from WMT16. Yelp is a dataset of restaurant reviews. English Web Treebank (EWT) consists of five individual datasets: Answers (A), Email (E), Newsgroups (N), Reviews (R), and Weblog (W). Each contains examples from the indicated domain.

Validation Data. For each experiment, we create a set of validation distributions D val out . The first anomalies are uniform noise anomalies where each pixel is sampled from U[0, 1] or U[-1, 1] depending on the input space of the classifier. The remaining D val out validation sources are generated by corrupting in-distribution data, so that the data becomes out-of-distribution. One such source of anomalies is created by taking the pixelwise arithmetic mean of a random pair of in-distribution images. Other anomalies are created by taking the geometric mean of a random pair of in-distribution images. Jigsaw anomalies are created by taking an in-distribution example, partitioning the image into 16 equally sized patches, and permuting those patches. Speckle Noised anomalies are created by applying speckle noise to in-distribution images. RGB Ghosted anomalies involves shifting and reordering the color channels of in-distribution images. Inverted images are anomalies which have some or all of their color channels inverted.

B ARCHITECTURES AND TRAINING DETAILS:

For CIFAR-10, CIFAR-100, and Tiny ImageNet classification experiments, we use a 40-2 Wide Residual Network (Zagoruyko & Komodakis, 2016) . The network trains for 100 epochs with a dropout rate of 0.3. The initial learning rate of 0.1 decays following a cosine learning rate schedule (Loshchilov & Hutter, 2017) . During fine-tuning of the entire network, we again use a cosine learning rate schedule but with an initial learning rate of 0.001. We use standard flipping and data cropping augmentation, Nesterov momentum, and 2 weight decay with a coefficient of 5 × 10 -4 . SVHN architectures are 16-4 Wide ResNets trained for 20 epochs with an initial learning rate of 0.01 and no data augmentation. For Places365, we use a ResNet-18 pre-trained on Places365. In this Places365 experiment, we tune with Outlier Exposure for 5 epochs, use 512 outlier samples per iteration, and start with a learning rate of 0.0001. 

G CONFIDENCE CALIBRATION:

Models integrated into a decision making process should indicate when they are trustworthy, and such models should not have inordinate confidence in their predictions. In an effort to combat a false sense of certainty from overconfident models, we aim to calibrate model confidence. A model is calibrated if its predicted probabilities match empirical frequencies. Thus if a calibrated model predicts an event with 30% probability, then 30% of the time the event transpires. Prior research (Guo et al., 2017; Nguyen & O'Connor, 2015; Kuleshov & Liang, 2015) considers calibrating systems where test-time queries are samples from D in , but systems also encounter samples from D test out and should also ascribe low confidence to these samples. Hence, we use OE to control the confidence on these samples.

G.1 METRICS:

In order to evaluate a multiclass classifier's calibration, we present three metrics. First we establish context. For input example X ∈ X , let Y ∈ Y = {1, 2, . . . , k} be the ground truth class. Let Y be the model's class prediction, and let C be the corresponding model confidence or prediction probability. Denote the set of prediction-label pairs made by the model with S = {( y 1 , c 1 ), ( y 2 , c 2 ), . . . , ( y n , c n )}. 

RMS and MAD Calibration Error:

|B i | n 1 |B i | k∈Bi 1(y k = y k ) - 1 |B i | k∈Bi c k 2 .

Along similar lines, the MAD Calibration Error-which is an improper scoring rule due to its use of absolute differences rather than squared differences-is estimated with

b i=1 |B i | n 1 |B i | k∈Bi 1(y k = y k ) - 1 |B i | k∈Bi c k .

Soft F1 Score. If a classifier makes only a few mistakes, then most examples should have high confidence. But if the classifier gives all predictions high confidence, including its mistakes, then the previous metrics will indicate that the model is calibrated on the vast majority of instances, despite having systematic miscalibration. The Soft F1 score (Pastor-Pellicer et al., 2013; Hendrycks & Gimpel, 2017) is suited for measuring the calibration of a system where there is an acute imbalance between mistaken and correct decisions. Since we treat mistakes a positive examples, we can write the model's confidence that the examples are anomalous with c a = (1 -c 1 , 1 -c 2 , . . . , 1 -c n ). To indicate that an example is positive (mistaken), we use the vector m ∈ {0, 1} n such that m i = 1(y i = y i ) for 1 ≤ i ≤ n. Then the Soft F1 score is c T a m 1 T (c a + m)/2 . 

RMS:



G.2 SETUP AND RESULTS:

There are many ways to estimate a classifier's confidence. One way is to bind a logistic regression branch onto the network, so that confidence values are in [0, 1]. Other confidence estimates use the model's logits l ∈ R k , such as the estimate σ(max i l i ) ∈ [0, 1], where σ is the logistic sigmoid.

Another common confidence estimate is max i exp (l i )/ k j=1 exp (l j ) . A modification of this estimate is our baseline. Softmax Temperature Tuning. Guo et al. (2017) show that good calibration can be obtained by including a tuned temperature parameter into the softmax: p(y = i | x) = exp(l i /T )/ k j=1 exp(l j /T ). We tune T to maximize log likelihood on a validation set after the network has been trained on the training set.

Results. In this calibration experiment, the baseline is confidence estimation with softmax temperature tuning. Therefore, we train SVHN, CIFAR-10, CIFAR-100, and Tiny ImageNet classifiers with 5000, 5000, 5000, and 10000 training examples held out, respectively. A copy of this classifier is fine-tuned with Outlier Exposure. Then we determine the optimal temperatures of the original and OE-fine-tuned classifiers on the held-out examples. To measure calibration, we take equally many examples from a given in-distribution dataset D test in and OOD dataset D test out . Out-of-distribution points are understood to be incorrectly classified since their label is not in the model's output space, so calibrated models should assign these out-of-distribution points low confidence. Results are in Table 12 . Outlier Exposure noticeably improves model calibration.

G.3 POSTERIOR RESCALING:

While temperature tuning improves calibration, the confidence estimate p(y = i | x) cannot be less than 1/k, k the number of classes. For an out-of-distribution example like Gaussian Noise, a good model should have no confidence in its prediction over k classes. One possibility is to add a reject option, or a (k + 1)st class, which we cover in Section 5. A simpler option we found is to perform an affine transformation of p(y = i | x) ∈ [1/k, 1] with the formula ( p(y = i | x) -1/k)/(1 -1/k) ∈ [0, 1]. This simple transformation makes it possible for a network to express no confidence on an out-of-distribution input and improves calibration performance. As Table 13 shows, this simple 0-1 posterior rescaling technique consistently improves calibration, and the model fine-tuned with OE using temperature tuning and posterior rescaling achieved large calibration improvements. 



:



Figures and Tables:

Figure 1: ROC curve with Tiny Im-ageNet (D in ) and Textures (D test out ).

Figure 2: OOD scores from PixelCNN++ on images from CIFAR-10 and SVHN.

Figure 3: Root Mean Square Calibration Error values with temperature tuning and temperature tuning + OE across various datasets.

The Root Mean Square Calibration Error measures the square root of the expected squared difference between confidence and accuracy at a confidence level. It has the formula E C [(P(Y = Y |C = c) -c) 2 ] . A similar formulation which less severely penalizes large confidence-accuracy deviations is the Mean Absolute Value Calibration error, written E C [|P(Y = Y |C = c) -c|]. The MAD Calibration Error is a lower bound of the RMS Calibration Error. To empirically estimate these miscalibration measures, we partition the n samples of S into b bins {B 1 , B 2 , . . . , B b } with approximately 100 samples in each bin. Unlike Guo et al. (2017), bins are not equally spaced since the distribution of confidence values is not uniform but dynamic. Concretely, the RMS Calibration Error is estimated with the numerically stable formula b i=1

Both have 50, 000 training images and 10, 000 test images. For this and the remaining image datasets, each image is standardized channel-wise. Tiny ImageNet. The Tiny ImageNet dataset (Johnson et al.) is a 200-class subset of the ImageNet

Table content: <table><tr><td>are disjoint but have similiarities. For example, CIFAR-10 has "automobiles" and "trucks" but not</td></tr><tr><td>CIFAR-100's "pickup truck" class.</td></tr><tr><td>4.2 DATASETS</td></tr><tr><td>4.2.1 IN-DISTRIBUTION DATASETS</td></tr><tr><td>SVHN. The SVHN dataset (Netzer et al., 2011) contains 32 × 32 color images of house numbers.</td></tr><tr><td>There are ten classes comprised of the digits 0-9. The training set has 604, 388 images, and the test</td></tr><tr><td>set has 26, 032 images. For preprocessing, we rescale the pixels to be in the interval [0, 1].</td></tr><tr><td>CIFAR. The two CIFAR (Krizhevsky &amp; Hinton, 2009) datasets contain 32 × 32 natural color</td></tr><tr><td>images. CIFAR-10 has ten classes while CIFAR-100 has 100. CIFAR-10 and CIFAR-100 classes</td></tr></table>

CIFAR-10, and CIFAR-100 as D in . We remove all examples of 80 Million Tiny Images which appear in the CIFAR datasets, so that D OE out and D test out are disjoint. In Section 5 we note that only a small fraction of this dataset is necessary for successful OE. ImageNet-22K. We use the ImageNet dataset with images from approximately 22 thousand classes as D OE

Table content: <table><tr><td>consists in 1, 803, 460 large-scale</td></tr><tr><td>photographs of scenes. Each photograph belongs to one of 365 classes.</td></tr><tr><td>20 Newsgroups. 20 Newsgroups is a text classification dataset of newsgroup documents with 20</td></tr><tr><td>classes and approximately 20, 000 examples split evenly among the classes. We use the standard</td></tr><tr><td>60/40 train/test split.</td></tr><tr><td>TREC. TREC is a question classification dataset with 50 fine-grained classes and 5, 952 individ-</td></tr><tr><td>ual questions. We reserve 500 examples for the test set, and use the rest for training.</td></tr><tr><td>SST. The Stanford Sentiment Treebank dataset (Socher et al., 2013) consists of movie reviews</td></tr><tr><td>expressing positive or negative sentiment. SST has 8, 544 reviews for training and 2, 210 for testing.</td></tr><tr><td>4.2.2 OUTLIER EXPOSURE DATASETS</td></tr><tr><td>80 Million Tiny Images. 80 Million Tiny Images (Torralba et al., 2008) is a large-scale, diverse</td></tr><tr><td>dataset of 32×32 natural images scrapped from the web. We use this dataset as D OE out for experiments</td></tr><tr><td>with SVHN,</td></tr></table>

in Appendix A. Notice that the SVHN classifier with OE can be used to detect new anomalies such as emojis and street view alphabet letters, even though D test OE is a dataset of natural images. Thus, Outlier Exposure helps models to generalize to unseen D test out distributions far better than the baseline. Out-of-distribution image detection for the maximum softmax probability (MSP) baseline detector and the MSP detector after fine-tuning with Outlier Exposure (OE). Results are percentages and also an average of 10 runs. Expanded results are in Appendix A.

Table content: <table><tr><td/><td colspan="2">FPR95 ↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>D in</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td></tr><tr><td>SVHN</td><td>6.3</td><td>0.1</td><td>98.0</td><td>100.0</td><td>91.1</td><td>99.9</td></tr><tr><td>CIFAR-10</td><td>34.9</td><td>9.5</td><td>89.3</td><td>97.8</td><td>59.2</td><td>90.5</td></tr><tr><td>CIFAR-100</td><td>62.7</td><td>38.5</td><td>73.1</td><td>87.9</td><td>30.1</td><td>58.2</td></tr><tr><td>Tiny ImageNet</td><td>66.3</td><td>14.0</td><td>64.9</td><td>92.2</td><td>27.2</td><td>79.3</td></tr><tr><td>Places365</td><td>63.5</td><td>28.2</td><td>66.5</td><td>90.6</td><td>33.1</td><td>71.0</td></tr><tr><td/><td colspan="2">FPR90 ↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>D in</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td></tr><tr><td>20 Newsgroups</td><td>42.4</td><td>4.9</td><td>82.7</td><td>97.7</td><td>49.9</td><td>91.9</td></tr><tr><td>TREC</td><td>43.5</td><td>0.8</td><td>82.1</td><td>99.3</td><td>52.2</td><td>97.6</td></tr><tr><td>SST</td><td>74.9</td><td>27.3</td><td>61.6</td><td>89.3</td><td>22.9</td><td>59.4</td></tr></table>

Comparisons between the MSP baseline and the MSP of the natural language classifier fine-tuned with OE. Results are percentages and averaged over 10 runs. In Table3, the baseline values are derived from the maximum softmax probabilities produced by the classifier trained with DeVries & Taylor (2018)'s publicly available training code. The confidence branch improves over this MSP detector, and after OE, the confidence branch detects anomalies more effectively.

Table content: <table><tr><td/><td/><td>FPR95 ↓</td><td/><td/><td>AUROC ↑</td><td/><td/><td>AUPR ↑</td><td/></tr><tr><td>D in</td><td colspan="3">MSP Branch +OE</td><td colspan="3">MSP Branch +OE</td><td colspan="3">MSP Branch +OE</td></tr><tr><td>CIFAR-10</td><td>49.3</td><td>38.7</td><td>20.8</td><td>84.4</td><td>86.9</td><td>93.7</td><td>51.9</td><td>48.6</td><td>66.6</td></tr><tr><td>CIFAR-100</td><td>55.6</td><td>47.9</td><td>42.0</td><td>77.6</td><td>81.2</td><td>85.5</td><td>36.5</td><td>44.4</td><td>54.7</td></tr><tr><td>Tiny ImageNet</td><td>64.3</td><td>66.9</td><td>20.1</td><td>65.3</td><td>63.4</td><td>90.6</td><td>30.3</td><td>25.7</td><td>75.2</td></tr></table>

Comparison among the maximum softmax probability, Confidence Branch, and Confidence Branch + OE OOD detectors. The same network architecture is used for all three detectors. All results are percentages, and averaged across all D test out datasets. fromLee et al. (2018). They carefully train a GAN to generate synthetic examples near the classifier's decision boundary. The classifier is encouraged to have a low maximum softmax probability on these synthetic examples. For CIFAR classifiers, they mention that a GAN can be a better source of anomalies than datasets such as SVHN. In contrast, we find that the simpler approach of drawing anomalies from a diverse dataset is sufficient for marked improvements in OOD detection.We train a 40-4 Wide Residual Network usingLee et al. (2018)'s publicly available code, and use the network's maximum softmax probabilities as our baseline. Another classifier trains concurrently with a GAN so that the classifier assigns GAN-generated examples a high OOD score. We want each D test out to be novel. Consequently we use their code's default hyperparameters, and exactly one model encounters all tested D test out distributions. This is unlike their work since, for each D test out distribution, they train and tune a new network. We do not evaluate on Tiny ImageNet, Places365, nor text, since DCGANs cannot stably generate such images and text reliably. Lastly, we take the network trained in tandem with a GAN and fine-tune it with OE. Table4shows the large gains from using OE with a real and diverse dataset over using synthetic samples from a GAN.

Table content: <table><tr><td/><td/><td>FPR95 ↓</td><td/><td/><td>AUROC ↑</td><td/><td/><td>AUPR ↑</td><td/></tr><tr><td>D in</td><td colspan="3">MSP +GAN +OE</td><td colspan="3">MSP +GAN +OE</td><td colspan="3">MSP +GAN +OE</td></tr><tr><td>CIFAR-10</td><td>32.3</td><td>37.3</td><td>11.8</td><td>88.1</td><td>89.6</td><td>97.2</td><td>51.1</td><td>59.0</td><td>88.5</td></tr><tr><td>CIFAR-100</td><td>66.6</td><td>66.2</td><td>49.0</td><td>67.2</td><td>69.3</td><td>77.9</td><td>27.4</td><td>33.0</td><td>44.7</td></tr></table>



Table content: <table/>

OOD detection results with a PixelCNN++ density estimator, and the same estimator after applying OE. The model's bits per pixel (BPP) scores each sample. All results are percentages. Test distributions D test out are described in Appendix A.

Table content: <table><tr><td/><td/><td colspan="2">FPR95 ↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>D in</td><td>D test out</td><td>BPP</td><td>+OE</td><td>BPP</td><td>+OE</td><td>BPP</td><td>+OE</td></tr><tr><td/><td>Gaussian</td><td>0.0</td><td>0.0</td><td>100.0</td><td>100.0</td><td>100.0</td><td>99.6</td></tr><tr><td/><td>Rademacher</td><td>61.4</td><td>50.3</td><td>44.2</td><td>56.5</td><td>14.2</td><td>17.3</td></tr><tr><td/><td>Blobs</td><td>17.2</td><td>1.3</td><td>93.2</td><td>99.5</td><td>60.0</td><td>96.2</td></tr><tr><td>CIFAR-10</td><td>Textures SVHN</td><td>96.8 98.8</td><td>48.9 86.9</td><td>69.4 15.8</td><td>88.8 75.8</td><td>40.9 9.7</td><td>70.0 60.0</td></tr><tr><td/><td>Places365</td><td>86.1</td><td>50.3</td><td>74.8</td><td>89.3</td><td>38.6</td><td>70.4</td></tr><tr><td/><td>LSUN</td><td>76.9</td><td>43.2</td><td>76.4</td><td>90.9</td><td>36.5</td><td>72.4</td></tr><tr><td/><td>CIFAR-100</td><td>96.1</td><td>89.8</td><td>52.4</td><td>68.5</td><td>19.0</td><td>41.9</td></tr><tr><td/><td>Mean</td><td>66.6</td><td>46.4</td><td>65.8</td><td>83.7</td><td>39.9</td><td>66.0</td></tr></table>

expanded results and D test out descriptions are in Appendix F. In all cases, OE improves over the baseline, and the improvement is especially large for the word-level model.

Table content: <table><tr><td/><td colspan="2">FPR90 ↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>D in</td><td colspan="2">BPC/BPW +OE</td><td colspan="2">BPC/BPW +OE</td><td colspan="2">BPC/BPW +OE</td></tr><tr><td>PTB Characters</td><td>99.0</td><td>89.4</td><td>77.5</td><td>86.3</td><td>76.0</td><td>86.7</td></tr><tr><td>PTB Words</td><td>48.5</td><td>0.98</td><td>81.2</td><td>99.2</td><td>44.0</td><td>97.8</td></tr></table>

OOD detection results on Penn Treebank language models. Results are percentages averaged over the D test out datasets. Expanded results are in Appendix F.

Table content: <table/>

.

Table content: <table><tr><td/><td/><td colspan="2">FPR95 ↓</td><td colspan="2">AUROC ↑</td><td colspan="2">AUPR ↑</td></tr><tr><td>D in</td><td>D test out</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td><td>MSP</td><td>+OE</td></tr><tr><td/><td>Gaussian</td><td>5.4</td><td>0.0</td><td>98.2</td><td>100.</td><td>90.5</td><td>100.</td></tr><tr><td/><td>Bernoulli</td><td>4.4</td><td>0.0</td><td>98.6</td><td>100.</td><td>91.9</td><td>100.</td></tr><tr><td/><td>Blobs</td><td>3.7</td><td>0.0</td><td>98.9</td><td>100.</td><td>93.5</td><td>100.</td></tr><tr><td>SVHN</td><td>Icons-50 Textures Places365</td><td>11.4 7.2 5.6</td><td>0.3 0.2 0.1</td><td>96.4 97.5 98.1</td><td>99.8 100. 100.</td><td>87.2 90.9 92.5</td><td>99.2 99.7 99.9</td></tr><tr><td/><td>LSUN</td><td>6.4</td><td>0.1</td><td>97.8</td><td>100.</td><td>91.0</td><td>99.9</td></tr><tr><td/><td>CIFAR-10</td><td>6.0</td><td>0.1</td><td>98.0</td><td>100.</td><td>91.2</td><td>99.9</td></tr><tr><td/><td>Chars74K</td><td>6.4</td><td>0.1</td><td>97.9</td><td>100.</td><td>91.5</td><td>99.9</td></tr><tr><td/><td>Mean</td><td>6.28</td><td>0.07</td><td>97.95</td><td>99.96</td><td>91.12</td><td>99.85</td></tr><tr><td/><td>Gaussian</td><td>14.4</td><td>0.7</td><td>94.7</td><td>99.6</td><td>70.0</td><td>94.3</td></tr><tr><td/><td>Rademacher</td><td>47.6</td><td>0.5</td><td>79.9</td><td>99.8</td><td>32.3</td><td>97.4</td></tr><tr><td>CIFAR-10</td><td>Blobs Textures SVHN Places365</td><td>16.2 42.8 28.8 47.5</td><td>0.6 12.2 4.8 17.3</td><td>94.5 88.4 91.8 87.8</td><td>99.8 97.7 98.4 96.2</td><td>73.7 58.4 66.9 57.5</td><td>98.9 91.0 89.4 87.3</td></tr><tr><td/><td>LSUN</td><td>38.7</td><td>12.1</td><td>89.1</td><td>97.6</td><td>58.6</td><td>89.4</td></tr><tr><td/><td>CIFAR-100</td><td>43.5</td><td>28.0</td><td>87.9</td><td>93.3</td><td>55.8</td><td>76.2</td></tr><tr><td/><td>Mean</td><td>34.94</td><td>9.50</td><td>89.27</td><td>97.81</td><td>59.16</td><td>90.48</td></tr><tr><td/><td>Gaussian</td><td>54.3</td><td>12.1</td><td>64.7</td><td>95.7</td><td>19.7</td><td>71.1</td></tr><tr><td>CIFAR-100</td><td>Rademacher Blobs Textures SVHN Places365</td><td>39.0 58.0 71.5 69.3 70.4</td><td>17.1 12.1 54.4 42.9 49.8</td><td>79.4 75.3 73.8 71.4 74.2</td><td>93.0 97.2 84.8 86.9 86.5</td><td>30.1 29.7 33.3 30.7 33.8</td><td>56.9 86.2 56.3 52.9 57.9</td></tr><tr><td/><td>LSUN</td><td>74.0</td><td>57.5</td><td>70.7</td><td>83.4</td><td>28.8</td><td>51.4</td></tr><tr><td/><td>CIFAR-10</td><td>64.9</td><td>62.1</td><td>75.4</td><td>75.7</td><td>34.3</td><td>32.6</td></tr><tr><td/><td>Mean</td><td>62.66</td><td>38.50</td><td>73.11</td><td>87.89</td><td>30.05</td><td>58.15</td></tr><tr><td/><td>Gaussian</td><td>72.6</td><td>45.4</td><td>33.7</td><td>76.5</td><td>12.3</td><td>28.6</td></tr><tr><td>Tiny ImageNet</td><td>Rademacher Blobs Textures SVHN Places365 LSUN</td><td>51.7 79.4 76.4 52.3 63.6 67.0</td><td>49.0 0.0 4.8 0.4 0.4 0.4</td><td>62.0 48.2 70.4 80.8 76.9 74.2</td><td>65.1 100. 98.5 99.8 99.8 99.9</td><td>18.8 14.4 31.4 42.8 36.3 31.2</td><td>20.0 99.9 95.8 98.2 99.3 99.5</td></tr><tr><td/><td>ImageNet</td><td>67.3</td><td>11.6</td><td>72.8</td><td>97.9</td><td>30.0</td><td>92.9</td></tr><tr><td/><td>Mean</td><td>66.27</td><td>13.99</td><td>64.86</td><td>92.18</td><td>27.15</td><td>79.26</td></tr><tr><td/><td>Gaussian</td><td>37.1</td><td>9.4</td><td>72.2</td><td>93.5</td><td>23.5</td><td>54.1</td></tr><tr><td/><td>Rademacher</td><td>60.4</td><td>13.5</td><td>47.7</td><td>90.2</td><td>14.6</td><td>44.9</td></tr><tr><td>Places365</td><td>Blobs Icons-50 Textures SVHN</td><td>73.7 59.1 84.1 19.9</td><td>0.1 0.0 49.9 0.0</td><td>41.9 82.7 66.6 96.6</td><td>100.0 99.9 91.4 100.0</td><td>13.0 49.9 24.6 90.5</td><td>99.4 99.7 75.7 99.9</td></tr><tr><td/><td>ImageNet</td><td>86.3</td><td>65.3</td><td>63.0</td><td>86.5</td><td>25.1</td><td>69.7</td></tr><tr><td/><td>Places69</td><td>87.3</td><td>87.5</td><td>61.5</td><td>63.1</td><td>23.4</td><td>24.9</td></tr><tr><td/><td>Mean</td><td>63.46</td><td>28.21</td><td>66.51</td><td>90.57</td><td>33.08</td><td>71.04</td></tr></table>

Outlier Exposure fine-tuning occurs with each epoch being the length of in-distribution dataset epoch, so that Outlier Exposure completes quickly and does involve reading the entire D OE out dataset. Results using an All Convolutional Network architectures. Results are percentages and an average of 10 runs. E OUTLIER EXPOSURE WITH H(U; p) SCORES DOES BETTER THAN WITH MSP SCORES While -max c f c (x) tends to be a discriminative OOD score for example x, models with OE can do better by using -H(U; f (x)) instead. This alternative accounts for classes with small probability mass rather than just the class with most mass. Additionally, the model with OE is trained to give anomalous examples a uniform posterior not just a lower MSP. This simple change roundly aids performance as shown in Table 10. This general performance improvement is most pronounced on datasets with many classes. For instance, when D test out = Tiny ImageNet and D test out = Gaussian, swapping the MSP score with the H(U; f (x)) score increases the AUROC 76.5% to 97.1%.

Table content: <table><tr><td>C TRAINING FROM SCRATCH WITH OUTLIER EXPOSURE USUALLY</td></tr><tr><td>IMPROVES DETECTION PERFORMANCE</td></tr><tr><td>Elsewhere we show results for pre-trained networks that are fine-tuned with OE. However, a net-</td></tr><tr><td>work trained from scratch which simultaneously trains with OE tends to give superior results. For</td></tr><tr><td>example, a CIFAR-10 Wide ResNet trained normally obtains a classification error rate of 5.16% and</td></tr><tr><td>an FPR95 of 34.94%. Fine-tuned, this network has an error rate of 5.27% and an FPR95 of 9.50%.</td></tr><tr><td>Yet if we instead train the network from scratch and expose it to outliers as it trains, then the error</td></tr><tr><td>rate is 4.26% and the FPR95 is 6.15%. This architecture corresponds to a 9.50% RMS calibration</td></tr><tr><td>error with OE fine-tuning, but by training with OE from scratch the RMS calibration error is 6.15%.</td></tr><tr><td>Compared to fine-tuning, training a network in tandem with OE tends to produce a network with</td></tr><tr><td>a better error rate, calibration, and OOD detection performance. The reason why we use OE for</td></tr><tr><td>fine-tuning is because training from scratch requires more time and sometimes more GPU memory</td></tr><tr><td>than fine-tuning.</td></tr><tr><td>D OE WORKS ON OTHER VISION ARCHITECTURES</td></tr><tr><td>Outlier Exposure also improves vision OOD detection performance for more than just Wide</td></tr><tr><td>ResNets. Table 9 shows that Outlier Exposure also improves vision OOD detection performance</td></tr><tr><td>for "All Convolutional Networks" (Salimans &amp; Kingma, 2016).</td></tr></table>

OOD detection results on Penn Treebank examples and English Web Treebank outliers. All results are percentages.The D test out datasets come from the English Web Treebank(Bies et al., 2012), which contains text from five different domains: Yahoo! Answers, emails, newsgroups, product reviews, and weblogs. Other NLP D test out datasets we consider do not satisfy the language modeling assumption of continuity in the examples, so we do not evaluate on them.

Table content: <table/>

Calib. Error ↓ MAD Calib. Error ↓ Calibration results for the temperature tuned baseline and temperature tuning + OE.

Table content: <table><tr><td>Soft F1 Score ↑</td></tr></table>

Calibration results for the softmax temperature tuning baseline, the same baseline after adding Posterior Rescaling, and temperature tuning + Posterior Rescaling + OE.

Table content: <table><tr><td/><td/><td colspan="2">Calib. Error ↓</td><td colspan="3">MAD Calib. Error ↓</td><td colspan="3">Soft F1 Score ↑</td></tr><tr><td>D in</td><td colspan="3">Temp +Rescale +OE</td><td colspan="3">Temp +Rescale +OE</td><td colspan="3">Temp +Rescale +OE</td></tr><tr><td>SVHN</td><td>22.3</td><td>20.8</td><td>3.0</td><td>10.9</td><td>10.1</td><td>1.0</td><td>52.1</td><td>56.1</td><td>92.7</td></tr><tr><td>CIFAR-10</td><td>19.4</td><td>17.8</td><td>6.7</td><td>12.6</td><td>11.7</td><td>4.1</td><td>39.9</td><td>42.8</td><td>73.9</td></tr><tr><td>CIFAR-100</td><td>14.7</td><td>14.4</td><td>8.1</td><td>11.3</td><td>11.1</td><td>6.4</td><td>52.8</td><td>53.1</td><td>66.1</td></tr><tr><td>Tiny ImageNet</td><td>12.0</td><td>11.9</td><td>6.9</td><td>9.0</td><td>8.8</td><td>4.8</td><td>62.9</td><td>63.1</td><td>72.3</td></tr></table>

Peer review (iclr2019):
 This paper describes how a deep neural network can be fine-tuned to perform outlier detection in addition to its primary objective. For classification, the fine-tuning objective encourages out-of-distribution samples to have a uniform distribution over all class labels. For density estimation, the objective encourages out-of-distribution samples to be ranked as less probability than in-distribution samples. On a variety of image and text datasets, this additional fine-tuning step results in a network that does much better at outlier detection than a naive baseline, sometimes approaching perfect AUROC. The biggest weakness in this paper is the assumption that we have access to out-of-distribution data, and that we will encounter data from that same distribution in the future. For the typical anomaly detection setting, we expect that anomalies could look like almost anything. For example, in network intrusion detection (a common application of anomaly detection), future attacks are likely to have different characteristics than past attacks, but will still look unusual in some way. The challenge is to define "normal" behavior in a way that captures the full range of normal while excluding "unusual" examples. This topic has been studied for decades. Thus, I would not classify this paper as an anomaly detection paper. Instead, it*s defining a new task and evaluating performance on that task. The empirical results demonstrate that the optimization succeeds in optimizing the objective it was given. What*s missing is the justification for this problem setting -- when is it the case that we need to detect outliers *and* have access to the distribution over outliers? -------- UPDATE AFTER RESPONSE PERIOD: My initial read of this paper was incorrect -- the authors do indeed separate the outlier distribution used to train the detector from the outlier distribution used for evaluation. Much of these details are in Appendix A; I suggest that the authors move some of this earlier or more heavily reference Appendix A when describing the methods and introducing the results. I am not well-read in the other work in this area, but this looks like a nice advance. Based on my read of the related work section (again, having not studied the other papers), it looks like this work fills a slightly different niche from some previous work. In particular, OE is unlikely to be adversarially robust. So this might be a poor choice for finding anomalies that represent malicious behavior (e.g., network intrusion detection, adversarial examples, etc.), but good for finding natural examples from a different distribution (e.g., data entry errors). My main remaining reservation is that this work is still at the stage of empirical observation -- I hope that future work (by these authors or others) can investigate the assumptions necessary for this method to work, and even characterize how well we should expect it to work. Without a framework for understanding generalization in this context, we may see a proliferation of heuristics that succeed on benchmarks without developing the underlying principles.