{"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/multi-similarity-loss-with-general-pair","title":"Multi-Similarity Loss with General Pair Weighting for Deep Metric Learning","arxiv_id":"1904.06627","date":"2019-04-14","proceeding":"CVPR 2019 6","authors":["Xun Wang","Xintong Han","Weilin Huang","Dengke Dong","Matthew R. Scott"],"abstract":"A family of loss functions built on pair-based computation have been proposed in the literature which provide a myriad of solutions for deep metric learning. In this paper, we provide a general weighting framework for understanding recent pair-based loss functions. Our contributions are three-fold: (1) we establish a General Pair Weighting (GPW) framework, which casts the sampling problem of deep metric learning into a unified view of pair weighting through gradient analysis, providing a powerful tool for understanding recent pair-based loss functions; (2) we show that with GPW, various existing pair-based methods can be compared and discussed comprehensively, with clear differences and key limitations identified; (3) we propose a new loss called multi-similarity loss (MS loss) under the GPW, which is implemented in two iterative steps (i.e., mining and weighting). This allows it to fully consider three similarities for pair weighting, providing a more principled approach for collecting and weighting informative pairs. Finally, the proposed MS loss obtains new state-of-the-art performance on four image retrieval benchmarks, where it outperforms the most recent approaches, such as ABE\\cite{Kim_2018_ECCV} and HTL by a large margin: 60.6% to 65.7% on CUB200, and 80.9% to 88.0% on In-Shop Clothes Retrieval dataset at Recall@1. Code is available at https://github.com/MalongTech/research-ms-loss.","url_abs":"https://arxiv.org/abs/1904.06627v3","url_pdf":"https://arxiv.org/pdf/1904.06627v3.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":"multi-similarity-loss-with-general-pair","repo_url":"https://github.com/MalongTech/research-ms-loss","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"multi-similarity-loss-with-general-pair","repo_url":"https://github.com/bnu-wangxun/Deep_Metric","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"image-retrieval","task_name":"Image Retrieval"},{"task_slug":"metric-learning","task_name":"Metric Learning"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-retrieval-on-cars196","task":"Image Retrieval","dataset":"CARS196","model":"MS512","rank_in_archive_order":6,"of":8,"metrics":{"R@1":"84.1"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-cub-200-2011","task":"Image Retrieval","dataset":"CUB-200-2011","model":"MS512","rank_in_archive_order":6,"of":8,"metrics":{"R@1":"65.7"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-in-shop","task":"Image Retrieval","dataset":"In-Shop","model":"MS512","rank_in_archive_order":4,"of":7,"metrics":{"R@1":"89.7"},"uses_additional_data":false},{"leaderboard":"/sota/image-retrieval-on-sop","task":"Image Retrieval","dataset":"SOP","model":"MS512","rank_in_archive_order":11,"of":14,"metrics":{"R@1":"78.2"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1904.06627","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1904.06627"}},"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/bnu-wangxun/Deep_Metric","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/MalongTech/research-ms-loss","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"unverified":1},"by_repo_kind":{"listed":{"samples":1,"ran":0,"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":"37b6248efba25a42","entry":"BN_Inception","repo":"bnu-wangxun/Deep_Metric","repo_kind":"listed","path":"models/BN_Inception.py","file_url":"https://github.com/bnu-wangxun/Deep_Metric/blob/HEAD/models/BN_Inception.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"37b6248efba25a42"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}