04

Liveness — Face anti-spoofing

The sequel to Deep Scan: telling a real face from an attack (printed photo, screen). Fine-tuning an ImageNet-pretrained ResNet18 for spoof / non-spoof classification, with a Streamlit interface for testing.

Stack

PythonPyTorchtorchvisionStreamlit

What happened?

  1. 01

    The question

    Deep Scan recognises a face. But what happens when you show it a photo of that face? Can a model learn to tell a real face from an imitation?

  2. 02

    The problem

    To a recognition system, a printed photo or a face on a screen looks a lot like the real person. Without spoof detection, a simple photo can be enough to fool the system.

  3. 03

    The hypothesis

    An attack leaves traces the eye barely notices: paper texture, screen glare and pixels. A pretrained ResNet fine-tuned on spoof / non-spoof examples should learn to spot them.

  4. 04

    The build

    Fine-tuning an ImageNet-pretrained ResNet18 (with an option to freeze the backbone), an inference script, unit tests, and a Streamlit interface showing the predicted class and confidence score.

  5. 05

    The next frontier

    Reach reliable results, measure robustness against different attack types, then plug the model in front of Deep Scan.

Spider-Verse · homage