freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #91 of 120

clip · contrastive image-text training

NeuraVSThe Overfit Ogre
Neura saysCLIP learns a shared space for images and text by contrastive training on pairs.

CLIP trains an image encoder and a text encoder together so that matching image–caption pairs land near each other in a shared embedding space, and mismatches far apart (contrastive learning, on hundreds of millions of pairs). The result: you can compare images and text directly — zero-shot image classification by comparing to label text, image search by caption. It's foundational to text-to-image and multimodal systems.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleExplain how CLIP enables zero-shot image classification.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>image ↔ caption trained to be close in one space
classify: compare image to "a cat"/"a dog" text vectors
nearest label wins (zero-shot)</pre></body></html>
▶ Open the interactive comic issue
‹ Multimodal · Vision + LanguageImage Generation · Diffusion Models ›