Zero-shot generalization across architectures for visual classification

Evan Gerritz, Luciano Dyballa, Steven W. Zucker

Introduction

This paper investigates how well deep learning models generalize to entirely new, unseen categories of data—specifically different artists in Chinese calligraphy—without any external semantic guidance. The researchers found that high classification accuracy on trained classes is a poor predictor of how well a model generalizes. Furthermore, the most "generalizable" representations often reside in the middle layers of a network rather than at the end.

The Challenge: Zero-Shot Generalization

In standard machine learning, "generalization" usually refers to a model’s ability to correctly classify new images of classes it has already seen. This paper tackles a much harder version: zero-shot generalization to unseen classes.

The authors use Chinese calligraphy as a "minimalist" testbed. Unlike natural images where objects have distinct shapes and colors, calligraphy consists only of black ink on white paper. To succeed, a model must separate "content" (the character being written) from "style" (the unique stroke patterns of the artist). The core question is: if a model learns to distinguish 15 calligraphers, can it naturally cluster the work of a 16th calligrapher it has never encountered?

Clustering of unseen calligraphy styles

Methodology: Measuring Generalization

The researchers fine-tuned an ensemble of popular architectures, including classic CNNs (ResNet50), pure Transformers (ViT), and hybrid models (Swin, PoolFormer, ConvNeXtV2) on the Chinese Calligraphy Styles dataset (training on 15 artists, testing on 5 unseen) and CIFAR-100.

To measure generalization without using text-based labels, they developed a Generalization Index ($g$):

  1. They extract the internal "embeddings" (mathematical representations) of images from unseen classes at various layers of the network.
  2. They perform k-means clustering on these embeddings.
  3. They calculate the Normalized Mutual Information (NMI) between these clusters and the actual ground-truth classes.

A high $g$ value indicates the network has naturally learned a feature space that separates new classes based on their underlying characteristics, despite never being trained on them.

Key Insights

1. Accuracy is Deceptive

All models achieved over 95% accuracy on the training classes, but their ability to generalize to unseen artists varied wildly. A model that is "perfect" at memorizing its training set isn't necessarily better at understanding the underlying "language" of the domain.

2. The "Goldilocks" Layer

Generalization is non-monotonic with respect to depth. In many models, the ability to separate unseen classes peaks in the middle layers and actually decreases toward the final output layer. The final layers become too specialized for the specific training classes, losing the broader "stylistic" features found earlier.

Generalizability across layers and training steps

3. Architecture Matters

Different designs produce very different internal representations. For instance, PoolFormer-S12 showed the highest generalization index ($g = 0.79$), followed by PViT ($0.77$). Standard ResNet50 ($0.62$) and Swin Transformer ($0.62$) struggled more with unseen classes despite having high training accuracy. This suggests that certain architectural choices (like specific spatial pooling mechanisms) might be more robust for zero-shot tasks.

Conclusion and Future Work

While calligraphy is excellent for isolating style in a "minimalist" domain, it remains to be seen if these specific layer-depth trends hold for more complex, multi-modal datasets. However, the consistency of the mid-layer generalization trend across both calligraphy and CIFAR-100 is compelling.

The paper concludes with a provocative question for the field: What if we ranked models based on their generalization index rather than their top-1 accuracy? Future work could involve designing loss functions that explicitly reward the formation of these generalizable latent spaces, rather than just minimizing classification error on a fixed set of labels.

Summary updated

BibTeX
@inproceedings{gerritz2024zero,
  author = {Evan Gerritz and Luciano Dyballa and Steven W. Zucker},
  title = {{Zero-shot generalization across architectures for visual classification}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=orYMrUv7eu},
}
Figure