All models

sphereface20a

SphereFace is a face recognition CNN trained with the angular softmax (A-Softmax) loss.

Image classification · 88 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (19 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
787.2K
Operations
88
Framework
PyTorch
Recurrent
No
Published
CVPR (arXiv 2017)
Cited by
3,003 (as of 9 October 2026)
Authors
Weiyang Liu, Yandong Wen, Zhiding Yu and others
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m12136
Graph hash
2925712cde18ae6f58cf59ccd8a0ee90c4749d0e1ebc377a89332f488f641b14
Skeleton hash
c3a076075a509eb2d7e14405beaae09c676bba63519ce90056898b1daac8124d
Architecture hash
017882f69e591c849b3de59bfc0964a8932064680e0f525d3ae61d81c93b9804
Diagram SHA-256
09127a3354090fa9c31ee55fdcf3d993ba5df663eb00e66a33a46f97dcf88eba
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

menagerie.classics.sphereface:build_sphereface20a: build({})

What it is

SphereFace is a face recognition model: a convolutional network trained with a loss that makes the features it produces for faces discriminative by angle. It targets the open-set setting, in which the identities seen at test time are usually disjoint from those in the training set.

The starting point is a softmax loss whose class weights are normalized and whose biases are zeroed, which the paper calls the modified softmax loss and which optimizes angles directly. The angular softmax (A-Softmax) loss adds an integer m that controls the size of the angular margin between classes. The authors derive lower bounds for m and settle on m = 4. The paper reads the loss as constraining features to be discriminative on a hypersphere, and for that reason calls the learned features SphereFace.

The paper evaluates CNNs of depths 4, 10, 20, 36 and 64. At test time two faces are compared by the cosine distance of their features. Trained on the publicly available CASIA-WebFace dataset, SphereFace is reported in the paper at 99.42% accuracy on LFW and 95.0% on YTF.

Key idea. The paper proposed the angular softmax (A-Softmax) loss, which lets convolutional networks learn face features separated by an adjustable angular margin on a hypersphere.

  • sphereface
  • sphereface20a
  • a-softmax
  • angular softmax
  • face recognition
  • face verification
  • angular margin
  • hypersphere embedding
  • deep face recognition

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{liu2018spherefacedeephypersphereembedding,
      title={SphereFace: Deep Hypersphere Embedding for Face Recognition}, 
      author={Weiyang Liu and Yandong Wen and Zhiding Yu and Ming Li and Bhiksha Raj and Le Song},
      year={2018},
      eprint={1704.08063},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1704.08063}, 
}