Home Knowledge Base Contrastive Learning

Contrastive Learning is the self-supervised representation learning framework that trains neural networks to map similar (positive) pairs of inputs close together in embedding space while pushing dissimilar (negative) pairs apart — learning powerful visual and multimodal representations from unlabeled data that match or exceed supervised pretraining on downstream tasks like classification, detection, and retrieval.

Core Mechanism

Given an input x, create two augmented views (x⁺, x⁺'). These are the positive pair (same image, different augmentation). All other samples in the batch serve as negatives. The model is trained to:

The InfoNCE loss formalizes this: L = -log[exp(sim(z_i, z_j)/τ) / Σ_k exp(sim(z_i, z_k)/τ)], where τ is a temperature parameter controlling the sharpness of the distribution.

Key Methods

Data Augmentation as Supervision

The augmentation strategy implicitly defines what the model should be invariant to. Standard augmentations: random resized crop (spatial invariance), horizontal flip, color jitter (illumination invariance), Gaussian blur, solarization. The combination and strength of augmentations dramatically impact representation quality.

Evaluation Protocol

Contrastive representations are evaluated by linear probing: freeze the learned encoder, train a single linear classifier on labeled data. SimCLR achieves 76.5% top-1 on ImageNet linear probing; DINOv2 achieves 86.3% — approaching supervised ViT performance without any labeled data.

Contrastive Learning is the paradigm that proved visual representations can be learned from structure rather than labels — making self-supervised pretraining the default initialization strategy for modern computer vision systems.

contrastive learning self supervisedsimclr byol dinopositive negative pairscontrastive loss infoncerepresentation learning contrastive

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.