Abstract
Face anti-spoofing techniques based on domain generalization have recently been studied widely. Adversarial learning and meta-learning techniques have been adopted to learn domain-invariant representations. However, prior approaches often consider the dataset gap as the primary factor behind domain shifts. This perspective is not fine-grained enough to reflect the intrinsic gap among the data accurately. In our work, we redefine domains based on identities rather than datasets, aiming to disentangle liveness and identity attributes. We emphasize ignoring the adverse effect of identity shift, focusing on learning identity-invariant liveness representations through orthogonalizing liveness and identity features. To cope with style shifts, we propose Style Cross module to expand the stylistic diversity and Channel-wise Style Attention module to weaken the sensitivity to style shifts, aiming to learn robust liveness representations. Furthermore, acknowledging the asymmetry between live and spoof samples, we introduce a novel contrastive loss, Asymmetric Augmented Instance Contrast. Extensive experiments on four public datasets demonstrate that our method achieves state-of-the-art performance under cross-dataset and limited source dataset scenarios. Additionally, our method has good scalability when expanding diversity of identities. The codes will be released soon.
Introduction
Face Anti-spoofing (FAS) systems are essential for securing biometric authentication against presentation attacks, such as high-resolution photos, video replays, or 3D masks. Despite significant progress, these systems often suffer from poor generalization when deployed in real-world environments. This performance degradation is primarily caused by domain shift, where the statistical distribution of the training data (source domain) differs significantly from the testing data (target domain).
Traditional research typically treats an entire dataset as a single domain. However, this approach is often too coarse. Even within a single dataset, significant domain gaps exist due to variations in facial identities, lighting conditions, and camera sensors. If a model inadvertently learns to associate specific facial identities with "liveness," it will fail to generalize to new individuals. To address this, we propose the Disentangling Liveness-irrelevant Factors (DLIF) framework, which shifts the focus from coarse dataset-level domains to fine-grained identity-level domains.
Methodology
The DLIF framework is built upon three core pillars designed to isolate liveness features from irrelevant factors like identity and style.
1. Orthogonal Identity Disentanglement
To prevent identity information from biasing the liveness classifier, the system employs two separate encoders: Encoder $U$ for liveness features and Encoder $V$ for identity features. To ensure these features do not "leak" into one another, we apply an orthogonal loss. This mathematical constraint forces the liveness feature space to be perpendicular to the identity feature space, effectively ensuring that the liveness representation is identity-invariant.
2. Style-Oriented Modules
To handle variations in lighting and sensors (style shifts), we introduce two modules:
- Style Cross (SC): A plug-and-play module that swaps stylistic features—specifically the mean and variance of feature channels—between different images of the same class. This acts as a powerful data augmentation tool, expanding the stylistic diversity of the training set.
- Channel-wise Style Attention (CWSA): Similar to Squeeze-and-Excitation blocks, this module adaptively scales feature channels to suppress style-sensitive noise and highlight domain-independent liveness information.
3. Asymmetric Augmented Instance Contrast (AAIC)
Standard contrastive learning often treats all samples symmetrically. However, "live" faces are generally homogeneous (looking similar across identities), while "spoof" attacks are highly heterogeneous (ranging from flat paper to complex 3D masks). Our proposed AAIC loss acknowledges this asymmetry. It pulls all live samples together in the feature space while only pulling a spoof sample toward its own augmented version. This prevents the model from forcing unrelated spoof types into a single, potentially misleading cluster, thereby improving generalization to unseen attack types.
Experiments and Results
We evaluated the DLIF framework using the four most prominent FAS datasets: Oulu-NPU (O), CASIA-FASD (C), Idiap Replay-Attack (I), and MSU-MFSD (M). We followed the standard Leave-One-Out (LOO) protocol, where the model is trained on three datasets and tested on the fourth unseen dataset.
Key Findings
- State-of-the-Art Performance: On the O&C&I to M protocol, DLIF achieved a 3.75% Half Total Error Rate (HTER), a significant improvement over the previous state-of-the-art of approximately 5.41%.
- Robustness with Limited Data: In extreme scenarios where only one or two datasets are available for training, DLIF consistently outperformed existing methods. For example, on the M&I to C protocol, it reduced the HTER from 24.07% to 11.11%.
- Scalability: The framework's performance improves further when integrated with pre-trained Face Recognition (FR) models, demonstrating its ability to leverage existing identity knowledge to better isolate liveness.
Conclusion
By redefining domains at the identity level and explicitly disentangling liveness from identity and style, the DLIF framework offers a robust solution to the domain generalization problem in face anti-spoofing. Our approach of orthogonalizing feature spaces and embracing the inherent asymmetry of spoof attacks sets a new benchmark for the field, ensuring more reliable biometric security in diverse, real-world conditions.
Summary updated