Enhancing Diversity in Bayesian Deep Learning via Hyperspherical Energy Minimization of CKA
Authors: David Smerkous
Qinxun Bai
Li Fuxin
Venue: NeurIPS 2024 poster (2024)
Keywords: bayesian inference
variational inference
uncertainty quantification
deep learning
hypernetworks
Primary area: probabilistic_methods
TL;DR: New kernel to increase feature diversity of ensembles, train hypernetworks, and improve uncertainty estimation of deep ensembles.

Abstract: Particle-based Bayesian deep learning often requires a similarity metric to compare two networks. However, naive similarity metrics lack permutation invariance and are inappropriate for comparing networks. Centered Kernel Alignment (CKA) on feature kernels has been proposed to compare deep networks but has not been used as an optimization objective in Bayesian deep learning. In this paper, we explore the use of CKA in Bayesian deep learning to generate diverse ensembles and hypernetworks that output a network posterior. Noting that CKA projects kernels onto a unit hypersphere and that directly optimizing the CKA objective leads to diminishing gradients when two networks are very similar. We propose adopting the approach of hyperspherical energy (HE) on top of CKA kernels to address this drawback and improve training stability. Additionally, by leveraging CKA-based feature kernels, we derive feature repulsive terms applied to synthetically generated outlier examples. Experiments on both diverse ensembles and hypernetworks show that our approach significantly outperforms baselines in terms of uncertainty quantification in both synthetic and realistic outlier detection tasks.

Enhancing Diversity in Bayesian Deep Learning via Hyperspherical Energy Minimization of CKA
David Smerkous Oregon State University Corvallis, OR, USA
Qinxun Bai Horizon Robotics Sunnyvale, CA, USA qinxun. bai.mmai@lmmll..m com
Li Fuxin Oregon State University Corvallis, OR, USA 1 Lifooregonstate.cem edu
smerkoud@oregonstaee.eee edu
Abstract
Particle-based Bayesian deep learning often requires a similarity metric to compare networks. However, naive similarity metries lack permutation invariance and are inappropriate for comparing networks. Centered Kernel Alignment (CKA) on feature kernels has been proposed to compare deep networks but has been used an optimization objective in Bayesian deep learning. In this paper, we explore the use of CKA in Bayesian deep learning to generate diverse ensembles and hypernetworks that output network posterior. Noting that CKA projects kernels onto unit hypersphere and that directly optimizing the CKA objective leads diminishing gradients when two networks are very similar. We propose adopting the approach hyperspherical energy (HE) on top of CKA kernels to address this drawback and improve training stability. Additionally, by leveraging CKA-based feature kernels, we derive feature repulsive terms applied to synthetically generated outlier examples. Experiments both diverse ensembles and hypernetworks show that our approach significantly outperforms baselines in terms uncertainty quantification in both synthetic and realistic outlier detection tasks.
Introduction
Bayesian deep learning has always garnered substantial interest in the machine learning community. Instead of a point estimate which most deep learning algorithms obtain, a posterior distribution of trained models could significantly improve understanding about prediction uncertainty and avoid overconfident predictions. Bayesian deep learning has potential applications in transfer learning, fairness, active learning, and even reinforcement learning, where reducing uncertainty be used as a powerful intrinsic reward function (Yang & Loog 2016 Ratzlaff et al. 2020) Wang et al. 2023).
One line of approach to Bayesian deep learning is to add noise to single trained model. Such noises can either be injected during the training process, e.g. as in the stochastic gradient Langevin dynamics (Welling & Teh 2011), 1), or after the training process (Maddox et al. (2019). However, many such approaches often underperform the simple ensemble method (Lakshminarayanan et al.) (017b) which merely trains several deep networks with different random seeds. Intuitively, because starts from different random initializations, might be able to "explore" a larger portion of the parameter space than those that are always nearby one specific model or training path. Because of this, ensembles may capture different modes and therefore better represent the posterior distribution of "well-trained" network functions (Fort al., 2019: Wilson & Izmailov 2020).
ensemble,
However, a critical question is, how different are the networks in an ensemble from one another? And utilize the idea of diversification to further improve these networks by making them even more diverse? In order to answer these questions, we first need a metric to compare those networks, which in itself significant problem; regular L1/L2 distances, either in the space of the network parameters, or in the space of the network activations, are not likely to work well. First, they suffer from the curse
38th Conference on Neural Information Processing Systems (NcurIPS 2024).

---

Input
Feature Grams
Feature Repulsion
(octioaa))
Inieer
Synthetic Outlier
Layer
Af Models
Layer Centering Hyperspherical Projection
Xg a Au
Model R
f1 #
K
Model M R.
Centering Projection
f1 +
2
Hyperspherical Energy
M.K
-Janiin (KA(K))
deLaE
of Imnnn
f1(
demand
arccus (R." R(
Nid
Nood
N - Nuu + Nood
K ()-MM)
Layer Weighted Kernel
# RN.....
HE (K)C) LMCM
WHE (HE
Final Loss L Las -HE-CCA((K) BLood
Figure 1: Overview of feature repulsive loss construction: Starting with batch of examples (left), optionally including synthetic outliers, ensemble features at each layer I are used to construct centered Gram matrices projected onto the unit hypersphere (middle). The hyperspherical energy then calculated between models, weighted by layer, and incorporated into the loss function (right).
of dimensionality due to the excessive number of parameters in modern deep networks. Moreover, there is the peculiar permutation invariance, where one can randomly permute the different channels of each layer and result in a network that has vastly different parameters and activations, yet represents the same function. The popular RBF kernel lacks this permutation invariance inhibiting methods like Stein Variational Gradient Descent (SVGD) from working effectively on larger networks (D' Angelo & Fortuin 2021). Therefore, a proper kernel for comparing network functions should address these critical issues by being effective in nigh-dimensional spaces and invariant to permutations of neural network channels.
Kornblith al. (2019) proposed interesting approach for performing this comparison based on Centered Kernel Aligmment (CKA). The idea is, instead of directly comparing activations or parameters, comparison made between the Gram matrices of the same dataset fed into different networks. Each example will generate a feature vector at each layer of the network, and kernel matrix can constructed based on the similarity between all example pairs in the dataset. Then, CKA metric measures the similarity of these two Gram matrices as the similarity of the two networks. This idea addresses the permutation invariance issue and generates meaningful comparisons between deep networks.
In this paper, propose to explicitly promote diversity of network functions by adding CKA-based loss terms to deep ensemble learning. Given that CKA projects all kernels on a hypersphere, we further propose to use Hyperspherical Energy (HE) minimization as an approach more evenly dis- tribute the ensemble of neural networks on the hypersphere. Experiments on synthetic data, MNIST, CIFAR, and Tiny ImageNet show that our approach maintains the predictive accuracy of ensemble models while boosting their performance in uncertainty estimation across both synthetic and realistic datasets. Besides, we demonstrate that our method can also be applied to training hypernetworks, improving the diversity and uncertainty estimation of the networks generated by hypernetwork. Ad- ditionally, we propose using synthetic out-of-distribution (OOD) examples, reduce their likelihood, and introducing feature repulsive terms on synthetic outlier examples to enhance OOD detection performance. We hope that our approach provides different perspective to variational inference methods and contributes to improving uncertainty estimation in deep networks. Code is publicly available at httth:://// //github. www/ooe/eeeeec.... com/Deep-Machine Machine- Vision/han /he- cka- ensembles
2 Related Work
Uncertainty Estimation. A large body of literature has studied the problem of uncertainty estimation for neural networks. Bayesian neural networks (Gal & Ghahramani 2016 Krueger et al., 2017

---

approximate posterior distribution over the model parameters and therefore estimate the epistemic uncertainty of the predictions. Non- -on-ssasi approaches. on the other hand. rely on bootstrap (Osband et al. 2016), ensemble (I (I.akshminrrayanan et al., 2017b, Wenn et al. 2020: Park & Kiml 2022), and conformal prediction (Bhatnagar et al.] (0033 to generate multiple neural networks of the same structure. Our approach is most closely related to ensemble methods for estimating predictive uncertainty. We follow the common practice of evaluating uncertainty by distinguishing between inlier and outlier images for datasets like CIFAR/SVHN and MNIST/MMNIST. Most approaches typically evaluate the separation or distance within the feature space of a model
Nazaret & Blei 2022)
between inliers and outliers (Mukhoti et al., 2023 Van Amersfoort et al. 2020 D Angelo & Fortuin 2021; Ovadia et al., 2019b Lakshminaaayanan et al. 2017a;] Liu et al. 2020). Deep deterministic
uncertainty (DDU) utilizes a single deterministic network with a Gaussian mixture model (GMM) fitted on the observed inlier features hefore the last layer and calculates separation of inliers and outliers using feature log density. We refer the reader to Mukhoti et al. (2023) for more information. For a more comprehensive survey and benchmarking of different uncertainty estimation approaches, refer to Ovadia et al. (0199); Gawlikowski al. (2022).
VI. Particle-based variational inference methods (P) such as Stein Variational Gradient Descent (SVGD) (Liu & Wang 2016 Chen et al., 2018 Liu & Zhu, 2018), use particles to approximate the Bayes posterior. Our work most closely resembles work done by D Angelo & Fortuin (021), which explores adapting kernelized repulsive terms in both the weight and function space of deep ensembles to increase model diversity and improve uncertainty estimation. Our work, however, focuses more constructing new kernel rather than exploring new repulsive terms that utilize an RBF kernel on weights or network activations.
Hypernetworks. Hypernetworks have been used for various specific tasks, some are conditioned on the input data to generate the target network weights, such as in image conditioning or restoration (Alaluf et al. 2022 Aharon & Ben-Artzi 2023). It has seen popular use in meta-learning tasks related to reinforcement learning (Beek et al. [023] 2024 Sarafian et al., 202T). and few-shot learning in Zhmoginov et al. (022). Hypernetworks conditioned on a noise vector to approximate Bayesian inference have been proposed (Krueger et al. 2018 Ratzlaff & Fuxin 2019), but either require an invertible hypernet or do not diversify target features explicitly. Our motivation is to provide Bayesian hypernetworks by explicitly promoting fcature diversity in target networks.
3 Measurements of Network Diversity
In order to generate an ensemble of diverse networks, we first need a measurement of similarity between internal network features. Throughout this paper, we denote deep network with L. layers as f(x, 0) ff(f..)(fi(z 0.),-..), ".))...),,,, 0r), where fı(z, 0t) E IR are the features of layer ( parameterized by O,, where pt E N is the output feature dimension.
3.1 Comparing two networks with CKA
We will compare two networks with the same architecture layer-by-layer Given two networks at layer/ / with weights 0), of and feature activations fi 0 fi 0f), naive approach would be to
take some Euclidean Lş norm between the weights [10] Bf|1 or features [z. 6/) fa ll)
but those tend to be bad heuristies for similarity measures in nigh-dimensional vector spaces due
to the curse of dimensionality (Reddi et al.) 2014; Aggarwal et al., 2001 Weber et al.) 1998). A better approach to measuring similarity would be to analyze the statistical independence or alignment of features between networks, through Canonical Correlation Analysis (CCA), Singular Vector CCA (SVCCA), Projection- Weighted CCA (PWCCA), Orthogonal Procrustes (OP), Hilbert-Schmidt Independence Criterion (HSIC), or Centered Kernel Alignment (CKA)
al. 2017 Gretton ct al. 2005 Kornblith et al. 2019). Ideally, the chosen metric should be computationally efficient, invariant to isotropic scaling, orthogonal transformations, permutations, and be easily differentiable. However, CCA methods and OP require the use of Singular Value Decomposition (SVD) or iterative approximation methods, which can be computationally intensive. Additionally, HSIC and OP are not invariant to isotropic scaling of fi-
As comparison metric between networks, Kornblith et al. (0019) propose to utilize CKA on Gram matrices, obtained by evaluating the neural network on a finite sample. CKA based on the non- parametric statistical independence criterion HSIC, which has been a popular method of measuring
3

---

statistical independence as covariance operator in the kernel Hilbert spaces (Gretton et al. 2005).
An empirical estimation of HSIC on a dataset of N examples is given by 1/(N Lr K where the two Gram matrices K (( (f), Si( 0)) and K2 = 1(S( Of) fi(z;, O)) constructed through the k(::-) kerne function, and H = 1 a centering matrix center the Gram matrices around the row means, where 1 denotes the all ones vector, and / as the identity matrix. This function, however, is not invariant isotropic scaling, The isotropic scaling invariant version of HSIC is termed Centered Kernel Alignment (CKA) (Kornblith et al. 2019),
HSIC(K), K2)
CKA(K) K2)=
HSSCCK K (SSIC(2,
We stick with the linear kernel for k, unless otherwise specified. due its computational simplicity. The RBF kernel works, but it is computationally expensive and requires the use of heuristic like the median heuristic to perform well and make CKA isotropic scaling invariant (Reddi al. 2014 Kornblith et al. 2019).
3.2 Generalizing to multiple networks
Given ensemble of M models, simple approach to generalizing Eq. (1) measure the similarity of an ensemble would be to construct a pairwise alignment metric. For each layer of each member of the ensemble m, we construct the set of kernel matrices K. {K?") J(=1..... loss across all layers L is as follows,
mm=1..,.M The mean pairwise
L
M.M
CKApw (KC) = LM(M- -
Σ Σ m.m =1 mmsmm
CKA(K?", ,K"")
In its current form, CKApw provides a good approximate metric to evaluate the similarity among members of an ensemble. We found that rewriting Eq. ② gives us another perspective on optimizing CKA. First, to simplify notation, let km ||] vco( Kmm H) be the centered and normalized Gram matrix, and rewriting the inner product in Eq. !I results in the cosine similarity metric CKA(K"" Km') = Km R'm", The matrix the vectorized kernels from the set Ki can be represented in compact form K,, and CKApw can be rewritten using this compact form,
CKApw (XC LM(M 1) (2]((
S.
: M
E
MXN2
Kj
I) is function that zeros out the diagonal of matrix. Now each row m of K2 is a vectorized Gram matrix with unit length from the model m. We can view these vectors the Gram matrices projected the unit hypersphere as shown in Fig. For each pair of models j on the hypersphere, with an angle dig between the feature gram vectors, CKA is equivalent cos( Thus minimizing pairwise CKA would reduce the sum of cos()r;). pushing Gram matrices between model pairs apart.
where zd(X)= = (11T -I)
3.3 Comparing Networks with Hyperspherical Energy
Note that CKA suffices as a differentiable measure between deep networks and one can directly minimize CKA to push different models in the ensemble apart from each other, However, CKA may have specific deficiency
optimization objective in that the gradient of cos(Φ) is -in( which close to when ò is close to 0. other words, two models are already very similar to each other (their CKA being close to 1), then optimizing with CKA may not provide enough gradient to move them apart. Hence, we explore further techniques to alleviate this drawback. Minimum Hyperspherical Energy (MHE) (Liu et al. (202]) aims distribute particles uniformly hypersphere, which maximizes their geodesic distances from each other. In physics, this is analogous to distributing electrons with a repellent Coloumb's 's force.
Inspired by MHE, we propose to adopt the idea of hyperspherical energy (HE) on top of the CKA kernel to compare neural networks, termed HE- CKA, which is novel to our knowledge. For each

---

10
10
1.0
05
0.5
055
05
-0.5
-1.0
-10
-10
200 08 1.0
-1.0
0.0
0.00000 10
x
05 1.0
-0.
0.0
1.0 11..5000
05 10
-0.5
0.0
15
25
(a) Initial Points
(b) cossim Minimized
(c) HE Minimized (d) cossim Objective (e) HE Objective
Figure 2: Comparison between optimizing cosine similarity (cossim) or HE on a sphere. (a) initial random set of points placed on sphere. (b-c) the final set of points after 50 iterations either cossim or HE as the similarity metrie. (d-e) the value of cossim/HE with respect the number of iterations. The orange line indicates that cossim minimized and the black line indicates that HE with 2 is minimized. Both methods used gradient descent with learning rate of 0.75 and momentum 0.9.
layer/ we treat the M model Gram vectors Ry as particles on the hypersphere, its geodesic on the hypersphere is then رi, = arccos (CecossCKA(K)... k))) )) = arccos R ), we define the energy function by simulating a repellent force on the particles via Fi,, = (d.,g) ) as shown in Fig Incorporating this across all layers, weighted by wy, and model pairs results in the overall hyperspherical energy of CKA between all models is.
L
M.M
(KAC))))) LM(M - 1)
1
Σ
Σ
arrcos (K)c KF'))
1=1
m, =1
where s >> 0 is the Riesz s-kernel function parameter. For more information regarding the layer
weighting wy and smoothing terms please see Appendix C
HE has been shown as a proper kernel (Liu et al. 2021 The minimization of HE, as mentioned in Liu et al. (202T), asymptotically corresponds the uniform distribution on the hypersphere, In order to demonstrate the difference between HE and the pairwise cosine similarity, we conducted a test on a synthetic dataset by generating random vectors from two Gaussian distributions in R and projecting on the unit hypersphere. We then minimized pairwise cosine similarity and HE respectively. Figure 2 illustrates that minimizing HE converges faster and achieves a more uniform distribution compared to minimizing cosine similarity. Specifically, as observed in Figure 2 (b), minimizing the cosine similarity loss caused particles cluster towards two opposite sides of the sphere, the gradient of this optimization as mentioned in the beginning of the subsection, becomes very small between particles that are clustered together. In Fig. dd), we show that minimizing HE actually leads to lower cosine similarity than directly minimizing cosine similarity, showing that minimizing cosine similarity could fall into local optima as described.
4 Particle-based Variational Inference by Minimizing Model Similarity
Armed with the comparison metrics between deep networks, we now proceed to incorporate the minimization of network similarity into deep ensemble training. In this section, we explore two different types of ensembles. The first is a regular ensemble where deep networks are trained to maximize the data likelihood, and we would add term minimizing model similarity to Afterwards, we also explore the application of the idea on generative ensembles by hypernetorks,, which aims to train a generator that generates network weights so that one can directly sample the posterior from Such generator can easily exhibit mode collapse by always generating the same function, and we hope the idea of minimizing the similarity of generated networks would help alleviate this issue.
(.)....).00)) We denote the ensemble of target network layer at layer as Ex(z, 0) = [f( 01), .... f((
Suppose we are given a deep network with L layers f(x, 0) = (T..(...)JI
BM)) with the ensemble parameters 0 = {00h) ) mm and the training set of N examples as {a;, Vi M From Bayesian perspective, incorporating CKAp//HE-CK. into the ensemble training can be interpreted as imposing a Boltzmann prior with HE-CKA over the ensemble network parameters 0 that produce feature Gram matrices uniformly distributed on the unit hypersphere. Specifically, p(0) x exp( (- (EECCKAAE((E constructed from the ensemble E, as described in Sec. 3.2 The posterior distribution now becomes:
0)), where K(EE,) (- 8)) is the set of feature Gram matrices,
D() p(D) () exp( - HE- (CA.AAAAA(EE
(5)
5

---

1.0
10
14
1,0
18
95
05
05
A5
05
-5
-10
10
10
10
00
-10
10
0.
-10
16
00 -1
10
(a) Ensemble
(b) SVGD RBF
(c) ISVGD + RBF
(d) KDE WGD +
(e) IKDE WGD
RBF
RBF
10
10
10
2.0
10
14
2.0
10
-10
12
110
16 -2
10
(f) SVGD HE-CKA
(g) Ensemble HE-CKA
(h) Ensemble OOD (i) Hypemetwork HE-CKA
( Hypemetwork OOD HE-CKA
Predictive entropies (PE) on a four-cluster 2D classification task. Darker values indicate higher entropy, lower confidence regions, and lighter values indicate higher confidence regions. (b) and (d) use an RBF kernel ensemble member weights, whereas and (l) and (g) use the HE- CKA, RBF feature kernel, for feature diversity on inlier points. Both (h) and (i) use HE-CKA and OOD entropy terms, methods were trained on an ensemble of 30 four layer MLPs for 1k iterations with the same seeds.
Figure 3:
RBF kemel on ensemble member outputs.
The MAP estimate of the posterior in Eq. (5) results in the following objective:
N [(f(z,, "T), vi) + (=HH-CKA((((B(((.)))
min M
(6)
0
The left hand side is the negative log likelihood term where C(ar, v) is the target loss, such as cross- entropy or MSE. Minimizing 0, while adjusting the constant y used in the Boltzmann prior, allows us balance between gram matrix hyperspherical uniformity and fitting the training data. Further explanation of Eq. (6) relationship to Pa is given in Appendix Note that the same approach can be used derive the formula for the CKA kernel in Eq. as well.
4.1 Diverse Generative Ensemble with Hypernetworks
Besides diversifying ensemble models, we also explore using CKA pw /HE-CKA in learning non- deterministic generator (Krueger et al., 2018) which gives us the ability to sample from a continuous nonlinear posterior distribution of network weights. This is appealing since it can generate any amount network with a single training run of the generator, without being restricted by the fixed amount of posterior samples one access with regular ensemble.
The approach we take uses the concept of hypernetworks (Ha et al., 2016: Krueger al. 2018). However, current variational inference methods are not scalable to larger models and generally require change of variables or invertible functions (Krueger al., 2018). Naively using a hypernetwork to transform prior distribution to generate 0 of the target network may result in the collapse of the posterior distribution. Hence, would be interesting to explore using CKApw HE-CKA to avoid such mode collapses. We use the surrogate diversity loss in Eq. (4) to impose non-parametric independence of feature distributions. With hypernetworks we aim to transform, using a network l(=)., some prior distribution of the latent space, and wy the number of parameters for layer 1. To learn the function h(-) we sample a batch M of f's, feed through the ensemble Exx, 0) and calculate loss, similar to a fixed ensemble as in Eq. (6). With the difference being that now are backpropagating gradients to h(-) accumulated from the M ensemble members.
(0, I), E TR. to h(=) = 0 R w1, where P the dimensionality
Using plain MLP for the hypernetwork h would require the last layer's weight matrix to contain ΣS wi entries, where is the activation dimension right before the last layer. This could possibly result in a matrix of millions of trainable parameters. To overcome this challenge we follow the approach by Ratzlaff Fuxin (2099) of decomposing into several parts. First layer code generator lx(z) g..c and the layer generators 0, 9t (cr), where each layer generator g is separate smaller network per layer See Fig. for a visualization. Note is a matrix with layer codes of size Csize-

---

91
92(C)
9ale)
(4(6)
Capecable
P.X. 4
A(#)
Comv2D
Com22D
Linear
Linear
X
Luargrt
t
K
K₁
K₂
K
K
НK(K)
Figure 4: Hypernetwork h(z) model architecture example four layer CNN
To further reduce size of the hypernetoork, for convolutional networks, we use the assumption that filters in convolutional layers can independently sampled. For each convolutional layer' 1 we create layer code vectors via the layer code generator ç h(=z), where each code vector i in o, corresponds latent vector for single convolution filter We feed each filter code through filter generator gr(ci,) separately to generate the filter for layer 1. An example architecture can be seen in Fig.
4.2 Synthetic OOD Feature Diversity
Striking balance between ensemble member diversity and inlier performance a challenge. En- forcing strong feature dissimilarity observed inlier examples could degrade inlier performance if not tuned correctly. ParVI methods that only observe inlier points, like SVGD, can achieve better diversity but often at the expense of inlier accuracy (l) Angelo & Fortuin 2021). We have found that a more effective strategy to reduce the feature similarity on obvious OOD examples, and reduce their likelihood, which could be synthetically generated. Intuitively, want more diverse features on obvious outlier examples to indicate uncertainty because the networks trained on these examples should not be confident. We found this approach to generate OOD examples and increase their feature diversity to be very effective.
Importantly, the OOD points do not need to be close to the inlier data manifold at all. For images, generate outlier points via random grids, lines, perlin noise, simplex noise, and vastly distorted and broken input samples. See Appendix E.2 for more details and example images. For vector datasets, such as the test 2D datasets presented in Fig. 3 we identify outlier points by locating the minimum and maximum values across training examples. Generally, the boundary does not need to be close to the in-distribution (ID) dataset to achieve good results. We split the Gram matrices into Kip and KoOD and apply HE-CKA them separately, with respective hyperparameters "ID and "ooD- The parameter value "nd can be adjusted to be smaller than "YODD. Additionally, for classification tasks, we add mntropy-maximizee
term, scaled by hyperparameter 3, for synthetic OOD points to Eq. (6). Similar loss terms may be constructed for other tasks, such as variance for regression tasks, but we have not explored them yet.
Fuskie
Pueciaa
Teaerg
(a) Ensemble
(b) Ensemble HE-CKA
(c) Hypemetwork
(d) Hypernetwork HE-CKA
Figure 5: 1D regression task comparing uncertainty estimation between different approaches
7

---

Trection
Trection
(a) Ensemble
(b) SVGD RBF
(c) SVGD + HE-CKA
(d) Ensemble OOD HE-CKA
Figure 6: Predictive softmax entropy between MNIST, Dirty-MNIST (with aleatoric uncertainty), and OOD Fashion-MNIST. Utilizing an ensemble LeNets. It can be seen that HE-CKA and OOD HE-CKA better separates the inlier Dirty-MNIST from outlier Reshion-MNISS
Experiments
In this section, we conduct experiments on several datasets, ranging from synthetic tasks to realistic out-of-distribution (OOD) detection problems, to validate our approach. We compare OOD results between ensembles, ParVI, and other baselines.
5.1 Synthetic Data
We start by testing our approach on two synthetic tasks visually assess the uncertainty estimation capability on both classification and regression problems. The first task is 2D four-class classification problem, where each class distributed in one quadrant the 2D space with points sampled from Gaussians with = (.4,.) and μ (=2, =2). The objective is to evaluate whether the models can accurately predict uncertainty, ideally showing low uncertainty near training examples and high uncertainty elsewhere. We employed three-layer MIP trained with cross-entropy on the four classes and measured the predictive entropy of points sampled uniformly from a 10 x grid.
When using cross-entropy alone, the decision boundaries among the four classes tend to be very similar. Deep ensembles classify with high confidence most areas where they have never observed data before (Fig. B(a)). Introducing the HE-CKA diversity term to the ensemble significantly reduces the ensemble's confidence on points outside the in-distribution set (Fig g)). Furthermore, incorporating the HE-CKA and entropy term for OOD points allows the model to better estimate uncertainty, with only inliers being confident (Fig. Bh)). In the case of hypemetworks, we observe the importance of diversity term. Without it, hypernetwork predictions tend to be overconfident on outliers (Fig. ()). However, when introducing HF-CKA hypernetoork, we achieve results closely resembling that of the ensemble HE-CKA term (Fig.Bji).
In our second test, we perform ID regression modeling task. We aim learn the function y(z) - sin (1.2x) (1 xx) within E (-6, 6) with high certainty everywhere except in æ E (-2, 2). The training dataset involves sampling the function with 40 points uniformly from both (-6, and (2, 6). with 2 points from (-2, 2). We then fit four layer MLP to approximate y(z).
The visual result of each method is shown in Fig. 5 The fixed ensemble (Fig. 5 a)) has little diversity between the areas with low density, in contrast to the ensemble plus the HE-CKA A term (Fig. ())). The hypernetwork, without any feature diversity term (Fig. (Fig-F(c) ())) collapses, producing very similar weights. However, adding the HE-CKA term to the hypernetwork (Fig. 5(d) alleviates this issue.
5.2 OOD Detection on Real Datasets
We evaluated our proposed approach on a variety of real-world datasets, including -iNIT-MNIST. Fashion-MNIST, CIFAR-10/100, SVHN, and TmnylmageNet. We employ different CNN architectures such as LeNet, ResNet32, and ResNet18 to demonstrate the versatility of our method across models of varying complexity. Our experiments compare the out-of-distribution (OOD) detection performance of our approach against several approaches, including Deep Deterministic Uncertainty (DDU), deep ensembles and Stein Variational Gradient Descent (SVGD) equipped with the RBF kernel.
We provide experimental settings and training details here and additionally Appendix C Limita- tions of this approach are discussed in Appendix D while further insights into memory usage and
computational efficiency are discussed in Appendix G Details regarding synthetic OOD example
generation is described in Appendix E.2
8

---

Table 1: OOD detection results with inlier Dirty-MNIST and outlier Fashion MNIST, runs. All models were trained LeNet, with HE-CKA and CKApp utilizing a cosine similarity feature kemel. One exception to predictive entropy (PE) report is DDU, which uses feature space density, indicated by star, to calculate
AUROC Mukhoti et al. 2023). More training details can be found in Appendix C
NLL (4)
ACCURACY (1)
ECE (4)
AUROC FASHIONMNIST (1)
PR
MI
DDU
0,278 = 0.001
82.177
0.032
3.952 = 0.317
91.168 : 125
SINGLE
0.272 0.002
82.299
0.168
2.908 +: 0.129
65,933 + 10.669
50.000
0.000
ENSEMBLE
0.271 0.001
83,915
0.084
1.306 1 0.098
86.095
1.608
96.065
0.798
SVGD+RBF
0.304 =: 0.001
83.360
0.072
3.178 2: 0.076
91.003
1.155
98. 083
U.516
SVGD+CKApw
0.377 0.003
82.351 1.0 0.150
7.359 1 0.211
89.195
4.260
99.207
0.160
SVGD+HE-CKA
0.298 0.002
+3.879
2.846 + 0.153
94.380 +: 1.332
99.213
0.14::1::144 0.147
HYPERNET
0,278
0.117
4.253 0.092
46.393 3.515
64.856
HYPERNET-OOD HE-CKA
0.325 0.014
82.398 + 0.628
3,058 + 0.665
98,073 1: 0.951
T7.548 9.526
ENSEMBLC-HE-CKS
0,306
83.681
3.174 0.120
91.656
ENSEMBLE+OOD HE-CKA
0.277 = 0.001
84.090 + 0.049
1.712 = 0.061
99.996 + 0.001
99.742 + 0.506
Table 2: OOD results on CIFARIO vs SVHN. Methods used 10 particles of modified ResNet32 were trained
described in Angelo & Fortuin I Methods with (+) report values taken from D' Angelo & Fortuin (02T). One exception predictive entropy (PE) report DDU* which uses feature space density to calculate
AUROC Muukhoti ct al. 2023).
Moner.
NLL (.)
ACCURACY (1)
ECB
AUROC SVHN (f)
MI
SVGD RBF
0.287 +
85. + 0.017
5.200
0.100
82.50 0.100
71.00 = 0.200
#SVGD + RBF
0.292 0.001
85.510 + 0.031
4.900
0.100
78.30 +: 0.100
71,20 : 0.
WGD RBF
0.276 0.000
85.904 + 0.030
5.300
0.100
0.100
73.50 0.400
SGE WGD - RBF
0.273:00000
85.792 - 0.035
5.100 0.100
0.100
72.50 = 0.400
PWGD RBF
0.282
84,883 +
4.400 0.100
0..00
75.50 0.200
SGE - EWGD + RBF
0 2288000000
81.706 0.000
1.700 0.100
0.
75.40 = 0,200
ENSEMBLE
0.001
85.502 0.066
4,900
0.400
73.60 0.500
SVGD - HE-CKA
0.000
85.890 + 0.381
3.675 =:75=000 0.089
29.23211.22
70.977 + 14545
SVGD CKAp'
0.286 0.002
84.833
4,946 0.185
83.893 1.513
70.327 1.703
DDU
0.211 + 0.002
81.655 = 0.0361
1.26 + 0.872
86.281 + 2 0.020*
ENSEMBLE + OOD HE-CKA
0.275 0.009
86.133 - 0.482
5.436 0.599
96.478 + 0.413
96.606 1.066
HYPERNET + OOD HE-CKA
0.259 = 0.002
83.610 + 0.046
1.115 = 0.050
88.121 = 0.182
88.811 = 0.131
MiNSS vs Fashion MNIST. The Dirty-MNIST vs Fashion MNIST OOD benchmark (Mukhoti et al. 2023) examines the capability of models to discern inliers, OOD data in similar distribution and OOD data more dissimilar distribution. This dataset combines MNIST with more ambiguous and challenging examples known as ambiguous MNIST (AMNIST), We examine the ability to to distinguish MNIST and AMNIST from the out-of-distribution Fashion MNIST (FMNIST) (Xiao et al. 2017). We trained LeNet5 on DirST and assessed OOD classification between Dirty-MNIS and FMNIST using predictive entropy (PE) and mutual information (MI). The area under the receiver operating characteristic (AUROC) is used to assess the separability between MNIST and FMNIST (Lecun et al. 1998; Bradley 1997). For DDU a GMM is fit to the second to last layer's features over Dirty-MNIST using the log density of features to distinguish inliers from outliers, rather than predictive entropy.
Results shown in Fig. 6 and Table Ensembles (Fig. (()) do not exhibit significant separation using predictive entropy (PE) alone, resulting in low AUROC with PE for FashionMNIST. While methods like SVGD, equipped with an RBF kernel, improve separation (Fig. b)), our approach demonstrates that using HE-CKA on an ensemble alone surpasses both RBF kernels and DDU's approach, and when paired with OOD examples, and OOD likelihood minimization, results in almost perfect separation with 99.99% AUROC. CKA plots of each method are presented in Appendix
Table 3: OOD results on CIFAR- 10 vs SVHN. Methods used a ResNet18 ensemble of size 5. (-) indicates ensemble size.
METHOD
NLL (4)
ACCURACY (t)
AUROC (t)
WIDERESNE128- 10 Mushatted at.
GMM
95.97
0.85
97.86
RiSNEr18 (6)
PE
0.122
96.34
1.08
96.18
RESNETIS SVGD-RBF (5)
PE
0.143
95.71
1.19
95.37
RESNETIS SVGD+CKA (5)
PE
0.125
96.25
0.41
96.07
RESNETI& SVGD-HE (5)
PE
0.121
96.23
0.63
96.01
RESNETIS+ (5)
PG
0.120
96.
0.59
RESNEr1&+OOD HE-CKA (5)
PE
0.123
96.24
0.58
99.86

---

Table Performance of five member & ensemble trained on TinylmageNet. All models utilized a
pretrained deep ensemble with no repulsive term, then fine tuned for 30 epochs for each method (including deep ensemble). Methods utilizing CK and HE-CKA utilized linear feature kernel.
MODEL
NLL (1)
ACCURACY (t)
ECE (4)
AUROC PE (t)
SVHN
CIFAR 10/100
TEXTURES (DTD)
ENSEMBLE
0.775
62.95
8.90
89.81
66.85/67.33
66.85 /67.3
68.96
SVGD+RBF
0.926
61.87
16.10
92.76
72.23/73.73
65.67
SVGD+CKApp
0.835
60.15
8.26
94.08
78.40/79.45
66.48
SVGD+HE-CKA
0.732
61.36
3.71
94.10
T2.05/ 22.05/72.86
70.75
ENSEMBLE+HE CKA
0.784
63.10
9.82
92.65
72.13/71.68
70.69
ENSEMBLE+OOD HE-CKA
0.786
61.88
8.02
99.31
$1.56/87.68
90.94
CIFAR-10/100 SVHN. We further evaluated our method on CIFAR-10 and CIFAR-100 datasets, testing outlier detection performance on SVHN (Table (Netzer et al.) 201T). For a fair comparison with D' Angelo & Fortuin (021I) we trained ResNet32 ensembles following the training procedure and parameters described by D' Angelo & Fortuin (2021). For more details regarding model archi- tecture please refer to the aforementioned paper and published code. We used predictive entropy and mutual information for the OOD classification, with the exception of DDU using feature space density Muukhoti al. 2023).
Given that the network presented in D' Angelo & Fortuin (202T) has significantly fewer parameters than typical ResNet, it is expected to an inferior classification accuracy that of standard ResNet. In order to show that our approach generalizes to larger networks, we trained on larger ResNet18 ensembles. Results in Table. show that HE-CKA can maintain similar accuracy as regular deep ensembles while significantly improving on ECE and AUROC of outliers. For the CIFAR-100 results please see Appendix C.3 Our ensemble with standard ResNet18 with batch normalization even slightly outperforms a WideResNet-288
(WRN) using the approach by Mukhoti al. (023). Additionally, the mean inference time for a WRN is 13ms compared to 9ms for the
ResNet18 ensemble on a Quadro RTX 8000.
To further evaluate the effectiveness of our approach to larger models and more complex datasets, we conducted experiments using the TinylmageNet dataset (Le & Yang 2015). We trained ensembles of ResNet18 models and tested their ability to detect OOD samples from SVHN (Netzer et al. (01T), CIFAR-10/100 (Krizhevsky) 2009), and the Describable Textures Dataset (DTD) (Cimpoi al. 2014). Our objective was assess whether the proposed methods could generalize to large-scale settings and improve OOD detection performance without compromising in-distribution accuracy. Training details, and data splits,
TinyImageNet vs
provided in Appendix C.4
Our proposed methods, especially Ensemble+OOD HE-CKA, enhanced OOD detection performance. Notably, Ensemble+OOD HE-CKA achieved an AUROC of 99.31% on SVHN and substantial improvements CIFAR- 10/100 and DTD datasets (Table. g. with AUROC scores of 81.56% 77.64% and 90. .4%, respectively. This improvement in OOD detection did not come at a major expense of ID accuracy.
6 Conclusion
In this paper, explored the novel usage of CKA and MHE feature kernels diversify deep networks. We demonstrated that HE-CKA A is an effective way to minimize pairwise cosine similarity, thereby enhancing feature diversity in ensembles and hypermetworks when applied on top of CKA. Our approach significantly improves the uncertainty estimation capabilities of both deep ensembles and hypernetworks, evidenced by experiments on synthetic lassificatinnrreressson tasks and real image outlier detection tasks. We showed that diverse ensembles utilizing predictive entropy alone can outperform other feature space density approaches, while synthetically generated OOD examples, far from the inlier distribution, can further significantly improve the OOD detection performance. While our current method requires fine-tuning several hyperparameters, such as layer weighting, we believe that future work could explore strategies for automatically estimating these parameters. We hope that our method inspires further advancements Bayesian deep learning, extending its application to wider range of tasks that require robust uncertainty estimation.
10

---

Acknowledgements
This work was funded in part by ONR award N0014-21-1-2052 DARPA HROD1 120C2022, NSF 1751412 and 1927564.
References
Aggarwal, C. C., Hinneburg, A., and Keim, D. A. On the surprising behavior of distance metrics in high dimensional spaces. In Proceedings of the 8th International Conference on Database Theory, ICDT 01, pp. 420-434, Berlin, Heidelberg, 2001. Springerrr Verlag. ISBN 3540414568
Aharon, S. and Ben-Artzi, G. Hypemettwrk--basee adaptive image restoration. In ICASSP 2023 2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 1-5, 2023. doi: 10.1 10.1109//AASP449555... 200.5.55577..... 10095537.
Alaluf, Y., Tov, O., Mokady, R., Gal, R., and Bermano, A. Hyperstyle: Stylegan inversion with hypernetworks for real image editing. In 2022 IEEE/CVF Conference on Computer Vision and Pultern Recognition (CVPR), pp. 18490-18500, 2022. doi: 10. 00.1009/CPR5228882222..0011
Ambrosio, L.,, Gigli, N., and Savare. G. Gradient Flows: In Metric Spaces and in the Space of Probability Measures. Springer Science & Business Media, 2008
Beck, J., Jackson, M. T., Vuorio, R., and Whiteson, Hypernetworks in meta-reiiforreement learning. In Liu, K., Kulic, D., and Ichnowski, J. (eds.), Proceedings of The 6th Conference on Robot Learning, volume 205 of Proceedings of Machine Learning Research, pp. 1478-1487, PMLR, 14-18 Dec 2023. URL https::/pptt ftttp::/pproceedingg mlr.
wttp://dinnn........eeee//o///// presss/v005/eec2333 html
Beck, J., Vuorio, R., Xiong, Z., and Whiteson, S. Recurrent hypernetworks are surprisingly strong in meta-rl. Advances in Neural Information Processing Systems, 36, 2024.
Bhatnagar, A., Wang, H., Xiong, C., and Bai, Y. Improved online conformal prediction via strongly the 40th International Conference on Machine Learning.
adaptive online learning. In Proceedings the ICML'23. JMLR.org, 2023.
Bradley, A. P. The use of the area under the roc curve in the evaluation of machine learning algorithms. Pattern Recognition, 30(7):1145-1159, 1997. ISSN 0031 doi: https://doi.org/1000 1016/ S003 9W031-3200009600042222 URL http:::ttt//wwe wwweecedireeetttt.ceeeeeeeeeeeee http:///rwrr..c.eeeeeeeceeeaaaaa $000313203960014222
Chen, C., Zhang, R., Wang, W., Li, B., and Chen, A unified particle-optimmizaion framework for scalable bayesian sampling, arXiv preprint 1805. 2018.
Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., and Vedaldi, A. Describing textures in the wild. In Proceedings of the IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2014.
D' Angelo, F. and Fortuin, V. Repulsive deep ensembles are bayesian. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 3451-3465. Curran Associates, pttppper.ieeeeepprr/////////eeee pttpp/ppp/////////e//
Inc., 2021. URL 1662266baaaa266bcc5551ccccobbb Pawbob-appppppppp..
weweeeddiiinnnnnnnnnseeeeeeeeeee newrips. cc/ cccppape_fftte files/
Fort, S., Hu, H., and Lakshminarayanan, B. Deep ensembles: A loss landscape perspective. arxiv 2019. arXiv preprint arXiv:1912.0225:: 2019.
Gal, Y. and Ghahramani, Z. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference machine learning, pp. 1050-1059, PMLR, 2016.
Gawlikowski, J., Tassi, C. R. N., Ali, M., Lee, J., Humt, M., Feng. J., Kruspe, A., Triebel, R., Jung, P., Roscher, R., Shahzad, M., Yang, W., Bamler, R., and Zhu, X. X. A survey of uncertainty in deep neural networks, 2022, URL https: : //tp/a/avvvv.//////av//aaaeaaaaa org/ abs /207 03342
11

---

Gretton, A., Bousquet, O., Smola, A., and Schölkopf, B. Measuring statistical dependence with hilbert-schmidt norms. In Jain, S.. Simon, H. U., and Tomita, E. (eds.). Algorithmic Learning Theory, pp. 63-77, Berlin, Heidelberg, 2005. Springer Berlin Heidelberg. ISBN 978-3-540-31666
Ha, D., Dai, A., and Le, Q. V. Hypernetworks, 2016.
Komblith, S., Norouzi, M.. Lee, H., and Hinton, G. Similarity of neural network representations revisited. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Con- ference on Machine Learning. volume 97 of Proceedings of Machine Learning Research, pp. 3519 3529. PMLR, 09-15 Jun 2019. URL pecttp::/pproeeedngg mlr. ww....pees/vv// http://vw/oooobt///900 html
Krizhevsky, A. Learning multiple layers of features from tiny images. Technical report, 2009,
Krueger, D., Huang, C.-W., Islam, R., Turner, R., Lacoste, A., and Courville, A. Bayesian hypemet- works. arXiv preprint arXiv: 1710.0477 2017.
Krueger, D., Huang, C.-W., Islam, R., Turner, R., Lacoste, A., and Courville, A. Bayesian hypernet- works, 2018.
Lakshminarayanaan B., Pritzel, A., and Blundell, C. Simple and scalable predictive uncertainty estimation using deep ensembles. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS' 17, pp. 6405-6416, Red Hook, NY, USA, 2017a. Curran Associates Inc. ISBN 9781510860964.
Lakshminarayanan, B., Pritzel, A., and Blundell, C. Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in neural information processing systems, 30, 2017b.
Le, Y. and Yang, X. Tiny imagenet visual recognition challenge. CS 231N, 7(7):3, 2015.
Lecun, Y., Bottou, L., Bengio, Y., and Haffner, Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11)2228-23344 1998. doi: 10. 10.1109/55 00.1109/5.72691
Liu, C. and Zhu, J. Riemannian stein variational gradient descent for bayesian inference. In Pro- ceedings of the Thirty-Second AAAI Conference on Artificial Intelligence and Thirtieth Innovative Applications of Artificial Intelligence Conference and Eighth AAAI Symposium on Educational Advances in Artificial Intelligence, ANAI' 1ITTAAAAAI///AAT 18. AAAÍ Press, 2018. ISBN 978-1- 57735-800-8.
Liu, C. and Zhu, Geometry in sampling methods: A review on manifold meme and particle-based variational inference methods. Advancements in Bayesian Methods and Implementations, 47:239, 2022.
Liu, C., Zhuo, J., Cheng, P., Zhang, R., and Zhu, Understanding and accelerating particle-basse based variational inference. In International Conference Machine Learning, pp. 4082-4092. PMIR, 2019.
Liu, J., Lin, Z., Padhy, S., Tran, D., Bedrax Weiss, T., and Lakshminarayanan, and principled uncertainty estimation with deterministic deep learning via distance aware- ness. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 7498-7512 Curran Associates, Inc., 2020. URL https: htttps://proceeddingg wtwpeeeddddinnnnnnnneseeeeeeeeee neurips. cttccc//paa. wwcppppprraeeeeeeeeeeeeeeee sumper_filest fiwesfllleppee pttp:///appp////1le////// 005666648234477ccaa22aaaaaa -aaeeeeeeeecso--------.eee pdff
Simple
Liu, Q. and Wang, D. Stein variational gradient descent: A general purpose bayesian inference algorithm. Advances neural information processing systems, 29, 2016.
Liu, W., Lin, R., Liu, Z.. Xiong. L., Schölkopf, B., and Weller, A. Learning with hyperspherical uniformity. In International Conference On Artificial Intelligence and Statistics, pp. 1180-1188. PMLR, 2021.
Maddox, W. J., Izmailov, P., Garipov, T., Vetrov, D. P., and Wilson, A. G. A simple baseline for bayesian uncertainty in deep learning. Advances in neural information processing systems, 32, 2019.
12

---

Mukhoti, J., Kirsch, A., van Amersfoort, J., Torr, P. H., and Gal. Y. Deep deterministic uncertainty: A new simple baseline. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 24384-24385 June 2023.
Nazaret, A. and Blei, D. Variational inference for infinitely deep neural networks. In International Conference Machine Learning, pp. 16447-16461. PMLR, 2022.
Netzer, Y., Wang, T., Coates, A., Bissacco, A.. Wu, B.. Ng. A. Y., et al. Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, pp. 4. Granada, 2011.
Osband, L,, Blundell, C., Pritzel, A., and Van Roy, B. Deep exploration via bootstrapped dqn. Advances in neural information processing systems, 29, 2016.
Ovadia, Y., Fertig, E., Ren, J., Nado, Z., Sculley, D., Nowozin, S., Dillon, J., Lakshminarayanan, B., and Snoek, J. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift, In Wallach, H., Larochelle, H.,, Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019a. URL https: httt::::s//prroeedinggeeee neurips. wwcpppppe__eeeeeeeeeeee wiwes//fille/eeeeeeee 6B55540BcL6621338886772101--- Paper pdf
Ovadia, Y., Fertig, E., Ren, J., Nado, Z., Sculley, D., Nowozin, S., Dillon, J. V., Lakshminarayanan, B., and Snoek, J. Can you frust your model's 's uncertainty? evaluating predictive uncertainty under dataset shift. Curran Associates Inc., Red Hook, NY, USA, 2019b.
Park, N. and Kim, S. Blurs behave like ensembles: Spatial smoothings to improve accuracy, uncertainty, and robustness. In International Conference Machine Learning, pp. 17390-17419. PMLR, 2022.
Raghu, M., Gilmer, J., Yosinski, J., and Sohl-Dickstein, J. Sveca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. Advances in neural information processing systems, 30, 2017
Ratzlaff, N. and Fuxin, L. HyperGAN: A generative model for diverse, performant neural networks. In Chaudhuri, K. and Salakhutdinov, R. (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 5361-5369. PMLR, 09-15 Jun 2019. URL http::tttt////tt /tttpp::/procceednggs mlr. http:/cceddaaaaa.....eeeee//////
html
Ratzlaff, N., Bai. Q., Fuxin, L., and Xu, W. Implicit generative modeling for efficient exploration. In III, H. D. and Singh, A. (eds.), Proceedings of the 37th International Conference Machine Learning, volume 1 119 of Proceedings of Machine Learning Research, pp. 7985-7995 PMLR, 13-18 Jul 2020. URL http::t/pp//::eeeeeee
mlr. press/ http:/1111/raa// 21119//atzlaff20a html
Reddi, S. J., Ramdas, A., Póczos, B., Singh, A., and Wasserman, L. On the decreasing power of kernel and distance based nonparametric hypothesis tests in high dimensions, 2014. URL htttp::/aaxxx //rxiii//axxvv. org/ abs/ 1406.106200 2083
Sarafian, E., Keynan, S., and Kraus, S. Recomposing the reinforcement learning building blocks with hypernetworks. In Meila, M. and Zhang. T. (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 9301-9312 PMLR, 18-24 Jul 2021. URL https: http:tttsss/rrceednggs mlr. mww..pres//aeo wtw.ppres//vii//raaaaaaa.am wttps///raaaaaaaa an2ia....nn.aaammaaaa html
Van Amersfoort, J., Smith, L., Teh, Y. W., and Gal, Y. Uncertainty estimation using a single deep deterministic neural network. In Proceedings of the 37th International Conference Machine Learning, (CML'20. JMLR.org, 2020.
Villani, C. ct al. Optimal transport: old and new, volume 338. Springer, 2009.
Wang, X., Zheng, R., Sun, Y., Jia, R., Wongkamjan, W., Xu, H., and Huang, F. Coplanner: Plan to roll out conservatively but to explore optimistically for model rl, 2023. URL https://arre :/axxivv///xx org/ abs/2310 07220
13

---

Weber, R., Schek, H.-J., and Blott, S. A quantitative analysis and performance study for similarity- search methods high sighddimessional spaces. Proceedings of the 24rd International Conference on Very Large Data Bases, VLDB '98, pp. 194-205 San Francisco, CA,, USA, 1998. Morgan Kaufmann Publishers Inc. ISBN 1558605665.
Welling, M. and Teh, Y. W. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th international conference machine learning (ICML-I1), pp. 68 681-688. Citeseer, 2011.
Wen, Y., Tran, D., and Ba, J. Batchensemble: An alternative approach to efficient ensemble and lifelong learning, 2020.
Wilson, A. G. and Izmailov, P. Bayesian deep learning and probabilistic perspective of generalization. arXiv preprint arXiv:2002.0879), 2020.
Xiao, H., Rasul, K., and Vollgraf, R. Fashion-MNIST: a Novel Image Dataset for Benchmarking August 2017. doi: 10.48550/
Machine Learning Algorithms. arXiv e-prints, art. arXiv.1708.07 077477.
Yang, Y. and Loog, M. Active learning using uncertainty information. In 2016 23rd International Conference on Pattern Recognition (ICPR), pp. 2646-2651. JEEE, 2016.
Zhmoginov, A., Sandler, M., and Vladymyrov, M. Hypertransformer: Model generation for super- vised and semi-supervised few-shot learning. In International Conference Machine Learning, pp. 27075-27098. PMLR, 2022.
14

---

A Minimizing Model Similarity as Particle-based Variational Inference
particle sampled from distribution. Hence, the training process can be seen as a variational inference problem in terms of minimizing the KL--divereence between the empirical distribution defined by the particles and the training data. In this section, we relate Eq. (4) with an RKHS and apply it under a particle- based variational inference framework for supervised learning. Particle-based variational inference methods (Liu & Wang] 2016; Chen et al. 2018: Liu et al. 2019) can be viewed from a geometric perspective approximating the gradient flow line the Wasserstein space P2(x)) (Liu & Zhu 2022). Let 9r denote the gradient flow line of the KL-divergence w.r.t. some target (data) distribution p E P2 (2)). for an absolutely continuous curve qt, its tangent vector at each is given by (Villani et al. 2009 Ambrosio et al. 2008).
In Bayesian deep learning, each network in ensemble be
grad kL(@lp) = -V logp + log 4t-
The core idea of particle-based is to represent q: by a set of particles {2;} and adopt a first-order approximation of qt++ through a perturbation of {.;}. In Eq. (7). while the first term corresponds to the maximum (data) likelihood term of supervised learning, the second term is intractable. Different variants of particle-base VI methods tackle this term via different approxination'mmothing methods. Inspired by SVGD (Liu & Wang 2016), approximate V log q: in RKHS corresponding the HE-CKA A kernel.
In particular, let (6: direction of perturbation can be viewed as a vector field on X', which is a tangent vector the tangent space T. where id is the identity transformation. Under the particle representation {x;} q. let (x) denote the distribution represented by transformed particles {<b(x:)) To approximate V log q. we want to find the perturbation direction of (xr,) that corresponds to the steepest ascend direction
}²} denote the space of transformations on space X' of particles,
of the loss (Ø) = Egng log 4o (z)] at Φ = id, which is the gradient of J (ő) the tangent space
T T. This gradient is given by the following Lemma, with the proof given in Appendix B.
Lemma A.1. For (()) Egzgl log (x))],
VoJ(+)() -=
Barng [V K.K.CaK (2,
(8)
where K KBR-CKA is the HE-CKA kernel defined by Eq. ④ In practice, Eq. 1 can be approximated by the empirical expectation,
V (oT(())
s Ear IV V KEn.KRa (z, -)]
(9)
d=id
In this paper, we apply Eq. 7 and Eq. 9 to the supervised tasks of classification and regression.
B Proof of Lemma A.1
Proof. To compute the gradient of [ Brang log to id, by definition, compute as follows the differential of J at d. Vo E To=idT,
dJ)(v) d=
J(6 +to+
di
d
Enng
log
(o (2x)
dl
t=0
g(x)
Eano
log
dl
1==0
det
O(d+tu)) 8x
aΦ
-1
d
O( tv)
E
Exzg
Tr
dx
dx
t=0
Ovs
E Eggn
dxi
(Euvng V (I, 11, 2)H
(10)
15

---

where 7. is the RKHS with corresponding HE kernel KHE-CKA, and the following identities are used,
g(x))
(s(x)=
det
0Φ
d log det Al Tr(A1-dA)
(x)(x)
(V K Kun. (x, (x))
Oxd
By definition of gradient,
dJa(v) = (VoJ d=idd |= u)
comparing with Eq. 10
VoJ(O) p=
Bainn V (nnnccca )))
C
Training Details
C.1 Smoothing Terms and Layer Weighting
To effectively train with the HE-CKA kernel for the repulsive term we found that it is essential to smooth out the particle energy using an Caist on the geodesics and care on the cosine similarity values. With larger smoothing terms we can reduce the large gradients very similar particles, with CKA values near 1, and ensure other particles still receive some repulsive force. Additionally, Eq. (4) equally weighs every layer in the network. It has been empirically shown that the first few layers of deep neural networks have high similarity (Kornblith et al., 2019). which indicates that initial layers learn more aligned features. Enforcing strong hyperspherical uniformity, or low CKA, of feature Gram matrices may remove useful features. We have noticed that it is difficult to train models with uniform HE-CKA layer weighting scheme of L/L. To fix this we applied a custom weighting scheme that typically increases linearly with the number of layers, with latter layers weighted higher. We found that using weighting scheme in Eq allowed for finer control of the repulsive term. Typically the first layer in a CNN is simple feature extractor, and depending on the depth of the network could assign too high of a repulsive term on the first layer. Additionally, the last layer could have too high of weight and ruin inlier performance. We utilize custom weighting scheme using the vector w [wI,... Wr... ), where ||w||1 is typically 1. We define the smoothed HE-CKA version for training HL (Eq. III
L
M.M Wi Σ
HE (K) M(M - 1)
Σ
1.0 + Caist arccos (K "T"" /(1.0 Earc)))))))))))) )xxc)) + Edist
(11)
The smoothing terms gives us finer control over the interaction between particles and prevents exploding or vanishing from the energy term. Although both édist and 6are have a similar effect it is more important to include the Eare as the gradient of arccos approaches too near -1 and 1 without any smoothing term. As demonstrated with the cosine similarity feature kernel used in Fig. 77] It is advised to set Cdiss as a small constant then vary Care and 7 parameters when searching for the right kernel. Optionally,
may replace the Riesz-s based kernel with an exponential one,
ie e e-* arccos R."TT RT" /(L0+cm)))-aa which provides more numerically stable gradient, and more intuitive understand growth term s. As discussed in Appendix. D Dhe the parameters for Y 8, and w need to be selected. For MNIST experiments we performed a bayes sweep across parameters to select the layer weighting schemes, smoothing terms, and repulsive terms. For larger models, such as the CIFAR and Tiny Imageee experiments, we selected, by trying few combinations, a weighting schemes by testing values 7 E [0.25, 1.5), E [0.01, 10.0), and using layer weighting scheme un that increases proportionally with I, and with different first layer and last layer values.
16

---

Earc 0.010
Earc 0.015
Earc 0.020
Facc 0.025
Earc 0.030
P
Figure 7: Effect of smoothing term when using cosine similarity based HE-CKA kernel with SVGD on inlier points only. All methods trained with AdamW (Ir=0.05, wd=0.0075), HE-CKA 2, and Editt 0.00025, and w [0.2, 0.35, 0.85, 0.05] for Ik steps.
C.2 Dirty-MNIST
The Dirty-MNIST experiments utilized an ensemble of LeNet5 models with modified variance preserving gelu activation function. Models were trained using AdamW with Ir =r= 0.0065 and weight decay of 0.001 for 50 epochs, except for Hypernetwork training which was trained for 85 epochs with AdamW with Ir 0.0025 and weight decay 0.0025. Details such Ir warmup. gradient clipping, repulsive terms, layer weighting, HE-CKA smoothing terms, and more can found the official repository.
C.3 CIFAR-10/100
Table 5: OOD results CIFAR-100 SVHN. Methods used ResNet18 ensemble of size
MODEL
OOD METHOD
NLL
ACCURACY (1)
ECE (1)
AUROC SVHN (1)
ENSEMBLE
PE
0.74
81.81
5.77
89.62
ENSEMBLE+HE-CKA ENSEMRLE+OOD HE-CKA
PE
0.74
80,7 72
3.90
91.17
0.76
80.61
4.11
99.44
Additionally, we have some results showing much improvement on CIFAR- 100 OOD detection with SVHN when trained with synthetic OOD examples in Table 5 With about 10% improvement in AUROC between the inlier and outlier sets. We applied HE-CKA A to an ensemble of ResNet18 models and evaluated the approach on CIFAR-10 (Table 3 and CIFAR-100 (Table 5 The models were trained for 200 epochs using SGD with a learning rate of 0.1 and weight decay 5e-4. The HЕ-CKA kernel used linear kernel for feature calculation with the exponential kernel
and (OOD) data, the following values were adjusted: y 0.5, ROoD 0.75, and B 0.75. Details regarding layer weighting and smoothing are available in the repository. Forty-eight OOD samples were taken per batch for all CIFAR experiments, where applicable.
1.0. For experiments with
The feature repulsion term was not applied to every convolution of the ResNet18 architecture. To conserve computational resources, only a subset of layers included. Specifically, the selected layers comprised the initial convolutional layer, the output of every other ResNet block within the first of the four layers, the output of all blocks in the last two layers, and the final linear layer.
Training details regarding ResNet32 experiments follow the training procedure, learning rate scheduling, and hyperparameters given by D' Angelo & Fortuin (2021). The hypernetwork variant, due to the difficulty of training, was trained for 180 instead 143 epochs, and utilized group based normalization to stabilize feature variance.
C.4 Tiny ImageNet and Particle Number Ablation
All models utilized a pretrained deep ensemble without any repulsive term and then fine-tuned using different methods, including our proposed approach. Methods utilizing CKApw and HE-CKA employed linear feature kemel. For OOD detection, we used predictive entropy (PE) computed from the ensemble predictions. Additionally, we generated synthetic OOD data from noise and augmented TinyImageNet samples to enhance the OOD detection capability. We utilized a training split of
17

---

80: 10 for training, validation, and testing respectively. Training utilized SGD with a learning rate of 0.005 and weight decay of 5e-4. We additionally performed particle number ablation on the R + HE-CKA A ensemble, utilizing the same repulsive term, showing improvements in accuracy, and outlier detection, when going from 2 particles (Table. 6
Table 6: Ablation on number of training particles for ResNet18 + trained with HE-CKA TinyImageNet.
PARTICLES (1)
ID ACCURACY (f)
ECE (4)
AUROC PE (f)
SVHN
CIFAR-IO/CIFAR
TEXTURES (DTD)
0.791
59.21
5.21
89.87
67.34
68.48
0.771
60.86
5.74
91.57
69.05/70.59
69.31
0.761
62.26
6.90
92.92
70.83/71.4 77444
70.89
0.784
63.10
9.82
92.65
72.13 77.68
70.69
D Limitations
With approach,
able to resolve of the issues related tackling permutation of feature channels, which normally pose challenges for Fuclidean-based kernels like RBF However, constructing model kernel based layer features requires tuning the repulsive term (7), the likelihood term (3), and the layer weighting terms (w). This introduces numerous hyperparameters that need adjusted depending on the dataset and the architecture in use. Future work could explore automating the estimation of these parameters or simplifying the HE-CKA kernel. Although the assumption that the first few layers should have small repulsive terms seems clear, the weighting and smoothing of later layers remain unclear. This work only explored repulsive terms that increased with layer depth; the dynamics of which layers should have more repulsion are not well understood and have not yet been explored. Additionally, feature-based kernels based on CKAp Ap sensitive to number of particles and the batch size sampled, as the dimensionality of the hypersphere changes, impacting the repulsive terms. One possible solution could be to construct normalized HF-CKA variant, which precomputes the minimum and maximum energy available on the (N² 1)-sphere with M models.
E
Synthetic OOD examples
E.1 OOD points for 2D datasets
The selection of OOD help force ensemble members to learn unique internal features for outliers, resulting in more diverse output features. For simple datasets it can be easy to construct an OOD set by simply taking min/max + padding shown in Fig. 8 for the 2D classification tasks.
10
5
1.0
0
0.55
-5
10
0.0
-10
10
Figure 8: Example boundary set for 2d classification task. Note the boundary OOD set can be far away from in distribution points.
18

---

Table 7: Average pairwise unbiased CKA across all layers of an ensemble of 5 ResNet18 trained on CIFAR-10. 10.
METHOD
LAYER MEAN CKA
RESNETI8 DEEP ENSEMBLE
0.955
RESNETI8 SVGD+RBF
0.972
RESNETI8 SVGD+CKA
0.870
RESNETI8 SVGD+HE
0.816
RESNETI8 HE
0.479
E.2 OOD Images for MNIST and CIFAR
Images are harder to define boundary/ood points, but we found in practice that generating images by transforming inliers to outliers via typical augmentations, and generating synthetic random channel data worked well in practice. Our approach to transforming inlier points to outlier points consists of the following augmentations in random order: blurring, affine transform, perspective transform, elastic deformations, erasures, Gaussian noise, Gaussian blurring and inversions. Examples of such images are shown in Fig. Forr MNIST, Fig. TO for CIFAR, and Fig. [To for TinyImageNet. The ID to OOD set of images accounts for roughly 30-40% of the dataset, whereas the other 60% are randomly generated. Synthetic OOD images are generated via combinations of perlin noise, simplex noise, gaussian noise, lines, alternating grids, inversions, and random area thresholding, For images with more than one channel, such as CIFAR and TinyImageNet, we either apply different noise to each channel, use the same method but different seed, or occasionally broadcast one channel along all channels.
F MNIST CKA Results
We present the CKA plots of each method: Ensemble (Fig. 12p Hypernetwork (Fig. 13) SVGD
+ RBF (Fig. 14), SVGD CKApa pw (Fig. 15). SVGD + HE-CKA (Fig. 16), Ensemble + HE-CKA
(Fig. 17 Ensemble OOD HF-CKA (Fig- [8). and Hypernetwork + OOD HE-CKA (Fig. 19).
Each plot shows a grid comparing layerwise estimation of pairwise CKA, equipped with a linear
feature kernel on the inlier DirST-MNIST dataset, while using unbiased estimator for CKA. To our surprise we found that CKApp and HE-CKA results in fairly similar unbiased CKA estimates across the ensemble, but overall performance of the models in uncertainty estimation and accuracy presented in Table. by HE-CKA were better. Nevertheless, methods utilizing CKAp pw and HE- IIECKKA A kernels significantly reduce similarity of features compared methods with no repulsive terms or RBF based kernels. This was especially true for our hypemetwork tests.
G Memory Footprint and Time Complexity
We compare the training runtime of our HE-CKA A term to ParVI based methods presented in D' Angelo & Fortuin (202T). We evaluated mini-batch training time averaged over 50 batches Quadro RTX 8000. Each method used ResNet18 fed with batches of 128 images from CIFAR- 10. The results are presented in Table 8 Reported CUDA memory includes all ensemble members, loss, batch statistics, feature kernels (if applicable), and gradients. We see that all ParVI methods increase training time by 2.2x for 5 ensemble members and 1.2x for 10. Given that HE-CKA is applied layerwise, our method does require a slight increase in memory compared to the other ParVI methods, but is comparable complexity for each minibatch of HE is O(LN2n?) compared to typical function space O(N2n²) or weight space O(n²) kernels, where is the number of particles, N is the mini-batch size and L is the number of layers we use to compute HF-CKA. However, n and are typically small, 5 and up to 128 respectively in experiments, and one our experiments. While using the HE- CKA kernel does have an increased memory and computation cost than using the RBF kernel. the benefit of having kernel invariant to feature permutations and scaling are worth the minor additional cost.
other methods in terms of training batch time increase. The time
subset of the layers I,, as we did with
19

---

10
10
20
20
0
10
10
20
20
20
20
Figure 9: MNIST generated OOD set.
20

---

20
20
20
20
20
20
20
0
20
20
Figure 10: CIFAR generated OOD set.
21

---

25
50
0
25
50
25
25
50
50
50
50
Figure 11: TinyImageNet generated OOD set.
22

---

1.0
4
0.59
0.66
0.77
0.83
0.89
0..8
3
0.77
0.82
0.89
0.90
0.83
00.6
Layer
2
0.86
0.90
0.93
0.89
0.77
0.4
1
0.96
0.82
0.66
0.2
0
0.99
0.93
0.86
0.77
0.59
0.0
0
2
4
Layer
Figure 12: CKA values of deep ensemble.
1.0
4
0.58
0.67
0.80
0.90
1.00
0.8
0.64
0.71
0.88
1.00
0.90
0.66
Layer
2
0.80
0.86
1.00
0.88
0.80
0..4
0.91
1.00
0.86
0.71
0.67
0.2
0
1.00
0.91
0.80
0.64
0.58
0.0
0
2
4
Layer
Figure 13: CKA values of hypernetwork.
Table 8: Training compute and memory usage of ensemble between various ParVI methods
CIFAR-10.
APPROACH
ENSEMBLE SIzE
CUDA MEMORY (GB)
BATCH TIME (MS)
BATCH TIME INCREASE
DEEP ENSEMBLE SVGD RBF
5
0.75
75 + 33
1.00
5
1.13
163 1: 23
2.17
WGD RBF
1.14
17
2.20
SSGE-WGD RBF
5
1.58
2.59
HE-CKA (OURS)
5
1.65
163 + 34
2.17
ENSEMBLE
1.35
1.00
SVGD RBF
10
2.18
346 +: 25
1.16
KDE-WGI RBF
10
2.19
346 + 17
1.16
SSGE-WOR RBF
10
3.13
391 + 22
1.32
HE-CKA (OURS)
10
3.29
395 +
1.33
23

---

1.0
4
0.57
0.61
0.66
0.62
0.73
0.8
3
0.72
0.74
0.76
0.68
0.62
00.6
Layer
2
0.84
0.87
0.87
0.76
0.66
0.4
1
0.94
0.74
0.61
0.2
0
0.98
0.91
0.84
0.72
0.57
0.0
0
2
4
Layer
Figure 14: CKA values of ensemble trained with SVGD RBF.
1.0
4
0.39
0.27
0.14
0.12
0.12
0.8
3
0.40
0.28
0.15
0.13
0.12
0.66
Layer
2
0.45
0.31
0.17
0.15
0.14
0.4
1
0.45
0.31
0.28
0.27
0.2
0
0.96
0.65
0.45
0.40
0.39
0.0
2
4
Layer
Figure 15: CKA values of ensemble trained with SVGD CKApp regularization.
24

---

1.0
4
0.41
0.26
0.13
0.10
0.10
0..8
3
0.42
0.27
0.13
0.11
0.10
00.6
Layer
2
0.46
0.30
0.15
0.13
0.13
0.4
0.66
0.47
0.30
0.27
0.26
0.2
0
0.97
0.66
0.46
0.42
0.41
0.0
0
2
4
Layer
Figure 16: CKA values of ensemble trained with SVGD НEECKA regularization.
1.0
4
0.35
0.22
0.11
0.10
0.8
3
0.36
0.22
0.14
0.11
0.11
0.6
Layer
0.39
0.24
0.15
0.14
0.13
0.4
1
0.58
0.38
0.24
0.22
0.22
0.2
0
0.81
0.58
0.39
0.36
0.35
0.0
4
Layer
Figure 17: CKA values of a deep ensemble trained with HE-CKA regularization.
25

---

1.0
4
0.45
0.46
0.23
0.17
0.15
0.88
0.48
0.48
0.24
0.17
0.17
0.6
Layer
2
0.56
0.56
0.29
0.24
0.23
0.4
0.78
0.73
0.56
0.48
0.46
0.2
0
0.78
0.56
0.0 0.48
0.45
0
2
4
Layer
Figure 18: CKA values of a deep ensemble trained with OOD + HE-CKA and entropy terms.
1.0
4
0.18
0.15
0.11
0.07
0.07
0.8
3
0.18
0.16
0.12
0.07
0.07
0.6
Layer
2
0.22
0.17
0.12
0.11
0.4
0.55
0.43
0.22
0.16
0.15
0.2
0.88
0.55
0.24
0.18
0.18
0.0
0
2
4
Layer
Figure 19: CKA values a deep ensemble sampled from a hypernetwork trained with OOD HE-CKA and entropy terms.
26

---

H
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:
See abstract and introduction.
2. Limitations
Question: Does the paper discuss the limitations of the work performed by the authors?
Answer: [Yes]
Justification: Limitations on training time and memory consumption was shown Table This paper has no ethical limitations. Additional limitations of our approach are discussed in Appendix. D
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: See Appendix and B
4. Experimental Result Reproducibility
Question: Does the paper fully disclose all the information needed to reproduce the main ex- perimental results 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]
The proposed algorithm is completely defined and the network structures are either defined/referencee
Justification:
standard.
5. Open access to data and code
Question: Does the paper provide open access to the data and code, with sufficient instruc- tions faithfully reproduce the main experimental results, as described in supplemental material?
Answer: [Yes]
Justification: The code is publicly available, and contains the relevant instructions at the following public repository httpp:///itthb: com/Deop-Machine- Visioo/
he- entemlessebles
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 experimental setups are described clearly. Training details and data splits are described in Appendix. C
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: Standard deviations are provided whenever necessary by multiple runs.
8. Experiments Compute Resources
For each experiment, does the paper provide sufficient information on the com- puter resources (type of compute workers, memory, time execution) needed reproduce the experiments?
Question:
27

---

Answer: [Yes]
Justification: See Appendix, G for details regarding memory footprint, and a comparison to other ParVI methods.
9. Code Of Ethics
Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics stttps///porrrss.cc/palll//eeees
Answer: [Yes]
Justification: We conducted the research ethically.
10. Broader Impacts
Question: Does the paper discuss both potential positive socictal impacts and negative societal impacts of the work performed?
Answer: [NA]
Justification:
This paper does not have significant social impact to be discussed.
11. Safeguards
Does the paper deseribe safeguards that have been put in place for responsible release of data or models that have high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
Question:
Answer: [NA]
Justification: This paper does not have high risk for misuse.
12. Licenses for existing assets
Are the creators or original owners of assets (e.g.. code, data, models), used in the paper, properly credited and the license and terms of use explicitly mentioned and properly respected?
Question:
Answer: [Yes]
Justification: We have cited all the appropriate sources.
13. New Assets
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
Answer: [NA]
Justification: We didn't iidn't release new assets.
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 participants and screenshots, if applicable, as well as details about compensation (if any)?
Answer: [NA]
Justification: We did not use crowdsourcing or human subjects.
15. Institutional Review Board (IRB) Approvals 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: We did not conduct human subject research.
28


Reviews:
[{"review_id": "LDgKOJbIDg", "reviewer": "Reviewer_JKj8", "summary": "The authors proposed to improve the quantification of particle diversity in deep ensemble with hyperspherical energy (HE) on top of the CKA kernel. They further integrate the HE kernel in particle-based variational inference (ParVI) and generative ensemble with hypernetwork frameworks. The methods are evaluated on both synthetic experiments and small-scale classification datasets.", "questions": "See weakness", "limitations": "The authors do not address potential negative social impact since the paper is predominantly theoretical.", "rating": 6, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "1. The motivation of the paper is clear: addressing mode collapse in deep ensemble by using a kernel that is more suitable to measure particle diversity of neural networks (HE kernel).\n2. The advantage of HE kernel has been demonstrated in two different ensemble frameworks (parVI & generative ensemble with hypernetwork), and the empiricall performance of the method looks Ok.", "weaknesses": "The datasets considered are a bit outdated and the networks considred seem to be quite small, such that overall the performance is on the lower end (e.g. 85% acc. for CIFAR10, while many BDL methods can easily achieve accuracy higher than 90%). Fuerthermore, recent BDL papers typically consider larger datasets (such as ImageNet) and deeper networks. It is necessary to consider larger datasets and larger models in order to assess the practical effectiveness of the method.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "### CIFAR-10 Performance\nWe did evaluate our approach using a standard ResNet18, shown in Table 4 of the manuscript. The inlier performance of all approaches (The “Accuracy” column in Table 4.) is above 95%. We compared using the permutation invariant kernels $\\text{CKA}_\\text{pw}$, $\\text{HE}$ with RBF. Further explanation can be found in the general remarks.", "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": "s98rTaQw2Y", "reviewer": "Reviewer_Wp13", "summary": "The paper “Minimizing Hyperspherical Energy for Diverse Deep Ensembling” explores the use of Centered Kernel Alignment (CKA) and Minimization of Hyperspherical Energy (MHE) in Bayesian deep learning to enhance the diversity of ensemble models and parameters generated by hypernetworks. By incorporating these techniques, the authors aim to improve uncertainty quantification in both synthetic and real-world tasks, which is quantified by measuring OOD detection performance and calibration. The key contributions include proposing CKA as an optimization objective and utilizing MHE to address the diminishing gradient issue, leading to more stable training and better performance in uncertainty estimation.", "questions": "- When running the LeNet comparisons agains DDU, was the model trained with spectral normalization (a requirement for DDU to function well) and how was the regularization strength determined?\n- Why was the normalization-free variant of LeNet used for some methods whereas the standard variant for the DDU baseline?\n- Page 9, line 289: Was the GMM fitted to the features of the pre-classification layer. I.e. to the features used by the last linear layer?", "limitations": "The work correctly points out that the small size of the datasets is one of the main limitations. Generally, seeing the efficacy of the approach in a larger scale training setup would significantly improve the paper.", "rating": 7, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "- **Original:** The paper introduces a novel approach by combining CKA and MHE to enhance the diversity of deep learning ensembles and hypernetworks, which is a fresh perspective in Bayesian deep learning.\n- **Detailed experiments:** The experimental results are comprehensive and demonstrate significant improvements in uncertainty quantification across various tasks, showing the practical effectiveness of the proposed methods.\n- **Well-written:** The paper is well-structured, with clear explanations of the methods and thorough discussions of the results. The figures and tables effectively illustrate the performance improvements.", "weaknesses": "- The comparison of the approach in terms of OOD detection performance is slightly biased due to leveraging of generated OOD samples. Here in order to differentiate the contribution of the method from the incorporation of additional information a further experiments comparing against DDU would be warranted. In particular one could imagine adding a term to the loss which encourages low likelihood of the fitted GMM on OOD samples.\n - The comparisons in Figure 2 paint a slightly overly optimistic picture for the OOD HE approaches. In 2 dimensions the problem becomes quite trivial given negative / OOD samples. The difficulty of generating enough samples to cover the OOD volume becomes exponentially more difficult with increasing dimensionality of the input space and is especially easy when the diversity of the data is limited.\n - (Related to prior point) the datasets used to show the efficacy of the OOD approach are rather simple and small such that sample diversity is limited. Running one experiment on a larger dataset like imagenet would be very beneficial to show that the method can also work in the context of highly diverse input distributions and high dimensionality of the input space.\n - There seems to be a mistake in table 2 row Ensemble + HE, column PE\n - I recommend renaming Fig1 d and e to Cossim evaluation and HE evaluation as using objective gives the impression that the data shown is from models trained using these objectives.\n - As the work points out that applying the method to larger datasets would in principle be possible, this might be a good additional comparison to include. Many comparison approaches will have issues in this case, but comparison to other ensembling based approaches would be feasible.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "## Questions\n>When running the LeNet comparisons against DDU, was the model trained with spectral normalization (a requirement for DDU to function well) and how was the regularization strength determined?\n\nYes, all DDU models were trained with spectral normalization. We picked the best regularization for experiment balancing AUROC/inlier accuracy from values tested in the range $1.0-5.0$.\n\n>Why was the normalization-free variant of LeNet used for some methods whereas the standard variant for the DDU baseline?\n\nTo ease the transition to hypernetworks, we aimed to construct a method not requiring feature normalization. We utilized weight standardization (WS) but did not adapt WS to work along with spectral normalization, and found no difference in inlier performance.\n\n>Page 9, line 289: Was the GMM fitted to the features of the pre-classification layer. I.e. to the features used by the last linear layer?\n\nYes, the GMM was fitted to the features of the pre-classification layer.", "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": "M9xwO1ZA7c", "reviewer": "Reviewer_jUbb", "summary": "This paper introduces the hyperspherical energy as an objective to prompt the diversity of particles in BNNs. It claims that the hyperspherical energy approach can avoid permutation invariance in traditional diversity metrics.", "questions": "1. The diversity evaluations are limited to synthetic data. I am not convinced that the proposed method can be scaled up.\n\n2. Important ablation studies are missing. For example, different model architectures and the number of particles.", "limitations": "1. This paper is restricted to relatively small Bayesian neural networks, and does not discuss the scalability.\n\n2. The proposed method can improve uncertainty estimation, but fails to improve accuracy.", "rating": 4, "confidence": 3, "soundness": 2, "presentation": 3, "contribution": 2, "strengths": "I agree that the diversity of particles in BNNs is an important problem. The proposed method introduces hyperspherical energy, which can avoid permutation invariance. This invariance is mainly due to the complex structures of DNNs, which previous Bayesian Inference methods have long ignored.", "weaknesses": "The technical contribution of this paper is not strong enough. Only a new regularization term is added to the standard ensemble framework. The idea of hyperspherical energy comes from previous works, and I do not recognize significant changes from previous works.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "## Technical Contribution\nWe strongly disagree with the reviewer’s dismissal of our contribution as “merely a regularization term”. Comparing neural networks in particle-based variational inference (ParVI) has been a difficult problem and most proposed comparison kernels suffer from the lack of channel permutation invariance (i.e. just permuting channel positions lead the networks to be different from each other according to those kernels whereas the function they realize would be exactly the same), and our exploration of pairwise CKA kernels in ParVI solves this problem and provides a differentiable kernel that is invariant to channel permutations and isotropic scaling. These important properties have long been ignored in the ParVI. We additionally add HE to work on top of the CKA kernel, and our experiments demonstrated that it is more effective at minimizing a cosine similarity (in our case CKA) than minimizing cosine similarity itself (Section 3). We believe we are the first to adopt MHE for particle variational inference (ParVI) as well as the first to propose using MHE on top of a pairwise CKA kernel to compare networks. Other reviewers also believe that our approach is well-motivated/novel. \n\n## Particle Number Ablation\nWe agree that performing ablations on the number of particles is important. We observe improvements in inlier accuracy and outlier detection performance as the number of particles increases, with four and five particles performing similarly (Table 2). We will add more ablations on particle numbers in the final version of the paper. \n\n\n| Training Particles | NLL $\\downarrow$ | ID Accuracy $\\uparrow$ | ID ECE $\\downarrow$ | AUROC SVHN $\\uparrow$ | AUROC CIFAR-10/CIFAR-100 $\\uparrow$ | AUROC Textures (DTD) $\\uparrow$ |\n| -------- | -------- | -------- | -------- | -------- | -------- | -------- | \n| 2    | 0.791     | 59.21     | 5.21     | 89.87     | 67.34/68.44     |  68.48    |\n| 3    | 0.771     | 60.86     | 5.74     | 91.57     | 69.05/70.59     |  69.31    |\n| 4    | **0.761**     | 62.26     | 6.90     | **92.92**     | 70.83/71.44     |  **70.89**    |\n| 5   | 0.784     | **63.10**     |  9.82    | 92.65     | **72.13**/**71.68**     | 70.69 |\n\n**Table 2.** Ablation on number of training particles for ResNet18 + $\\text{HE}$ trained with TinyImageNet.\n\n## Questions\nContrary to the reviewer’s claim, we did, evaluate on MNIST/CIFAR10/CIFAR100 in the original submission, and additionally TinyImageNet in the rebuttal (see general comments). None of these datasets are synthetic. Synthetic examples were included for visualization purposes but those weren’t the main results in the paper.\n\n## Limitations\nWe did discuss scaling and memory footprint in Appendix F. Results showed that our algorithm does not increase training time significantly over regular ensembles.", "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:
## General Remarks
We are grateful to the reviewers for their constructive feedback. Below, we respond to questions and concerns shared by the reviewers regarding running on a larger dataset.


## Larger Dataset
We agree with the reviewers that the evaluation of BDL on a larger dataset is desirable. Due to time constraints of the rebuttal period, we applied HE to an ensemble of ResNet18 on TinyImageNet (Table 1). Encouraging feature diversity with $\text{CKA}_\text{pw}$ and $\text{HE}$ significantly improves uncertainty estimation while minimally impacting inlier performance. Besides, encouraging feature diversity on synthetically generated OOD examples, albeit highly different from the testing examples, further significantly improves the performance of both inlier classification and outlier detection. We will add more ImageNet-level experiments in the final version.

| Model | NLL $\downarrow$ | ID Accuracy $\uparrow$ | ID ECE $\downarrow$ | AUROC SVHN $\uparrow$ | AUROC CIFAR-10/CIFAR-100 $\uparrow$ | AUROC Textures (DTD) $\uparrow$ |
| -------- | -------- | -------- | -------- | -------- | -------- | -------- | 
| ResNet18 (5)    | 0.775     | 62.95     | 8.90     | 89.81     | 66.85/67.33     |  68.96    |
| SVGD + RBF (5)     | 0.926     | 61.87     |  16.10    | 92.76     | 72.23/73.73     | 65.67     |
| SVGD + $\text{CKA}_\text{pw}$ (5)     | 0.835     | 60.15     |  8.26    | 94.08     | 78.40/79.48     | 66.48     |
| SVGD + $\text{HE}$ (5) | 0.732 | 61.36 | **3.71** | 94.10 | 72.05/72.86 | 70.75 |
| ResNet18 + $\text{HE}$ (5)     | 0.784     | 63.10     |  9.82    | 92.65     | 72.13/71.68     | 70.69 |
| ResNet18 + $\text{HE}$ OOD (5)   | **0.606**     | **68.51**     | 11.49     | **98.54**     | **79.00**/**81.09**     | **89.18** |

**Table 1.** Performance of ResNet18 ensemble trained with TinyImageNet. All models are pretrained with a deep ensemble with no regularization, then fine tuned for 20 epochs with each method (including the deep ensemble). Standard predicted entropy is used in the AUROC calculation. Synthetic OOD generated from noise and augmented TinyImagenet.


## Larger Models
We have already included results with a ResNet18 with over **96%** inlier accuracy performance on CIFAR-10 in the original manuscript (Table 4 (Column 4 Accuracy is inlier accuracy)). The smaller ResNet32 models,  with ~85% inlier performance (Table 2.) were additionally included for a fair one-to-one comparison with the work presented in (D’Angelo et al. 2021), . Additionally, we reported scaling time/memory costs with typical weight space function space ParVI methods in Appendix F. Our approach is comparable to other ParVI methods in speed and incurs a slightly larger memory cost due to feature kernel construction.

Meta-review: In this work, the authors propose a novel approach to increase feature diversity in deep ensembles by minimizing hyperspherical energy (MHE) on top of Centered Kernel Alignment (CKA) kernels. The reviewers praise the work for its originality, well-written presentation, and comprehensive experiments demonstrating significant improvements in uncertainty quantification. However, they are critical of the limited evaluation on small datasets and the lack of ablation studies on particle numbers and model architectures. In their rebuttal, the authors clarify their contributions, address concerns about dataset size and model performance, and provide additional experiments on TinyImageNet. This addressed the reviewers' concerns about dataset size and model performance but did not fully address their concerns about the technical contribution and scalability.

After the rebuttal and discussion, the paper is very borderline, where two reviewers lean towards acceptance, while one leans towards rejection. The main criticism on which the decision hinges seems to be the small scale of the experiments and the lack of ablation studies. Both of these have been provided by the authors in their rebuttal.  I trust that the authors add those additional results to the camera-ready version and might even add more ablation studies that have not yet been provided, which would further strengthen the paper. Based on this, I recommend acceptance. However, I would further recommend that the authors seriously take all the reviewer feedback into account for the camera-ready version.
Decision: Accept (poster)