{"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/phasic-content-fusing-diffusion-model-with","title":"Phasic Content Fusing Diffusion Model with Directional Distribution Consistency for Few-Shot Model Adaption","arxiv_id":"2309.03729","date":"2023-09-07","proceeding":"ICCV 2023 1","authors":["Teng Hu","Jiangning Zhang","Liang Liu","Ran Yi","Siqi Kou","Haokun Zhu","Xu Chen","Yabiao Wang","Chengjie Wang","Lizhuang Ma"],"abstract":"Training a generative model with limited number of samples is a challenging task. Current methods primarily rely on few-shot model adaption to train the network. However, in scenarios where data is extremely limited (less than 10), the generative network tends to overfit and suffers from content degradation. To address these problems, we propose a novel phasic content fusing few-shot diffusion model with directional distribution consistency loss, which targets different learning objectives at distinct training stages of the diffusion model. Specifically, we design a phasic training strategy with phasic content fusion to help our model learn content and style information when t is large, and learn local details of target domain when t is small, leading to an improvement in the capture of content, style and local details. Furthermore, we introduce a novel directional distribution consistency loss that ensures the consistency between the generated and source distributions more efficiently and stably than the prior methods, preventing our model from overfitting. Finally, we propose a cross-domain structure guidance strategy that enhances structure consistency during domain adaptation. Theoretical analysis, qualitative and quantitative experiments demonstrate the superiority of our approach in few-shot generative model adaption tasks compared to state-of-the-art methods. The source code is available at: https://github.com/sjtuplayer/few-shot-diffusion.","url_abs":"https://arxiv.org/abs/2309.03729v1","url_pdf":"https://arxiv.org/pdf/2309.03729v1.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":"phasic-content-fusing-diffusion-model-with","repo_url":"https://github.com/sjtuplayer/few-shot-diffusion","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"model","task_name":"model"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.03729","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.03729"}},"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/sjtuplayer/few-shot-diffusion","reach":null}],"summary":{"ran":13,"ran_draft_wrong":2,"unverified":10},"by_repo_kind":{"official":{"samples":25,"ran":15,"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":25,"samples":[{"code_sha256_prefix":"d16665e1f56437fb","entry":"Block","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"d16665e1f56437fb"}},{"code_sha256_prefix":"27faeacc0d8cf344","entry":"CheckpointFunction","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"27faeacc0d8cf344"}},{"code_sha256_prefix":"8c5676227adb2492","entry":"Downsample","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8c5676227adb2492"}},{"code_sha256_prefix":"f5fbdad1df60c363","entry":"LayerNorm","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f5fbdad1df60c363"}},{"code_sha256_prefix":"c71125f439d1d5ea","entry":"LinearAttention","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c71125f439d1d5ea"}},{"code_sha256_prefix":"5b3345b4a26536a9","entry":"PreNorm","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"5b3345b4a26536a9"}},{"code_sha256_prefix":"5ebe00ac9e392f07","entry":"QKVAttention","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"5ebe00ac9e392f07"}},{"code_sha256_prefix":"c21412aa89ed28a7","entry":"QKVAttentionLegacy","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c21412aa89ed28a7"}},{"code_sha256_prefix":"d2f3f77a4605ff1f","entry":"Residual","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d2f3f77a4605ff1f"}},{"code_sha256_prefix":"9cc672082b6782fb","entry":"ResnetBlock","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9cc672082b6782fb"}},{"code_sha256_prefix":"7b3d0ed0839661d7","entry":"SinusoidalPosEmb","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7b3d0ed0839661d7"}},{"code_sha256_prefix":"6998a3677700ee6c","entry":"Upsample","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6998a3677700ee6c"}},{"code_sha256_prefix":"179fd1dd12f18912","entry":"WeightStandardizedConv2d","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"179fd1dd12f18912"}},{"code_sha256_prefix":"5b31715a9b105926","entry":"normalization","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","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":"5b31715a9b105926"}},{"code_sha256_prefix":"b0aa348a2f95ef0f","entry":"timestep_embedding","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.py","link_basis":"first_harvest_node","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":"b0aa348a2f95ef0f"}},{"code_sha256_prefix":"33dbefd057c8df79","entry":"AttentionBlock","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"33dbefd057c8df79"}},{"code_sha256_prefix":"79d0a98cc75ac0c8","entry":"MyUnet","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"79d0a98cc75ac0c8"}},{"code_sha256_prefix":"0fc14114982f5c9d","entry":"ResBlock","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"0fc14114982f5c9d"}},{"code_sha256_prefix":"40fb9bc947892adc","entry":"TimestepBlock","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"40fb9bc947892adc"}},{"code_sha256_prefix":"ed74c5af0b1d1d51","entry":"TimestepEmbedSequential","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"ed74c5af0b1d1d51"}},{"code_sha256_prefix":"fb150e1f7e53041e","entry":"checkpoint","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"fb150e1f7e53041e"}},{"code_sha256_prefix":"ac07425399caf784","entry":"convert_module_to_f16","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"ac07425399caf784"}},{"code_sha256_prefix":"b283a8ab305dc007","entry":"convert_module_to_f32","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"b283a8ab305dc007"}},{"code_sha256_prefix":"0c49097ae6ff37ef","entry":"count_flops_attn","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"0c49097ae6ff37ef"}},{"code_sha256_prefix":"176cae28c26d5cf2","entry":"style_condtioner","repo":"sjtuplayer/few-shot-diffusion","repo_kind":"official","path":"model/big_unet.py","file_url":"https://github.com/sjtuplayer/few-shot-diffusion/blob/HEAD/model/big_unet.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":"176cae28c26d5cf2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}