{"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/prior-knowledge-guided-unsupervised-domain","title":"Prior Knowledge Guided Unsupervised Domain Adaptation","arxiv_id":"2207.08877","date":"2022-07-18","proceeding":null,"authors":["Tao Sun","Cheng Lu","Haibin Ling"],"abstract":"The waive of labels in the target domain makes Unsupervised Domain Adaptation (UDA) an attractive technique in many real-world applications, though it also brings great challenges as model adaptation becomes harder without labeled target data. In this paper, we address this issue by seeking compensation from target domain prior knowledge, which is often (partially) available in practice, e.g., from human expertise. This leads to a novel yet practical setting where in addition to the training data, some prior knowledge about the target class distribution are available. We term the setting as Knowledge-guided Unsupervised Domain Adaptation (KUDA). In particular, we consider two specific types of prior knowledge about the class distribution in the target domain: Unary Bound that describes the lower and upper bounds of individual class probabilities, and Binary Relationship that describes the relations between two class probabilities. We propose a general rectification module that uses such prior knowledge to refine model generated pseudo labels. The module is formulated as a Zero-One Programming problem derived from the prior knowledge and a smooth regularizer. It can be easily plugged into self-training based UDA methods, and we combine it with two state-of-the-art methods, SHOT and DINE. Empirical results on four benchmarks confirm that the rectification module clearly improves the quality of pseudo labels, which in turn benefits the self-training stage. With the guidance from prior knowledge, the performances of both methods are substantially boosted. We expect our work to inspire further investigations in integrating prior knowledge in UDA. Code is available at https://github.com/tsun/KUDA.","url_abs":"https://arxiv.org/abs/2207.08877v1","url_pdf":"https://arxiv.org/pdf/2207.08877v1.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":"prior-knowledge-guided-unsupervised-domain","repo_url":"https://github.com/tsun/kuda","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"unsupervised-domain-adaptation","task_name":"Unsupervised Domain Adaptation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.08877","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.08877"}},"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/tsun/kuda","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/tsun/KUDA","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":5,"ran_fixture":3,"ran_honours":2,"unverified":3},"by_repo_kind":{"official":{"samples":13,"ran":10,"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":"94b5622f0aa7add1","entry":"Entropy","repo":"tsun/KUDA","repo_kind":"official","path":"DINE/loss.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/DINE/loss.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"94b5622f0aa7add1"}},{"code_sha256_prefix":"815f704e5efd8345","entry":"ShearX","repo":"tsun/KUDA","repo_kind":"official","path":"SHOT/augmentations.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/SHOT/augmentations.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"815f704e5efd8345"}},{"code_sha256_prefix":"f5e3179cafd9393a","entry":"ShearY","repo":"tsun/KUDA","repo_kind":"official","path":"SHOT/augmentations.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/SHOT/augmentations.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f5e3179cafd9393a"}},{"code_sha256_prefix":"b2893a9a2ac1188f","entry":"TranslateX","repo":"tsun/KUDA","repo_kind":"official","path":"SHOT/augmentations.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/SHOT/augmentations.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b2893a9a2ac1188f"}},{"code_sha256_prefix":"9768efb52f591b55","entry":"grl_hook","repo":"tsun/KUDA","repo_kind":"official","path":"SHOT/loss.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/SHOT/loss.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9768efb52f591b55"}},{"code_sha256_prefix":"35c2d572ebd185f5","entry":"image_train","repo":"tsun/KUDA","repo_kind":"official","path":"DINE/DINE_dist.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/DINE/DINE_dist.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"35c2d572ebd185f5"}},{"code_sha256_prefix":"edd7184ac144c4fa","entry":"l_loader","repo":"tsun/KUDA","repo_kind":"official","path":"DINE/data_list.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/DINE/data_list.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"edd7184ac144c4fa"}},{"code_sha256_prefix":"0b7ffc9f8b77529c","entry":"lr_scheduler","repo":"tsun/KUDA","repo_kind":"official","path":"DINE/DINE_dist.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/DINE/DINE_dist.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0b7ffc9f8b77529c"}},{"code_sha256_prefix":"93a11f62e4a129f0","entry":"op_copy","repo":"tsun/KUDA","repo_kind":"official","path":"DINE/DINE_dist.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/DINE/DINE_dist.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":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"93a11f62e4a129f0"}},{"code_sha256_prefix":"2c5ce24ea2b5d2a4","entry":"rgb_loader","repo":"tsun/KUDA","repo_kind":"official","path":"DINE/data_list.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/DINE/data_list.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c5ce24ea2b5d2a4"}},{"code_sha256_prefix":"e4ed2051ad0f8c9f","entry":"PK_loss","repo":"tsun/KUDA","repo_kind":"official","path":"SHOT/loss.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/SHOT/loss.py","link_basis":"harvester_set","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":"e4ed2051ad0f8c9f"}},{"code_sha256_prefix":"e352afa5762c5a6b","entry":"calc_coeff","repo":"tsun/KUDA","repo_kind":"official","path":"SHOT/network.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/SHOT/network.py","link_basis":"harvester_set","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":"e352afa5762c5a6b"}},{"code_sha256_prefix":"2301055cb33836bc","entry":"make_dataset","repo":"tsun/KUDA","repo_kind":"official","path":"DINE/data_list.py","file_url":"https://github.com/tsun/KUDA/blob/HEAD/DINE/data_list.py","link_basis":"harvester_set","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":"2301055cb33836bc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}