{"id":20518762,"url":"https://github.com/happynear/amsoftmax","last_synced_at":"2026-01-26T12:37:09.895Z","repository":{"id":80974991,"uuid":"115779861","full_name":"happynear/AMSoftmax","owner":"happynear","description":"A simple yet effective loss function for face verification.","archived":false,"fork":false,"pushed_at":"2018-08-03T02:13:10.000Z","size":1093,"stargazers_count":488,"open_issues_count":6,"forks_count":129,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-01-16T10:26:24.450Z","etag":null,"topics":["deep-learning","face-recognition","loss-functions","metric-learning","softmax"],"latest_commit_sha":null,"homepage":"","language":"Matlab","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/happynear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-30T06:56:41.000Z","updated_at":"2024-12-18T06:22:36.000Z","dependencies_parsed_at":"2023-05-15T17:00:12.175Z","dependency_job_id":null,"html_url":"https://github.com/happynear/AMSoftmax","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happynear%2FAMSoftmax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happynear%2FAMSoftmax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happynear%2FAMSoftmax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/happynear%2FAMSoftmax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/happynear","download_url":"https://codeload.github.com/happynear/AMSoftmax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242123201,"owners_count":20075344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","face-recognition","loss-functions","metric-learning","softmax"],"created_at":"2024-11-15T21:46:01.737Z","updated_at":"2026-01-26T12:37:04.856Z","avatar_url":"https://github.com/happynear.png","language":"Matlab","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Additive Margin Softmax for Face Verification \n\nby Feng Wang, Weiyang Liu, Haijun Liu, Jian Cheng\n\nThe paper is available as a technical report at [arXiv](https://arxiv.org/abs/1801.05599).\n\n### Introduction\n\n![FeatureVis](assets/FeatureVis.png)\n\nIn this work, we design a new loss function which merges the merits of both [NormFace](https://github.com/happynear/NormFace) and [SphereFace](https://github.com/wy1iu/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. \n\n### Citation\nIf you find **AM-Softmax** useful in your research, please consider to cite:\n\n\t@article{Wang_2018_amsoftmax,\n\t  title = {Additive Margin Softmax for Face Verification},\n\t  author = {Wang, Feng and Liu, Weiyang and Liu, Haijun and Cheng, Jian},\n\t  journal = {arXiv preprint arXiv:1801.05599},\n\t  year = {2018}\n\t}\n\n### Training\n\n**Requirements:** My Caffe version https://github.com/happynear/caffe-windows. This version can also be compiled in Linux.\n\nThe prototxt file is in `./prototxt`. The batch size is set to 256. If your GPU's memory is not sufficient enough, you may set `iter_size: 2` in `face_solver.prototxt` and `batch_size: 128` in `face_train_test.prototxt`.\n\nThe 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 `10516`. The list of the duplicated identities can be found in https://github.com/happynear/FaceDatasets.\n\nAll other settings are the same with SphereFace. Please refer to the details in [SphereFace's repository](https://github.com/wy1iu/sphereface).\n\nPS: If you want to try the margin scheme described in [ArcFace](https://arxiv.org/abs/1801.07698), you may try to transplant [this\n layer](https://github.com/happynear/caffe-windows/blob/experiment/src/caffe/layers/label_specific_margin.cu) in the `experiment` branch of my Caffe repository. `LabelSpecificHardMarginForward()` is the kernel function for `cos(theta+m)`.\n\n### Model and Training Log\n\nFeature normalized, s=30, m=0.35: [OneDrive](https://stduestceducn-my.sharepoint.com/:u:/g/personal/201411020102_std_uestc_edu_cn/ER-9FNdXCXtPlZAwZQwFmW0BdMVUjG8_y9IodYfoHVYXSg?e=QBG13o), [Baidu Yun](https://pan.baidu.com/s/1hulG7QW) .\n\n### Results\nSee our [arXiv technical report](https://arxiv.org/abs/1801.05599).\n\n### 3rd-Party Re-implementation\n- TensorFlow: [code](https://github.com/Joker316701882/Additive-Margin-Softmax) by [Joker316701882](https://github.com/Joker316701882).\n- TensorFlow: [code](https://github.com/yule-li/CosFace) by [yule-li](https://github.com/yule-li).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappynear%2Famsoftmax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhappynear%2Famsoftmax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhappynear%2Famsoftmax/lists"}