ArcFace
ArcFace (Additive Angular Margin Loss) is a margin-based softmax loss for deep face recognition.
- Paper: Jiankang Deng, Jia Guo, Niannan Xue, Stefanos Zafeiriou (Imperial College London / InsightFace), ArcFace: Additive Angular Margin Loss for Deep Face Recognition, CVPR 2019. This page follows the extended TPAMI version (adds Jing Yang and Irene Kotsia), arXiv:1801.07698.
- Core idea: -normalise both the embedding and the class weights so the logit is exactly , then add a constant margin to the angle of the target class before taking the cosine. On the hypersphere, angle equals geodesic distance, so is a constant geodesic margin.
- Geodesic distance: the length of the shortest path between two points along a curved surface, rather than through the space around it. For two unit vectors on the sphere this is the arc length , whereas the Euclidean (straight-line) distance cuts through the sphere’s interior and equals . On a unit sphere the arc length is the angle in radians, so a margin added to the angle is a margin in true distance along the surface, which is why the paper calls ArcFace’s margin “geodesic”. Triplet loss, by contrast, uses the Euclidean distance.
- Cost: a three-line change to softmax, with no extra losses, no sampling and no hybrid training schedule.
- Sub-center ArcFace: sub-centers per class, so a sample only has to be close to one of them. Robust to label noise, and usable to clean web-scale data automatically, which yields the 11.96M-image IBUG-500K.
- Model inversion: a trained ArcFace network can synthesise identity-preserving faces from its gradients and BatchNorm statistics, with no GAN.
- Headline result: ArcFace with ResNet100 trained on IBUG-500K reaches 97.27% TPR@FPR=1e-4 on IJB-C.

Fig. 1: triplet/tuplet compare samples inside a mini-batch with Euclidean margins; ArcFace and sub-center ArcFace compare a sample against all class (sub-)centers with angular margins.
Motivation
Two lines of work train face embeddings: classification (softmax) and metric learning (triplet).
- Softmax features are separable for closed-set classification but not discriminative enough for open-set verification, and the weight matrix grows linearly with the number of identities.
- Triplet loss suffers a combinatorial explosion of triplets on large data, and semi-hard mining is hard to get right.
Margin-based softmax variants (SphereFace, CosFace) keep the cheap global sample-to-class comparison but add a margin. ArcFace’s contribution is a margin with the cleanest geometry and the most stable training.
ArcFace loss
Softmax with bias : the logit is . Fix and (feature scale), so predictions depend only on angle (Norm-Softmax):
ArcFace adds an additive angular margin to the target angle only:
Implementation: compute , take for the target class, add , take again, scale all logits by , apply cross-entropy. Embeddings are pushed onto arcs of fixed radius, and the closest classes are separated by a visible geodesic gap (Fig. 3 of the paper, 2-D toy with 8 identities, ~1,500 images each).
Comparison with SphereFace and CosFace
Three margin types: multiplicative angular (SphereFace), additive angular (ArcFace), additive cosine (CosFace). The paper unifies them:
All three penalise the target logit, so numerically they are similar; what differs is the shape of the target-logit curve (starting point, end point, slope). During training moves from ~90° (random init) to ~30°, so only the 20°–100° range matters.

Fig. 4: (a) the angle to the target center moves from ~90° at the start to ~30° at the end; (b) target-logit curves for each margin type, with in the legend.
The geometric difference is in the decision boundary. For binary classification:

Fig. 5: ArcFace has a constant angular margin over the whole interval; SphereFace and CosFace have a margin that varies with the angle.
- ArcFace: boundary is a straight line in , i.e. a constant angular margin.
- SphereFace: margin depends on , and the integer multiplicative margin makes the target logit curve fall steeply, so the original needs an annealing scheme and a hybrid softmax loss to converge. The authors’ re-implementation uses instead of the double-angle formula and (real-valued), matching the original without convergence trouble.
- CosFace: constant margin in cosine space, nonlinear in angle.
Other intra/inter losses
Penalties on the angular representation, tested as add-ons:
Also a triplet loss on angles, . None gives a clear gain on top of ArcFace, since it already enforces compactness, discrepancy and margin.
Sub-center ArcFace
Margin-based softmax assumes clean labels, but web-scale data (MS1MV0: ~10M images, 100K identities, est. 47.1–54.4% noise) is not.

Fig. 2: normalised embedding times normalised sub-centers , max-pool over , then the ArcFace margin, scale and softmax.
Give each class sub-centers; a sample only has to be close to one of them. Similarity is max-pooled over the sub-center axis:
The clean majority forms a dominant sub-class; hard and noisy samples are absorbed by non-dominant sub-classes instead of generating large wrong loss values. On MS1MV0, plain ArcFace () trains on 38.47% noisy samples. With , the samples split into four groups: dominant-clean 57.24%, dominant-noisy 12.40%, non-dominant-clean 4.28%, non-dominant-noisy 26.08%. Keeping only the dominant sub-class therefore cuts the noise rate from 38.47% to 12.40% at the cost of 4.28% hard clean samples.
Automatic cleaning recipe:
- Train with sub-center ArcFace, .
- Drop non-dominant sub-centers ().
- Drop samples whose angle to their dominant center exceeds a constant threshold (75° chosen; 70°–85° tested).
- Retrain ArcFace from scratch on the cleaned set.
Applying this to MS1MV0 and Celeb500K, merging after removing ~50K overlapping identities, gives IBUG-500K: 11.96M images, 493K identities.
Model inversion
A pre-trained ArcFace network can be inverted into a generator-free face synthesiser. Start from Gaussian noise and run gradient steps on the input, minimising with , where matches the batch statistics of the activations to those stored in the BN layers:
- Close-set: target is a class center (the identity in the linear layer).
- Open-set: replace the classification loss with an loss to the embedding of any real face, so identities unseen in training can be reconstructed.
Without the BN prior the outputs look unnatural (Fig. 16 of the paper). Controlling pose and expression is not possible since only identity is constrained. The authors note a privacy implication: face images can be reconstructed from model weights.
Hyperparameters
| Setting | Value |
|---|---|
| Face crops | , five landmarks from RetinaFace |
| Backbones | ResNet50 / ResNet100, no bottleneck; last conv → BN-Dropout-FC-BN → 512-D embedding |
| Feature scale | 64 |
| Angular margin | 0.5 |
| Sub-centers | 3 (then dropped to 1 after cleaning) |
| Noise-drop threshold | 75° |
| Optimizer | SGD, momentum 0.9, weight decay |
| Batch size | 512 on 8× Tesla P40 (24 GB) |
| LR, CASIA | 0.1, ÷10 at 20 and 28 epochs, stop at 32 |
| LR, VGG2 | ÷10 at 6 and 9 epochs, stop at 12 |
| LR, MS1MV3 / IBUG-500K | ÷10 at 8 and 14 epochs, stop at 18 |
| Inversion | Adam, LR 0.25, 20K steps, 256 images per batch, , TV reg. , reg. |
| Distillation (LFR, EfficientNet-B0) | ArcFace + feature regression (weight 1.0) + KL (weight 0.1) |
At test time only the embedding network is kept (the FC classification layer is dropped); templates and videos use the mean embedding. Margin settings: SphereFace , CosFace in the unified framework.
Results
Margin sweep (CASIA, ResNet50; LFW / CFP-FP / AgeDB):
| Loss | LFW | CFP-FP | AgeDB |
|---|---|---|---|
| Softmax | 99.08 | 94.39 | 92.33 |
| SphereFace (1.35) | 99.11 | 94.38 | 91.70 |
| CosFace (0.35) | 99.51 | 95.44 | 94.56 |
| ArcFace (0.4) | 99.53 | 95.41 | 94.98 |
| ArcFace (0.5) | 99.53 | 95.56 | 95.15 |
| ArcFace (0.55) | 99.41 | 95.32 | 95.05 |
Combined margins (CM1 , CM2 ) are on par but never beat plain ArcFace.
Sub-center ablation (IJB-B / IJB-C, TPR@FPR=1e-4, ResNet50):
| Setting | IJB-B | IJB-C |
|---|---|---|
| MS1MV0, | 87.87 | 90.27 |
| MS1MV0, | 91.70 | 93.72 |
| MS1MV0, | 63.84 | 67.94 |
| MS1MV0, , drop >75° | 94.56 | 95.92 |
| MS1MV3 (clean), | 95.13 | 96.50 |
| Celeb500K, | 95.65 | 96.91 |
Too large a () collapses intra-class compactness. Sub-center ArcFace on noisy MS1MV0 () matches ArcFace on manually cleaned MS1MV3 () within a point, and exceeds it when trained on the larger Celeb500K.
Benchmarks (ResNet100):
| Dataset | Result |
|---|---|
| LFW / YTF (IBUG-500K) | 99.83 / 98.01 |
| CFP-FP / CPLFW / AgeDB / CALFW (IBUG-500K) | 98.87 / 93.43 / 98.38 / 96.10 |
| IJB-B / IJB-C TPR@FPR=1e-4 (IBUG-500K) | 96.02 / 97.27 |
| IJB-B / IJB-C 1:N Rank-1 (IBUG-500K) | 95.94 / 97.21 |
| MegaFace refined, Id / Ver (IBUG-500K) | 98.98 / 99.08 |
| LFR2019 Image (TPR@1e-8) / Video (TPR@1e-4), MS1MV3 | R100 teacher 92.75 / 64.89; distilled EfficientNet-B0 88.65 / 63.60 (86.44 / 61.47 without distillation) |
Compared with cleaning via MC-FaceGraph (18.8M images, 636K identities), IBUG-500K trained models are better by 0.66% (IJB-B) and 0.45% (IJB-C). On identification and verification, MegaFace results have saturated near 99%. The authors manually fixed wrong labels in MegaFace (“R” rows) because errors were limiting the measurable gap.
Inversion (ResNet50 on MS1MV3): close-set FID 70.39 and cosine similarity 0.6248 for ArcFace(0.5), versus 75.59 / 0.5612 for softmax, 73.18 / 0.5919 for SphereFace and 71.64 / 0.6176 for CosFace. Open-set on LFW: 93.30% verification accuracy on generated faces versus 90.14% (softmax).
Limitations
- The margin and scale are hand-set and dataset-dependent; the best differs between SphereFace, CosFace and ArcFace in the unified framework.
- Sub-center cleaning needs a first training run plus a threshold and a retrain from scratch; on already clean data (MS1MV3) it slightly hurts ( vs ).
- Inversion recovers identity only, not pose or expression, and shows the model leaks face information (privacy risk).
- The classification layer scales linearly with identity count; the paper’s center-parallel strategy handles millions of identities on 8 GPUs, but it still must store centers.
See also
- SigLIP — another contrastive-style embedding objective, replacing softmax normalisation with a sigmoid loss.