Viewmaker Networks: Learning Views for Unsupervised Representation Learning

Alex Tamkin, Mike Wu, Noah D. Goodman

Abstract

Many recent methods for unsupervised representation learning train models to be invariant to different "views," or distorted versions of an input. However, designing these views requires considerable trial and error by human experts, hindering widespread adoption of unsupervised representation learning methods across domains and modalities. To address this, we propose viewmaker networks: generative models that learn to produce useful views from a given input. Viewmakers are stochastic bounded adversaries: they produce views by generating and then adding an $\ell_p$-bounded perturbation to the input, and are trained adversarially with respect to the main encoder network. Remarkably, when pretraining on CIFAR-10, our learned views enable comparable transfer accuracy to the well-tuned SimCLR augmentations -- despite not including transformations like cropping or color jitter. Furthermore, our learned views significantly outperform baseline augmentations on speech recordings (+9% points, on average) and wearable sensor data (+17% points). Viewmakers can also be combined with handcrafted views: they improve robustness to common image corruptions and can increase transfer performance in cases where handcrafted views are less explored. These results suggest that viewmakers may provide a path towards more general representation learning algorithms -- reducing the domain expertise and effort needed to pretrain on a much wider set of domains.

Introduction

In self-supervised contrastive learning, the "view" is the fundamental unit of training. Models are taught to recognize that two different versions of the same input—such as a cropped image and a color-distorted version—represent the same underlying concept. However, these views are almost always designed by humans. While we have decades of experience with image augmentations like flipping and cropping, we lack similar intuition for complex data like 52-channel wearable sensor streams or high-fidelity audio. This reliance on domain expertise limits the expansion of self-supervised learning to new fields.

To overcome this bottleneck, we introduce Viewmaker Networks, a generative approach that learns to create data augmentations automatically. By shifting from manual feature engineering to "augmentation learning," we provide a modality-agnostic framework capable of generating effective views for images, speech, and sensor data alike.

Methods

Viewmaker Networks utilize a generative model to produce stochastic, additive perturbations. Instead of a human deciding to "blur" an image, the Viewmaker learns to generate a distortion that makes the contrastive task more challenging for the main encoder.

The Viewmaker architecture: a generative model produces stochastic, bounded perturbations to create views for contrastive learning.

Key technical components include:

  • Adversarial Training: The Viewmaker is trained to maximize the contrastive loss, while the encoder tries to minimize it. This forces the Viewmaker to identify "challenging" views that highlight essential features.
  • $\ell_1$ Bounded Perturbations: To prevent the Viewmaker from simply deleting the input signal, its output is constrained to an $\ell_1$ sphere. This "distortion budget" ensures the generated views remain faithful to the original data.
  • Stochasticity: By injecting random noise, the system generates diverse views for a single input, a core requirement for contrastive objectives like SimCLR.
  • Modality Agnostic Design: Because the perturbations are additive noise, the same architecture can be applied to 1D sensor data, 2D spectrograms, or 3D image volumes with minimal changes.

Results and Key Insights

We evaluated Viewmaker across three distinct modalities: images (CIFAR-10), speech (LibriSpeech), and wearable sensors (Pamap2).

  • Breaking the "Expert" Ceiling: In domains like speech and sensors, where human-defined augmentations are less mature, Viewmaker significantly outperformed human baselines. It improved speech recognition tasks by an average of +9 percentage points and sensor-based activity recognition by +17 percentage points.
  • Competitive Image Performance: On CIFAR-10, Viewmaker achieved 84.5% transfer accuracy, nearly matching the 86.2% of SimCLR’s heavily optimized, expert-designed augmentations—despite the Viewmaker lacking explicit geometric transforms like cropping.
  • Robustness through Diversity: Combining Viewmakers with traditional augmentations improved model robustness to common image corruptions (e.g., CIFAR-10-C), as the adversarial training prepares the encoder for diverse, unseen noise types.

Discussion

Visual analysis of the learned views suggests a "Spatial Ablation" hypothesis. The Viewmaker often produces "ghostly" versions or partial masks of objects, effectively performing a form of spatial information ablation similar to cropping, but through learned additive noise rather than geometric manipulation.

Examples of views generated by the Viewmaker network for different image classes, illustrating the diverse and 'ghostly' nature of the learned distortions.

Despite these successes, Viewmaker Networks introduce trade-offs. Training an additional generative network increases computational time by roughly 50% and doubles GPU memory utilization. Furthermore, performance is highly sensitive to the distortion budget ($\epsilon$); a budget that is too high destroys the signal, while one that is too low makes the task trivial for the encoder.

Conclusion

Viewmaker Networks represent a significant step toward general-purpose representation learning. By automating the creation of data views, this framework reduces the need for domain-specific expertise, potentially opening the door for self-supervised learning in specialized scientific and industrial domains where visual intuition is absent.

Summary updated

BibTeX
@inproceedings{tamkin2021viewmaker,
  author = {Alex Tamkin and Mike Wu and Noah D. Goodman},
  title = {{Viewmaker Networks: Learning Views for Unsupervised Representation Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=enoVQWLsfyL},
}
Figure