{"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/optimal-transport-guided-conditional-score","title":"Optimal Transport-Guided Conditional Score-Based Diffusion Models","arxiv_id":"2311.01226","date":"2023-11-02","proceeding":null,"authors":["Xiang Gu","Liwei Yang","Jian Sun","Zongben Xu"],"abstract":"Conditional score-based diffusion model (SBDM) is for conditional generation of target data with paired data as condition, and has achieved great success in image translation. However, it requires the paired data as condition, and there would be insufficient paired data provided in real-world applications. To tackle the applications with partially paired or even unpaired dataset, we propose a novel Optimal Transport-guided Conditional Score-based diffusion model (OTCS) in this paper. We build the coupling relationship for the unpaired or partially paired dataset based on $L_2$-regularized unsupervised or semi-supervised optimal transport, respectively. Based on the coupling relationship, we develop the objective for training the conditional score-based model for unpaired or partially paired settings, which is based on a reformulation and generalization of the conditional SBDM for paired setting. With the estimated coupling relationship, we effectively train the conditional score-based model by designing a ``resampling-by-compatibility'' strategy to choose the sampled data with high compatibility as guidance. Extensive experiments on unpaired super-resolution and semi-paired image-to-image translation demonstrated the effectiveness of the proposed OTCS model. From the viewpoint of optimal transport, OTCS provides an approach to transport data across distributions, which is a challenge for OT on large-scale datasets. We theoretically prove that OTCS realizes the data transport in OT with a theoretical bound. Code is available at \\url{https://github.com/XJTU-XGU/OTCS}.","url_abs":"https://arxiv.org/abs/2311.01226v1","url_pdf":"https://arxiv.org/pdf/2311.01226v1.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":"optimal-transport-guided-conditional-score","repo_url":"https://github.com/xjtu-xgu/otcs","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"image-to-image-translation","task_name":"Image-to-Image Translation"},{"task_slug":"super-resolution","task_name":"Super-Resolution"},{"task_slug":"translation","task_name":"Translation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2311.01226","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2311.01226"}},"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/XJTU-XGU/OTCS","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/xjtu-xgu/otcs","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":4,"ran_fixture":1,"ran_honours":2,"ran":2,"unverified":8},"by_repo_kind":{"official":{"samples":17,"ran":9,"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":17,"samples":[{"code_sha256_prefix":"c3a6b977022957cb","entry":"Normalize","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"functions/models.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/functions/models.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c3a6b977022957cb"}},{"code_sha256_prefix":"bd1f17e427bf51a5","entry":"dict2namespace","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"main_ddpm.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/main_ddpm.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bd1f17e427bf51a5"}},{"code_sha256_prefix":"cb49209c125de1b4","entry":"get_timestep_embedding","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"functions/models.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/functions/models.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cb49209c125de1b4"}},{"code_sha256_prefix":"edd7184ac144c4fa","entry":"l_loader","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/animal.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/animal.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"edd7184ac144c4fa"}},{"code_sha256_prefix":"0a2cbd0f7b6ec66e","entry":"list_dir","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/utils.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/utils.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":"0a2cbd0f7b6ec66e"}},{"code_sha256_prefix":"c1f52cd4748a76ab","entry":"list_files","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/utils.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/utils.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":"c1f52cd4748a76ab"}},{"code_sha256_prefix":"07d90bd6ae1be7db","entry":"md5_hash","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"functions/ckpt_util.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/functions/ckpt_util.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"07d90bd6ae1be7db"}},{"code_sha256_prefix":"3137073275f8c21a","entry":"nonlinearity","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"functions/models.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/functions/models.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3137073275f8c21a"}},{"code_sha256_prefix":"2c5ce24ea2b5d2a4","entry":"rgb_loader","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/animal.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/animal.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2c5ce24ea2b5d2a4"}},{"code_sha256_prefix":"add68c6d59179a8a","entry":"LargeScaleOTSolver","repo":"xjtu-xgu/otcs","repo_kind":"official","path":"runners/OT_solver.py","file_url":"https://github.com/xjtu-xgu/otcs/blob/HEAD/runners/OT_solver.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":"add68c6d59179a8a"}},{"code_sha256_prefix":"7345763c9b9300fb","entry":"check_integrity","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/utils.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/utils.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":"7345763c9b9300fb"}},{"code_sha256_prefix":"d7e6fb44d02122f9","entry":"get_animal_dataset","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/data_list.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/data_list.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":"d7e6fb44d02122f9"}},{"code_sha256_prefix":"5673afaf376c4601","entry":"get_animal_dataset_test","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/data_list.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/data_list.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":"5673afaf376c4601"}},{"code_sha256_prefix":"89b1fbb2a7d8307c","entry":"get_celeba_dataset","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/data_list.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/data_list.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":"89b1fbb2a7d8307c"}},{"code_sha256_prefix":"95ec0717923d54c9","entry":"get_ckpt_path","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"functions/ckpt_util.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/functions/ckpt_util.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":"95ec0717923d54c9"}},{"code_sha256_prefix":"a0192b9fd16fb20f","entry":"make_dataset","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"datasets/animal.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/datasets/animal.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":"a0192b9fd16fb20f"}},{"code_sha256_prefix":"1445873866afd900","entry":"noise_estimation_loss","repo":"XJTU-XGU/OTCS","repo_kind":"official","path":"functions/losses.py","file_url":"https://github.com/XJTU-XGU/OTCS/blob/HEAD/functions/losses.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":"1445873866afd900"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}