arXiv(opens in a new tab)Computer ScienceApr 2017Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:1704.08063

SphereFace: Deep Hypersphere Embedding for Face Recognition

Weiyang Liu, Yandong Wen, Zhiding Yu, Ming Li, B. Raj, Le Song

Abstract

This paper addresses deep face recognition (FR) problem under open-set protocol, where ideal face features are expected to have smaller maximal intra-class distance than minimal inter-class distance under a suitably chosen metric space. However, few existing algorithms can effectively achieve this criterion. To this end, we propose the angular softmax (A-Softmax) loss that enables convolutional neural networks (CNNs) to learn angularly discriminative features. Geometrically, A-Softmax loss can be viewed as imposing discriminative constraints on a hypersphere manifold, which intrinsically matches the prior that faces also lie on a manifold. Moreover, the size of angular margin can be quantitatively adjusted by a parameter mm. We further derive specific mm to approximate the ideal feature criterion. Extensive analysis and experiments on Labeled Face in the Wild (LFW), Youtube Faces (YTF) and MegaFace Challenge show the superiority of A-Softmax loss in FR tasks. The code has also been made publicly available.

1 Introduction

Figure

Figure 1: Comparison of open-set and closed-set face recognition.

Recent years have witnessed the great success of convolutional neural networks (CNNs) in face recognition (FR). Owing to advanced network architectures [13, 23, 29, 4] and discriminative learning approaches [25, 22, 34], deep CNNs have boosted the FR performance to an unprecedent level. Typically, face recognition can be categorized as face identification and face verification [8, 11]. The former classifies a face to a specific identity, while the latter determines whether a pair of faces belongs to the same identity.

In terms of testing protocol, face recognition can be evaluated under closed-set or open-set settings, as illustrated in Fig. 1. For closed-set protocol, all testing identities are predefined in training set. It is natural to classify testing face images to the given identities. In this scenario, face verification is equivalent to performing identification for a pair of faces respectively (see left side of Fig. 1). Therefore, closed-set FR can be well addressed as a classification problem, where features are expected to be separable. For open-set protocol, the testing identities are usually disjoint from the training set, which makes FR more challenging yet close to practice. Since it is impossible to classify faces to known identities in training set, we need to map faces to a discriminative feature space. In this scenario, face identification can be viewed as performing face verification between the probe face and every identity in the gallery (see right side of Fig. 1). Open-set FR is essentially a metric learning problem, where the key is to learn discriminative large-margin features.

Desired features for open-set FR are expected to satisfy the criterion that the maximal intra-class distance is smaller than the minimal inter-class distance under a certain metric space. This criterion is necessary if we want to achieve perfect accuracy using nearest neighbor. However, learning features with this criterion is generally difficult because of the intrinsically large intra-class variation and high inter-class similarity [21] that faces exhibit.

Figure 2: Comparison among softmax loss, modified softmax loss and A-Softmax loss. In this toy experiment, we construct a CNN to learn 2-D features on a subset of the CASIA face dataset. In specific, we set the output dimension of FC1 layer as 2 and visualize the learned features. Yellow dots represent the first class face features, while purple dots represent the second class face features. One can see that features learned by the original softmax loss can not be classified simply via angles, while modified softmax loss can. Our A-Softmax loss can further increase the angular margin of learned features.

Few CNN-based approaches are able to effectively formulate the aforementioned criterion in loss functions. Pioneering work [30, 26] learn face features via the softmax loss, but softmax loss only learns separable features that are not discriminative enough. To address this, some methods combine softmax loss with contrastive loss [25, 28] or center loss [34] to enhance the discrimination power of features. [22] adopts triplet loss to supervise the embedding learning, leading to state-of-the-art face recognition results. However, center loss only explicitly encourages intra-class compactness. Both contrastive loss [3] and triplet loss [22] can not constrain on each individual sample, and thus require carefully designed pair/triplet mining procedure, which is both time-consuming and performance-sensitive.

It seems to be a widely recognized choice to impose Euclidean margin to learned features, but a question arises: Is Euclidean margin always suitable for learning discriminative face features? To answer this question, we first look into how Euclidean margin based losses are applied to FR.

Most recent approaches [25, 28, 34] combine Euclidean margin based losses with softmax loss to construct a joint supervision. However, as can be observed from Fig. 2, the features learned by softmax loss have intrinsic angular distribution (also verified by [34]). In some sense, Euclidean margin based losses are incompatible with softmax loss, so it is not well motivated to combine these two type of losses.

In this paper, we propose to incorporate angular margin instead. We start with a binary-class case to analyze the softmax loss. The decision boundary in softmax loss is (W1−W2)x+b1−b2=0(\bm{W}_{1}-\bm{W}_{2})\bm{x}+b_{1}-b_{2}=0, where Wi\bm{W}_{i} and bib_{i} are weights and bias in softmax loss, respectively. If we define x\bm{x} as a feature vector and constrain ∥W1∥=∥W2∥=1\|\bm{W}_{1}\|=\|\bm{W}_{2}\|=1 and b1=b2=0b_{1}=b_{2}=0, the decision boundary becomes ∥x∥(cos⁡(θ1)−cos⁡(θ2))=0\|\bm{x}\|(\cos(\theta_{1})-\cos(\theta_{2}))=0, where θi\theta_{i} is the angle between Wi\bm{W}_{i} and x\bm{x}. The new decision boundary only depends on θ1\theta_{1} and θ2\theta_{2}. Modified softmax loss is able to directly optimize angles, enabling CNNs to learn angularly distributed features (Fig. 2).

Compared to original softmax loss, the features learned by modified softmax loss are angularly distributed, but not necessarily more discriminative. To the end, we generalize the modified softmax loss to angular softmax (A-Softmax) loss. Specifically, we introduce an integer mm (m≥1m\geq 1) to quantitatively control the decision boundary. In binary-class case, the decision boundaries for class 1 and class 2 become ∥x∥(cos⁡(mθ1)−cos⁡(θ2))=0\|\bm{x}\|(\cos(m\theta_{1})-\cos(\theta_{2}))=0 and ∥x∥(cos⁡(θ1)−cos⁡(mθ2))=0\|\bm{x}\|(\cos(\theta_{1})-\cos(m\theta_{2}))=0, respectively. mm quantitatively controls the size of angular margin. Furthermore, A-Softmax loss can be easily generalized to multiple classes, similar to softmax loss. By optimizing A-Softmax loss, the decision regions become more separated, simultaneously enlarging the inter-class margin and compressing the intra-class angular distribution.

A-Softmax loss has clear geometric interpretation. Supervised by A-Softmax loss, the learned features construct a discriminative angular distance metric that is equivalent to geodesic distance on a hypersphere manifold. A-Softmax loss can be interpreted as constraining learned features to be discriminative on a hypersphere manifold, which intrinsically matches the prior that face images lie on a manifold [14, 5, 31]. The close connection between A-Softmax loss and hypersphere manifolds makes the learned features more effective for face recognition. For this reason, we term the learned features as SphereFace.

Moreover, A-Softmax loss can quantitatively adjust the angular margin via a parameter mm, enabling us to do quantitative analysis. In the light of this, we derive lower bounds for the parameter mm to approximate the desired open-set FR criterion that the maximal intra-class distance should be smaller than the minimal inter-class distance.

Our major contributions can be summarized as follows:

(1) We propose A-Softmax loss for CNNs to learn discriminative face features with clear and novel geometric interpretation. The learned features discriminatively span on a hypersphere manifold, which intrinsically matches the prior that faces also lie on a manifold.

(2) We derive lower bounds for mm such that A-Softmax loss can approximate the learning task that minimal inter-class distance is larger than maximal intra-class distance.

(3) We are the very first to show the effectiveness of angular margin in FR. Trained on publicly available CASIA dataset [37], SphereFace achieves competitive results on several benchmarks, including Labeled Face in the Wild (LFW), Youtube Faces (YTF) and MegaFace Challenge 1.

References (35)

  • Learning a similarity metric discriminatively, with application to face verification
  • Robust face recognition via multimodal deep face representation
  • Dimensionality reduction by learning an invariant mapping
  • Deep residual learning for image recognition
  • Deep metric learning using triplet network
  • Labeled faces in the wild: Updates and new reporting procedures
  • Labeled faces in the wild: A database for studying face recognition in unconstrained environments
  • Caffe: Convolutional architecture for fast feature embedding
  • The megaface benchmark: 1 million faces for recognition at scale
  • Large scale metric learning from equivalence constraints
  • Imagenet classification with deep convolutional neural networks
  • Targeting ultimate accuracy: Face recognition via deep embedding
  • Large-margin softmax loss for convolutional neural networks
  • Multi-manifold deep metric learning for image set classification
  • Megaface: A million faces for recognition at scale
  • Deep face recognition
  • Multimodal biometrics: An overview
  • Facenet: A unified embedding for face recognition and clustering
  • Very deep convolutional networks for large-scale image recognition
  • Deep metric learning via lifted structured feature embedding
  • Deep learning face representation by joint identification-verification
  • Deep learning face representation from predicting 10,000 classes
  • Deeply learned face representations are sparse, selective, and robust
  • Sparsifying neural network connections for face recognition
  • Going deeper with convolutions
  • Deepface: Closing the gap to human-level performance in face verification
  • Large-scale manifold learning
  • Learning fine-grained image similarity with deep ranking
  • Distance metric learning for large margin nearest neighbor classification
  • A discriminative feature learning approach for deep face recognition
  • Face recognition in unconstrained videos with matched background similarity
  • Distance metric learning with application to clustering with side-information
  • Learning face representation from scratch
  • Distance metric learning with eigenvalue optimization
  • Joint face detection and alignment using multi-task cascaded convolutional networks