ScanDoc
← All articles

Security

Anti-Spoofing in Face Recognition: How Liveness Detection Stops Identity Fraud

A phone selfie protected by a shield, blocking spoofing attempts from a printed photo, a screen replay, a mask and a deepfake

Face recognition has become one of the most common ways to verify identity online. A customer scans their ID, takes a selfie, and the software confirms that the face matches the photo on the document. It's fast, it's convenient, and it stops one of the most common kinds of fraud: using someone else's genuine ID. But a face match is only as trustworthy as the selfie behind it. If a fraudster can hold up a photo of the real document holder, play a video on a second screen, wear a mask or feed a deepfake straight into the app, matching faces proves nothing. That's what anti-spoofing is for. This article explains the attacks that face recognition has to withstand, how liveness detection and injection attack detection work, the standards used to test them, and what to ask any provider before you trust their checks.

Why spoofing is a growing problem

Spoofing used to mean a printed photo held up to a webcam. Today it increasingly means AI. Entrust's Identity Fraud Report found that deepfakes were linked to one in five biometric fraud attempts, with deepfaked selfie attempts up 58% in a year and injection attacks up 40%. Its follow-up report found that deepfake attacks rose another 165%.

The tools behind these attacks are cheap and widely available, which is why anti-spoofing is no longer an optional extra for face recognition. It's the part that makes the rest of the check meaningful.

Two kinds of attack

Diagram showing presentation attacks held up to the camera, stopped by liveness detection, and injection attacks that bypass the camera, stopped by injection attack detection

Spoofing attacks fall into two broad families, and they need different defences.

Presentation attacks happen in front of the camera. The attacker shows the camera something that isn't a live person: a printed photo, a cut-out photo with the eyes removed, a video played on a phone or tablet, a paper or silicone mask, or a deepfake video displayed on a screen. The camera genuinely captures what's in front of it; it's just being shown a fake.

Injection attacks skip the camera altogether. Instead of showing something to the lens, the attacker feeds manipulated images or video directly into the verification process, using a virtual camera, a device emulator or a tampered app. Because nothing is physically presented, a system that only looks for signs of a real face in the image may never notice that the camera was bypassed. Injection is the route most deepfake attacks now take.

How liveness detection works

Liveness detection, known in the standards as presentation attack detection, checks that the face in front of the camera belongs to a real, present person. There are two main approaches, and the strongest systems combine them.

Passive liveness works without asking the user to do anything special. The software analyses the selfie image or a short video for signs that separate real skin and a real three-dimensional face from a photo, screen or mask: depth cues, skin texture, the way light reflects, tiny natural movements, and artefacts such as screen pixels, moiré patterns or the edges of a printed photo. Because there's nothing extra to do, passive checks are quick and comfortable for genuine users, which keeps drop-off low.

Active liveness asks the user to respond to a prompt, such as turning their head, blinking, smiling or following a dot across the screen, and checks that the response is natural and happens in real time. A static photo can't respond, and a pre-recorded video can't predict a randomised challenge. Active checks add friction, so they're often reserved for higher-risk situations or used when passive checks aren't conclusive.

Some devices add hardware-based signals, such as infrared or depth cameras that can tell skin from paper or silicone. These are powerful where they exist, but most customers verify on ordinary phone cameras, so good software-based liveness remains essential.

How injection attack detection works

Because injection attacks don't involve presenting anything to the camera, they need a separate layer of defence, usually called injection attack detection. Its job is to confirm that the images being analysed really came from the device's own camera, in real time, during this session.

That typically involves checking for virtual camera software and emulators, verifying the integrity of the app and device, and looking for signs that the video stream has been tampered with or replayed. Liveness and injection detection work best together: one checks that the face is real, the other checks that the capture is real.

The standards for testing anti-spoofing

Two standards help buyers compare providers. ISO/IEC 30107-3 is the international standard for testing presentation attack detection. It defines how presentation attacks should be tested and how results are reported, including two key error rates: how often an attack is wrongly accepted as genuine (APCER) and how often a genuine person is wrongly rejected as an attack (BPCER). A good system keeps both low, because blocking fraud is pointless if it also blocks your real customers.

For injection attacks, the newer CEN/TS 18099 technical specification, published in Europe, gives the industry a common way to define injection attacks and evaluate injection attack detection. It fills a gap that ISO/IEC 30107-3 doesn't cover, so asking providers about both is a good way to see how complete their protection is.

Anti-spoofing in banking and digital onboarding

Banks and fintechs were among the first to rely on face recognition at scale, because remote account opening only works if they can be confident the applicant is the person on the ID. In a typical digital customer onboarding flow, the customer scans their ID, takes a selfie, passes a liveness check and is matched to the document photo, all in a few minutes. Without strong anti-spoofing, that same flow becomes an open door for fraudsters with stolen documents and a deepfake app.

The same applies wherever face verification protects something valuable: hotel and car rental check-in, driver verification on mobility platforms, age checks and account recovery. We explain how anti-spoofing fits alongside document checks and chip verification in how ID scanning prevents fraud, and how face matching itself works in our guide to face recognition software.

Questions to ask any provider

Before relying on a provider's anti-spoofing, it's worth asking a few direct questions. Has their liveness detection been independently tested to ISO/IEC 30107-3, and at what level? Do they offer passive liveness, active liveness or both, and can you choose by risk? How do they detect injection attacks, virtual cameras and emulators, and have they considered CEN/TS 18099? What are their attack-acceptance and genuine-rejection rates, and how were they measured? And what happens to the face images after the check, including where they're processed and how long they're kept?

A provider that can answer these clearly is far more likely to protect you than one that simply says its system is "unhackable".

How ScanDoc helps

ScanDoc combines Face Recognition with active and passive liveness detection, so you can use smooth passive checks for most customers and add active challenges where risk is higher.

Because face verification runs in the same flow as ID and Passport Scan, the selfie is matched directly against the document photo, and NFC Verification can supply the digitally signed chip photo for an even stronger reference. It all works through iOS and Android SDKs, web capture and a REST API.

For remote account opening, ScanDoc for banks brings these anti-spoofing checks into the same digital onboarding flow.

Request a demo or try ScanDoc to see ScanDoc's liveness checks for yourself.

Visit the ScanDoc homepage to explore the complete document scanning and identity verification platform.

Frequently asked questions

Anti-spoofing is the set of techniques that stop face recognition from being fooled by fakes, such as printed photos, screen replays, masks, deepfakes and injected video. It makes sure the face being matched belongs to a real person who is present at that moment.

Face recognition compares two faces to decide whether they belong to the same person. Liveness detection checks that the face in front of the camera is real and live. You need both: a face match without liveness can be fooled by a photo of the right person.

Passive liveness analyses a selfie or short video without asking the user to do anything. Active liveness asks the user to respond to a prompt, such as turning their head or following a dot, and checks the response. Many systems combine them.

It's a key part of the defence. Liveness detection catches many deepfakes shown on a screen, while injection attack detection is needed for deepfakes fed directly into the app. The strongest protection uses both.

It's the international standard for testing presentation attack detection in biometric systems. It defines how attacks are tested and how error rates are reported, so buyers can compare liveness solutions on a common basis.

An injection attack feeds fake images or video directly into the verification process, for example through a virtual camera or emulator, instead of presenting anything to the real camera. The European technical specification CEN/TS 18099 covers how to detect and test against these attacks.

Latest articles

Ready to verify in seconds?

Start a free trial or book a walkthrough with our team.