i-Mix: A Domain-Agnostic Strategy for Contrastive Representation Learning

Kibok Lee, Yian Zhu, Kihyuk Sohn, Chun-Liang Li, Jinwoo Shin, Honglak Lee

TL;DR

The paper introduces i-Mix (instance Mix), a domain-agnostic regularization strategy that adapts the popular MixUp technique to self-supervised contrastive representation learning. By treating every data instance in a batch as a unique "virtual class," i-Mix interpolates both the inputs and their virtual labels, significantly boosting performance across image, speech, and tabular domains without requiring domain-specific engineering.

What Problem Does This Paper Address?

Contrastive representation learning has revolutionized self-supervised learning (SSL), particularly in computer vision. However, its success heavily relies on carefully engineered, domain-specific data augmentations (like color jittering or random cropping) to create positive and negative pairs.

This reliance creates two major bottlenecks:

  1. Domain Dependency: Designing effective augmentations requires deep domain expertise, making it difficult to extend contrastive learning to non-vision domains like speech or tabular data.
  2. Data Scarcity & Overfitting: In real-world applications where unlabeled data is limited or expensive to acquire, contrastive learning models are prone to overfitting when trained over many epochs.

The authors address these challenges by proposing a general, data-driven augmentation strategy that works independently of the underlying data type.

Methods

The core innovation of i-Mix is casting contrastive learning as a non-parametric classification problem.

  1. Virtual Labels: For a batch of $N$ data pairs, each instance is assigned a unique, one-hot "virtual label" vector of length $N$ (or $2N$ depending on the framework), representing its distinct identity within the batch.
  2. Mixing Inputs and Labels: Following the principle of MixUp, i-Mix linearly interpolates two data instances ($x_i, x_j$) in the input space and their corresponding virtual labels ($v_i, v_j$) in the label space using a mixing coefficient $\lambda$ sampled from a Beta distribution: $$\tilde{x} = \lambda x_i + (1-\lambda)x_j$$ $$\tilde{v} = \lambda v_i + (1-\lambda)v_j$$
  3. Framework Integration: The authors demonstrate how this virtual label formulation seamlessly integrates into state-of-the-art SSL frameworks, including SimCLR (simplified into an N-pair contrastive loss), MoCo v2, and BYOL (a negative-free method).

Additionally, they propose InputMix for scenarios where domain-specific augmentations are entirely absent. InputMix mixes the inputs but assigns the label of the dominant instance, acting as structured noise injection.

Datasets

The authors evaluated i-Mix across three distinct domains using the following datasets:

  • Image: CIFAR-10, CIFAR-100, ImageNet-100 (a 100-class subset), and the full ImageNet-1k dataset.
  • Speech: The Speech Commands dataset (51k audio clips across 12 classes), transformed into mel-spectrograms.
  • Tabular: Forest Cover Type (CovType) from the UCI repository and the Higgs Boson dataset (evaluated at 100k and 1M sample scales).

Key Insights and Ideas

  • Identity as a Class: Treating each data point as its own class allows supervised regularization techniques (like MixUp) to be directly ported into unsupervised landscapes.
  • Overfitting Prevention: Vanilla contrastive learning models often degrade in performance when trained for too many epochs due to overfitting on the pretext task. i-Mix acts as a powerful regularizer, enabling steady performance gains even up to 2000 epochs.
  • Robustness to Limited Augmentations: When standard domain-specific augmentations are removed, vanilla contrastive learning fails completely. i-Mix (combined with InputMix) prevents this catastrophic failure, showing that data-driven interpolation can substitute for hand-crafted domain knowledge.

Key Results

The authors evaluated the quality of the learned representations by training a linear classifier on top of the frozen features (linear evaluation protocol).

  • Cross-Domain Gains: As shown in the main results, i-Mix consistently improves downstream accuracy across all tested frameworks and domains. For instance, applying i-Mix to MoCo v2 on CIFAR-100 boosted accuracy from 71.6% to 78.1% (+6.5%).
Main Results Table
  • Model Scaling: The regularization effect is especially pronounced in deeper architectures (like ResNet-152) and longer training regimes, where vanilla MoCo v2 performance begins to decline due to overfitting.
Figure 1: Comparison of performance gains by applying i-Mix to MoCo v2 with different model sizes and number of epochs on CIFAR-10 and 100.
  • Learning Without Augmentations: On CIFAR-10 without any standard image augmentations, vanilla MoCo v2 drops to a meager 47.7% accuracy. Adding i-Mix brings it back up to 83.4%, demonstrating its domain-agnostic utility.

Limitations and Future Work

  • Diminishing Returns on Massive Datasets: While i-Mix provides massive gains on smaller or medium-sized datasets (like ImageNet-100), its relative improvement on the massive full ImageNet-1k dataset is modest (70.9% to 71.3%).
  • Compute Overhead in Standard SimCLR: Applying i-Mix directly to the standard SimCLR formulation requires processing both clean and mixed data, which doubles memory consumption and training time. The authors bypassed this by using an N-pair loss formulation, but optimizing it for standard architectures remains an open engineering challenge.

Summary updated

BibTeX
@inproceedings{lee2021i,
  author = {Kibok Lee and Yian Zhu and Kihyuk Sohn and Chun-Liang Li and Jinwoo Shin and Honglak Lee},
  title = {{i-Mix: A Domain-Agnostic Strategy for Contrastive Representation Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=T6AxtOaWydQ},
}
Figure