Skip to main content
Interactive 3D/CLIP Contrastive Learning
Parameters
Batch Size6
Temperature τ0.070
HUD
Batch: 6
Positives: 6
Negatives: 30
Train step: 0
Temperature: 0.070
Zero-shot transfer: after training, classify new images by embedding class name and finding nearest image embedding.

CLIP Contrastive Learning - Interactive Visualization

CLIP (Contrastive Language–Image Pretraining) trains a joint image-text embedding space by maximizing similarity of matching image-text pairs while minimizing similarity of non-matching pairs. The InfoNCE loss treats each batch of N pairs as N classification problems. This shared space enables zero-shot transfer to any image classification task.

  • Batch similarity matrix - see the N×N cosine similarity grid where diagonal entries are positive pairs and off-diagonal are negatives
  • InfoNCE loss - watch how the loss pushes matched embeddings together and unmatched embeddings apart simultaneously
  • Zero-shot classification - see how text prompts like "a photo of a dog" are compared to image embeddings at inference
  • Embedding space visualization - watch image and text embeddings cluster by semantic meaning after contrastive training
  • Compare CLIP, ALIGN, and SigLIP loss formulations and understand why SigLIP uses sigmoid instead of softmax

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.