Unsupervised feature learning by augmenting single images

Alexey Dosovitskiy, Jost Tobias Springenberg, Thomas Brox

Abstract

We introduce a simple yet effective method for unsupervised feature learning that leverages the power of discriminative training. By treating individual, unlabeled image patches as unique "surrogate classes" and subjecting them to extreme data augmentation, we train a convolutional neural network (CNN) to learn features that are both discriminative and invariant to common distortions. Our approach, known as Exemplar-CNN, achieves state-of-the-art results on the STL-10 benchmark and demonstrates strong generalization across various object recognition datasets without requiring any human-provided labels.

Introduction

The success of deep learning in computer vision has largely depended on massive, human-labeled datasets. However, the cost and scalability of manual labeling remain significant bottlenecks. Unsupervised learning—extracting meaningful representations from raw, unlabeled data—offers a solution, yet historically, these methods have lagged behind supervised counterparts.

Most unsupervised approaches have focused on reconstruction-based objectives, such as autoencoders, which aim to recreate input pixels perfectly. We argue that reconstruction is not necessarily the optimal proxy for learning discriminative features. Instead, we propose to bridge this gap by repurposing supervised discriminative training for a task where labels are automatically generated from the data itself.

Methodology

Our pipeline transforms unsupervised learning into a standard multi-class classification problem through the following steps:

  1. Data Acquisition: We sample $N$ random 32x32 pixel patches from unlabeled images, selecting only those with high "gradient energy" to ensure they contain informative content rather than flat colors.
  2. Surrogate Class Creation: Each sampled patch is defined as a unique class. For instance, sampling 8,000 patches creates an 8,000-way classification task.
  3. Extreme Augmentation: To force the network to learn invariant features, we apply a variety of random transformations to each "seed" patch, including translation, scaling, and adjustments to color, contrast, and pixel principal components.
Figure 2: Examples of a surrogate class. The top-left image (red box) is the original seed patch, while the others are transformed versions that the network must learn to classify as the same entity.
  1. Discriminative Training: A CNN is trained to recognize which seed patch a transformed image originated from. This forces the model to ignore the specific transformations and focus on the underlying identity of the patch.
  2. Feature Extraction: After training, the CNN weights are frozen. The layer responses serve as features for a linear Support Vector Machine (SVM) evaluated on standard benchmarks like STL-10, CIFAR-10, and Caltech-101.

Results

The Exemplar-CNN approach demonstrated significant improvements over existing unsupervised methods at the time of publication. On the STL-10 dataset, which is specifically designed for unsupervised learning with 100,000 unlabeled images, our method achieved an accuracy of 67.4%, surpassing previous state-of-the-art techniques.

Figure 5: Comparison of the proposed method against other unsupervised learning techniques across multiple benchmarks.

Furthermore, the features learned on STL-10 generalized remarkably well to the Caltech-101 dataset, reaching 76.6% accuracy. This suggests that the learned representations are not merely overfit to the source data but capture fundamental visual properties.

Discussion and Key Insights

The core insight of this work is that data augmentation can serve as a primary source of supervision. By encoding prior knowledge about natural image variations (e.g., lighting changes or small shifts) into the training task, the model learns robust representations.

However, the method faces a complexity trade-off. Performance tends to plateau or degrade when the number of surrogate classes exceeds a certain threshold (approximately 8,000). This occurs because random patches eventually begin to overlap in content (e.g., two different patches of grass), leading to conflicting labels in the surrogate task.

Limitations and Future Directions

While effective, Exemplar-CNN is limited to the specific invariances provided during augmentation. It currently struggles with high-level transformations like 3D viewpoint changes or inter-instance variations (e.g., recognizing different breeds of dogs as the same category). Future work could involve using video data to provide more natural temporal augmentations or developing methods to automatically merge similar surrogate classes to scale the approach further.

Summary updated

BibTeX
@inproceedings{dosovitskiy2014unsupervised,
  author = {Alexey Dosovitskiy and Jost Tobias Springenberg and Thomas Brox},
  title = {{Unsupervised feature learning by augmenting single images}},
  booktitle = {Workshops @ ICLR},
  year = {2014},
  url = {https://openreview.net/forum?id=V3zBnWCTzxa},
}
Figure