A recognition model will happily match a printed photograph of you to your enrolled embedding. It was trained to recognise faces, not to notice paper. Liveness detection is the layer that asks "is there a live person here?" and FaceVision runs it in the browser alongside recognition.

Two families of liveness

  • Passive — a model looks at a single frame or a short clip for signs of a spoof: paper texture, screen moiré, unnatural depth cues. Frictionless for the user; only as good as its training data.
  • Active — the user is asked to do something: blink, turn their head, follow a dot. Cheap to implement with landmarks, hard to fool with a static photo, defeatable by a video replay unless the challenge is random.

Combine them

A passive check on every frame plus a randomised active challenge at enrolment and for high-value actions covers the common attacks: printed photos, phone screens, and pre-recorded videos. Neither alone does. Keep the challenge short — two actions — or users abandon the flow.

Doing it in the browser

Landmark tracking from the detector already gives you eye openness and head pose, so blink and turn challenges cost nothing extra. A small passive anti-spoofing model in ONNX runs in a worker alongside recognition. Frames stay on the device, which matters: liveness is where you would otherwise be streaming a user's face to a server continuously.

Measuring it honestly

  1. Collect real spoof attempts — photos on paper, on a phone, a video on a laptop — from several people and devices.
  2. Report the spoof acceptance rate and the live rejection rate separately. A system that rejects 20% of real users is not "secure", it is unusable.
  3. Re-test whenever you change cameras, lighting assumptions or the model.

Liveness is the part of a face project that shows a reviewer you thought about how it would be attacked. Recognition gets the demo; liveness gets the job.

Pranjul Rathour, GenAI Engineer from Kanpur, India. Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at any campus: pranjulrathour41@gmail.com.