Source-linked AI summary
Additive Margin Softmax for Face Verification
Feng Wang, Weiyang Liu, Haijun Liu, Jian Cheng
TL;DR
Deep face verification seeks compact within-identity features and separated identities, but existing angular-margin approaches use less interpretable multiplicative formulations. The paper proposes AM-Softmax, which subtracts an additive margin from the target cosine logit with normalized features and weights, and reports better performance than state-of-the-art approaches on LFW BLUFR and MegaFace using the same architecture.
Problem
Face verification requires small intra-class variation and large inter-class difference, while existing margin formulations are multiplicative and metric-learning losses can be sensitive to sample-mining strategies.
Method
AM-Softmax imposes an additive margin by subtracting m from cos θ in the target logit while normalizing features and weights.
Results
AM-Softmax performs better than current state-of-the-art approaches on LFW BLUFR and MegaFace with the same network architecture.
Takeaways & Limitations
The additive margin provides a simpler, more interpretable margin scheme that can converge without an annealing strategy for m.
Takeaways & Limitations
The margin is a manually tuned global hyper-parameter, while automatically determined, class-specific, and sample-specific margins remain open questions.
Abstract
from arXiv · showhide
In this paper, we propose a conceptually simple and geometrically interpretable objective function, i.e. additive margin Softmax (AM-Softmax), for deep face verification. In general, the face verification task can be viewed as a metric learning problem, so learning large-margin face features whose intra-class variation is small and inter-class difference is large is of great importance in order to achieve good performance. Recently, Large-margin Softmax and Angular Softmax have been proposed to incorporate the angular margin in a multiplicative manner. In this work, we introduce a novel additive angular margin for the Softmax loss, which is intuitively appealing and more interpretable than the existing works. We also emphasize and discuss the importance of feature normalization in the paper. Most importantly, our experiments on LFW BLUFR and MegaFace show that our additive margin softmax loss consistently performs better than the current state-of-the-art methods using the same network architecture and training dataset. Our code has also been made available at https://github.com/happynear/AMSoftmax
1. Introduction
Deep face verification needs features with small intra-class variation and large inter-class separation, while existing metric-learning losses can depend heavily on sample mining. The paper proposes AM-Softmax as a more interpretable additive angular-margin loss and reports better performance on LFW BLUFR and MegaFace with the same architecture.
- Metric-learning losses such as contrastive and triplet loss require carefully designed sample-mining strategies and are sensitive to those strategies.
- Softmax separates different classes effectively but is less effective at compacting features from the same class.
- The additive margin uses a fixed hard angular margin, unlike angular softmax, which imposes an unfixed angular margin.
- AM-Softmax introduces an additive margin by replacing the target cosine term with cos θ−m, yielding a simpler and more interpretable angular-margin formulation.
- Experiments on LFW BLUFR and MegaFace show better results than current state-of-the-art approaches using the same network architecture.
2. Preliminaries
The preliminaries review how softmax target logits are formed and how A-Softmax modifies them through weight normalization and a piecewise angular function. A-Softmax also uses annealing to control the classification boundary during training.
- The original softmax target logit for sample i is y_i f_i, with f_i the last-layer input and W_j the j-th last-layer weight column.
- A-Softmax normalizes weight vectors and generalizes the target logit from ||f_i||cos(θ_yi) to ||f_i||ψ(θ_yi).
- The A-Softmax function ψ(θ) is defined piecewise, with m typically an integer larger than 1.
- A-Softmax uses λ to control how strongly the classification boundary is pushed and anneals λ from 1,000 to a small value during training.
3. Additive Margin Softmax
AM-Softmax introduces an additive cosine margin with normalized features and weights, giving the loss a simpler geometric interpretation and easier optimization than multiplicative angular-margin schemes.
- Definition: AM-Softmax defines ψ(θ) as cos θ − m, subtracting a scalar margin from the target cosine logit.The formulation is presented as a simpler alternative to the multiplicative angular margin used in prior losses.
- Definition: Feature and weight normalization converts the inner-product layer into a cosine layer, followed by scaling with a fixed factor s.The paper fixes s to a sufficiently large value such as 30 because learning it after introducing the margin slows convergence.
- Geometric interpretation: The additive margin changes the conventional single-vector decision boundary into a marginal region on the normalized hypersphere.Under the paper’s equal-variance assumption, m equals the difference between class-1 cosine scores on the two sides of that region.
- Angular versus cosine margin: Unlike multiplicative angular margins, AM-Softmax subtracts m from cos θ and optimizes cosine similarity rather than angle directly.The paper notes that angular optimization could require an arccos operation, which may be more computationally expensive.
- Feature normalization: Feature normalization gives small-norm features much larger gradients, focusing learning on low-quality images similarly to hard-sample mining.The paper states that this normalization is most suitable when image quality is very low.
- Feature normalization: Feature normalization can also create extremely large gradients for very small feature norms, potentially increasing the risk of gradient explosion.The paper suggests that an intermediate re-weighting strategy could be studied in future work.
- Experimental analysis: In a Fashion MNIST visualization, AM-Softmax performs similarly to the best SphereFace model and can further shrink intra-class variance with larger m.The paper also reports easier convergence with a proper scaling factor s and fewer hyper-parameter-tuning demands than A-Softmax.
4. Experiment
The experiments compare loss functions under controlled training and evaluation settings, including dataset-overlap removal, hyperparameter choices, feature normalization, and MegaFace identification and verification curves.
- Implementation details: The training setup uses aligned 112 × 96 faces, a modified 20-layer ResNet, 256-image batches, and learning-rate drops at 16K, 24K, and 28K iterations.Faces are detected and aligned with MTCNN; networks are trained from scratch for 30K iterations with mirror augmentation.
- Experimental settings: Experiments compare methods using the same network architecture and training dataset, with baselines retrained on a cleaned dataset.The study follows prior experimental settings and removes overlapping identities between CASIA-WebFace and the evaluation datasets.
- Hyperparameter effects: AM-Softmax performs best when the margin m is set from 0.35 to 0.4, while performance improves significantly between m = 0.25 and m = 0.3.The scale s is fixed at 30, while m is varied from 0.25 to 0.5.
- Feature normalization: Feature normalization performs better on low-quality MegaFace images, whereas original feature norms perform better on high-quality LFW images.The comparison includes a loss variant without feature normalization and scale s.
- MegaFace evaluation: At very low rank or false positive rate, AM-Softmax performs much better than the other loss functions on MegaFace Set 1 with 1M distractors.Figure 6 uses CMC curves for identification and ROC curves for verification; Center Loss and NormFace use the larger ResNet-28 backend.
5. Conclusion and Future Work
The paper concludes that AM-Softmax provides a simple, interpretable additive-margin strategy with normalized features and weights, while larger-margin strategies remain open for further research.
- Conclusion: AM-Softmax imposes an additive margin on the target softmax logit while normalizing features and weights.The method is presented as simpler and more interpretable than prior margin schemes.
- Conclusion: Comprehensive experiments show that AM-Softmax performs better than A-Softmax on LFW BLUFR and MegaFace.The comparison uses the paper’s reported evaluation protocols.
- Future work: Automatically determining the margin and incorporating class-specific or sample-specific margins remain open research questions.In AM-Softmax, the margin is a manually tuned global hyperparameter.