WhichCelebrity

How celebrity face matching works (in plain English)

You choose a selfie, and a moment later a famous face appears next to yours. Here is what actually happens in between, with no maths degree required.

The short version

Your face is turned into a list of 128 numbers, a kind of "face print". We compare that list with the lists we prepared in advance for 961 actors. The actor whose numbers are closest to yours comes first. That is all a "match" is: the nearest neighbour in a space of numbers.

Selfie Find face 128 numbers Closest actor

Step 1: finding the face

First the page has to know where your face is. We use Google's MediaPipe Face Landmarker, which runs inside your browser. It places 478 landmarks on the face: points around the eyes, brows, nose, lips and jawline. It also produces expression scores (called blendshapes), such as how much you are smiling.

If no face is found, or the photo is unusable, the process stops here and asks for a different picture.

Step 2: straightening and cropping

People tilt their heads and hold cameras at odd angles. Using the landmarks, the face is rotated so the eyes sit level, then cropped to a 150-pixel square. This gives the next stage a consistent, tidy input, whether your original photo was huge or tiny.

Step 3: the 128-number face print

The cropped face goes into a neural network, a dlib ResNet model run through the face-api library. It was trained on a very large number of face images to do one job: give photos of the same person similar numbers, and photos of different people different numbers.

The result is 128 numbers. Individually they mean nothing you could name, such as "nose width". Together they act like a fingerprint for how a face looks in that particular photo.

Step 4: comparing with the actors

Before you arrive, we prepare face prints for 961 actors from Hollywood, Bollywood and British film and television. The photos used are freely licensed images from Wikimedia Commons, and each one is credited on the Credits page.

Your face print is compared with every actor's. The comparison is a distance: how far apart are the two lists of 128 numbers? A small distance means the network sees the faces as similar.

What the distance tells you

These are typical figures, not guarantees. Some pairs of strangers are close, and some photos of the same person are far apart.

What the similarity percentage means

Distances are not very friendly to read, so we rescale them into a similarity percentage. It is a presentation choice: a smaller distance gives a higher percentage, and we cap it at 97% so that nobody is ever told they are a perfect copy of someone.

Treat the percentage as a ranking aid. A 90% match is closer in face-print terms than an 80% match, but neither is a statement about how alike you look to a human eye.

How well does it work?

We tested the matching on held-out photos of the actors themselves, meaning photos that were not used to build their face prints. In that test the right actor came first about 81% of the time and was among the top 5 about 90% of the time.

An important caveat: this measures how well the system recognises the actors. It does not measure how "right" a match feels for you, because there is no correct answer when a visitor is not in the database. Your result is a fun resemblance, not a verdict.

An everyday analogy

Imagine describing a friend's face to someone using 128 sliders, each set to a value between low and high. If you set the sliders the same way for two photos of that friend, the descriptions match. If you describe a stranger, several sliders will sit in different places. Face matching simply measures how far apart two sets of slider positions are, then lists the closest ones first.

The twist is that nobody chose what the sliders mean. The network worked that out for itself during training, which is why the numbers are useful for comparing faces but impossible to read by eye.

Why your result is private

Every step above runs in your browser. Your photo and your face print are never uploaded, stored or logged. Only the models and the actors' prepared numbers are downloaded to your device. The Privacy Policy has the details.

What the system cannot do

Getting a better result

Face the camera, use even light and keep a relaxed expression. Our guide on taking a selfie for the best match covers this in more detail. Then enjoy the result for what it is: a lighthearted comparison between two lists of numbers.