Hyp-OC: Hyperbolic One Class Classification for Face Anti-Spoofing

Kartik Narayan, Vishal M. Patel

This research paper from Johns Hopkins University introduces Hyp-OC, a novel framework that rethinks Face Anti-Spoofing (FAS) by moving away from traditional binary classification and into the realm of hyperbolic geometry. By treating FAS as a one-class classification problem, the authors aim to build systems that are more resilient to the "infinite variability" of real-world spoofing attacks.

TL;DR

Hyp-OC treats face anti-spoofing as a one-class classification task, learning a compact representation of "real" faces in hyperbolic space rather than trying to model every possible spoof. By leveraging the unique geometry of the Poincaré Ball and novel hyperbolic loss functions, it significantly outperforms existing one-class methods across multiple benchmark datasets.

What Problem Does This Paper Address?

Most current face anti-spoofing (FAS) systems are trained as binary classifiers: they learn to distinguish between "real" faces and specific "spoof" attacks (like printed photos or video replays). The fatal flaw here is that spoofing attacks are virtually limitless. A model trained on print attacks might fail miserably against a high-quality 3D mask it has never seen.

The authors argue that FAS should instead be treated as One-Class Classification (OCC). In this paradigm, the model only learns the distribution of "real" samples. Anything that falls outside this tightly defined "real" cluster is flagged as an anomaly (a spoof). However, doing this in standard Euclidean space is difficult because real and spoof features often overlap or scatter, making it hard to draw a clean boundary.

Methods

The core innovation of Hyp-OC is the use of Hyperbolic Space—specifically the Poincaré Ball model—to represent facial features.

Feature representation of real and spoof samples in the Euclidean and the hyperbolic space. The representation of real samples in the hyperbolic space is compact, resulting in a better separating gyroplane.

The Architecture

  1. Feature Extraction: A VGG-16 backbone extracts facial features.
  2. Dimensionality Reduction: A fully connected network (FCNN) compresses these features.
  3. Hyperbolic Mapping: An "exponential map" projects these Euclidean features into the Poincaré Ball (a model of hyperbolic space).
  4. Hyperbolic Classifier Head (Hyp-OC): Instead of a flat hyperplane, the model learns a "gyroplane"—a hyperbolic generalization of a decision boundary—to encapsulate the real samples.

Novel Loss Functions

To train the model without actual spoof samples, the authors use two new losses:

  • Hyp-PC (Hyperbolic Pairwise Confusion): This loss "de-clusters" identity-specific information. In FAS, we don't care who the person is, only if they are real. Hyp-PC forces the model to ignore identity, leading to a more generalized representation of "realness."
  • Hyp-CE (Hyperbolic Cross Entropy): A classification loss that operates directly on hyperbolic logits, penalizing the model for misclassifying samples relative to the learned gyroplane.

Pseudo-Negative Sampling

To define the boundary of the "real" class, the model needs a contrast. The authors sample "pseudo-negatives" from a Gaussian distribution centered around an adaptive mean of the real features. This effectively creates "synthetic spoofs" that help sharpen the decision boundary during training.

Datasets

The authors evaluated Hyp-OC on five major FAS benchmarks:

  • Rose-Youtu
  • MSU-MFSD (M)
  • CASIA-MFSD (C)
  • Idiap Replay-Attack (I)
  • OULU-NPU (O)

They tested the model under three protocols: Intra-domain (train/test on the same dataset), Leave-one-out (train on three, test on one), and Single-source-single-target (train on one, test on a different one).

Key Insights and Ideas

  • Hyperbolic Advantage: Hyperbolic space has a negative curvature, meaning its volume grows exponentially with its radius. This allows the model to learn much more compact and discriminative representations for the "real" class than Euclidean space allows.
  • Identity as Noise: For anti-spoofing, identity information is actually a nuisance. By intentionally inducing "confusion" between different identities (via Hyp-PC), the model focuses purely on the textures and artifacts that signal a spoof.
  • Stability is Key: Training in hyperbolic space is notoriously unstable. The authors found that using Euclidean feature clipping and gradient clipping was essential to prevent "exploding gradients" near the edges of the Poincaré Ball.

Key Results

Hyp-OC set a new state-of-the-art for one-class FAS methods:

  • Protocol 1 (Intra-domain): Achieved an average HTER (Half Total Error Rate) of 28.339%, a significant 7.493% improvement over the best previous baseline.
  • Generalization: In cross-dataset tests (Protocol 2), Hyp-OC improved HTER by an average of 4.231% over baselines, proving it generalizes better to unseen environments and attack types.
  • Ablation Study: Removing the "Adaptive Mean" sampling caused the HTER to jump by nearly 15%, highlighting how critical it is to sample pseudo-negatives near the real data cluster.

Limitations and Future Work

While Hyp-OC beats all other one-class methods, the authors acknowledge that it still lags behind binary classifiers that have access to spoof samples during training. However, binary models are prone to failing on entirely new attack types, whereas Hyp-OC's one-class approach is theoretically more robust to "zero-day" spoofs.

Future work includes exploring more sophisticated ways to leverage hyperbolic embeddings and potentially integrating multi-modal data (like depth or infrared) into the hyperbolic framework.

Summary updated

BibTeX
@inproceedings{narayan2024hyp,
  author = {Kartik Narayan and Vishal M. Patel},
  title = {{Hyp-OC: Hyperbolic One Class Classification for Face Anti-Spoofing}},
  booktitle = {FG},
  year = {2024},
  url = {https://openreview.net/forum?id=TCsT0RNf7q},
}
Figure