Source-linked AI summary
Rethinking Domain Generalization for Face Anti-spoofing: Separability and Alignment
Yiyou Sun, Yaojie Liu, Xiaoming Liu, Yixuan Li, Wen-Sheng Chu
TL;DR
Cross-domain face anti-spoofing faces shifts between training and unseen test data, while domain-invariant feature learning may not remove those shifts. SA-FAS retains domain-variant representations and aligns live-to-spoof transitions across domains; the authors report state-of-the-art performance on cross-domain FAS benchmarks.
Problem
FAS models must generalize across domain gaps, but domain-invariant feature learning can leave unseen-test shifts and classifiers vulnerable to spurious correlations.
Source: §1 · pp. 1–2Method
SA-FAS combines separable domain-variant features with aligned live-to-spoof transitions, using SupCon and PG-IRM to learn a domain-invariant classifier.
Source: §1 · p. 2Results
Takeaways & Limitations
The authors suggest incorporating domain-specific signals in FAS and extending the approach to broader domain-generalization tasks.
Source: §6 · p. 8SA-FAS assumes each domain contains both live and spoof data, and per-domain hyperplanes may add computation when there are many domains.
Source: E. Limitation · p. 16
Abstract
from arXiv · showhide
This work studies the generalization issue of face anti-spoofing (FAS) models on domain gaps, such as image resolution, blurriness and sensor variations. Most prior works regard domain-specific signals as a negative impact, and apply metric learning or adversarial losses to remove them from feature representation. Though learning a domain-invariant feature space is viable for the training data, we show that the feature shift still exists in an unseen test domain, which backfires on the generalizability of the classifier. In this work, instead of constructing a domain-invariant feature space, we encourage domain separability while aligning the live-to-spoof transition (i.e., the trajectory from live to spoof) to be the same for all domains. We formulate this FAS strategy of separability and alignment (SA-FAS) as a problem of invariant risk minimization (IRM), and learn domain-variant feature representation but domain-invariant classifier. We demonstrate the effectiveness of SA-FAS on challenging cross-domain FAS datasets and establish state-of-the-art performance.
1. Introduction
Cross-domain face anti-spoofing must handle training and test differences in devices, environments, and image characteristics. SA-FAS retains domain-specific signals while seeking a classifier that generalizes across domains.
- Real-world FAS faces domain gaps from varied devices, scenes, and viewing conditions that training data may not cover.Source: §1 · pp. 1–2
- Domain-invariant feature methods can overfit training domains, while mixing domains may let classifiers rely on spurious image-resolution or sensor cues.The resulting feature shift can leave the live/spoof relation misaligned with the learned classifier in an unseen test domain.Source: §1 · p. 2
- SA-FAS retains domain-specific signals and seeks a generalized classifier through feature separability and aligned live-to-spoof transitions.Source: §1 · p. 2
- SupCon clusters samples by domain and live/spoof label, while PG-IRM regularizes the transition across domain variation.With normalization, domain variation remains within symmetric live and spoof half-spaces, with minimal impact on the classifier.Source: §1 · p. 2
- SA-FAS achieves state-of-the-art performance on widely used cross-domain FAS benchmarks.Source: §1 · p. 2
2. Related Work
Prior cross-domain FAS work includes target-domain adaptation, domain generalization, and meta-learning. SA-FAS instead combines domain-variant representations with invariant classifier learning through PG-IRM.
- Cross-domain FAS methods include target-domain adaptation [80], domain generalization [30] [58] [63] [72], and meta-learning [61] [71].Source: §2 · p. 2
- Many domain-generalization approaches suppress domain-specific signals using adversarial training or metric losses [30,43,44,60,67, 72].Source: §2 · pp. 2–3
- IRM seeks a classifier shared across domains [1] [2] [14] [37] [50] [56] [62], but can be difficult to optimize in nonlinear settings [57].Source: §2 · p. 3
- SA-FAS explicitly uses domain-specific signals with an equivalent PG-IRM objective designed for easier optimization.Source: §2 · p. 3
3. Method
SA-FAS preserves domain variation in the feature space while aligning the live-to-spoof transition across domains, seeking a classifier that generalizes to an unseen domain. It combines separable representations with an invariant classifier.
3. Method
- SA-FAS seeks separable features across domains and classes while aligning the live-to-spoof transition in the same direction across domains.The two properties work jointly: separability retains awareness of domain variance, while alignment makes that variance invariant to the live-vs-spoof hyperplane.Source: §3 · p. 3
3.1. Problem Setup
- Cross-domain FAS trains on samples from multiple domains and evaluates a live-or-spoof decision function on an unseen domain.Source: §3.1 · p. 3
3.2. Separability
- SupCon pulls together samples with the same domain and live/spoof label while pushing other mini-batch samples apart, forming more distinguishable feature clusters.The figure contrasts ERM, ERM+SupCon, and SA-FAS feature spaces.Source: §3.2 · p. 4, Figure 2 · p. 4
3.3. Alignment
- Because separated clusters can occupy different positions, separability alone leaves domain-wise optimal hyperplanes variable; PG-IRM instead jointly updates features and domain-wise hyperplanes toward a shared classifier.PG-IRM uses projected-gradient optimization and a non-empty α-adjacency set to keep the solution projectable.Source: §3.3 · pp. 4–5
3.4. Training and inference
- At inference, SA-FAS uses the mean of the domain-wise hyperplanes for the final score; its evaluation compares cross-domain performance on four benchmark datasets.The benchmarks are CASIA, Idiap Replay, MSU-MFSD, and Oulu-NPU; Table 1 compares methods at best performance, while Table 2 reports mean/std over the last 10 epochs.Source: §3.4 · p. 5, Table 1 · p. 6, Table 2 · p. 6
- At convergence, the cosine distance between domain-wise hyperplanes is very close to 1, indicating that the hyperplanes are nearly identical.Source: §3.4 · p. 5
4. Experiments
The experiments evaluate SA-FAS on four cross-domain protocols and compare it with prior methods. SA-FAS improves on the best baseline in OCM→I and remains comparatively strong and stable when performance is averaged over the last 10 converged epochs.
4.1. Experimental setups
- The evaluation uses leave-one-out testing across Oulu-NPU, CASIA, Idiap Replay attack, and MSU-MFSD, with each dataset treated as a domain.The four protocols train on three datasets and test on the held-out dataset.Source: §4.1 · p. 6
- Experiments use a shared ResNet-18 backbone and report HTER, AUC, and TPR95 at 5% FPR.Inputs are resized to 256×256; ICM→O trains for 300 epochs, while most setups train for 100.Source: §4.1 · p. 6
4.2. Cross-domain performance
- SA-FAS improves on the best baseline [72] by 2.30% in HTER on OCM→I, a gain of more than 25%.The comparison is reported across cross-domain FAS benchmarks.Source: §4.2 · p. 6
- For a convergence-based comparison, performance is averaged over the last 10 epochs rather than selected from the lowest-test-error training snapshot.Convergence is defined by the live/spoof classification loss staying below 1e-3 for 10 consecutive epochs or reaching the maximum epoch limit.Source: §4.2 · p. 6
- Under the convergence-based setting, SA-FAS outperforms the compared state-of-the-art methods and has the smallest standard deviation.The reported Tab. 1 results are worse across methods than the conventional lowest-test-error snapshots, which the authors interpret as evidence of selection randomness.Source: §4.2 · pp. 6–7
5. Ablation and Discussion
The ablations support both separability and alignment components, while test-domain analyses associate these properties with better AUC and show consistent live/spoof decision boundaries across domains.
5.1. Effectiveness of loss components
- SupCon outperforms SimCLR, SimSiam, Triplet loss, and SSDG clustering when applied to penultimate-layer features with ERM classification.The comparison supports domain-wise separable features for cross-domain FAS.Source: §5.1 · p. 7
5.2. Separability and alignment analysis
- Ssep and Salign are positively related to test AUC; PG-IRM raises alignment and AUC, while SupCon improves feature separability.Figure 5 plots test AUC against both property measures across training snapshots in four cross-domain settings.Source: Figure 5 · p. 7, §5.2 · pp. 7–8
5.1. Effectiveness of loss components
- The ablations indicate that all SA-FAS components are indispensable for improving cross-domain spoof-detection generalization.PG-IRM also performs better overall than ERM and alternative IRM objectives.Source: §5.1 · p. 7
5.2. Separability and alignment analysis
- Ssep measures live/spoof feature-center separation, while Salign compares the transition between their centers with the learned hyperplane direction.A larger Ssep corresponds to a smaller cosine between the class centers.Source: §5.2 · p. 7
5.3. UMAP visualization
- SA-FAS’s live/spoof hyperplane remains consistent across training domains and transfers to unseen test domains despite resolution-related feature shifts.CASIA samples lie near both high-resolution OULU and lower-resolution MSU or REPLAY samples.Source: Figure 6 · p. 8, §5.3 · p. 8
- DANN’s unseen-domain feature gap remains broad, while SSDG retains a gap for live training samples despite better-aligned degradation directions.These visualizations support regularizing live/spoof hyperplanes to remain consistent across domains.Source: Figure 7 · p. 8, §5.3 · p. 8
6. Conclusion
The conclusion presents SA-FAS as a cross-domain FAS framework that learns domain-variant features with domain-invariant decision boundaries. Experiments report improved performance over current best methods and state-of-the-art results.
6. Conclusion
- SA-FAS learns domain-variant features with domain-invariant decision boundaries and establishes state-of-the-art performance in cross-domain FAS experiments.The paper also reports theoretical insights on optimizing IRM objectives with projected gradient and points to Appendix E for limitations.Source: §6 · p. 8
A. Detailed Proof
The appendix proof establishes equivalence between the IRM and PG-IRM objectives, then shows that projected gradient descent can efficiently optimize PG-IRM.
A. Detailed Proof
- The proof has two steps: establish IRM–PG-IRM objective equivalence, then show projected gradient descent efficiently optimizes PG-IRM.The equivalence is stated in Theorem 1, and the optimization strategy is illustrated in Algorithm 2.Source: A. Detailed Proof · p. 13
A.1. PG-IRM objective is equivalent to IRM
The appendix explains PG-IRM as an equivalent formulation of IRM that can be optimized by projected gradient descent. It also motivates a fairer evaluation because unseen-domain test performance is unstable early in training.
A.1. PG-IRM objective is equivalent to IRM
- IRM requires a linear classifier optimal across environments; the proof reformulates this as a shared element of their optimal-classifier sets and establishes PG-IRM equivalence.The relaxed formulation uses classifiers for each environment rather than requiring a unique shared classifier.Source: §A.1 · p. 13
A.2. Projected Gradient Optimization for PG-IRM objective
- Projected gradient descent projects updates back into the PG-IRM feasible set, whose projection is equivalent to interpolation toward the farthest domain-wise hyperplane.Training begins with standard updates before projected updates take over at the alignment starting epoch.Source: §A.2 · pp. 14–15
B. Why do we need a fair setting?
- Unseen-domain test performance is test-set-dependent and unstable early, but more stable in the final ten epochs, motivating a fairer comparison strategy.The best snapshot may occur at an unpredictable early epoch and cannot be selected using test-domain validation information.Source: B. Why do we need a fair setting? · p. 15
C. Convergence of PG-IRM
PG-IRM progressively aligns domain-specific classifiers, with their average cosine similarity converging to 1. This convergence indicates a shared classifier across domains.
C. Convergence of PG-IRM
- The measure averages cosine similarity across pairs of distinct domain classifiers.PG-IRM optimizes multiple classifiers simultaneously and gradually aligns them during training.Source: C. Convergence of PG-IRM · p. 15
- Figure 10 plots HTER on MSU for models trained on CASIA, Replay, and OULU using SSDG-R and SA-FAS.Source: Figure 10 · p. 16
- The average cosine similarity between domain classifiers gradually rises to 1, indicating convergence to a classifier aligned across domains.The training plot tracks this measure for PG-IRM trained on CASIA, Replay, and OULU.Source: C. Convergence of PG-IRM · p. 16, Figure 11 · p. 16
D. Sensitivity Analysis
SA-FAS is less sensitive to learning rate and alignment starting epoch than to the alignment parameter α. The authors conclude that extensive tuning is unnecessary within a reasonable range.
D. Sensitivity Analysis
- With other hyperparameters fixed, SA-FAS is less sensitive to learning rate and alignment starting epoch; choosing α matters more, and the reported maximum performance gap in the given range is 1.2%.Source: D. Sensitivity Analysis · p. 16
- Choosing α appropriately matters because it controls whether domain-wise decision boundaries align too quickly or too slowly.At α = 0, the method degenerates to ERM after epoch Ta; at α = 1, the boundaries never align.Source: D. Sensitivity Analysis · p. 16
- The algorithm does not require heavy hyperparameter tuning when settings fall within a reasonable range.Source: D. Sensitivity Analysis · p. 16
E. Limitation
SA-FAS assumes each domain's dataset contains both live and spoof samples, and may incur extra computation when the number of domains is very large.
E. Limitation
- Each domain must contain both live and spoof data; SA-FAS cannot handle live-only data from one domain and spoof-only data from another.Source: E. Limitation · p. 16
- The framework may add computation costs when the number of domains is very large because it sets up one hyperplane per domain.Source: E. Limitation · p. 16
- The dataset constraint excludes training settings that separate live and spoof samples across domains.For example, the stated unsupported setting has live samples only in domain A and spoof samples only in domain B.Source: E. Limitation · p. 16