On Transfer in Classification: How Well do Subsets of Classes Generalize?

Raphaël Baena, Lucas Drumetz, Vincent Gripon

Abstract

Transfer learning has become the standard paradigm in computer vision, yet the theoretical principles governing why certain class subsets provide better generalization than others remain poorly understood. This paper introduces a novel framework based on separability—a metric quantifying the number of class pairs a model can distinguish. By analyzing the semantics of classes through binary partitions, the authors demonstrate that a model's transfer learning potential can be predicted prior to fine-tuning. Our findings reveal a high correlation (0.86 to 0.96) between initial separability and final performance across multiple benchmarks, providing a mathematical foundation for selecting optimal training subsets.

Introduction

In modern machine learning, "foundation models" are typically pre-trained on massive datasets and subsequently fine-tuned for specific downstream tasks. While this approach is empirically successful, it lacks a rigorous explanation for why specific data subsets are more effective for transfer than others. Most research in this area focuses on domain adaptation—shifting from one visual style to another. This study shifts the focus toward the semantics of classes, asking whether we can mathematically rank subsets of classes based on their inherent "expressiveness."

The Separability Framework

The core of the proposed theory is the concept of separability. The authors define a model's power by the specific set of class pairs it can successfully distinguish.

1. Binary Partitions and Expressiveness

If a Model A can distinguish every pair of classes that Model B can, plus additional pairs, Model A is considered strictly more expressive. This partial ordering allows for the construction of Hasse Diagrams, which visualize the hierarchy of class subsets. Through these diagrams, the authors identify "fundamental pairs"—classes that are essential for maintaining the model's generalizability.

2. The Fundamental Number

Drawing from coding theory, the paper establishes bounds on the number of models required to separate $n$ classes. The lower bound is $\log_2(n)$, achieved through a hypercube configuration where each model acts as a bit in a binary code. The upper bound is $\binom{n}{2}$, representing a scenario where every possible pair must be learned individually. The closer a training subset gets to the $\log_2(n)$ bound, the more efficient and "fundamental" the learned features are likely to be.

Methodology

To validate this theory in practical settings, the authors utilize frozen, pre-trained feature extractors (such as ResNet-50 and Vision Transformers). They train simple linear "heads" on specific pairs of classes and then measure how many unseen pairs these heads can distinguish. This empirical separability score serves as a proxy for the subset's transferability. The study evaluates this framework across several datasets, including CIFAR-10, MNIST, CUB200 (fine-grained birds), and various few-shot learning benchmarks like mini-ImageNet.

Key Insights

Separability as a Predictive Metric

The most significant finding is that separability measured on a frozen model is a highly accurate predictor of post-fine-tuning performance. The authors observed a Pearson correlation coefficient of 0.86 to 0.96 on CIFAR-10. This suggests that we can rank the utility of class subsets without the computational overhead of full training cycles.

The Geometry of Learning and "Hard Pairs"

The research highlights that not all classes contribute equally to a model's knowledge. In CIFAR-10, animal classes generally led to better generalization than vehicle classes, though the most robust subsets were those that maintained diversity by including at least one non-animal class.

In few-shot learning contexts, the authors identified "hard pairs" that significantly hinder generalization. For instance, pairs like "Husky vs. Dalmatian" or "crab vs. ants" are difficult because they share overlapping textures or structural patterns. Training on these specific pairs forces the model to learn features that are too narrow, which fails to transfer to broader categories.

Results and Performance

Experimental results confirm the predictive power of the separability metric:

  • Scratch Training: Even when training a ResNet-18 from scratch, metrics derived from a separate pre-trained ViT-8 model served as a strong indicator of subset quality (correlations up to 0.93).
  • Few-Shot Accuracy: On mini-ImageNet, identifying and training on the "best" pairs yielded an accuracy of 94%, whereas training on the "worst" pairs (as identified by the framework) resulted in a drop to 86%.

Conclusion and Future Work

This paper provides a robust mathematical framework for understanding class-based transfer learning. By linking classification to the efficiency of binary partitions, the authors offer a way to identify the most "expressive" data subsets before committing to expensive training.

While the current focus on binary partitions is mathematically elegant, future work is needed to explore high-order interactions between three or more classes. Additionally, the current reliance on a pre-trained "probe" model suggests an opportunity for future research into identifying fundamental classes a priori through self-supervised signals or data geometry alone. This framework paves the way for designing more challenging and effective benchmarks for few-shot and transfer learning.

Summary updated

BibTeX
@inproceedings{baena2024transfer,
  author = {Raphaël Baena and Lucas Drumetz and Vincent Gripon},
  title = {{On Transfer in Classification: How Well do Subsets of Classes Generalize?}},
  booktitle = {EUSIPCO},
  year = {2024},
}
Figure