{"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/test-time-canonicalization-by-foundation","title":"Test-Time Canonicalization by Foundation Models for Robust Perception","arxiv_id":"2507.10375","date":"2025-07-14","proceeding":null,"authors":["Utkarsh Singhal","Ryan Feng","Stella X. Yu","Atul Prakash"],"abstract":"Real-world visual perception requires invariance to diverse transformations, yet current methods rely heavily on specialized architectures or training on predefined augmentations, limiting generalization. We propose FOCAL, a test-time, data-driven framework that achieves robust perception by leveraging internet-scale visual priors from foundation models. By generating and optimizing candidate transformations toward visually typical, \"canonical\" views, FOCAL enhances robustness without re-training or architectural changes. Our experiments demonstrate improved robustness of CLIP and SAM across challenging transformations, including 2D/3D rotations, illumination shifts (contrast and color), and day-night variations. We also highlight potential applications in active vision. Our approach challenges the assumption that transform-specific training is necessary, instead offering a scalable path to invariance. Our code is available at: https://github.com/sutkarsh/focal.","url_abs":"https://arxiv.org/abs/2507.10375v1","url_pdf":"https://arxiv.org/pdf/2507.10375v1.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":"test-time-canonicalization-by-foundation","repo_url":"https://github.com/sutkarsh/focal","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"sam","method_name":"SAM"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2507.10375","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2507.10375"}},"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/sutkarsh/focal","reach":null}],"summary":{"ran":1,"ran_draft_wrong":3,"ran_fixture":1},"by_repo_kind":{"official":{"samples":5,"ran":5,"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":"e71ef584e8abae59","entry":"CLIPEnergyArgs","repo":"sutkarsh/focal","repo_kind":"official","path":"focal/utils/energy.py","file_url":"https://github.com/sutkarsh/focal/blob/HEAD/focal/utils/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e71ef584e8abae59"}},{"code_sha256_prefix":"0edfa3be7958d637","entry":"diff_energy","repo":"sutkarsh/focal","repo_kind":"official","path":"focal/utils/energy.py","file_url":"https://github.com/sutkarsh/focal/blob/HEAD/focal/utils/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0edfa3be7958d637"}},{"code_sha256_prefix":"25b9b3ca7e2014f3","entry":"uncond_clip_energy","repo":"sutkarsh/focal","repo_kind":"official","path":"focal/utils/energy.py","file_url":"https://github.com/sutkarsh/focal/blob/HEAD/focal/utils/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"25b9b3ca7e2014f3"}},{"code_sha256_prefix":"77e65a976bbcb297","entry":"uncond_clip_energy","repo":"sutkarsh/focal","repo_kind":"official","path":"focal/utils/energy.py","file_url":"https://github.com/sutkarsh/focal/blob/HEAD/focal/utils/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"77e65a976bbcb297"}},{"code_sha256_prefix":"cf8786d382011675","entry":"uncond_clip_energy_norm_prompt","repo":"sutkarsh/focal","repo_kind":"official","path":"focal/utils/energy.py","file_url":"https://github.com/sutkarsh/focal/blob/HEAD/focal/utils/energy.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cf8786d382011675"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}