SphereFace Revived: Unifying Hyperspherical Face Recognition

Weiyang Liu, Yandong Wen, Bhiksha Raj, Rita Singh, Adrian Weller

TL;DR

This paper introduces SphereFace-R, an improved hyperspherical face recognition method that addresses the training instability of its predecessor, SphereFace. By proposing a unified framework for understanding large angular margins and a novel "characteristic gradient detachment" technique, SphereFace-R achieves better stability and performance, making advanced face recognition more practical.

What Problem Does This Paper Address?

Deep face recognition (FR) aims to identify individuals from images. A key challenge is "open-set recognition," where the system must distinguish between known identities and unknown ones, a task that differs significantly from closed-set classification (where all identities are known during training). Ideal face features should have small distances within the same person's images (intra-class) and large distances between different people's images (inter-class). Hyperspherical face recognition methods aim to achieve this by projecting face embeddings onto a hypersphere and enforcing large angular margins between classes. SphereFace was an early work in this area, proposing a multiplicative angular margin. However, SphereFace suffered from severe training instability, limiting its real-world applicability. This paper tackles this instability and seeks to unify and improve hyperspherical FR methods.

Methods

The authors introduce a unified framework for hyperspherical FR, which helps understand how various loss functions achieve large angular margins. This framework reveals that the core principle is to ensure the characteristic function, which defines the margin, is positive.

Building on this, they propose SphereFace-R, an improved version of SphereFace. SphereFace-R addresses SphereFace's limitations in two key ways:

  1. Novel Multiplicative Margin Implementations: They propose two new ways to implement the multiplicative angular margin that are more stable and accurately reflect the original intuition across all possible angles, unlike SphereFace's approximation.
  2. Characteristic Gradient Detachment (CGD): This is a novel implementation strategy that stabilizes training by simplifying the gradient computation of the characteristic function. CGD effectively approximates the multiplicative margin with a dynamic additive margin during backpropagation, making training more robust.

The paper also investigates three feature normalization (FN) schemes:

  • No Feature Normalization (NFN): Standard approach.
  • Hard Feature Normalization (HFN): Normalizes feature magnitude to a constant (used in many prior works).
  • Soft Feature Normalization (SFN): A new approach that interpolates between NFN and HFN by adding a regularization term to control feature magnitude, allowing it to be data-dependent.

Datasets

The authors used several standard datasets for training and evaluation:

  • Training: VGGFace2, MS-Celeb-1M (also known as MS1M-V2).
  • Validation: LFW, AgeDB-30, CALFW, CPLFW, CFP-FP, CFP, VGG2-FP.
  • Testing: MegaFace, IJB-B, IJB-C.

Key Insights and Ideas

  • Unified Framework: The paper provides a unifying perspective on hyperspherical FR, showing how different methods are instantiations of a general principle for achieving large angular margins. This framework is crucial for understanding and designing new loss functions.
  • CGD for Stability: The Characteristic Gradient Detachment (CGD) technique is a significant contribution. It simplifies gradient computation, leading to substantially improved training stability, which was a major bottleneck for methods like SphereFace. This technique is generalizable to other hyperspherical FR methods.
  • Feature Magnitude Matters (Subtly): The study of NFN, HFN, and SFN reveals that while HFN is a common and effective practice, SFN offers a more nuanced approach by allowing feature magnitude to be data-dependent. This suggests that feature magnitude, often discarded in HFN, can still hold valuable information for improving performance, especially on noisy datasets.
  • Multiplicative Margin Nuances: The paper highlights that the original SphereFace's multiplicative margin was an approximation. Their new implementations (SphereFace-R v1 and v2) more accurately capture the intended multiplicative effect, leading to better geometric interpretation and performance.

Key Results

  • SphereFace-R Performance: SphereFace-R consistently outperforms or is competitive with state-of-the-art methods across various benchmarks (MegaFace, IJB-B, IJB-C) and datasets (VGGFace2, MS-Celeb-1M).
  • Improved Stability: SphereFace-R demonstrates significantly better training stability compared to the original SphereFace, making it more practical for real-world applications.
  • CGD Effectiveness: CGD consistently improves performance across different feature normalization strategies and SphereFace variants, validating its utility. For instance, on VGGFace2, CGD improved SphereFace-R v2 with NFN from 56.08% to 62.72% (Table 6).
  • SFN Benefits: Soft Feature Normalization (SFN) shows promise, particularly on cleaner datasets like VGGFace2, achieving competitive results and sometimes outperforming HFN. However, on noisier datasets like MS-Celeb-1M, HFN often performs better, suggesting SFN's sensitivity to data quality.
  • State-of-the-Art Comparisons: On MegaFace, IJB-B, and IJB-C, SphereFace-R with HFN and SFNet-64/IResNet-100 backbone achieved top-tier results, comparable to or exceeding methods like CosFace and ArcFace. For example, on MegaFace (refined), SphereFace-R v2 with HFN achieved 98.04% accuracy (Table 12).

Limitations and Future Work

  • Optimal Characteristic Function: The paper acknowledges that finding an "optimal" characteristic function is an open problem. They argue that it should ideally be dynamic and depend on the dataset, network, and training stage, rather than being static.
  • Feature Magnitude in Similarity: While SFN explores feature magnitude during training, the paper notes that incorporating it into the final similarity score (for testing) is an open area. They propose a generalized similarity score function g(||x1||, ||x2||)cos(01,2) as a future direction.
  • Hyperparameter Tuning: While the paper provides a strategy for tuning hyperparameters (m, s, t), finding optimal combinations can still be challenging, especially with multiple parameters.
  • Understanding Loss Characteristics: The underlying mechanisms of how loss characteristics affect performance are still not fully understood, despite the proposed unified characterization.
  • Exploring Other Margin Types: The paper suggests that beyond additive and multiplicative margins, other types (e.g., exponential) or combinations could be explored for designing new angular margin losses.

Summary updated

BibTeX
@misc{liu2021sphereface,
  author = {Weiyang Liu and Yandong Wen and Bhiksha Raj and Rita Singh and Adrian Weller},
  title = {{SphereFace Revived: Unifying Hyperspherical Face Recognition}},
  year = {2021},
  eprint = {2109.05565},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.05565},
}
Figure