Linking Robustness and Generalization: A k* Distribution Analysis of Concept Clustering in Latent Space for Vision Models

Shashank Kotyan, Pin-Yu Chen, Danilo Vasconcellos VargasarXiv 2024 · DOI

Abstract

This study introduces a novel quantitative framework for evaluating the internal organization of vision model latent spaces using the $k^*$ distribution. By analyzing the local neighborhood of data points in high-dimensional space, we define metrics for "fracturing," "overlapping," and "clustering" of semantic concepts. Through a large-scale evaluation of robust and zero-shot models across over 20 datasets, we demonstrate a fundamental link between a model's performance and its internal representation: as models become more robust and better at generalizing, they transition from fractured, scattered representations toward forming cohesive, dense clusters.

Introduction

Evaluating the quality of representations learned by vision models remains a challenge. Standard accuracy metrics provide only an indirect measure of a model's internal logic, while popular visualization techniques like t-SNE or UMAP are often subjective and sensitive to hyperparameter choices. Furthermore, many evaluation protocols rely on linear probes, which may conflate the probe's learning capacity with the quality of the underlying features. This research addresses these limitations by proposing a direct, quantitative metric to answer a critical question: How well-organized is a model's latent space?

Methodology

The authors utilize the $k^*$ Distribution, a method that analyzes the local neighborhood of data points in the high-dimensional latent space. For any given image, the $k^*$ value is defined as the index of its nearest neighbor that belongs to a different class. A high $k^*$ value indicates that an image is surrounded by many others of the same class (good clustering), while a low $k^*$ value suggests that a different class is "intruding" nearby, indicating potential overlap or fracturing.

Overview of the k* distribution pipeline and the derivation of skewness metrics for quantifying latent space quality.

To condense these distributions into actionable metrics, the authors introduce two measures based on skewness:

  • True Skewness ($\Gamma_{k^*}$): Measures the asymmetry of the $k^*$ distribution for the entire dataset.
  • Approximate Skewness ($\Gamma'_{k^*}$): An average of skewness across individual classes, offering greater flexibility for cross-dataset comparisons.

Based on these metrics, latent space quality is categorized into three states: Fractured ($\gamma > 0.5$), where classes are broken into isolated islands; Overlapped ($-0.5 < \gamma < 0.5$), where classes are blurred together; and Clustered ($\gamma < -0.5$), where classes form cohesive "blobs."

Experimental Setup

The study's scope is extensive, evaluating:

  • Robust Models: Variants from the RobustBench library (CIFAR-10, CIFAR-100, ImageNet-1k), including $L_2$, $L_\infty$, and corruption-robust models.
  • Generalization Models: A wide array of pre-trained OpenCLIP models.
  • Evaluation Datasets: Over 20 datasets, including natural images (e.g., Caltech-101, Oxford Pets), specialized domains (e.g., EuroSAT), and structured tasks (e.g., MNIST, CLEVR).

Results and Analysis

The analysis reveals several key insights into the relationship between latent space organization and model performance.

Correlation between Approximate Skewness Coefficient and accuracy (standard and robust) across various model types and datasets.

Robustness and Clustering

There is a clear correlation between adversarial robustness and latent space quality. Interestingly, $L_2$ robust models tend to cluster concepts more effectively than $L_\infty$ robust models, which exhibit a higher degree of fracturing. On CIFAR-10, $L_\infty$ robust models averaged 8.55 fractured classes out of 10, compared to 5.63 for $L_2$ models.

Generalization as a Function of Cohesion

For CLIP models, better zero-shot performance across diverse datasets is directly linked to a more cohesive latent space. Across almost all natural image datasets, a lower (more negative) Approximate Skewness Coefficient $\Gamma'_{k^*}$ correlated strongly with higher zero-shot accuracy.

The Reality of Fracturing

Most current vision models do not create "perfect" clusters but rather "fracture" concepts into scattered fragments. However, as models improve in zero-shot accuracy, this fracturing significantly decreases. Some datasets, such as Rendered SST2, show high fracturing across all models, suggesting that current training strategies struggle to cluster semantic text concepts in a visual space.

Conclusion and Future Work

The $k^*$ distribution provides a robust, quantitative framework for comparing model architectures and training strategies beyond simple accuracy. While the authors acknowledge that $\Gamma'_{k^*}$ is an approximation, its strong correlation with performance metrics makes it a valuable tool for latent space analysis. Future work will explore the impact of different distance metrics and the potential for using these skewness metrics as a loss function during training to explicitly encourage the formation of cohesive, non-fractured representations.

Summary updated

BibTeX
@misc{kotyan2024linking,
  author = {Shashank Kotyan and Pin-Yu Chen and Danilo Vasconcellos Vargas},
  title = {{Linking Robustness and Generalization: A k* Distribution Analysis of Concept Clustering in Latent Space for Vision Models}},
  year = {2024},
  eprint = {2408.09065},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.09065},
}
Figure