{"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/rank-based-loss-for-learning-hierarchical","title":"Rank-based loss for learning hierarchical representations","arxiv_id":"2110.05941","date":"2021-10-11","proceeding":null,"authors":["Ines Nolasco","Dan Stowell"],"abstract":"Hierarchical taxonomies are common in many contexts, and they are a very natural structure humans use to organise information. In machine learning, the family of methods that use the 'extra' information is called hierarchical classification. However, applied to audio classification, this remains relatively unexplored. Here we focus on how to integrate the hierarchical information of a problem to learn embeddings representative of the hierarchical relationships. Previously, triplet loss has been proposed to address this problem, however it presents some issues like requiring the careful construction of the triplets, and being limited in the extent of hierarchical information it uses at each iteration. In this work we propose a rank based loss function that uses hierarchical information and translates this into a rank ordering of target distances between the examples. We show that rank based loss is suitable to learn hierarchical representations of the data. By testing on unseen fine level classes we show that this method is also capable of learning hierarchically correct representations of the new classes. Rank based loss has two promising aspects, it is generalisable to hierarchies with any number of levels, and is capable of dealing with data with incomplete hierarchical labels.","url_abs":"https://arxiv.org/abs/2110.05941v2","url_pdf":"https://arxiv.org/pdf/2110.05941v2.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":"rank-based-loss-for-learning-hierarchical","repo_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"audio-classification","task_name":"Audio Classification"},{"task_slug":null,"task_name":"Triplet"}],"methods":[{"method_slug":"rbl","method_name":"Rank-based Loss"},{"method_slug":"triplet-loss","method_name":"Triplet Loss"}],"datasets_introduced":[],"methods_introduced":[{"slug":"rbl","name":"Rank-based Loss","full_name":"Rank-based loss"}],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2110.05941","atlas_url":"https://app.syntology.ai/?focus=2110.05941","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.05941"}},"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/inesnolas/Rank-based-loss_ICASSP22","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":6,"unverified":1},"by_repo_kind":{"official":{"samples":7,"ran":6,"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":"3457a7b58aa8856f","entry":"calc_euclidean","repo":"inesnolas/Rank-based-loss_ICASSP22","repo_kind":"official","path":"loss_functions/quadruplet_loss.py","file_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22/blob/HEAD/loss_functions/quadruplet_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":"3457a7b58aa8856f"}},{"code_sha256_prefix":"7d4360c8554ee21d","entry":"compute_cosine_distances","repo":"inesnolas/Rank-based-loss_ICASSP22","repo_kind":"official","path":"loss_functions/quadruplet_loss.py","file_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22/blob/HEAD/loss_functions/quadruplet_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":"7d4360c8554ee21d"}},{"code_sha256_prefix":"e95589380484e2df","entry":"compute_pair_gt_tree_distance","repo":"inesnolas/Rank-based-loss_ICASSP22","repo_kind":"official","path":"loss_functions/rank_based_loss.py","file_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22/blob/HEAD/loss_functions/rank_based_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":"e95589380484e2df"}},{"code_sha256_prefix":"c842d0c2faa8437b","entry":"compute_pairwise_cosine_distances","repo":"inesnolas/Rank-based-loss_ICASSP22","repo_kind":"official","path":"utils/distance_functions.py","file_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22/blob/HEAD/utils/distance_functions.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":"c842d0c2faa8437b"}},{"code_sha256_prefix":"384275dd3b9c3822","entry":"compute_pairwise_euclidean_distances","repo":"inesnolas/Rank-based-loss_ICASSP22","repo_kind":"official","path":"utils/distance_functions.py","file_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22/blob/HEAD/utils/distance_functions.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":"384275dd3b9c3822"}},{"code_sha256_prefix":"9eb7ab0b0e602198","entry":"compute_triplet_loss","repo":"inesnolas/Rank-based-loss_ICASSP22","repo_kind":"official","path":"loss_functions/quadruplet_loss.py","file_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22/blob/HEAD/loss_functions/quadruplet_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":"9eb7ab0b0e602198"}},{"code_sha256_prefix":"c7f8555baf15925e","entry":"pre_compute_rank_map","repo":"inesnolas/Rank-based-loss_ICASSP22","repo_kind":"official","path":"loss_functions/rank_based_loss.py","file_url":"https://github.com/inesnolas/Rank-based-loss_ICASSP22/blob/HEAD/loss_functions/rank_based_loss.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":"c7f8555baf15925e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}