{"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/the-group-loss-for-deep-metric-learning","title":"The Group Loss for Deep Metric Learning","arxiv_id":"1912.00385","date":"2019-12-01","proceeding":"ECCV 2020 8","authors":["Ismail Elezi","Sebastiano Vascon","Alessandro Torcinovich","Marcello Pelillo","Laura Leal-Taixe"],"abstract":"Deep metric learning has yielded impressive results in tasks such as clustering and image retrieval by leveraging neural networks to obtain highly discriminative feature embeddings, which can be used to group samples into different classes. Much research has been devoted to the design of smart loss functions or data mining strategies for training such networks. Most methods consider only pairs or triplets of samples within a mini-batch to compute the loss function, which is commonly based on the distance between embeddings. We propose Group Loss, a loss function based on a differentiable label-propagation method that enforces embedding similarity across all samples of a group while promoting, at the same time, low-density regions amongst data points belonging to different groups. Guided by the smoothness assumption that \"similar objects should belong to the same group\", the proposed loss trains the neural network for a classification task, enforcing a consistent labelling amongst samples within a class. We show state-of-the-art results on clustering and image retrieval on several datasets, and show the potential of our method when combined with other techniques such as ensembles","url_abs":"https://arxiv.org/abs/1912.00385v4","url_pdf":"https://arxiv.org/pdf/1912.00385v4.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":"the-group-loss-for-deep-metric-learning","repo_url":"https://github.com/dvl-tum/group_loss","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"the-group-loss-for-deep-metric-learning","repo_url":"https://github.com/laurinwagner/grouploss_plus","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"clustering","task_name":"Clustering"},{"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/metric-learning-on-cars196","task":"Metric Learning","dataset":"CARS196","model":"Group Loss","rank_in_archive_order":26,"of":36,"metrics":{"R@1":"85.6"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-cub-200-2011","task":"Metric Learning","dataset":"CUB-200-2011","model":"BN-Inception + Group Loss","rank_in_archive_order":20,"of":30,"metrics":{"R@1":"65.5"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-stanford-online-products-1","task":"Metric Learning","dataset":"Stanford Online Products","model":"Group Loss","rank_in_archive_order":33,"of":33,"metrics":{"R@1":"75.7"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/1912.00385","atlas_url":"https://app.syntology.ai/?focus=1912.00385","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1912.00385"}},"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/laurinwagner/grouploss_plus","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dvl-tum/group_loss","reach":null}],"summary":{"ran":9,"ran_draft_wrong":2,"ran_honours":1,"unverified":6},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":17,"ran":11,"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":"650c1166736654f2","entry":"bn_inception","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/inception_bn.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/inception_bn.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":"650c1166736654f2"}},{"code_sha256_prefix":"d9def42110729a85","entry":"conv1x1","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/resnet.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/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":"d9def42110729a85"}},{"code_sha256_prefix":"160bb14bd76201b4","entry":"conv3x3","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/resnet.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/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":"160bb14bd76201b4"}},{"code_sha256_prefix":"0fa98ac2194783f3","entry":"dynamics","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"dynamics.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/dynamics.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":"0fa98ac2194783f3"}},{"code_sha256_prefix":"5efaf143a9a72186","entry":"get_W_gt","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"gtg.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/gtg.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":"5efaf143a9a72186"}},{"code_sha256_prefix":"d574dd05dd75020c","entry":"get_sim_pairs","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"gtg.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/gtg.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":"d574dd05dd75020c"}},{"code_sha256_prefix":"4e716cb135e5eb7c","entry":"make_embedding_layer","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/embed.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/embed.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":"4e716cb135e5eb7c"}},{"code_sha256_prefix":"21bfe6f420cc452c","entry":"predict_batchwise","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/utils.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":"21bfe6f420cc452c"}},{"code_sha256_prefix":"b8c440cba313c634","entry":"predict_batchwise_inshop","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/utils.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":"b8c440cba313c634"}},{"code_sha256_prefix":"d477cdb6933c981b","entry":"re_rank","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/utils.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":"d477cdb6933c981b"}},{"code_sha256_prefix":"e9ea44d93d8ffa92","entry":"rnd","repo":"dvl-tum/group_loss","repo_kind":"official","path":"train_finetune.py","file_url":"https://github.com/dvl-tum/group_loss/blob/HEAD/train_finetune.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e9ea44d93d8ffa92"}},{"code_sha256_prefix":"108396eb628e18c6","entry":"update_probs","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"combine_sampler.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/combine_sampler.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":"108396eb628e18c6"}},{"code_sha256_prefix":"662688cdde7e85be","entry":"densenet121","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/densenet.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/densenet.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":"662688cdde7e85be"}},{"code_sha256_prefix":"a15fc654c671c2bf","entry":"densenet161","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/densenet.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/densenet.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":"a15fc654c671c2bf"}},{"code_sha256_prefix":"2f494ef1c2bb7bab","entry":"densenet169","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/densenet.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/densenet.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":"2f494ef1c2bb7bab"}},{"code_sha256_prefix":"757fc132892039c3","entry":"embed","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/embed.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/embed.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":"757fc132892039c3"}},{"code_sha256_prefix":"9771a961f7827f37","entry":"resnet18","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"net/resnet.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/net/resnet.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":"9771a961f7827f37"}},{"code_sha256_prefix":"a087db29a375ae43","entry":"thresh_func","repo":"laurinwagner/grouploss_plus","repo_kind":"listed","path":"gtg.py","file_url":"https://github.com/laurinwagner/grouploss_plus/blob/HEAD/gtg.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":"a087db29a375ae43"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}