Face Anti-Spoofing: Model Matters, so Does Data

Xiao Yang, Wenhan Luo, Linchao Bao, Yuan Gao, Dihong Gong, Shibao Zheng, Zhifeng Li, Wei Liu

Abstract

Face anti-spoofing (FAS) is a critical component of biometric security, yet it remains vulnerable to high-resolution photo and video replay attacks. This paper addresses two primary bottlenecks in FAS: data scarcity and model generalization. We introduce the Spatio-Temporal Anti-Spoof Network (STASN), which integrates global video dynamics with a specialized region attention mechanism. Furthermore, we propose a novel data synthesis pipeline that transforms live video into realistic spoofs by simulating physical artifacts like reflections and perspective distortions. Our approach achieves state-of-the-art results on major benchmarks, including Oulu-NPU and SiW.

Introduction

As face recognition becomes ubiquitous, distinguishing a living human from a spoof—such as a printed photo, a mask, or a video replayed on a tablet—has become a high-stakes challenge. Existing FAS methods often rely on auxiliary information like 3D depth or heart rate signals (rPPG), which can be unreliable in noisy or uncontrolled environments. This research identifies that both the model architecture and the quality of training data are paramount for robust performance.

The STASN Architecture

The Spatio-Temporal Anti-Spoof Network (STASN) is designed to capture both the broad temporal context of a video and the minute spatial artifacts characteristic of a spoofing medium. The architecture consists of three integrated modules:

  1. Temporal Anti-Spoofing Module (TASM): Utilizes a ResNet-50 backbone and an LSTM to extract global features and temporal dependencies across video frames.
  2. Region Attention Module (RAM): Acts as the "brain" of the spatial search, automatically identifying the most discriminative local patches in an image, such as screen borders or specific reflections.
  3. Spatial Anti-Spoofing Module (SASM): A multi-branch network that zooms in on the patches identified by the RAM to extract high-resolution local features.
Overview of the STASN architecture, showing the TASM, RAM, and SASM modules processing input video and local patches.

Data Synthesis and the "Spoofing Simulator"

To overcome the lack of diverse, real-world spoofing data, we developed a scalable data generation pipeline. Starting with 5,000 live videos, we mathematically transformed them into spoofs by fitting faces into virtual device templates, adding synthetic reflections, and applying perspective distortions to mimic a user holding a mobile device at various angles.

Example of synthetic spoof generation showing perspective distortion to mimic a real-world digital attack.

This synthesis serves as a powerful proxy for reality. By modeling the physics of a spoof—including blur and moiré patterns—we can pre-train models on a much larger and more diverse dataset than previously available.

Experimental Results

STASN, particularly when augmented with synthesized data (Ours+), significantly outperformed existing methods across four major public benchmarks:

  • SiW Dataset: On Protocol 1 (varying pose and expression), STASN achieved an ACER of 0.30%, a substantial improvement over the previous state-of-the-art of 3.58%.
  • Oulu-NPU: On the challenging Protocol 4 (unseen sensors and environments), the model reduced the error rate (ACER) to 2.6%, compared to the next best competitor at 5.6%.
  • Cross-Testing: The model demonstrated superior generalization when trained on one dataset (e.g., CASIA) and tested on another (e.g., Replay-Attack), proving it learns robust features rather than dataset-specific quirks.

Discussion and Insights

A key finding of this work is the behavior of the attention mechanism. For live faces, the RAM focuses on central facial features like the nose and eyes. For spoofs, it automatically "hunts" for the edges of the screen and moiré patterns. This shift in focus confirms that the model is learning to identify the physical medium of the spoof rather than just the face itself.

While highly effective, the computational load of running multiple CNN branches and an LSTM remains a challenge for real-time deployment on mobile edge devices. Future work will focus on refining the efficiency of the attention mechanism and expanding the synthesis pipeline to include 3D masks and sophisticated deepfake injections.

Summary updated

BibTeX
@inproceedings{yang2019face,
  author = {Xiao Yang and Wenhan Luo and Linchao Bao and Yuan Gao and Dihong Gong and Shibao Zheng and Zhifeng Li and Wei Liu},
  title = {{Face Anti-Spoofing: Model Matters, so Does Data}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.00362},
}
Figure