Abstract
Modern face recognition relies on margin-based loss functions to enhance feature discriminability. However, state-of-the-art methods like ArcFace and CosFace typically employ fixed margins, which may be suboptimal for imbalanced datasets or varying class similarities. This paper introduces X2-Softmax, a novel loss function that utilizes an adaptive quadratic margin. By replacing trigonometric functions with a quadratic logit, X2-Softmax allows the margin to scale with the angular distance between class weights, leading to tighter intra-class clusters and better inter-class separation. Experimental results on challenging benchmarks like IJB-B and IJB-C demonstrate its superior performance over existing fixed-margin approaches.
Introduction
In modern face recognition, the primary objective is to map face images into a high-dimensional feature space where intra-class compactness and inter-class separation are maximized. Current state-of-the-art methods achieve this by introducing a "margin" into the Softmax loss function.
While effective, methods like ArcFace and CosFace (shown above) utilize fixed margins. The authors of X2-Softmax argue that a "one-size-fits-all" margin is suboptimal. In real-world datasets, training data is often imbalanced, and some identities are naturally more similar than others. A fixed margin that is too large can hinder convergence for similar identities, while one that is too small may fail to separate distinct ones.
Methodology: The Quadratic Adaptive Margin
To address the limitations of fixed margins, the authors propose X2-Softmax, which replaces the standard cosine-based logit with a quadratic function:
$$f_R(\theta) = a(\theta - h)^2 + k$$
Where $\theta$ is the angle between the feature vector and the class weight, and $a, h, k$ are hyperparameters controlling the curve's shape.
Why a Quadratic Function?
The choice of a quadratic function is motivated by the Taylor expansion of $\cos(x) \approx 1 - \frac{1}{2!}x^2$. By using a quadratic form and discarding higher-order terms, the authors reduce computational complexity while gaining the flexibility to shape the penalty curve.
Unlike ArcFace (which adds a constant to the angle) or CosFace (which subtracts a constant from the cosine), X2-Softmax creates a margin $\Delta\theta$ that increases as the angle $\theta$ between classes grows. As illustrated in the figure above, this adaptive approach allows the model to enforce tighter clustering for classes that are already well-separated, optimizing the feature space more effectively than fixed-margin methods.
Experimental Setup and Results
The model was trained on MS1Mv3 (5.1M images, 93k identities) and evaluated across eight diverse benchmarks, ranging from standard sets like LFW to challenging large-scale datasets like IJB-B and IJB-C.
Key Performance Metrics
X2-Softmax demonstrated highly competitive results, particularly on rigorous benchmarks:
- IJB-B & IJB-C: Achieved a True Accept Rate (TAR) of 0.9133 and 0.9459 respectively at a False Accept Rate (FAR) of $10^{-5}$, outperforming variants like Dyn-ArcFace and ElasticFace.
- LFW: Achieved a near-perfect accuracy of 99.82%.
- Feature Compactness: Toy examples using 2D feature mappings showed that X2-Softmax produces significantly lower standard deviations in feature angles compared to ArcFace, indicating much tighter identity clusters.
Discussion and Future Work
The core insight of X2-Softmax is that the margin should be a function of class similarity. By naturally assigning larger margins to less similar classes, it enhances separation without over-constraining the optimization for similar identities.
While X2-Softmax is robust, its performance is sensitive to the hyperparameters $a, h,$ and $k$. Optimal values (found to be $a=-1.0, h=-0.3, k=1.0$) may require retuning for different architectures. Future research could explore making these parameters dynamic during the training process to further refine the adaptive nature of the margin.
Summary updated