Every later stage needs a way to say two images are alike. An embedding gives you that: a fixed-length vector for each image, scaled to length 1, so cosine similarity is a dot product.
Three kinds of embedding answer different questions:
- CLIP was trained to match images with their captions, on 400 million image and text pairs collected from the internet. Its images and text land in one shared space. That's what makes text queries work: plain language can name a visual concept CLIP learned, or describe a new one. The model then handles new tasks with no extra training.
- Self-supervised vision features, like DINOv2's, are learned from images alone. DINOv2's own curation needed no metadata or text, and worked directly on the images.
- The downstream model's own features, from its last hidden layer. If novel means novel to this model, measure distance in the space this model sees.
That last point is easy to miss. An image can be far from the training set in CLIP space and perfectly familiar to the model, or the reverse. Use CLIP for text queries and general similarity. Use the model's features when the question is what the model finds unfamiliar.
In the editor, write unit(v) and cosine(x, y). The vectors a, b and c are tiny two-number stand-ins for embeddings: b points the same way as a, and c is at a right angle to it.