Machine Learning · Computer Vision

How Image Embeddings Work

A neural network turns every image into a list of numbers — a vector. Similar images get nearby vectors. That single idea powers reverse image search, face unlock, and "find similar products." Explore a real embedding space below.

0.80

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:

cos(A,B) = (A · B) / (|A| |B|) A=[0.9, 0.2, 0.1] (tabby cat) B=[0.8, 0.3, 0.0] (black cat) A·B = 0.72+0.06+0 = 0.78 |A|=0.938 |B|=0.854 cos = 0.78/0.801 = 0.97 → very similar

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

Enjoy this tool? Build your own with Super