Are Large-scale Datasets Necessary for Self-Supervised Pre-training?

Alaaeldin El-Nouby, Gautier Izacard, Hugo Touvron, Ivan Laptev, Hervé Jégou, Edouard GravearXiv 2021

Abstract

Pre-training models on large-scale datasets, like ImageNet, is a standard practice in computer vision. This paradigm is especially effective for tasks with small training sets, for which high-capacity models tend to overfit. In this work, we consider a self-supervised pre-training scenario that only leverages the target task data. We consider datasets, like Stanford Cars, Sketch or COCO, which are order(s) of magnitude smaller than ImageNet. Our study shows that denoising autoencoders, such as BEiT or a variant that we introduce in this paper, are more robust to the type and size of the pre-training data than popular self-supervised methods trained by comparing image embeddings. We obtain competitive performance compared to ImageNet pre-training on a variety of classification datasets, from different domains. On COCO, when pre-training solely using COCO images, the detection and instance segmentation performance surpasses the supervised ImageNet pre-training in a comparable setting.

Introduction

Modern, high-capacity Vision Transformers (ViTs) tend to overfit when trained on small or medium-sized datasets. The standard solution is to pre-train the model on a massive, curated dataset like ImageNet and then fine-tune it on the target data. However, this introduces two significant problems: domain shift, where ImageNet's natural, object-centric images do not represent specialized tasks like medical imaging or sketches; and supervision collapse, where fixed labels force the network to discard information irrelevant to those specific classes.

While self-supervised learning (SSL) methods like contrastive learning (e.g., DINO) solve the label issue, they still typically require millions of images to perform well. This paper challenges the "bigger is always better" data paradigm by asking if we can skip massive pre-training datasets entirely and effectively pre-train a model using only the limited, uncurated data of the target task.

Methodology: The SplitMask Architecture

The authors focus on denoising autoencoders—specifically Masked Image Modeling (MIM), where patches of an image are hidden, and the model must reconstruct them. They introduce a novel architecture called SplitMask, which improves upon existing MIM methods like BEiT through three key innovations:

  1. Encoder-Decoder Split: An image is divided into patches and split into two disjoint subsets. A deep ViT encoder processes only the observed patches, making it highly efficient. A shallow decoder then takes these representations, adds mask tokens, and predicts the missing patches.
  2. Global Contrastive Loss: In addition to the local patch-reconstruction loss, SplitMask applies an image-level contrastive loss (InfoNCE). It average-pools the outputs of the two subsets and forces them to match, providing a globally coherent feature representation with minimal computational overhead.
  3. Simplified Tokenization: Unlike BEiT, which relies on a complex DALL-E tokenizer pre-trained on massive datasets, the authors demonstrate that simple, untrained alternatives like random projection or k-means clustering are sufficient.
The SplitMask architecture features a deep ViT encoder processing only visible patches and a shallow decoder for reconstruction, augmented by a global InfoNCE loss.

Experimental Results

The approach was evaluated across a wide variety of datasets, including ImageNet subsets (1% and 10%), COCO (object detection), and fine-grained classification tasks like iNaturalist and Stanford Cars.

Sample Efficiency and Domain Adaptation

A key finding is that MIM is remarkably sample-efficient. Unlike contrastive learning methods that degrade rapidly with less data, denoising autoencoders are highly robust. Transfer performance for SplitMask actually plateaus using just 5% of ImageNet. Furthermore, MIM methods thrive on uncurated, complex data like COCO, whereas joint embedding methods (like DINO) often fail because their augmentations assume a single central object.

Performance on COCO

One of the most striking results occurs in object detection. When pre-training a ViT-Base solely on COCO images (roughly 118k images, which is 10x smaller than ImageNet), SplitMask achieves a +1.1 higher box AP compared to a model pre-trained on ImageNet with supervised labels. This suggests that pre-training on a small dataset that perfectly matches the target domain is often superior to pre-training on 1.2 million out-of-domain images.

Comparison of object detection performance (Box mAP) on COCO. Pre-training solely on COCO images (orange) outperforms supervised ImageNet pre-training (light blue).

Conclusion and Future Work

This research demonstrates that large-scale datasets are not always a prerequisite for high-performing self-supervised models. By using denoising autoencoders like SplitMask, researchers can achieve competitive results using only target-task data, even in data-constrained or specialized domains.

However, limitations remain. For extremely small datasets (under 10,000 images), pre-training for too many epochs can lead to overfitting that harms fine-tuning. Future work will focus on developing stronger augmentations and optimal scheduling to mitigate these effects in the sub-10k image regime.

Summary updated

BibTeX
@misc{elnouby2021are,
  author = {Alaaeldin El-Nouby and Gautier Izacard and Hugo Touvron and Ivan Laptev and Hervé Jégou and Edouard Grave},
  title = {{Are Large-scale Datasets Necessary for Self-Supervised Pre-training?}},
  year = {2021},
  eprint = {2112.10740},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.10740},
}
Figure