{"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/distribution-shift-inversion-for-out-of-1","title":"Distribution Shift Inversion for Out-of-Distribution Prediction","arxiv_id":"2306.08328","date":"2023-06-14","proceeding":"CVPR 2023 1","authors":["Runpeng Yu","Songhua Liu","Xingyi Yang","Xinchao Wang"],"abstract":"Machine learning society has witnessed the emergence of a myriad of Out-of-Distribution (OoD) algorithms, which address the distribution shift between the training and the testing distribution by searching for a unified predictor or invariant feature representation. However, the task of directly mitigating the distribution shift in the unseen testing set is rarely investigated, due to the unavailability of the testing distribution during the training phase and thus the impossibility of training a distribution translator mapping between the training and testing distribution. In this paper, we explore how to bypass the requirement of testing distribution for distribution translator training and make the distribution translation useful for OoD prediction. We propose a portable Distribution Shift Inversion algorithm, in which, before being fed into the prediction model, the OoD testing samples are first linearly combined with additional Gaussian noise and then transferred back towards the training distribution using a diffusion model trained only on the source distribution. Theoretical analysis reveals the feasibility of our method. Experimental results, on both multiple-domain generalization datasets and single-domain generalization datasets, show that our method provides a general performance gain when plugged into a wide range of commonly used OoD algorithms.","url_abs":"https://arxiv.org/abs/2306.08328v1","url_pdf":"https://arxiv.org/pdf/2306.08328v1.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":"distribution-shift-inversion-for-out-of-1","repo_url":"https://github.com/yu-rp/distribution-shift-iverson","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"domain-generalization","task_name":"Domain Generalization"},{"task_slug":"prediction","task_name":"Prediction"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2306.08328","atlas_url":"https://app.syntology.ai/?focus=2306.08328","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2306.08328"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/yu-rp/distribution-shift-iverson","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":1,"ran":1,"unverified":14},"by_repo_kind":{"official":{"samples":16,"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":"ce7990d7ad5821ff","entry":"Classifier","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/Predictor/domainbed_part/networks.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/Predictor/domainbed_part/networks.py","link_basis":"plan_row","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":"ce7990d7ad5821ff"}},{"code_sha256_prefix":"196cab71d7129d62","entry":"remove_batch_norm_from_resnet","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/Predictor/domainbed_part/networks.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/Predictor/domainbed_part/networks.py","link_basis":"plan_row","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":"387b3ed83dbf9591","entry":"Featurizer","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/Predictor/domainbed_part/networks.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/Predictor/domainbed_part/networks.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":"387b3ed83dbf9591"}},{"code_sha256_prefix":"af49b2eeee127db3","entry":"Fourier","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/DiffusionModel/post_processing.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/DiffusionModel/post_processing.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":"af49b2eeee127db3"}},{"code_sha256_prefix":"5c82a73ea5e957eb","entry":"cpu_var","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/metrics.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/metrics.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":"5c82a73ea5e957eb"}},{"code_sha256_prefix":"4a5985f881f48c7d","entry":"detach_var","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/metrics.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/metrics.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":"4a5985f881f48c7d"}},{"code_sha256_prefix":"4533e43e06a12dc5","entry":"download_models","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DiffusionModel/stable-diffusion-main/notebook_helpers.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DiffusionModel/stable-diffusion-main/notebook_helpers.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":"4533e43e06a12dc5"}},{"code_sha256_prefix":"abee7dd03af97a09","entry":"ensemble","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/Predictor/ensemble.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/Predictor/ensemble.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":"abee7dd03af97a09"}},{"code_sha256_prefix":"5b4b926100b414ec","entry":"ensemble2","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/Predictor/ensemble.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/Predictor/ensemble.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":"5b4b926100b414ec"}},{"code_sha256_prefix":"42050f16bad6d41f","entry":"ensembleN","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/Predictor/ensemble.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/Predictor/ensemble.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":"42050f16bad6d41f"}},{"code_sha256_prefix":"e57760f9904f71d8","entry":"flatten","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/DiffusionModel/post_processing.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/DiffusionModel/post_processing.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":"e57760f9904f71d8"}},{"code_sha256_prefix":"b0bc80b1655a6802","entry":"get_algorithm_class","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/Predictor/domainbed_part/algorithms.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/Predictor/domainbed_part/algorithms.py","link_basis":"plan_row","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":"bc1daaae1ff9752f","entry":"gpu_summary","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/utils.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/utils.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":"bc1daaae1ff9752f"}},{"code_sha256_prefix":"1a36f0162b6d35c9","entry":"pp_identity","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/DiffusionModel/post_processing.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/DiffusionModel/post_processing.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":"1a36f0162b6d35c9"}},{"code_sha256_prefix":"4f0c7fbe852a3d65","entry":"pprint","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/utils.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/utils.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":"4f0c7fbe852a3d65"}},{"code_sha256_prefix":"e924f83e343bd341","entry":"ptime","repo":"yu-rp/distribution-shift-iverson","repo_kind":"official","path":"DSI/utils.py","file_url":"https://github.com/yu-rp/distribution-shift-iverson/blob/HEAD/DSI/utils.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":"e924f83e343bd341"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}