Skip to content
Technology

What Happens Inside an AI in the 2 Seconds It Takes to Match Your Face

How does face matching work? AI face matching takes four steps, all within about two seconds: detect the face and its five key points, align and crop it, turn it into a 512-number embedding, then compare that embedding with every celebrity photo in the database. The closest celebrities are ranked, and their distances are turned into percentage scores.

Liam BradleySeptember 15, 2026 · 5 min read
Rows of servers lit blue in a data centre
Image: BalticServers.com, CC BY-SA 3.0, via Wikimedia Commons (resized)

Step 1: Face Detection and Alignment

The moment your image arrives, Ollie runs a face detection model to locate the face within the photo. This model identifies five key facial landmarks: the positions of both eye centres, the nose tip, and the two mouth corners. Using these five points, a geometric transformation is applied to the image that standardises the face: rotating it so the eyes are horizontal, scaling it so the inter-ocular distance matches the expected value, and cropping to a square region centred on the face.

This face alignment step is not cosmetic, it is functionally critical. The recognition network was trained exclusively on aligned face crops. Providing it with a misaligned crop, even by a small amount, shifts the positions of facial features relative to the patterns the network expects, substantially degrading embedding accuracy.

Step 2: Embedding Extraction

The aligned crop is passed through the convolutional neural network. The image travels through multiple convolutional blocks, each extracting progressively higher-level features. This forward pass is the most computationally intensive step in the pipeline, on Ollie's server it takes a fraction of a second. The final layer produces a 512-number vector, which is then L2-normalised.

The resulting 512-number vector is your facial embedding, the mathematical fingerprint of your face as the network understands it. It encodes the structural geometry of your face in a format optimised for distance computation. This vector is the only thing passed to the next stage; the original image is no longer needed.

Step 3: Comparing Against Every Celebrity

Your embedding is compared with the pre-computed embedding of every celebrity photo in Ollie's database. There is no shortcut or approximation: for tens of thousands of photos this is one matrix calculation that finishes in milliseconds.

The comparison gives a distance for each photo: the Euclidean distance between two L2-normalised vectors, which grows with the angle between them. Each celebrity's score comes from their single closest photo, the one that looks most like you.

Step 4: Score Conversion and Ranking

The distances are turned into percentages in two steps: each distance is mapped onto a 0–100 scale, and then the range where real matches fall is stretched so the differences between your top matches are easier to see. The order of your matches never changes; only the display does. The percentage isn't calibrated against human ratings, so read it as a ranking aid rather than a probability.

The top five celebrities, with their percentages and the photo of each that matched you best, are sent back to your browser. A search usually takes a few seconds, or up to about 15 seconds when the server has to wake up first.

Frequently Asked Questions

How long does Ollie take to find a celebrity match?

Usually a few seconds. If the matching server has been idle, it can take up to about 15 seconds to wake up first.

Does Ollie compare my face with every celebrity?

Yes. Your fingerprint is compared with the fingerprint of every celebrity photo in the database, which takes milliseconds. Each celebrity is then scored by their two best-matching photos.

Does Ollie store my photo or embedding after processing?

No. Your image and the resulting embedding are used only during the current session to compute your matches. Neither is retained after the session ends.

Try it yourself

Find your celebrity lookalike

Upload a photo and see which celebrities you look most like. Free to try, and your photo is never stored.

Find my celebrity look alike

Related Articles