Need help with AMSoftmax?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

438 Stars 127 Forks MIT License 32 Commits 6 Opened issues


A simple yet effective loss function for face verification.

Services available


Need anything else?

Contributors list

Additive Margin Softmax for Face Verification

by Feng Wang, Weiyang Liu, Haijun Liu, Jian Cheng

The paper is available as a technical report at arXiv.



In this work, we design a new loss function which merges the merits of both NormFace and SphereFace. It is much easier to understand and train, and outperforms the previous state-of-the-art loss function (SphereFace) by 2-5% on MegaFace.


If you find AM-Softmax useful in your research, please consider to cite:

  title = {Additive Margin Softmax for Face Verification},
  author = {Wang, Feng and Liu, Weiyang and Liu, Haijun and Cheng, Jian},
  journal = {arXiv preprint arXiv:1801.05599},
  year = {2018}


Requirements: My Caffe version This version can also be compiled in Linux.

The prototxt file is in

. The batch size is set to 256. If your GPU's memory is not sufficient enough, you may set
iter_size: 2
batch_size: 128

The dataset used for training is CASIA-Webface. We removed 59 identities that are duplicated with LFW (17) and MegaFace Set 1 (42). This is why the final inner-product layer's output is

. The list of the duplicated identities can be found in

All other settings are the same with SphereFace. Please refer to the details in SphereFace's repository.

PS: If you want to try the margin scheme described in ArcFace, you may try to transplant this layer in the

branch of my Caffe repository.
is the kernel function for

Model and Training Log

Feature normalized, s=30, m=0.35: OneDrive, Baidu Yun .


See our arXiv technical report.

3rd-Party Re-implementation

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.