{"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/contrastive-syn-to-real-generalization-1","title":"Contrastive Syn-to-Real Generalization","arxiv_id":"2104.02290","date":"2021-04-06","proceeding":"ICLR 2021 1","authors":["Wuyang Chen","Zhiding Yu","Shalini De Mello","Sifei Liu","Jose M. Alvarez","Zhangyang Wang","Anima Anandkumar"],"abstract":"Training on synthetic data can be beneficial for label or data-scarce scenarios. However, synthetically trained models often suffer from poor generalization in real domains due to domain gaps. In this work, we make a key observation that the diversity of the learned feature embeddings plays an important role in the generalization performance. To this end, we propose contrastive synthetic-to-real generalization (CSG), a novel framework that leverages the pre-trained ImageNet knowledge to prevent overfitting to the synthetic domain, while promoting the diversity of feature embeddings as an inductive bias to improve generalization. In addition, we enhance the proposed CSG framework with attentional pooling (A-pool) to let the model focus on semantically important regions and further improve its generalization. We demonstrate the effectiveness of CSG on various synthetic training tasks, exhibiting state-of-the-art performance on zero-shot domain generalization.","url_abs":"https://arxiv.org/abs/2104.02290v1","url_pdf":"https://arxiv.org/pdf/2104.02290v1.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":"contrastive-syn-to-real-generalization-1","repo_url":"https://github.com/NVlabs/CSG","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"contrastive-syn-to-real-generalization-1","repo_url":"https://github.com/ryanking13/CSG","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"inductive-bias","task_name":"Inductive Bias"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2104.02290","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2104.02290"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/NVlabs/CSG","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ryanking13/CSG","reach":null}],"summary":{"ran":2,"ran_honours":1,"unverified":1},"by_repo_kind":{"official":{"samples":3,"ran":2,"repositories":1},"listed":{"samples":1,"ran":1,"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":3,"samples":[{"code_sha256_prefix":"a9035681e2b85d9a","entry":"MoCoLoss","repo":"ryanking13/CSG","repo_kind":"listed","path":"loss/moco_loss.py","file_url":"https://github.com/ryanking13/CSG/blob/HEAD/loss/moco_loss.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":"a9035681e2b85d9a"}},{"code_sha256_prefix":"7137f5836bf77b0d","entry":"chunk_feature","repo":"NVlabs/CSG","repo_kind":"official","path":"model/csg_builder.py","file_url":"https://github.com/NVlabs/CSG/blob/HEAD/model/csg_builder.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7137f5836bf77b0d"}},{"code_sha256_prefix":"a2ad46fbfc2d7b20","entry":"concat_all_gather","repo":"NVlabs/CSG","repo_kind":"official","path":"model/csg_builder.py","file_url":"https://github.com/NVlabs/CSG/blob/HEAD/model/csg_builder.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"a2ad46fbfc2d7b20"}},{"code_sha256_prefix":"2e581e90912e9383","entry":"CSG","repo":"NVlabs/CSG","repo_kind":"official","path":"model/csg_builder.py","file_url":"https://github.com/NVlabs/CSG/blob/HEAD/model/csg_builder.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2e581e90912e9383"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}