{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/circle-loss-a-unified-perspective-of-pair","title":"Circle Loss: A Unified Perspective of Pair Similarity Optimization","arxiv_id":"2002.10857","date":"2020-02-25","proceeding":"CVPR 2020 6","authors":["Yifan Sun","Changmao Cheng","Yuhan Zhang","Chi Zhang","Liang Zheng","Zhongdao Wang","Yichen Wei"],"abstract":"This paper provides a pair similarity optimization viewpoint on deep feature learning, aiming to maximize the within-class similarity $s_p$ and minimize the between-class similarity $s_n$. We find a majority of loss functions, including the triplet loss and the softmax plus cross-entropy loss, embed $s_n$ and $s_p$ into similarity pairs and seek to reduce $(s_n-s_p)$. Such an optimization manner is inflexible, because the penalty strength on every single similarity score is restricted to be equal. Our intuition is that if a similarity score deviates far from the optimum, it should be emphasized. To this end, we simply re-weight each similarity to highlight the less-optimized similarity scores. It results in a Circle loss, which is named due to its circular decision boundary. The Circle loss has a unified formula for two elemental deep feature learning approaches, i.e. learning with class-level labels and pair-wise labels. Analytically, we show that the Circle loss offers a more flexible optimization approach towards a more definite convergence target, compared with the loss functions optimizing $(s_n-s_p)$. Experimentally, we demonstrate the superiority of the Circle loss on a variety of deep feature learning tasks. On face recognition, person re-identification, as well as several fine-grained image retrieval datasets, the achieved performance is on par with the state of the art.","url_abs":"https://arxiv.org/abs/2002.10857v2","url_pdf":"https://arxiv.org/pdf/2002.10857v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/FEIfei-coder/circle-loss-for-reid","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/TinyZeaMays/CircleLoss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/XuyangBai/D3Feat","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/layumi/Person_reID_baseline_pytorch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/lzx551402/ASLFeat","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/qianjinhao/circle-loss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/wujpbb7/caffe_circleloss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/yujiacheng333/CircleLossMNIST","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/zhen8838/Circle-Loss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/Faceplugin-ltd/FaceRecognition-Android","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/MindCode-4/code-11/tree/main/circle-loss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/MindCode-4/code-6/tree/main/circle-loss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/MindSpore-scientific/code-3/tree/main/circle-loss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/Recognito-Vision/Android-FaceRecognition-FaceLivenessDetection","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/alibaba/EasyCV","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"circle-loss-a-unified-perspective-of-pair","repo_url":"https://github.com/nanzhaogang/contrib/tree/master/application/circle-loss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"mindspore","reach":null}],"tasks":[{"task_slug":"face-recognition","task_name":"Face Recognition"},{"task_slug":"face-verification","task_name":"Face Verification"},{"task_slug":"image-retrieval","task_name":"Image Retrieval"},{"task_slug":"metric-learning","task_name":"Metric Learning"},{"task_slug":"person-re-identification","task_name":"Person Re-Identification"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":null,"task_name":"Triplet"}],"methods":[{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"triplet-loss","method_name":"Triplet Loss"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/face-recognition-on-cfp-fp","task":"Face Recognition","dataset":"CFP-FP","model":"CircleLoss(ours)","rank_in_archive_order":5,"of":8,"metrics":{"Accuracy":"0.9602"},"uses_additional_data":false},{"leaderboard":"/sota/face-recognition-on-lfw","task":"Face Recognition","dataset":"LFW","model":"CircleLoss","rank_in_archive_order":9,"of":16,"metrics":{"Accuracy":"0.9973"},"uses_additional_data":true},{"leaderboard":"/sota/face-verification-on-ijb-c","task":"Face Verification","dataset":"IJB-C","model":"circle loss","rank_in_archive_order":11,"of":26,"metrics":{"TAR @ FAR=1e-3":"96.29%","TAR @ FAR=1e-4":"93.95%","TAR @ FAR=1e-5":"89.60%","model":"R100","training dataset":"MS1M Cleaned"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-cars196","task":"Metric Learning","dataset":"CARS196","model":"CircleLoss","rank_in_archive_order":30,"of":36,"metrics":{"R@1":"83.4"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-stanford-online-products-1","task":"Metric Learning","dataset":"Stanford Online Products","model":"Circle Loss","rank_in_archive_order":28,"of":33,"metrics":{"R@1":"78.3"},"uses_additional_data":false},{"leaderboard":"/sota/person-re-identification-on-msmt17","task":"Person Re-Identification","dataset":"MSMT17","model":"MGN + CircleLoss(ours)","rank_in_archive_order":35,"of":43,"metrics":{"Rank-1":"76.9","mAP":"52.1"},"uses_additional_data":false},{"leaderboard":"/sota/person-re-identification-on-msmt17","task":"Person Re-Identification","dataset":"MSMT17","model":"ResNet50 + CircleLoss(ours)","rank_in_archive_order":36,"of":43,"metrics":{"Rank-1":"76.3","mAP":"50.2"},"uses_additional_data":false},{"leaderboard":"/sota/person-re-identification-on-market-1501","task":"Person Re-Identification","dataset":"Market-1501","model":"MGN + CircleLoss(ours)","rank_in_archive_order":32,"of":135,"metrics":{"Rank-1":"96.1","mAP":"87.4"},"uses_additional_data":false},{"leaderboard":"/sota/person-re-identification-on-market-1501","task":"Person Re-Identification","dataset":"Market-1501","model":"ResNet50 + CircleLoss(ours)","rank_in_archive_order":80,"of":135,"metrics":{"Rank-1":"94.2","mAP":"84.9"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2002.10857","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2002.10857"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhen8838/Circle-Loss","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-11/tree/main/circle-loss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindCode-4/code-6/tree/main/circle-loss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/FEIfei-coder/circle-loss-for-reid","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/alibaba/EasyCV","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/qianjinhao/circle-loss","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Recognito-Vision/Android-FaceRecognition-FaceLivenessDetection","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/XuyangBai/D3Feat","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/TinyZeaMays/CircleLoss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/layumi/Person_reID_baseline_pytorch","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Faceplugin-ltd/FaceRecognition-Android","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/nanzhaogang/contrib/tree/master/application/circle-loss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lzx551402/ASLFeat","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yujiacheng333/CircleLossMNIST","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MindSpore-scientific/code-3/tree/main/circle-loss","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/wujpbb7/caffe_circleloss","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"ran_fixture":1},"by_repo_kind":{"listed":{"samples":2,"ran":2,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":1,"samples":[{"code_sha256_prefix":"b33437b2fbf7912a","entry":"DeepSupervision","repo":"FEIfei-coder/circle-loss-for-reid","repo_kind":"listed","path":"losses.py","file_url":"https://github.com/FEIfei-coder/circle-loss-for-reid/blob/HEAD/losses.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b33437b2fbf7912a"}},{"code_sha256_prefix":"05c14581c9d9da1d","entry":"convert_label_to_similarity","repo":"TinyZeaMays/CircleLoss","repo_kind":"listed","path":"circle_loss.py","file_url":"https://github.com/TinyZeaMays/CircleLoss/blob/HEAD/circle_loss.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"05c14581c9d9da1d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}