Combining Statistical Depth and Fermat Distance for Uncertainty Quantification
Authors: Hai-Vy Nguyen
Fabrice Gamboa
Reda Chhaibi
Sixin Zhang
Serge Gratton
Thierry Giaccone
Venue: NeurIPS 2024 poster (2024)
Keywords: Out-of-distribution
In-distribution
Uncertainty quantification
Fermat distance
Lens depth
Novelty detection
Feature spaces
Deep learning
Primary area: other

Abstract: We measure the out-of-domain uncertainty in the prediction of Neural Networks using a statistical notion called "Lens Depth'' (LD) combined with Fermat Distance, which is able to capture precisely the "depth'' of a point with respect to a distribution in feature space, without any distributional assumption. Our method also has no trainable parameter. The method is applied directly in the feature space at test time and does not intervene in training process. As such, it does not impact the performance of the original model. The proposed method gives excellent qualitative results on toy datasets and can give competitive or better uncertainty estimation on standard deep learning datasets compared to strong baseline methods.

Combining Statistical Depth and Fermat Distance for Uncertainty Quantification
Hai-Vy Nguyen Fabrice Gamboa', Reda Chhaibi", Sixin Zhang Serge Gratton Thierry Giaccone
Ampere Software Technology
2 Institut de mathématiques de Toulouse
Institut de Recherche Informatique de Toulouse
{thierry giaccone, hai-vy. nai-vy..nuuyennaampere cars, freda. chhaibi, fabrice hrrprce..aaaooo/.ma...uutttooooo www.stth.uii--oooouu.e.....
sixin. 2irit)
Abstract
We measure the out-of-domain uncertainty in the prediction of Neural Networks using statistical notion called "Lens Depth" (LD) combined with Fermat Distance, which is able to capture precisely the "depth" of a point with respect to a distribution in feature space, without any distributional assumption. Our method also has no trainable parameter. The method is applied directly in the feature space at test time and does intervene in training process. As such, it does not impact the performance of the original model. The proposed method gives excellent qualitative results toy datasets and give competitive better uncertainty estimation standard deep learning datasets compared to strong baseline methods.
Introduction
We consider multi-class classification problem with the input space X. In general, classification model consists of a feature extractor (backbone) & and a classifier heg fo hg, o 4 where 0 (0,,0) (2) is the set of parameters of the model. The backbone transforms inputs into fixed- dimension vectors in the so-called feature space F. The classifier / then maps the features to predictions. The model fo is trained i.i.d. examples drawn from In-Distribution (ID) Pin Sā denotes the trained model.
OOD detection. Classification by neural networks has proved highly effecttve in terms of precision. However, beside performance, in critical applications, one needs to detect oustof-diisriibttion (OOD)
data for safety reasons. Indeed, the inference stage, the model should only predict for data coming from the ID) and reject OOD samples. For this purpose, one needs to associate a confidence (or uncertainty) score S with these data that can reject uncertain predictions. This is referred as Out-of-domain uncertainty [5]. At the inference stage, x is considered as ID if ((x) 2 (with some threshold IR) and OOD otherwise. We develop method applicable directly in the feature space F of a trained model fg- It yields a score function Sz: S(z) == S>(4) ( e, (#)). The high-level idea to measure directly "how central" a point is with respect to (w.r.t.) clusters taking into account density and geometry of each cluster in the feature space. This provides uncertainty score. For this objective, standard methods consist in assuming some prior distribution such as GDA (Gaussian Discriminant Analysis) based Gaussian fitting [13]. However, the assumption that the data in cluster is Gaussian distributed or follow any particular distribution is quite restrictive. We will show in our experiments section that the Gaussian assumption fails even in a very simple case (Section
38th Conference on Neural Information Processing Systems (NcurIPS 2024).

---

Model trained with distribution (ID) data
Lens depil as Eq. (3.2)
Doy (X) (Features)
Score Eq. (4.2)
hos
Fermat distance as Eg. (4.1)
Classification
(a) Motivation example of two-moons. GDA (left) fails completely cap- ture the distribution of dataset whereas our proposed method (right) represents very well how central a point is w.r.t. clusters without prior assumption.
(b) General scheme of our method. Given set of features + the Fermat distance is metric which respects and adapts to the distribution 26y- Lens depth wraps the Fermat distance into a probabilistic and interpretable score S. No additional supervised training is needed.
Figure 1.1: Motivation example and general scheme our method.
5.1). Let us take the example of a simple frame in the plane with 2 clusters corresponding to 2 classes in form two-moons (Fig. 1.la). In this example, GDA fails totally to capture the distribution of clusters. This motivates to develop non-parametric method that measure explicitly how "central" a point is w.r.t. cluster without the need of additional training and prior assumption. Furthermore, the method should accurately capture distribution with complex support and shape, in order to be adapted to a variety of cases. To measure how central a point is w.r.t. a distribution, the so-called notion of statistical Lens Depth (LD) [15], that will be presented in Section 3.1. Furthermore, for LD to correctly capture the shape of the distribution, an appropriate distance must be adopted that adaptively takes into account its geometry and density. Fermat distance is good candidate for this purpose. However, is not directly tractable as stands on integrals along rectifiable paths. A recent paper [6] proposes the of explicit sampled Fermat distance and shows its consistency property (see also [2]). In our work, we make use of their results to compute the LD. The general scheme is illustrated Figure 1.1b. In our experiments, the classification model is provided by a neural network, h is a softmax layer consisting of a linear transformation and softmax function, F is the output space of the penultimate layer right before the softmax layer.
Consistency of the uncertainty score. A consistent uncertainty score function should allow us to detect OOD. Furthermore, when more samples are rejected based this score, the accuracy of the multi-class classification on the retained samples should increase. In other words, the fewer examples retained (based the score), the better the accuracy. Our method measures natural "depth" of the considered example. Consequently, the larger the depth of this example, the more typical this point is (relative to the training set), and so the easier it for the model to classify.
In summary, our contribution is at the following three levels:
We are bringing to machine learning the mathematical tool of LD, combined with Fermat distance. It proves particularly efficient for OOD uncertainty quantification. We also propose improvements that avoid undesirable artifacts, and simple strategies for reducing significantly the complexity in computing L.D
The method we propose is non-parametric and non-intrusive. We do not have priors on the distribution of data features. We do require modifying the training algorithms.
The method is almost hyperparameter-free as we show that it is rather insensitive the only parameter used define Fermat distance.
Tables 5.1 and 5.2 give benchmarks. Our code can be found LD-experimentt-oode
2 Related Work
Intrusive approaches. One approach to construct a confidence score consists in fine-tuning the model ía using some auxiliary OOD data so that the and OOD data are more separable in the feature space [16]. One may even use very particular type of models and training mechanisms for the original classification task such as Prior Networks in which the prior distribution assumed on the output of the model fo [19]. More laborious methods to handle uncertainty in neural network is

---

Bayesian modeling [17, 4J. Another approach is to train additional models such as Deep Ensembles [9] or LL ratio [23]. In these approaches, one needs to carefully perform supplementary training. Otherwise one could reflect wrongly the true underlying distribution. Moreover, the performance of the multi-class classification task could be impacted. For all these reasons, these methods can be considered intrusive.
Non-intrusive approaches. Independently from above methods, a non-intrusive approach is to work directly in the feature space F of the trained model fg. This is non-intrusive in the sense that there no need of changing the model nor supplementary training. Besides, model performance is not impacted. One of the simplest method is to use the k-nearest neighbor distance [24]. It is simple but has the drawback of ignoring the global cluster geometry and density as it considers only the nearest neighbors. A more sophisticated approach is GDA [13] that uses minimum Mabalanobis distance [18] based on Gaussian prior. Despite taking the distribution into account, Gaussian modeling restrictive as it leads to an ellipsoid for shaping each cluster.
Single forward- -aass pass uncertainty. A popular work which yields uncertainty score in a single forward pass is DUQ [27]. In this method, one needs to train particular models, namely RBF models [12], with some carefully fine-tuned penalty to encourage sensitivity. This makes the training process more difficult, hence impacting negatively the classification performance. [14] proposes SNGP using& distance-aware output layer, based on Gaussian Processes, with Spectral Normalization (SN) in training. Again, these additionnal constrains can decrease the overall performance of model (compared standard softmax model). More recently. [20] proposes DDU, which is based on GDA approach, but one adds SN to encourage smoothness. [7] proposes Nonparametric Uncertainty Quantification (NUQ) using a kernel-based method. Although this method is non non-paraettric, highly dependent on the choice of kernel and the kernel bandwidth.
3 Background
3.1 Lens Depth
Lens depth (LD) [15] is specific notion of a more general quantity called Depth [26]. A depth is score measure of the membership of a point w.r.t. a distribution in a general space. The greater the depth, the more central the point is to the distribution. LD of point w.r.t a distribution P'x is defined as the probability that it belongs to the intersection of two random balls. These balls are centered at two independent random points X and Y, both having the distribution Px and radius equal the distance between X and Y. More formally, if we work on Rd, the LD of a point x e IR w.r.t. Px is defined as follows,
LD(x, x. Px) == P(r E B1 O n2).
(3.1)
Here, D is given distance on R4: X1 are i.i.d with law Px: B(p,r) is the closed ball centered at with radius r; B, = B(X,, D(x,, X1)), i == 2. Let A(X1,X) = B1 o B2. Equation (3.1) naturally gives rise to the following empirical version of LD,
(D) =
11 2
Σ 18 <intn
1 (x)
(3.2)
Note that for the empirical version, the intersection set can be rewritten as
A(X1,X) = {z max D(x, & D2),
(3.3)
1-
Obviously, a crucial question is the choice of the distance D. A naive choice is the Euclidean one. Examples of LD using Euclidean distance are depicted in Fig. 3.1. We see that in the Gaussian case, the level curves of LD rather well capture the distribution. However, for the moon distribution they fail miserably. This is not surprising as the Euclidean distance does not take into account the data distribution Px. This gives rise natural problem as stated by [6]: How learn a distance that can capture both the geometry of the manifold and the underlying density? The Fermat distance allows us solve this problem and it is presented in the following section.
The Mahalanobis distance from a point E R to a given probability Q (with mean i and covariance matrix c (x u).
Y) is defined as d(z, Q) v(z
3

---

(a) Gaussian
(b) Moon
Figure 3.1: LD using Euclidean distance. Using Euclidean distance cannot capture correctly the distribution.
a=)== (b) 1.2
(c)=
ad)
Figure 3.2: Sample Fermat path between two randomly chosen points with different values of c.
3.2 Fermat distance
Following [6], let S be subset of Idd For a continuous and positive function f:S- -.S......... 3 and z, E S, the Fermat distance (I, y) is defined
D Dy,(z, == inf, ins))),()). with TTa(7) f f-P.
(3.4)
The infimum taken over all continuous and rectifiable paths y contained in S, the closure of S, that start at and end y.
Sample Fermat Distance. Let Q non-empty, locally finite, subset of R.d. serving as dataset. |a| denotes Euclidean norm of sQ (xx) Q is the particle closest to in Euclidean distance assuming uniqueness?. For a > and y E IRd, the sample Fermat distance is defined as
(x, = min
15+1 451% (qi....,, ) Q* with ạ = 92(2), 9k = 1Q(1), h: >
1}
(3.5)
The paper [6] shows that the sample Fermat distance when appropriately scaled converges to the Fermat distance. For sake of brevity, we refer Appendix for exact statement. More theoretical insight of Fermat distance and applications to clustering can be found in [25].
Intuition behind Sample Fermat Distance. The sample Fermat distance searches for the shortest path relating the points. The length of each path is the sum of the Euclidean distances of consecutive points the path powered by a. With I, the shorted path between x and y is simply the line relating 9Q gQ(x) and 90 (3) (Fig. 3.2a). However, with sufficiently large a, this definition of path length discards consecutive points with large Euclidean distance instead favoring points that closely positioned in terms of Euclidean distance. So, this will qualify the path passing through high density areas. Moreover, as this distance depends also on the number of terms in the sum in Eq. (3.5), this enforces path to be smooth enough. These two remarks show that Fermat distance naturally captures the density and geometry the dataset.
In Fig. 3.2, we go back to the moon example where Q is moon-shaped cluster of points. We randomly choose 2 points and compute the Fermat path. We that with a 1, we recover the Euclidean distance and so the Fermat path is simply line. For a larger than but not large enough (for instance, a 1.2, Fig. 3.2b), the Fermat path still does not capture the orientation of the dataset. However, as a gets larger, the Fermat path rapidly tracks the orientation of the dataset. For instance, with a 3, the path follows very well the distribution shape.
of course, uniqueness is generically achieved, for example almost surely for random points sampled according diffuse measure.

---

(a) Before
(b) Before
(c) After
(d) After
Figure 4.1: LD with Sample Fermat Distance moon and spiral datascts. (a) and (b) results of using directly sample Fermat distance in Eq. (3.5). This produces undesirable artifacts where observe zones of constant value of LD. This phenomenon explained by Proposition 1. (c) and (d) use our modified version Eq. (4.1): it captures perfectly the distributions.
4
Combining LD and Fermat Distance
4.1 Artifacts from classical Fermat distance
In the computation of the depth, instead of using Euclidean distance, The results for the moon and spiral datasets are depicted in Fig. 4. la and 4.1b. We see that the shape of datasets is much better captured. However, also observe some zones having constant LD value (represented by the same color). The existence of such zones are explained by the following proposition:
sample Fermat distance.
For E RRd. L.D(x) (.(gg(2)). In other words, the empirical lens depth is constant over the Voronoi cells' associated to Q.
Proposition 1.
The proof Proposition is in Appendix E. The consequence of the last proposition is that, even for point far removed from Q, the value of LD remains the same as that of its nearest point in Q. Consequently, LD does not vanish at infinity. This is totally undesirable, depth is to vanish infinity. To avoid this undesirable artifact, we need to modify the sample Fermat distance that it takes into account the distance to Q.
ideal property of any
4.2 Modified Sample Fermat Distance
The modified distance is defined, for E Q, x E IRd as follows:
Diod (x, 3) == min qf + (9.
(4.1)
Here, (q y) has been defined in Eq. (3.5).
Interpretation. In the original definition in Eq. (3.5), the path always starts by the closest point in the dataset. Consequently, the distance to this closest point is totally ignored. To eliminate this drawback, the distance to potential starting point lying in Q is added. Note that the optimization problem for calculating Dmodit is the same type as that for calculating Do.xx with only a change of starting point. Hence, the consistency of this empirical distance towards the theoretical Fermat distance remains true. Indeed, in the new formulation (4. (),, the point q Q is not fixed at qQ (x) but remains free and is part of the optimization problem. Notice further that our modified version enjoys two nice properties. Firstly, if E Q then Eq. (4.1) coincides with Eq. (3.5) (D (x, = D (z, B)). Secondly, Disedit (Ir, v) increases to infinity when is going far away from Q. Consequently, in this case, the corresponding LD w.r.t Q tends to 0. The LD using this modified version of the distance is displayed on two examples Fig. 4.1c and 4.1d. With our modification, the undesirable artifact of constant-valued zone is erased. Furthermore, for points far away from the dataset, T.D tends quickly to O. In conclusion, method captures the shape of distributions perfectly.
4.3 Qualitative evaluation of stability
We experiment and evaluate the stability of our method on the spiral dataset. This is tricky dataset, and standard method like the Gaussian one cannot capture its shape.
Definition of the Voronoi cells in Appendix J.
5

---

(a) LD applying different values of hyperparameter in Sample Fermat Distance. From left to right, e {3, 5, 10, 15). For different values of a, the method always captures really well the distribution.
(b) LD using only 20% of points (200 points) simulated spiral dataset of 1000 points. The contours of LD level changes slightly between different tries, but in general, the proposed method captures well the general shape of distribution.
Figure 4.2: Stability with respect number of training points and cx.
4.3.1 Stability with respect to number of training points
When running a statistical algorithm, it is desirable to have as large sample as possible. However, in many cases, only very small amount of data is available. This motivates the study of the stability of our method in a small data regime. Here, we simulate the spiral dataset with 1000 points. Then, we choose randomly only 20% of the simulated points (i.e. 200 points) as the sample dataset compute LD. We perform different runs for different random samples with a = 5 for a visual evaluation. For the sake of brevity, only the results of four tests are shown in Fig. 4.2b. More replications are displayed in Appendix C. We see that in the tries, our method gives slightly different estimation of L.D. This small fluctuation is to be expected, as we take only 20% of the points random each time. Nevertheless, the method captures the shape of the dataset really well (the full sample of 1000 points also perform
displayed in the figures). Besides, points until the method fails to capture the shape of the distribution. This helps us to have better idea how our method works at small-data regime. We refer Appendix for results.
experiment where we reduce the number of
4.3.2 Stability with respect to the hyperparameter a
In our method, only one hyperparameter (a), governing the Fermat distance needs to be chosen. It is therefore important to assess the stability of the method w.r.t. a. For this purpose, we experiment with different values of a > 1 (recall that = 1 corresponds to the Euclidean distance). For each f3, 5, 10, 15), we test our method on the spiral dataset. Results are shown Fig. 4.2a The conclusion is that our method is very stable through different values of a. Indeed, in the 4 cases, it always captures almost perfectly the dataset support, which implies a strong stability of the method. Of course this stability is only achieved in the proper range when or is large enough (See Fig. 3.2).
4.4 From LD to OOD uncertainty score
Our ultimate objective to use LD to provide an OOD uncertainty score. To do so, we apply LDD to the feature space F of our classification model. Let C be the number of separate clusters. Now, there are two ways for computing LDD of new point: (1) All the clusters are considered as a sole distribution to compute I.D; (2) Compute LD w.r.t. the different clusters and then take the maa among the LD's (i.e. LD w.r.t. the nearest cluster). It turns out that the first approach gives unsatisfying result as explained in Appendix F. So, we adopt the second approach in this paper. More formally, let us denote LD (x)) C.) the empirical LD of w.r.t. the 7th cluster formed by training examples of class i (in the feature space) (i.e. the clustering is given by the labeling as we have labels here). Then, the confidence score of is defined as
S(x) == max LD((())))))
(4.2)
4.5 Computational complexity: the main limitation of L.D and how be more efficient
From Eq. (3.2), can deduce that the complexity of calculating LD for given point is 3 (C is the number of classes, N is number of examples in each class). It is therefore useful to reduce the number of inner points N used to calculate LD while maintaining good precision. Keeping only n inner points among the N' initial ones, we then have 3 different straightforward strategies:
L. Random. Randomly sample without replacement n points among N intial points.

---

II. K-mean/center. We want the points to cover well the support of the initial sample. Hence, we first apply K-mean clustering with n centroids on the N points. Then, the resulted centroids are used as inner points.
III. K-mean/center+. Same as strategy II, but instead of using directly the centroids, we use the inner point closest to each centroid.
We test and discuss about these strategies Appendix G. It turns out that K-mean Center outperforms the two other strategies with very small number of inner points n. We refer to Appendix G for more discussion and detailed experiment. So, for the rest of this paper, we use strategy III.
Experiments on Neural Networks
We first evaluate our method on the two-moon dataset. Then, we evaluate 2 benchmarks TashionMNNSTTMNIIST and CIFAR 10- TinTTmageNNe/CCAAARRRR 100/SVHHNN the ability our method for the detection of OOD. Besides, we also evaluate the consistency property of our uncertainty score as presented in introduction section (shown in Fig. 5.2). Without further mention, we fix a = 7 for all experiments. For fair comparison, we use the same model architectures as in the previous work of [27]. More details about the models and the training schemes can be found in the Appendix B.
5.1 How is the input distribution represented in the feature space of softmax model?
We first perform experiment on the two-moon dataset consisting of 2 classes, each having moon shape. We train a neural network with 2 hidden layers for classification (more details can found in the Appendix B). After training, the model parameters are fixed and different methods for uncertainty evaluation are applied in the feature space F of this model. One popular way to provide an uncertainty score is to the predictive distribution entropy*. It is maximized when the distribution is uniform. In this example, predictive distribution entropy is high only in boundary zone (Fig. 5.1 This is to be expected, the model is trained learn boundary between the two classes. Nevertheless, it is desired to assign a high uncertainty to the region without training data. Indeed, it might be too risky make decision in these zones, especially critical applications.
Is Gaussian prior suitable? We consider the methods of Euclidean distance (Fig. 5.1d) and GDA [13] (Fig. 5.1e). For the Euclidean distance method, compute the distance the centroids of the different clusters (in F) and then we take its minimum. Surprisingly, in this example, the crude use of Euclidean distance seems to better capture the input distribution than GDA (failing miserably on this dataset). This suggests that the distribution of clusters in feature space is more complicated than the Gaussian one. This remark shows the necessity to have method able to capture better the distribution. LD can capture impressively well the zone where we have training data (Fig. 5.1a, 5.1b and 5. corresponding to a 3, 10 and 15). Hence, LD is able pin down clusters with complex support shape in the feature space. Furthermore, we intentionally use 3 values for a with large gaps show the stability w.r.t. a.
(a) LD 3
(b) LD 10 10
(c) LD = 15
(d) Euclidean
(c) GDA (Gaussian) (f) Predictive eniropy
Figure 5.1: Methods for uncertainty estimation applied the same neural net trained to classify 2 classes in moon-shape (represented by yellow and black points respectively). Uncertainty estimations solely on the feature space of the model without sceing directly the inputs. Red represents high uncertainty. Our method (Fig. 5.1a, 5.1b and 5.1c) gives excellent results and much better than other methods.
computed based
5.2 FashionMNIST vs MNIST
We perform five different runs to train classification models on the dataset FashionMNIST [28]. Firstly, we evaluate our method by studying the separation capacity between the test set of FashionMNIST
'The entropy of predicted probability p RC is calculated as (p) = DD Pa log(p:), with XC
1 and 0 & ps 1.
7

---

Table 5.1: Results on FNST. with MNIST as OOD set. Results marked by (0) are extracted from [23] and (A) are extracted from [27]. Deep Ensembles by [9]. Mahalanobis Distance by [13], LL ratio by [23]. DUQ by [27].
Charatericiis
Method
AUROC
LD method)
impact original model
Eaclidean Distance
0.943
Mahalanohis Distance
0.942
Use particular type model difficali train
DUQ (2)
0.955
to main many models
Deep Ensembles (A)
Need to train extra generative models
L1. rabo (2)
0.994
and of MNIST [1I] based on AUROC score. Results are reported in Table 5.1. We first compare our method to Euclidean and GDA method [13]. Notice that our method outperforms these two distance- based methods. A more sophisticated method called DUQ [27] stands devoted neural architecture (RBF network). This particular type of model is much more difficult to train and so generally does not preserve the accuracy of the main classification task (compared to standard softmax models). Once again, our method outperforms this method. This indicates that our method measures natural "depth" directly in the feature space without the need of changing completely the model as in DUQ method. Another popular method is Deep Ensembles in which one trains and applies many independently-trainedd models for the same task. Despite its heavy demanding of resource, our method outperforms this approach in this experiment. A more advanced method for density estimation is LL ratio [23]. In this method, one needs to train two supplementary generative models to estimate distributions. This method needs an adequate noise and really careful training of these 2 generative models so that they can reflect the true underlying input density. With this complex process this method gives better AUROC score than ours in this experiment.
Consistency curve. Following some previous works (e.g. [9]. [27]), we compound test set of FashionMNiST and MNIST together and all the data from MNIST are considered to be incorrectly predicted by the model. Then, certain percentage of data is rejected based their LDD If LD is an appropriate indicator for prediction uncertainty. then accuracy on the retained data has to be an increasing function of the rejection percentage. We call the resulted curve consistency curve. The results for five runs are depicted in Fig. 5.2a. We see that the curves are always increasing over runs. Hence, LD is a good measure for uncertainty estimation.
36
20
29
Fenumape sempler L0
PishicMNNISTANIIST
(b) CIFARIOSVEN
(c) CIFARIOCCIFARIO0
(d) COFARR00Tiny-Iaggee
Figure 5.2: Consistency curves for FashionMNIST/MNIST.. CIFARIO/SVHN, CIFARIO/CIFARI00 and
CIFAR10/Tiny -mage--e over runs (each curve corresponds to an independently trained model).
5.3 CIFARIO vs SVHNTTingllaggeNee/Ciii.
In this section, we compare LD to popular deterministic single- forward pass methods for uncertainty quantification (UQ). We also compare with Eneembbe, as stays a de facto method for UQ We train the models on the training set CIFAR10 100 [8] and then the test set of CIFAR16 10 is considered as
in-distribution (ID) data. We use test sets of datasets SVHN [21], CIFAR 100 and Tiny-mmageNet [10] as OOD data. AUROC scores are reported in Table 5.2. We first compare LD with GDA using ResNet18 (the first two lines). We see that LD consistently outperforms GDA on OOD sets. Next, we compare our method with DDU [20]. This method is basically GDA but one adds spectral normalization (SN) in the model. Using ResNetl8, our method outperforms on CIFAR 100 and SVHN. An interesting remark is that using SN seems to improve AUROC on CIFAR 100 and SVHN. This is expected as SN encourages more smoothness. However, for Tiny-ImageNer AUROC gets worse using SN. That is, somehow SN makes the features of TinyImageNet closer to those of CIFARIO. Using WideResNet, DDU seems to be a little better than ours on CIFAR 100 and SVHN but NinylmagNet, method is better. Next, we compare LD with DUQ. Our method consistently
Seee Appendix H for more details.
8

---

outperforms DUQ on all the benchmarks. Besides, our method also ouiperforms energy- based method [16]. Considering the method SNGP [14]. is based on a Gaussian process layer with SN, making itself a very intrusive method. In spite of this, LD outperforms this method on the two pairs CIFAR CeeTTin--maggeee and CIFAR TO/CIFAR 100. On CIFAR 10/SVNN, this method performs a little better than ours. Finally, we observe that Deep Ensemble (with 5 models) seems to perform very well on the 3 pairs. This is to be expected, as it uses 5 models instead of one single model. However, surprisingly, on CIFAR 1o/Tinn-ImaaeeeCC LD outperforms this latter method.
Besides, to see our method scales well when number of classes of ID data increases, we also experiment with CIFAR100 as ID data. The results are shown in Fig. 5.3. Overall, through experiments with CIFARIO and CIFARI00 as ID data, we see that our method performs very well and outperforms many strong baseline UQ methods. This proves that LD is useful tool to capture the underlying distribution to provide an OOD uncertainty score.
Consistency curve. We plot the consistency curves over the 5 runs as in Section 5.2 for 3 pairs (Fig. 5.2b, 5.2c and 5.2d). Once again, accuracy is always an increasing function of the rejected percentage of the data based on LD. This confirms again that LD is an appropriate indicator for uncertainty estimation and it useful for decision making.
Table 5.2: Results on CIFARIO with Imny-ImageNet, CIFARI00 and SVHN as OOD sets, SN: Spectral Normalistion,, JP: Jacobian Penalty.
Somrre
Method
Model
Penaity
AUROC Tiny-InagsNee
CIFARIN
AUROC SVHN
OUES
LD (ours)
ResNer188
No
0.965 20.003
0.892 0.892200.00
0.93610.000
GDA ([13))
ResNe118
No
0.945
0.864
0.91410.014
ResNei18
SN
0.927
0.900
0.950
DDU (GDA SND ((20))
ResNei18
SN
0.937=0.000
0.872+0.005
0.947
[27]
DUQ (277))
ResNet18
JP
0..073
0UES
LD (ours)
Wide Re-Net 10
SN
0.926
0.906
0.939
[20)
DDU (GDA ((20))
Nede-ReeNet-26110
SN
0.9107 0000
0.91 +0.000000004
0.979
[20]
DUQ ([27))
0.868
0.859+0.000
0.937=10.00
[20]
SNGP (TI4D
Wide Res-RReNNNe-UU 10
SN
0.89940.000
0,911
0.940
[20]
Energy- ((16))
Nede-ReeNet22-110
0.881 00000
0.889=0.000r
0.045
[20]
5-Fosemble (I9I
Wede-ResNett22-10
0.9006
0.921=0.00m
0.000
Table 5.3: AUROC score with CIFARIOM 100 as ID data and Tiny-Imaget OOD data. Results of other methods
are extracted from [20] where all the methods were experimented the same Wide-ResNet-28-100 28- model.
Method
AUROC
LD (ours)
0.831020.0013
Softmax Entropy
0.815320.000s
Energy-based
0.813320.0000
SNGP
0. 0.788520.0004
DDU
0.831320.00m
5- Finsemble
U.8295
5.4 On the limitations of the Gaussian assumption: LD vs GDA
In Table 5.2, we see that in some cases, GDA performs a little better than LD. Does this mean the distribution in the feature space is Gaussian? In fact, if the OOD set is sufficiently far from the ID one, then OOD data lies outside the smallest ellipsoid containing the ID data. In this case, Gaussian fitting can perfectly separate ID and OOD, even if the distribution is not Gaussian. That is, good AUROC score by GDA does not necessarily imply that the distribution is Gaussian. However, if OOD and ID sets get closer, sharper detection boundaries between ID and OOD data become necessary.
To assess this, we perform an experiment with OOD more similar to ID data, thanks to hold-one-out experiments. For each of the two datasets MNIST and CIFAR1O, we train model on the 9 classes and hold out one class as OOD data. this way, ID set more similar to OOD one as they come from the same dataset. Results are shown in Table 5,4 5.4. In this setup, the gap in terms of AUROC score

---

between LD and GDA is much larger than in Table 5.2. As such, LD seems to be adaptively finding a sharper boundary than the Gaussian method. This is to be expected, as the boundaries obtained from Gaussian fitting are necessarily elliptical.
Table 5.4: AUROC score for OOD data that are close ID data
Data pair
Hold-one-out MNIST
Hold-one-out CIFARIO
LD (ours)
0. 0.009
0. 0.806g0.015
GDA
-0.08
0.759-0.032
6
Discussion
As one property of Fermat distance is being able to adapt itself to the manifold, one could think of alternative methods following manifold learning literature. However typical methods in manifold learning do not have the property of yielding shorter distances in high density areas. Moreover, LD allows the choice of any distance, unlike other typical depths (Half-space depth or Simplicial depth...). As such, the choice of combining LD with Fermat distance is synergistic and not independent at all.
The main advantage of method is that we make no prior distribution assumption. However, there are still extreme cases where our method would not work well. Indeed, let us consider the case where there is class with 2 clusters in the feature space. From theoretical viewpoint, for the Fermat distance to be well defined, it is crucial for the density I to remain bounded from above and away from zero- see Appendix A. Hence, in between clusters, density". However, from practical viewpoint, in such cases, one could argue that 2 clusters of the same class should not be too distinct. Indeed, if the main model in trained to classify properly, semantically similar inputs should be close to each other, leading to connected clusters for each class. But in general, the cluster of each class should be sufficiently connected to yield an ideal result. This also explains why we propose to work in the feature space instead of using directly raw data points. Indeed, feature spaces help us to extract the low dimensionality of the data more efficiently at a semantic level, and to have proper clusters in the feature space.
need "very small density" but not "zero
Besides, note that the aim of LD is to measure the Out-of-domain uncertainty, which is due to zones in feature space that are scarce in data. As the model is not trained in these zones, one should be cautious with the model's predictions on these zones as can behave very randomly due scarcity of training data. Consider for example the two-moons experiment where the two moons have more spread (and even overlap). In such cases, we have enough data in the zone between the 2 classes. Hence, LD should not be able to detect the uncertainty in this case. Other metrics such as predictive entropy should be a good candidate in this case.
Finally, an interesting use case is to apply our method on pre- pre-trained models. This is because SOTA models become often too large to retrain ourselves. If we have no idea about the data distribution, we are convinced that our method should be a useful tool, at least as a starting point, for better understanding the data scarcity in feature space.
7 Conclusion
In this work, we use Lens Depth combined with modified version of the sample Fermat distance. This combination captures naturally the shape and density of the input distribution. This not the case with many previously proposed methods, which assume a prior distribution or use additional models with trainable parameters, or even modify the mechanism of the training process. Our method is non-parann con-parametric and non-intrusive. Through toy dataset as well as experiments conducted on Deep Neural Networks, we show that our method adapts very well to many cases. Hence, our work opens new venues for non-parametric methods capturing the input distribution to quantify uncertainty in the context of Deep Learning. For future work, it would be interesting both to have an efficient algorithm for computing Lens Depth with some error bound and to mathematically investigate the impact of the hyper-paramede a. Finally notice that, while we were focused on neural networks, any classification model with feature space, e.g. kernel methods, can benefit from our framework.
10

---

detection. Advances in Broader impact statement
Our Out-of-Disttribee (OOD) uncertainty quantification holds implications for enhancing safety in critical applications. By effectively addressing uncertainty beyond the training data, our approach contributes robust serision-making particularly in scenarios where reliability crucial. Moreover, our method can play role in ensuring fairesss by recognizing and mitigating potential biases that may arise when the training data lacks sufficient representation.
References
[1] Aurenhammer. Voronoi diagrams- survey fundamental geometric data structure. ACM Computing Surveys (CSUR), 23(3):345-405, 1991.
[2] A. Cholaquidis, R. Fraiman, F. Gamboa, and Moreno. Weighted lens depth: Some applica- tions to supervised classification. Canadian Journal of Statistics, 51(2):652-673, 2023.
[3] T. DeVries and G. W. Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint
04552,, 2017.
[4] Y. Gal et al. Uncertainty in deep learning. 2016.
[5] J. Gawlikowski, C. R. N. Tassi, M. Ali, J. Lee, M. Humt, J. Feng, A. Kruspe, R. Triebel, P. Jung, R. Roscher, et al. A survey of uncertainty deep neural networks. Artificial Intelligence Review, 56(Suppl 1):1513-1589, 2023.
[6] Groisman. M. Jonekheere, and F. Sapienza. Nonhomogeneous euclidean first-aassaee percolation and distance learning. Bernoulli, 28(1):255 2022.
[7] N. Kotelevskii, A. Artemenkov, K. Fedyanin, F. Noskov, A. Fishkov, A. Shelmanov, A. Vazhent- sev, A. Petiushko, and M. Panov, Nonparametric uncertainty quantification for single determin- istic neural network. Advances in Neural Information Processing Systems, 35:36308-36325 2022.
[8] A. Krizhevsky, V. Nair, and G. Hinton. Cifar-10 (canadian institute for advanced research).
[9] B. Lakshminarayanan, A. Pritzel, and C. Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems, 30, 2017.
[10] Y. Le and X. Yang. Tiny imagenet visual recognition challenge. CS 231N, 7(7):3, 2015.
[11] Y. LeCun. The mnist datahase of handwritten digits. http://yann. lecun. com/exdb/nnist// 1998.
[12] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient- baadie learning applied document recognition. Proceedings of the IEEE, 86( (1 1):2278-2222 2324, 1998.
[13] K. Lee, K. Lee, H. Lee, and Shin. A simple unified framework for detecting distriiittii samples and adversarial attacks. Advances in neural information processing systems, 31, 2018.
[14] J. Liu, Z. Lin, S. Padhy, D. Tran, T. Bedrax Weiss, and B. Lakshminarayanan. Simple and principled uncertainty estimation with deterministic deep learning via distance awareness. Advances in neural information processing systems, 33:7498-7512, 2020.
[15] R. Y. Liu. On notion of data depth based random simplices. The Annals of Statistics, pages 405-414, 1990.
[16] W. Liu, X. Wang, J. Owens, and Y. Li. Energy-based neural information processing systems, 33:21464-21475, 2020.
[17] D. J. C. MacKay. A practical bayesian framework for backpropagation networks. Neural Computation, 4:448-472, 1992.
[18] C. Mahalanobis. On the generalized distance statistics. Sankhyā: The Indian Journal of Statistics, Series A (2008-), 80:S1-S7, 2018.

---

[19] A. Malinin and M. Gales. Predictive uncertainty estimation via prior networks. Advances in neural information processing systems. 31, 2018.
[20] Mukhoti, A. Kirsch, van Amersfoort, H. Torr, and Y. Gal. Deep deterministic uncertainty:
A new simple baseline. In Proceedings of the IEEE/CVF Conference Computer Vision and Pattern Recognition, pages 24384 24394, 2023.
[21] Y. Netzer, Wang, A. Coates, A. Bissacco, B. Wu, and A. Y. Ng. Reading digits in natural images with unsupervised feature learning. 2011.
[22] Pedregosa, G. Varoquaux, A. Gramfort, Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and Duchesnay. Scikit-learn: Machine learning Python. Journal of Machine Learning Research, 12:2825-288 2830, 2011.
[23] J. Ren, J. Liu, E. Fertig, J. Snoek, R. Poplin, M. Depristo, J. Dillon, and B. Lakshminarayanan. Likelihood ratios for -itto--diitribttion detection. Advances neural information processing systems, 32, 2019.
[24] Y. Sun, Y. Ming, X. Zhu, and Y. Li. Out-of-distribution detection with deep nearest neighbors. In International Conference on Machine Learning, pages 20827-20840. PMLR, 2022.
[25] N. G. Trillos, A. Little, D. McKenzie, and J. M. Murphy. Fermat distances: Metric approx- imation, spectral convergence, and clustering algorithms. arXiv preprint arXiv:230.005750, 2023.
[26] J. W. Tukey. Mathematics and the picturing of data. In Proceedings of the International Congress of Mathematicians, Vancouver, 1975, volume 2, pages 523 223-531, 1975.
[27] Van Amersfoort, L. Smith, W. Teh, and Y. Gal. Uncertainty estimation using a single deep deterministic neural network. In International conference machine learning, pages 9690-9700. PMLR, 2020.
[28] H. Xiao, K. Rasul, and R. Vollgraf. Fashion-mnist: novel image dataset for benchmarking machine learning algorithms, 2017.
12

---

A Convergence of rescaled Sample Fermat Distance to Population Fermat Distance
Theorem 2.3 in [6] proves convergence of rescaled sample FD to population FD, with rescaling n with 3 = (a 1)/d. More precisely, there exists a constant fl such that
lim nº ( y) pD 5,s(, R-+00
when the samples Qn = (X1, X2,...) are sampled either as n i.i.d. with density f or as a Poisson point process with intensity n.f. It is crucial for f to remain bounded from above and away from zero.
B Experimental Details
All experiments related neural networks are implemented in Pytorch /cuda, with its default initialization.
B.1 Two-moons
For generating two-moon dataset, we use package seikit-lcarn [22], with noise 0.07, random state and 1000 samples.
For model, we construct simple fully connected network with hidden layers, each gives output of dimension 20. First hidden layer is followed by non-linearity ReLU. We train model for 160 epochs using Adam optimizer, learning rate 10-3, other parameters set by default of Pytorch package.
B.2 MNSH
For fair comparison, we follow exactly the same CNN architecture proposed in [27] and the same training scheme with only one minor modification: the dimension of penultimate layer 25 instead of 256 for efficient computation related to LD. We observe this modification has no impact on accuracy of model. We refer reader to [27] for details. From training set, we randomly split 80:20 to have training data and validatation. We choose the best model based on accuracy on validation set. Test accuracy after training over runs 92.35% 0.19.
For estimating LD, we use 1500 training examples for each class based on results of the experiment in Section G. We observed that applying the method on normalized feature vectors (L2-norms) (which the reported result) gives slightly better result than applying directly on the feature vectors. The method is applied on the test set of MasHionMNIST consisting of 10,000 images and the test set of MNIST also consisting 10,000 images).
B.3 CIFAR10
For ResNet18 without spectral normalization (SN), with a minor modification and training scheme of the same authors. More specifically, after Global Average Pooling layer of CNN, add layer of output dimension of 25 instead of 256 proposed by [27] before softmax layer. For training model, we use SGD optimizer with nesterov momentum, learning rate 0.1 (decayed by factor of 5 at epochs 60. 120 and 160), momentum 0.9, weight decay 3-oeel set) and save the last model, i.c. the model epoch 200. Test accuracy after training over 5 runs is 0.950 + 0.001.
ResNet-18 18 model implemented by [3]
5- 100 Model is trained for 200 epochs. We train model on the full training set (i.c. no validation
For ResNet18 and ReseeRee 10 with SN, proposed in [20] for fair comparisons. We refer readers to the concerned paper for details.
exactly the same model and training scheme
CIFAR10/SVHN: As there are many more images to test compared to the previous experiment, we use only 1000 training images in each class for estimate L.D using K-mean/Center strategy to have reasonable run time. We tested the method normalized and non-normalized feature vectors and
13

---

observed no significant difference. The reported result is on non-normalized vectors, Notice that the method is applied on sets of CIFARIO consisting 10,000 images and of SVHN consisting of 26,032 images.
only 500 points for each class to evaluate LD. We observe that increasing number of points for more than 500 points gives no significant improvement.
KIFAR10/innyImageee and CIFARIO/CIFARIO0
As [27], at test time, we use the statistics (mean and standard deviation) the training set (i.e. FashionMNIST CIFARIO in our case). Indeed, these statistics used both in the Batch normalization layers and the data normalization process (both for OOD and for ID set).
B.4 Hold-one-out MNIST and CIFAR1O
We training models on the hold-one-out MNIST and CIFARIO. Hence, each training set is now of 9 classes. We perform 5 runs for each set and evaluate AUROC score using LD and GDA. The model and training scheme for hold-one-out MNIST is exactly the same as in Appendix B.2. The model and training scheme for hold-one-out CIFARIO is exactly the same as in Appendix B.3. For evaluate LD, we use 500 points for each class.
B.5 Models with Spectral Normalization
We train ResNet18 with SN (for CIFARIO) and WideResNet with SN (for CIFARIO0) using the code provided by [20].
To evaluate LD on CIFAR we apply directly on the training set of CIFAR 100, as have only 500 training examples for each class.
C More qualitative results of Fermat Lens Depth on spiral dataset using 20% points
We LD using only 20% of points (200 points) simulated spiral dataset of 1000 points over 10 runs for qualitatively evaluating stable of the method w.rt. number points.
points.Results Results in Fig.C.1.
(a) 1d try
(b) gnd try
(c) 3rd try
(d) 4 try
(e) 5th try
(f) th try
(g) 7th
(h) th try
(i) 9th try
(i) 10 try
Figure C.I: LD using only 20% of points (200 points) on simulated spiral dataset of 1000 points over 10 runs. We see that the contours of LD level changes slightly between different tries, but in general, the proposed method captures well the general form of distribution. Note that the points presented in the plot are the full dataset of 1000 points.
14

---

D More qualitative results of Fermat Lens Depth on spiral dataset using a portion of point until failing
We perform an experiment where we reduce the number of points until the method fails to capture the shape of the distribution. This helps us to have a better idea how our method works at small-data regime. The results are shown in Fig. D.I.
(a) 200 randomly sampled points (20% of original points)
(b) 100 randomly sampled points (10% original points)
(c) 80 randomly sampled points (8% of original points)
(d) 60 randomly sampled points (6% of original points)
(e) 50 randomly sampled points (5% of original points)
Figure D.1: LD using only a certain portion of points until LD fails to capture the shape of the distribution. Each row represents fixed percentage,for for which performs 5 independent runs. Notice that the points displayed on the figure is the full dataset of 1000 points, so that we can observe how well LD captures the original data distribution. Please also note that randomly sample small portion of the original points. Hence, the sampled points be concentrated sampled points can represent not very correctly original distribution. Therefore, it not surprising that LD fails to capture the original support at around 5 6% the original size. (Note that we use 20% for results in F.g.4.2.b in the main paper.)
small region instead of being distributed along the spiral. So, the
E Proof of Proposition 1
Proof. By definition, (({(=)) q(x) and q(v) as g(z), y E Q, the closest point to them in Q is themselves. Hence, according to Eq.3.5, it is obvious that DQ (2, v) DQ v), Vr e Rd and E Q. Applying this sample Fermat distance to 3.2 to compute empirical LD, we obtain LD(x) LD(g(z)).
15

---

F
One or multiple clusters?
Our ultimate objective to use LD for finding out-of-distribttion data associated with an uncertainty (or equivalently confidence) score. For this purpose, we apply LD in feature space of softmax model. More concretely, we apply in the activation of penultimate layer right before softmax layer. this setup where have different separate clusters, one important question is: Can simply consider them as one distribution for computing LD?
To answer this question, we simulate dataset composed of separate Gaussian clusters and then we compute LDD w.r.t this dataset by consider them as one distribution. The result is shown Fig.F. la. We see that the result is not good: value of T.D is large for zones lying between clusters whereas in this case, we want LD to large only in 3 cluster and NOT the zones lying between them. So, the solution for this problem is quite straightforward: we compute LD of points w.r.t different clusters, than the final LD of that point is considered as its LD w.r. to the closest cluster, i.e. we take the max among computed LD's. The result is shown in Fig.F.I.. We see that the result now is much bette: LD is only large in the zones dataset which are clusters.
(a) Consider clusters as(b) Max of LD w.nt dif- one distribution
ferent clusters
Figure F.1: LD computed by 2 ways: (a)Consider clusters distribution w.r.t which one compute LD and (b) Compute LD w.r.t separate clusters than final LD is computed as the max among the LDD's computed
G Effectiveness of Reduced Lens Depth
In this section, we evaluate the effectiveness of the strategies discussed in Section 4.5 to reduce the computing complexity of T.D. We evaluate the quality of each strategy by measuring how well the ID can be separated from OOD set in term of the AUROC metric The pair FashionMNISTMMNISTT is used to assess the suitability of the three strategies. This pair is much more difficult to handle than MNIST/NOtMNISST as argued in previous works (e.g. [27]). For each strategy, we use {500, 1000, 1500} points for each class (each class contains 6000 training examples), Results are reported Table G.I. In all cases, strategy II always gives the best result. Remarkably, with only 500 points, K-mean / Center is already better than the two other strategies with 1500 points. K-mean / Center has regularization effect from averaging points (for calculating centroids). We conjecture that this effect makes the method much more stable, and also facilitates the capture of the overall shape of the cluster by avoiding certain irregular points that could have a negative impact on the estimate of L.D.
Moreover, as number of points are increased from 500 to 1500, we observe no significant improvement in AUROC score. This reinforces our conjecture about the impact of irregular points estimation of LD and furthermore, this remark implies that the n chosen points cover well enough the initial space occupied by the N original points, then only need to choose very small percentage of points for good estimation of LD. So, for the rest of this paper, we use strategy K-mean Center.
Finally, we note that this could lead to some change in the original density. However, at the end, our objective to measure how "central" a point w.r.t. our data and only LD matters. So, our motivation for using reduced methods is to find a configuration of points that cover well the support of the original data. this the case, even if there change density, the change of L.D is minimal
'AUROC is equal to when the data perfectly separable.
16

---

Table G.I: Comparing AUROC performance strategies for reducing complexity of LD Fashion- MNIST/MNIST
No. TRAINING EXAMPLES
500
1000
1500
I. RANDOM
0.9368
0.9426
0.94366
II. K-MEAN CENTER III. K-MEAN CENTER+
0.9543
0.9548
0.9553
0.9475
0.9536
0.9537
and the ordering points by LD is not really impacted. That is, points that are "central" will remain with large LD and points near the the frontier of the original support should still have small value of LD.
H LL ratio method
In this method, instead of using directly the main model, needs train supplementary generative models to estimate distributions. A first model is trained on ID data and a second one trained on perturbed imputs. So that, the second model captures only the background statistics. Under suitable assumptions, authors show that the ratio between these two likelihoods cancels out the background information. Consequently, the LL ratio focuses on the semantic part of the input and so can be used as score to distinguish ID from OOD data. This method needs an adequate noise in way that the perturbed inputs contain only background information. This process itself is complicated as we need some supplementary dataset to choose the noise. Moreover, one needs to really carefully train these generative models so that they can reflect the true underlying input density.
Rejection curve for In-distribution Data of CIFAR10
We only test set of of CIFAR10, i.e. in-distribution data to evaluate consistency curve. Result in Fig. 1.1. As expected, the curve increasing, which implies that LD consistent indicator for confidence level.
1.00
Arcuracy en retained data
0.96
0.95
0
10
20
30
40
50
60
70
80
Percentage of samples rejected (96)
Figure I.1: Rejection curve CIFARIO over runs (each curve corresponds to an independently trained model).
Voronoï cells
Suppose we have finite number of distinct points in the plane, referred as sites, seeds generators. Each seed has a corresponding region, called a Voronoi cell, made up of all the points plane closer to that seed than to any other. We refer to [1] for more details.
17

---

NeurIPS Paper Checklist
1. Claims
Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
Answer: [Yes]
Justification: The abstract and introduction clearly state the claims made, including the contributions made in the paper and important assumptions.
Guidelines:
The answer NA means that the abstract and introduction do not include the claims made in the paper.
The abstract and/or introduction should clearly state the claims made, including the
contributions made in the paper and important assumptions and limitations. A No or
NA answer to this question will not perceived well by the reviewers.
The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
It is fine to include aspirational goals as motivation as long it is clear that these goals are not attained by the paper.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors? Answer: [Yes]
Justification: the main limitation of our method is the computational complexity compared standard methods clearly shown in Section 4.5. However, proposed method to reduce the complexity.
Guidelines:
The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
The authors are encouraged to create a separate "Limitations" section in their paper.
The paper should point any strong assumptions and how robust the results are violations of these assumptions (e.g.. independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
The authors should reflect on the factors that influence the performance of the approach. For example, facial recognition algorithm may perform poorly when image resolution low or images are taken in low lighting. Or speech-to-text system might not be used reliably provide closed captions for online lectures because it fails to handle technical jargon.
The authors should discuss the computational efficiency of the proposed algorithms
and how they scale with dataset size.
If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.
While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an impor- tant role in developing norms that preserve the integrity of the community, Reviewers will be specifically instructed to not penalize honesty concerning limitations.
3. Theory Assumptions and Proofs
Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?
Answer: [Yes]
Justification: For each theoretical result, the paper provides the full set of assumptions and complete proof.
Guidelines:
The answer NA means that the paper does not include theoretical results.
18

---

All the theorems, formulas, and proofs in the paper should be numbered and cross
referenced.
All assumptions should be clearly stated or referenced in the statement of any theorems.
The proofs can either appear in the main paper or the supplemental material, but they appear in the supplemental material, the authors are encouraged to provide short proof sketch to provide intuition.
Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
Theorems and Lemmas that the proof relies upon should be properly referenced.
4. Experimental Result Reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results of the paper to the extent that affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided not)?
Answer: [Yes]
Justification: the paper fully discloses all the information needed reproduce the main experimental results of the paper.
Guidelines:
The answer NA means that the paper does not include experiments. If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
If the contribution is dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
While NeurlPS does not require releasing code, the conference does require all submis- sions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
(a) If the contribution is primarily a new algorithm, the paper should make clear how to reproduce that algorithm. (b) If the contribution is primarily new model architecture, the paper should describe the architecture clearly and fully.
(c) If the contribution is a new model (e.g., a large language model), then there should either be way to access this model for reproducing the results or way to reproduce the model (e.g., with an open-source dataset instructions for how to construct the dataset).
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome describe the particular way they provide for reproducibility. the case of closed-source models, it may be that access to the model limited in some way (e.g., registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results. 5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions to faithfully reproduce the main experimental results, as described in supplemental material?
Answer: [Yes]
Justification: the paper provide open access to code.
Guidelines:
The answer NA means that paper does not include experiments requiring code.
Please see the NeurlPS code and data submission guidelines (https://nips.ce)
cyy for more details.
19

---

reproducible, they While we encourage the release of code and data, we understand that this might not be possible, so "No" an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for new open-source benchmark).
The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https:
/nips.cccpubll11 wwtppbcic/ppcpeccccccccccccccccp c/guidgg//////e/eeec "CodeSubmiss wwwaimissinooiioiiiiiiioom
for more details.
The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only subset of experiments should state which ones are omitted from the script and why.
At submission time, preserve anonymity, the authors should release anonymized versions (if applicable).
Providing much information possible in supplemental material (appended the paper) is recommended, but including URLs to data and code is permitted.
6. Experimental Setting/Details
Question: Does the paper specify all the training and test details (e.g., data splits, hyper- parameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
Answer: [Yes]
Justification: the paper specifies all the training and test details. Guidelines:
The answer NA means that the paper does not include experiments.
The experimental setting should be presented the core of the paper to level of detail
that is necessary to appreciate the results and make sense of them.
The full details can provided either with the code, appendix, or as supplemental material.
7. Experiment Statistical Significance
Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
Question:
Answer: [Yes]
Justification: the results are accompanied by confidence intervals over different independent runs.
Guidelines:
The answer NA means that the paper does include experiments.
The authors should answer "Yes" if the results are accompanied by error bars, confi-
dence intervals, statistical significance tests, least for the experiments that support the main claims of the paper.
The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall
run with given experimental conditions).
The method for calculating the error bars should be explained (closed form formula,
call to a library function, bootstrap, etc.)
The assumptions made should be given (e.g., Normally distributed errors).
should be clear whether the error bar is the standard deviation or the standard error of the mean.
is OK to report I-sigma error bars, but one should state The authors should preferably report a 2-sigma error bar than state that they have 96% CI, if the hypothesis of Normality of errors is not verified.
For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out range (e.g. negative error rates).
If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
8. Experiments Compute Resources
Question: For each experiment, does the paper provide sufficient information on the puter resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?
20

---

Answer: [No]
Justification: we have provided theoretical complexity of our method. Hence, the execution time can be easily deduced from the performance parameters of devices.
Guidelines:
The answer NA means that the paper does not include experiments.
The paper should indicate the type of compute workers CPU or GPU, internal cluster,
or cloud provider, including relevant memory and storage.
The paper should provide the amount compute required for each of the individual experimental rums well estimate the total compute.
The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).
9. Code Of Ethics
Question: Does the research conducted in the paper conform, in every respect, with the etti:i///ttiiiiiiieeeeee
NeurlPS Code of Ethics https: /tt////uuurra meurips.....
Answer:
[Yes]
Justification: have reviewed the NeurlPS Code of Ethics.
Guidelines:
The answer NA means that the authors have reviewed the NeurIPS Code of Ethics.
If the authors answer No, they should explain the special circumstances that require deviation from the Code of Ethics.
The authors should make sure to preserve anonymity (e.g.. if there is special consid- eration due to laws or regulations their jurisdiction).
10. Broader Impacts
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
Answer: [Yes]
Justification: we have discussed about the broader impact of our paper.
Guidelines:
The answer NA means that there is no societal impact of the work performed.
If the authors answer NA or No. they should explain why their work has no socictal
impact why the paper does not address societal impact.
Examples of negative societal impacts include potential malicious or unintended uses
(e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deploymmen of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
The conference expects that many papers will be foundational research and not tied partieular applications, let alone deployments. However, if there is direct path to any negative applications, the authors should point it out. For example, it is legitimate point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly. harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional unintentional) misuse of the technology.
If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).
11. Safeguards
Question: Does the paper deseribe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)? Answer: [NA]
Justification: the paper poses such risks.
Guidelines:
The answer NA means that the paper poses no such risks.
21

---

Released models that have high risk for misuse or dual use should be released with necessary safeguards to allow for controlled use of the model. for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make best faith effort.
12. Licenses for existing assets
Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
Answer: [NA]
Justification: the paper does not use existing assets.
Guidelines:
The answer NA means that the paper does use existing assets.
The authors should cite the original paper that produced the code package or dataset.
The authors should state which version of the asset used and, possible, include URL.
The name of the license (e.g., CC-BY 4.0) should be included for each asset. For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswi thcode. com datasets has curated licenses for some datasets. Their licensing guide can help determine the license dataset.
For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. If this information is not available online, the authors are encouraged to reach out to the asset's 's creators.
13. New Assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [NA]
Justification: the paper does not release new assets. Guidelines:
The answer NA means that the paper does release new assets.
Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
The paper should discuss whether and how consent was obtained from people whose asset is used.
At submission time, remember to anonymize your assets (if applicable). You can either create anonymized URL or include an anonymized zip file.
14. Crowdsourcing and Research with Human Subjects
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well details about compensation (if any)?
Answer: [NA]
Justification: the paper does not involve crowdsourcing nor research with human subjects. Guidelines:
The answer NA means that the paper does not involve crowdsourcing research with
human subjects.
Including this information in the supplemental material is fine, but if the main contribu- tion of the paper involves human subjects, then as much detail as possible should be included in the main paper.
22

---

According to the NeurlPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
Answer: [NA]
Justification: the paper does not involve crowdsourcing nor research with human subjects. Guidelines:
The answer NA means that the paper does not involve crowdsourcing research with
human subjects.
Depending the country in which research is conducted, IRB approval (or equivalent)
may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors adhere the NeurIPS Code of Ethics and the guidelines for their institution.
For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
23


Reviews:
[{"review_id": "nNB38bq8Z1", "reviewer": "Reviewer_exfg", "summary": "The authors address the problem of out of distribution detection in supervised learning with particular focus on neural networks models. The developed method worj in some feature (embedding) space by measuring the statistical depth of the query point with respect to some reference set of points. The particular implementation combines lens depth function with Fermat distance. The authors validate the proposed approach in a series of experiments on simulated and real-world data.", "questions": "1. Why Lens Depth was chosen and not other statistical depth functions like Half-space depth, Simplicial depth, ...\n2. Why Fermat distance was chosen? One can consider many alternatives. For example, following manifold learning literature one can consider kNN graph constructed with Euclidean distance over embeddings and then computing shortest paths over the resulting graph.\n3. Can you clarify how you implemented \"GDA\"-based methods? Did you use Mahalanobis distance or GMM-density?\n4. Why didn't you do the experiments with more complex datasets? Is it due to high computational of LD + Fermat distance approach?\n5. Have you tested effectiveness of reduced LD on more complex dataset than MNIST? Apparently, more complex models may lead to more complex embedding structure and require more points for approximation.", "limitations": "Limitations are adequately addressed", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "* The paper is very well-written and easy to follow.\n* The considered problem is relevant for practice as there is a significant demand in efficient and non-intrusive methods for uncertainty quantification. \n* The proposed approach is solid with all the steps being properly motivated.\n* The authors did a significant effort to do a comprehensive literature review, experimental evaluation and analysis, though all the steps were not fully successful (see Weaknesses and Questions below).\n\n[After rebuttal comment] I appreciate the answer by the authors and increase my score to 6. My main concerns were addressed.", "weaknesses": "* While usage of statistical depth functions and distribution/manifold related distances looks logical, it is not clear why the particular choices of Lens Depth and Fermat distance were made.\n\n* The baselines considered are not comprehensive enough and some of the baselines are not interpreted correctly by the authors of the present paper. In particular:\na. Non-Gaussianity of embedding distribution was directly considered in [1] aiming to improve over GDA. I think that is worth comparing with this method as the present paper target the same issue though with the completely different approach.\nb. I believe that the authors incorrectly say that the difference between papers [2] and [3] is only in usage of spectral normalization. In my opinion, even more important is that [2] uses Mahalanobis distance as uncertainty measure while [3] considers the density of Gaussian mixture instead.\n\n* The experiments are done with relatively simple datasets like CIFAR-10 for in-distribution data and SVHN/CIFAR-100/TinyImageNet as OOD. With the proposed approach being relatively lightweight, it is not clear why not to consider CIFAR-100/ImageNet as in-distribution with corresponding OOD choices (like ImageNet-R or ImageNet-O as OOD for ImageNet).\n\nReferences \n[1] Kotelevskii, Nikita, et al. Nonparametric uncertainty quantification for single deterministic neural network. Advances in Neural Information Processing Systems 35 (2022): 36308-36323.\n[2] K. Lee, K. Lee, H. Lee, and J. Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. Advances in neural information processing systems, 31, 2018.\n[3] J. Mukhoti, 362 A. Kirsch, J. van Amersfoort, P. H. Torr, and Y. Gal. Deep deterministic uncertainty: A new simple baseline. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 24384–24394, 2023.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "### Comment on weakness\n \nWe believe that in [3], one uses GDA and not Gaussian Mixture Model (GMM). More precisely, GMM consists in calculating density for a point x as $p(x) = \\sum_{i=1}^{C} w_i p_i(x)$, and so one needs to fit both $w_i$ (weight) and params $\\theta_i$ of each $p_i$. (Here $\\theta_i$ is the mean and covariance matrix). While, GDA consists in only fitting $\\theta_i$ and then $p(x)$ is considered as $\\max_{i} p_i(x)$. As both approaches lead to a mixture of gaussian, in some ML litterature, one usually confuse GDA with GMM. The most notable difference between these 2 approaches is that GMM has a smoothing effect of density value between the clusters , so larger value in these zones.\n\nWe did mention non-Gaussianity as a desirable feature of our method, as the method [1]. Yet it is not the main selling point: See Q1-Q2 below for synergies of LD+FD. We shall cite [1], but we believe that density estimation by kernels \n- is not a far departure from GDA\n- it does not provide a natural measure of centrality like Lens Depth\n- needs bandwidth tuning\n\nThus instead of adding that benchmark, we chose to focus on Q4.\n \n### Answers to questions\n\n> Questions Q1-Q2. Why Lens depth vs Tuckey depth aka Half-plane depth or Simplicial depth?\nFermat distance vs Typical manifold learning eg Shortest paths after local kNNs?\n\nThank you for these questions, which we answer jointly, in order to stress that while the choice in (1) is for convenience, the choice for (2) is more fundamental. Moreover the choice (1)+(2) is synergistic and not independent.\nThe main idea of our method is the combination of a notion of depth or centrality w.r.t a distribution, and a measure of length that gives shorter distances for high density areas. Furthermore, it is highly desirable that the notion of depth adapts to the chosen distance.\n\nQ1. As you relevantly point out, there are many notions of depth. And we chose not to delve on them. But indeed, it is easy to give a panorama of pros and cons:\n- Tukey depth aka half-plane depth. Pros: Computationally simple, Naturally normalized. Cons: Euclidean, hence less synergy with Fermat distance. Half-place separation is very Euclidean.\n- Simplicial depth. It counts the number of simplices of sample points that contain a given point. Cons: Not normalized into a probability, potentially exponential growth of number of simplices. Computationally complex / expensive as while there exists algorithms in 2D plane, it is not trivial in higher dimension. \n- LD. Pros: Takes into account any distance. Normalized. Computationally middle complexity. \nIn summary, we can structure this discussion into the table.\n\n|   Depth notion | Adapts to any distance | Computational cost | Normalized into probability |\n|-|-|-|-|\n|Lens depth (LD)|Yes|Average|Yes|\n|Half-space depth|No|Low|Yes|\n|Simplicial depth|No as simplices are Euclidean|High|No|\n\nLD is a well-rounded choice. And among these, it is the only one which can leverage the Fermat distance. If you think this is important, we could turn this explanation into an additional  paragraph in the paper.\n\nQ2. Indeed manifold learning is the logical tool for evaluating distances in a latent space. However typical methods such as those suggested do not have this extra feature of “shorter distances in high density areas”. Indeed, in the Fermat distance, the sum $\\sum |q_i - q_{i+1}|^\\alpha$ is small if the q_i’s are close and alpha is high.\nAnd the idea of Fermat distance, inspired from percolation theory in statistical physics, is to use high parameter $\\alpha$. This point is subtle yet important for us. Perhaps we should insist more on that.\n\nAll in all, we believe that we have made a sensible choice in combining LD for notion of depth, and Fermat for notion of distance.\n \n>Q3. \n\nGDA method: please see our comment on weakness above. The result is a mixture of Gaussians, as illustrated in Fig. 1.1 in our main paper.\n \n> Q4. “Experiments with more complex datasets? High computational of LD + FD approach?”\n> With being relatively lightweight, it is not clear why not to consider CIFAR-100/ImageNet as in-distribution with corresponding OOD choices.\n \nAs per the weakness you raised, we added CIFAR100 (InD) vs. TIny-ImageNet (OoD). \nRegarding the complexity of evaluation, we need a trained model on InD of size N and for every OoD example, the complexity is O(C N^2). Even if this is reasonable for a single example, which is relevant for applications, this can indeed become quite large for a full scale evaluation like ImageNet as InD. We estimate that would require approximately 60 hours on our hardware for a single run, which was not possible for this rebuttal, especially multiple runs are needed.\nWe did CIFAR100 / Tiny-ImageNet over 5 independent runs as it required approx 10 hours of experiments. And the presence of C=100 hopefully shows that the method scales well with larger dataset. To have a fair comparision, we use model Wide-ResNet-28-10 and the same training scheme as in DDU paper.  \n###  Table. AUROC score with CIFAR100 as InD data and  Tiny-Imaget as OOD data. Results of other methods are extracted from paper of DDU that were experimented on the same Wide-ResNet-28-10 model.\n|   Method | AUROC |\n|-|-|\n|LD (ours)|$0.8310 \\pm 0.0013$|\n|Softmax Entropy|$0.8153 \\pm 0.0005$|\n|Energy-based|$0.8133 \\pm 0.0006$|\n|SNGP|$0.7885 \\pm 0.0004$|\n|DDU|$0.8313 \\pm 0.0006$|\n|5-Ensemble|$0.8295\\pm 0.0009$|\n\n> Q5. “Reduced LD on more complex dataset than MNIST?”\n\nYes, this was done. \nIndeed the results summarized in tables 5.1 and 5.2 in the paper do use reduced LD. This is mentioned in the details provided in the Appendix A “Experiment details”.\nAnd while the reduction is sizable, the results’ AUROC do not degrade.\nFinally, let us mention that the details of experiment CIFAR100/Tiny-Imagenet will be added to appendix.\n\n### Conclusion\n\nGiven our answers, we sincerely hope you will consider raising your score.\n\nKind regards,\nThe authors", "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": "8Fdo37X8p8", "reviewer": "Reviewer_NNtx", "summary": "This paper proposes a new method for OOD detection/scoring based on the lens depth and Fermat distance, arguing that it has advantages over prior methods by being non-parametric, non-invasive, (almost) tuning-parameter-free, and quite effective in adapting to the unknown structure of the data to identify OOD points.", "questions": "1. What is \\alpha in Fig 4.1? Is it the same for all panels?\n2. Nothing about the proposed method seems to have anything to do with NNs or their feature space, and in particular, it is never mentioned why the method is applied to data points in the feature space, as opposed to the raw data points. I can imagine the reason is that the method works better with relatively “nice” densities, with fewer clusters and continuous densities supported on smooth manifolds, but there is no mention of this in the paper, and it seems like it merits discussion. I did see the last sentence mentions the method can be applied to any model with a feature space, but again, why is a feature space (or a classification model) even needed?", "limitations": "I guess some of my points listed under “weaknesses” could be interpreted as limitations, and I would like to see them better addressed/discussed. If they are (even if the authors don’t change their method at all), that would raise my score.", "rating": 8, "confidence": 4, "soundness": 4, "presentation": 3, "contribution": 4, "strengths": "1. Subject matter is important\n2. I found the paper really easy and fun to read.\n3. 4.2 is a nice, simple, and practical modification—very natural and clearly successful!\n4. Both the Lens Depth and Fermat Distance are nice, intuitive notions, and it is natural and fun to think about their combination!\n5. I raise a number of conceptual issues below, but at the end of the day the demonstration of the method on standard data sets, comparing it to state-of-the-art methods, is fairly compelling, hence my high score.", "weaknesses": "1. LD is interesting and intuitive but what happens when the data falls into two disjoint clusters? Then won’t LD (with basically any distance I can think of, including Fermat distance) consider points in between those two clusters to be extremely central, despite the fact that, since they lie in neither distribution, they could reasonably be considered very OOD? Related: it seems the FD is infinite (whenever \\beta>0) between two points separated by a region of zero density, suggesting that the sample version will be highly unstable in this setting, as it is should not converge at all but instead diverge to infinity. I see this is addressed in 4.4 by computing sample FD separately per cluster, but how were the clusters computed? Clustering is no trivial task, and given that things go wrong without clustering, I imagine S(x) in eq (4.2) depends rather heavily on the clustering. This (seems to me important) aspect of the proposed method seems underexplored/underexplained in the paper.\n2. How does the convergence of the sample FD to the population FD depend on dimension? It’s a bit hard to believe it doesn’t suffer from some sort of curse of dimensionality, since it depends on a density and density estimation very much suffers from the curse of dimensionality. It seems many of the nice demonstrations of it in this paper occur in 2 dimensions (with the data lying nearly on a set of dimension 1), which doesn’t seem very representative of NN feature spaces.\n3. Claim of “no trainable parameter” in the abstract is rather misleading, given the need for choosing both \\alpha (ok there is a case made that maybe this isn’t too important) and the clustering.\n4. Lit review is well-organized, but very focused on methods for NN OOD detection. The paper makes a big deal out of the method being non-intrusive, but another way of saying this is just that the proposed method is a way of scoring a point being OOD with respect to a distribution, which is a problem that, in general, has nothing to do with NNs or their feature representations. Surely there is a large body of work on outlier detection in statistics that could be considered in a similar light to this method, where one takes an off-the-shelf outlier detection method’s score and just applies it to the data transformed to be in the feature space of the NN? That is essentially what this paper is doing (though for a novel method, and I am not questioning its novelty). I just wonder what other existing methods are out there that could be doing something similar, even if they haven’t been explicitly applied to NNs.\n5. Section 4.5 and Appendix E: choices II and III seem like they would rather seriously break the connection between the estimated LD and the true LD, since the k-means clustering will in general (and in typical circumstances) have clusters with very different numbers of points in them, so by reducing to the cluster centers (or center+’s), you are representing very different numbers of points with different centers. Another way to say it is that the density of the n points via methods II and III is quite different from that of the original N points (or via method I), and hence using them to compute the LD will be quite different in nature from using method I or the original N points. I would expect these methods (II and III) to not even have any kind of consistency property to the true LD of the original points, given their change in the density. \n6. I appreciated the authors’ honesty in reporting LL ratio results as being better than their method (of course, it comes with a more complex process), but it seems worth noting that it is substantially better. Since all the AUROC scores are close to 1, it is natural to look at. 1-AUROC (so smaller is better), in which case the LL ratio gets 0.006 and LD gets 0.029, almost 5x higher. I don’t think the authors were misleading in presenting these results, but I found the two sentences (lines 252-254) highlighting the challenges associated with the LL ratio to be a bit vague, and the results might be more convincing if those challenges were made more explicit (possibly in an appendix if there isn’t room in the main paper).\n7. I don’t find Fig 5.2 very convincing, since the monotonicity here is a pretty weak property and no comparison is made with other methods—my guess would be that many methods satisfy monotonicity. Is that not the case?", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "First of all, thank you for your kindly insightful reviews. Here are our answer.\nMany aspects of the discussion will be added to the paper.\n\n### Weaknesses\n\n> W1: Two disjoints clusters for data?\n\nVery natural question. You are perfectly right that the population (ideal) Fermat distance in Eq. (3.4) would be infinite due to vanishing density $f$. However, the sample FD would remain finite -- of the order of the distance to the power $\\alpha$. The finite size effect thus stabilizes the value.\nIn fact, Theorem 2.3 in the reference [6] proves convergence of rescaled sample FD to population FD, with rescaling $n^\\beta$ with $\\beta = (\\alpha-1)/d$. More precisely\n$$ n^\\beta D_{Q_n, \\alpha}(x,y) \\rightarrow D_{f, \\beta}(x,y) $$\nwhen the samples $Q_n = (X_1, X_2, \\dots)$ are either $n$ iid with density $f$ or Poisson with intensity $n f$. It is crucial for $f$ to remain bounded from above and away from zero. As such, one could say that in between clusters, we need “very small density” but not “zero density”. Hence connectedness.\n\nThis purely mathematical answer is rather unsatisfying. A more practical take would be to argue that if a class is disconnected, there is a problem with the feature space. We agree that a better clustering would solve the issue.\nBut, here the clustering is given by the labeling, as we are in a supervised setting for classification. For a focus on the clustering (unsupervised), we found the reference [1] on the use of FD for clustering.\n\n[1] Sapienza et al. \"Weighted geodesic distance following Fermat's principle.\"\n\n[6] Groisman et al. Nonhomogeneous euclidean first-passage percolation and distance learning.\n\n> W2: Curse of dimensionality in the convergence sample FD to population FD.\n\nIn the previous convergence extracted from [6], the scaling does indeed depend on the dimension, thus reflecting a curse of dimensionality.\nHowever, one could argue that this dependence is not too bad. Moreover [Theorem 2.7, 6] tackles the case of data living in an embedded manifold of dimension $d$, much smaller than the embedding space $\\mathbb{R}^D$. In this case, only $d$ matters and not $D$. \nThis is a nice property for ML, where it is a common belief that data lives in much smaller dimensions that raw data points. \n\nIn the end, these are sensible arguments for the lack of a curse of dimensionality in using FD.\n\n> W3. “No trainable parameter”\n\nBy \"trainable param\", one refers to params that are optimized (based on gradient descend for example) in the process. Here, $\\alpha$ is chosen a priori and fixed during the process. And as you point out, it is not very important.\nAlso, perhaps there is a misunderstanding, but we point out (as in W1) that the clustering is part of the data. It is given by  the classes in our supervised classification problem, which we want to make more robust thanks to OOD. \n\n> W4. Focus on \"non-intrusive\" and \"NNs\", ignoring that the method applies beyond NNs.\n\nYes we agree with your remark. A comprehensive answer is given with the related Question 2.\n\n> W5: Section 4.5 seem like they would rather seriously break the connection between the estimated LD and the true LD\n\nYes your remark is correct. This could lead to some change in the original density. However, at the end, our objective is to measure how \"central\" a point is w.r.t. our data and only LD matters. So, our motivation for using reduced methods is to find a config of points that cover well the support of the original data. If this is the case, even if there is change in density, the change of LD is minimal and the ordering of points by LD is not really impacted. That is, points that are \"central\" will remain with large LD and points near the the frontier of the original support should still have small value of LD.\n\n> W6: LL ratio\n\nIn this method, instead of using directly the main model, one needs to train two supplementary generative models to estimate distributions. A first model is trained on ID data and a second one is trained on perturbed inputs. So that, the second model captures only the background statistics. Under suitable assumptions, authors show that the ratio between these two likelihoods cancels out the background information. Consequently, the LL ratio focuses on the semantic part of the input and so can be used as a score to distinguish ID from OOD data. This method needs an adequate noise in the way that the perturbed inputs contain only background information. This process itself is complicated as we need some supplementary dataset to choose the noise. Moreover, one needs to really carefully train these 2 generative models so that they can reflect the true underlying input density. This is quite complex. We will add this in the appendix.\n\n>W7: Fig 5.2 on the monotonicity.\n\nWe made the figure because similar ones appear in the literature. We agree it is not fundamental. Nevertheless, we believe that this monotonicity is a reasonable sanity/reality check, which is nice to observe.\n\n### Questions\n\n> Q1. $\\alpha$ in Fig 4.1?\n\nWe used alpha=3 in this experiment and it is the same for all panels.\n\n> Q2 (and W4). Beyond NNs, and feature space? Why not raw data points?\n\nYou are perfectly right that the combination LD+FD can be used for outlier detection in a more general context than NNs. This is what we had in the mind in the very last sentence in the conclusion. We were perhaps not insisting enough in the paper.\n\nRegarding other literature, we cited the works of Cholaquidis et al. from statistics on LD and the works of Groisman et al. from probability of FD. We are unaware of any works combining the two, aside from ours, for any outlier detection. \n\nRegarding the use of raw data points directly, this indeed possible as in [1] for clustering. However, in the context of NNs and vision, working on pixels is not a good idea. Feature spaces are more efficient in this context as they extract the low dimensionality of the data more efficiently at a semantic level.\n\nKind regards\n\nThe authors", "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": "4kmJn3kryd", "reviewer": "Reviewer_TY6a", "summary": "The paper presents a non-parametric approach to out-of-distribution (OOD) detection. Given a trained neural network classifier, it is proposed to combine the Lens Depth (LD) with the Fermat distance (in an improved form) to capture the geometry and density of the data in feature space. Without assuming any prior distribution, the paper classifies OOD samples for toys and small scale benchmarks.", "questions": "- What is the reason for not performing the ImageNet evaluation, given that it is quite common in the topic?", "limitations": "The paper has a broader impact statement to discuss the idea of robust decision making.", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- The combination of the Lens Depth with the sample Fermat distance for the out-of-distribution problem is a solid and interesting contribution. \n- The paper is well written and easy to follow. In general, the approach is clearly described.\n- The results on small scale experiments are convincing. \n- The approach presented does not include the training process of the model.", "weaknesses": "- An extension of the related work to include papers on OOD would be necessary for the content of the paper. \n- An additional evaluation metric would be helpful, e.g. FPR-95, ECE. This point should be addressed. \n- A large-scale evaluation, e.g. ImageNet, is also missing. This is the main limitation of the paper.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "First of all, thank you for your kind review. Here are our answers.\n\n### Weaknesses\n\n>1. Related work to include papers on OOD: \n\nThank you for your recommendation. We will add more references on OOD in related work.\n\n> 2. An additional evaluation metric: \n\nWe do appreciate your kind recommendation, which is legitimate.\nHowever, our choice of sticking to AUROC is almost forced upon us because single-forward UQ methods like DDU and DUQ, unfortunately, do not report metrics such as FPR-95. \nFurthermore, the references we found such as [1] (and papers it cites) deal with ECE as a metric for OOD generalization but not OOD UQ (Uncertainty Quantification) \nThus, it is difficult for us to include a fair comparison with these metrics.\n\n[1] Wald, Yoav, et al. \"On calibration and out-of-domain generalization.\" Advances in neural information processing systems 34 (2021): 2215-2227. \n\n> 3. Large scale evaluation. \n\nSee next question.\n\n### Question:\nThis very legitimate question has been raised by another reviewer, and we reproduce the answer for your convenience. \n\nRegarding the complexity of evaluation, we need a trained model on InD of size N and for every OoD example, the complexity is O(C N^2). Even if this is reasonable for a single example, which is relevant for applications, this can indeed become quite large for a full scale evaluation like ImageNet as InD. We estimate that would require approximately 60 hours on our hardware for a single run, which was not possible for this rebuttal, especially multiple runs are needed.\nWe did CIFAR100 / Tiny-ImageNet over 5 independent runs as it required approx 10 hours of experiments. And the presence of C=100 hopefully shows that the method scales well with larger dataset. To have a fair comparision, we use model Wide-ResNet-28-10 and the same training scheme as in DDU paper to train models on CIFAR100. We see that performance of our method is better or on par with strong baseline methods.\n\n###  Table. AUROC score with CIFAR100 as InD data and  Tiny-Imaget as OOD data. Results of other methods are extracted from paper of DDU that were experimented on the same Wide-ResNet-28-10 model.\n|   Method | AUROC |\n|-|-|\n|LD (ours)|$0.8310 \\pm 0.0013$|\n|Softmax Entropy|$0.8153 \\pm 0.0005$|\n|Energy-based|$0.8133 \\pm 0.0006$|\n|SNGP|$0.7885 \\pm 0.0004$|\n|DDU|$0.8313 \\pm 0.0006$|\n|5-Ensemble|$0.8295\\pm 0.0009$|\n\n### Conclusion\n\nGiven our answers, we sincerely hope you will consider raising your score.\n\nKind regards,\nThe authors", "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": "nXbQVdXpKs", "reviewer": "Reviewer_kN5D", "summary": "This paper introduces a new method for Out-of-Distribution detection based on the concepts of Lens Depth and Fermat distance. This method is used to see whether a sample has a similar representation in the penultimate layer of a Neural Network as the samples in the training data. The method is subjected to various tests of Out-of-Distribution detection and is shown to be on-par or exceeding alternative methods. However, the proposed method does not intrude on the training process of the model, and therefore cannot have a negative impact on the classification performance. Alternative methods assume a Gaussian Distribution in the hidden representation, but the use of (a modification of) Lens Depth allows estimating the “similarity” of the sample without assuming a certain distribution.", "questions": "1. How computationally expensive is LD after the improvements discussed in Section 4.5? Is it substantially faster/slower to do inference than e.g. DDU?\n2. In Figure 4.2 you show that the LD still works with 200 samples to claim that the method also works for small datasets. At what dataset size does the method start to fail, and how catastrophic is that? A plot like Figure 4.2.B with decreasing sizes of the dataset may give this insight. \n3. Consider Figure D.1. What if two of the “blobs” belong to cluster A and the last to cluster B, so that there are two classes (C=2) but in three clusters. Would LD then still behave as desired? If LD then gives undesirable results, wouldn’t you say that there is at least some assumption about the shape of the distributions?\n4. How would the model perform if the two moons have more spread, to the point that the two classes might touch/overlap? Is there “uncertainty” between the two classes? I understand this is not the point of OOD-detection, but it can be a point of UQ. This might be a ‘limitation’ worth mentioning. LD is good at OOD-detection, but not for the general task of uncertainty estimation. Specifically Line 262 says that LD is a good measure for uncertainty estimation, but only OOD-detection and being monotically decreasing with accuracy are demonstrated. Estimating heteroscedastic aleatoric uncertainty and uncertainty calibration are not tested, but are properties of good uncertainty estimation. On Line 264 “uncertainty quantification” and is said, while OOD-detection is investigated, though I think they are not exactly the same. \n5. In Figures 5.2b-5.2d the accuracy seems to plateau. Do the authors have any suggestions on what might be causing this, and how this might impact applications using LD? \n6. One important use case I’d consider for minimally invading the training process is OoD detection with pre-trained models. Can you elaborate on whether this would be a good use case for your method? If it is, consider stating this in the paper as well, to argue clearly for why minimally invasive OoD detection is desirable.", "limitations": "The authors claim that their method works on all classification models, and without any assumptions on the distribution of the data. However, this is missing evidence. Authors only demonstrate effectiveness in Neural Networks on Computer Vision data. While it is true that the method may be applied to other models and other data, more research is needed to establish its effectiveness there. Other limitations are demonstrated and addressed. The positive conclusions are appropriately based on the findings and are not over-optimistic. \n\nThe authors discuss the high computational cost and demonstrate methods to make it more efficient, but it’s not clear what the remaining computational cost is.", "rating": 7, "confidence": 3, "soundness": 3, "presentation": 4, "contribution": 3, "strengths": "- The application of Femat Distance and Lens Depth introduces mathematical concepts that are not common knowledge and not obvious to a Machine Learning audience. The application of these methods in OoD detection is new (originality)\n-  Previous literature is well cited, and the mathematical concepts are clearly and intuitively introduced, with clearly stated relevance (clarity)\nThe claims made follow naturally from the evidence and are not overstated. The evaluation is in line with common practice in the field of OoD detection (quality)\n- The paper is well written and consistently builds a clear argumentation (clarity)\n- Mathematical concepts are introduced with both formalism, and an intuitive explanation (clarity).\n- The proposed method is competitive with other methods, and is minimally invasive to the training process. This could be helpful when then training process is outside of the control, for example for large pre-trained models (significance)", "weaknesses": "- Small claims are not entirely accurate. Line 4 says there are “no assumptions” about the form of the distribution, but there are only minimal assumptions (see question 3). Line 262 claims that the proposed measure is a good measure of “uncertainty estimation”, but it’s only evaluated for OoD detection, so it may be wildly over/underconfident and behave poorly on aleatoric uncertainty. Line 323 conjects that OoD detection may ensure fairness, but I see no reason why. Line 5 claims that the proposed method is applicable to any classification model, but the performance is only tested for Neural Networks (quality/clarity)\n- The explanation of Lens Depth may be made more intuitive with a visualisation to support Lines 94-99 (clarity)\n- Presented results are not substantially better than previous methods. Authors argue that the main benefit is that the proposed method is minimally invasive to the training process, but the authors do not make a strong case on why this is necessary (significance)", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "First of all, thank you for your time and for this review. Here are our answers.\n\n### Q1. How computationally expensive is LD after the improvements? faster/slower to do inference than e.g. DDU?\n\nThe computational expense depends on the number n of points in the proposed reduced LD, and the number of classes C.  The complexity is of order O(Cn^2). At inference, it is slower than DDU, as DDU uses Gaussian assumption, and an empirical covariance estimation. Hence it uses simple and standard matrix linear algebra, which is friendly for standard Deep Learning packages.\nWith our method, we use non-standard operations, making it slower. We believe that there is much room for improvement using more native implementations, more parallelization etc.. especially when computing shortest paths for LD. But we considered this as not a priority.\nThe objective of our paper is mainly to introduce an approach that is fairly new to Deep Learning community.\n \n### Q2. What dataset size does the method start to fail?\n\nTo respond to your question, we have added an experiment on the spiral dataset where we use only a certain percentage of the original data until LD fails to capture the original distribution. Please look at the figure in the pdf file attached in the global rebuttal to observe. Please  note that we randomly sample a small portion of the original points. Hence, the sampled points can be concentrated in a small region instead of being distributed along the spiral. So, the sampled points can represent not very correctly the original distribution. With that being said, it is not surprising that $LD$ fails to capture the original support at around $5-6 \\%$ of the original size. We hope that the figure will give you more insight about our method at small data regime. Finally, thank you for your recommendation and we will add that in the appendix.\n \n### Q3. Consider Figure D.1. What if two of the “blobs” belong to cluster A and the last to cluster B, so that there are two classes (C=2) but in three clusters. Would LD then still behave as desired? If LD then gives undesirable results, wouldn’t you say that there is at least some assumption about the shape of the distributions?\n\nThis is a very interesting remark. In this example, we intentionally make 3 clusters very far away from each other to see the effect of our method. In the extreme scenario that you propose, there is a class with 2 clusters.\nOne could argue that in such case, these 2 clusters should not be too distinctive. This is because the main model in trained to well classify, so semantically similar inputs should be close to each other, leading to quite continuous cluster for each class. Hence, the \"bad\" effect could exist but should be very minimal.But in general, we agree that the cluster of each class should be sufficiently connected to have an ideal result. We will add that in our discussion.\n\n### Q4. How would the model perform if the two moons have more spread.\nIn the case you are mentioning, we argue this is not a case of OoD uncertainty but a case of decision uncertainty. For this, other metrics such as predictive entropy should be a good candidate as it's related to uncertainty in the decision.\nOoD on the other hand deals well with data scarcity. The aim of LD is to measure the Out-of-domain uncertainty, which is due to the zones where we do not have (or very little) data. As model is not trained in these zones, we would like that the model does not predict on these zones as it can behave very randomly due to scarcity of training data in these zones. This is unlike the case where the two moons have more spread  (and even overlap), so we have enough data in the zone between the 2 classes.\nFinally, we agree with your remark and it's worth mentioning in the discussion. \n\n### Q5. In Figures 5.2b-5.2d the accuracy seems to plateau\nWe think that the plateau part corresponds to  \"difficult\" regions where InD and OOD data are less distinctive, so the rejected data could contain both InD and OOD data.\nSuch a phenomenon is not specific to LD and appears for other methods as well. (see DUQ for example.)\n\n### Q6. One important use case I’d consider for minimally invading the training process is OoD detection with pre-trained models:\nYes! This is indeed a point we have in mind, as SOTA models become often too large to retrain ourselves. But perhaps we did not insist enough on that. It will be added in the introduction.\nThank you for your recommendation. Ideally this should be a good use case where we have no idea about the distribution of data and we want to keep the original model intact to make sure that its performance on the main task is not impacted.\n\nKind regards,\nThe authors", "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:
First of all, thank you all for your time and insightful reviews. Here are the main points in the rebuttal.

- We answered all the questions to best of our capability. In particular, the questions of Reviewer NNtx brought extensive mathematical discussions.

- We shall add / nuance multiple points about limitations.

- Reviewer kN5D remarked that Figure 4.2 shows that the LD still works with 200 samples. At what dataset size does the method start to fail, and how catastrophic is that?

In the attached pdf, you can find the figure showing experiment proposed by Reviewer kN5D. We hope that the figure will give you more insight about our method at small data regime.

 - Reviewers exfg and TY6a kindly proposed to test our method on larger scale datasets to see if our method can scale well with more complex data. In the allotted time of the rebuttal, we added experiment with CIFAR100 as InD data and Tiny-ImageNet as OOD. And the presence of C=100 classes hopefully shows that the method scales well with larger dataset. We performed 5 independent runs. To have a fair comparison, we use model Wide-ResNet-28-10 and the same training scheme as in DDU paper.

###  Table. AUROC score with CIFAR100 as InD data and  Tiny-Imaget as OOD data. Results of other methods are extracted from paper of DDU that were experimented on the same Wide-ResNet-28-10 model.
|   Method | AUROC |
|-|-|
|LD (ours)|$0.8310 \pm 0.0013$|
|Softmax Entropy|$0.8153 \pm 0.0005$|
|Energy-based|$0.8133 \pm 0.0006$|
|SNGP|$0.7885 \pm 0.0004$|
|DDU|$0.8313 \pm 0.0006$|
|5-Ensemble|$0.8295\pm 0.0009$|

Kind regards,

The authors

Meta-review: The paper proposed a non-parametric approach to estimate whether an input point is OOD. For this the authors calculate so-called lens depth based on the Fermat distance.

The paper is well written. The experiments verify the method under different conditions and datasets. The method is based on theoretically well-defined concepts. Overall, the paper and the results looks fine to be accepted after incorporating the reviewers' feedback.
Decision: Accept (poster)