Centered Kernel Alignment (CKA)
Centered Kernel Alignment (CKA) is a similarity metric designed to measure the similarity of between representations of features in neural networks1.
Definition of CKA
CKA is based on the
[[Hilbert-Schmidt Independence Criterion (HSIC)]]
Hilbert-Schmidt Independence Criterion (HSIC)
Given two kernels of the feature representations
Given two kernels of the feature representations
where
, are the representations of features, is the dimension of the representation of the features, is the so-called .
- We can choose different kernel functions
and . For example, if and are linear kernels, we have . In this linear case, HSIC is simply …
But HSIC is not invariant to isotropic scaling which is required for a similarity metric of representations1. CKA is a normalization of HSIC,
Applications

Kornblith2019
CKA has Problems too
Seita et al argues that CKA is a metric based on intuitive tests, i.e., calculate cases that we believe that should be similar and check if the CKA values is consistent with this intuition2. Seita et al built a quantitive benchmark2.
Kornblith S, Norouzi M, Lee H, Hinton G. Similarity of Neural Network Representations Revisited. arXiv [cs.LG]. 2019. Available: http://arxiv.org/abs/1905.00414 ↩︎ ↩︎
Seita D. How should we compare neural network representations? In: The Berkeley Artificial Intelligence Research Blog [Internet]. [cited 8 Nov 2021]. Available: https://bair.berkeley.edu/blog/2021/11/05/similarity/ ↩︎ ↩︎
cards/machine-learning/measurement/centered-kernel-alignment
Links to:L Ma (2021). 'Centered Kernel Alignment (CKA)', Datumorphism, 11 April. Available at: https://datumorphism.leima.is/cards/machine-learning/measurement/centered-kernel-alignment/.