arXiv:2609.06474cs.LGSep 2026

Manuscript Offprint

arXiv:2609.06474

Learning Kernels by Alignment for Multiclass Bayes Classification

Hollan Haule, Alfredo Gonzalez-Sulser, Javier Escudero

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 ϕ\phi 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 ϕ\phi 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.

References (33)