{"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/ranked-list-loss-for-deep-metric-learning","title":"Ranked List Loss for Deep Metric Learning","arxiv_id":"1903.03238","date":"2019-03-08","proceeding":"CVPR 2019 6","authors":["Xinshao Wang","Yang Hua","Elyor Kodirov","Neil M. Robertson"],"abstract":"The objective of deep metric learning (DML) is to learn embeddings that can capture semantic similarity and dissimilarity information among data points. Existing pairwise or tripletwise loss functions used in DML are known to suffer from slow convergence due to a large proportion of trivial pairs or triplets as the model improves. To improve this, ranking-motivated structured losses are proposed recently to incorporate multiple examples and exploit the structured information among them. They converge faster and achieve state-of-the-art performance. In this work, we unveil two limitations of existing ranking-motivated structured losses and propose a novel ranked list loss to solve both of them. First, given a query, only a fraction of data points is incorporated to build the similarity structure. Consequently, some useful examples are ignored and the structure is less informative. To address this, we propose to build a set-based similarity structure by exploiting all instances in the gallery. The learning setting can be interpreted as few-shot retrieval: given a mini-batch, every example is iteratively used as a query, and the rest ones compose the gallery to search, i.e., the support set in few-shot setting. The rest examples are split into a positive set and a negative set. For every mini-batch, the learning objective of ranked list loss is to make the query closer to the positive set than to the negative set by a margin. Second, previous methods aim to pull positive pairs as close as possible in the embedding space. As a result, the intraclass data distribution tends to be extremely compressed. In contrast, we propose to learn a hypersphere for each class in order to preserve useful similarity structure inside it, which functions as regularisation. Extensive experiments demonstrate the superiority of our proposal by comparing with the state-of-the-art methods.","url_abs":"https://arxiv.org/abs/1903.03238v8","url_pdf":"https://arxiv.org/pdf/1903.03238v8.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":"ranked-list-loss-for-deep-metric-learning","repo_url":"https://github.com/XinshaoAmosWang/Ranked-List-Loss-for-DML","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"paper_slug":"ranked-list-loss-for-deep-metric-learning","repo_url":"https://github.com/Qidian213/Ranked_Person_ReID","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-retrieval","task_name":"Image Retrieval"},{"task_slug":"metric-learning","task_name":"Metric Learning"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"semantic-similarity","task_name":"Semantic Similarity"},{"task_slug":"semantic-textual-similarity","task_name":"Semantic Textual Similarity"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/1903.03238","atlas_url":"https://app.syntology.ai/?focus=1903.03238","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1903.03238"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/XinshaoAmosWang/Ranked-List-Loss-for-DML","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Qidian213/Ranked_Person_ReID","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":2,"ran":7,"unverified":3},"by_repo_kind":{"listed":{"samples":12,"ran":9,"repositories":1}},"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":0,"samples":[{"code_sha256_prefix":"fac5364e2f53c6db","entry":"conv3x3","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet_ibn_a.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet_ibn_a.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fac5364e2f53c6db"}},{"code_sha256_prefix":"dd1114865f06f0fd","entry":"conv3x3","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dd1114865f06f0fd"}},{"code_sha256_prefix":"82b1a2e5ff78341d","entry":"euclidean_dist_rank","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"layers/reanked_clu_loss.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/layers/reanked_clu_loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"82b1a2e5ff78341d"}},{"code_sha256_prefix":"b68e8972a6c19ecf","entry":"necrank_loss","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"layers/reanked_clu_loss.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/layers/reanked_clu_loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b68e8972a6c19ecf"}},{"code_sha256_prefix":"1a26ab081550abcd","entry":"normalize_rank","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"layers/reanked_clu_loss.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/layers/reanked_clu_loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1a26ab081550abcd"}},{"code_sha256_prefix":"8ec87e18f2d04e40","entry":"rank_loss","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"layers/reanked_loss.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/layers/reanked_loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8ec87e18f2d04e40"}},{"code_sha256_prefix":"e5e13f5830c0dbac","entry":"resnet101_ibn_b","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet_ibn_b.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet_ibn_b.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e5e13f5830c0dbac"}},{"code_sha256_prefix":"d2eb6158f5dbb02b","entry":"resnet50_ibn_a","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet_ibn_a.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet_ibn_a.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d2eb6158f5dbb02b"}},{"code_sha256_prefix":"5d9b23d7f641d50c","entry":"resnet50_ibn_b","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet_ibn_b.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet_ibn_b.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5d9b23d7f641d50c"}},{"code_sha256_prefix":"bfe3a99f29b46621","entry":"resnet101_ibn_a","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet_ibn_a.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet_ibn_a.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bfe3a99f29b46621"}},{"code_sha256_prefix":"c7fc850e79b64621","entry":"resnet101_ibn_a_old","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet_ibn_a_old.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet_ibn_a_old.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c7fc850e79b64621"}},{"code_sha256_prefix":"63d91c88c6d72b37","entry":"resnet50_ibn_a_old","repo":"Qidian213/Ranked_Person_ReID","repo_kind":"listed","path":"modeling/backbones/resnet_ibn_a_old.py","file_url":"https://github.com/Qidian213/Ranked_Person_ReID/blob/HEAD/modeling/backbones/resnet_ibn_a_old.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"63d91c88c6d72b37"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}