Img2Vec: A Teacher of High Token-Diversity Helps Masked AutoEncoders

Heng Pan, Chenyang Liu, Wenxiao Wang, Li Yuan, Hongfa Wang, Zhifeng Li, Wei LiuarXiv 2023 · DOI

Introduction

Masked Image Modeling (MIM) has established itself as the dominant paradigm for pre-training Vision Transformers (ViTs). By reconstructing hidden image patches, models learn robust visual representations. Recent advancements have shifted from reconstructing raw pixels to predicting high-level semantic features provided by a "teacher" model.

A long-standing assumption in knowledge distillation is that a more powerful, larger teacher necessarily produces a superior student. Img2Vec challenges this "bigger is better" dogma. The authors demonstrate a surprising phenomenon: a lightweight ResNet-50 teacher can significantly outperform a massive ViT-Large teacher, enabling a ViT-Base student to achieve state-of-the-art performance.

The Token Diversity Hypothesis

The core contribution of this work is the introduction of the token diversity metric. Token diversity measures the dissimilarity between feature vectors (tokens) within a single image. The authors discovered that many high-performing ViT teachers suffer from "feature collapse," where tokens across different regions of an image become overly similar.

Correlation between teacher token diversity and student accuracy.

When a teacher's features are too uniform, the reconstruction task becomes trivial, and the student fails to learn discriminative, localized features. Conversely, teachers with high token diversity provide a more challenging and informative curriculum. Interestingly, the local inductive bias of ConvNets (like ResNet) naturally promotes higher token diversity compared to the global attention mechanisms of ViTs, making them ideal teachers for MIM.

The Img2Vec Framework

Img2Vec utilizes an asymmetric encoder-decoder architecture designed to maximize information transfer from a high-diversity teacher. The framework incorporates several key innovations:

  1. ResNet Teacher: Based on diversity analysis, a DINO-pretrained ResNet-50 is used as a fixed, off-the-shelf teacher.
  2. Multi-block Feature Aggregation: Instead of relying solely on the final encoder layer, Img2Vec averages features across all encoder blocks to capture a hierarchy of textures and semantics.
  3. Dual Loss Objectives: The model optimizes both a Patch Loss (matching local tokens) and a Global Loss (matching the teacher's overall image representation) to ensure both fine-grained and high-level understanding.
The Img2Vec architecture featuring a ConvNet teacher and dual loss objectives.

Results and Benchmarks

Img2Vec sets new benchmarks across multiple vision tasks using ImageNet-1K for pre-training:

  • ImageNet-1K Classification: A ViT-Base student reached 85.1% top-1 accuracy, a +1.5% improvement over standard MAE. When scaled, ViT-Large and ViT-Huge reached 86.7% and 87.5% respectively, outperforming competitors like data2vec and BootMAE.
  • Object Detection & Segmentation: On the COCO dataset, Img2Vec achieved 51.8% mAP for object detection.
  • Semantic Segmentation: On ADE20K, it reached 50.7% mIoU, establishing a new state-of-the-art for self-supervised models in this category.

Conclusion

Img2Vec reveals that the quality of a teacher in MIM is determined more by the diversity of its feature space than by its raw parameter count. By leveraging the inherent inductive biases of ConvNets to provide a high-diversity target, Img2Vec demonstrates that even modest models can serve as exceptional teachers for the next generation of Vision Transformers. Future work may involve specifically engineering teacher models to further maximize this critical diversity metric.

Summary updated

BibTeX
@misc{pan2023img,
  author = {Heng Pan and Chenyang Liu and Wenxiao Wang and Li Yuan and Hongfa Wang and Zhifeng Li and Wei Liu},
  title = {{Img2Vec: A Teacher of High Token-Diversity Helps Masked AutoEncoders}},
  year = {2023},
  eprint = {2304.12535},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.12535},
}
Figure