{"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/a-sentence-speaks-a-thousand-images-domain","title":"A Sentence Speaks a Thousand Images: Domain Generalization through Distilling CLIP with Language Guidance","arxiv_id":"2309.12530","date":"2023-09-21","proceeding":"ICCV 2023 1","authors":["Zeyi Huang","Andy Zhou","Zijian Lin","Mu Cai","Haohan Wang","Yong Jae Lee"],"abstract":"Domain generalization studies the problem of training a model with samples from several domains (or distributions) and then testing the model with samples from a new, unseen domain. In this paper, we propose a novel approach for domain generalization that leverages recent advances in large vision-language models, specifically a CLIP teacher model, to train a smaller model that generalizes to unseen domains. The key technical contribution is a new type of regularization that requires the student's learned image representations to be close to the teacher's learned text representations obtained from encoding the corresponding text descriptions of images. We introduce two designs of the loss function, absolute and relative distance, which provide specific guidance on how the training process of the student model should be regularized. We evaluate our proposed method, dubbed RISE (Regularized Invariance with Semantic Embeddings), on various benchmark datasets and show that it outperforms several state-of-the-art domain generalization methods. To our knowledge, our work is the first to leverage knowledge distillation using a large vision-language model for domain generalization. By incorporating text-based information, RISE improves the generalization capability of machine learning models.","url_abs":"https://arxiv.org/abs/2309.12530v1","url_pdf":"https://arxiv.org/pdf/2309.12530v1.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":"a-sentence-speaks-a-thousand-images-domain","repo_url":"https://github.com/oodbag/rise","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"sentence","task_name":"Sentence"}],"methods":[{"method_slug":"clip","method_name":"CLIP"},{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/domain-generalization-on-pacs-2","task":"Domain Generalization","dataset":"PACS","model":"RISE (ResNet-50)","rank_in_archive_order":21,"of":133,"metrics":{"Average Accuracy":"90.2"},"uses_additional_data":false}],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2309.12530","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.12530"}},"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/oodbag/rise","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/OoDBag/RISE","reach":{"status":"ok"}}],"summary":{"ran":14,"unverified":2},"by_repo_kind":{"official":{"samples":16,"ran":14,"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":16,"samples":[{"code_sha256_prefix":"39934307038ef5a9","entry":"adaptive_avgmax_pool2d","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/adaptive_avgmax_pool.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/adaptive_avgmax_pool.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"39934307038ef5a9"}},{"code_sha256_prefix":"fa9e3a5ceeac7703","entry":"adaptive_catavgmax_pool2d","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/adaptive_avgmax_pool.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/adaptive_avgmax_pool.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fa9e3a5ceeac7703"}},{"code_sha256_prefix":"13295c0de28cc1f1","entry":"adaptive_pool_feat_mult","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/adaptive_avgmax_pool.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/adaptive_avgmax_pool.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"13295c0de28cc1f1"}},{"code_sha256_prefix":"52231145e6cbb0b4","entry":"get_optim_and_scheduler","repo":"OoDBag/RISE","repo_kind":"official","path":"optimizer/optimizer_helper.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/optimizer/optimizer_helper.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":"52231145e6cbb0b4"}},{"code_sha256_prefix":"0ff0426715fb49eb","entry":"get_top_k","repo":"OoDBag/RISE","repo_kind":"official","path":"evaluate_results.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/evaluate_results.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":"0ff0426715fb49eb"}},{"code_sha256_prefix":"91c27523dde7eb4a","entry":"hard_sigmoid_jit","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations_jit.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations_jit.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":"91c27523dde7eb4a"}},{"code_sha256_prefix":"801c85b8903bfff5","entry":"mish","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"801c85b8903bfff5"}},{"code_sha256_prefix":"14eddd8cc4c65fe0","entry":"mish_jit","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations_jit.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations_jit.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":"14eddd8cc4c65fe0"}},{"code_sha256_prefix":"d83b6ecf3cdc1d6a","entry":"sigmoid","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d83b6ecf3cdc1d6a"}},{"code_sha256_prefix":"717e4d22b6d103e6","entry":"swish","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"717e4d22b6d103e6"}},{"code_sha256_prefix":"8e341f8585b3fe94","entry":"swish_jit","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations_jit.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations_jit.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":"8e341f8585b3fe94"}},{"code_sha256_prefix":"ccf59d4aa2ccacdb","entry":"swish_jit_bwd","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations_me.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations_me.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":"ccf59d4aa2ccacdb"}},{"code_sha256_prefix":"2d53e47b891cd927","entry":"swish_jit_fwd","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations_me.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations_me.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":"2d53e47b891cd927"}},{"code_sha256_prefix":"51a2f9920a170144","entry":"swish_me","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/activations_me.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/activations_me.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":"51a2f9920a170144"}},{"code_sha256_prefix":"f0b44651e598ca66","entry":"rel_logits_1d","repo":"OoDBag/RISE","repo_kind":"official","path":"timm/layers/bottleneck_attn.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/timm/layers/bottleneck_attn.py","link_basis":"harvester_set","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":"f0b44651e598ca66"}},{"code_sha256_prefix":"25212e54355cd32c","entry":"write_to_dict","repo":"OoDBag/RISE","repo_kind":"official","path":"evaluate_results.py","file_url":"https://github.com/OoDBag/RISE/blob/HEAD/evaluate_results.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":"25212e54355cd32c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}