TL;DR
This paper introduces a novel method to quantify a deep learning model's "open-set" generalization capacity by measuring how cleanly unseen categories cluster within its intermediate layers. By evaluating popular vision models, the authors reveal two counterintuitive findings: high training accuracy does not guarantee good generalization to new classes, and the deepest layers are often not the best at representing novel data.
What Problem Does This Paper Address?
When we evaluate a machine learning model, we typically test it on held-out data from the same classes it was trained on (e.g., training on 10 dog breeds and testing on new images of those same 10 breeds). This is "weak generalization."
But what happens when the model encounters entirely new categories within the same broader domain (e.g., an 11th dog breed)? This "open-set" generalization scenario is critical for few-shot learning and category discovery.
The authors address a fundamental gap: How do we measure a network's intrinsic capacity to represent a domain, and which layers actually contain the most generalizable features? Conventional wisdom suggests that deeper layers learn more useful representations, but this paper rigorously tests that assumption.
Methods
The authors propose a separability-based framework to evaluate intermediate layers. The core idea is that if a model has learned a rich, robust feature space from "seen" classes, it should naturally separate "unseen" classes into distinct clusters, even without explicit training on them.
The pipeline works as follows:
- Fine-tuning: Train a pre-trained model on a subset of a dataset ("seen classes").
- Feature Extraction: Pass images from the remaining "unseen classes" through the network and extract latent embeddings from every intermediate layer.
- Quantifying Generalization ($g$): Measure how well these unseen embeddings separate into their true categories using three distinct metrics:
- K-means + Normalized Mutual Information (NMI): An unsupervised metric evaluating how cleanly K-means clustering recovers the true labels.
- k-Nearest Neighbors (kNN): An unsupervised metric measuring the local neighborhood purity of data points.
- Linear Probe: A supervised metric where a simple linear classifier is trained on a small subset of the unseen data to measure linear separability.
Datasets
The methodology was validated across two structurally diverse image classification datasets:
- CIFAR-100: A natural scenes dataset. To prevent data leakage from ImageNet-1k pre-training, the authors carefully selected 5 flower species ('sunflower', 'tulip', 'orchid', 'poppy', 'rose') as the unseen classes, using 15 other classes as seen data.
- Chinese Calligraphy Dataset: A grayscale dataset classifying characters by the artist who drew them (15 seen artists, 5 unseen).
Six state-of-the-art architectures were evaluated: ViT-base, Swin Transformer, Pyramid ViT (PViT), CvT-21, PoolFormer-S12, and ConvNeXt V2.
Key Insights and Ideas
- Accuracy $\neq$ Generalization: Models can achieve near-perfect validation accuracy on seen classes while their ability to generalize to unseen classes plateaus or even declines during training. This implies the network is overfitting to the specific sub-domain of the training data rather than mastering the broader domain.
- The Best Layer Isn't Always the Deepest: Generalization performance is non-monotonic across network depth. For standard Vision Transformers (ViT), the peak generalization capacity actually resides in the early layers (around layer 3 or 4 out of 12). For hierarchical models like Swin, it peaks at the very end.
- Architecture Dictates the Curve: The pattern of generalizability across layers is remarkably consistent for a given architecture, regardless of whether it is processing natural color images (CIFAR-100) or grayscale brush strokes (Calligraphy). This indicates that layer-wise generalizability is an intrinsic property of the network's architecture.
Key Results
- High Seen Accuracy, Low Unseen Separability: On CIFAR-100, while all models achieved over 92% accuracy on seen classes, the unsupervised generalization index ($g_{NMI}$) for unseen classes was strikingly low, ranging from a dismal 0.04 (Swin) to a modest 0.26 (ViT).
- Early Layer Efficiency in ViT: For the standard ViT model, the highest generalization score was achieved using less than a third of the full network. This has massive implications for model pruning and inference efficiency.
- Supervised vs. Unsupervised alignment: Across all experiments, the unsupervised clustering metrics (NMI and kNN) strongly aligned with the supervised linear probe accuracy, validating that simple clustering is a reliable proxy for feature utility.
Limitations and Future Work
While the paper uncovers clear architectural signatures, it operates under a few constraints:
- Domain Proximity: The unseen classes must still belong to the broader domain of the dataset (e.g., flowers within CIFAR). The paper does not explore extreme out-of-distribution shifts (e.g., training on calligraphy and testing on flowers).
- Fixed Training Paradigms: The models were evaluated using standard cross-entropy fine-tuning.
The authors suggest that future work should leverage this framework to evaluate how alternative training paradigms—such as contrastive learning or specific regularization techniques like dropout—alter the internal generalizability curves of these architectures.
Summary updated