{"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/divide-and-contrast-source-free-domain","title":"Divide and Contrast: Source-free Domain Adaptation via Adaptive Contrastive Learning","arxiv_id":"2211.06612","date":"2022-11-12","proceeding":null,"authors":["Ziyi Zhang","Weikai Chen","Hui Cheng","Zhen Li","Siyuan Li","Liang Lin","Guanbin Li"],"abstract":"We investigate a practical domain adaptation task, called source-free domain adaptation (SFUDA), where the source-pretrained model is adapted to the target domain without access to the source data. Existing techniques mainly leverage self-supervised pseudo labeling to achieve class-wise global alignment [1] or rely on local structure extraction that encourages feature consistency among neighborhoods [2]. While impressive progress has been made, both lines of methods have their own drawbacks - the \"global\" approach is sensitive to noisy labels while the \"local\" counterpart suffers from source bias. In this paper, we present Divide and Contrast (DaC), a new paradigm for SFUDA that strives to connect the good ends of both worlds while bypassing their limitations. Based on the prediction confidence of the source model, DaC divides the target data into source-like and target-specific samples, where either group of samples is treated with tailored goals under an adaptive contrastive learning framework. Specifically, the source-like samples are utilized for learning global class clustering thanks to their relatively clean labels. The more noisy target-specific data are harnessed at the instance level for learning the intrinsic local structures. We further align the source-like domain with the target-specific samples using a memory bank-based Maximum Mean Discrepancy (MMD) loss to reduce the distribution mismatch. Extensive experiments on VisDA, Office-Home, and the more challenging DomainNet have verified the superior performance of DaC over current state-of-the-art approaches. The code is available at https://github.com/ZyeZhang/DaC.git.","url_abs":"https://arxiv.org/abs/2211.06612v1","url_pdf":"https://arxiv.org/pdf/2211.06612v1.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":"divide-and-contrast-source-free-domain","repo_url":"https://github.com/zyezhang/dac","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"GPL-3.0"}},{"paper_slug":"divide-and-contrast-source-free-domain","repo_url":"https://github.com/fenghz/cosda","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"source-free-domain-adaptation","task_name":"Source-Free Domain Adaptation"}],"methods":[{"method_slug":"align","method_name":"ALIGN"},{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"dac","method_name":"DAC"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/source-free-domain-adaptation-on-visda-2017","task":"Source-Free Domain Adaptation","dataset":"VisDA-2017","model":"DaC","rank_in_archive_order":6,"of":10,"metrics":{"Accuracy":"87.3"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2211.06612","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.06612"}},"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/ZyeZhang/DaC","reach":{"status":"ok","spdx":"GPL-3.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fenghz/cosda","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zyezhang/dac","reach":{"status":"ok","spdx":"GPL-3.0"}}],"summary":{"ran":5,"ran_draft_wrong":2,"unverified":11},"by_repo_kind":{"official":{"samples":15,"ran":7,"repositories":1},"listed":{"samples":3,"ran":0,"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":15,"samples":[{"code_sha256_prefix":"069df2d4fa215e25","entry":"ImageList_test","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"069df2d4fa215e25"}},{"code_sha256_prefix":"2a74a19eebc34f29","entry":"ImageList_train","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"2a74a19eebc34f29"}},{"code_sha256_prefix":"6cae9d73baff6f3b","entry":"MB","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"6cae9d73baff6f3b"}},{"code_sha256_prefix":"2c15973eb571a851","entry":"MemoryBank","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"2c15973eb571a851"}},{"code_sha256_prefix":"93b530743eff0c43","entry":"feat_bootleneck","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"93b530743eff0c43"}},{"code_sha256_prefix":"b7e334f5e0eb5920","entry":"lr_scheduler","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"b7e334f5e0eb5920"}},{"code_sha256_prefix":"770bd4ff7a230add","entry":"mb","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"770bd4ff7a230add"}},{"code_sha256_prefix":"c9c5025b02609986","entry":"ImageNetPolicy","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"c9c5025b02609986"}},{"code_sha256_prefix":"a98c6f5569a6791f","entry":"SubPolicy","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"a98c6f5569a6791f"}},{"code_sha256_prefix":"bd79f7cd617a9c3c","entry":"cal_acc","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"bd79f7cd617a9c3c"}},{"code_sha256_prefix":"d7c23e7e0e1b671b","entry":"dac_train","repo":"fenghz/cosda","repo_kind":"listed","path":"train/dac/dac.py","file_url":"https://github.com/fenghz/cosda/blob/HEAD/train/dac/dac.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d7c23e7e0e1b671b"}},{"code_sha256_prefix":"bce26a57a93cddbb","entry":"data_load","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"bce26a57a93cddbb"}},{"code_sha256_prefix":"aeaf277ab7f6d86e","entry":"eval_initial","repo":"fenghz/cosda","repo_kind":"listed","path":"train/dac/dac.py","file_url":"https://github.com/fenghz/cosda/blob/HEAD/train/dac/dac.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"aeaf277ab7f6d86e"}},{"code_sha256_prefix":"a27e3ff9f9e538f6","entry":"eval_initial","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"a27e3ff9f9e538f6"}},{"code_sha256_prefix":"cd55b45f072d883a","entry":"image_train","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"cd55b45f072d883a"}},{"code_sha256_prefix":"74c402a1775f70fe","entry":"obtain_label","repo":"fenghz/cosda","repo_kind":"listed","path":"train/dac/dac.py","file_url":"https://github.com/fenghz/cosda/blob/HEAD/train/dac/dac.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"74c402a1775f70fe"}},{"code_sha256_prefix":"5b707a834ab0fd28","entry":"obtain_label","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"5b707a834ab0fd28"}},{"code_sha256_prefix":"1490acffabac55ec","entry":"train_target","repo":"zyezhang/dac","repo_kind":"official","path":"VisDA/target.py","file_url":"https://github.com/zyezhang/dac/blob/HEAD/VisDA/target.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"1490acffabac55ec"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}