{"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/adapt-before-comparison-a-new-perspective-on","title":"Adapt Before Comparison: A New Perspective on Cross-Domain Few-Shot Segmentation","arxiv_id":"2402.17614","date":"2024-02-27","proceeding":"CVPR 2024 1","authors":["Jonas Herzog"],"abstract":"Few-shot segmentation performance declines substantially when facing images from a domain different than the training domain, effectively limiting real-world use cases. To alleviate this, recently cross-domain few-shot segmentation (CD-FSS) has emerged. Works that address this task mainly attempted to learn segmentation on a source domain in a manner that generalizes across domains. Surprisingly, we can outperform these approaches while eliminating the training stage and removing their main segmentation network. We show test-time task-adaption is the key for successful CD-FSS instead. Task-adaption is achieved by appending small networks to the feature pyramid of a conventionally classification-pretrained backbone. To avoid overfitting to the few labeled samples in supervised fine-tuning, consistency across augmented views of input images serves as guidance while learning the parameters of the attached layers. Despite our self-restriction not to use any images other than the few labeled samples at test time, we achieve new state-of-the-art performance in CD-FSS, evidencing the need to rethink approaches for the task.","url_abs":"https://arxiv.org/abs/2402.17614v2","url_pdf":"https://arxiv.org/pdf/2402.17614v2.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":"adapt-before-comparison-a-new-perspective-on","repo_url":"https://github.com/vision-kek/abcdfss","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"cross-domain-few-shot","task_name":"Cross-Domain Few-Shot"},{"task_slug":"segmentation","task_name":"Segmentation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.17614","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.17614"}},"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/vision-kek/abcdfss","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/Vision-Kek/ABCDFSS","reach":{"status":"ok"}}],"summary":{"ran_fixture":6,"ran":9,"ran_honours":2,"unverified":6},"by_repo_kind":{"official":{"samples":23,"ran":17,"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":23,"samples":[{"code_sha256_prefix":"c2fb89e36a52d3fc","entry":"buildDenseAffinityMat","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","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":"c2fb89e36a52d3fc"}},{"code_sha256_prefix":"247da38da9e3d69a","entry":"buildHyperCol","repo":"vision-kek/abcdfss","repo_kind":"official","path":"core/denseaffinity.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/core/denseaffinity.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":"247da38da9e3d69a"}},{"code_sha256_prefix":"5cfd57e7b81664c4","entry":"calc_q_pred_coarse_nodetach","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","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":"5cfd57e7b81664c4"}},{"code_sha256_prefix":"fb5084bdcc8fef8d","entry":"ctrstive_prototype_loss","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fb5084bdcc8fef8d"}},{"code_sha256_prefix":"1741736a8a12800e","entry":"fg_bg_proto","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","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":"1741736a8a12800e"}},{"code_sha256_prefix":"c5166df90ef9cdfd","entry":"filterDenseAffinityMap","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","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":"c5166df90ef9cdfd"}},{"code_sha256_prefix":"a813ee834ec01f6f","entry":"fwd_pass_support_imgs","repo":"vision-kek/abcdfss","repo_kind":"official","path":"utils/crfhelper.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/utils/crfhelper.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":"a813ee834ec01f6f"}},{"code_sha256_prefix":"0f163b1b99bd0b94","entry":"iou","repo":"vision-kek/abcdfss","repo_kind":"official","path":"utils/segutils.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/utils/segutils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f163b1b99bd0b94"}},{"code_sha256_prefix":"4a96ac238387e631","entry":"keep_var_loss","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4a96ac238387e631"}},{"code_sha256_prefix":"2fbd545597570f15","entry":"mean","repo":"vision-kek/abcdfss","repo_kind":"official","path":"utils/commonutils.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/utils/commonutils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2fbd545597570f15"}},{"code_sha256_prefix":"e70e62a8a6c5e6bc","entry":"otsus","repo":"vision-kek/abcdfss","repo_kind":"official","path":"utils/segutils.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/utils/segutils.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":"e70e62a8a6c5e6bc"}},{"code_sha256_prefix":"0f6e6c300830147d","entry":"paste_supports_together","repo":"vision-kek/abcdfss","repo_kind":"official","path":"core/denseaffinity.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/core/denseaffinity.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f6e6c300830147d"}},{"code_sha256_prefix":"4fb5d5624f290f81","entry":"self_attention_loss","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4fb5d5624f290f81"}},{"code_sha256_prefix":"7fa435cfd75709ec","entry":"ssim","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7fa435cfd75709ec"}},{"code_sha256_prefix":"48c15e26ae8b5ded","entry":"tensor_table","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.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":"48c15e26ae8b5ded"}},{"code_sha256_prefix":"a3d18d17a48bf937","entry":"to_cpu","repo":"vision-kek/abcdfss","repo_kind":"official","path":"utils/commonutils.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/utils/commonutils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a3d18d17a48bf937"}},{"code_sha256_prefix":"8c6947459806ae3b","entry":"to_cuda","repo":"vision-kek/abcdfss","repo_kind":"official","path":"utils/commonutils.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/utils/commonutils.py","link_basis":"harvester_set","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":"8c6947459806ae3b"}},{"code_sha256_prefix":"702cac538a6b1126","entry":"ContrastiveFeatureTransformer","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.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":"702cac538a6b1126"}},{"code_sha256_prefix":"473b271bb4fd5296","entry":"augwise_proto","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.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":"473b271bb4fd5296"}},{"code_sha256_prefix":"bece7c16c70daa1d","entry":"dense_info_nce_loss","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.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":"bece7c16c70daa1d"}},{"code_sha256_prefix":"216eb9d7ff602b2d","entry":"get_augmentations_and_features","repo":"vision-kek/abcdfss","repo_kind":"official","path":"utils/crfhelper.py","file_url":"https://github.com/vision-kek/abcdfss/blob/HEAD/utils/crfhelper.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":"216eb9d7ff602b2d"}},{"code_sha256_prefix":"2f9961a082f7c62b","entry":"opposite_proto_sim_in_aug","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.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":"2f9961a082f7c62b"}},{"code_sha256_prefix":"d8b49e0930bd1b01","entry":"proto_align_val_measure","repo":"Vision-Kek/ABCDFSS","repo_kind":"official","path":"core/contrastivehead.py","file_url":"https://github.com/Vision-Kek/ABCDFSS/blob/HEAD/core/contrastivehead.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":"d8b49e0930bd1b01"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}