{"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/coarse-to-fine-learning-compact","title":"Coarse-to-Fine: Learning Compact Discriminative Representation for Single-Stage Image Retrieval","arxiv_id":"2308.04008","date":"2023-08-08","proceeding":"ICCV 2023 1","authors":["Yunquan Zhu","Xinkai Gao","Bo Ke","Ruizhi Qiao","Xing Sun"],"abstract":"Image retrieval targets to find images from a database that are visually similar to the query image. Two-stage methods following retrieve-and-rerank paradigm have achieved excellent performance, but their separate local and global modules are inefficient to real-world applications. To better trade-off retrieval efficiency and accuracy, some approaches fuse global and local feature into a joint representation to perform single-stage image retrieval. However, they are still challenging due to various situations to tackle, $e.g.$, background, occlusion and viewpoint. In this work, we design a Coarse-to-Fine framework to learn Compact Discriminative representation (CFCD) for end-to-end single-stage image retrieval-requiring only image-level labels. Specifically, we first design a novel adaptive softmax-based loss which dynamically tunes its scale and margin within each mini-batch and increases them progressively to strengthen supervision during training and intra-class compactness. Furthermore, we propose a mechanism which attentively selects prominent local descriptors and infuse fine-grained semantic relations into the global representation by a hard negative sampling strategy to optimize inter-class distinctiveness at a global scale. Extensive experimental results have demonstrated the effectiveness of our method, which achieves state-of-the-art single-stage image retrieval performance on benchmarks such as Revisited Oxford and Revisited Paris. Code is available at https://github.com/bassyess/CFCD.","url_abs":"https://arxiv.org/abs/2308.04008v1","url_pdf":"https://arxiv.org/pdf/2308.04008v1.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":"coarse-to-fine-learning-compact","repo_url":"https://github.com/bassyess/cfcd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-retrieval","task_name":"Image Retrieval"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.04008","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.04008"}},"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/feymanpriv/DOLG-paddle","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/bassyess/CFCD","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":15,"ran_fixture":1,"unverified":5},"by_repo_kind":{"official":{"samples":10,"ran":9,"repositories":1},"found_in_text":{"samples":11,"ran":7,"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":11,"samples":[{"code_sha256_prefix":"f623b3e3625d4e42","entry":"cache_url","repo":"bassyess/CFCD","repo_kind":"official","path":"core/io.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/io.py","link_basis":"first_harvest_node","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":"f623b3e3625d4e42"}},{"code_sha256_prefix":"4136b6e9df422178","entry":"complexity_batchnorm2d","repo":"bassyess/CFCD","repo_kind":"official","path":"core/net.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/net.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":"4136b6e9df422178"}},{"code_sha256_prefix":"b299737079f619a1","entry":"complexity_conv2d","repo":"bassyess/CFCD","repo_kind":"official","path":"core/net.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/net.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":"b299737079f619a1"}},{"code_sha256_prefix":"ee4b7c6aef3ebb1f","entry":"complexity_maxpool2d","repo":"bassyess/CFCD","repo_kind":"official","path":"core/net.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/net.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":"ee4b7c6aef3ebb1f"}},{"code_sha256_prefix":"a07ad22c46aa3105","entry":"compute_ap","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"revisitop/compute.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/revisitop/compute.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a07ad22c46aa3105"}},{"code_sha256_prefix":"ba576e373d900666","entry":"configdataset","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"revisitop/dataset.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/revisitop/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ba576e373d900666"}},{"code_sha256_prefix":"24756d5881b92c4f","entry":"dump_log_data","repo":"bassyess/CFCD","repo_kind":"official","path":"core/logging.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/logging.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":"24756d5881b92c4f"}},{"code_sha256_prefix":"d163ebb8549c1402","entry":"float_to_decimal","repo":"bassyess/CFCD","repo_kind":"official","path":"core/logging.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/logging.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":"d163ebb8549c1402"}},{"code_sha256_prefix":"8e4e129cb77e7f8b","entry":"get_logger","repo":"bassyess/CFCD","repo_kind":"official","path":"core/logging.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/logging.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":"8e4e129cb77e7f8b"}},{"code_sha256_prefix":"cac699a42dd367b4","entry":"global_search","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"revisitop/example_evaluate.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/revisitop/example_evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cac699a42dd367b4"}},{"code_sha256_prefix":"ebcc600b4c421051","entry":"normalize","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"infer.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/infer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ebcc600b4c421051"}},{"code_sha256_prefix":"959d3177b743555a","entry":"process","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"revisitop/example_evaluate.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/revisitop/example_evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"959d3177b743555a"}},{"code_sha256_prefix":"192cb22df1633f0e","entry":"resize","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"infer.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/infer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"192cb22df1633f0e"}},{"code_sha256_prefix":"803bcd86e3301891","entry":"time_string","repo":"bassyess/CFCD","repo_kind":"official","path":"core/meters.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/meters.py","link_basis":"first_harvest_node","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":"803bcd86e3301891"}},{"code_sha256_prefix":"b997b70e1ac2c2f1","entry":"topk_errors","repo":"bassyess/CFCD","repo_kind":"official","path":"core/meters.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/meters.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":"b997b70e1ac2c2f1"}},{"code_sha256_prefix":"8e712c383c677282","entry":"zero_pad","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"infer.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/infer.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8e712c383c677282"}},{"code_sha256_prefix":"5ff2df48c3c7db02","entry":"compute_map","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"revisitop/compute.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/revisitop/compute.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5ff2df48c3c7db02"}},{"code_sha256_prefix":"49cf1f4ce52e9613","entry":"config_imname","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"revisitop/dataset.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/revisitop/dataset.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"49cf1f4ce52e9613"}},{"code_sha256_prefix":"91c5ae2396603107","entry":"config_qimname","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"revisitop/dataset.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/revisitop/dataset.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"91c5ae2396603107"}},{"code_sha256_prefix":"e10bd0e3f25f2b57","entry":"download_url","repo":"bassyess/CFCD","repo_kind":"official","path":"core/io.py","file_url":"https://github.com/bassyess/CFCD/blob/HEAD/core/io.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":"e10bd0e3f25f2b57"}},{"code_sha256_prefix":"72a59e3adb80fc0b","entry":"load_checkpoint","repo":"feymanpriv/DOLG-paddle","repo_kind":"found_in_text","path":"convertor/convert.py","file_url":"https://github.com/feymanpriv/DOLG-paddle/blob/HEAD/convertor/convert.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"72a59e3adb80fc0b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}