Estimating Shape Distances on Neural Representations with Limited Samples

Dean A. Pospisil, Brett W. Larsen, Sarah E. Harvey, Alex H. Williams · DOI

Abstract

Measuring the similarity between high-dimensional neural representations is a cornerstone of modern neuroscience and AI research, but standard methods fail when data is scarce. This paper proves that common "plug-in" estimators are significantly biased in high-dimensional, low-sample regimes and introduces a novel method-of-moments estimator. This approach allows researchers to explicitly trade off bias for variance, providing more reliable similarity scores and honest confidence intervals.

Introduction: The Curse of Alignment

How do we know if two neural networks—or two brain regions—are "doing the same thing"? To answer this, researchers often compare their internal representations using shape distances, such as Procrustes distance. These metrics are powerful because they are invariant to rotations and reflections, focusing on the underlying geometry of the data rather than the specific indexing of neurons.

However, in high-dimensional spaces (many neurons, $N$) with limited samples (few stimuli, $M$), these metrics become unreliable. The authors identify a "curse of alignment": with sufficient dimensions and insufficient data, one can almost always find a rotation that makes two completely unrelated datasets appear similar. This leads to a massive underestimate of distance and an overestimate of similarity. While this problem is recognized in low-dimensional settings like 3D anatomy, it has lacked rigorous analysis for the high-dimensional "big data" characteristic of modern neurobiology and deep learning.

Methods: A Moment-Based Approach

The paper addresses these challenges through both theoretical analysis and algorithmic innovation.

Theoretical Bounds

The authors derive non-asymptotic upper and lower bounds on the error of standard "plug-in" estimators. They demonstrate that the error scales approximately with $N \cdot M^{-1/2}$. This implies a significant scaling challenge: doubling the number of recorded neurons requires quadrupling the stimulus set size to maintain constant accuracy.

The Method-of-Moments Estimator

To mitigate alignment bias, the authors propose a new estimator. Rather than directly seeking an optimal alignment matrix—a process prone to overfitting—they estimate the "moments" (powers) of the cross-covariance matrix.

Overview of rotational alignment and the effect of sample size M on representation estimation.

Tunable Bias-Variance Tradeoff

Using a quadratic programming approach, the method finds an optimal combination of these moments. This allows users to specify a "bias cap" (e.g., a maximum 5% bias), and the algorithm identifies the estimate with the lowest possible variance satisfying that constraint.

Datasets and Validation

The approach was validated across three distinct domains:

  • Synthetic Data: Multivariate normal distributions with known ground-truth similarity were used to verify mathematical bounds.
  • Biological Neural Data: Calcium imaging recordings from the primary visual cortex (V1) of mice responding to 2,800 natural images (from the Stringer et al., 2019 dataset).
  • Deep Learning: Penultimate layer activations from ResNet-50 architectures trained on ImageNet.

Key Insights

The Overfitting Trap

The paper formalizes why "plug-in" estimators are hazardous. In high dimensions, the optimization step used to align representations overfits to noise, creating a spurious sense of similarity.

Honest Uncertainty

A major contribution is the generation of confidence intervals (CIs). Unlike standard methods that provide a single point estimate, this new method provides CIs that account for both sampling noise and the maximum possible bias.

Effective Dimensionality

Bias is not merely a function of the raw neuron count but of the effective dimensionality—the number of independent directions the activity spans. Representations with "flatter" power spectra (more independent components) are inherently harder to estimate accurately.

Key Results

  • Bias Reduction: In ResNet-50 simulations, standard plug-in estimators were biased by up to 3-fold, significantly overestimating layer similarity. The moment-based estimator remained nearly unbiased even with minimal samples.
  • Identifying Independence: On real mouse V1 data, when ground truth similarity was zero (comparing responses to different stimuli), the plug-in estimator reported a similarity of ~0.4. The new estimator correctly identified it as zero.
  • Sample Efficiency: The method achieves accuracy comparable to standard methods while requiring significantly fewer samples, a critical advantage for expensive experimental data collection.

Limitations and Future Work

The primary limitation is the inherent bias-variance tradeoff. Eliminating bias can result in high variance, leading to wide confidence intervals in extremely noisy or low-sample regimes. Future work may explore more sophisticated spectral estimators or apply these techniques to other metrics like Centered Kernel Alignment (CKA) or Canonical Correlation Analysis (CCA), which likely face similar high-dimensional challenges.

Summary updated

BibTeX
@inproceedings{pospisil2024estimating,
  author = {Dean A. Pospisil and Brett W. Larsen and Sarah E. Harvey and Alex H. Williams},
  title = {{Estimating Shape Distances on Neural Representations with Limited Samples}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=kvByNnMERu},
}
Figure