{"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/single-domain-generalization-for-few-shot","title":"Single Domain Generalization for Few-Shot Counting via Universal Representation Matching","arxiv_id":"2505.16778","date":"2025-05-22","proceeding":"CVPR 2025 1","authors":["Xianing Chen","Si Huo","Borui Jiang","Hailin Hu","Xinghao Chen"],"abstract":"Few-shot counting estimates the number of target objects in an image using only a few annotated exemplars. However, domain shift severely hinders existing methods to generalize to unseen scenarios. This falls into the realm of single domain generalization that remains unexplored in few-shot counting. To solve this problem, we begin by analyzing the main limitations of current methods, which typically follow a standard pipeline that extract the object prototypes from exemplars and then match them with image feature to construct the correlation map. We argue that existing methods overlook the significance of learning highly generalized prototypes. Building on this insight, we propose the first single domain generalization few-shot counting model, Universal Representation Matching, termed URM. Our primary contribution is the discovery that incorporating universal vision-language representations distilled from a large scale pretrained vision-language model into the correlation construction process substantially improves robustness to domain shifts without compromising in domain performance. As a result, URM achieves state-of-the-art performance on both in domain and the newly introduced domain generalization setting.","url_abs":"https://arxiv.org/abs/2505.16778v1","url_pdf":"https://arxiv.org/pdf/2505.16778v1.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":"single-domain-generalization-for-few-shot","repo_url":"https://github.com/jbr97/urm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2505.16778","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2505.16778"}},"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/jbr97/URM","reach":null}],"summary":{"ran":4},"by_repo_kind":{"official":{"samples":4,"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":4,"samples":[{"code_sha256_prefix":"e75aa072e004da65","entry":"MLP","repo":"jbr97/URM","repo_kind":"official","path":"URM/urm/universal_prompt_attention.py","file_url":"https://github.com/jbr97/URM/blob/HEAD/URM/urm/universal_prompt_attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e75aa072e004da65"}},{"code_sha256_prefix":"7d91a43d45b726e7","entry":"UniversalPromptAttn","repo":"jbr97/URM","repo_kind":"official","path":"URM/urm/universal_prompt_attention.py","file_url":"https://github.com/jbr97/URM/blob/HEAD/URM/urm/universal_prompt_attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7d91a43d45b726e7"}},{"code_sha256_prefix":"6d8251772e34586e","entry":"img2prompt_layer","repo":"jbr97/URM","repo_kind":"official","path":"URM/urm/universal_prompt_attention.py","file_url":"https://github.com/jbr97/URM/blob/HEAD/URM/urm/universal_prompt_attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6d8251772e34586e"}},{"code_sha256_prefix":"55e1e9adc2f3ef09","entry":"prompt2img_layer","repo":"jbr97/URM","repo_kind":"official","path":"URM/urm/universal_prompt_attention.py","file_url":"https://github.com/jbr97/URM/blob/HEAD/URM/urm/universal_prompt_attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"55e1e9adc2f3ef09"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}