Manuscript Offprint
arXiv:2609.06474Learning Kernels by Alignment for Multiclass Bayes Classification
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Hollan Haule, Alfredo Gonzalez-Sulser and Javier Escudero, Senior Member, IEEE
Abstract—Kernel methods separate data representation from decision-making, but typically require the kernel to be chosen in advance. We show that this kernel can instead be learned by alignment, and develop the resulting framework through the recently introduced Collaborative Learning and Inference (CLaI). We show that Collaborative Learning can be viewed as a kernel alignment process, in which an embedding is trained so that its induced similarity matches a label-derived target kernel. We also prove that Collaborative Inference is equivalent to kernel Bayes classification with Parzen-window density estimation. Motivated by these perspectives, we generalise CLaI by replacing cosine similarity with a learned Mahalanobis distance and extend it to multiclass classification. On CIFAR-10, PathMNIST, and SleepEDF, the Mahalanobis formulation improves accuracy, converges faster, and yields lower calibration error than the cosine-based variant. Auxiliary experiments further support these connections, showing that CLaI produces latent signals of the same form as a Gaussian process, while achieving competitive calibration on sepsis prediction. Together, these results establish a principled learned-kernel framework that unifies representation learning, kernel alignment, and Bayesian classification, and extends naturally to the multiclass setting.
Index Terms—Bayes Classifier, Kernel Alignment, Multi-class Classification, Kernel Methods, Deep Kernel Learning
I. Introduction
Kernel methods are a popular machine learning paradigm due to their ability to implicitly map input data to a high-dimensional feature space, known as a Reproducing Kernel Hilbert Space (RKHS). In this feature space, traditional kernel-based algorithms can efficiently discover patterns in the data. Essentially, kernel methods perform two distinct tasks: (i) mapping data to a feature space, and (ii) performing pattern discovery or learning in that space [1], [2].
Despite their strengths, kernel methods face significant challenges. One major issue is the selection and tuning of the kernel function, which is often a non-trivial task that demands extensive user intervention. For example, support vector machines (SVMs) do not only require solving a quadratic program to determine the decision function, but also rely on cross-validation to tune the kernel parameters [3], [4]. This coupling of hyper-parameter tuning with the learning process makes model selection computationally expensive and complex [1].
Deep kernel learning (DKL) methods leverage deep learning to automatically learn the appropriate kernel function and its hyper-parameters directly from the data. For example, in [5] a deep network is designed to learn a symmetric kernel function, with training performed via a logistic regression layer in a semi-binary classification task to capture pairwise similarity. Similarly, [6] embeds the deep learning module within a base kernel framework, enabling joint learning of both the deep feature representation and the kernel hyper-parameters using the Gaussian process marginal likelihood. Compartmentalising the deep learning function within the base kernel also facilitates learning a rich, infinite basis function representation of the data through the kernel [6].
In parallel, kernel evaluation metrics such as kernel alignment have been introduced [1], [7], [8] to aid in the model selection process. Kernel alignment measures the similarity between the kernel matrix and a target similarity matrix. Moreover, because kernel alignment is independent of the underlying learning machine, it is simple and efficient to compute [1]. In addition, kernel alignment exhibits a strong concentration property [1], [7], with empirical estimates maintaining low variance across different data subsets. This stability suggests that optimising kernel alignment, even with mini-batches, can provide reliable gradient estimates and consequently improve the training stability of DKL models.
While many kernel-based methods have been successful in binary classification, extending these techniques to multiclass problems remains a significant research interest [9], [10]. Multiclass classification techniques generally fall into one of two categories: those that employ a single predictor function to manage all classes and those that decompose the problem into multiple binary classification tasks (using strategies such as one-vs-one or one-vs-rest) [1], [11]–[13].
In this manuscript, we build on Collaborative Learning and Inference (CLaI) [14], showing it is a faithful instantiation of kernel methods that cleanly separates data mapping from decision-making. In our framework, collaborative learning, which we show is equivalent to a kernel alignment process, directly learns a mapping function and the associated kernel hyper-parameters from the data. Collaborative inference then determines the predictor in the latent space through a similarity-weighted combination of reference labels, a solution we show to be equivalent to a kernel Bayes classifier with Parzen-window density estimation.
Moreover, we extend CLaI to the multiclass setting by conditioning on a target class under a one-versus-rest strategy, despite the conventional restriction of kernel alignment to binary tasks [1]. To further improve multi-class performance, we introduce a Mahalanobis-distance base kernel as the similarity function, inspired by DKL
HH acknowledges an EPSRC postdoctoral pathways for growth in the UK grant. AGS and JE acknowledge Cure Syngap1 – Syngap Research Fund grant. JE also acknowledges an EPSRC (UKRI1659) grant.
Manuscript received April 19, 2021; revised August 16, 2021.
[4]. We further position Collaborative Learning within the family of learned-kernel methods, where the similarity function is learned directly from data through kernel alignment rather than selected a priori.
The main contributions of this work include:
• Proving the theoretical connection between collaborative inference and the Bayes classifier.
• Demonstrating that collaborative learning is essentially optimising a kernel alignment during training.
• Extending collaborative learning to use a generalised distance function based on the Mahalanobis distance.
• Presenting an extension of the collaborative learning framework (CLaI) for multiclass problems, validated on CIFAR-10, PathMNIST, and SleepEDF.
This manuscript is organised as follows: Section II covers the background, Section III covers a formal description of CLaI, and shows its connection to kernel alignment, Bayes classifier and extension to multiclass. Then Section IV, V, VI, and VII, respectively, cover experiments and results, discussion, limitations, and conclusions.
A. Kernel Methods fundamentals
Many supervised Kernel methods can be formulated as regularised empirical risk minimisation problems in Reproducing Kernel Hilbert Spaces (RKHS), (1) as
where the Representer theorem shows that the minimiser takes the form
a finite linear combination of the kernel functions, centred at the training points, . In (1), is the RKHS induced by the kernel , is a loss function, is a regularisation parameter, and is the training set. The regularised empirical loss splits the risk into two parts: the kernel, and the task . Moreover, based on Aronszajn's theorem [15], the kernel induced RKHS is such that
where is a mapping to the Hilbert space unique to the kernel.
B. Deep Kernel Learning (DKL)
As highlighted in Section I, a number of DKL exist in literature [16]–[18]. The most relevant for our work is the work by Wilson et al. [4], which embeds a deep learning module, , within a base kernel
This approach allows learning a unique mapping to the Hilbert space and hyperparameters directly from the data.
Moreover, Mercer's theorem implies that encapsulating the mapping inside the base kernel leads to a model that combines learned representations with an infinite-dimensional function space, trained jointly via marginal likelihood.
C. Kernel Alignment
Kernel Alignment [7] measures the similarity between two kernel matrices, as an evaluation metric for kernel model selection [1]. Consider a binary classification task and training dataset and . Given a kernel matrix and a target , where , Kernel alignment is computed as
where and are the Frobenius inner product and norm.
Maximising Kernel alignment is achieved by minimising the distance of a Kernel K to the target kernel T
D. Bayes Classifier
In statistical decision theory [19], the objective is to construct a predictor that minimises the expected misclassification error. Under the assumption that the class-conditional distributions are known (or can be accurately estimated), the Bayes classifier provides the optimal decision rule for binary classification:
Here, and denote the class-conditional probability density functions (likelihoods) for the positive and negative classes, respectively, while and denote the corresponding prior probabilities, where and .
III. Approach and Theoretical Insights
In this section, we split the contributions on this work in to three main parts: (i) Describing and establishing the connection between CLaI and kernel methods and the Bayes classifier; (ii) Introducing the Mahalanobis distance kernel as part of DKL with collaborative learning; and (iii) Extending CLaI to multiclass classification.
A. CLaI: Collaborative Learning and Inference
In our previous work [14], we introduced CLaI as a two-step binary classification-based approach originally designed for time series. The assumption behind CLaI [14] is that there is a latent space where embeddings of samples belonging to the same class are clustered while different classes are pushed apart. The two steps involved are: (i) Collaborative Learning: learning a mapping function to an embedding space, where similar samples are clustered; and (ii) Collaborative Inference: a new sample is assigned a class based on its proximity to a reference set of samples in the embedding space. Here, a more general formulation is presented, suitable for other types of data.
- Collaborative Learning: Collaborative Learning is based on the underlying assumption that there exists a latent space such that similar samples are clustered together. To setup the problem, we are given a dataset , , , partitioned into mini-batches, , where , , and batch size .
We define a parameterised embedding model
which maps each batch to latent representations
where L is the embedding dimension and denotes the model parameters.
Let t and r denote two (distinct) mini-batches, referred to as the anchor and reference batches, respectively. We define a pairwise similarity function
induces the cross-batch similarity matrix
whose -th entry is
In our previous implementation of CLaI [14], is chosen as the cosine similarity between latent embeddings. Consequently,
where the normalization is applied row-wise.
The desired similarity structure between the two batches is encoded by the target matrix
where
Thus, samples from the same class are encouraged to have high similarity, while samples from different classes are encouraged to have low similarity.
Collaborative Learning trains the embedding model by aligning the predicted similarity matrix S with the target matrix T. Specifically, the parameters are learned by minimising
During each optimisation step, an anchor batch is compared with each reference batch . The resulting losses are accumulated before updating the model parameters. The complete training procedure is summarised in Algorithm 1. Duplicate batch pairs and , as well as self-comparisons , are omitted.
The loss is a matrix alignment objective since
When S and T are normalised, this reduces to
which is precisely the kernel alignment distance defined in (6). Hence, Collaborative Learning can be interpreted as directly optimising kernel alignment between the learned similarity matrix and the label-induced target matrix.
Algorithm 1 Collaborative Learning – Binary
Require: Dataset , batch size , epochs , Learning rate
1: Initialization, model =
2: for to do
3: Shuffle
4: Partition into batches
5: for to do
6:
7:
8: Form label vector
9: for to do
10:
11: Form label vector
12: Compute
13: Compute target matrix
14:
15:
16:
- Collaborative Inference: Collaborative Inference uses the embedding model learned by Algorithm 1 to predict labels for unseen samples. Let
denote a labelled reference set, and
denote a set of unlabelled test samples. The reference set may simply be the same dataset used during Collaborative Learning. Given the trained embedding model , the objective is to predict the test labels
During training, the embedding model is optimised so that cross-batch similarity matrices approximate the corresponding label agreement matrices. Consequently, for a batch of test samples and a batch of reference samples, we expect the learned similarity matrix to satisfy
leading to the predictor
where y contains the known labels of the reference samples and f denotes the unknown labels of the test samples. The predicted class labels are then obtained by thresholding
The complete inference procedure is summarised in Algorithm 2.
Algorithm 2 Collaborative inference – Binary
1: Input: , , batch size
2: Load model =
3:
4: Partition into batches
Form from
5:
6: for to do
7:
8: Compute
9: Form label vector
10:
11:
12:
13: return
B. Collaborative Inference and Bayes Classifier
We now show that the Collaborative Inference decision rule can be interpreted as a kernel approximation to the Bayes classifier introduced in Section II-D. In particular, we demonstrate that the prediction rule in (10) has the same form as a Bayes classifier when the class-conditional densities are estimated using kernel (Parzen window) density estimation.
Consider predicting the label of a single test sample x using a labelled reference set
In this case, the similarity matrix in (10) reduces to the similarity vector
Comparing (14) with the Bayes classifier in (7) reveals a direct correspondence. The empirical class frequencies
estimate the prior probabilities and , while the kernel summations
are Parzen window estimates of the class-conditional densities . Consequently, Collaborative Inference implements a kernel Bayes classifier in the learned embedding space.
This establishes Collaborative Inference as a kernel Bayes classifier operating on a learned similarity function. Unlike conventional Parzen classifiers, which employ a predefined kernel, the similarity kernel is induced by the embedding model learned during Collaborative Learning through the kernel alignment objective.
C. DKL with Collaborative Learning
Following the Deep Kernel Learning formulation of Wilson et al. [4], we modify collaborative learning to use Mahalanobis distance [20], inside an exponential base kernel, instead of cosine similarity. We then rescale it to have values between -1 and +1 so that it is compatible with the target matrix:
where M is positive semidefinite, called a metric matrix, and L is a lower triangular matrix of real values according to Cholesky decomposition, defined as . We learn both and directly from data using neural networks.
We compare the performance of this kernel with cosine similarity using CLaI for multiclass prediction in Section IV-C.
D. Extending CLaI to Multiclass classification
CLaI as presented in section III-A works only for binary class problems. Here we extend CLaI to work in multiclass setting. As described in [1], one common approach involves decomposing a multiclass task into several binary classification tasks. Our approach is based on the one-versus-rest (1-v-r) strategy, also known as one-vs-all in other literature [11].

Fig. 1: Multiclass classification in stages, conditioning the embedding model with different classes.
- Collaborative Learning: Given a dataset , , , partitioned into mini-batches, , where , , and batch size . To achieve a 1-v-r strategy with CLaI, we introduce a class conditioning variable, , in the embedding function . This creates the appearance of having different mapping functions for each class, effectively transforming a multiclass problem into multiple binary tasks, as shown in Fig. 1.
Given batch indices , we compute the similarity matrix, . We also compute the target matrix where
Note here that to avoid classes that have already been separated being re-clustered, samples belonging to the same negative class are assigned a zero, i.e. essentially treated as “unknown” and reserved for the next class conditioning. Full training procedure is listed in Algorithm 3.
- Collaborative Inference: Given a dataset , , , partitioned into mini-batches, and a set of test samples , , arranged as . Collaborative inference predicts the test labels , leveraging cross-similarity as
where and are the ideal target and reference label vectors. Following the 1-v-r approach, we compute , before applying softmax on and selecting the class with the most confident prediction:
The full collaborative inference algorithm is shown in Algorithm 4.
Algorithm 3 Collaborative Learning – Multiclass
Require: Dataset , batch size , epochs , Learning rate , class count
1: Initialization, model ;
2: for to do
3: for to do
4: Shuffle
5: Re-assign labels
6: Partition , such that
7: for to do
8:
9:
10: for to do
11:
12: Compute
13: Compute target matrix
14:
15:
16:
IV. Experiments and Results
A. Datasets and Preprocessing
Here, we use MIMIC-IV [21] dataset to empirically show the connection between CLaI-Binary and kernel methods. MIMIC-IV contains different types of patient data such as patient administrative data, physiological measurements, physician notes, and imaging data. For our experiments, we extract vital signs from patients diagnosed with sepsis to detect sepsis events. We follow the preprocessing procedure described in our previous work [14], to extract multivariate recordings and its corresponding sample labels . Note here that a recording is the same as a collection of samples and their respective labels as described in Section III-A1.
To evaluate multiclass classification we use three datasets: CIFAR10 [22]–[24] (10 classes), PathMnist [25] (9 classes), and the expanded SleepEDF dataset [26],
Algorithm 4 Collaborative inference – Multiclass
1: Input: , , batch size , class count
2: Load model
3: Form from
4:
5: for to do
6: ,
7: Create from with new labels
8: Partition into batches
9:
10: for to do
11:
12: Compute
13:
14:
15:
16:
17:
18: return
[27] (5 classes). CIFAR10 consists of a large collection of 60000 tiny 32×32 pixel colour images, to showcase the performance of CLaI-multiclass. The dataset, split into 50000 by 10000 train and test images respectively, comprises ten object categories, some of which are notably challenging to discriminate due to the limited information contained in low-resolution images [22]. We separately normalise the training and testing datasets using mean and standard deviation of the dataset.
PathMNIST [25] is one of the datasets in MedMNIST [28], [29], a large collection of biomedical images at various resolutions for classification tasks. PathMNIST is a collection of about 107180 28×28 images of slides stained with colorectal cancer tissue.
We use a subset of The expanded SleepEDF dataset [26], [27] containing 78 polysymnographic sleep recordings, using a bipolar electroencephalogram (EEG) montage, Fpz-Cz/Pz-Oz channels. We split the EEG recordings into 80/20 for training and testing. Each recording is segmented into 30 second non-overlapping windows along with their corresponding sleep stages: Wake (W), REM (R), non-Rem(N1,N2,N3,N4), movement (M) and ? (not scored). We merge N3 and N4 into N3 and drop M and ?, leading to a total 5 stages for multiclass classification [30].
B. Multiclass Classification
We evaluate the multi-class extension of CLaI on image datasets, CIFAR10 [23] (10 classes), and PathMNIST [25] (9 classes) using a lightweight ResNet-18-based embedding function, , as a proof of concept. We note that a lightweight ResNet-18 model is not the state of the art
TABLE I: Classification performance on PathMNIST, CIFAR-10, and SleepEDF.
| Dataset | Accuracy | Precision | Recall | F1-score | ROC-AUC |
|---|---|---|---|---|---|
| PathMNIST | 79.97 | 81.74 | 79.97 | 79.75 | 92.82 |
| CIFAR-10 | 80.46 | 80.45 | 80.46 | 80.35 | 93.86 |
| SleepEDF | 58.49 | 71.61 | 58.49 | 61.21 | 79.64 |
in these computer vision tasks, but Table I shows that our model achieves adequate performance compared to state-of-the-art methods and demonstrates the proof of principle of multiclass CLaI. Moreover, Fig.2 illustrates that the latent space not only clusters samples of the same class but also groups similar classes together (e.g., four-legged animals: classes 5, 7, 3, 4; vehicles: classes 1, 9; blue background: classes 2, 0). Additionally, we evaluate CLaI on the SleepEDF dataset, with the results presented in Table I and Fig. 2. The results indicate that CLaI achieves lower performance on SleepEDF than on the other evaluated datasets.
C. Ablation of the learned similarity function
Here we explore how the choice and flexibility of the similarity function affect CLaI. We compare cosine similarity kernel (CLaI-C) (8), which was used in our previous implementation of CLaI to Mahalanobis distance based kernel (CLaI-M), (15). Fig. 3, shows that CLaI-M achieves a much lower loss by epoch 120 compared to CLaI-C, hence faster convergence.
D. Connection to kernel methods (auxiliary)
In this section, we perform experiments to assess the quality of CLaI predictions in comparison to Kernel methods. Specifically, we visually explore the latent representation with respect to occurrence of events and calibration of predictions.
-
Latent signals: CLaI vs. Gaussian Process: Although CLaI and GP classification arise from different objectives, both construct predictions through similarity-weighted contributions from reference/training samples. We therefore compare their latent signals. Here, we plot the embedding signals to examine their behaviour upon event occurrence. Fig. 4 shows that latent signals converge during sepsis events, resulting in smaller areas between them. In contrast, they diverge when no event is present, increasing the area between the signals. For comparison, we visualise the latent signal generated by a Gaussian Process model in Fig. 5, showing that the latent signal value increases during an event. However, the figure shows that the signal is not as smooth as that generated by CLaI.
-
Calibration of CLaI in sepsis prediction: We evaluate the calibration of the CLaI framework on sepsis prediction by comparing two CLaI variants that differ in their similarity measures: one using a cosine similarity kernel and another employing an exponential kernel based on the Mahalanobis distance, as described in section III-C. To assess the probabilistic fidelity of the predictions, we benchmark these results against a traditional Bayesian

(a) PathMNIST

(b) CIFAR-10

(c) SleepEDF
Fig. 2: Visualization of the latent space using t-SNE for the PathMNIST, CIFAR-10, and SleepEDF datasets. Class index-to-label mappings are given in Table II.
TABLE II: Class index-to-label mappings and corresponding colors for the datasets shown in Figure 2.
| PathMNIST | CIFAR-10 | SleepEDF | ||||||
|---|---|---|---|---|---|---|---|---|
| Idx | Label | Color | Idx | Label | Color | Idx | Label | Color |
| 0 | Adipose | 0 | Airplane | 0 | Wake | |||
| 1 | Background | 1 | Automobile | 1 | N1 | |||
| 2 | Debris | 2 | Bird | 2 | N2 | |||
| 3 | Lymphocytes | 3 | Cat | 3 | N3 | |||
| 4 | Mucus | 4 | Deer | 4 | REM | |||
| 5 | Smooth Muscle | 5 | Dog | |||||
| 6 | Normal Colon Mucosa | 6 | Frog | |||||
| 7 | Cancer-associated Stroma | 7 | Horse | |||||
| 8 | Colorectal Adenocarcinoma Epith. | 8 | Ship | |||||
| 9 | Truck | |||||||
approach using a mixture model of Student-t distributions, as we found that the embeddings resulting from collaborative learning tend to exhibit long-tailed distributions. Calibration is quantified using Expected Calibration Error (ECE), which is a widely used metric that measures how well a model's prediction confidence matches the observed frequency of correctness. In addition we compute other performance metrics including AUROC, AUPRC and F1 scores, and report the results in Table III.
TABLE III: Sepsis detection performance results across different experiments involving different versions of CLaI and the benchmark model MM of Student-t. The results show that CLaI with Mahalanobis distance kernel (CLaI-M) has lowest ECE, despite having a slightly lower performance across other metrics. Moreover CLaI achieves the highest performance and calibration in comparison to the mixture model (MM). ECE quantifies the calibration of the model's predicted probabilities.
| Experiment | AUROC | AUPRC | F1 | ECE |
|---|---|---|---|---|
| CLaI-M | 0.804 (0.014) | 0.635 (0.035) | 0.613 (0.055) | 0.229 (0.029) |
| CLaI-C | 0.848 (0.009) | 0.714 (0.019) | 0.701 (0.011) | 0.262 (0.006) |
| MM of Student-t | 0.835 (0.016) | 0.701 (0.027) | 0.699 (0.026) | 0.278 (0.023) |
V. Discussion
This work presents a general formulation of Collaborative Learning and Inference (CLaI) that establishes connections between kernel alignment, learned representations, and kernel-based classification. The framework can be viewed as a two-stage process: Collaborative Learning learns an embedding whose induced similarity function is aligned with a label-derived target kernel, while Collaborative Inference uses this learned similarity structure to predict the labels of unseen samples. We evaluated this formulation across binary [14] and extended to multiclass classification tasks, including PathMNIST, CIFAR-10, SleepEDF, and sepsis prediction.
A central result of this work is the interpretation of Collaborative Learning as a kernel alignment procedure. Rather than prescribing a similarity function independently of the task, the embedding model is trained so that pairwise similarities in the learned representation agree with the desired class-based similarity structure. The resulting embedding therefore induces a kernel that is explicitly shaped by the classification objective. This provides a direct connection between representation learning and kernel alignment, and offers an alternative to selecting a kernel a priori. This interpretation extends naturally to Collaborative Inference. The inference rule can be expressed as a similarity-weighted combination of

(a) Train loss for CLaI-C

(b) Training loss for CLaI-M
Fig. 3: Training loss for CLaI with cosine similarity (CLaI-C) vs CLaI with mahalanobis distance in exponential base kernel (CLaI-M), showing CLaI-M achieves a much smaller loss by epoch 120 than CLaI-C i.e. faster convergence.

Fig. 4: CLaI Latent signals converge during events, resulting in smaller areas between them. In contrast, they diverge when no event is present, increasing the area between the signals.

Fig. 5: GP Latent signal showing that the signal value increases during an event. However, the signal contains more noise compared to the signals generated by CLaI.
the labels of a reference set. As shown in Section III-B, this has the same form as a kernel Bayes classifier when the class-conditional densities are estimated using Parzen window methods. The empirical proportions of the reference classes act as estimates of the class priors, while
the sums of kernel similarities within each class provide estimates of the corresponding class-conditional densities. Collaborative Inference can therefore be interpreted as kernel Bayes classification operating in a learned representation space.
The multiclass experiments demonstrate that this formulation extends beyond binary classification. Across PathMNIST, CIFAR-10, and SleepEDF, CLaI was able to learn representations that supported effective multi-class prediction. The learned embeddings also exhibited meaningful class structure, with samples from the same class tending to cluster while visually or semantically related classes remained closer in the latent space. We see these class groups in Fig. 2b, vehicles(truck and automobile), four-legged animals (dog, horse, cat, dear), blue-background (ship, bird, airplane). Note that the frog class sits between blue-background and four-legged animals groups. This suggests that the alignment objective does not simply separate classes independently, but can also capture relationships between classes through the learned similarity structure.
The choice of similarity function was found to have an important effect on the behaviour of CLaI. Replacing cosine similarity with a Gaussian kernel based on a learned Mahalanobis distance resulted in improved multiclass performance and faster convergence in our experiments. The Mahalanobis formulation also produced lower calibration error than the cosine-based formulation in the sepsis prediction experiment. These results suggest that allowing the geometry of the latent space to be learned jointly with the embedding can provide a more expressive similarity function than cosine similarity alone. In particular, the Gaussian kernel induces an infinite-dimensional feature space, and hence a richer RKHS, whereas cosine similarity applied to a finite-dimensional embedding corresponds to a finite-dimensional kernel representation [31]. Importantly, this extension retains the kernel-alignment formulation while providing additional flexibility in the structure of the learned similarity.
The relationship between CLaI and established kernel methods was further explored through the auxiliary experiments. Although CLaI and Gaussian-process classification [32] are derived from different optimisation objectives, their predictive structures share an important commonality: both produce predictions from similarity-weighted contributions of reference samples. The observed similarity between their latent signals is consistent with interpreting CLaI within the broader family of kernel-based learning methods, and complements the theoretical result that Collaborative Inference implements a kernel Bayes classifier in the learned representation space.
The differences between the approaches, however, are equally important. Both Gaussian-process classification and DKL [4] optimise kernel parameters by maximising the marginal likelihood of a probabilistic model over functions. CLaI departs from this family in its objective: rather than maximising a likelihood, it aligns the induced kernel directly with a label-derived target matrix, optimising the learned similarity for discriminative class structure. CLaI is closest to DKL in that both learn a feature representation that induces the kernel rather than fixing it in advance; the distinction lies in the objective, i.e. alignment [7] versus marginal likelihood. Consequently, CLaI explicitly shapes the learned similarity for discriminative class structure, whereas GP- and DKL-based methods are formulated within a probabilistic Gaussian-process framework. This positions CLaI as a complementary member of the learned-kernel family, combining representation learning with a direct kernel-alignment objective.
Overall, these results support a unified interpretation of CLaI as a learned-kernel framework: Collaborative Learning learns a task-specific similarity function through kernel alignment, and Collaborative Inference subsequently performs kernel-based classification using that learned similarity. This provides a common perspective on the training and inference stages and connects the framework to established ideas from kernel methods, Bayesian classification, and deep kernel learning.
VI. Limitations
The principal limitation of CLaI is its computational complexity, which is more pronounced in the multiclass extension. Because Collaborative Learning compares every batch against every other batch, its time complexity is quadratic in the number of batches, , where T and M denote the number of epochs and batches, respectively. The multiclass extension introduces an additional loop that conditions the embedding model on each class in turn, raising the cost to , where C is the number of classes. (For clarity, these expressions omit the per-pair cost.) Storage complexity, by contrast, is unaffected by the number of classes, since the class loop executes sequentially and reuses the same buffers; it remains , where P, A, B, and L
denote the number of model parameters, the activations stored per batch for one backward pass, the batch size, and the latent dimension, respectively (ignoring kernel-specific costs). Owing to these costs, we deliberately used lightweight embedding models as a proof of concept for multiclass classification, rather than aiming to surpass state-of-the-art performance.
VII. Conclusion and Future Work
In this work we showed that CLaI is, in principle, a kernel alignment method, and we extended it to the multiclass setting. Our experiments verify these theoretical claims and establish a proof of concept for multiclass classification.
A natural direction for future work is to reduce the computational cost of CLaI, particularly for multiclass applications. The additional loop over the classes, which conditions the embedding model on each class in turn, is the main source of this overhead. This loop could be eliminated by computing a single target/similarity tensor of shape , replacing the sequential passes with a single pass, possibly supported by an additional preprocessing step to prepare the tensors.
Having established CLaI as an instance of supervised kernel learning by alignment, another promising direction is to extend the framework to unsupervised kernel learning by alignment [8], [33]–[36]. Combined with the DKL capabilities that CLaI already offers, such an extension would be especially valuable in domains where labelled data are scarce, such as medical applications.
Finally, we plan to conduct further experiments exploring interpretability through case-based reasoning, with the aim of demonstrating CLaI as a practical and adoptable solution for advancing healthcare delivery.
References
[1] T. Wang, D. Zhao, and S. Tian, “An overview of kernel alignment and its applications,” Artificial Intelligence Review, vol. 43, pp. 179–192, Feb. 2015.
[2] J. Shawe-Taylor and N. Cristianini, Kernel methods for pattern analysis. Cambridge university press, 2004.
[3] K.-L. Du, B. Jiang, J. Lu, J. Hua, and M. N. S. Swamy, "Exploring Kernel Machines and Support Vector Machines: Principles, Techniques, and Future Directions," Mathematics, vol. 12, p. 3935, Jan. 2024.
[4] A. G. Wilson, Z. Hu, R. Salakhutdinov, and E. P. Xing, “Deep Kernel Learning,” in Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pp. 370–378, PMLR, May 2016.
[5] L. Le, J. Hao, Y. Xie, and J. Priestley, “Deep kernel: learning kernel function from data using deep neural network,” in Proceedings of the 3rd IEEE/ACM International Conference on Big Data Computing, Applications and Technologies, (Shanghai China), pp. 1–7, ACM, Dec. 2016.
[6] A. G. Wilson, Z. Hu, R. Salakhutdinov, and E. P. Xing, “Deep kernel learning,” in Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, AISTATS 2016, 2016.
[7] N. Cristianini, J. Shawe-Taylor, A. Elisseeff, and J. Kandola, “On Kernel-Target Alignment,” in Advances in Neural Information Processing Systems, vol. 14, MIT Press, 2001.
[8] F. Insulla, S. Huang, and L. Rosasco, “Towards a learning theory of representation alignment,” Oct. 2024.
[9] G. Pinheiro, D. M. Slabbert, L. Kowada, and F. Petruccione, "Quantum kernel and HHL-based support vector machines for multi-class classification," EPJ Quantum Technology, vol. 13, p. 46, Mar. 2026.
[10] V. M. Hanriot, L. C. B. Torres, and A. P. Braga, "Multiclass Graph-Based Large Margin Classifiers: Unified Approach for Support Vectors and Neural Networks," IEEE Transactions on Neural Networks and Learning Systems, vol. 36, pp. 8307–8316, May 2025.
[11] R. Rifkin and A. Klautau, "In defense of one-vs-all classification," Journal of Machine Learning Research, vol. 5, 2004.
[12] K. Crammer and Y. Singer, "On the Algorithmic Implementation of Multiclass Kernel-based Vector Machines," Journal of Machine Learning Research, vol. 2, no. Dec, pp. 265–292, 2001.
[13] C.-W. Hsu and C.-J. Lin, "A comparison of methods for multiclass support vector machines," IEEE Transactions on Neural Networks, vol. 13, pp. 415–425, Mar. 2002.
[14] H. Haule, I. Piper, P. Jones, T. Y. M. Lo, and J. Escudero, "CLaI: Collaborative Learning and Inference for low-resolution physiological signals – Validation in clinical event detection and prediction," IEEE Transactions on Biomedical Engineering, pp. 1–10, 2025.
[15] K. P. Murphy, Probabilistic machine learning: an introduction. MIT press, 2022.
[16] N. K. Nikhitha, A. L. Afzal, and S. Asharaf, "Deep Kernel machines: a survey," Pattern Analysis and Applications, vol. 24, pp. 537–556, May 2021.
[17] Y. Cho and L. Saul, "Kernel Methods for Deep Learning," in Advances in Neural Information Processing Systems, vol. 22, Curran Associates, Inc., 2009.
[18] T. Wang, L. Zhang, and W. Hu, "Bridging deep and multiple kernel learning: A review," Information Fusion, vol. 67, pp. 3–13, Mar. 2021.
[19] K. Nordhausen, "The Elements of Statistical Learning: Data Mining, Inference, and Prediction, Second Edition by Trevor Hastie, Robert Tibshirani, Jerome Friedman," International Statistical Review, vol. 77, no. 3, 2009.
[20] K. Q. Weinberger and L. K. Saul, "Distance metric learning for large margin nearest neighbor classification," Journal of Machine Learning Research, vol. 10, 2009.
[21] B. Moody, S. Hao, B. Gow, T. Pollard, W. Zong, and M. Roger, "MIMIC-IV Waveform Database."
[22] Y. Abouelnaga, O. S. Ali, H. Rady, and M. Moustafa, "CIFAR-10: KNN-Based Ensemble of Classifiers," in 2016 International Conference on Computational Science and Computational Intelligence (CSCI), pp. 1192–1195, Dec. 2016.
[23] A. Krizhevsky and G. Hinton, "Learning multiple layers of features from tiny images," 2009.
[24] A. Torralba, R. Fergus, and W. T. Freeman, "80 Million Tiny Images: A Large Data Set for Nonparametric Object and Scene Recognition," IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 30, pp. 1958–1970, Nov. 2008.
[25] J. N. Kather, J. Krisam, and others, "Predicting survival from colorectal cancer histology slides using deep learning: A retrospective multicenter study," PLOS Medicine, vol. 16, pp. 1–22, Jan. 2019.
[26] B. Kemp, A. Zwinderman, B. Tuk, H. Kamphuisen, and J. Oberye, "Analysis of a sleep-dependent neuronal feedback loop: the slow-wave microcontinuity of the EEG," IEEE Transactions on Biomedical Engineering, vol. 47, pp. 1185–1194, Sept. 2000.
[27] A. L. Goldberger, L. A. N. Amaral, L. Glass, J. M. Hausdorff, P. C. Ivanov, R. G. Mark, J. E. Mietus, G. B. Moody, C.-K. Peng, and H. E. Stanley, "PhysioBank, PhysioToolkit, and PhysioNet: Components of a New Research Resource for Complex Physiologic Signals," Circulation, vol. 101, June 2000.
[28] J. Yang, R. Shi, and B. Ni, "MedMNIST Classification Decathlon: A Lightweight AutoML Benchmark for Medical Image Analysis," in IEEE 18th International Symposium on Biomedical Imaging (ISBI), pp. 191–195, 2021.
[29] J. Yang, R. Shi, D. Wei, Z. Liu, L. Zhao, B. Ke, H. Pfister, and B. Ni, "MedMNIST v2-A large-scale lightweight benchmark for 2D and 3D biomedical image classification," Scientific Data, vol. 10, no. 1, p. 41, 2023.
[30] A. Deb, C. Shahnaz, and M. Saquib, "A Joint Optimization Guided Deep Learning Model based on CNN and Channel-Wise Transformers for Robust Sleep Stage Classification from EEG
Signal," in 2025 47th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), pp. 1–7, July 2025. ISSN: 2694-0604.
[31] B. Schölkopf and A. J. Smola, Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. The MIT Press, Dec. 2001.
[32] C. E. Rasmussen and C. K. I. Williams, Gaussian Processes for Machine Learning. 2005.
[33] Y. Gao, S. Luo, J. Pan, Z. Wang, and P. Gao, "Kernel alignment unsupervised discriminative dimensionality reduction," Neurocomputing, vol. 453, pp. 181–194, Sept. 2021.
[34] H. Sui, Y. Wang, and M. N. Do, "UniCon: Unified Framework for Efficient Contrastive Alignment via Kernels," Oct. 2025.
[35] H.-W. Lin, Y. Tsai, H. J. Lin, C.-H. Yu, M.-H. Liu, H.-W. Lin, Y. Tsai, H. J. Lin, C.-H. Yu, and M.-H. Liu, "Unsupervised domain adaptation with deep network based on discriminative class-wise MMD," AIMS Mathematics, vol. 9, no. 3, pp. 6628–6647, 2024. Cc_license_type: cc_by_Primary_atype: AIMS Mathematics Subject_term: Research article Subject_term_id: Research article.
[36] Y. Sun and S. Kok, "Unsupervised Multiple Kernel Learning for Graphs via Ordinality Preservation," International Conference on Learning Representations, vol. 2025, pp. 76087–76128, May 2025.