{"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/an-empirical-investigation-of-pre-trained-1","title":"An Empirical Study of Pre-trained Model Selection for Out-of-Distribution Generalization and Calibration","arxiv_id":"2307.08187","date":"2023-07-17","proceeding":null,"authors":["Hiroki Naganuma","Ryuichiro Hataya","Ioannis Mitliagkas"],"abstract":"In out-of-distribution (OOD) generalization tasks, fine-tuning pre-trained models has become a prevalent strategy. Different from most prior work that has focused on advancing learning algorithms, we systematically examined how pre-trained model size, pre-training dataset size, and training strategies impact generalization and uncertainty calibration on downstream tasks. We evaluated 100 models across diverse pre-trained model sizes, \\update{five} pre-training datasets, and five data augmentations through extensive experiments on four distribution shift datasets totaling over 120,000 GPU hours. Our results demonstrate the significant impact of pre-trained model selection, with optimal choices substantially improving OOD accuracy over algorithm improvement alone. We find larger models and bigger pre-training data improve OOD performance and calibration, in contrast to some prior studies that found modern deep networks to calibrate worse than classical shallow models. Our work underscores the overlooked importance of pre-trained model selection for out-of-distribution generalization and calibration.","url_abs":"https://arxiv.org/abs/2307.08187v3","url_pdf":"https://arxiv.org/pdf/2307.08187v3.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":"an-empirical-investigation-of-pre-trained-1","repo_url":"https://github.com/hiroki11x/timm_ood_calibration","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":null,"task_name":"GPU"},{"task_slug":"memorization","task_name":"Memorization"},{"task_slug":"model-selection","task_name":"Model Selection"},{"task_slug":"out-of-distribution-generalization","task_name":"Out-of-Distribution Generalization"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2307.08187","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.08187"}},"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/hiroki11x/timm_ood_calibration","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":2,"ran":6,"unverified":7},"by_repo_kind":{"official":{"samples":15,"ran":8,"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":"fac5364e2f53c6db","entry":"conv3x3","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/networks.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/networks.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fac5364e2f53c6db"}},{"code_sha256_prefix":"53fac8d8d949e72b","entry":"get_test_records","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/model_selection.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/model_selection.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"53fac8d8d949e72b"}},{"code_sha256_prefix":"71a3a61ceed99bf3","entry":"hashable","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/lib/query.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/lib/query.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"71a3a61ceed99bf3"}},{"code_sha256_prefix":"2f8af5779e1edcb6","entry":"make_selector_fn","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/lib/query.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/lib/query.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2f8af5779e1edcb6"}},{"code_sha256_prefix":"5f576ed342c48a0a","entry":"make_weights_for_balanced_classes","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/lib/misc.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/lib/misc.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5f576ed342c48a0a"}},{"code_sha256_prefix":"196cab71d7129d62","entry":"remove_batch_norm_from_resnet","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/networks.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/networks.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"196cab71d7129d62"}},{"code_sha256_prefix":"6784a79e7943e224","entry":"resnet18","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/networks.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/networks.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6784a79e7943e224"}},{"code_sha256_prefix":"18e820e42046bc45","entry":"split_dataset","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/lib/misc.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/lib/misc.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"18e820e42046bc45"}},{"code_sha256_prefix":"9e81bbf308f5fd2b","entry":"build_calibration_metric","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/calibration/ece.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/calibration/ece.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9e81bbf308f5fd2b"}},{"code_sha256_prefix":"4cc1b13edccacd97","entry":"calc_ece","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/calibration/ece.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/calibration/ece.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4cc1b13edccacd97"}},{"code_sha256_prefix":"07696a6fad15378d","entry":"calibrate","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/calibration/ece.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/calibration/ece.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"07696a6fad15378d"}},{"code_sha256_prefix":"b0bc80b1655a6802","entry":"get_algorithm_class","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/algorithms.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/algorithms.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b0bc80b1655a6802"}},{"code_sha256_prefix":"d0ea85d74c20dea9","entry":"get_dataset_class","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/datasets.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d0ea85d74c20dea9"}},{"code_sha256_prefix":"73f32252eedba6a4","entry":"num_environments","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/datasets.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"73f32252eedba6a4"}},{"code_sha256_prefix":"af3c9a80c8fd1f7a","entry":"print_row","repo":"hiroki11x/timm_ood_calibration","repo_kind":"official","path":"domainbed/lib/misc.py","file_url":"https://github.com/hiroki11x/timm_ood_calibration/blob/HEAD/domainbed/lib/misc.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"af3c9a80c8fd1f7a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}