{"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/a-simple-image-segmentation-framework-via-in","title":"A Simple Image Segmentation Framework via In-Context Examples","arxiv_id":"2410.04842","date":"2024-10-07","proceeding":null,"authors":["Yang Liu","Chenchen Jing","Hengtao Li","Muzhi Zhu","Hao Chen","Xinlong Wang","Chunhua Shen"],"abstract":"Recently, there have been explorations of generalist segmentation models that can effectively tackle a variety of image segmentation tasks within a unified in-context learning framework. However, these methods still struggle with task ambiguity in in-context segmentation, as not all in-context examples can accurately convey the task information. In order to address this issue, we present SINE, a simple image Segmentation framework utilizing in-context examples. Our approach leverages a Transformer encoder-decoder structure, where the encoder provides high-quality image representations, and the decoder is designed to yield multiple task-specific output masks to effectively eliminate task ambiguity. Specifically, we introduce an In-context Interaction module to complement in-context information and produce correlations between the target image and the in-context example and a Matching Transformer that uses fixed matching and a Hungarian algorithm to eliminate differences between different tasks. In addition, we have further perfected the current evaluation system for in-context image segmentation, aiming to facilitate a holistic appraisal of these models. Experiments on various segmentation tasks show the effectiveness of the proposed method.","url_abs":"https://arxiv.org/abs/2410.04842v2","url_pdf":"https://arxiv.org/pdf/2410.04842v2.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":"a-simple-image-segmentation-framework-via-in","repo_url":"https://github.com/aim-uofa/sine","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}}],"tasks":[{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"image-segmentation","task_name":"Image Segmentation"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.04842","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.04842"}},"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/aim-uofa/SINE","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/aim-uofa/sine","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"ran":6,"ran_honours":1,"unverified":4},"by_repo_kind":{"official":{"samples":11,"ran":7,"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":11,"samples":[{"code_sha256_prefix":"1666068b54bd01a0","entry":"all_gather","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/utils/comm.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/utils/comm.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":"1666068b54bd01a0"}},{"code_sha256_prefix":"d50eb3fbba28dbbf","entry":"dice_loss","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/model/criterion.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/model/criterion.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"d50eb3fbba28dbbf"}},{"code_sha256_prefix":"18bde1ccecf78eba","entry":"gather","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/utils/comm.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/utils/comm.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":"18bde1ccecf78eba"}},{"code_sha256_prefix":"ded3458cc8c21f23","entry":"get_classification_logits","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/model/transformer_decoder/mformer.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/model/transformer_decoder/mformer.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":"ded3458cc8c21f23"}},{"code_sha256_prefix":"53838c15d969eb79","entry":"reduce_dict","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/utils/comm.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/utils/comm.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":"53838c15d969eb79"}},{"code_sha256_prefix":"7130af6c2979dba8","entry":"sigmoid_ce_loss","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/model/criterion.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/model/criterion.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7130af6c2979dba8"}},{"code_sha256_prefix":"87e36ec29dea3d10","entry":"trivial_batch_collator","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/utils/utils.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/utils/utils.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"87e36ec29dea3d10"}},{"code_sha256_prefix":"bc2cb481a75c370d","entry":"batch_dice_loss","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/model/matcher.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/model/matcher.py","link_basis":"harvester_set","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":"bc2cb481a75c370d"}},{"code_sha256_prefix":"1edd24985036b0bf","entry":"batch_sigmoid_ce_loss","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/model/matcher.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/model/matcher.py","link_basis":"harvester_set","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":"1edd24985036b0bf"}},{"code_sha256_prefix":"2dcb8123d89bb1ff","entry":"calculate_uncertainty","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/model/criterion.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/model/criterion.py","link_basis":"harvester_set","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":"2dcb8123d89bb1ff"}},{"code_sha256_prefix":"58cc9ff3bf75e753","entry":"nested_tensor_from_tensor_list","repo":"aim-uofa/SINE","repo_kind":"official","path":"sine/utils/misc.py","file_url":"https://github.com/aim-uofa/SINE/blob/HEAD/sine/utils/misc.py","link_basis":"harvester_set","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":"58cc9ff3bf75e753"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}