<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Is it all a cluster game? - Exploring Out-of-Distribution Detection based on Clustering in the Embedding Space</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Fraunhofer-Institut fu¨ r Kognitive Systeme IKS</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ludwig Maximilian University of Munich</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Technical University of Munich</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <volume>2640</volume>
      <abstract>
        <p>It is essential for safety-critical applications of deep neural networks to determine when new inputs are significantly different from the training distribution. In this paper, we explore this out-of-distribution (OOD) detection problem for image classification using clusters of semantically similar embeddings of the training data and exploit the differences in distance relationships to these clusters between in- and out-ofdistribution data. We study the structure and separation of clusters in the embedding space and find that the supervised contrastive learning leads to well separated clusters while its self-supervised counterpart fails to do so. In our extensive analysis of different training methods, clustering strategies, distance metrics and thresholding approaches, we observe that there is no clear winner. The optimal approach depends on the model architecture and selected datasets for in- and out-of-distribution. While we could reproduce the outstanding results for contrastive training on CIFAR-10 as in-distribution data, we find standard cross-entropy paired with cosine similarity outperforms all contrastive training methods when training on CIFAR-100 instead. Cross-entropy provides competitive results as compared to expensive contrastive training methods.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The recent success of Deep Neural Networks (DNN) has
motivated their application in an varity of tasks. While
DNNs have demonstrated remarkable performance, they
cannot be expected to work reliably on inputs that are
not represented by the training distribution. Such
out-ofdistribution (OOD) samples can lead to unpredictable
behaviour and overconfident predictions [
        <xref ref-type="bibr" rid="ref37">Nguyen et al. 2015</xref>
        ,
        <xref ref-type="bibr" rid="ref15">Guo et al. 2017</xref>
        ,
        <xref ref-type="bibr" rid="ref17">Hendrycks &amp; Gimpel 2018</xref>
        ], with severe
consequences in case of safety-critical applications like
autonomous driving or automated medical diagnoses.
Therefore, it is crucial to detect such inputs when applied to the
model to allow for additional fallback measures to be
triggered [
        <xref ref-type="bibr" rid="ref20">Henne et al. 2019</xref>
        ] or to abstain from automated
decisions in rare or unseen situations [
        <xref ref-type="bibr" rid="ref48">Zhou et al. 2021</xref>
        ,
        <xref ref-type="bibr" rid="ref40">Prabhu
et al. 2018</xref>
        ].
      </p>
      <p>One promising research direction for out-of-distribution
detection - especially in image classification - is to exploit</p>
      <p>
        SupCon
the distribution of training samples in the learnt embedding
space assuming that related images exhibit similar features
and are therefore in close proximity according to their latent
representation [
        <xref ref-type="bibr" rid="ref31">Lee et al. 2018</xref>
        ]. Since contrastive learning
(CL) methods [
        <xref ref-type="bibr" rid="ref25">Khosla et al. 2020</xref>
        ,
        <xref ref-type="bibr" rid="ref9">Chen et al. 2020</xref>
        a] are
supposed to improve the separability of instances or
samples in the embedding space by pulling similar inputs
together and pushing dissimilar ones apart, it is only natural
that their use for OOD detection based on latent
representations has demonstrated state-of-the-art results recently
[Sehwag et al. 2021]. Figure 1 illustrates the intuition behind
those approaches.
      </p>
      <p>
        However, while the results are promising, several aspects
are left unexplored. On the one hand, there is the question
to which extent different training methods really influence
the formation of well-defined clusters of in-distribution (ID)
samples in the embedding space where different distance
metrics may be applied to measure sample similarity. On the
other hand, clustering strategies and the optimal number of
clusters have barely been touched in existing literature, with
the odd choice of a single cluster representing all the ID data
apparently leading to the best results [Sehwag et al. 2021].
Since the use of machine learning in safety-critical contexts
depends on a sound understanding of the insufficiencies and
expected failure modes of the deployed models [
        <xref ref-type="bibr" rid="ref6">Burton et al.
2021</xref>
        ], we conduct an extensive study on the performance of
supervised and self-supervised contrastive learning methods
for OOD detection focussing on the following contributions:
• Structure of the embedding space: In Section 3, we
provide detailed insights into cluster formations across
supervised (SupCon) and unsupervised (SimCLR)
contrastive learning methods, by using Global Separation
and Cluster Purity metrics to analyse cluster quality. We
ifnd that supervised training leads to well-separated
clusters, while unsupervised training leads to closely
overlapping clusters.
• OOD detection based on clustering: In Section 4, we
provide a modular OOD detection approach based on the
similarity of an input sample to a set of clusters allowing
the comparison of different distance metrics, clustering
methods and thresholding strategies. We further
investigate, whether observations are consistent for different
models and data sets. Our results indicate that there is no
clear winner: the optimal combination indeed depends on
the model size, distance metrics and training data.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Related Work</title>
      <p>
        DNNs are increasingly used in tasks like
classification[
        <xref ref-type="bibr" rid="ref11">Dosovitskiy et al. 2020</xref>
        ],scene prediction[
        <xref ref-type="bibr" rid="ref27 ref28 ref29">Koner et al.
2021</xref>
        c, 2020] and other high level tasks such as
reasoning [
        <xref ref-type="bibr" rid="ref21">Hildebrandt et al. 2020</xref>
        ,
        <xref ref-type="bibr" rid="ref27 ref28 ref29">Koner et al. 2021</xref>
        a]. However,
presence of OOD samples presents an important concern in
the successful completion of all such tasks, particularly in
safety-critical systems. Thus, reliable OOD detection has
become an important direction of research.
      </p>
      <p>
        Out-of-Distribution Detection The problem of OOD
detection has often been formulated as outlier detection
[
        <xref ref-type="bibr" rid="ref23">Hodge &amp; Austin 2004</xref>
        , Sehwag et al. 2021], one-class
classification [
        <xref ref-type="bibr" rid="ref43">Ruff et al. 2018</xref>
        ,
        <xref ref-type="bibr" rid="ref38">Perera et al. 2019</xref>
        ], novelty
detection [
        <xref ref-type="bibr" rid="ref45">Tack et al. 2020</xref>
        ,
        <xref ref-type="bibr" rid="ref39">Pidhorskyi et al. 2018</xref>
        ], anomaly
detection [
        <xref ref-type="bibr" rid="ref14">Golan &amp; El-Yaniv 2018</xref>
        ,
        <xref ref-type="bibr" rid="ref19">Hendrycks et al. 2019</xref>
        a]
and open set recognition [
        <xref ref-type="bibr" rid="ref5">Boult et al. 2019</xref>
        ,
        <xref ref-type="bibr" rid="ref12">Geng et al.
2020</xref>
        ]. Some contemporary ways to approach the problem
are: density approximation based generative modelling [
        <xref ref-type="bibr" rid="ref41">Ren
et al. 2019</xref>
        ,
        <xref ref-type="bibr" rid="ref35">Nalisnick et al. 2019</xref>
        ], self-supervision to learn
discriminatory features [
        <xref ref-type="bibr" rid="ref19">Hendrycks et al. 2019</xref>
        b,
        <xref ref-type="bibr" rid="ref34">Mohseni
et al. 2020</xref>
        ,
        <xref ref-type="bibr" rid="ref45">Tack et al. 2020</xref>
        , Sehwag et al. 2021], softmax
score based classifier methods [
        <xref ref-type="bibr" rid="ref17">Hendrycks &amp; Gimpel 2018</xref>
        ,
Liang et al. 2020], detection score based methods [
        <xref ref-type="bibr" rid="ref31">Lee et al.
2018</xref>
        ,
        <xref ref-type="bibr" rid="ref47">Winkens et al. 2020</xref>
        ,
        <xref ref-type="bibr" rid="ref45">Tack et al. 2020</xref>
        ], utilisation of
uncertainty quantifications based methods [Schwaiger et al.
2020,
        <xref ref-type="bibr" rid="ref8">Charpentier et al. 2020</xref>
        ] as well as methods using
self-attention based transformers [
        <xref ref-type="bibr" rid="ref27 ref28 ref29">Koner et al. 2021</xref>
        b]. Since
OOD samples can vary in many different ways, many outlier
exposure methods use few known OOD samples, thus
inducing a form of prior knowledge of OOD [
        <xref ref-type="bibr" rid="ref31">Lee et al. 2018</xref>
        ,
        <xref ref-type="bibr" rid="ref19">Hendrycks et al. 2019</xref>
        a, Liang et al. 2020]. However, this
approach could lead to problems when generalising across
diverse novel OOD datasets. Many contemporary works have
explored multi-class OOD detection settings without
inducing prior bias for OOD samples, but often do not perform
well with only near-OOD data, i.e. semantically similar from
ID data. In such a scenario, instance based discriminatory
method like CL can be used to learn useful semantic
features.
      </p>
      <p>
        Contrastive Learning: Discriminative approaches using
contrastive loss [
        <xref ref-type="bibr" rid="ref1">Bachman et al. 2019</xref>
        ,
        <xref ref-type="bibr" rid="ref22">Hjelm et al. 2019</xref>
        ]
had shown great promise in the past, however recently CL
has found even greater application in multiple application
domains [
        <xref ref-type="bibr" rid="ref16">Henaff 2020</xref>
        ,
        <xref ref-type="bibr" rid="ref45">Tack et al. 2020</xref>
        , Sehwag et al. 2021]
following the success of self-supervised methods like
SimCLR [
        <xref ref-type="bibr" rid="ref9">Chen et al. 2020</xref>
        a], MoCov2 [
        <xref ref-type="bibr" rid="ref9">Chen et al. 2020</xref>
        b], etc
as well as Supervised CL method [
        <xref ref-type="bibr" rid="ref25">Khosla et al. 2020</xref>
        ] and
similar. Recent works like [Sehwag et al. 2021,
        <xref ref-type="bibr" rid="ref45">Tack et al.
2020</xref>
        ,
        <xref ref-type="bibr" rid="ref47">Winkens et al. 2020</xref>
        ] have employed contrastive
training for OOD detection by either modifying the contrastive
training objective or assuming inherent class-conditioned
clusters. As a novel contribution, we present an extensive
study into the quality of clusters formed by various
contrastive training approaches and their influence on OOD
detection.
      </p>
      <p>3</p>
    </sec>
    <sec id="sec-3">
      <title>Structure of the embedding space</title>
      <p>In this section, we investigate potential clusters in the
embedding space and address the question about how to
evaluate the quality of clusters as well as their separation in the
high-dimensional embedding space.
3.1</p>
      <sec id="sec-3-1">
        <title>Contrastive Learning towards clustering</title>
        <p>
          The key intuition behind any CL method is to preserve a
meaningful representation by maximising the agreement
between similar instances and at the same time minimising the
agreement with dissimilar instances. This means that, given
an anchor image and a set of positives and negatives, the
positives are pulled closer based on similarity with the
anchors while the negatives are pushed apart in the
embedding space. In this work, we focus on Supervised Contrastive
Learning (SupCon) [
          <xref ref-type="bibr" rid="ref25">Khosla et al. 2020</xref>
          ] and the
unsupervised approach SimCLR [
          <xref ref-type="bibr" rid="ref9">Chen et al. 2020</xref>
          a] and compare
them to a baseline trained with standard cross-entropy (CE)
loss.
        </p>
        <p>
          SimCLR uses strong data augmentation to compare with
positive instances of an anchor image to learn without
supervision. While this promotes discriminative feature learning,
it often leads to disagreement between instances of same
classes. SupCon tries to address this caveat, by increasing
the number of positives by using all the samples of the same
class/ same ground-truth (GT) labels for comparison with
each anchor during CL. Both methods apply the contrastive
loss, based on cosine similarity, at a lower-dimensional
nonlinear projection layer. Since this layer is trained to be
invariant to augmentations, the authors [
          <xref ref-type="bibr" rid="ref9">Chen et al. 2020</xref>
          a] suggest
that good quality representations are most likely to be
preserved at the last feature layer of the encoder.
3.2
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Determining Cluster Quality</title>
        <p>In our investigation of cluster quality, we want to determine
how well clusters are separated from each other. Clusters
are either formed based on class labels corresponding to GT
classes or by using additional clustering like k-means on the
embedding vectors of all training samples. In the case of
kmeans clustering, we are further interested to understand if
these clusters reflect semantically similar samples, e.g. with
samples belonging to the same class.</p>
        <p>
          Cluster
airplane
automobile
bird
cat
deer
dog
frog
horse
ship
truck
0.8
Global Separation (GS) [
          <xref ref-type="bibr" rid="ref4">Bojchevski et al. 2017</xref>
          ]
generalises and extends the idea of the Silhouette Coefficient
[
          <xref ref-type="bibr" rid="ref42">Rousseeuw 1987</xref>
          ]. GS utilises the intuition that
separability between clusters can be determined by inspecting
intracluster and inter-cluster distances. Thus, for each cluster c,
a list of pairwise distances Pc,c is calculated for all samples
within the same cluster (intra-cluster distance). In addition,
a list of pairwise distances for samples from another cluster
c′, Pc,c′ is computed.
        </p>
        <p>Finally, GS for a given cluster, taking smallest x%
samples, is given as the difference between the intra-cluster
distances and the distance to the closest different cluster,
normalised by maximum of the two values, given as:
(1)
(2)
GSc(x) =</p>
        <p>Pc,c′ (x) − Pc,c(x)
max(Pc,c′ (x), Pc,c(x))
Cluster Purity is used to determine how many samples in a
cluster belong to the same class when k-means clustering is
applied:</p>
        <p>CP c =
maxj |Kc ∩ tj |</p>
        <p>Nc
where Kc , Nc denote the samples in a given k-means cluster
and their total count respectively whereas tj refers to
samples from jth GT class. Say, we assume a k-means
cluster with 500 samples that has 490 samples belonging to the
same GT class. That would lead to a cluster purity of 98%.</p>
      </sec>
      <sec id="sec-3-3">
        <title>3.3 Experiments and Discussion</title>
        <p>
          Here, we discuss several experiments conducted on the
CIFAR-10 dataset [
          <xref ref-type="bibr" rid="ref30">Krizhevsky et al. 2009</xref>
          ] using ResNet-50
model [He et al. 2016] to evaluate cluster quality of
contrastively trained SupCon, SimCLR with CE as baseline
using the metrics presented in Section 3.2.
        </p>
        <p>Evolution of cluster formation over training time: We
investigated the evolution of separation of class-based
clusters over training epochs as shown in Figure 2. We observe
that supervised methods like CE and SupCon show
increasing global separation over time starting initially from a
negative separation (epoch 0) with SupCon learning much faster
and showing better separation. Notably, CE still leads to
quite well-defined clusters even without a contrastive loss.
The unsupervised SimCLR does not show much further
separation after an initial clustering of embeddings, based on
GT classes. The unsupervised goal of discriminating
between individual samples rather than class, hurts the
overall formation of class-based clusters placing it even further
below cross-entropy in that domain. Some classes like ‘frog
’, ‘automobile ’or ‘truck ’show good separability while ‘cat
’and ‘dog ’have consistently worse clusters across all
methods. This could indicate that ‘cat ’and ‘dog ’are harder to
distinguish, sharing the majority of overall features, than the
other more separated classes. On the other hand, it could
also be an artefact of the individual distribution of samples
for each class in the CIFAR-10 dataset.</p>
        <p>SupCon
1.0
iton0.8
raa0.6
ep0.4
laS0.2
lob0.0
G-0.2 GT 5 10 15 20 25 30</p>
        <p>Number of clusters (K)</p>
        <p>SimCLR
1.0
iton0.8
raa0.6
ep0.4
laS0.2
lob0.0
G-0.2 GT 5 10 15 20 25 30</p>
        <p>Number of clusters (K)
1.0
ity0.8
r
Pu0.6
r
te0.4
s
luC0.2</p>
        <p>SupCon</p>
        <p>SimCLR
1.0
ity0.8
r
Pu0.6
r
te0.4
s
luC0.2
0.0 GT 5 10 15 20 25 30</p>
        <p>Number of clusters (K)
0.0 GT 5 10 15 20 25 30</p>
        <p>Number of clusters (K)</p>
        <p>Class-based or feature-based clusters? In the previous
section, we found no prominent GT class-based cluster
separation for the unsupervised CL approach. However, it is
still possible that feature-based clusters form based on
common features than class semantics. Thus, we further
investigated whether applying k-means clustering on top of such
contrastively trained embeddings can regroup them into
better separated distinct clusters using the GS and CP metrics
along with cosine similarity, as shown in Figure 3.
Classbased clusters K = GT are shown for comparison. The
boxplots indicate the range of global separation for all clusters
for a given configuration. CP is only applied to the k-means
clusters since the class-based clusters always have a purity
of 1.
for different distance-based scoring metrics and clustering
methods across diverse ID/ OOD datasets and model
architecture. Further, we investigate the relationship between
cluster quality and OOD detection performance.
GT class
K-means class (K=10)
4.1</p>
        <p>Method</p>
        <p>
          SupCon shows already good cluster separation for GT
class-based clusters due to supervised contrastive training.
Subsequently, with 10 k-means clusters, separation gets
even slightly better while cluster purity around 90%
indicates a significant overlap with the GT clusters. But, for
SimCLR we observe GT class-based clusters are not well
separated. This is expected since the contrastive loss is
applied at the projection layer maximising its effect there, it is
difficult for feature layer to show well separated GT
classbased clusters for an unsupervisedly learnt embeddings.
What do clusters look like? Many works on OOD
detection using the distance-based scores use a single global
threshold to distinguish between ID and OOD samples [
          <xref ref-type="bibr" rid="ref24">Hsu
et al. 2020</xref>
          ,
          <xref ref-type="bibr" rid="ref31">Lee et al. 2018</xref>
          ,
          <xref ref-type="bibr" rid="ref45">Tack et al. 2020</xref>
          , Sehwag et al.
2021,
          <xref ref-type="bibr" rid="ref19">Hendrycks et al. 2019</xref>
          b], i.e. if a sample is farther
away from the closest cluster than this threshold, it is
classiifed as OOD. However, this implies the assumption that all
clusters have an equal size or even hyperspheres with the
same diameter depending on distance metrics used. Since
this is a very strong assumption, we compare the size of the
individual clusters. Figure 4 shows the cosine distance from
the cluster centre encompassing 95% of the training
samples of this cluster using the feature layer embeddings from
SupCon as an example. We interpret this figure as an
approximation of the cluster radius and observe that the largest
cluster has almost 2.5 times the smallest cluster. This is true
for GT clusters as well as k-means clusters. We therefore
conclude that the use of a single global threshold does not
reflect the true nature of the clusters motivating the use of
individual thresholds for each cluster. Thus, in the next
section, we present a study on the OOD detection performance
for different models and metrics by evaluating with both per
cluster-based as well as global threshold based metrics.
4
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>OOD detection based on clustering</title>
      <p>Here, we describe our OOD detection method using
clusterbased thresholds and compare them to global thresholds
From our analysis in Section 3, we can find well-separated
clusters of ID samples at the last layer of the feature
extractor once a model is sufficiently trained. We use the distance
to the mean of a cluster as an indication of how similar a test
sample is to one of the samples in ID cluster. The farther the
sample, the less likely it is to be related to ID clusters. If a
sample is far enough away from all clusters, it is considered
to be an OOD sample. Since we discovered in the previous
section that clusters have varying sizes, we propose to
employ cluster-based thresholds as compared to global
thresholds for distance-based scoring metrics.</p>
      <p>Our approach consists of the following steps: (1)
During training, the mean of all clusters with respective training
samples is calculated. This is for clusters based on GT class
labels. In case of k-means clustering or using Guassian
Mixture Models (GMM), mean is calculated based on samples
assigned to respective clusters by these methods. (2) Using
mean and distance metrics, distance scores are calculated
for all train and test samples. (3) During inference, for each
cluster, the set of distance scores for the respective reference
distribution (train/test) are taken. For each new test sample,
a probability score is assigned depending upon where the
distance score of the given test sample can fit in the
overall distribution of distance scores of the given cluster. These
probability scores of test samples are finally used for
calculating evaluation metrics. The global threshold based
probability scores can also be similarly calculated by taking the
entire reference distribution of distance scores into account.
Distance metrics: In order to test the proximity of a
sample to a cluster, we need to either approximate the
underlying distribution function or use a simple distance metric
such as Cosine similarity or Euclidean distance. The
former can be analysed by mapping to cluster conditioned
linear multivariate Gaussians. This can be expressed as
Mahalanobis distance based score [Mahalanobis 1936], by
calculating cluster-wise mean (µ c) and co-variance (Σ c)
corresponding to the features f (x) of a test sample x, as given in
Equation 3. Here Sc(x), represents the distance of a sample
x from centre of cluster c.</p>
      <p>
        Sc(x) = (f (x) − µ c)T Σ −c 1(f (x) − µ c)
(3)
Although Mahalanobis distance is a reasonable choice for
highly correlated data it is prone to the curse of
dimensionality with increasing dimensions of the embeddings
[
        <xref ref-type="bibr" rid="ref46">Ververidis &amp; Kotropoulos 2009</xref>
        ] as well as increasing
components. Cosine similarity, is often deemed to be better
suited for computing distances with high dimensional
inputs. Since, during contrastive training, instance based
comparisons utilise cosine similarity, we employ this score for
cluster based distances as well. In our experiments, we have
also used GMM to map the embedding space into a mixture
potential Gaussian components, thus assigning each
sample to one of these clusters/components based on
Expectation Maximisation rather than simply taking the GT class
labels. Subsequently, Mahalanobis distance has been used to
calculate the distance scores with respect to this cluster
assignment. We have incorporated this an alternate to k-means
clustering which simply utilises Euclidean distance between
the feature vectors to assign samples to different clusters.
Finally, we compare all the cluster-based and global evaluation
metrics with a global evaluation of the probability scores
assigned by applying GMM irrespective of which
clusters/components each sample belong to.
      </p>
      <p>Cluster Analysis
GT class based clusters
(K = GT)</p>
      <p>Single
clusters
(K = 1)</p>
      <p>Clustering on
learnt/trained embedding</p>
      <p>(K &gt; 1)
K-means</p>
      <p>GMM clusters
based labels</p>
      <p>Distance based metrics
Cosine</p>
      <p>Mahalanobis</p>
      <p>Mahalanobis</p>
      <p>Default probability
based scores
('GMM')
Evaluation
Thresholds</p>
      <p>OOD Score
Closest cluster based
(Cluster Score)</p>
      <p>Entire reference data based</p>
      <p>(Global Score)</p>
      <sec id="sec-4-1">
        <title>Experiments and Discussion</title>
        <p>
          In this section, we investigate the OOD performance for
models trained on CIFAR-10, CIFAR-100 [
          <xref ref-type="bibr" rid="ref30">Krizhevsky et al.
2009</xref>
          ] with SupCon, SimCLR and baseline CE using ResNet
architecture. We present results with SVHN [
          <xref ref-type="bibr" rid="ref36">Netzer et al.
2011</xref>
          ] and CIFAR-100 /CIFAR-10 as OOD data sets due to
limited space, however we have conducted experiments with
other OOD datasets like resized ImageNet, LSUN [Liang
et al. 2020] and our observations are also extended to these
datasets. The results of our study is presented in Figure 6.
        </p>
        <p>Given ’K’ represents the number of clusters, we base our
investigation on following type of clusters in the embedding
space - GT class based clusters (K = GT ) where features
are taken from embeddings trained based on GT class
labels, single cluster (K = 1) where all the embeddings are
taken as one cluster and finally similar feature-based clusters
(K = 5, 10, 15, ..) mapped by using either k-means
clustering or GMM to re-group the embeddings into distinctive
clusters. This process of the OOD evalaution pipeline has
been represented in the schematic given in Figure 5. While
K = 1 case is similar to the results presented in [Sehwag
et al. 2021] for SimCLR, however by investigating further
clusters we show that the mentioned setting is not always
the best case scenario. It largely depends on choice of
different variables as shown in our study. As mentioned in
previous Section 4.1, for all cluster based analysis using k-means,
we employ Cosine similarity (‘KM+Cos’)and Mahalanobis
distance (‘KM+Maha’) except for clusters based on GMM
based target labels ( ‘GMM+Maha ’) we use only
Mahalanobis distance only due to inherent assumption of
Gaussian components. Finally, we employ the Area under ROC
curve (AUROC) as the main evaluation metric for OOD
detection where we present ‘AUROC cluster ’, ‘AUROC global
’as the respective scores for cluster-based and global
thresholds. We also compare with default ‘GMM’scores in global
evaluation.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Performance across GT class-based and feature-based</title>
        <p>clusters: From Figure 6, using class-based clusters (K =
GT ), we observe comparable AUROC scores across all the
methods with SupCon quite similar to CE and slightly better
than SimCLR. For feature clusters with K = 10, we achieve
almost similar performance as with class-based clusters for
CIFAR-10. This is expected since we see a strong overlap
of the clusters generated by k-means/ GMM and the GT
classes. With further increasing clusters (K &gt; 10), almost
similar trend exists as K = 10. For CIFAR-100 as ID, we
see an overall decreasing trend across all distance metrics
except for Cosine (K &gt; 1). This could be due to fewer
clusters than GT cluster(100). However, for SimCLR it
appears to be beneficial to treat all ID samples as one single
cluster (K = 1), as illustrated in Figure 1. This result is
in line with our observation, that SimCLR does not lead
to well-separated clusters and therefore making a
distinction between clusters is superfluous. Nonetheless, it is a bit
surprising that this single clusters also leads to competitive
OOD detection performance across all datasets.</p>
      </sec>
      <sec id="sec-4-3">
        <title>Performance across distance metrics: Taking cue on</title>
        <p>
          SimCLR performing best at K = 1 using Mahalanobis
distance in almost all cases in Figure 6 indicates the possibility
of high covariance between clusters when taken as a whole.
Notably, for GT clusters cosine similarity always performs
better than Mahalanobis [
          <xref ref-type="bibr" rid="ref46">Ververidis &amp; Kotropoulos 2009</xref>
          ].
However, this is not the case for K &gt; 1 as Mahalanobis
shows a decreasing trend in general from maximum at single
cluster (for SimCLR) while the AUROC for cosine
similarity drops for K = 1 and then continues an upward trend until
optimum cluster at K = 10 for SupCon and slightly further
for SimCLR in case of CIFAR-10 as ID dataset. For
CIFAR100, it continues with an upward trend for both SupCon and
SimCLR. CE with cosine similarity achieves best
performance across all methods in CIFAR-100. Also for clustering
cases, performance of GMM and k-means cluster based
Mahalanobis has been comparably same with slightly greater
performance by GMM based clusters. For supervised cases,
the AUROCs remain comparable with increase in clusters
but for SimCLR they show usual declining trend. For most
global cases, the default GMM probability remain steady
and similarly high to other distance metrics across different
CE | CIFAR-10 / CIFAR-100
        </p>
        <p>CE | CIFAR-10 / SVHN</p>
        <p>Cos/ KM+Cos
Maha/ KM+Maha
GMM+Maha
Cos/ KM+Cos
Maha/ KM+Maha
GMM+Maha
CO 40
R
U
A
20
0
100
80
l
a
lob 60
g
C
RO 40
U
A
20
0
Cos/ KM+Cos
Maha/ KM+Maha
GMM+Maha
Cos/ KM+Cos
Maha/ KM+Maha
GMM+Maha
Cos/ KM+Cos
Maha/ KM+Maha
GMM+Maha
Cos/ KM+Cos
Maha/ KM+Maha
GMM+Maha</p>
      </sec>
      <sec id="sec-4-4">
        <title>Performance across cluster-based and global thresholds</title>
        <p>Although cluster-based thresholds seek to represent the
embedding clusters better than global thresholds, however
global AUROCs tend to perform slightly better than cluster
AUROCs in most cases. Although the clusters are of inequal
sizes, however depending on features of the given ID dataset
they tend to be quite overlapping, so that global thresholds
seem to be good enough for OOD detection.</p>
      </sec>
      <sec id="sec-4-5">
        <title>Performance across OOD datasets: All the above obser</title>
        <p>vations remain consistent across all the OOD datasets.
However, we note SVHN being semantically quite different from
CIFAR-10 (Far OOD) achieves much better AUROC as
compared to CIFAR-100 which is semantically quite close
to CIFAR-10.</p>
      </sec>
      <sec id="sec-4-6">
        <title>Performance across ID datasets We note that the AU</title>
        <p>ROCs for CIFAR-100 (ID) vs CIFAR-10 (OOD) are much
lower compared to vice-versa, although it follows similar
trends mentioned above. This could be due to more classes
(100 vs 10) leading to much smaller closely overlapping
embedding clusters. This distinction becomes more difficult
with similar OOD dataset like CIFAR-10, as when compared
to really different SVHN.</p>
      </sec>
      <sec id="sec-4-7">
        <title>Performance across model architectures We conducted</title>
        <p>similar experiments on ResNet-18 (although not reported
here) vs ResNet-50, however we find much lesser overall
AUROCs in the former, with SimCLR performing
superior than supervised cases. This could potentially indicate
requirement for bigger models as supervised cases require
higher positives for instance based discrimination in CL.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>In this work, we first investigated the nature of clusters in
embedding spaces of contrastively trained models for image
classification. We found that supervised contrastive
training leads to well-separated clusters of in-distribution data
in the embedding space and that these clusters correlate
strongly with the ground truth classes. Unsupervised
contrastive training on the other hand leads to mostly
overlapping clusters that cannot be clearly distinguished. To our
surprise, standard cross-entropy loss also lead to reasonably
distinct clusters. Secondly, we proposed a modular OOD
detection method exploiting proximity of similar samples in
the embedding space allowing us to compare different
distance metrics, clustering methods and thresholding
strategies across a selection of model architectures, ID and OOD
datasets. While we could reproduce the superior
performance of SimCLR with a single cluster and Mahalanobis
distance for CIFAR-10 vs. CIFAR-100, cross-entropy with
clusters based on ground truth classes and cosine similarity
performed best when the in- and out-of-distribution roles are
reversed. However, in many cases there exist several
combinations that lead to similar detection performance
making the results even more ambiguous. We therefore have to
conclude, that there is no clear winner and not even a solid
trend, yet. For a deeper understanding, future work should
extend this investigation to a broader and more diverse set
of model architectures. Given recent observations that many
OOD methods do not translate well from academic datasets
to real world applications [Berger et al. 2021], further
research should focus on studies with real image data from
medical, automotive or industrial use cases.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <p>This work was funded by the Bavarian Ministry for
Economic Affairs, Regional Development and Energy as part of
a project to support the thematic development of the Institute
for Cognitive Systems (IKS).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <surname>Bachman</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hjelm</surname>
          </string-name>
          , R. D., and
          <string-name>
            <surname>Buchwalter</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <article-title>Learning Representations by Maximizing Mutual Information Across Views</article-title>
          . arXiv:
          <year>1906</year>
          .00910 [cs, stat],
          <year>July 2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <article-title>Confidence-based out-of-distribution detection: A comparative study and analysis</article-title>
          .
          <source>In Uncertainty for Safe Utilization of Machine Learning in Medical Imaging, and Perinatal Imaging, Placental and Preterm Image Analysis</source>
          , pp.
          <fpage>122</fpage>
          -
          <lpage>132</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <surname>Springer</surname>
          </string-name>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <string-name>
            <surname>Bojchevski</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matkovic</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <article-title>and Gu¨nnemann, S. Robust Spectral Clustering for Noisy Data: Modeling Sparse Corruptions Improves Latent Embeddings</article-title>
          .
          <source>In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining</source>
          , pp.
          <fpage>737</fpage>
          -
          <lpage>746</lpage>
          , Halifax NS Canada,
          <year>August 2017</year>
          .
          <source>ACM. ISBN 978-1-4503- 4887-4</source>
          . doi:
          <volume>10</volume>
          .1145/3097983.3098156.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>Boult</surname>
            ,
            <given-names>T. E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cruz</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dhamija</surname>
            ,
            <given-names>A. R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gunther</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Henrydoss</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Scheirer</surname>
          </string-name>
          , W. J.
          <article-title>Learning and the Unknown: Surveying Steps toward Open World Recognition</article-title>
          . AAAI,
          <volume>33</volume>
          (
          <issue>01</issue>
          ):
          <fpage>9801</fpage>
          -
          <lpage>9807</lpage>
          ,
          <year>July 2019</year>
          . ISSN 2374-
          <fpage>3468</fpage>
          . doi:
          <volume>10</volume>
          .1609/aaai.v33i01.
          <fpage>33019801</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <string-name>
            <surname>Burton</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kurzidem</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schwaiger</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schleiß</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Unterreiner</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Graeber</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Becker</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <article-title>Safety Assurance of Machine Learning for Chassis Control Functions</article-title>
          . In Computer Safety, Reliability, and Security,
          <string-name>
            <surname>LNCS</surname>
          </string-name>
          , Cham,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>Springer International Publishing. doi: 10/gjq3ch.</mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>Charpentier</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          , Zu¨gner, D., and
          <article-title>Gu¨nnemann, S. Posterior Network: Uncertainty Estimation without OOD Samples via Density-Based Pseudo-Counts</article-title>
          . arXiv:
          <year>2006</year>
          .09239 [cs, stat],
          <year>October 2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kornblith</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Norouzi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Hinton</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <article-title>A Simple Framework for Contrastive Learning of Visual Representations</article-title>
          .
          <source>In International Conference on Machine Learning</source>
          , pp.
          <fpage>1597</fpage>
          -
          <lpage>1607</lpage>
          . PMLR, November 2020a.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          arXiv:
          <year>2003</year>
          .04297 [cs],
          <year>March</year>
          2020b.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          <string-name>
            <surname>Dosovitskiy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Beyer</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kolesnikov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weissenborn</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zhai</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Unterthiner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dehghani</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Minderer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heigold</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gelly</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , et al.
          <article-title>An image is worth 16x16 words: Transformers for image recognition at scale</article-title>
          . arXiv preprint arXiv:
          <year>2010</year>
          .11929,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <string-name>
            <surname>Geng</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Huang</surname>
          </string-name>
          , S.-J., and
          <string-name>
            <surname>Chen</surname>
            ,
            <given-names>S. Recent</given-names>
          </string-name>
          <article-title>Advances in Open Set Recognition: A Survey</article-title>
          .
          <source>IEEE Transactions on Pattern Analysis and Machine Intelligence</source>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>1</lpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          <string-name>
            <surname>ISSN</surname>
          </string-name>
          <year>1939</year>
          -
          <volume>3539</volume>
          . doi:
          <volume>10</volume>
          .1109/TPAMI.
          <year>2020</year>
          .
          <volume>2981604</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          <string-name>
            <surname>Golan</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          and
          <string-name>
            <surname>El-Yaniv</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <article-title>Deep Anomaly Detection Using Geometric Transformations</article-title>
          . arXiv:
          <year>1805</year>
          .10917 [cs, stat],
          <year>November 2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          <string-name>
            <surname>Guo</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pleiss</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sun</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Weinberger</surname>
            ,
            <given-names>K. Q.</given-names>
          </string-name>
          <article-title>On Calibration of Modern Neural Networks</article-title>
          .
          <source>In International Conference on Machine Learning</source>
          , pp.
          <fpage>1321</fpage>
          -
          <lpage>1330</lpage>
          . PMLR,
          <year>July 2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          <string-name>
            <surname>Henaff</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          <article-title>Data-Efficient Image Recognition with Contrastive Predictive Coding</article-title>
          .
          <source>In International Conference on Machine Learning</source>
          , pp.
          <fpage>4182</fpage>
          -
          <lpage>4192</lpage>
          . PMLR,
          <year>November 2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          <string-name>
            <surname>Hendrycks</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Gimpel</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          <article-title>A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks</article-title>
          .
          <source>arXiv:1610</source>
          .02136 [cs],
          <year>October 2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          arXiv:
          <year>1812</year>
          .04606 [cs, stat],
          <year>January 2019a</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          <string-name>
            <surname>Hendrycks</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mazeika</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kadavath</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Song</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <article-title>Using Self-Supervised Learning Can Improve Model Robustness and Uncertainty</article-title>
          .
          <source>In Advances in Neural Information Processing Systems</source>
          <volume>32</volume>
          , pp.
          <fpage>15663</fpage>
          -
          <lpage>15674</lpage>
          . October 2019b.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          <string-name>
            <surname>Henne</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schwaiger</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Weiss</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <article-title>Managing Uncertainty of AI-based Perception for Autonomous Systems</article-title>
          .
          <source>In AISafety@IJCAI</source>
          <year>2019</year>
          , Macao, China,
          <source>August 11-12</source>
          ,
          <year>2019</year>
          , volume
          <volume>2419</volume>
          <source>of CEUR Workshop Proceedings. CEURWS.org</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          <string-name>
            <surname>Hildebrandt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koner</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tresp</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          , and Gu¨nnemann,
          <string-name>
            <surname>S.</surname>
          </string-name>
          <article-title>Scene graph reasoning for visual question answering</article-title>
          .
          <source>arXiv preprint arXiv:2007.01072</source>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          <string-name>
            <surname>Hjelm</surname>
            ,
            <given-names>R. D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fedorov</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lavoie-Marchildon</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grewal</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bachman</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Trischler</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Bengio</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          <article-title>Learning deep representations by mutual information estimation and maximization</article-title>
          . arXiv:
          <year>1808</year>
          .06670 [cs, stat],
          <year>February 2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          <string-name>
            <surname>Hodge</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Austin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <article-title>A Survey of Outlier Detection Methodologies</article-title>
          .
          <source>Artificial Intelligence Review</source>
          ,
          <volume>22</volume>
          (
          <issue>2</issue>
          ):
          <fpage>85</fpage>
          -
          <lpage>126</lpage>
          ,
          <year>October 2004</year>
          . ISSN 1573-
          <fpage>7462</fpage>
          . doi:
          <volume>10</volume>
          .1023/B: AIRE.
          <volume>0000045502</volume>
          .10941.
          <year>a9</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          <string-name>
            <surname>Hsu</surname>
            ,
            <given-names>Y.-C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shen</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jin</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Kira</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <string-name>
            <surname>Generalized</surname>
            <given-names>ODIN</given-names>
          </string-name>
          :
          <article-title>Detecting Out-of-Distribution Image Without Learning From Out-of-Distribution Data</article-title>
          .
          <source>In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition</source>
          , pp.
          <fpage>10951</fpage>
          -
          <lpage>10960</lpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          <string-name>
            <surname>Khosla</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Teterwak</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sarna</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tian</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Isola</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maschinot</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Krishnan</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <article-title>Supervised Contrastive Learning</article-title>
          . arXiv:
          <year>2004</year>
          .11362 [cs, stat],
          <year>April 2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          <string-name>
            <surname>Koner</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sinhamahapatra</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Tresp</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <article-title>Relation transformer network</article-title>
          .
          <source>arXiv preprint arXiv:2004.06193</source>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          <string-name>
            <surname>Koner</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Li</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hildebrandt</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Das</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tresp</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          , and Gu¨nnemann,
          <string-name>
            <given-names>S.</given-names>
            <surname>Graphhopper</surname>
          </string-name>
          <article-title>: Multi-hop scene graph reasoning for visual question answering</article-title>
          .
          <source>In International Semantic Web Conference</source>
          , pp.
          <fpage>111</fpage>
          -
          <lpage>127</lpage>
          . Springer,
          <year>2021a</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          <string-name>
            <surname>Koner</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sinhamahapatra</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roscher</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          , Gu¨nnemann, S., and
          <string-name>
            <surname>Tresp</surname>
          </string-name>
          , V. Oodformer:
          <article-title>Out-of-distribution detection transformer</article-title>
          .
          <source>CoRR, abs/2107</source>
          .08976,
          <year>2021b</year>
          . URL https://arxiv.org/abs/2107.08976.
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          <string-name>
            <surname>Koner</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sinhamahapatra</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Tresp</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          <article-title>Scenes and surroundings: Scene graph generation using relation transformer</article-title>
          .
          <source>arXiv preprint arXiv:2107.05448</source>
          ,
          <year>2021c</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          <string-name>
            <surname>Krizhevsky</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hinton</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          , et al.
          <article-title>Learning multiple layers of features from tiny images</article-title>
          .
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Shin</surname>
            ,
            <given-names>J. A Simple</given-names>
          </string-name>
          <string-name>
            <surname>Unified</surname>
          </string-name>
          <article-title>Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks</article-title>
          . arXiv:
          <year>1807</year>
          .03888 [cs, stat],
          <year>October 2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          <source>arXiv:1706</source>
          .02690 [cs, stat],
          <year>August 2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          <source>National Institute of Science of India</source>
          ,
          <year>1936</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref34">
        <mixed-citation>
          <string-name>
            <surname>Mohseni</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pitale</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yadawa</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          <article-title>SelfSupervised Learning for Generalizable Out-of-Distribution Detection</article-title>
          .
          <source>In Proc. AAAI</source>
          <year>2020</year>
          , pp.
          <fpage>8</fpage>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref35">
        <mixed-citation>
          <string-name>
            <surname>Nalisnick</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matsukawa</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Teh</surname>
            ,
            <given-names>Y. W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gorur</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Lakshminarayanan</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <string-name>
            <surname>Do Deep Generative Models Know What They Don't Know</surname>
          </string-name>
          ? arXiv:
          <year>1810</year>
          .09136 [cs, stat],
          <year>February 2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref36">
        <mixed-citation>
          <string-name>
            <surname>Netzer</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Coates</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bissacco</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Ng</surname>
            ,
            <given-names>A. Y.</given-names>
          </string-name>
          <article-title>Reading digits in natural images with unsupervised feature learning</article-title>
          .
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref37">
        <mixed-citation>
          <string-name>
            <surname>Nguyen</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yosinski</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Clune</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <article-title>Deep neural networks are easily fooled: High confidence predictions for unrecognizable images</article-title>
          .
          <source>In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR)</source>
          ,
          <year>June 2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref38">
        <mixed-citation>
          <string-name>
            <surname>Perera</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nallapati</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Xiang</surname>
            ,
            <given-names>B. OCGAN</given-names>
          </string-name>
          :
          <string-name>
            <surname>One-Class Novelty Detection Using GANs With Constrained Latent</surname>
          </string-name>
          <article-title>Representations</article-title>
          .
          <source>In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition</source>
          , pp.
          <fpage>2898</fpage>
          -
          <lpage>2906</lpage>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref39">
        <mixed-citation>
          <string-name>
            <surname>Pidhorskyi</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Almohsen</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Doretto</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          <article-title>Generative Probabilistic Novelty Detection with Adversarial Autoencoders</article-title>
          .
          <source>In Advances in Neural Information Processing Systems</source>
          <volume>31</volume>
          , pp.
          <fpage>6822</fpage>
          -
          <lpage>6833</lpage>
          . Curran Associates, Inc.,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref40">
        <mixed-citation>
          <string-name>
            <surname>Prabhu</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kannan</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ravuri</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chablani</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sontag</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Amatriain</surname>
            ,
            <given-names>X.</given-names>
          </string-name>
          <article-title>Prototypical Clustering Networks for Dermatological Disease Diagnosis</article-title>
          . arXiv:
          <year>1811</year>
          .03066 [cs],
          <year>November 2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref41">
        <mixed-citation>
          <string-name>
            <surname>Ren</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , Liu,
          <string-name>
            <given-names>P. J.</given-names>
            ,
            <surname>Fertig</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            ,
            <surname>Snoek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Poplin</surname>
          </string-name>
          ,
          <string-name>
            <surname>R.</surname>
          </string-name>
          , DePristo,
          <string-name>
            <given-names>M. A.</given-names>
            ,
            <surname>Dillon</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. V.</given-names>
            , and
            <surname>Lakshminarayanan</surname>
          </string-name>
          ,
          <string-name>
            <surname>B.</surname>
          </string-name>
          <article-title>Likelihood ratios for out-of-distribution detection</article-title>
          .
          <source>arXiv preprint arXiv:1906.02845</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref42">
        <mixed-citation>
          <string-name>
            <surname>Rousseeuw</surname>
            ,
            <given-names>P. J.</given-names>
          </string-name>
          <string-name>
            <surname>Silhouettes</surname>
          </string-name>
          :
          <article-title>A graphical aid to the interpretation and validation of cluster analysis</article-title>
          .
          <source>Journal of Computational and Applied Mathematics</source>
          ,
          <volume>20</volume>
          :
          <fpage>53</fpage>
          -
          <lpage>65</lpage>
          ,
          <year>November 1987</year>
          . ISSN 0377-
          <fpage>0427</fpage>
          . doi:
          <volume>10</volume>
          .1016/
          <fpage>0377</fpage>
          -
          <lpage>0427</lpage>
          (
          <issue>87</issue>
          )
          <fpage>90125</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref43">
        <mixed-citation>
          <string-name>
            <surname>Ruff</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vandermeulen</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goernitz</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Deecke</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Siddiqui</surname>
            ,
            <given-names>S. A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Binder</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , Mu¨ller, E., and
          <string-name>
            <surname>Kloft</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <article-title>Deep One-Class Classification</article-title>
          .
          <source>In International Conference on Machine Learning</source>
          , pp.
          <fpage>4393</fpage>
          -
          <lpage>4402</lpage>
          . PMLR,
          <year>July 2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref44">
        <mixed-citation>
          <source>arXiv:2103</source>
          .12051 [cs],
          <year>March 2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref45">
        <mixed-citation>
          <string-name>
            <surname>Tack</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mo</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jeong</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Shin</surname>
            ,
            <given-names>J. CSI</given-names>
          </string-name>
          :
          <article-title>Novelty Detection via Contrastive Learning on Distributionally Shifted Instances</article-title>
          . arXiv:
          <year>2007</year>
          .08176 [cs, stat],
          <year>July 2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref46">
        <mixed-citation>
          <string-name>
            <surname>Ververidis</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Kotropoulos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <article-title>Information loss of the mahalanobis distance in high dimensions: Application to feature selection</article-title>
          .
          <source>IEEE Transactions on Pattern Analysis and Machine Intelligence</source>
          ,
          <volume>31</volume>
          (
          <issue>12</issue>
          ):
          <fpage>2275</fpage>
          -
          <lpage>2281</lpage>
          ,
          <year>2009</year>
          . doi:
          <volume>10</volume>
          .1109/TPAMI.
          <year>2009</year>
          .
          <volume>84</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref47">
        <mixed-citation>
          <string-name>
            <surname>Winkens</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bunel</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Roy</surname>
            ,
            <given-names>A. G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stanforth</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Natarajan</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ledsam</surname>
            ,
            <given-names>J. R.</given-names>
          </string-name>
          , MacWilliams,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Kohli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            ,
            <surname>Karthikesalingam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            ,
            <surname>Kohl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Cemgil</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            ,
            <surname>Eslami</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. M. A.</given-names>
            , and
            <surname>Ronneberger</surname>
          </string-name>
          ,
          <string-name>
            <surname>O.</surname>
          </string-name>
          <article-title>Contrastive Training for Improved Outof-Distribution Detection</article-title>
          . arXiv:
          <year>2007</year>
          .05566 [cs, stat],
          <year>July 2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref48">
        <mixed-citation>
          <string-name>
            <surname>Zhou</surname>
            ,
            <given-names>S. K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Greenspan</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Davatzikos</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Duncan</surname>
            , J. S., van Ginneken,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Madabhushi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Prince</surname>
            ,
            <given-names>J. L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rueckert</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Summers</surname>
            ,
            <given-names>R. M.</given-names>
          </string-name>
          <article-title>A review of deep learning in medical imaging: Imaging traits, technology trends, case studies with progress highlights, and future promises</article-title>
          .
          <source>Proc. IEEE</source>
          ,
          <volume>109</volume>
          (
          <issue>5</issue>
          ):
          <fpage>820</fpage>
          -
          <lpage>838</lpage>
          , May
          <year>2021</year>
          .
          <source>ISSN 0018-9219</source>
          ,
          <fpage>1558</fpage>
          -
          <lpage>2256</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref49">
        <mixed-citation>
          <source>doi: 10</source>
          .1109/JPROC.
          <year>2021</year>
          .
          <volume>3054390</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>