{"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/arxiv-2512-16202","title":"Open Ad-hoc Categorization with Contextualized Feature Learning","arxiv_id":"2512.16202","date":"2025-12-18","proceeding":"CVPR","authors":["Zilin Wang","Sangwoo Mo","Stella X. Yu","Sima Behpour","Liu Ren"],"abstract":"Adaptive categorization of visual scenes is essential for AI agents to handle changing tasks. Unlike fixed common categories for plants or animals, ad-hoc categories are created dynamically to serve specific goals. We study open ad-hoc categorization: Given a few labeled exemplars and abundant unlabeled data, the goal is to discover the underlying context and to expand ad-hoc categories through semantic extension and visual clustering around it. Building on the insight that ad-hoc and common categories rely on similar perceptual mechanisms, we propose OAK, a simple model that introduces a small set of learnable context tokens at the input of a frozen CLIP and optimizes with both CLIP's image-text alignment objective and GCD's visual clustering objective. On Stanford and Clevr-4 datasets, OAK achieves state-of-the-art in accuracy and concept discovery across multiple categorizations, including 87.4% novel accuracy on Stanford Mood, surpassing CLIP and GCD by over 50%. Moreover, OAK produces interpretable saliency maps, focusing on hands for Action, faces for Mood, and backgrounds for Location, promoting transparency and trust while enabling adaptive and generalizable categorization.","url_abs":"https://arxiv.org/abs/2512.16202","url_pdf":"https://arxiv.org/pdf/2512.16202","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2512.16202","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2512.16202"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/Wayne2Wang/OAK","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"ran_fixture":1,"unverified":13},"by_repo_kind":{"found_in_text":{"samples":15,"ran":2,"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":"c62a45794431e9b7","entry":"get_mean_lr","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/utils/general.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/utils/general.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":2,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c62a45794431e9b7"}},{"code_sha256_prefix":"55120f2026b56aa2","entry":"drop_path","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/models/dino_vision_transformer.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/models/dino_vision_transformer.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"55120f2026b56aa2"}},{"code_sha256_prefix":"39e6b23b55f376ea","entry":"build_model","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/models/clip/model.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/models/clip/model.py","link_basis":"plan_row","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":"39e6b23b55f376ea"}},{"code_sha256_prefix":"9eb37a3dad52eb3f","entry":"dict_to_namespace","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/utils/configs.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/utils/configs.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":"9eb37a3dad52eb3f"}},{"code_sha256_prefix":"585dcab349137ace","entry":"extract_features","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"visualize_tsne.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/visualize_tsne.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":"585dcab349137ace"}},{"code_sha256_prefix":"57fdc34a54514350","entry":"info_nce_logits","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/engine/losses.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/engine/losses.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":"57fdc34a54514350"}},{"code_sha256_prefix":"021a688e5389b8b6","entry":"load","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/models/clip/clip.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/models/clip/clip.py","link_basis":"plan_row","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":"021a688e5389b8b6"}},{"code_sha256_prefix":"e6b6248844258f59","entry":"load_config","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/utils/configs.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/utils/configs.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":"e6b6248844258f59"}},{"code_sha256_prefix":"a551b95adaa59c5f","entry":"log_accs_from_preds","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/engine/cluster_eval.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/engine/cluster_eval.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":"a551b95adaa59c5f"}},{"code_sha256_prefix":"c60159f61d71caa5","entry":"merge_dict","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/utils/configs.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/utils/configs.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":"c60159f61d71caa5"}},{"code_sha256_prefix":"980dd2e8fa24f9da","entry":"pairwise_distance","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/engine/cluster_eval.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/engine/cluster_eval.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":"980dd2e8fa24f9da"}},{"code_sha256_prefix":"2068c4ac4bbfde4b","entry":"plot_tsne","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"visualize_tsne.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/visualize_tsne.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":"2068c4ac4bbfde4b"}},{"code_sha256_prefix":"e211b877949b1b84","entry":"split_cluster_acc_v2","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/engine/cluster_eval.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/engine/cluster_eval.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":"e211b877949b1b84"}},{"code_sha256_prefix":"995a10f898196998","entry":"vit_small","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/models/dino_vision_transformer.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/models/dino_vision_transformer.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":"995a10f898196998"}},{"code_sha256_prefix":"996780ba4be89ba3","entry":"vit_tiny","repo":"Wayne2Wang/OAK","repo_kind":"found_in_text","path":"src/models/dino_vision_transformer.py","file_url":"https://github.com/Wayne2Wang/OAK/blob/HEAD/src/models/dino_vision_transformer.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":"996780ba4be89ba3"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CV","source":"arxiv_api"},"syntology_extracted_results":null}