{"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/hyperbolic-vision-transformers-combining","title":"Hyperbolic Vision Transformers: Combining Improvements in Metric Learning","arxiv_id":"2203.10833","date":"2022-03-21","proceeding":"CVPR 2022 1","authors":["Aleksandr Ermolov","Leyla Mirvakhabova","Valentin Khrulkov","Nicu Sebe","Ivan Oseledets"],"abstract":"Metric learning aims to learn a highly discriminative model encouraging the embeddings of similar classes to be close in the chosen metrics and pushed apart for dissimilar ones. The common recipe is to use an encoder to extract embeddings and a distance-based loss function to match the representations -- usually, the Euclidean distance is utilized. An emerging interest in learning hyperbolic data embeddings suggests that hyperbolic geometry can be beneficial for natural data. Following this line of work, we propose a new hyperbolic-based model for metric learning. At the core of our method is a vision transformer with output embeddings mapped to hyperbolic space. These embeddings are directly optimized using modified pairwise cross-entropy loss. We evaluate the proposed model with six different formulations on four datasets achieving the new state-of-the-art performance. The source code is available at https://github.com/htdt/hyp_metric.","url_abs":"https://arxiv.org/abs/2203.10833v2","url_pdf":"https://arxiv.org/pdf/2203.10833v2.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":"hyperbolic-vision-transformers-combining","repo_url":"https://github.com/htdt/hyp_metric","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"hyperbolic-vision-transformers-combining","repo_url":"https://github.com/OML-Team/open-metric-learning","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"metric-learning","task_name":"Metric Learning"}],"methods":[{"method_slug":"dino","method_name":"DINO"},{"method_slug":"infonce","method_name":"InfoNCE"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/metric-learning-on-cars196","task":"Metric Learning","dataset":"CARS196","model":"Hyp-DINO 8x8","rank_in_archive_order":2,"of":36,"metrics":{"R@1":"92.8"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-cars196","task":"Metric Learning","dataset":"CARS196","model":"Hyp-DINO","rank_in_archive_order":13,"of":36,"metrics":{"R@1":"89.2"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-cars196","task":"Metric Learning","dataset":"CARS196","model":"Hyp-ViT","rank_in_archive_order":25,"of":36,"metrics":{"R@1":"86.5"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-cub-200-2011-4","task":"Metric Learning","dataset":"CUB-200-2011","model":"Hyp-DINO","rank_in_archive_order":1,"of":2,"metrics":{"R@1":"80.9"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-cub-200-2011","task":"Metric Learning","dataset":"CUB-200-2011","model":"Hyp-ViT","rank_in_archive_order":3,"of":30,"metrics":{"R@1":"85.6"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-in-shop-1","task":"Metric Learning","dataset":"In-Shop","model":"Hyp-ViT","rank_in_archive_order":4,"of":15,"metrics":{"R@1":"92.5"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-in-shop-1","task":"Metric Learning","dataset":"In-Shop","model":"Hyp-DINO","rank_in_archive_order":5,"of":15,"metrics":{"R@1":"92.4"},"uses_additional_data":false},{"leaderboard":"/sota/metric-learning-on-stanford-online-products-1","task":"Metric Learning","dataset":"Stanford Online Products","model":"Hyp-ViT","rank_in_archive_order":6,"of":33,"metrics":{"R@1":"85.9"},"uses_additional_data":true},{"leaderboard":"/sota/metric-learning-on-stanford-online-products-1","task":"Metric Learning","dataset":"Stanford Online Products","model":"Hyp-DINO","rank_in_archive_order":7,"of":33,"metrics":{"R@1":"85.1"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2203.10833","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.10833"}},"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":"deterministic:regex_extraction","url":"https://github.com/NVIDIA/apex","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/OML-Team/open-metric-learning","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/htdt/hyp_metric","reach":null}],"summary":{"ran":2,"ran_draft_wrong":2,"unverified":2},"by_repo_kind":{"official":{"samples":6,"ran":4,"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":"ef850ea4ebf99283","entry":"HypLinear","repo":"htdt/hyp_metric","repo_kind":"official","path":"hyptorch/nn.py","file_url":"https://github.com/htdt/hyp_metric/blob/HEAD/hyptorch/nn.py","link_basis":"first_harvest_node","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":"ef850ea4ebf99283"}},{"code_sha256_prefix":"daf212010121f13d","entry":"artanh","repo":"htdt/hyp_metric","repo_kind":"official","path":"hyptorch/nn.py","file_url":"https://github.com/htdt/hyp_metric/blob/HEAD/hyptorch/nn.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"daf212010121f13d"}},{"code_sha256_prefix":"d0bcd7cd164a4987","entry":"mobius_add","repo":"htdt/hyp_metric","repo_kind":"official","path":"hyptorch/nn.py","file_url":"https://github.com/htdt/hyp_metric/blob/HEAD/hyptorch/nn.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d0bcd7cd164a4987"}},{"code_sha256_prefix":"ea6109a03ce10561","entry":"mobius_matvec","repo":"htdt/hyp_metric","repo_kind":"official","path":"hyptorch/nn.py","file_url":"https://github.com/htdt/hyp_metric/blob/HEAD/hyptorch/nn.py","link_basis":"first_harvest_node","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":"ea6109a03ce10561"}},{"code_sha256_prefix":"7b7b467a36348c8b","entry":"Artanh","repo":"htdt/hyp_metric","repo_kind":"official","path":"hyptorch/nn.py","file_url":"https://github.com/htdt/hyp_metric/blob/HEAD/hyptorch/nn.py","link_basis":"first_harvest_node","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":"7b7b467a36348c8b"}},{"code_sha256_prefix":"93968601ef4b16be","entry":"_mobius_matvec","repo":"htdt/hyp_metric","repo_kind":"official","path":"hyptorch/nn.py","file_url":"https://github.com/htdt/hyp_metric/blob/HEAD/hyptorch/nn.py","link_basis":"first_harvest_node","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":"93968601ef4b16be"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}