{"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/unip-rethinking-pre-trained-attention","title":"UNIP: Rethinking Pre-trained Attention Patterns for Infrared Semantic Segmentation","arxiv_id":"2502.02257","date":"2025-02-04","proceeding":null,"authors":["Tao Zhang","Jinyong Wen","Zhen Chen","Kun Ding","Shiming Xiang","Chunhong Pan"],"abstract":"Pre-training techniques significantly enhance the performance of semantic segmentation tasks with limited training data. However, the efficacy under a large domain gap between pre-training (e.g. RGB) and fine-tuning (e.g. infrared) remains underexplored. In this study, we first benchmark the infrared semantic segmentation performance of various pre-training methods and reveal several phenomena distinct from the RGB domain. Next, our layerwise analysis of pre-trained attention maps uncovers that: (1) There are three typical attention patterns (local, hybrid, and global); (2) Pre-training tasks notably influence the pattern distribution across layers; (3) The hybrid pattern is crucial for semantic segmentation as it attends to both nearby and foreground elements; (4) The texture bias impedes model generalization in infrared tasks. Building on these insights, we propose UNIP, a UNified Infrared Pre-training framework, to enhance the pre-trained model performance. This framework uses the hybrid-attention distillation NMI-HAD as the pre-training target, a large-scale mixed dataset InfMix for pre-training, and a last-layer feature pyramid network LL-FPN for fine-tuning. Experimental results show that UNIP outperforms various pre-training methods by up to 13.5\\% in average mIoU on three infrared segmentation tasks, evaluated using fine-tuning and linear probing metrics. UNIP-S achieves performance on par with MAE-L while requiring only 1/10 of the computational cost. Furthermore, UNIP significantly surpasses state-of-the-art (SOTA) infrared or RGB segmentation methods and demonstrates broad potential for application in other modalities, such as RGB and depth. Our code is available at https://github.com/casiatao/UNIP.","url_abs":"https://arxiv.org/abs/2502.02257v1","url_pdf":"https://arxiv.org/pdf/2502.02257v1.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":"unip-rethinking-pre-trained-attention","repo_url":"https://github.com/casiatao/unip","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2502.02257","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.02257"}},"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/casiatao/UNIP","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/casiatao/unip","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":2,"ran_honours":1,"unverified":2},"by_repo_kind":{"official":{"samples":5,"ran":3,"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":5,"samples":[{"code_sha256_prefix":"7070415ec38f0594","entry":"Block","repo":"casiatao/unip","repo_kind":"official","path":"UNIP_pretraining/models_unip.py","file_url":"https://github.com/casiatao/unip/blob/HEAD/UNIP_pretraining/models_unip.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7070415ec38f0594"}},{"code_sha256_prefix":"47c9fdd42ab85cff","entry":"PatchEmbed","repo":"casiatao/unip","repo_kind":"official","path":"UNIP_pretraining/models_unip.py","file_url":"https://github.com/casiatao/unip/blob/HEAD/UNIP_pretraining/models_unip.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"47c9fdd42ab85cff"}},{"code_sha256_prefix":"13358844a2bd12b8","entry":"get_2d_sincos_pos_embed","repo":"casiatao/unip","repo_kind":"official","path":"UNIP_pretraining/models_unip.py","file_url":"https://github.com/casiatao/unip/blob/HEAD/UNIP_pretraining/models_unip.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"13358844a2bd12b8"}},{"code_sha256_prefix":"62f8d24046ec4b54","entry":"Attention","repo":"casiatao/unip","repo_kind":"official","path":"UNIP_pretraining/models_unip.py","file_url":"https://github.com/casiatao/unip/blob/HEAD/UNIP_pretraining/models_unip.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"62f8d24046ec4b54"}},{"code_sha256_prefix":"b548f9addce17a54","entry":"UNIP","repo":"casiatao/unip","repo_kind":"official","path":"UNIP_pretraining/models_unip.py","file_url":"https://github.com/casiatao/unip/blob/HEAD/UNIP_pretraining/models_unip.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"b548f9addce17a54"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}