An image becomes a list of numbers
Before an AI system can compare images, it converts each one into an embedding — a vector of a few hundred to a few thousand numbers produced by a neural network trained to place visually and semantically similar images near each other in that numeric space. Two photos of golden retrievers on grass end up as nearby points even if the exact pixels are completely different; a photo of a golden retriever and a photo of a cat end up far apart.
Similarity becomes a distance calculation
Once every image in an index is represented as a vector, finding 'visually similar' results is a matter of measuring distance between vectors — commonly cosine similarity or Euclidean distance — and returning the nearest neighbors to the query image's vector. At the scale of billions of images, this nearest-neighbor search is done with specialized index structures (like HNSW or IVF) rather than a brute-force comparison against every stored vector.
Why this differs from perceptual hashing
Perceptual hashing (pHash, dHash) also reduces an image to a compact representation, but it's built from low-level visual structure — gradients, luminance, edges — and is designed to catch near-duplicate images: the same photo resized, recompressed, or lightly cropped. AI embeddings, by contrast, are trained to capture semantic content, so they can match a different photo of a similar-looking object or scene, not just a variant of the same file. Perceptual hashing answers 'is this the same image?'; embedding-based search answers 'what does this image show, and what else looks like it?'
Why this differs from classic reverse image search
Early reverse image search relied heavily on matching an image against pages where visually or contextually identical copies had been crawled and indexed, often leaning on surrounding text and metadata alongside pixel-level signals. Modern engines including Google Lens now layer embedding-based visual matching on top of that, which is why they can identify an object, plant, or landmark in a photo that has never appeared anywhere else online — the system doesn't need an identical prior copy, only conceptually similar images it was trained or indexed on.
The practical implication for your own searches
When a reverse image search returns 'visually similar' results rather than exact source matches, that's the embedding-based layer at work — useful for identifying what something is, less useful for proving where a specific image originally came from. For provenance questions, engines and techniques weighted toward exact and near-exact matching (like TinEye, or a perceptual-hash similarity check against a known original) remain the more reliable tool.