DOS: Diverse Outlier Sampling for Out-of-Distribution Detection
Authors: Wenyu Jiang
Hao Cheng
MingCai Chen
Chongjun Wang
Hongxin Wei
Venue: ICLR 2024 poster (2024)
Keywords: out-of-distribution detection
data-centric artificial intelligence
Primary area: unsupervised, self-supervised, semi-supervised, and supervised representation learning
TL;DR: We empirically show that diversity is critical in sampling, and thereby propose a clustering-based sampling strategy.

Abstract: Modern neural networks are known to give overconfident predictions for out-of-distribution inputs when deployed in the open world. It is common practice to leverage a surrogate outlier dataset to regularize the model during training, and recent studies emphasize the role of uncertainty in designing the sampling strategy for outlier datasets. However, the OOD samples selected solely based on predictive uncertainty can be biased towards certain types, which may fail to capture the full outlier distribution. In this work, we empirically show that diversity is critical in sampling outliers for OOD detection performance. Motivated by the observation, we propose a straightforward and novel sampling strategy named DOS (Diverse Outlier Sampling) to select diverse and informative outliers. Specifically, we cluster the normalized features at each iteration, and the most informative outlier from each cluster is selected for model training with absent category loss. With DOS, the sampled outliers efficiently shape a globally compact decision boundary between ID and OOD data. Extensive experiments demonstrate the superiority of DOS, reducing the average FPR95 by up to 25.79% on CIFAR-100 with TI-300K.

Published as a conference paper at ICLR 2024
DOS: DIVERSE OUTLIER SAMPLING FOR OUT-OF- DISTRIBUTION DETECTION
Wenyu J Hao Cheng', Mingeai Chen', Chongjun Wang', Hongxin Weilt Department of Statistics and Data Science, Southern University of Science and Technology State Key Laboratory for Novel Software Technology, Nanjing University
ABSTRACT
Modern neural networks are known to give overconfident predictions for out-of- distribution inputs when deployed in the open world. It is common practice to leverage surrogate outlier dataset regularize the model during training, and re- cent studies emphasize the role of uncertainty designing the sampling strategy for outlier datasets. However, the OOD samples selected solely based on predic- tive uncertainty can be biased towards certain types, which may fail to capture the full outlier distribution. In this work, we empirically show that diversity is critical in sampling outliers for OOD detection performance. Motivated by the observa- tion, we propose a straightforward and novel sampling strategy named DOS (Di- verse Outlier Sampling) to select diverse and informative outliers. Specifically, we cluster the normalized features at each iteration, and the most informative outlier from each cluster is selected for model training with absent category loss. With DOS, the sampled outliers efficiently shape a globally compact decision boundary between ID and OOD data. Extensive experiments demonstrate the superiority of DOS, reducing the average FPR95 by up to 25. 5.79% on CIFAR- 100 with TI-300K.
INTRODUCTION
Modern machine learning systems deployed in the open world often fail silently when encountering out-of-distribution (OOD) inputs (Nguyen al., 2015)- unknown distribution different from in- distribution (ID) training data, and thereby should not be predicted with high confidence. A reliable classifier should not only accurately classify known ID samples, but also identify as "unknown" any OOD input. This emphasizes the importance of OOD detection, which determines whether an input ID or OOD and allows the model raise an alert for safe handling.
To alleviate this issue, it is popular to assume access to a large auxiliary OOD dataset during training. series of methods are proposed to regularize the model to produce lower confidence (Hendrycks et al., 2019b; Mohseni et al., 2020) or higher energy (Liu et al., 2020) on the randomly selected data from the auxiliary dataset. Despite the superior performance over those methods without auxiliary OOD training data, the random sampling strategy yields a large portion of uninformative outliers that do not benefit the differentiation of ID and OOD data (Chen et al., 2021), ),, as shown in Figure la 1b. To efficiently utilize the auxiliary OOD dataset, recent works (Chen et al., 2021; Li & Vasconcelos, 2020) design greedy sampling strategies that select hard negative examples, i.e., outliers with the lowest predictive uncertainty. Their intuition is that incorporating hard negative examples may result in a more stringent decision boundary, thereby improving the detection of OOD instances. However, the OOD samples selected solely based on uncertainty can be biased towards certain classes or domains, which may fail to capture the full distribution of the auxiliary OOD dataset. As shown in Figure Ic. the concentration of sampled outliers in specific regions will result suboptimal performance of OOD detection (see Section 2.2 for more details). This motivates us to explore the importance of diversity designing sampling strategies.
In this work, we empirically show that diversity is critical in designing sampling strategies, by the observation that outlier subset comprising data from more clusters results in better OOD detection.
Work done while working at SUSTech as a visiting scholar. 1 "oorespondiig author (we h austech.. edu.cn cn)

---

Published as a conference paper at ICLR 2024
OOD data (sampled)
X OOD data (unsampled)
+ ID data
Decision boundary between ID and sampled OOD data
All
(b) Random
(c) Uncertain
(d) Diverse Uncertain
Figure 1: A toy example in 2D space for illustration of different sampling strategies. The ID data consists of three class-conditional Gaussian distributions, and the OÔD training samples are sim- ulated with plenty of small-scale class-conditional Gaussian distributions away from ID data. (a): All outliers sampled: a global compact boundary but intractable. (b): Random outliers sampled: efficient, with loose boundary. (c): Uncertain outliers sampled: efficient, with a locally compact boundary (See Subsection 2.2 for more empirical results). (d): Diverse and uncertain outliers sam- pled: efficient, with globally compact boundary.
is noteworthy that the diverse outlier pool without considering the cost of development (Hendrycks al., 2019b) might not directly transfer to the outlier subset, due the deficient sampling strategy. Therefore, the sampling strategy should improve the diversity of selected hard negative samples, for a globally compact decision boundary as shown Figure 1d. Specifically, we propose a straight- forward and novel sampling strategy named DOS (Diverse Outlier Sampling), which first clusters the candidate OOD samples, and then selects the most informative outlier from each cluster, without dependency on external label information or pre-trained model. For efficient and diverse clustering, we utilize the normalized latent representation in each iteration with the K-means algorithm. Trained with absent category loss. the most informative outlier can be selected from each cluster based on the absent category probability. In this way, a diverse and informative outlier subset efficiently unlocks the potential of an auxiliary OOD training dataset.
To verify the efficacy of our sampling strategy, we conduct extensive experiments on common and large-scale OOI) detection benchmarks, including CIFAR-100 (Krizhevsky & Hinton, 2009) and ImageNet-IK 1K (Deng et al., 2009) datasets. Empirical results show that our method establishes state- of-the-art performance over existing methods for OOD detection. For example, using CIFAR-100 dataset as ID and much smaller TI-300K (Hendrycks et al., 2019b) as an auxiliary OOD training dataset, our approach reduces the FPR95 averaged over various OOD test datasets from 50.15% to 24.36% 25.79% improvement over the NTOM method, which adopts greedy sampling strategy (Chen et al., 2021). Moreover, we show that DOS keeps consistent superiority over other sampling strategies across different auxiliary outlier datasets and regularization terms, such as energy loss (Liu et al., 2020). In addition, our analysis indicates that DOS works well with varying scales of the auxiliary OOD dataset and thus can be easily adopted in practice.
In Section 5, we perform in-depth analyses that lead to an improved understanding our method. In particular, we contrast with alternative features in clustering and demonstrate the advantages of feature normalization
DOS. While the clustering step introduces extra computational overhead, find that DOS can benefit from faster convergence, leading to efficient training. Additionally, we demonstrate the value of OF-based methods in the era of large models by boosting the OOD detection performance of CLIP. We hope that our insights inspire future research to further explore sampling strategies for OOD detection.
2 PRELIMINARIES
2.1 BACKGROUND
Setup. In this paper, we consider the setting of supervised multi-class image classification. Let X' = d denote the input space and y {1,... K} denote the corresponding label space. The
training dataset Dirain ((.,, N drawn i.ddd from the joint data distribution IP Pxxx-- We use
2

---

Published as a conference paper at ICLR 2024
Px to denote the marginal probability distribution on X, which represents the in-distribution (ID). Given the training dataset, we learn classifier fo X RR with learnable parameter 0 <R,, to correctly predict label of input æ. Let z denote the intermediate feature of x from fo-
Problem statement. During the deployment stage, the classifier in the wild can encounter inputs from an unknown distribution, whose label set has no intersection with y. We term the unknown distribution out-oofdistrributio (OOD), denoted by Px over X. The OOD detection task can be formulated as a binary- problem: determining whether input is from Pit or not (IP OOD detection can be performed by a level-set estimation:
in, if S(x) 2T
g(x) =
out, if S(x) <T
where S(x) denotes scoring function and T is a threshold, which commonly chosen so that high fraction (e.g., 95%) of ID data is correctly distinguished. By convention, samples with higher scores are classified as ID and vice versa.
Auxiliary OOD training dataset. To detect OOD data during testing, it is popular to assume access to an auxiliary unlabeled OOD training dataset D = {-}}²= from Ix" at training stage (M >> N). In particular, the auxiliary dataset Doux typically selected independently of the specific test-time OOD datasets denoted by out For terminology clarity, we refer to training-tima OOD data as outlier and exclusively use OOD data to refer to test-time unknown inputs.
To leverage the outliers from auxiliary datasets Doux, previous works (Hendrycks et al., 2019b; Mohseni et al., 2020; Liu et al., 2020) propose to regularize the classifier to produce lower scores on the randomly selected outliers. Formally, the objective be formulated as follows:
(1) However, the random sampling strategy yields large portion of uninformative outliers that do not benefit the OOD detection (Chen et al., 2021). Recent works (Li & Vasconcelos, 2020; Chen et al., 2021) designed greedy strategies sample outliers with the lowest predictive uncertainty, thus resulting in a more stringent decision boundary. Despite the superior performance of greedy strategies over those methods without auxiliary OOD training data, the OOD samples selected solely based on uncertainty can be biased towards certain classes or domains, which may fail to capture the full distribution of the auxiliary OOD dataset. In the following section, we empirically show the bias of greedy sampling and reveal the importance of diversity in designing sampling strategies.
((.,)>>Dieul [x) 3) + AE [CoE (f(x).
2.2 MOTIVATION
To demonstrate the inherent bias of the greedy sampling strategy, we divide the auxiliary dataset into multiple groups based on semantic information. In particular, we adopt the K-means to group similar outliers with their intermediate features, extracted by a pre-trained model. For the greedy sampling. we select outliers with the highest predictive confidence following ATOM (Chen et al., 2021). For comparison, we provide two additional sampling strategies: uniform sampling that uniformly sam- ples outliers from different groups and biased sampling that selects outliers from only a group. We construct three subsets with the same size using the three sampling strategies, respectively.
In this part, we perform standard training with DenseNet-100 101 (Huang et al., 2017), using CIFAR- 100 (Krizhevsky & Hinton, 2009) as ID dataset and TI-300K (Hendrycks et al., 2019b) as outlier pool. For evaluation, we use the commonly used six OOD test datasets. To extract features for clustering, we use the pretrained WRN-40-2 (Zagoruyko & Komodakis, 2016) model (Hendrycks et al., 2019a). For the clustering, set the number of clusters 6. More experimental details can be found in Appendix B.
The sampling bias of greedy strategy. Figure 2a presents the clustering label distribution of outliers sampled by the greedy and uniform strategies in The x-axis denotes the ID of different clusters. The results show that the greedy strategy leads to biased sampling, which exhibits an imbalanced distribution of outliers over the six clusters. For example, the number of outliers from cluster C1 is nearly twice that of cluster C6. With imbalanced distribution, the biased outliers from greedy sampling may fail to capture the full distribution of the auxiliary OOD training dataset, which degrades the performance of OOD detection.
3

---

Published as a conference paper at ICLR 2024
Groods
Uaiken
OODVAR
<TT 374
6000
Number Outtees
Nummee ber of Outteirs
3000
3000
50000
5000
0.0
0.2
0.3
0.6
0.8
1.0
8000
Hiased Sampling (FP1896-68.1778
10000
11
0000
8.40
0.95 0097 0.17
5000
100
0.2
0.4
DUG
0.8
1.0
Uniform Sumpling (FP156=446.15%
(a) Sampled Outlier Distribution
(b) Score Distribution
Figure 2: Comparisons among different sampling strategies. (a): The outliers (TI-300K) distribu- tion across six clustering centers with greedy and uniform strategies. (b): The score distribution for ID (CIFAR-100) and OOD (All) using biased and uniform strategies. Compared with uniform sampling, biased sampling produces more OOD examples with high scores that are close to ID.
The importance of diversity in designing sampling strategies. The formal definition of diversity can be found in Appendix E. To verify the effect of diversity in outlier sampling, we compare the OOD detection performance of models trained with the biased and uniform strategies, presented in Figure 2b. Here, we use the inverse of absent category probability as scoring function. Recall that the biased strategy is an extreme example that selects outliers from only cluster, the uniform strategy maximizes the diversity by uniformly selecting outliers from the six clusters. The results show that the uniform strategy with max diversity achieves a much lower FPR95 than the biased strategy, which demonstrates the critical role of diversity in sampling.
To understand how the diversity of outliers affects OOD detection, we compare the score distribution of the biased and uniform strategies in Figure 2b. We can observe that the biased sampling produces more OOD examples with high scores that are close to ID examples, making it challenging to dif- ferentiate the ID and OOD examples. This phenomenon aligns with the locally compact decision boundary shown in Figure Ic. In contrast, diverse outliers selected by the uniform strategy result in smooth score distribution, and thus better differentiation of ID and OOD data. In this way, we show that the diversity of outliers is critical factor in designing sampling strategies.
3 METHOD: DIVERSE OUTLIER SAMPLING
From our previous analysis, we show that by training with outliers that are sufficiently diverse, the neural network can achieve consistent performance of OOD detection across the feature space. For compact boundary between ID and OOD examples, the selected outliers should be also informative, i... close to ID examples (Chen et al., 2021). Inspired by the insights, our key idea in this work to select the most informative outliers from multiple distinct regions. In this way, the selected outlier could contain sufficient information for differentiating between ID and OOD examples while maintaining the advantage of diversity.
To obtain distinct regions in the feature space of outliers, a natural solution is to utilize the semantic labels of the auxiliary dataset. However, it is prohibitively expensive to obtain annotations for such large-scale datasets, making it challenging to involve human knowledge in the process of division. To circumvent the issue, we present novel sampling strategy termed Diverse Outlier Sampling (DOS), which partitions outliers into different clusters by measuring the distance to the prototype of each cluster. In the following, we proceed by introducing the details of proposed algorithms.
Clustering with normalized features To maintain the diversity of selected outliers, we em- ploy a non-parametric clustering algorithm K-means, which partitions the outliers from the auxiliary dataset into & clusters C = (CI,C2....,CS C.} so to minimize the within- cluster sum of squares. Formally, the objective of the vanilla K-means algorithm is to find: arg min Σ Exec, ||z - mill? where μe is the centroid of outliers from the cluster C..
4

---

Published as a conference paper at ICLR 2024
Goediy
DOs (lmm)
6500
620
Diversity
Uneertalin
600
3500
400
2500
350
Epoch
Eguch
(a) Diversity
(b) Uncertainty
Figure 3: Comparison of the selected outliers between the greedy sampling and proposed method in (a) diversity and (b) uncertainty. For the diversity, we adopt the label-independent clustering evaluation metric Calinski-Harabasz index (Caliñski & Harabasz, 1974), which the ratio of the sum of inter-cluster dispersion and of intra-clusted dispersion for all clusters. For the uncertainty, we use the softmax probability of the (K+1)-th class.
Nevertheless, adopting the vanilla K-means algorithm will introduce bias towards features with larger scales, i.e., examples with confident predictions. In other words, those features with large scales may have a greater impact the clustering process, which degrades the performance of outlier clustering. To address this issue, we propose to normalize the features before the clustering, thereby mitigating the negative effect of the feature scale. We provide an analysis in Section to validate the effect of the normalization in clustering. In particular, the new objective of the normalized K-means algorithm is:
2 p
arg min
XEC:
Now, we can partition outliers from the auxiliary dataset into & clusters with the normalized K-means algorithms. By uniformly sampling from these clusters, the diversity of the selected outlier can be easily bounded. In Appendix D, we provide an ablation study to show the effect of the number of clustering centers and the choice of clustering algorithm.
Active sampling in each cluster Despite that using diverse outliers can promote balanced sam- pling, the selected outliers might be too easy for the detection task, which cannot benefit the dif- ferentiation of ID and OOD data. Therefore, it is important to filter out those informative outliers from each cluster. Following the principle of greedy sampling, we select the hard negative examples that are close to the decision boundary. Practically, as a scoring function and select the outlier with the highest score in each cluster. For cluster C;, the selected outlier æy is sampled by
the inverse absent category probability
arg max [1.0 p(K 1[x;))]
With the diverse and informative outliers, the model could shape globally compact decision bound- ary between ID and OOD data, enhancing the OOD detection performance.
Mini-batch scheme Previous works (Chen et al., 2021; Ming et al., 2022b) normally sample the outliers from the candidate pool in the epoch level. However, the overwhelming pool heavily slows down the clustering process. For efficient sampling, we design a mini-batch scheme by splitting the full candidate pool into small groups sequentially. In each iteration, select outliers by the proposed sampling strategy to regularize the model.
It is intuitive utilize feature visualization for data diversity verification. However, the auxiliary OOD training data distribution is broad, and different sampling strategies may have minor differ- ences, which is hard perceive qualitatively. Therefore, choose quantify and compare the diversity and uncertainty differences. As shown in Figure 3a, the outliers selected from our sam- pling strategy indeed achieve much larger diversity than those of the greedy strategy. The results of

---

Published as a conference paper at ICLR 2024
Table I: OOD detection results on common benchmark. All values are percentages. 1 indicates larger values are better, and + indicates smaller values are better. Bold numbers are superior results.
FPR95 L/ 1/AUROC?
traiin
Method
D beec Places
ACC
SVHN
LSUN-C
DTD
LSUN-R
ISUN
Average
MSP
83.3/76.3
78.6/ 78.2
86.9/
83.0/ 74.1
82.3/7..0
84.2/72.4
83.0/74.3
75.6
ODIN
92.9/73.9
88.9/88.4
85.2/71.2
79.7/79.0
37.3/93.3
42.4/91.9
64.9/82.9
75.6
NA
Maha
88.4
77.3/711
30.4/9166
94.2/57.9
23.7/95.3
23.3/95.2
/
75.6
Energy.core
88.7
54.4/895
69.
78.8/78.2
63.1/87.7
67.1/86.0
72.4/199
75.6
ReAct
83.8/81.4
94.9
77.8/79.0
72.7/74.0
60.1/87.9
65.37 86.6
62.3/84.5
75.6
DICE
/8.7
0.9799.7
65.0 76.4
79.6/77.3
49.4/910
/
49.7
75.6
OF
42.6/91.5
34.1 /936
87.0/87.3
54.7/87.3
45.7//9088
48.6/
47.1
74.4
Energyioo
26.0/ 29.4/96.4
53.4/ 88.4
53.2/ 88,9
34.5/93.0
38.6/92.1
37.7/92.3
68.7
T1300K
NTOM
28.4/95.2
36.5/93.7
82.5/88.7
60.9/87.9
89.9/86.2
62.7/84.7
/8.2
74.6
Share
27.8
28.5/94.9
/
88.7
38.1/92.5
42.2/91.3
39.9
75.1
POEM
63.4/88.1
38.5
57.2/87.9
59.5 80.5
57.2/87.6
/
/8.7
63.4
DOS (Ours)
/971/
20.0 / 96.4
34,9 92.3
59.6 88.6
8.2 98.4
10.3 97.8
24.4 95.2
75.5
SOFL
17.4/ 21.5/96.2
$7.0 87.4
87.6
50.3 90.3
53.57 89.3
/9..
72.6
OE
19.7
0.67
/97.1
30.9/9166
0./1000.0
9.0/
10.0
73.7
ACET
/5.9
14.6/97.4
62.0/
86.3
86.4/88.2
86.8
50.9/89.3
72.7
CCU
50.8/91.
12.0/97.8
60.8 86.3
55.2/87.2
38.4/91.8
41.0/ 90.9
43.0/91.0
74.6
INRC
ROWL
98.9/50.3
55,7
97.0/
58.9/
55.3
90.4/54.5
93.4
72.5
Energy Iooe
34.0/94.5
0.1999.9
3.6/98.8
18.6/96.1
100.0
0.0 100.0
9.4/98.2
72.7
NTOM
12.8/978
0,3/99.9
5.6/98.7
29.1/94.1
0.0/ 100.0
0.1/ 100.0
8.0/
74.8
Share
19.5/97.3
0.57
6.5/98.3
95.9
0.0/ 100.0
1000
7.6/98.4
74,9
POEM
18.6/96.7
0.1799.9
3.3/
19.5
0.0/ 100.0
0.0 100.0
6.9/98.5
72.4
DOS (Ours)
4.0/98.9
990.9
/9.33
12.7/97.4
0.0 100.0
0.0 100.0
3.2/99.3
74.1
Figure show that our strategy can obtain outliers with comparable OOD scores those of the greedy strategy, which demonstrates the informativeness of the selected outliers.
Training objective In each iteration, we use the mixed training set comprising labeled ID data and unlabeled outliers for training the neural network. Concretely, the classifier is trained to optimize O by minimizing the following cross-entropy loss function:
- |- log p( x)] + En-Daa [- log p(K 1|x)]]
The details of DOS are presented in Appendix C. Our sampling strategy is a general method, or- thogonal different regularization terms, and can be easily incorporated into existing loss functions with auxiliary OOD datasets, e.g., energy loss (Liu et al., 2020). We provide a generality analysis in Section 4.2 to show the effectiveness of our method with energy loss.
4 EXPERIMENTS
In this section, validate the effectiveness of DOS on the common and large-scale benchmarks. Moreover, we perform ablation studies to show the generality DOS and the effect of the auxiliary OOD training dataset scales. Code is available at: https:/ /ttp://ggtttttt com/ http//yygiwyy/oOoo /DOS.
4.1 SETUP
Datasets. We conduct experiments on CIFAR100 (Krizhevsky & Hinton, 2009) as common benchmark and ImageNet-10 (Ming et al., 2022a) large-scale benchmark. For CIFAR 100, down-sampled version of ImageNet (ImageNet-RCC (Chen et al., 2021) is utilized as an auxiliary the 300K random Tiny Images subset (TI-300K) as
OOD training dataset. Additionally, alternative OOD training dataset, due to the unavailability of the original 80 Million Tiny Images² in previous work (Hendrycks al., 2019b). The methods are evaluated on six OOD test datasets: SVHN (Netzer et al., 2011), cropped/resized LSUN (LSUN-C/R) (Yu et al., 2015), Textures (Cim- poi et al., 2014), Places365 (Zhou et al., 2017), and iSUN (Xu et al., 2015). More experimental setups can be found in Appendix B.
'https: / / thub, cwm/ hom/hhnnryckke cut 1 ier-exposur "hhe original dataset contains offensive contents and permanently downgraded.

---

Published as a conference paper at ICLR 2024
Table 2: OOD detection results on large-scale benchmark. All values are percentages. indicates
larger values are better, and & indicates smaller values are better. Bold numbers are superior results.
FPR95 AUROCT
Dtrain
Method
D out
Average
iNaturalist
SUN
Places
Texture
MSP
$4,99 / 87.74
70.83 80.86
73.99 79.76
68.00 79.61
66.95 / 81.99
ODIN
47.66 / 89.66
60.15 84.59
67.89 /8.788
50.23 / 85.62
56.48 85.41
Maha
97.00 52.65
98.50 42.41
98.40 41.79
55.80/ 85.01
87.43 / 55.47
NA
Energy woore
55.72 89.95
59.26 85.89
64.92 82.86
53.72/85.99
58.41 86.17
ReAct
20.38 / 196.22
24.20 94.20
33.85 /91.58
47.30/ 89.80
31.43 / 92.95
DICE
25.63 / 99,49
35.15 90.83
46.49 87.48
31.72 90.30
34.75 / 90.77
OE
21.10 97.08
28.72/ 97.199 19
30.70 99.99
14.59/97.67
23,78 96.72
IN-990
Energyloss
35.77 195.5444 44
40.05 99.43
42.29 / 194.04
27.96/96.02
36.52 94.98
NTOM
61.75 194
944.98 45.41
43.94 94.93
59.10/94.43
52.55 / 94.62
Share
29.05 / 195.90
30.52/ (0.52/95.44 95.45
30,38 99.26
23.97 /96.40
28.48 95.75
DOS (Ours)
22.78 / 96.80
24.0 / 96,29
25,31 / 96.11
10.76/ 97.84
20.71 96.76
Table 3: Results with energy loss.
Table 4: FPR95 with varying OOD size.
Under-ganpling
FPR95
AUROC
Method
25%
%
%
100 %
Random
37.72
92.32
OE
26.12
24.2
22.18
23.78
NTOM
84.68
52.44
Energy
32.45
30.61
29.87
36.52
POEM
55.74
87.14
NTOM
66.21
60.62
55.99
52.55
Share
26.12
29.87
29.87
28.48
DOS (Ours)
29.43
94.05
DOS (Ours)
21.97
21.56
21.03
20.71
Training setting. We use DenseNet-101 for the common benchmark and DenseNet-121 for the large-scale benchmark. The model is trained for 100 epochs using SGD with momentum of 0.9, a weight decay of 0.0001, and a batch size of 64, for both ID and OOD training data. The initial learning rate is set as 0.1 and decays by a factor of at 75 and 90 epochs. The above settings are the same for all methods trained with auxiliary outliers. By default, the size of sampled OOD training samples the same as the training dataset, which a common setting in prior work (Ming al., 2022b). Without tuning, keep the number of the clustering center the same as the batch size. All the experiments are conducted on NVIDIA V100 and all methods are implemented with default parameters using PyTorc.
Compared methods. According dependency on auxiliary OOD training dataset, we divide the comparison methods into (1) Post-hoc methods: MSP (Hendrycks & Gimpel, 2017), ODIN (Liang al., 2018), Maha (Lee et al., 2018b), Energy score (Liu al., 2020), GradNorm (Huang et al., 2021), ReACT (Sun et al., 2021), and DICE (Sun & Li, 2022), and (2) Outlier exposure methods: SOFL (Mohseni et al., 2020), OE (Hendrycks et al., 2019b), ACET (Hein et al., 2019), CCU (Meinke & Hein, 2019), ROWL (Sehwag et al., 2019), Encrgy (Liu et al., 2020), NTOM (Chen et al., 2021), Share (Bitterwolf et al., 2022), and POEM (Ming et al., 2022b).
4.2 RESULTS
DOS achieves superior performance on the common benchmark. In Table 1, we present the OOD detection results of the CIFAR100-INRC benchmark. obvious that the outlier exposure methods normally perform better than those post-hoc methods. It is vital that our method out- performs existing competitive OE-based methods, establishing state-of-the-ar performance. For example, DOS further reduces the average FPR95 by 3.7%, compared to the most competitive energy-regularized method POEM, despite the overwhelming INRC dataset resulting the satu- rated performance several OOD test datasets. Trained with the same absent category loss, DOS shows superiority over random (Share) and greedy (NTOM) strategies, with a 4.4% and 4.8% im- provement the average FPR95, respectively. At the same time, maintain comparable accu- racy. The average FPR95 standard deviation our methods over 3 runs of different random seeds 1.36%, and 0.15% for the CIFAR 100-TT300K and CIFAR INR-IN respectively.

---

Published as a conference paper at ICLR 2024
Representatien
ALROC
90
Nen Watrring
MTON
005 10030
90
91
92
93
94
95
96
60
70
80
90
100
AUROC
Epoch
Figure 4: Results of different features.
Figure 5: AUROC at varying epochs.
DOS shows consistent superiority across different auxiliary OOD datasets. To verify the per- formance of the sampling strategy across different auxiliary OOD training datasets, we treat TI-300K as alternative auxiliary outliers. Using the TI-300K dataset, the performance of compared methods largely deteriorated due the small size of the auxiliary dataset. As shown in Table the FPR95 of POEM degrades from 6.9% to 55.7%. However, our proposed method still shows consistent su- periority other methods. Specifically, the average FPR95 is reduced from 50.15% to 24.36% a 25.79 % improvement over the NTOM method, which uses a greedy sampling strategy.
DOS is effective on the large-scale benchmark. We also verify the effectiveness of our method on the large-scale benchmark. Specifically, we use the ImageNet-10 10 as ID training dataset and ImageNet-990 as the auxiliary data. Table 2 presents the OOD detection results for each OOD test dataset and the average over the four datasets. We can observe that outlier exposure methods still demonstrate better differentiation between ID and OOD data than the post-hoc methods, and our method achieves the best performance, surpassing the competitive OF by 3.07 % in average FPR95. The average FPR95 standard deviation DOS over 3 runs different random seeds is 0.77%.
DOS shows generality and effectiveness with energy loss. To validate the effectiveness of DOS with other regularization functions, we replace the original absent category loss with energy loss and detect OOD data with energy score (Liu al., 2020). As shown in Table 3, find that the proposed sampling strategy is consistently effective, establishing state-of-the-ari performance over other sampling strategies. For example, on the CIFAR100 1000 benchmark, using DOS sampling boosts the FPR95 of energy score from 37.72% to 29.43% - 8.29% % of direct improvement.
DOS is robust with varying scales of the auxiliary OOD dataset. Here, we provide an empirical analysis of how the scale of auxiliary datasets affects the performance of DOS. We conduct experi- ments with the IN10-IN990 benchmark by comparing the performance with different percentages of the whole auxiliary OOD training dataset. As shown in Table 4, we can observe that DOS maintains superior OOD detection performance with all the outlier percentages. Even if we keep 25% of the auxiliary OOD training dataset, the FPR95 of DOS only decreases by 1.26 %, which demonstrates the robustness of our method to the numbers of outliers.
DISCUSSION
Feature processing for clustering. DOS, normalize the features from the penultimate layer for clustering with K-means. While our method has demonstrated strong promise, a question arises: Can similar effect be achieved with alternative forms of features? Here, we replace the normalized features with various representations, including softmax probabilities, raw latent features, and latent features with dimensionality reduction or whitening, the CIFAR T0000 benchmark. this ablation, show that those alternatives do not work as well
method.
Our results in Figure 4 show that employing normalized features achieves better performance than using softmax probabilities and raw features. While the post-processing methods, including PCA and whitening, can improve the performance over using raw features, feature normalization still superior to those methods by meaningful margin. Previous works demonstrated that OOD exam- ples usually produce smaller feature norms than in-distribution data (Sun al., 2022; Tack et al., 2020; Huang al., 2021), which may disturb the clustering algorithm with Fuclidean distance for
8

---

Published as a conference paper at ICLR 2024
Table 5: FPR95 with the CLIP ViT model on large-scale benchmark. All values are percentages. + indicates smaller values are better. Bold numbers are superior results.
Diest
Dtrain
Method
iNaturalist
SUN
Places
Texture
Average
MSP
32.53
21.92
24.19
14.97
23.40
ODIN
18.13
6.05
8.26
5.36
9.45
Maha
22.31
8.22
10.02
4.52
11.27
Energy score
26.20
8.83
11.96
7.98
13.74
OF
4.82
5.07
5.83
0.78
4.13
IN-990
Energy loss
19.60
7.81
9.35
3.42
10.04
NTOM
9.33
7.45
9.28
3.69
7.44
Share
5.85
7.05
8.18
1.56
5.66
DOS (Ours)
4.00
4.08
4.82
0.75
3.41
distinct clustering. With normalization, the norm gap between ID and OOD examples can be dimin- ished, leading better performance in clustering. Empirically, we verify that normalization plays key role in the clustering step of diverse outlier sampling.
Fast convergence for efficiency. Compared with random sampling. potential limitation of DOS is the additional computational overhead from the clustering operation. Specifically, for the CIFAR SFFAR100-TOR 10000000000 benchmark, the clustering (0.0461s) takes 12% fraction of the total training time (0.384s) for each iteration. On the other hand, we find the extra training cost can be covered by an advantage our proposed method fast convergence.
In Figure 5, we present the OOD detection performance of snapshot models at different training epochs. The results show that our method has established ideal performance at an early stage, while the performances of random sampling and NTOM are still increasing at the 100th epoch, with significant gap to our method. Training with DOS, the model requires much fewer training epochs to achieve optimal performance, which demonstrates the superiority of our method in efficiency.
Adaptation pre-trained large models. In recent works, large models have shown strong ro- bustness to distribution shift by pretraining on broad data (Radford et al., 2021; Ming et al., 2022a). Here, we provide an empirical analysis show whether OE-basel methods can help large models in OOD detection. To this end, we conduct experiments by fine-tuning the pre-trained CLIP ViT (ViT-B/16) (Dosovitskiy et al., 2020) for OOD detection on the IN10-IN990 benchmark. For post- hoc methods, we only fine-tune the model on the in in-distribution data, while we use both the ID data and the auxiliary dataset for OE-based methods. The model is fine-tuned for 10 epochs using SGD with momentum of 0.9, learning rate of 0.001. and weight decay of 0.00001.
We present the results of the pre-trained CLIP model Table 5. Indeed, pretrained large models achieve stronger performance than models trained from scratch (shown in Table 2) in OOD detection. Still, fine-tuning with outliers can significantly improve the OOD detection performance of CLIP, where DOS achieves the best performance. Overall, the results demonstrate the value of OE-based methods in the era of large models, as an effective way to utilize collected outliers.
CONCLUSION
In this paper, we propose Diverse Outlier Sampling (DOS), straightforward and novel sampling strategy. Based on the normalized feature clustering, we select the most informative outlier from each cluster, thereby resulting in globally compact decision boundary between ID and OOD data. We conduct extensive experiments on common and large-scale OOD detection benchmarks, and the results show that method establishes state-of-the-or performance for OOD detection with limited auxiliary dataset. This method can easily adopted in practical settings. We hope that our insights inspire future research to further explore sampling strategy design for OOD detection.

---

Published as a conference paper at ICLR 2024
ACKNOWLEDGMENTS
This research is supported by the Shenzhen Fundamental Research Program (Grant No. (CYJ202308070011890222 Chongjun Wang is supported by the National Natural Science Foun- dation of China (Grant No. 62192783, 62376117). We gratefully acknowledge the support of the Center for Computational Science and Engineering at the Southern University of Science and Tech- nology, and the Collaborative Innovation Center of Novel Software Technology and Industrialization Nanjing University for our research.
REFERENCES
Sharat Agarwal, Himanshu Arora, Saket Anand, and Chetan Arora. Contextual diversity for active learning. European Conference on Computer Vision, pp. 137-153. Springer, 2020.
David Arthur and Sergei Vassilvitskii. K-means++ the advantages of careful seeding. In Annual ACM-SIAM symposium on Discrete algorithms, pp. 1027-1035, 2007.
Arindam Banerjee. Inderjit S Dhillon, Joydeep Ghosh, Suvrit Sra, and Greg Ridgeway. Clustering on the unit hy hypersphere using von mises-fisher distributions. Journal of Machine Learning Research, 6(9), 2005.
Abhijit Bendale and Terrance Boult. Towards open set deep networks. In Conference on Computer Vision and Pattern Recognition, pp. 1563-1572, 2016.
Julian Bitterwolf, Alexander Meinke, Maximilian Augustin, and Matthias Hein. Breaking down out-of-distribution detection: Many methods based on ood training data estimate combination of the same core quantities. International Conference on Machine Learning, pp. 2041-2074. PMLR, 2022.
Tadeusz Caliński and Jerzy Harabasz. A dendrite method for cluster analysis. Communications in Statistics-theory and Methods, 3(1):1-27, 1974.
Jiefeng Chen, Yixuan Li, Xi Wu, Yingyu Liang, and Somesh Jha. Atom: Robustifying out-of- distribution detection using outlier mining. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 430-445. Springer, 2021.
Yutian Chen, Max Welling, and Alex Smola. Super-samples from kernel herding, arXiv preprint arXiv: 2012.
Mircea Cimpoi, Subhransu Maji, lasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. De- scribing textures the wild. In Conference on Computer Vision and Pattern Recognition, pp. 1606-3613, 2014.
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Conference Computer Vision and Pattern Recognition, pp. Ieee, 2009.
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.1 1929, 2020.
Matej Grcié, Petra Bevandić, and Siniša Šegvić. Dense open-set recognition with synthetic outliers generated by real nvp. arXiv preprint arXiv:201 1. 1094, 2020.
Matthias Hein, Maksym Andriushchenko, and Julian Bitterwolf. Why relu networks yield high- confidence predictions far away from the training data and how to mitigate the problem. In Conference Computer Vision and Pattern Recognition, June 2019.
Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of distribution examples in neural networks. International Conference Learning Representations, 2017.
10

---

Published as a conference paper at ICLR 2024
Dan Hendrycks. Kimin Lee, and Mantas Mazeika, Using pre-training can improve model robustness and uncertainty. International Conference on Machine Learning, 2019a.
Dan Hendrycks, Mantas Mazeika, and Thomas Dietterich. Deep anomaly detection with outlier exposure, International Conference on Learning Representations, 2019b.
Yen-Chang Hsu, Yilin Shen, Hongxia Jin, and Zsolt Kira. Generalized odin: Detecting out-of- distribution image without learning from outtrf--dsstibution data. In Conference on Computer Vision and Puttern Recognition, pp. 10951-10960, 2020.
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Conference Computer Vision and Pattern Recognition, 2017.
Rui Huang, Andrew Geng, and Yixuan Li. On the importance of gradients for detecting distribu- tional shifts in the wild. Advances in Neural Information Processing Systems, 34, 2021.
Wenyu Jiang, Yuxin Ge, Hao Cheng, Mingcai Chen, Shuai Feng, and Chongjun Wang. Read: Ag- gregating reconstruction error into -ut-of-distribution detection. In AAAI Conference on Artificial Intelligence, volume 37, pp. 14910-1499 2023.
Shu Kong and Deva Ramanan. Opengan: Open-set recognition via open data generation. In Inter- national Conference on Computer Vision, pp. 813-822, 2021.
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Tech- nical Report 0, University of Toronto, Toronto, Ontario, 2009.
Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting autt-o--distribution samples. In International Conference Learning Representations, 2018a. URL https: pttttts::/pppeeeee /pppeeeeeevieeeeeeeeeeeeeeee n forum? Lerruummdddryyyvxxxa..
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting outtt--disttibuutin samples and adversarial attacks. Advances in Neural Information Process- ing Systems, 2018b.
Aodong Li, Chen Qiu, Marius Kloft, Padhraic Smyth, Stephan Mandt, and Maja Rudolph. Deep anomaly detection under labeling budget constraints. In International Conference on Machine Learning, pp. 19882-19910. PMLR, 2023.
Yi Li and Nuno Vasconcelos. Background data resampling for outlier-awand aware classification. In Con- ference on Computer Vision and Pattern Recognition, June 2020.
Shiyu Liang, Yixuan Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection neural networks. In International Conference on Learning Representations, 2018. URL https::///// // oppnrevieee n fests/forumidde Hatrrummii--HVVkIIi..
Weitang Liu, Xiaoyun Wang, John Owens, and Yixuan Li. Energy- based tion. Advances in Neural Information Processing Systems, 33:21 244-1444421455. 2020.
detec-
Alexander Meinke and Matthias Hein. Towards neural networks that provably know when they don't tt know. arXiv preprint arXiv: 12180, 2019.
Yifei Ming, Ziyang Cai, Jiuxiang Gu, Yiyou Sun, Wei Li, and Yixuan Li. Delving into out-of- distribution detection with vision-language representations. In Advances in Neural Information Processing Systems, 2022a.
Yifei Ming, Ying Fan, and Yixuan Li. Poem: Out-of-distribution detection with posterior sampling. In International Conference on Machine Learning. PMLR, 2022b.
Sina Mohseni, Mandar Pitale, JBS Yadawa, and Zhangyang Wang- Self-supervised learning for gen- eralizable -ittr--distibuution detection. In AAAI Conference on Artificial Intelligence, volume 34, pp. 5216-5223, 2020.
Peyman Morteza and Yixuan Li. Provable guarantees for understanding out-of distribbution detec- tion. In AAAI Conference on Artificial Intelligence, volume 36, pp. 7831-7840, 2022.
11

---

Published as a conference paper at ICLR 2024
Fionn Murtagh and Pierre Legendre. Ward's hierarchical agglomerative clustering method: which algorithms implement ward's criterion? Journal of Classification, 31:274-295, 2014.
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks easily fooled: High con- fidence predictions for unrecognizable images. In Conference on Computer Vision and Pattern Recognition, pp. 427-436, 2015.
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748-8763 PMLR, 2021.
Vikash Sehwag, Arjun Nitin Bhagoji, Liwei Song, Chawin Sitawarin, Daniel Cullina, Mung Chiang, and Prateek Mittal. Analyzing the robustness of open-world machine learning. In Workshop Artificial Intelligence and Security, pp. 105-116, 2019.
Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. arXiv preprint MKKiv:708..040 2017.
Samarth Sinha, Han Zhang, Anirudh Goyal, Yoshua Bengio. Hugo Larochelle, and Augustus Odena.
Small-gan: Speeding up gan training using core-sets. In International Conference on Machine Learning, pp. 9005-9015, PMLR, 2020.
Yiyou Sun and Yixuan Li. Dice: Leveraging sparsification for out-of-distribution detection. In European Conference on Computer Vision, 2022.
Yiyou Sun, Chuan Guo, and Yixuan Li. React: Out-of cuttof-distribution detection with rectified activa- tions. Advances Neural Information Processing Systems, 34, 2021.
Yiyou Sun, Yifci Ming, Xiaojin Zhu, and Yixuan Li. Out-of-distrbutioon detection with deep nearest neighbors. International Conference on Machine Learning. 2022.
Jihoon Tack, Sangwoo Mo. Jongheon Jeong, and Jinwoo Shin. Csi: Novelty detection via con-
trastive learning on distributionally shifted instances. Advances Neural Information Processing Systems, 33:1 1839-119111 1852, 2020.
Grant Van Horn, Oisin Mae Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The inaturalist species classification and detection dataset. In Conference on Computer Vision and Puttern Recognition, pp. 8769-8778, 2018.
Haoran Wang, Weitang Liu, Alex Bocchieri, and Yixuan Li. Can multi-label classification networks know what they don't know? Advances in Neural Information Processing Systems, 34:29074- 29087, 2021.
Qizhou Wang, Zhen Fang, Yonggang Zhang, Feng Liu, Yixuan Li, and Bo Han. Learning to augment distributions for out-of-distribution detection. In Advances in Neural Information Processing Systems, 2023a.
Qizhou Wang, Junjie Ye, Feng Liu, Quanyu Dai, Marcus Kalander, Tongliang Liu, Jianye Hao, and Bo Han. Out-of-distribution detection with implicit outlier transformation. arXiv preprint arXiv:2303.05033, 2023b.
Hongxin Wei, Renchunzi Xie, Hao Cheng, Lei Feng, Bo An, and Yixuan Li. Mitigating neural net- work overconfidence with logit normalization. In International Conference Machine Learning, 2022.
Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Lcrge-scale scene recognition from abbey to zoo. In Conference on Computer Vision and Pattern Recognition, pp. 3485-3492 IEEE, 2010.
12

---

Published as a conference paper at ICLR 2024
Pingmei Xu, Krista A Ehinger, Yinda Zhang, Adam Finkelstein, Sanjeev R Kulkarni, and Jianxiong Xiao. Turkergaze: Crowdsourcing saliency with webcam based eye tracking. arXiv preprint arXiv:1504.06755, 2015.
Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv: 03365, 2015.
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference, 2016.
Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. Transactions on Pattern Analysis and Machine Intelligence, (0(6))1452-1444 2017.
Jianing Zhu, Geng Yu, Jiangchao Yao, Tongliang Liu, Gang Niu, Masashi Sugiyama, and Bo Han. Diversified outlier exposure for out-of-distribttion detection via informative extrapolation. In Advances in Neural Information Processing Systems, 2023.
Yao Zhu, YueFeng Chen, Chuanlong Xie, Xiaodan Li, Rong Zhang, Hui Xue, Xiang Tian, Yaowu Chen, et al. Boosting out-of-distribution detection with typical features. arXiv preprint 2rX1v:2210.04200, 2022.
13

---

Published as a conference paper at ICLR 2024
A RELATED WORK
OOD detection OOD detection is critical for the deployment of models in the open world. A popular line of research aims to design effective scoring functions for OOD detection, such as Open- Max score (Bendale & Boult, 2016). maximum softmax probability (Hendrycks & Gimpel, 2017), ODIN score (Liang et al., 2018), Mahalanobis distance-based score (Lee et al., 2018b), distance- based score with reconstruction error (Jiang et al., 2023), cosine similarity score (Hsu et al., 2020), Energy-based score (Liu et al., 2020: Wang et al., 2021; Morteza & Li. 2022). GradNorm score (Huang et al., 2021), and non-parametric KNN-based score (Sun et al., 2022). However, the model can be overconfident to the unknown inputs (Nguyen et al., 2015).
In order to investigate the fundamental cause of overconfidence, ReAct (Sun et al., 2021) proposes to rectify the extremely high activation. BATS (Zhu et al., 2022) further rectifies the feature into typical sets achieve reliable uncertainty estimation. DICE (Sun & Li, 2022) exploits sparsification to eliminate the noisy neurons. LogitNorm (Wei et al., 2022) finds that the increasing norm of the logit leads to overconfident output, thereby a constant norm is enforced on the logit vector.
Another direction of work addresses the OOD detection problem by training-time regularization with auxiliary OOD training dataset (Mohseni et al., 2020; Hendrycks et al., 2019b; Hein et al., 2019; Meinke & Hein, 2019; Sehwag et al., 2019; Liu et al., 2020; Bitterwolf et al., 2022). The auxiliary OOD training dataset can be natural, synthetic (Lee al., 2018a; Kong Ramanan, 2021; Grcié et al., 2020), or mixed (Wang et al., 2023b). Models are encouraged to give predictions with uniform distribution (Hendryeks et al., 2019b) or higher energies (Liu et al., 2020) for outliers. To efficiently utilize the auxiliary OOD training dataset, recent works (Li & Vasconcelos, 2020; Chen et al., 2021) design greedy sampling strategics that select hard negative examples for stringent decision boundaries. POEM (Ming et al., 2022b) achieves a better exploration-cxploittiio trade-off' by maintaining a posterior distribution over models. Recently, DAL (Wang et al., 2023a) augments the auxiliary OOD distribution with Wasserstein Ball to approximate the unseen OOD distribution via augmentation. DivOE (Zhu et al., 2023) augments the informativeness of the auxiliary outliers via informative extrapolation, which generates new outliers closer to the decision boundary. In this work, we propose a straightforward and novel sampling strategy named DOS (Diverse Outlier Sampling), which first clusters the outleers, and then selects the most informative outlier from each cluster, resulting in globally compact decision boundary.
Coreset selection A closely related topic to our sampling strategy is coreset selection, which aims select a subset of the most informative ID training samples. Based on the assumption that data points close to each other in feature space tend to have similar properties, geometry-based methods (Chen et al., 2012; Sener & Savarese, 2017; Sinha et al., 2020; Agarwal et al., 2020) try to remove those data points providing redundant information then the left data points form a coreset, which similar to our method. However, geometry-bad better generalization. In this work, we select outlier examples as auxiliary data to improve OOD detection, which is different from active learning. In other words, the problem setting of this work is different from those methods.
methods aim to select in-distribution data for
B EXPERIMENTAL DETAILS
To clarify the motivation experiment setting in Section 2.2, we follow prior work (Hendrycks al., 2019a) to train the model. Concretely, downsampled ImageNet, which is the 1000-class Ima- geNet dataset resized to 32x32 resolution, is used for pre-training. The pretrained model can be found at https://github..cm wwt.///rrcocss///eeeeeeeeee et al., 201 cropped/resized LSÜN (LSUN-C/R) (Yu et al., 2015), Textures (Cimpoi et al., 2014), Places365 (Zhou et al., 2017), and iSUN (Xu al., 2015).
Six OOD test datasets contain: SVHN (Netzer
is worth noting that we adopt center clipping to remove the black border of LSUN-C for a fair and realistic comparison. For reproducible results, we follow fixed Places list from (Chen al., 2021).
The large-scale benchmark. To build the large-scale benchmark, we split the ImageNet- 1 IK (Deng et al., 2009) into IN-10 (Ming et al., 2022a) and IN-990. Specifically, the IN-10 is the ID training dataset, and IN-990 serves the auxiliary OOD training data. The OOD test datasets com-
14

---

Published as a conference paper at ICLR 2024
prise (subsets of) iNaturalist (Van Horn et al., 2018), SUN (Xiao et al., 2010), Places (Zhou al., 2017), and Textures (Cimpoi et al., 2014). For main results, the size of sampled OOD data is the same as the ID training dataset, which is a common setting (Ming et al., 2022b).
Evaluation metrics. We evaluate the performance of OOD detection by measuring the following metries: (I) the false positive rate (FPR95) of OOD examples when the true positive of ID examples is 95%; (2) the area under the receiver operating characteristic curve (AUROC).
C ALGORITHM
Algorithm 1: DOS: Diverse Outlier Sampling
Input: ID training dataset: Dirain auxiliary OOD training dataset: Doux, Output: OOD detector: 9. classifier: f;
for f to do
Sample random outliers from Daur to get a candidate set Dean, for (Birain, Boar) (Dirain, Deau do
Calculate OOD score list on B using current classifier fo: Fetch normalized OOD features 2 from extractor module
Cluster the Z into | || centers;
Add the outlier with largest OOD score from each cluster into Btrain. Train So using the training objective of Equation 2 with gtrain and Barain
end
end
D ABLATION STUDIES
Table 6: OOD detection results with varying clustering algorithms. FPR95 and AUROC values are percentages. indicates larger values better, and indicates smaller values are better. Bold numbers are superior results.
FPR95 AUROCT
Clustering
Disst
Time
Average
iNaturalist
SUN
Places
Texture
Agglomerative
44.08 / 94.83
40.16 94,70
40.19 / 94.61
29.11 96.56
38.39 / 15.188
0.05s
K- M--Men+++ seeding
54.25 / 94.78
49.58
94.86
49.70 99.77
39.22 96.20
48.19 95.13
2.0s
Spherical K-Means
27.46/ 96.22
26.86 96.12
07.93/95.99
14.18/97.61
24.11 96.48
3.1s
mo VM
242. 1s
moVMFFhaad
243.0s
K-Means (Ours)
22.78 96.80
24.0 96.29
25.31 96.11
10.76 97.84
20.71 96.76
4.5s
Sensitivity analysis on clustering algorithm. this section, we justify the selection of K-Means by comparing the performance of various clustering algorithms, including Agglomerative (Murtagh Legendre, 2014), K-Mcans++ seeding (Arthur Vassilvitskii, 2007: Li et al., 2023), Spherical K-Means, MF soft, and mo hard (Banerjee al., 2005). The experiments with the large benchmark (In 101990) We keep the same training setting as the manuscript. In also present clustering time in each iteration, which
conducted
addition to the OOD detection performance, is also a key factor of choosing clustering algorithm. As shown in the Table 6, K-means (our choice) achieves the best performance among the compared algorithms. In addition, the two algorithms based on mo VMF require too much time in each iteration. making it non-trivial to implement in this case. The resting algorithms cannot achieve comparable performance to ours, while they three ob- tains a little higher efficiency. Therefore, we choose the vanilla K-Means with superior performance and acceptable cost.
15

---

Published as a conference paper at ICLR 2024
04
17108
000
02
85
Number of Cluster
Number Cluster
(a) FPR95
(b) AUROC
Figure 6: OOD detection performance with varying number of clusters.
Effeet of clustering centers number. In this section, emphasize the importance of diversity by adjusting the number of clustering centers. By default, the candidate OOD data pool is clustered into K centers in each iteration, which is equal to the batch size of ID samples. As shown in Figure 6a 6b, the OOD detection performance deteriorates as the number of clustering centers decreases. It is noted that the number of clustering centers is not hyperparameter.
E DEFINITION OF DIVERSITY
Given set of all OOD examples D { J. goal is to select subset of K examples S 'D with |S| = K. We define that the selected subset is diverse, if S satisfies the condition:
1 Σ
8(S)
min d (z), 2 C, 371
where denotes a distance function the space and C is a constant that controls the degree of diversity. A larger value of C' reflects stronger diversity of the subset.
16


Reviews:
[{"review_id": "9OhMMdqtVT", "reviewer": "Reviewer_bYrq", "summary": "This paper proposes Diverse Outlier Sampling (DOS), a simple sampling approach for choosing diverse and informative outliers to use as an auxiliary OOD training dataset. The basic idea is simple: use k-means on normalized features to cluster the data and then per cluster identify the most informative outlier. Diversity is achieved since the k clusters collectively explain the full possible auxiliary OOD data but per cluster, we only choose the most informative outlier, which altogether ensures that the size of the auxiliary dataset can be controlled to be small (i.e., based on the number of clusters). Experimental results show that DOS works extremely well in practice.", "questions": "See weaknesses.", "limitations": "", "rating": 8, "confidence": 4, "soundness": 4, "presentation": 4, "contribution": 3, "strengths": "- The paper is easy to follow.\n- The basic idea of the proposed approach is very simple and elegant.\n- The experimental results are compelling.", "weaknesses": "- By normalizing the feature vectors, if I understand correctly, Euclidean norm is used so that the normalized vector resides on the unit hypersphere. Is there any benefit to using specialized versions of k-means (and k-means related) algorithms for the hypersphere? For reference, there are versions of k-means and the Gaussian mixture model that are restricted to the hypersphere (technically, mixtures of von Mises-Fisher distributions). See, for instance, the papers by Banerjee et al (2005) and Kim (2021). More generally, some sort of sensitivity analysis with respect to using different clustering algorithms could be helpful.\n- Figuring out how to set up experiments so that you could report error bars would be very helpful.\n\nReferences:\n- A Banerjee, I S Dhillon, J Ghosh, S Sra. Clustering on the Unit Hypersphere using von Mises-Fisher Distributions. JMLR 2005.\n- M Kim. On PyTorch Implementation of Density Estimators for von Mises-Fisher and Its Mixture. arXiv 2021.", "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": "", "extra_scores": {}}, {"review_id": "e89WYPFHSD", "reviewer": "Reviewer_HJAj", "summary": "This paper focuses on outlier sampling for out-of-distribution detection (OOD detection) tasks. To be specific, this paper follows the setting of outlier exposure that utilizes a surrogate outlier dataset to regularize the model during training, trying to make the model better recognize those OOD inputs. This work points out that previous outlier sampling methods are solely based on predictive uncertainty which may fail to capture the full outlier distribution. Motivated by the empirical evidence which shows the criticality of diversity, this work proposes Diverse Outlier Sampling (DOS) to select diverse and informative outliers via clustering the normalized features at each iteration. The proposed method achieves an efficient way to shape the decision boundary between ID and OOD data. Experiments from different perspective are conducted to demonstrate the effectiveness of DOS.", "questions": "Please also refer to the weakness part for the general concerns. The following questions are more specific to the clarification and the reviewer hope these question can help the authors to improve the writing and presentation of this work. \n1. As for the critical motivation (\"However, the OOD samples selected solely based on uncertainty can be biased towards certain classes or\ndomains, which may fail to capture the full distribution of the auxiliary OOD dataset.\"), the intuitive illustration is based on a toy example in 2D space, it could be better to refer to some convincing results which also show the same problem with Figure 1c.\n2. For the \"imbalanced performance of OOD detection\" pointed out in the same sentence, could the authors provide some empirical evidence?\n3. The critical observation shows that \"outlier subset comprising data from more clusters results in better OOD detection\", but what is the relationship between the cluster with diversity? \n4. Based on the previous question, could the authors provide a more detailed or specific conceptual definition of diversity? and clearly state how to measure the diversity in the motivation part to make that part more convincing.\n5. It seems that the current version of the work does not provide the corresponding experimental part for supporting the claimed \"efficient\" of the proposed DOS, like the sampling efficiency if I understand it correctly.\n6. In addition to using the CIFAR-100 as the ID dataset, it could be better to use the ImageNet dataset as ID dataset and use a large-scale ImageNet 21k as auxiliary outliers to verify the scalability of the proposed DOS.", "limitations": "", "rating": 8, "confidence": 4, "soundness": 4, "presentation": 3, "contribution": 3, "strengths": "1. This paper focuses on an important and practical question on outlier exposure, i.e., the auxiliary outliers may fail to capture the full outlier distribution.  \n2. This paper proposes a new method, namely DOS, which clusters the normalized features at each iteration and samples the informative outlier from each cluster to realize the diversified outlier selection. The technical design for clustering with normalized features is noval to the knowledge of the reviewer and shows promising empirical achievement towards the target.\n3. Comprehensive experiments compared with both post-hoc OOD detection scores and also several representative sampling methods are conducted to demonstrate the effectiveness of the proposed DOS.\n4. The overall presentation is clear and the method is easy to understand.", "weaknesses": "Overall, this work presents a concise and effective way to conduct diverse sampling in outlier exposure. Here are the major concerns for the current version of this paper, and hope it can help to improve the paper better.\n1. Although the overall presentation is clear, some critical definitions and claims are questionable and lack of convincing support.\n2. Technically, the proposed method (DOS) is based on an empirical demonstration of \"diversity\" with the OOD detection performance. However, the detailed definition of diversity is under-defined and the underlying mechanism of the clustering-based sampling scheme is not clearly explained. \n3. Since the previous greedy strategy will continually sample those outliers that are easy to be recognized as ID data, why do we need to utilize the diverse sampling method if the newly proposed method will sample some outliers that are already recognized as OOD data by the model?\n4. The experimental part can include more results conducted in other ID datasets, as well as the large benchmark dataset (like ImageNet) to demonstrate the effectiveness and efficiency of the proposed DOS.\n\n---- Acknowledgement ----\nAfter reading the response, further clarification and discussion addressed most of the concerns in the following perspectives,\n- Provided the specific definition of diversity and explained the relationship with clustering-based sampling; Complete the analysis on the outliers sampled by diversification target; Revised some unrigorous statements; Provided the large-scale experimental verification on the ImageNet dataset;\n\nOverall, regarding the quality and the technical novelty of this work, the reviewer decided to raise the score accordingly.", "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": "", "extra_scores": {}}, {"review_id": "IasujqZBne", "reviewer": "Reviewer_BvLD", "summary": "The paper proposes to use a diverse sampling to draw OOD samples from auxiliary datasets for training OOD models. The sampling consists of two steps. First, they apply K-means to cluster the auxiliary samples in a normalized feature space. Second, the samples close to the decision boundary of in-distribution are selected from each cluster. The clustering ensures the diversity of the selected samples. In training, the selected samples are considered OOD samples. They evaluate the proposed method on the common benchmark, i.e., CIFAR100, and show that the proposed diverse sampling improves over greedy sampling and other baselines.", "questions": "How important is the clustering step in diverse sampling? [1] proposed to use a K-means++ seeding algorithm based diverse sampling for semi-supervised anomaly detection. The K-means++ seeding algorithm doesn't require to predefine the clusters and the number of clusters. I think it can be also easily combined with the absent category probability. How would the proposed diverse sampling compare to the K-means++ seeding algorithm based diverse sampling?\n\n[1] Li, Aodong, Chen Qiu, Marius Kloft, Padhraic Smyth, Stephan Mandt, and Maja Rudolph. \"Deep anomaly detection under labeling budget constraints.\" In International Conference on Machine Learning, pp. 19882-19910. PMLR, 2023.", "limitations": "", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "1. The paper studies a well-motivated problem in OOD detection. Finding high-quality samples in the large auxiliary dataset improves the performance of the trained model and reduces the training cost.\n\n2. The proposed diverse sampling is simple and effective. \n\n3. The proposed method achieves impressive empirical results on the common benchmark.\n\n4. The authors provide extensive ablation studies to demonstrate the robustness of the method.", "weaknesses": "1. Diverse sampling is a well-known method in active learning [1,2]. Diverse sampling leading to superior performance is not surprising. It indeed improves the performance of OOD models. Critically speaking, the novelty in terms of the method is limited. If the authors could provide some deeper theoretical analysis, e.g., how diverse sampling improves the generalization bound, it would make the paper more solid.\n\n2. There are typos in equation 2. I understand that the authors use a cross-entropy loss. However, equation 2 is just the entropy. $p(y)$ or $y$ is missing inside the expectation.\n\n[1] Ozan Sener and Silvio Savarese. Active learning for convolutional neural networks: A core-set approach. In\nInternational Conference on Learning Representations, 2018.\n\n[2] Jordan T Ash, Chicheng Zhang, Akshay Krishnamurthy, John Langford, and Alekh Agarwal. Deep batch active learning by diverse, uncertain gradient lower bounds. In International Conference on Learning Representations, 2020", "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": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (poster)