TIME-LAPSE: Learning to say “I don't know” through spatio-temporal uncertainty scoring
Authors: Nandita Bhaskhar
Daniel Rubin
Christopher Lee-Messer
Venue: ICLR 2022 Submitted (2022)
Keywords: out-of-distribution detection
OOD detection
spatio-temporal
latent-space
sequential
outlier
anomaly

Abstract: Safe deployment of trained ML models requires determining when input samples go out-of-distribution (OOD) and refraining from making uncertain predictions on them. Existing approaches inspect test samples in isolation to estimate their corresponding predictive uncertainty. However, in the real-world, deployed models typically see test inputs consecutively and predict labels continuously over time during inference. In this work, we propose TIME-LAPSE, a spatio-temporal framework for uncertainty scoring that examines the sequence of predictions prior to the current sample to determine its predictive uncertainty. Our key insight is that in-distribution samples will be more “similar” to each other compared to OOD samples, not just over the encoding latent-space but also across time. Specifically, (a) our spatial uncertainty score estimates how different OOD latent-space representations are from those of an in-distribution set using metrics such as Mahalanobis distance and cosine similarity and (b) our temporal uncertainty score determines deviations in correlations over time using representations of past inputs in a non-parametric, sliding-window based algorithm. We evaluate TIME-LAPSE on both audio and vision tasks using public datasets and further benchmark our approach on a challenging, real-world, electroencephalograms (EEG) dataset for seizure detection. We achieve state-of-the-art results for OOD detection in the audio and EEG domain and observe considerable gains in semantically corrected vision benchmarks. We show that TIME-LAPSE is more driven by semantic content compared to other methods, i.e., it is more robust to dataset statistics. We also propose a sequential OOD detection evaluation framework to emulate real-life drift settings and show that TIME-LAPSE outperforms spatial methods significantly.  

Under review as a conference paper at ICLR 2022
TIME-LAPSE: UNCERTAINTY SCORING VIA LATENT- SPACE EMBEDDINGS OVER TIME
Anonymous authors Paper under double-blind review
ABSTRACT
Safe deployment of trained ML models requires determining when they are un- certain of their predictions and refraining from using them for decision-making. Existing approaches inspect test samples isolation estimate their correspond- ing predictive uncertainty. However, in the real-world, deployed models typically see test inputs consecutively and predict labels continuously over time during infer- ence. We propose TIME-LAPSE, an uncertainty scoring framework that examines a sequence of latent-space embeddings over time prior to the current sample to determine its predictive uncertainty. Specifically, (a) spatial uncertainty score estimates uncertainty using distance metrics (Mahalanobis distance) and similarity metries (cosine similarity) in the latent-space and (b) temporal uncertainty score determines deviations correlations over time using representations past inputs in a non-parametric, fliding-window based algorithm. We evaluate TIME- LAPSE through the lens of outtof-distribution (OOD) detection and dataset shift detection on tasks over diverse domains: audio and vision using public datasets and further benchmark our approach on a challenging, real-world, electroencephalo grams (EEG) dataset for seizure detection. We achieve state-of-the-ee results for OOD detection in the audio and EEG domain and observe considerable gains in semantically corrected vision benchmarks. We show that TIME-LAPSE is more driven by semantic content compared to other methods, i.e., it is more robust to dataset statistics. We also show that TIME-LAPSE outperforms spatial methods significantly through our sequential evaluation framework that emulates real-life drift settings through extensive experiments and ablations.
INTRODUCTION
Modern machine learning (ML) has seen tremendous success in various tasks across multiple domains
(Bojarski et al., 2016 Hinton 2018 Kreinovich & Kosheleva, 2020 van den Oord et al. (016)),
surpassing human performance in many benchmarks (EEsteva et al. 2017 Yala et 2019 Krizhevsky eet 2012). However, deep learning models have been known to fail silently and catastrophically
with highly confident predictions (Nguyen et al.) 2015) Goodfellow et al,, 2015) Guo et al., 2017).
Such models assume closed world scenario, i.e., they assume that variability encountered when deployed in the real-world would be similar to the variability present in their training data. In practice, they encounter an open world where incoming samples can come from shifted distributions or completely new distributions (Liu et al.) 2020). This behaviour can have severe consequences in mission-critical domains such healtheare and autonomous driving, where errors can be costly, resulting in injury or even death (Amodei et al. 2016). Most widely cited models do not come with an uncertainty scoring mechanism to say "I don't know" or to abstain from prediction (Kompa et al., 2021). As deployed MI. models are used to inform real-world decisions, it is important that they have ability to understand when they ought to be "unsure". good uncertainty scoring framework must assign higher uncertainty estimates when the network is faced with distributional shifts or new semantic content, i.c., out-of-distrrbuttin (OOD) data but must be certain (low uncertainty) and generalize well learnt distributions yet unseen data (in-distribution or InD data).
The task of identifying when incoming inputs are drawn far from the training distribution is called ditt----iitribttiinn (OOD) detection. At its core, is a binary classification problem, evaluated using measures such as area under the receiver operating curve (AUROC), area under the precision recall curve (AUPR) and false positive rate at 80% true positive rate (FPR80). Current OOD evaluation

---

Under review as a conference paper at ICLR 2022
ligh-dimensional imputs as sequence
Trained Encoder
Lalent Space
Spatial Scorer
Spatial Scorer
Spatial Scorer
Extracted Representation
Temporal Soorer
8xp
Reference Window Rw
Gliding Window Sug
%
Figure 1: TIME-LAPSE for uncertainty scoring. High-dimensional inputs (images, audio, speech, EEG signals, etc) are passed sequentially during inference. Dark green indicates samples from the training set. Light green light orange represent potential InD and OOD inputs respectively. Each input projected on to a lower-dimensional latent space using a well-trained encoder and its spatial uncertainty score is extracted by the spatial scorer. The temporal scorer utilizes the sequence of spatial scores to give the final temporal uncertainty scores 8t-
schemes hold different datasets to be OOD sources, without considering if the distinctions are semantic in nature (Ahmed & Courville 2020) leading to methods that are insensitive semantic overlap and biased to dataset statistics. Closely related is the task of dataset shift detection (Moreno- Torres al., 2012), crucial for deployed systems. Dataset shift can occur due sample selection bias, non-stationary environments, missing values, new concepts evolving over time, etc. Most ML systems do not evaluate their ability detect such shifts, presenting huge gap between models performing well on test sets and models capable of being deployed in the wild.
In this paper, we propose TIME-LAPSE, a predictive uncertainty quantification framework using latent space embeddings over time, evaluated through downstream tasks of OOD) detection and dataset shift detection. A key insight in our approach is that most real-world scenarios (such as elettreencephalogram (EEG) seizure analysis, healthcare decision making, autonomous driving, etc.) involve consecutive inputs to the model that are likely to be correlated over time. For example, an obstacle detector deployed in self-driving car will images correlated detector installed in neurology clinic will process hours of time-correlated EEG signals. Even low-risk image classification models deployed in search engines the cloud will correlated inputs over time when grouped by user ID or location. Thus, sequentially occurring samples share meaningful semantic correlations.
time. A seizure
In TIME-LAPSE (Fig. D. we compute spatial uncertainty scores based on the following hypotheses: an encoder with enough inductive bias likely (a) maps OOD inputs "far" from other InD samples in the latent space under the Mahalanobis distance metric (Lee et al. 2018) and (b) produces dissimilarities between their representations under the cosine similarity metric (Jones Furnas 1987). We compute temporal uncertainty scores by exploiting correlations between lower dimensional representations of consecutive samples over time when examined sequence. A sequence of InD inputs will show more correlation than sequence with both InD and OOD inputs sequence with just OOD inputs.
Recent works limit themselves to OOD detection tasks with evaluations purely on highly curated image benchmarks, but do not extend their tests to more diverse and realistic scenarios required for practical applications (Ren et al. 2019: Ahmed & Courville, 2020). Such OOD image benchmarks consider different datasets to be OOD sources, neglecting any semantic overlap between their OOD test sets and InD train sets, leading to narrow model capabilities (Yang et al. (021). We show that TIME-LAPSE is more driven by semantic content compared to other techniques, i.e. more
2

---

Under review as a conference paper at ICLR 2022
robust to dataset statistics. Moreover, current evaluation schemes do not consider different dataset drift settings that could occur in the real-world. We put forth an additional sequential evaluation framework to evaluate methods under realistic conditions of data drifts and show that TIME- LAPSE outperforms other methods significantly. We demonstrate the efficacy of our proposed method by comparing against multiple baselines over different domains (vision, audio and clinical EEGs). We achieve state-of-the-art (SOTA) on both audio and EEG datasets while improving performance on semantically corrected image benchmarks. To the best of our knowledge, are the first use temporal sequences of latent space embeddings for uncertainty quantification. We are also the first to use leap-lennn based uncertainty scoring techniques for EEG analyses.
To summarize, our key contributions are:
We propose TIME-LAPSE, an uncertainty scoring framework that uses samples' similarity in the latent space and their temporal similarity amongst sequential inputs to determine their predictive uncertainty.
We show that scores from TIME-LAPSE are driven by semantic content and are more robust to dataset statistics whereas popular baselines, benchmarked on standard image datasets, are susceptible dataset statistics and overlook semantic overlap for OOD detection.
We benchmark TIME-LAPSE on diverse domains: audio speech classification, seizure detection using clinical EEGs and image classification. TIME-LAPSE. achieves state-of-the-art (SOTA) in audio tasks, the EEG domain and semantically corrected image benchmarks.
We propose scquential evaluation framework for dataset shift detection to evaluate methods under realistic conditions data drifts and show that TIME-LAPSE outperforms other methods. We hope this evaluation scheme will be adopted for routinely characterizing ML system performance in the wild.
2 RELATED WORK
Uncertainty estimation is a rich field with a long history. Classical techniques include density
estimation (Breunig et al. 2000), one-class SVMs (Schölkopf et al. 1999), tree-isolation forests (Liu jet al.] 2208)) etc for dineniinnsional data such as time-series However, such techniques scale badly
with input dimensionality (Rabanser al. 2019). Calibration is frequentiit notion of uncertainty.
measured by proper scoring rules like log-loss or Brier scoring (Guo et al., 2017: DeGiroot & Fienherg
1983. Dawid 1982). Uncertainty estimation for deep neural networks (NNs) (Lakshminarryyaaan
et al.
2017) typically use Bayesian formalism to learn distributions over model weights (Blundell
al.
2015 Malinin Gales 2018 Chen et al. 2019 Graves 201T; Neal 1996, Welling & Teh
201 However, most Bayesian methods are difficutt to train and computationally expensive. Gal &
Ghahramani (2016) use Monte- Carlo dropout at test- test-time with an approximate Bayesian interpretation
to derive uncertainty estimates.It is also computationally expensive, requiring & forward passes for each instance during inference. Quality of uncertainty estimates are commonly evaluated using OOD detection. Moreno-Torres et al. (2012) give complete overview of closely related topics of distributional shift detection including covariate shift, label shift and concept drift (Gama et al.. 2014). Several works consider (Hendrycks et al. 2019a Ruff et al. 2020), while many assume the supervised setting where the target OOD distribution known and propose alternative training strategies and auxillary OOD tasks
techniques for OOD such outlier exposure methods
(DeVries & Taylor 2018 Hendrycks et al. 2019b; Mohseni et al., 2020) Shalev et al. 2018) in
multi-task setting. In this paper, consider the more general setting of unsupervised OOD detection
where no OOD examples are labelled as such and the encoder has access to only InD training labels.
Other methods use representations from NNs infer OOD inputs. [Hendrycks & Gimpel (2017) use maximum softmax probabilites (MSP) to detect OOD data. Liang et al. (2018) improve this by introducing a temperature parameter the softmax equation. [ee al. ( (2018) 1) fit class-conditional Gaussians to intermediate activations and use the Mahalanobis distance to identify OOD samples. Recently some works use self-supervision to get better representations to improve OOD detection (Tack et al. 2020 Winkens et al. 2020 Sehwag et al. 2021). Several methods directly use input likelihoods as the OOD detection score. However, studies have shown that generative techniques may be overeonfident proposed since then (Serrà et al. [2000] Xiao et al. 2220: Choi et al.) 2019) including energy-based
complex inputs (Nalisnick 2019). Modified likelihood scores have been
models (Liu et al. 2020
Du & Mordatch| 2019
Grathwohl al. 2020) and likelihood ratios (Ren
3

---

Under review as a conference paper at ICLR 2022
Reconstruction-base OOD methods reconstruction loss as the uncertainty score and primarlly use auto -utoden (Zong et al. 2018: Pidhorskyi et al. 2018) or GANs (Schlegl et al. 2017: Deecke et al. 2019; Perera et al., 2019). Our temporal uncertainty scores builds upon and shares similarity to change point detection methods in time-series data (Aminikhanghahi & Cook
et al. 2019).
2017| [Kifer et al., 2004) along with signal processing techniques such as Particle and Kalman filtering
(van der Merwe et al. 2001] Kalman 1960).
3 TIME-LAPSE: OUR UNCERTAINTY SCORING FRAMEWORK
We propose TIME-LAPSE, an uncertainty scoring framework using latent-space embeddings over time. We consider multi-class classification setting here, though our framework can be extended to other scenarios such as regression, segmentation, etc.
3.1 PROBLEM SETUP
Let X' represent our high- high-dimensional input space, X C IR. (0,
denote the label space where C is the number of classes. In standard multi-class classification, we learn classifier f: + y using dataset Dtrain (assumed to be sampled from an underlying distribution p²) such that f(x) = >(Y yr(r), where x X' and y/ J' 4 i. The final prediction for unseen input x is given by ý = arg max, p(y](.) (x). Given a sequence of unseen inputs, Iy (where / denotes time) to a classifier during inference, our goal is to output score s(x,) and a selective function g(x)) with threshold th V 2, such that
arg max,,
v, p(ys(are;
if s(x+) S th
(g. 8) (2+) ABSTAIN or FLAG AS OOD, else
We call the score s(x)) the associated uncertainty score of input sample øt
3.2 TIME-LAPSE FRAMEWORK
We use the learnt classifier derive an encoder h X' - 1 that maps high-dimensional inputs X C R" onto latent space U C Rd through its intermediate representations. Note that h is inherently learnt when f is trained using the InD training dataset Dtrein. TIME-LAPSE is agnostic to the training method, which can be supervised, self-superviser or unsupervised depending how the label information Dirain is utilized.
3.2.1 LEARNING SPATIAL UNCERTAINTY SCORES
To extract the spatial uncertainty score of an input test sample's prediction, we apply two fundamental hypotheses: (a) well-trained encoder maps InD samples onto a dense region in the latent space but maps OOD inputs outside this region under distance metric with high likelihood, and (b) the OOD inputs that get mapped to the latent space do not share similarity with InD inputs under similarity metric, sim.
To identify spatially distinguishable OOD inputs, first model the extent of InD region D within the exedddiimesioonl latent space, using the InD samples. We extract a coreset by sampling from our InD training data, D Drrain-
coresct (h(x:;)
Dtrain);
[D
ccoreset]
We compute the distance score Sais and the similarity score 8am of the unseen test sample æ by comparing its latent representation that of samples in the coreset using distance metric d and similarity metric sim such that:
ddist h(m))) coreset
min d(h(x;), h(x)) Ssim (x)
max sim sim(h(x:), (xx))
h(xz)) coreset
Finally, the combined spatial uncertainty score is given by
Aspatial (1) S (sim(r)
4

---

Under review as a conference paper at ICLR 2022
We choose the distance metric d to be the Mahalanobis distance obtained using class-conditional Gaussians (Lee et al. 2018) without label smoothing (Winkens et al. 2020) where class-wise means Me and covariance matries L, are estimated from the coreset.
d(h(z)) = min (h(x) - po)" N (h(x) mM)
As similarity metric sim, we adopt the cosine similarity between the test input's representation and the coreset.
h(x) A(xz)
(m(hh()),(x.))) [[b(=)]] [[(();)]]*
h(x;)) E coreset
We note that TIME-LAPSE will accept any d and sim that is most suited for the target domain.
3.2.2 LEARNING TEMPORAL UNCERTAINTY SCORES
Our hypothesis in extracting our temporal uncertainty scores is that there is value evaluating samples in the context of other samples instead of viewing them independently. In our framework, we consider high-dimensional inputs to the model as sequence (Fig. D]. We use the representational capabilities of modern encoders and examine them over time instead of directly modeling the incoming high-dimensional, multivariate data stream or treating each sample independently, i.e., detect when input samples go (Aspatial) with those of other inputs over time. We note that when these scores are scalar (as in our case). the problem reduces change-point detection for one-dimensional sequence.
by comparing their deltucdd-dimensiie scores
We put forth an unsupervised, non-parametric, Biddngg-window based algorithm that builds on the work done by Kifer et al. (2004) to generate our temporal uncertainty scores Stemporal We consider a sequence of r samples in the input data stream denoted by {I1, 22, ... It, ... Tr We obtain the scalar spatial scores for the r samples, &Sspatial (I1) ), sppuiial (I2), Sspanil (x),, ... Ssnatial from their representations (h(z1) ), h(x2), .... h(xz), ..... h(x;)) } as explained in Section 3.2.1
Given two window sizes WA and WB (WA, WB r), we define reference window Rw and sliding window (Sw), to be
Rw = [Aspatial (Ir ), Sxpatial (1 (F (Sw). ); [sspatial (2(w + f)) Sxpatial (wr + t wg))]
where t {I, (r WA w as visualized in Fig. I On choosing appropriate statistic or distance measure F (e.g. probability odds ratio, Kolmogorov-Smimet Kullback-Leibler, Wilcoxon, Mann- Hoin--Witney,, etc.), compute the temporal uncertainty score between reference window Rw and the th sliding window (Sw); )e for the tth sample
Suomporal (z+) F(Bw, (Sw)()
The null hypothesis Ho for our setting here is that the two windows (reference and sliding) are similar and come from the same distribution. We hope to reject Hy in favour of the alternate hypothesis Hi at significance level of 0.05 whenever the inputs go out- off-iitrrbbutinn. This approach (as in (Kifer al. ) assumes the data points are generated sequentially by some underlying probability distribution, but otherwise makes no assumptions on the nature of the generating distribution nor does it assume the samples are identically distributed.
EXPERIMENTAL SETUP
We perform experiments across multiple domains (vision, audio and clinical EEG signals) to evaluate approach. We choose the task of image classification for the visual domain, spoken word classification from audio clips for the audio domain and the challenging, real-world clinical task of seizure detection from EEG signals framed an EEG clip binary classification task for the healthcare domain. Our code will be made publicly available after publication.
We use variety of datasets and models in experiments. For the audio domain, Free Spoken Digits Dataset (FSDD) (Jackson et al., (017) and Google Speech Commands (GSC) dataset (Warden 2018). We train M5 encoder (Dai al. 2016) with raw audio InD data from
the
5

---

Under review as a conference paper at ICLR 2022
spoken digits 0-9 from GSC and evaluate it on unseen InD samples from GSC 0-9 and FSDD 0-9 along with OOD samples from the non-digit spoken words from GSC. For our seizure tasks, we use EEG data from Stanford Health Care (SHC) (InD: patient population 20-60 years). Lucile Packard Children's 's Hospital (LPCCH) (OOD: patient population <20 years) and the public Temple University Hospital seizure corpus (TUH) (Shah al. 2018: Obeid & Picone (016) (OOD: different patient demographics) along with Dense-Inception encoder as described by Saab et al. (2020). For our vision tasks, we use MNIST as InD and MNIST-like data as OOD and CIFARIO as InD, SVHN as OOD and CIFAR 100 as a semantic OOD evaluation set up. Details on the data, model training, embedding extraction and temporal framework settings Appendix [B.] B.3
We compare against six baselines: Maximum Softmax Probability (MSP) (Hendrycks & Gimpel 2017), Predictive Entropy (Ren et al. 2019)) KL. Divergence with Uniform Distribution (Hendrycks)
et al. 2019a), ODIN (Liang et al. 2018), Vanilla Mahalanobis distance (L.ee et al., 2018) and
Test-time Dropout (Gal & Ghahramani 2016). We provide baseline details in Appendix B.2
4.1 EVALUATION
For all experiments, we evaluate our approach only using samples unseen during training. Our test sets include unseen samples drawn from the same distribution as the training data along with samples from unseen classes and significantly different datasets. We also follow the setting recommended by Ahmed & Courville (2020) to avoid dataset bias by holding out few classes from a dataset during training and using the held-out classes new semantic content for evaluation. We evaluate OOD detection performance using standard metrics: area under the receiver operating characteristic (AUROCT), area under the precision-recat curve (AUPR)) and the false positive rate at 80% true positive rate (FPR80L) as commonly prescribed (Ren et al. (019))
It is important note that what constitutes InD or OOD is driven by context, i.e., it depends on the target task, the encoder capacity, what models need to be robust to and what they should detect as outliers. Standard OOD benchmarks treat different datasets be OOD resulting in models with narrow capabilities susceptible to dataset bias (Ahmed & Courville/ 2020 Yang et al. 2021). Moreover, they fail to capture any semantic overlap between different datasets, e.g., if model is trained to classify cats from dogs and is shown breed of dog (high semantic overlap) from a different dataset during inference, it should be considered InD whereas a muffin would be OOD since has no semantic overlap with the train set. We evaluate OOD detection performance with & without semantic overlap and show that TIME-LAPSE is driven more by semantic content than other baselines.
We further propose a sequential evaluation framework to evaluate uncertainty estimation under realistic conditions of data drifts. We evaluate performance metrics such as % error across trials and detection accuracy over N- 1000 trials. For each trial, we generate stream of test data from our test sets of length 10,000 samples with change points inserted every samples in each trial. Distribution changes are simulated by first randomly choosing InD or OOD (Bernoulli random variable with probability p E {0.2, 0.5, 0.7}) and then randomly drawing & E (50. 100, 200, 500, 1000, 5000} samples from the chosen distribution. We emulate various drift conditions including rapidly changing streams and slowly shifting streams.
RESULTS
5.1 OOD DETECTION PERFORMANCE ON AUDIO, CLINICAL EEG AND IMAGE DATASETS
We achieve the state-of-the-art (SOTA) with TIME-LAPSE scores on OOD detection in our audio and EEG-based tasks of spoken digits classification and seizure detection compared to our baselines (Table L across all metrics: AUROC, AUPR and FPR80. The AUROC values for TIME-LAPSE scores are 73.9% and 77.1%. points and 12 points higher than the strongest baseline, Test-time Dropout, for both tasks respectively. In our MNIST experiments, we see TIME-LAPSE performs comparably with Test-Time Dropout. It has the best AUPR and comparable AUROC and FPR80 values. Over CIFAR 10 experiments with the SVHN dataset (no semantic overlap with CIFAR 10) as OOD, TIME-LAPSE outperforms other baselines significantly. When CIFAR 100 classes are added (considered OOD as in standard benchmarks) to the evaluation, TIME-LAPSE shows the best AUPR score and the second best AUROC and FPR80. We examine the effect of semantic overlap present in CIFAR 100 classes with the InD classes as well as those of other domains in Section 5.2

---

Under review as a conference paper at ICLR 2022
Table 1: OOD performance. Mean scores AUROC / AUPR t/ FPRS0 4 over 5 random runs are reported.
Standard Deviations are reported Appendix (Tables 5
Best scores in hold.
Audia
BEG Data
Vision
Tisk
Speech Classification
Scizure Detection
Image Classification Digit Classification
OOD Sets
Other spoken words
Other institutions
SVHN
CIFARI00
X-MNIST
MSP
0.626/ 0..27 0.515
0.358 / / 0,7554
0.760 /,670/ /.3358
0.952/0.986/ / 0.231
0.899 0.899/0.979 / /0,148
Predictive Entrupy
0615/0.5155 0.515
0.495 0..74
0.761 /0.752/ 0.355
0.854 0.996 0.230
0.902/ /0.147
Kl_ U
0,553 / /0.47/ 0.579
0.390/ 0.472/ 0,711
0.775 0,778/ / 00.37
0,860 0.987 / 00.23
0.899 00. 00.980 / 16.
ODIN
0,466 0.448 0.7122
0.325 00,38 /0.790
0.748 / /0.77 / 0.402
0.845 0.986 0.251
0.898 0.997/ /0.148
Vanilla Mahalanobis
0.680 1.300/0.660 0:663 0.520
0.633 0.651 00.525
0.738 / 0.762/ / 0.477
0.679/ (669//.900 0.967 0.558
0.918/ / 0.984 / 10
Test- Test-Time Time Drapout
0.649/ 0.619 0.523
0.647 00619 00.583
0.716/ / 0.494
0.925 0.986 0.049
0.976 0 0.986/ / 0.016
TIME-LAPSE (ours)
0.739/ 0.704/ 0.439
0.771 0.701 0.335
0.814/ 0.827 / 0.311
0.866/ 0,988 /.239
0,972 0.995 / 0.037
Table 2:
Effect of semantic content on OOD performance. In spoken digit classification, spoken digits from different datasets (high semantic overlap) as InD should result in AUROC f. Naively considering them be OOD (dataset driven) should result in AUROC & Mean and standard deviation over 5 random runs, Best in bold.
Predictive Entropy
Vanilla Mahalanobis
Test Time
MSP
KL_U
ODIN
Dropout
(ours)
Semantic OOD
0.621 + 0.006
0.611 + 0.006
0,550 + 0.006
0.466 + 0.007
0.676 + 0.016
0.644 + 0.005 0.821 0.002
0.739 + 0.006
Dataset Driven
0.005
0.821 + 0.005
0.806 0.006
0.675
0,006
0.495 0.008
0.506 0.007
5.2 AFFINITY FOR SEMANTIC CONTENT AND ROBUSTNESS TO DATASET STATISTICS
We study the effect of semantic overlap in OOD classes and characterize how TIME-LAPSE compares against other methods in its robustness to dataset statistics over multiple domains.
Audio In our audio experiments, we train our encoder only on spoken digits 0-9 (forming the InD classes) from the Google Speech Commands (GSC) dataset. The other 25 classes (Yes, No, Right, Left, Bird, etc) in GSC have never been encountered by the model and have drastic semantic shifts in their content when compared to the InD classes 0-9 and are considered OOD. During evaluation, we show the model unseen samples from each of the classes in GSC along with samples from the Free Spoken Digits Dataset (FSDD) which contains classes 0-9 (same semantic content as InD data but different dataset) and measure OOD detection performance (Table D As an ablation, we examine the performance when we flip the FSDD classes to be OOD data in our evaluation. We see that AUROC, AUPR and FPR80 values for most baselines (notably Test-time Dropout and Predictive Entropy) increase significantly, whereas they drop for TIME-LAPSE and vanilla Mahalanobis (Table This shows that our strongest baseline methods have narrow capabilities that assume only data belonging to InD classes and having the same dataset statistics as the training data will be considered as InD. All other data will be rejected as OOD, leading to very high FPRs in practice. In contrast, TIME-LAPSE is able to identify true InD samples despite differing dataset statistics, i.e. TIME-LAPSE detects OOD samples based on semantic content than dataset statistics when compared to the other methods.
Vision (CIFAR10) For CIFAR experiments, we train our encoder only on 7 classes of CIFAR 10, leaving out classes Airplane, Bird and Dog. SVHN data consists of images of numbers and has no semantic overlap with any of the 7 InD classes (Automobile, Cat, Deer, Frog, Horse, Ship, Truck). To study the effect of semantic overlap, we consider the 100 classes from CIFAR 100 along with the 3 left out classes from CIFARIO 10. We compare the performance metrics when naively considering all of the above as OOD ignoring any semantic overlap. We see that baselines perform better while TIME-LAPSE drops (Table D). We analyse class-wise performance and we see that TIME-LAPSE's performance strongly correlates to semantic content compared to other methods. For example, consider Class Pickup-Truck and Streetcar from CIFAR100. While they are disjoint from the InD classes Automobile and Truck in CIFARIO, they shares a high degree of semantic content and should be considered InD. When models encounter samples from classes that have high semantic overlap with InD, they need to consider them InD and not OOD. Instead, if such samples are considered OOD, only methods that have narrow model capacities will show high detection performance (Table indicating their dependence on data statisties instead of semantic content.
Vision (MNIST) We train two different encoders, one trained on all digits 0-9 while the other was trained on (0, 1,4, 6, 7, 8,9) leaving digits 2, 3 and 5. Amongst our evaluations, only certain classes
7

---

Under review as a conference paper at ICLR 2022
from the e-MNIST data shared semantic overlap- - letters "'''"','''''""" ''''''' and "q" share structural similarity with classes O, 1. 2, 4, 5 and 9 respectively. We show results for both encoders with and without the above classes in the OOD evaluations (Table
Clinical EEGs While discussions on semantic issues on clinical EEGs may be out of scope for this paper, we do observe interesting semantic effects in this case well. For instance, seizure types unseen by the network will generate higher uncertainty scores.
Table 3: Pickup Truck & Street Car share high semantic overlap with InD classes Truck & Automobile. Evaluations when naively considering them to be OOD should result in AUROC // AUPR J. Airplane Fish do not show any semantic overlap with InD classes, should simultancously result in AUROC T/ AUPR 1
Predictive Entropy
Vanilla
Test-Time Dropout
TIME-LAPSE.
CIFAR
MSP
KT_UU
ODIN
Mahalanobis
(ours)
Pickup Truck
0.794/ / 0.292
0.791 /0.276
0.698 0.188
0.815 / 70.182
0.691 / 002007
0.942/ / 0.506
0.688 / 0.183 0.757 / 0.256
Street Car
0.767 / 0.255
0.768 / 0,256
0,766/
0.785 / 7.255
0.656 / 00.881
0.838/ 0.337
Airplanc
0.891 / 00.488
0.894 10
0.913 0,5571
0.893 / /0,549
0.658 / /0.192
0.955 / /0,547
0.902 / 0.575
Aquarium Fish
00492
/0.529
0.913
0.888 /0.526
0.209
0.955 0.542
0,911 0.577
Table 4: MNIST models. Oto9 denotes encoder trained on 0-9 digits. M235 indicates encoder trained on digits (0 9] (2.3.5]. i... (0,1.4.6,7.8.99) Semantic means that e-MNIST classes with ambiguous semantic overlap on InD classes, i.c., (l..,,,..) are removed from OOD evaluation
Predictive Entropy
Vanilla Mahtalanobis
Test-Time Dropout
TIME-LAPSE (ours)
MNIST
MSP
KI_UU
ODIN
0lu9
0.895 / 00.968
/0,971
0.903 / 00,972
0.896 /0,999
0,903 / /0,973
0.963 00,973
0.961 7.990 0.986 / 0.995
Oto9 Semantic
0,921 /0.970
0.926 0,973
0.928 / 00.975
0.922/0.00
0.937 00.97
0.976/0.99 0.9900
M235
0.907 00.982
0,910/ 0.983
0.909 /0.983
0.906/ 0,982
0.919 0..95
0,976/0.986
0.975 0.996
M235 Semantic
0.926/ 0.983
0.929/ / 0,984
0.925 / 0,983
0,925 / 0,983
0.941 / 0.986
0.984 0.986
0.990/ 0.998
5.3
DRIFT DETECTION: SEQUENTIAL EVALUATION RESULTS
To evaluate the performance under our sequential framework, we define the detector to have erred if it wrongly concludes an incoming test sample x; to be OOD when it is actually InD vice-versa. If the framework detects the change point within its fixed window size, we do not consider it as an error. We generate data streams of length 10,000 samples changing the distribution every k samples in each trial The distribution changes are simulated by first randomly choosing InD or OOD (Bernoulli random variable with probability p E {0.2, 0.5, 0.7}) and then randomly drawing the k E (50, 100, 200, 500, 1000, 5000) samples from the chosen distribution. We calculate the TIME- LAPSE scores using the two-sided Mann-Whitme level of 0.05 for each sample in the stream and run it through our sequential detector with window sizes W wg 25 for vision experiments and W WB 50 for audio and EEG experiments. We show example plots of datastreams for each domain in the Appendix, Figs. 2 9 We perform a 2-cluster KMeans on the generated Mann- Honn-Whitney scores to assign I and OOD predictions. We then calculate the cumulative error by adding the errors of all samples to calculate detection error. We repeat this experiment N times (N = 1000 here) to estimate the detector's error distribution (EEG distribution given in the Fig. 2 Appendix). Over 73% of the cumulative errors in our EEG task (over 85% for our audio task) lie within 10% and over 93% of the errors in our EEG task (over 97% for our audio task) lic within 20% indicating our detector's 's high performance in comparison to other spatial detectors. For our vision tasks, the error distribution is much tighter and are able to get near 99% detection accuracy for over 95% of the time.
test (Mann & Whitney 1947) significance
6 7 8
5.4 ABLATIONS: EFFECT OF ENCODER CAPACITY
We perform extensive ablations on TIME-LAPSE to study (i) the effect of individual scorers: distance, similarity, spatial, temporal on performance (Appendix (D), (ii) the effect of the coreset size performance (Appendix [)) (iii) the effects of encoder capacity on performance (here, Section 5.4 Appendix F. and (iv) qualitative analyses (Appendix G
8

---

Under review as a conference paper at ICLR 2022
To study the effects of encoder capacity TIME-LAPSE, we consider audio task. We compare two encoders, trained on the same InD data and evaluated with the same OOD data. The lower capacity encoder, Kymatio, is two-layer network with log-scattering layer that extracts scattering coefficients from the inputs as latent space embeddings, followed by a log-softmax layer for clas- sification with 0.75 classification accuracy for InD test samples. The higher capacity encoder is CNN-based M5 model with 0.85 classification accuracy for InD test samples, As shown in Fig. [00 (Appendix F.. Kymatio not able to separate out any of the classes based on TIME-LAPSE scores whereas M5 is able to correctly separate out semantic InD samples from OOD samples well. Thus, the success of TIME-LAPSE is highly dependent on the capacity of the model.
To further investigate the effects of the lower capacity model, we train Kymatio for the same task (i.e., same Inl) semantic classes 0-9) but with the much smaller FSDD dataset. The model reaches 0.97 classification accuracy, showing that it is able to express high-dimensional audio signals well. However, on comparing its TIME-LAPSE scores with those of Kymatio trained on GSC 0-9 (Fig I Appendix F.. we see that the former separates out FSDD InD from GSC InD and GSC OOD, indicating that it is overfitting to dataset statistics whereas the latter is not able to separate out any of them. Thus, TIME-LAPSE scores help in determining both OOD detection capability of an encoder as well as generalization capability over OOD samples.
DISCUSSION
In this work, we develop a unique uncertainty scoring framework that can identify when incoming in- puts fall out-of-distribution with respect to trained encoders and subsequently enable models to abstain from prediction on such inputs. Our theoretical formulation encompasses all representation based OOD detection methods and provides an opportunity to leverage temporal signals in combination. We show that longitudinal information across time can be leveraged for the challenging task of identifying distributional shifts. Through our ablations (Appendix (D), we verify that temporal uncertainty scores and spatial uncertainty scores are complementary and combining them gives additional information than when used separately. We use latent-space embeddings to determine spatial uncertainty and based approach to model temporal uncertainty
proposed a simple sliding-window hypothesis- But "IME-LAPSE can accept any type of spatial scoring and temporal scoring. We believe that there is scope for developing sophisticated methods that leverage the temporal aspect and leave it open for future work.
Furthermore, alongside works by Ahmed & Courville 2020) and Yang et al. (202T), we motivate the necessity of rethinking standard OOD image benchmarks that disregard semantic overlaps. We note that the task of identifying OOD inputs is highly dependent context. For a classifier trained to identify cats and dogs, a tree is OOD whereas all of them would be InD for an object recognition system in self-driving car. We believe that showing generalizability of OOD detection methods across domains is key to ensure robust performance in the wild. It is not sufficient to show better performance over just image OOD benchmarks. We show that diverse domains- vision, audio and healthcare EEG, through our extensive experiments and analyses. We also propose sequential evaluation framework view OOD detection from the lens of dataset drift detection. To enable safe deployment and periodic monitoring of trained models, we believe that such sequence-basee evaluation scheme is essential. We hope this evaluation scheme will be adopted for routinely characterizing uncertainty estimation and model performance in the wild.
generalizes across 3
For our experiments, we train encoders with labelled InD data in a supervised setting. But our framework will support and benefit from more robust representations (Section 5.4 Appendix F) learnt via self superviervisoon or semi- sumi-supervision. We also note that both the audio and seizure analyses generate much higher-dimensional inputs compared to image classification. We hypothesize that model performance is strongly dependent on semantic content for such high-dimensional inputs when compared to dataset statistics and thus, gains from TIME-LAPSE more obvious.
In conclusion, we provide framework that utilizes both latent-space and time to determine predictive uncertainty for deep learning models. Our method is end-to-end trainable and network agnostic: it (a) does not require exposure to outliers (though can easily be extended to accommodate them present), (b) does not require modifications to existing network architectures, and (c) does not require computationally heavy dropout techniques or ensemble passes. It can thus can be easily adopted to high-risk settings such clinical workflows and autonomous driving.

---

Under review as a conference paper at ICLR 2022
ETHICS STATEMENT
We strongly believe that uncertainty quantification and its associated tasks of out-of-distribution detection and dataset need be benchmarked and evaluated on diverse datasets and domains aside from standard, well-curated, image datasets to reduce the effect of bias, variability, "easyness" of the task or domain. To that effect, we have chosen three disparate domains (audio, vision and clinical EEGs) and associated tasks (spoken word classification, image classification, seizure detection posed as binary classification). While this an important and necessary step, we believe our work and the community at large will only henefit from evaluating on more domains, datasets and tasks to ascertain method's s success and failure modes to ensure model deployment. We also hope to work with domain experts to validate TIME-LAPSE's strengths and error modes for more world use cases, All the data used in our work are either publicly available or are used with full IRB approval.
REPRODUCIBILITY STATEMENT
Our source code for TIME-LAPSE as well as our baseline implementations will be released to the public via Github upon publication. The datasets used for our audio and vision tasks are publicly
available: FSDD (Jackson et al. (017). GSC (Warden 2018), x-MNIST (Lecun et al. 1998 Cohen
et al.
2017 Tarin et al. [0018] Xiao et al. 2017). CIFARIO & CIFAR 100 (Krizhevsky & Hinton 2009).
The Temple University Hospital ERG Seizure Corputs (TUH) used in our clinical EEG experiments
publicly available (Shah al. 2018 Obeid & Picone 2016). EEG data from Stanford Healthcare
(SHC) and Lucile Packard Children's 's Hospital (LPCH) contain patient sensitive information and
cannot be shared publicly. Details on the data preprocessing steps and experimental settings are
provided in Appendix
REFERENCES
Faruk Ahmed and Aaron Courville. Detecting semantic anomalies. Proceedings of the AAAI Conference on Artificial Intelligence, pp. 3164-3162, 2020.
Samaneh Aminikhanghahi and Diane Cook. A survey of methods for time series change point detection. Knowledge and information systems, 51(():339 2017.
Dario Amodei, Chris Olah, Jacob Steinhardt, Paul Christiano, John Schulman, and Dan Mané. Concrete problems in ai safety. arXiv preprint arXiv:1606.06565 2016.
Mathieu Andreux, Tomás Angles, Georgios Exarchakis, Roberto Leonarduzzi, Gaspar Rochette, Louis Thiry, John Zarka, Stéphane Mallat, Joakim Andén, Fugene Belilovsky, Joan Bruna, Vin- cent Lostanlen, Matthew J. Hirn, Edouard Oyallon, Sixin Zhang, Carmine Cella, and Michael Eickenberg. Kymatio: Scattering transforms in python. arXiv Preprint 1rXiv:1812.11224 2018.
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. International Conference on Machine Learning (ICML), 2015.
Mariusz Bojarski, Davide Del Testa, Daniel Dworakowski, Bernhard Firner, Beat Flepp, Prasoon Goyal, Lawrence D. Jackel, Mathew Monfort, Urs Muller, Jiakai Zhang, Xin Zhang, Jake Zhao, and Karol Zieba. End to end learning for self-driving cars. arXiv Preprint 1604v.1604.07316 2016.
density-based local outliers. Association for Computing Machinery, 29(2):93-104, 2000. Markus M. Breunig, Hans-Peter Kriegel, Raymond T. Ng. and Jörg Sander. Lof: Identifying
Wenhu Chen, Yilin Shen, Hongxia Jin, and William Wang. A variational dirichlet framework for out-of-distribution detection. arXiv preprint arXiv: 2019.
Hyunsun Choi, Eric Jang, and Alexander A. Alemi. Waic, but why? generative ensembles for robust anomaly detection, 2019.
Gregory Cohen, Saeed Afshar, Jonathan Tapson, and Andre van Schaik. Emnist: an extension of mnist to handwritten letters. arXiv preprint arXiv: 170300333,,, 2017.
10

---

Under review as a conference paper at ICLR 2022
Wei Dai, Chia Dai, Shuhui Qu, Juncheng Li, and Samarjit Das. Very deep convolutional neural networks for raw waveforms. arXiv preprint arXiv:1610.0000 2016.
A.P. Dawid. The well-calibrated bayesian. Journal of the American Statistical Association, 1982.
Lucas Deecke, Rohert Vandermeulen, Lukas Ruff, Stephan Mandt, and Marius Kloft. Image anomaly detection with generative adversarial networks. Machine Learning and Knowledge Discovery in Databases, pp. 3-17, 2019.
M.H. DeGroot and S.E. Fienberg. The comparison and evaluation of forecasters. The statistician, 1983.
Terrance DeVries and Graham W. Taylor. Learning confidence for out-of-distribution detection in neural networks. arXiv Preprint 1rXXiv:8822.48666 2018.
Yilun Du and Igor Mordatch. Implicit generation and modeling with energy based models. Advances in Neural Information Processing Systems (NeurIPS), 2019.
Andre Esteva, Brett Kuprel, Roberto A. Novoa, Justin Ko, Susan M. Swetter, Helen M. Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. Nature, 2017.
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. International Conference Machine Learning (ICMI.), 2016.
João Gama, Indr Zliobait, Albert Bifet, Mykola Pechenizkiy, and Abdelhamid Bouchachia. A survey concept drift adaptation. ACM Computing Surveys, 46(4), 2014.
Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. International Conference on Learning Representations (ICLR), 2015.
Will Grathwohl, Kuan-Chieh Wang,
Jacobsen, David Duvenaud, Mohammad Norouzi, and Kevin Swersky, Your classifier is secretly an energy based model and you should treat it like one. International Conference on Learning Representations (ICLR), 2020.
Alex Graves. Practical variational inference for neural networks. Advances in Neural Information Processing Systems (NeurIPS), 2011.
Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On calibration of modern neural networks. International Conference Machine Learning (ICML), 2017.
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. IEEE Conference on Computer Vision and Pattern Recognition, 2016.
Dan Hendrycks and Kevin Gimpel. baseline for detecting misclassified and out-of-distributin examples in neural networks. International Conference Learning Representations (ICLR), 2017.
Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure. International Conference on Learning Representations (ICLR), 2019a.
Dan Hendrycks, Mantas Mazeika, Saurav Kadavath, and Dawn Song. Using self-supervised learning can improve model robustness and uncertainty. Advances in Neural Information Processing Systems (NeurIPS), 2019b.
Geoffrey Hinton.
Deep learning: A technology with the potential to transform health care. JAMA, 2018.
Zohar Jackson, César Souza, Jason Flaks, Yuxin Pan, Hereman Nicolas, and Adhish Thite. Free spoken digits dataset.
2017.
William P. Jones and George W. Furnas. Pictures of relevance: A geometric analysis of similarity measures. Journal of the American Society for Information Science, 1987.
Rudolph Emil Kalman. A new approach to linear filtering and prediction problems. Transactions of the JournJournal of Basic Engineering, 1960.
11

---

Under review as a conference paper at ICLR 2022
Daniel Kifer, Shai Ben-David, and Johannes Gehrke. Detecting change in data streams. International Conference on Very Large Data Bases (VLDB). 2004.
Benjamin Kompa, Jasper Snoek, and Andrew L. Beam. Second opinion needed: Communicating
uncertainty in medical machine learning. npj Digital Medicine, 2021.
Vladik Kreinovich and Olga Kosheleva. Deep learning (partly) demystified. International Conference on Intelligent Systems, Metaheuristics and Swarm Intelligence, 2020.
Alex Krizhevsky and Geoffre Hinton. Learning multiple layers of features from tiny images. Tech Report, 2009.
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep con- volutional neural networks. Advances in Neural Information Processing Systems (NeurIPS), 2012.
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in Neural Information Processing Systems (NeurIPS), 2017.
Yann Lecun, Leon Bottou, Yoshua Bengio, and Parick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998.
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distributtin samples and adversarial attacks. Advances in Neural Information Processing Systems (NeurIPS), 2018.
Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. International Conference on Learning Representations (ICLR), 2018.
Fei Tony Liu, Kai Ming Ting, and Zhi-Hua Zhou, Isolation forest. International Conference on Data Mining (ICDM), 2008
Weitang Liu, Xiaoyun Wang, John D. Owens, and Yixuan Li. Energy-based out-of-distribution detection. Advances in Neural Information Processing Systems (NeurIPS). 2020.
J. MacQueen. Some methods for classification and analysis of multivariate observations. Proceedings of the Fifth Berkeley Symposium Mathematics, Slatistics and Probability, 1967.
Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. Advances in Neural Information Processing Systems (NeurIPS), 2018.
H.B. Mann and D.R. Whitney. On a test of whether one of two random variables is stochastically larger than the other. The Annals of Mathematical Statistics, 1947.
Leland McInnes. John Healy, and James Melville. Umap: Uniform manifold approximation and projection for dimension reduction. arXiv preprint 180.:020. 2018.
Sina Mohseni, Mandar Pitale, JBS Yadawa, and Zhangyang Wang. Self-supervised learning for generalizable distri-iittiitttion detection. Proceedings of the AAAI Conference on Artificial Intelligence, 2020.
Jose G. Moreno- Torres, Troy Raeder, Rocío Alaiz-Rodriguez. Nitesh V. Chawla, and Francisco Herrera. A unifying view on dataset shift classification. Pattern Recognition, 45(1):521-530, 2012.
Eric Nalisnick, Akihiro Matsukawa, Yee Whye Teh, Dilan Gorur, and Balaji Lakshminarayanan. Do deep generative models know what they don't know? International Conference on Learning Representations (ICLR), 2019.
Radford M. Neal. Bayesian learning for neural networks. Springer-Verlag, 1996.
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Ng. Reading digits in natural images with unsupervised feature learning. NeurIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
12

---

Under review as a conference paper at ICLR 2022
Anh Mai Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. IEEE Conference on Computer Vision and Pattern Recognition, 2015.
Iyad Obeid and Joseph Picone. The temple university hospital eeg data corpus. Frontiers in neuroscience, 2016.
Pramuditha Perera, Ramesh Nallapati, and Bing Xiang. Ocgan: One-class novelty detection using gans with constrained latent representations. IEEE Conference on Computer Vision and Pattern Recognition, 2019.
Stanislav Pidhorskyi, Ranya Almohsen, Donald A Adjeroh, and Gianfranco Doretto. Generative probabilistic novelty detection with adversarial autoencoders, Advances in Neural Information Processing Systems (NeurIPS), 2018.
Stephan Rabanser, Stephan Günnemann, and Zachary C. Lipton. Failing loudly: An empirical study of methods for detecting dataset shift. Advances Neural Information Processing Systems (NeurIPS), 2019.
Aaditya Ramdas, Sashank J. Reddi, Barnabás Póczos, Aarti Singh, and Larry Wasserman. On the decreasing power of kernel and distance based nonparametric hypothesis tests in high dimensions. Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence (AAAI), 2015.
Jie Ren, Peter J. Liu, Emily Fertig, Jasper Snoek, Ryan Poplin, Mark Depristo, Joshua Dillon, and Balaji Lakshminarayanan. Likelihood ratios for diittriiiittittti detection. Advances in Neural Information Processing Systems (NeurIPS), 2019.
Lukas Ruff, Robert A. Vandermeulen, Nico Görnitz, Alexander Binder, Emmanuel Müller, Klaus- Robert Müller, and Marius Kloft. Deep semi-supervised anomaly detection. International Confer- ence on Learning Representations (ICLR), 2020.
Khaled Saab, Jared Dunnmon, Christopher Ré, Daniel Rubin, and Christopher Lee-Messer. Weak supervision as an efficient approach for automated seizure detection in electroenceepaalograayy npj Digital Medicine, 2020.
Thomas Schlegl, Philipp Seeböck, Sebastian M. Waldstein, Ursula Schmidt-Erfurie and Georg Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. Information Processing in Medical Imaging, pp. 146-157,2 2017.
Bernhard Schölkopf, Robert Williamson. Alex Smola, John Shawe- Taylor and John Platt. Sup- port vector method for novelty detection. Advances in Neural Information Processing Systems (NeurIPS), 1999.
Vikash Sehwag, Mung Chiang, and Prateck Mittal. Ssd: A unified framework for self-supervised outlier detection. International Conference on Learning Representations (ICLR), 2021.
Joan Serrà, David Álvarez, Vicenç Gómez, Olga Slizovskaia, José F. Núñez, and Jordi Luque. Input complexity and out-of-distribution detection with likelihood-baas generative models. International Conference Learning Representations (ICLR), 2020.
Vinit Shah, Eva von Weltin, Silvia Lopez, James Riley McHugh, Lillian Veloso, Meysam Golmo- hammadi, Iyad Obeid, and Joseph Picone. The temple university hospital seizure detection corpus. Frontiers neuroinformatiis, 2018.
Gabi Shalev, Yossi Adi, and Joseph Keshet. Out-of-distribution detection using multiple semantic label representations. Advances in Neural Information Processing Systems (NeurIPS), 2018.
Jihoon Tack, Sangwoo Mo. Jongheon Jeong, and Jinwoo Shin. Csi: Novelty detection via contrastive learning on distributionally shifted instances. Advances in Neural Information Processing Systems (NeurIPS), 2020.
Clanuwat Tarin, Mikel Bober-Irizar, Asanobu Kitamoto, Alex Lamb, Kazuaki Yamamoto, and David Ha. Deep learning for classical japanese literature. arXiv preprint 18Xiv:1812.001 2018.
13

---

Under review as a conference paper at ICLR 2022
Aäron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alexander Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model 2016.
for raw audio. arXiv Preprint
Rudolph van der Merwe, Armaud Doucet, Nando de Freitas, and Eric Wan. The unscented particle filter. Advances in Neural Information Processing Systems (NeurIPS, 2001.
Pete Warden. Speech commands: A dataset for limited-vocabulary speech recognition. h 884.03209.pp4 2018.
Max Welling and Yee Whye Tch. Bayesian learning via stochastic gradient langevin dynamics. International Conference Machine Learning (ICML), 2011.
Jim Winkens, Rudy Bunel, Abhijit Guha Roy, Robert Stanforth, Vivek Natarajan, Joseph R. Ledsam, Patricia MacWilliams, Pushmeet Kohli, Alan Karthikesalingam. Simon Kohl, Taylan Cemgil, S. M. Ali Eslami, and Olaf Ronneberger. Contrastive training for improved out-of-distribution detection. arXiv Preprint arXiv:2007.05566 2020.
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: novel image dataset for benchmarking machine learning algorithms. arXiv preprint urXiv: 2017.
Zhisheng Xiao, Qing Yan, and Yali Amit. Likelihood regret: An -ii--ii-iitiittiion detection score for variational nuto-encoder. Advances in Neural Information Processing Systems (NeurIPS), 2020.
Min Xu, Ling-Yu Yu Duan, Jianfei Cai, Liang-Tien Chia, Changsheng Xu, and Qi Tian. Hmm-based audio keyword generation. Advances in Multimedia Information Processing, 2005.
Adam Yala, Constance Lehman, Tal Schuster, Tally Portnoi, and Regina Barzilay. A deep learning mammography- model for improved breast cancer risk prediction. Radiology, 2019.
Jingkang Yang, Haoqi Wang, Litong Feng, Xiaopeng Yan, Huabin Zheng, Wayne Zhang, and Ziwei Liu. Semantically coherent -itt----ittiitttoon detection. International Conference on Computer Vision (ICCV), 2021.
Bo Zong, Qi Song, Martin Renqiang Min, Wei Cheng, Cristian Lumezanu, Dacki Cho, and Haifeng Chen. Deep autoencoding gaussian mixture model for unsupervised anomaly detection. Interna- tional Conference on Learning Representations (ICLR), 2018.
14

---

Under review as a conference paper at ICLR 2022
APPENDIX
A SUPPLEMENTARY TABLES
Table OOD performance: speech classification (audio domain) and seizure detection (clinical EEGs) task. Mean and standard deviations over five random runs. Best scores indicated in bold.
Audio
Clinical FEGs
AUROC 1
AUPR
FPRS0
ALROCT
AUPR
MSP
0.626 0.006
0.527 +: 0,005
0,515 + 0.006
0.358 + 0.008
0.421 + 0.002
0.754 = 0.022
Predictive Entropy
0.615 0.006
0.515 0.005
0.515 0.009
0.393 + 0.006
0,495 0.012
0.742 0.018
KL_UU
0.553 = 0.005
0.475 + 0.002
0.579 = 0.007
0.390 + 0.003
0.472 + 0.005
0.719 = 0.010
ODIN
+:
0.712
0.790 0.035
Vanilla Mahalanobis
0.680 0.014
0.636 1: 0.009
0.520 + 0.017
0.633 1 0.028
0.651 1: 0,011
0.525 - 0.025
Test-Time Dropout
0.649 0.003
0.619 + 0.007
0,523 - 0.003
0.647
+ 0.004
0.002
0.583 0.012
TIME-LAPSE (ours)
0.739 0,006
0.704 = 0.008
0,439 = 0,005
0.771
0,009
0,701 + 0.004
0.335 0.039
Table 6: OOD performance: CIFARIO image classification on SVHN (no semantic overlap) vs CIFARIO0. Mean and standard deviations over five random runs. Best scores indicated in bold.
SVHN
CIFARI00
AUROC f
AUPR f
FPR30
AUROC
AUPR f
FPR80 J
MSP
0,760 1: 0.047
0.770 +: 0.021
0.358 4: 0.045
0.852
0.014
0 1: 0.001
0.231 1: 0.018
Predictive Entropy
0.761 + 0.047
0.752 + 0.063
0.357 0.045
0.854
0.014
0.986 0.001
0.230
0.017
KL_U
0.775 + 0.052
0.786 + 0.029
0.347 = 0.060
0,860 + 0.015
0,987 + 0.001
0.223
= 0.023
ODIN
0.748 + 0.068
0.776 +: 0.031
0.095
Vanilla Mahalanobis
0.738 + 0.039
0.782 + 0.029
0.477 = 0.075
0.679 = 0.012
0,967 0.001
0.558
0.025
Test- Time Dropout
0.716 + 0.057
0.725
+ 0.042
0.494
- 0.069
0.925 0.004
0.986 0.000
0.049
0.003
TIME LAPSE (ours)
0.814 J. 0.019
0.827 1 0.024
0.311 0.034
0.866 0.008
0,988 0.001
0.239
0.028
Table OOD performance: Image classification on a-MNIST. Mean and standard deviations over five random runs. Best scores indicated in bold.
>-MNIST
AUROC f
AUPR t
FPR80
MSP
0,899 + 0.006
0.979 + 0.002
0.148 = 0.012
Predictive Entropy
0.011
KL_
0.899 1 0.007
0.980 1. 0.002
0.164 1 0.012
ODIN
0.006
+ 0.002
0.148 - 0.015
Vanilla Mahalanobis
0.918 0.006
0.984 + 0.001
0.118 = 0.015
Test-Time Dropout
0.976 1: 0.002
0.986 1: 0.001
0.016
: 0.001
TIME-LAPSE (ours)
0.972 0.002
0.995 + 0.000
0.037 0.038
B DETAILED EXPERIMENTAL SETUP
B. DATASETS
Audio For the task of spoken word classification of audio recordings, use the Free Spoken Digits Dataset (FSDD) (Jackson et al. 2017), consisting of ,wav recordings of English digits 0-9, and the Google Speech Commands (GSC) dataset (Warden 2018) that contain
recordings of 35 English keywords including the digits 0-9 and non-digits such as "Yes", "No", "Stop", etc. The two datasets provide unique setup where digits 0-9 occur in different datasets but belong the same semantic classes.
nigh-dimensional EEG data from different institutions and age groups: (a) Stanford Healthcare (SHC) with patients the age group ~20060 years, (b) Lucile Packard Children's Hospital (LPCH) with patients under 18 years and (c) publicly
EEG Signals For seizure analyses tasks,
15

---

Under review as a conference paper at ICLR 2022
available Temple University Hospital seizure corpus (TUH) (Shah et al. 2018 Obeid & Picone 2016). 12 second or 60 second EEG clips with 19 channels, each sampled at 200Hz, are used for seizure detection.
Vision We use CIFAR-10 (InD), CIFAR- 100 (Krizhevsky & Hinton 2009) and SVHN Netzer et al.
2011) datasets along with MNIST (Lecun et al.) 1998) (InD), FashionMNIST (Xiao al. (017). e.MNSTT (Cohen et al. 2017) and kMNIST (Tarin et al. 2018) (collectively referred to as x- 2-MNIST)
datasets for image classification is typically reported in literature (Hendrycks & Gimpel 2017
Lee el al. 2018 Ren el al. 2019).
B.2 BASELINES
We use the following baselines to compare against our framework. We don't compare with methods that require exposure to outliers to match our framework settings.
MSP:
Hendrycks Gimpel 2017) use the maximum softmax probability (MSP) p(i)z> max; ply k|z) as the uncertainty score. OOD inputs tend to have lower MSP than InD data.
Predictive Entropy Ren et al. (219) show that using high entropy of the predicted class distribution E. = k/z) P(y = k Ø)) as an indicator for OOD inputs is strong baseline.
KL-divergence with Uniform distribution: Hendryeks et al. (2119a) use the KL divergence of the softmax predictions to the uniform distribution U, KL pP( x:) to identify OOD inputs.
ODIN: Liang et al. (2018) use cuaperature-scaling and input perturbations to increase the gap between OOD and InD data using MSP. We fix T = 1000, 1.4e 33 following their most common setting instead of tuning the parameters with outlier exposure.
Vanilla Mahalanobis: Lee et al. (2018) use the Mahalanobis distance from the nearest class- conditional Gaussian with shared covariance as the uncertainty score. This approach directly fits in with our spatial scoring method (Section 3.2.T) though we use class-wise wise covariance matrices.
Test-time Dropout: Gal & Ghahramani (2016) show that Monte Carlo (test-time) dropout to estimate the prediction distribution give good uncertainty estimates. Note that it is computationally intensive requiring & forward passes of the classifier, with k-fold increase in runtime. We use 10.
B.3 MODEL TRAINING & HYPERPARAMETHER
Image Encoders & Pre-processing We carry out our vision experiments using CNN-based classi- fiers, i.c. the LeNet architecture (Lecun et al. 1998) when working with 2-MNIST data and the ResNet18 architecture (He et al. 2016) when working with
CARR10//0///HH data. With the a-MNIST data, we normalize the ipput using the mean and standard deviation calculated from the training set for both training and inference, is standard. With the CIFAR 10/100/SVHH data, apply the normalization transform along with augmentation strategies (random crop and horizontal flips) during training and only normalization during inference.
Audio Encoders & Pre-processing For our audio experiments, we use the M5 classifier (Dai et al. 2016) as our encoder. We also train a simple two-layer network- a static, normalized, log-scattering layer that extracts scattering coefficients from audio signals (Andreux et al. (018) followed by log-softmax layer that generates output probabilities Both models are trained only on classes 0-9 from the GSC dataset with the rest of the classes as OOD inputs. In cases, we learn embeddings directly from raw, one second audio clips (resampled to 8kHz) without making use of any spectrogram features like MFCC (Xu et al. 2005).
compare encoder capabilities (Section 5.4).
EEG Encoders & Pre-processing For our seizure detection task, we use the Dense-Inception Inception based models (Saab et al.) 2020) as encoders. We use the same data pre- reeprocesssig strategy as given by Saab et al. (2020). , The models are trained on 19 channel, 12 second or 60 second raw EEG clips from InD datasets, resampled to 200Hz.
Additional Details We train all encoders on InD training data using standard weight initializations, SGD/Adam optimizer and ReLU non-linearities. We train and tune hyperparameters for encoders using only InD data samples. We don't I expose any outlier data to our encoders. We extract activations from fully connected (FC) hidden layer before the logits layer to form latent space representations.
16

---

Under review as a conference paper at ICLR 2022
We normalize distance scores and similarity scores before forming the spatial scores in cases where one of them is tightly bound while the other is not. For our temporal uncertainty scoring, we set window sizes WA, Wp 25 for vision tasks and wA, Wy 50 for audio and EEG tasks based on hyper-parameter tuning. We choose the reference window by sampling randomly from the training set (or coreset) and using its spatial scores in any order. We randomly shuffle the evaluation set and send in data points sequentially. We first obtain the spatial uncertainty scores for the evaluation set forming ID evaluation sequence, on which form the sliding window sequentially. We choose the non-parann non-parmeerrc,, two-sided Mann-Whitney Whitney test (Mann & Whitney 1947) ) at significance level of 0.05 as our measure F. We perform two-centered KMeans clustering (MacQueen) 1967) on the temporal score sequence to identify uncertain model predictions and reject corresponding test samples as OOD.
C SEQUENTIAL EVALUATION: VISUALIZATIONS
Some examples of data streams generated from sampling EEG, audio and vision datasets are shown below (Figs. the uncertainty scores (Mann Whitney Scores are the same as TIME-LAPSE temporal scores). Using two cluster K.Maans algorithm, change points are detected and individual samples accepted or rejected as InD.
5 6
and 9). The The X axis indicates the time sequence. The Y axis gives
Error Distribution, Number of 1000
VM
Dataset (ground truth)
$2.2%
1r.% 330 0% U0 os 160 100 0s
Mann- Woin-Whinneyy Test Score
Mann-Whitney Scores OOD Predictions
80
0.8
Frequency
60
Stan-InD
40
20
0.2
TUH-
3.%
10%
02%
62%
62%
00%
0.%
0.0
9-10
10-20
20-36
40
40-50
50.60
62-20
30
190000
90
25
50
100
125
150
175
Time
Bins
Figure 2: (left) Snapshot of the TIME-LAPSE temporal Within window of 15 samples, is able detect the change point for the seizure detection task. (right) % Error distribution over 1000 trials.
D ABLATIONS: IMPORTANCE OF INDIVIDUAL SCORES IN TIME-LAPSE
We study the effect of individual scores (distance spatial score vs similarity spatial score, spatial scores vs temporal scores, just using temporal scores) in this section. We also compare the effect of having shared covariance assumption in the Mahalanobis distance score (baseline Vanilla Mahalanobis) as opposed to using the separate covariance assumption that we use in our Mahalanobis distance score. From T
we see that:
Shared vs Separate covariances: We see that using the shared covariance assumption is more restrictive and does not fit various types of data. From Table all tasks and domains in comparison to the more relaxed separate covariance assumption we make for our Mahanalobis distance formulation (Section 3.2.I).
that performs worse across
Only distance scores: It is easy to see how the distance only scores perform in comparison to TIME-LAPSE. They follow the same trend as TIME-LAPSE regarding semantic overlap, i.e., they sensitive to semantic overlap than dataset statistics. But their performance is not high enough to be competitive.
Only similarity scores: We see that similarity scores are more tuned to direct similarity, whether they dataset-based or semantic- based. TIME-LAPSE allows us get the benefits of both our distance scores and similarity scores with a competitive boost in performance across semantic tasks.
17

---

Under review as a conference paper at ICLR 2022
Spatial vs using the added advantage provided by temporal scoring through Figs. B 4 S We see from the plots that the margin between uncertainty scores of InD and OOD data is low for any of the baselines and the purely spatial TIME-LAPSE scores. Addition of the temporal scores greatly increases the separability between them leading to increase in performance not only as measured by net AUROC but also increased interpretability.
We provide a qualitative ablation of using just spatial scores versus
Only temporal (directly on embeddings): Conceptually, it is possible to use our temporal scoring approach directly on the (non-scalar) latent-space embeddings. skipping the spatial scoring step entirely. However, we have evidence from literature (Ramdas et al. 2015) to show that that hypothesis based tests such as our temporal approach do not scale well to the multivariate case. Hence, we do not consider it viable option.
Table 8: Ablations showing the importance of individual scores on TIME-LAPSE. Semantic, Dataset, All refer to modes of evaluation. Semantic (audio) involves considering spoken digits from different datasets to be InD. Dataset (audio) involves considering spoken digitis from different datasets be OOD. Semantic (MNIST) involves removal of e-MNIST classes that share ambiguous semantic overlap (o.li.zy...q) with digits 0-9. All
(MNIST) involves considering them as OOD along with other classes.
Audio
CIFAR
MNIST
Semaniie
Dalasel
SVHN
CIFARIOU
Semantic
All
Only distance (shared covariance)
0.658
0,480
0.962
0.694
0.951
0.919
Only distance (ours) (separate covariance) Only similarity (ours)
0.728
0.502
0.980
0.832
0.962
0.948
0.658
0.817
0.984
0.880
0.989
0,970
TIME-LAPSE (ours)
0.506
0.875
E ABLATIONS: CORESET SIZE
TIME-LAPSE's spatial score uses the cosine similarity metric to compare the similarity of test sample's 's latent-space embeddings to those of the training data pairwise. Potentially, this could be computationally intensive process, especially for large dataset sizes. We reduce the computation costs, memory overhead and latency by using a subset of training data (coreset) instead of the full training set. The coreset is extracted by randomly sampling a fraction from every class in the training data. We show that in case of large dataset, small coreset will be sufficient to achieve a similar performance for downstream tasks. We can see from Table P that just 2% to 10% of the training dataset is sufficient to achieve a similar performance as using the full training dataset. In fact, for our clinical EEG dataset, we use just 2% of the training samples for all spatial score calculations and reach the state-of-the-art. This encouraging result also paves the way for choosing different sampling strategies that can ensure more "representational" samples (based on domain knowledge) from the training set are included in the coreset as part of future work. We note that similar trends with coresets are observed by Tack et al. (2020) though they use a different strategy to select their coreset.
Table 9; Coreset Ablations. AUROC for OOD detection for various coreset sizes (% of training samples). Even 2% and 10% of training data give good results.
Coresct (%)
Audio
CIFAR
EBG MNIST
1%
0.7360
0.8543
2%
0.7385
0.8581
0.9702
0.771
10%
0.7390
0.8620
0.9710
100%
0.7399
0,8663
0.9721
F ABLATIONS: EFFECT OF ENCODER CAPACITY (SUPPLEMENTARY FIGURES)
We visualize the distributions of TIME-LAPSE spatial scores generated by two encoder architectures (Kymatio and M5) with varying modelling capacity. We see from Fig. 10 that more modelling capacity an encoder has, the better it is able separate InD and OOD samples in its latent space. Note that in Fig. I0, the left plot shows the distribution of scores for InD samples from different datasets in blue and orange and that of all the OOD samples together in green. In the right plot,
18

---

Under review as a conference paper at ICLR 2022
however, blue indicate the merged InD samples from both datasets while orange represents class wise distributions across OOD samples.
In Fig. keep the architecture of the encoder fixed, i... Kymatio, and vary how well it is trained. We use two encoders of the same architecture, train one on GSC 0-9 classes and another on FSDD 0-9 classes. Both the encoders are thus trained the same InD classes but different datasets. The model trained on FSDD is able to reach high accuracy on the FSDD test sets whereas the one trained on GSC cannot. From the plots, we see that the model trained on FSDD actually overfits the data since it is able to distinguish between InD classes from different datasets (Fig. I1 right).
G QUALITATIVE ANALYSES
We plot the UMAP Mclnnes et al. 2018) embeddings of our raw InD data and their extracted latent space representations from the trained encoders along with those of OOD data. Fig. [2 shows the plots for our audio GSC dataset. We see that the raw data are too high- nigh-dimensional to be captured according their class labels by UMAP. On the other hand, the extracted representations arrange themselves in well-separable clusters showing the representational capacity of the trained encoder. Most distance- based OOD detectors assume OOD representations will get mapped far away from the InD representations in the latent-space. This is good assumption and holds in many cases. Indeed, the spatial scorer in TIME-LAPSE uses this hypothesis (along with others) to derive its predictive uncertainty score. However, OOD inputs representational space under most distance metrics. Fig. 12 (right) shows the overlay of OOD inputs in the latent-space. Although it is just 2D projection and the extracted representations have higher dimensions, this figure still shows that OOD inputs can get mapped near to InD inputs. In that case, purely distance-based spatial scores lose their power TIME-LAPSE looks at multiple hypotheses to determine if samples are OOD, We find that the combination of our similarity score and distance score outperform each score individually. Moreover, since TIME-LAPSE has temporal component to it, the temporal scorer acts as an additional constraint to ensure OOD inputs are separable. Thus, within a few samples, TIME-LAPSE can indicate when samples are going out-of of-iistibbution with much better accuracy.
get mapped very close InD inputs in the
19

---

Under review as a conference paper at ICLR 2022
MSP
10
0.
PredEntropy
20
1.
M
0.0
225
202
KL U
420
200
Mhe Male (0 M01 10 /
100
100
200
CDN
3.4
0.4
0.
375
Ma nal
-300
-100
4400
X00 Drapout
325
1.0
3.6
/// 10 / P/V-
0.4
0.0
TIME LAPSE (spatial)
0.50
M
-0.00
-0.04
0.00
32
25
100
375
492
TIME LAPSE (temporal)
1100
1000
050
100
600
Figure 3: Uncertainty scores (audio). TIME-LAPSE (temporal) shows the most separability between InD (blue low segment) and OOD (blue high segment)
20

---

Under review as a conference paper at ICLR 2022
MSP
1.0
0.7
0.
PredEntropy
1.0
0.0
0.1
0.
KL U
200
1/
100001000 M MM
93
125
OPN
1.00
0.05
0.5
135
v.Mahal
-33
M/w M
300
-200
155
350
Dropout
mm
0.2
TIME LAPSE (spatial)
0.9
1/
0.0
125
130
200
TIME LAPSE Itemparal)
432
200
190
100
Figure 4: Uncertainty scores (CIFARI0). TIME-LAPSE (temporal) shows the most separability between InD (blue low segment) and OOD (blue high segment)
21

---

Under review as a conference paper at ICLR 2022
MSP
1.0
04
1/x
PredEntropy
1.75
1.50
1:25
6.79
0.50
6.29
0.00
50
KL U
25
M Lon 1000
250
M
M
MM
M
0.2
135
130
v.Mahal
-100
M4
1 1
WV
130
125
350
250
Dropout
1.2
0.3
MM in my
012
TIME LAPSE (spatial)
1.0
and wit A MM M/Mooo Ww M/ MMy byy
0.
0.7
109 TIME LAPSE ttemporal)
125
350
200
103
Figure 5: Uncertainty scores (MNIST). TIMF-LAPSE (temporal) shows the most separability between InD
(blue low segment) and OOD (blue high segment)
22

---

Under review as a conference paper at ICLR 2022
Mann WhinnWWitney Tests Audio Tasks
Mann-Whiiteey Scores
200
1000
2000
3000
4000
5000
Sequence
Figure 6: Sequential Evaluation: Data stream with distribution shifts occurring every 500 steps. The orange lines indicate true change points. Blue plot represents the Mann- Mann-Whitney scores generated from the spatial scores of audio clips.
Mann Whitney Tests on Audio Tasks
1200
(Mati Whitney Scotes
1.000
800
600
Sequence
Figure 7: Sequential Evaluation: Data stream with distribution shifts occurring every 100 steps. The orange lines indicate true change points. Blue plot represents the Mann- Mann-Whitney Whitney scores generated from the spatial scores of audio clips.
Mann-Whitney Tests on Vision (CIFAR10) Tasks
Menn-WWitreey Scores
200
130
100
50
mmm
M Aw
\van M
1000
2000
5000
4000
5003
Sequence
Figure 8: Sequential Evaluation: Data stream with distribution shifts occurring every 500 steps. The orange lines indicate change points. Blue plot represents the Mann- Mann-Whitney Whiteyy scores generated from the spatial scores CIFAR OOD images.
23

---

Under review as a conference paper at ICLR 2022
Mann Whitney Tests on Vision (MNIST) Tasks
Mann-thittee' Scores
230
200
50
Mvrll Wu
Av
Lux
Sequence
Figure 9: Sequential Evaluation: Data stream with distribution shifts occurring every 500 steps. The orange lines indicate true change points. Blue plot represents the Mann- Mann-WWitneyy scores generated from the spatial scores of MNIST + OOD images.
clsss
Distribution TIME-LAPSE scores across semantic InD (GSC 0-9, FSDD 0-9) OOD classes with (left) Kymatio encoder, (right) M5 encoder, class-wise OOD scores are shown. GSC 0-9 and FSDD 0-9 are merged here and only part of the full list of OOD classes shown. All GSC OOD classes are merged together as green in the left figure.
Figure 10:
sox eloo Kiscores labl)
Box Hot Micores taba)
dlsss
Figure 11: Distribution of TITIE--LPPEE LAPSE scores with trained Kymatio encoder. (left) Kymatio encoder trained with GSC 0-9 data, achieving 0.75 classification accuracy. The InD scores from the two datasets (blue and orange) indistinguishable (right) Kymatio encoder trained with FSDD 0-- data, achieving 0.97 classification accuracy. The InD between the datasets are separable, showing that has overfit the dataset statistics.
24

---

Under review as a conference paper at ICLR 2022
Figure 12: UMAP embeddings of GSC data (left) raw InD data (middle) representations from trained encoder, ie. a 2D projection of the latent space (c) OOD samples added to the mix (only few classes are shown for visualization purposes).
UMAP proector OICEAA MNS Sear
UAAA SODRCIO CETAA M. MIC sctvrtar Strasen Cos 000
CURTION
Figure 13: UMAP embeddings of CIFAR data (left) raw InD data (middle) representations from the trained encoder, ie. a 2D projection of the latent space (c) OOD samples added to the mix (only few classes are shown for visualization purposes).
Figure 14: UMAP embeddings of MNIST data (left) raw InD data (middle) representations from the trained
encoder, ie. a 2D projection of the latent space (c) OOD samples added to the mix (only few classes are shown for visualization purposes).
25

---

Under review as a conference paper at ICLR 2022
LPCH 60s Training Data (with valid rand aug): Coloring based on Ground Truth (Sz or Not)
seizure
non-selzure
Figure 15: UMAP embeddings of EEG data (left) raw data (middle) representations from trained encoder, ie. a 2D projection of the latent space (c) OOD samples added to the mix (only few classes are shown for visualization purposes).
Boxen Plot: MScores (abs)
Box Plot: MScores (abs)
10a
10a
107
107
105
10a
MbsMscoees
105
dataset
10a
dataset
LPCH-OOD
LPCH-OOD
104
Stan-InD
10
Stan-InD
TUH-0OD
TUH-0OD
10a
10a
102
101
1
class
class
Figure 16: TIME-LAPSE distribution EEG data
26

---

Under review as a conference paper at ICLR 2022
Figure 17: TIME-LAPSE score distribution on GSC
Figure 18: Test-time Dropout score distribution GSC
27


Reviews:
[{"review_id": "euUy3dewilK", "reviewer": "Reviewer_qgxp", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "The strengths of this paper are:\n+ It addresses a highly relevant and important problem, OOD.\n+ It provides thorough experiments with baseline comparisons.\n+ It is well organized and easy to read.\n\nUnfortunately, the paper suffers from a number of major weaknesses:\n- Firstly, the title and beginning of intro is misleading - the paper does not address uncertainty quantification or calibration, it just provides a method for OOD. Please narrow down the scope of the first intro paragraphs, and select a more focused title.\n- Secondly, the terminology \"spatial\" and \"temporal\" is not correctly used. The spatial dimension would refer to dimensions within a data-point in time, such as the vertical and horizontal dimension in a video frame. You could instead talk about time-independent and time-dependent distance measure.\n- Third, your temporal uncertainty bears large resemblance to filtering and temporal smoothness methods - Kalman and particle filters pre-deep learning, and deep learning methods such as LSTM and CNN over time. The similarity to these methods should be discussed. Moreover, you should refer to some work from the by now large literature on uncertainty estimation and calibration of classification models.\n- Last, although rigorous, the experimental results lack standard deviations. Without this information, it is not possible the significance of the results presented in tables 1-3. \n\nGiven this, I recommend to not accept this paper, as it is not yet in a state to be published in ICLR. However, given the encouraging results and the importance of the problem, I encourage the authors to address the weaknesses above, revise the paper, and submit it to a later venue.\n\nEDIT AFTER REBUTTAL: The authors have addressed my comments to a large extent, and the paper now looks much nicer - although, I am still not convinced about the technical novelty compared to the vast literature on filtering, outlier detection, uncertainty estimation and calibration. Hence, I raise my grade to 5.", "summary_of_the_paper": "This paper presents a method for out-of-distribution (OOD) detection taking temporal consistency into account - both the position of a new data-point in the latent space in relation to the other observed data, as well as the relation to temporally close (recently observed) data are taken into account. Experiments are performed on both audio, video and EEG data, and comparisons are made against six baselines.", "summary_of_the_review": "The strengths of this paper are that is addresses an important problem, it provides thorough experiments and it is well organized and easy to read.\n\nUnfortunately, the paper suffers from a number of major weaknesses, in that the title and intro paragraphs are misleading, there are issues with terminology and there are missing references to the literature on filtering and uncertainty estimation. Moreover, the results do not show if the differences to baselines are significant.\n\nGiven this, I recommend to not accept this paper, but I encourage the authors to address the weaknesses and resubmit to a later venue.\n\nEDIT AFTER REBUTTAL: The authors have addressed my comments to a large extent, and the paper now looks much nicer - although, I am still not convinced about the technical novelty compared to the vast literature on filtering, outlier detection, uncertainty estimation and calibration. Hence, I raise my grade to 5.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "1: The main claims of the paper are incorrect or not at all supported by theory or empirical results.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "R4lvm7Xr0y", "reviewer": "Reviewer_o7sa", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 4, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "The paper achieves state-of-the-art results on diverse established datasets and performance metrics. More importantly, the suggested framework appears to be more semantics-preserving than existing scores that rely on data-statistics. \nHowever, I feel that some hypothesis are not very well corroborated (experimentally and/or theoretically) while some details are missing. \nIn particular,\n\n(1) could the authors please provide more details on the embeddings used? Are they deterministic or stochastic? If they are deterministic, how are they formed exactly ( it is the concatenation of the output of the hidden layers of the networks?)\n\n(2) the hypothesis stated in 3.2.1 (that in the latent space ood samples will lie in distance from  iid samples), especially for high-dimensional inputs. may not always hold. A visualization on cifar10 data will better support this claim. Do the authors think that modifying the objective function to explicitly support this claim could further improve performance? In particular, I am pointing the authors to the following work (for stochastic features), that may want to consider for further improving the performance:\n\n[1] Sinha S, Dieng AB. Consistency Regularization for Variational Auto-Encoders. arXiv preprint arXiv:2105.14859. 2021 May 31.\n\n(3) Moreover, what if the embeddings of iid form clusters (also appart from each other)? How many training samples would be needed in this case to sufficiently populate the coreset??  The computation of the similarity score also seems prohibitive for large-scale datasets that may need large coreset. I think it would be good if the authors could report an ablation study on the size of the coreset. \n\n(4) I also think the authors should extent the ablation such that they report results i) based on the spatial scores only (only distance, only similarity, both) and/or ii) the temporal score (computed directly on the embedding h) to better demonstrate the importance of each score used \n\n(5) results on large-scale datasets (imagenet) could strengthen the impact of the paper.", "summary_of_the_paper": "The paper proposes a spatio-temporal approach for unsupervised out-of-distribution detection. In particular, it suggests a 'hierarchical' evaluation method based on computation of existing distance/similarity scores on hidden embeddings of high-dimensional data succeeded by a temporal component, that is also based on existing work, that treats chunks of  scores, computed by the first step, of input data as a stream. The suggested pipeline achieves state-of-the-art results on datasets coming from different domains ( image, audio, clinical data). More importantly, it demonstrates the importance of semantic context when deciding whether a sample is ood exhibiting better performance than existing baselines when semantic overlap should be taken into consideration. ", "summary_of_the_review": "The paper shows competitive results compared to strong baselines and a promising direction for semantic preserving out-of-distribution detection. However, I think some suggestions on the ablation study and some comments on the scalability on large datasets should be addressed to strengthen the paper.", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "3: Some of the paper’s claims have minor issues. A few statements are not well-supported, or require small changes to be made correct.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work."}, "extra_text": {}}, {"review_id": "7YD-7mvixS", "reviewer": "Reviewer_CrvH", "summary": "", "questions": "", "limitations": "", "rating": 3, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "*Strengths*:\n* The idea of using temporal structure in data and coresets for OOD detection are both interesting ideas.\n* The paper conducted experiments across several domains, involving a number of different datasets and tasks.\n\n*Weaknesses*:\n* This work is not the first spatio-temporal model for OOD detection as claimed. See [1] for a review. See [2, 3, 4] for examples of how other works deal with problems similar as ‘an obstacle detector deployed in a self-driving car will see images correlated over time.’ (which is an example used in the introduction) See [5] for an example of how the spatio-temporal structure is used when applied on EEG datasets. In light of these works and lack of discussion and comparisons, the novelty and contributions of the work are unclear.\n\n* The method makes sense overall but lacks justification of certain choices. For instance, the choice of the Mahalanobis metric and Gaussian assumptions in OOD detection is unclear. What does the combined spatial uncertainty score imply? How is the coreset extracted and how do the number of points in the coreset impact detection? Some analysis of these different parameters and aspects of the method should be explored further. Because there are no strong theoretical justifications, ablations of some of the different components of the proposed model are necessary. \n\n* How is the model used for image datasets (CIFAR)? The beginning of the results discusses how OvR classification can be used for examining OOD but it is unclear how these datasets are used in this case where the temporal structure of inliers is a core assumption. If different classes are presented as certain temporal rates, this information should be discussed and analyzed. How does the temporal rate of different classes impact learning or detection?\n\n* How is the reference window and the sliding window selected? Does setting this parameter involve an estimation of how temporally distributed OOD examples will be? Details on this and other choices / hyperparameters should be provided.\n\nMinor comments:\n- The authors claim that their proposed method is more robust to dataset statistics and focuses on the semantic meaning of the data. However, the same was not discussed for the EEG experiments, where the InD/OOD is decided based on either patient population or different patient demographics. It would be interesting to see this discussion.\n- Fix the equation in 3.1: ‘th’ as threshold should be explained. \n\n[1] Abdar, M., Pourpanah, F., Hussain, S., Rezazadegan, D., Liu, L., Ghavamzadeh, M., ... & Nahavandi, S. (2021). A review of uncertainty quantification in deep learning: Techniques, applications and challenges. Information Fusion.\n[2] Zhao, Y., Deng, B., Shen, C., Liu, Y., Lu, H., & Hua, X. S. (2017, October). Spatio-temporal autoencoder for video anomaly detection. In Proceedings of the 25th ACM international conference on Multimedia (pp. 1933-1941).\n[3] Nguyen, T. N., & Meunier, J. (2019). Anomaly detection in video sequence with appearance-motion correspondence. In Proceedings of the IEEE/CVF International Conference on Computer Vision (pp. 1273-1283).\n[4] Zhou, J. T., Du, J., Zhu, H., Peng, X., Liu, Y., & Goh, R. S. M. (2019). Anomalynet: An anomaly detection network for video surveillance. IEEE Transactions on Information Forensics and Security, 14(10), 2537-2550.\n[5] Fernando, T., Denman, S., Ahmedt-Aristizabal, D., Sridharan, S., Laurens, K. R., Johnston, P., & Fookes, C. (2020). Neural memory plasticity for medical anomaly detection. Neural Networks, 127, 67-81.\n[6] Hendrycks, D., Mazeika, M., & Dietterich, T. (2018). Deep anomaly detection with outlier exposure. arXiv preprint arXiv:1812.04606.\n", "summary_of_the_paper": "This paper proposes a spatio-temporal training method to quantify uncertainty and detect out-of-distribution samples. The authors apply their method to audio speech classification, seizure detection using EEGs, and image classification. ", "summary_of_the_review": "The idea of using temporal structure to perform out-of-distribution detection is an interesting problem with many important applications. While the authors provide some experimental results that suggest their approach outperforms other methods, there was little justification for the different choices made and no analysis of how these decisions impact their model's performance. In addition, the authors did not discuss or compare other approaches for estimating spatiotemporal uncertainty from sequential data and thus it is difficulty to assess the novelty and contributions of the work. ", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "2: The contributions are only marginally significant or novel.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}, {"review_id": "74ejGf_Dc0P", "reviewer": "Reviewer_54Yv", "summary": "", "questions": "", "limitations": "", "rating": 5, "confidence": 3, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "The strengths of this paper are two-fold. First, they have a fairly intuitive setup with a number of very desirable features (never before seen classes, high dimensional input data). Second, they have strong performance on key tasks, using a useful measure (AUROC) on a diverse set of benchmark datasets compared to a wide variety of other recent methods.\n\nThere were, however, some significant weakness in this paper. \n\nFirst, is I was confused about what problem this was trying to solve - OOD, yes,  but I couldn't really tell if this was focused on detecting concept drift, data drift, anomaly detection, or something else (I think they are focused on data drift, but this is only mentioned in passing when discussing evaluation at the bottom of page 6). I believe there were technical issues in their problem setup: There should be a distinction drawn between ABSTAIN and and FLAG, which is not present in their equation. More bothersome, the temporal aspect of the problem setup was unclear. By my read of the problem setup, $x_t$ is used only as a data point, and neither the output, nor the score function have any dependence on time. The place the temporal information was encoded was in the network structure. That only makes sense if you have certain strong assumptions on your input data (e.g. regular spacing between time samples). That assumption was not stated and not checked anywhere in the paper. \n\nSecond, I have concerns about the experimental setup. The precise problem they are addressing impacts the experimental setup. My previous comment on this spacing between time points applies here. Figure 1 makes me concerned that their temporal scorer is subject to data leakage during evaluation because it is being updated based on test sets. More concerning is the setup, they are inserting change points, so in spite of the excellent data chosen, they are fundamentally using a synthetic dataset for evaluation. Because the details of that synthesis don't necessarily match the intended setup of the baseline measurements, it shouldn't be a surprise that their methods perform better. When you pick evaluation, baseline, and data, it is easy to show good performance. \n", "summary_of_the_paper": "This paper was fundamentally about out of distribution detection. The authors tried to use the changing confidence around prediction values to predict changing distributions. They did so specifically for high dimensional, unstructured data, where distributions are often difficult to understand or quantify and compared their results to a number of current methods in the area on a wide variety of high dimensional data.", "summary_of_the_review": "I think this paper has a lot of potential, but but has technical issues that should be addressed before acceptance. The experimental setup and problem statement are the primary concerns for me. What they measure seems strong, but it is the connection between those measurements and the stated goals of the paper that are the limiting factor. ", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"correctness": "2: Several of the paper’s claims are incorrect or not well-supported.", "technical_novelty_and_significance": "3: The contributions are significant and somewhat new. Aspects of the contributions exist in prior work.", "empirical_novelty_and_significance": "2: The contributions are only marginally significant or novel."}, "extra_text": {}}]

Author rebuttal:

Meta-review: This paper has been reviewed by four experts. Their independent evaluations were all below the acceptance threshold citing various issues ranging from disconnection between stated goals of the presented work and the means in which the approach was evaluated, to doubts about the scalability of the proposed approach, to the lack of clarity regarding the actual novelty of the approach given some key missed references, to name a few items of criticism. Most reviewers were impressed with the empirical performance achieved in the conducted experiments, and one of the reviewers raised their mark in response to the author's rebuttal. Yet, the overall evaluation places this work as it stands now below the threshold for ICLR acceptance. I would like to encourage the authors to continue pushing their promising endeavor and systematically incorporating the feedback received here to improve the overall quality of this work.
Decision: Reject