Face matching answers one question: do these two faces look like the same person? It cannot tell whether the face in front of the camera belongs to someone who is actually there. A printed photo, a picture on a phone, or a video of the right person would all match perfectly. Liveness detection is the step that closes that gap. This post explains how it works in plain language.
The short answer
Liveness detection checks that the camera is looking at a living person, present at that moment, rather than a copy of one. It does this in two ways, usually together. Active checks ask the person to do something, such as turn their head, and confirm it happened naturally. Passive checks study the frames themselves for signs of paper, screens or masks. Together they stop the common attacks while keeping the step short for honest users.
What liveness is protecting against
The industry calls these presentation attacks: showing the camera something that is not a live face. In rough order of effort:
- A printed photo. The cheapest attack. Sometimes the eyes are cut out, or the paper is bent to look rounder.
- A photo or video on a screen. A phone or tablet held up to the camera, playing a picture or a recording of the victim.
- A mask. From a printed paper mask to a fitted silicone one. Rare, expensive and slow, but they exist.
There is a separate family, injection attacks, where software feeds a fake video stream into the browser instead of a real camera. Liveness models help there too, but defending against injection also depends on how the capture is built.
Active liveness: asking for a movement
The person is asked to do something a flat image cannot do convincingly. Common requests are a head turn, a nod, a smile or following a dot with the eyes. The system tracks the face through the movement and checks that it behaves like a real head in three dimensions: the nose moves across the face, the far cheek disappears, the light falls differently, and all of it changes smoothly from frame to frame.
A printed photo cannot turn. A video of the right person might, but only if it happens to show the same movement at the same moment, which is why some systems ask for random actions. The weakness of active checks is friction: every instruction is a chance to confuse someone, especially an older user or someone who has taken off their glasses to look at the camera.
Passive liveness: reading the frames
Passive checks ask nothing of the user. A model trained on thousands of real faces and attack attempts looks at the frames for tell-tale signs: the moiré pattern of a screen, the flat texture and edges of paper, unnatural reflections, missing depth. Because the user does not have to do anything, passive checks add no friction.
Their weakness is that a model is only as good as the attacks it has seen. That is why passive and active checks are usually combined: each one covers the other's blind spots.
Why one head turn is enough
Many flows ask for a sequence: left, right, up, blink. Each extra step adds a little security and a lot of drop-off. A single, well-chosen movement captures most of the value. Turning the head to one side produces a clear three-dimensional change that a flat image cannot fake, and it gives the face match frames from more than one angle.
The instruction also has to be readable by everyone. People often take their glasses off before a selfie, so a small line of text is not enough. A large, high-contrast, flashing cue at the moment of the turn works for almost anyone, and it makes the step feel quick.
How liveness is tested
There is an international standard for testing these systems: ISO/IEC 30107-3. Independent laboratories run prepared attacks against a system and report two numbers. One is how often an attack is wrongly accepted. The other is how often a real person is wrongly rejected. The two pull against each other: making a system stricter blocks more attacks but annoys more honest users. A good provider can tell you where it sets that balance and why.
What liveness does not do
Liveness proves that a real person was present. It does not prove that the person is who they claim to be; that is the job of the document check and the face match. And it cannot tell why someone is verifying. A real person may verify on behalf of someone else, which is a matter for your own rules, not for the camera.
How lumex.id does it
After the ID card or passport is scanned, the person is asked for one head turn to the right. A strong, blinking cue shows when to turn, so the step works without glasses. The camera records a short sequence of frames. The movement is checked for natural three-dimensional motion, the frames are scored by a passive model that looks for paper and screens, and the most frontal frames are used for the face match against the document photo.
If the turn is not completed, the person gets several tries before the check is declined with the reason liveness_failed. Selfie frames are never returned to you and are deleted once the result is decided. The guide to how online ID checks work shows where liveness fits in the full check, and the security page explains how images are handled.
Frequently asked questions
Does liveness detection work in low light?
It needs enough light to see the face clearly. In a very dark room the check is more likely to need a retry, so facing a window or a lamp helps.
Can a deepfake video pass a liveness check?
A deepfake played on a screen is still a screen, which passive checks look for. A deepfake injected as a fake camera is harder, and that is why capture design and liveness models are improved together over time.
Do users with glasses or a hijab have problems?
No. Glasses can stay on, and a hijab or headscarf is fine as long as the face from forehead to chin is visible, as it is on the ID photo.
Is the selfie stored?
Not with lumex.id. Selfie frames are used only for liveness and the face match, never returned to your site, and deleted once the result is decided.