Liveness detection is the check that a living person is in front of the camera, and not a printed photo, a video on another screen, a mask or a deepfake. It is a part of identity verification (IDV). Face matching alone is not enough. A fraudster can hold up a photo of someone else, and the photo will match that person's ID perfectly.
There are two kinds of liveness check. Active liveness asks the person to do something: blink, turn the head, or follow a dot on the screen. Passive liveness asks for nothing. It studies one short selfie video, or a few frames from it. It looks at the depth of the face, the texture of the skin, the way light reflects and small natural movements. It also looks for signs of a screen, such as the fine grid pattern that appears when a camera photographs another screen. Passive checks are faster for the user, so many apps now prefer them.
Say a delivery app is signing up new riders in Patna. Each rider takes a selfie in the app before the first shift. The app records about two seconds of video. The liveness model studies 20 frames and returns a score of 97 out of 100: a live face. The rider's face then goes on to be matched with the photo on the rider's ID. A week later, someone tries to sign up with a friend's ID. He holds up a photo of the friend on a second phone. The model detects the screen's grid pattern and the flat depth, and returns a score of 6. The sign-up is refused, and the case goes to a person for review.
The newest attacks do not use a second screen at all. Software called a virtual camera feeds a deepfake video straight into the app, as if it came from the phone's own camera. So liveness checks now also test whether the video really came from the phone's camera hardware. Many products also run deepfake detection on the same video. This contest between the people making fakes and the companies catching them is part of AI in cybersecurity.
Liveness detection is used wherever a face must prove that someone is present. Age estimation runs it before estimating an age, so that a child cannot hold up an adult's photo. Online proctoring uses it to check that a real student, not a recording, is taking the exam.
Liveness detection is different from face matching. Face matching answers the question: is this the same person as on the ID? Liveness detection answers a different question: is a real person here at all? A good check needs both.