Table of Contents
Fetching ...

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

Kartik Narayan, Vishal M. Patel

TL;DR

Face anti-spoofing is conventionally treated as binary classification, but the vast variability of spoofing attacks motivates a one-class approach. The authors propose Hyp-OC, a hyperbolic one-class classifier that trains with real samples and pseudo-negatives sampled from a Gaussian with adaptive mean, using two hyperbolic losses, $\\\ ext{L}_{Hyp-PC}$ and $\\\text{L}_{Hyp-CE}$, on the Poincaré ball with a hyperbolic classifier head. The framework combines a Euclidean feature extractor with hyperbolic mapping via the exponential map and a Gaussian pseudo-negative sampling strategy, achieving stability through Euclidean feature clipping and gradient clipping. Experiments on five benchmark FAS datasets show state-of-the-art performance for one-class FAS, highlighting the practical potential of hyperbolic embeddings for robust anomaly detection in biometric security. The results indicate that hyperbolic geometry can yield tighter real-sample representations and more effective decision boundaries than Euclidean approaches in near-boundary anomaly tasks.

Abstract

Face recognition technology has become an integral part of modern security systems and user authentication processes. However, these systems are vulnerable to spoofing attacks and can easily be circumvented. Most prior research in face anti-spoofing (FAS) approaches it as a two-class classification task where models are trained on real samples and known spoof attacks and tested for detection performance on unknown spoof attacks. However, in practice, FAS should be treated as a one-class classification task where, while training, one cannot assume any knowledge regarding the spoof samples a priori. In this paper, we reformulate the face anti-spoofing task from a one-class perspective and propose a novel hyperbolic one-class classification framework. To train our network, we use a pseudo-negative class sampled from the Gaussian distribution with a weighted running mean and propose two novel loss functions: (1) Hyp-PC: Hyperbolic Pairwise Confusion loss, and (2) Hyp-CE: Hyperbolic Cross Entropy loss, which operate in the hyperbolic space. Additionally, we employ Euclidean feature clipping and gradient clipping to stabilize the training in the hyperbolic space. To the best of our knowledge, this is the first work extending hyperbolic embeddings for face anti-spoofing in a one-class manner. With extensive experiments on five benchmark datasets: Rose-Youtu, MSU-MFSD, CASIA-MFSD, Idiap Replay-Attack, and OULU-NPU, we demonstrate that our method significantly outperforms the state-of-the-art, achieving better spoof detection performance.

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

TL;DR

Face anti-spoofing is conventionally treated as binary classification, but the vast variability of spoofing attacks motivates a one-class approach. The authors propose Hyp-OC, a hyperbolic one-class classifier that trains with real samples and pseudo-negatives sampled from a Gaussian with adaptive mean, using two hyperbolic losses, and , on the Poincaré ball with a hyperbolic classifier head. The framework combines a Euclidean feature extractor with hyperbolic mapping via the exponential map and a Gaussian pseudo-negative sampling strategy, achieving stability through Euclidean feature clipping and gradient clipping. Experiments on five benchmark FAS datasets show state-of-the-art performance for one-class FAS, highlighting the practical potential of hyperbolic embeddings for robust anomaly detection in biometric security. The results indicate that hyperbolic geometry can yield tighter real-sample representations and more effective decision boundaries than Euclidean approaches in near-boundary anomaly tasks.

Abstract

Face recognition technology has become an integral part of modern security systems and user authentication processes. However, these systems are vulnerable to spoofing attacks and can easily be circumvented. Most prior research in face anti-spoofing (FAS) approaches it as a two-class classification task where models are trained on real samples and known spoof attacks and tested for detection performance on unknown spoof attacks. However, in practice, FAS should be treated as a one-class classification task where, while training, one cannot assume any knowledge regarding the spoof samples a priori. In this paper, we reformulate the face anti-spoofing task from a one-class perspective and propose a novel hyperbolic one-class classification framework. To train our network, we use a pseudo-negative class sampled from the Gaussian distribution with a weighted running mean and propose two novel loss functions: (1) Hyp-PC: Hyperbolic Pairwise Confusion loss, and (2) Hyp-CE: Hyperbolic Cross Entropy loss, which operate in the hyperbolic space. Additionally, we employ Euclidean feature clipping and gradient clipping to stabilize the training in the hyperbolic space. To the best of our knowledge, this is the first work extending hyperbolic embeddings for face anti-spoofing in a one-class manner. With extensive experiments on five benchmark datasets: Rose-Youtu, MSU-MFSD, CASIA-MFSD, Idiap Replay-Attack, and OULU-NPU, we demonstrate that our method significantly outperforms the state-of-the-art, achieving better spoof detection performance.
Paper Structure (19 sections, 13 equations, 5 figures, 5 tables, 1 algorithm)

This paper contains 19 sections, 13 equations, 5 figures, 5 tables, 1 algorithm.

Figures (5)

  • Figure 1: 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 (dotted circle), resulting in a better separating gyroplane contrary to the Euclidean space in which the representation is scattered. Hyperbolic embeddings prove to be effective in one-class classification for face anti-spoofing.
  • Figure 2: Visualization of the Poincarè Ball $\mathbb{B}_{c}^d$. $S_n^i$ denotes hyperbolic features exponentially mapped from $\mathcal{T}_x\mathbb{B}^d_c$. In our work, we use $d_c(x, \Tilde{H}_{a_k,p_k}^c)$ to compute $\mathcal{L}_{Hyp-PC}$ and $\mathcal{L}_{Hyp-CE}$. $\Tilde{H}_{a,p}^c$ represents the gyroplane of class $k$.
  • Figure 3: Overview of the proposed pipeline Hyp-OC (Section \ref{['sec:training']}). $E_1(x)$ extracts the facial features. The facial features are used to estimate the mean of Gaussian distribution utilized to sample pseudo-negative points. The real features and pseudo-negative features are then concatenated and passed to $E_2(x)$ for dimensionality reduction. The low-dimension features are mapped to Poincaré Ball using exponential map. The training objective is to minimize the summation of the proposed loss functions $\mathcal{L}_{Hyp-PC}$ (Section \ref{['sec:Hyp-PC']}) and $\mathcal{L}_{Hyp-CE}$ (Section \ref{['sec:Hyp-CE']}). The result is a separating gyroplane beneficial for one-class face anti-spoofing. [Best viewed in color]
  • Figure 4: Sample images from the datasets used for training: RoseYoutu li2022one, MSU-MFSD wen2015face, CASIA-MFSD zhang2012face, Idiap Replay Attack chingovska2012effectiveness, OULU-NPU boulkenafet2017oulu.
  • Figure 5: (Left) HTER performance w.r.t different curvatures of the Poincaré Ball. In our work, we fix the curvature of Poincaré Ball to $0.1$ (orange). (Right) HTER performance w.r.t different Euclidean feature clipping values. In our work, we set the Euclidean feature clipping value to 2 (orange).