Pick a query image to run a nearest-neighbor search.
Drag to rotate · Points that beat the similarity threshold glow and link to the query star
From pixels to vectors
An embedding model (a CNN or vision transformer, e.g. CLIP) processes an image through dozens of layers. Early layers detect edges and textures; later layers detect parts and objects. The final layer outputs a vector — typically 512 to 1536 numbers — that summarizes what the image is about, not what its pixels are.
The key property
Training pushes semantically similar images together: two different cats end up close in vector space even if their pixels share almost nothing. The 3D scene above is a compressed view — real spaces have hundreds of dimensions, but the geometry works the same way.
Measuring similarity
The standard metric is cosine similarity — the angle between two vectors, ignoring their length:
Scores range from −1 to 1. In practice: >0.9 near-duplicates, 0.75–0.9 same subject, <0.6 unrelated. Your threshold slider above is exactly the knob real search systems tune.
Where embeddings run your daily life
- Reverse image search: embed the query, find nearest neighbors among billions of stored vectors using an ANN index (HNSW, IVF) in milliseconds.
- Face unlock: your phone stores an embedding of your face — never a photo — and compares distances at unlock time.
- Product recommendations: "similar items" = nearest neighbors of the product image embedding.
- Content moderation: known-bad images are matched by embedding even after crops and filters.
- Text-to-image search: models like CLIP embed text and images into the same space, so the phrase "red bicycle" lands near photos of red bicycles.