{"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/dense-cross-query-and-support-attention","title":"Dense Cross-Query-and-Support Attention Weighted Mask Aggregation for Few-Shot Segmentation","arxiv_id":"2207.08549","date":"2022-07-18","proceeding":null,"authors":["Xinyu Shi","Dong Wei","Yu Zhang","Donghuan Lu","Munan Ning","Jiashun Chen","Kai Ma","Yefeng Zheng"],"abstract":"Research into Few-shot Semantic Segmentation (FSS) has attracted great attention, with the goal to segment target objects in a query image given only a few annotated support images of the target class. A key to this challenging task is to fully utilize the information in the support images by exploiting fine-grained correlations between the query and support images. However, most existing approaches either compressed the support information into a few class-wise prototypes, or used partial support information (e.g., only foreground) at the pixel level, causing non-negligible information loss. In this paper, we propose Dense pixel-wise Cross-query-and-support Attention weighted Mask Aggregation (DCAMA), where both foreground and background support information are fully exploited via multi-level pixel-wise correlations between paired query and support features. Implemented with the scaled dot-product attention in the Transformer architecture, DCAMA treats every query pixel as a token, computes its similarities with all support pixels, and predicts its segmentation label as an additive aggregation of all the support pixels' labels -- weighted by the similarities. Based on the unique formulation of DCAMA, we further propose efficient and effective one-pass inference for n-shot segmentation, where pixels of all support images are collected for the mask aggregation at once. Experiments show that our DCAMA significantly advances the state of the art on standard FSS benchmarks of PASCAL-5i, COCO-20i, and FSS-1000, e.g., with 3.1%, 9.7%, and 3.6% absolute improvements in 1-shot mIoU over previous best records. Ablative studies also verify the design DCAMA.","url_abs":"https://arxiv.org/abs/2207.08549v1","url_pdf":"https://arxiv.org/pdf/2207.08549v1.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":"dense-cross-query-and-support-attention","repo_url":"https://github.com/pawn-sxy/dcama","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"few-shot-image-segmentation","task_name":"Few-Shot Semantic Segmentation"},{"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":[{"leaderboard":"/sota/few-shot-semantic-segmentation-on-coco-20i-1","task":"Few-Shot Semantic Segmentation","dataset":"COCO-20i (1-shot)","model":"DCAMA (Swin-B)","rank_in_archive_order":9,"of":85,"metrics":{"FB-IoU":"73.2","Mean IoU":"50.9"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-coco-20i-1","task":"Few-Shot Semantic Segmentation","dataset":"COCO-20i (1-shot)","model":"DCAMA (ResNet-101)","rank_in_archive_order":42,"of":85,"metrics":{"FB-IoU":"69.9","Mean IoU":"43.5","learnable parameters (million)":"47.7"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-coco-20i-1","task":"Few-Shot Semantic Segmentation","dataset":"COCO-20i (1-shot)","model":"DCAMA (ResNet-50)","rank_in_archive_order":43,"of":85,"metrics":{"FB-IoU":"69.5","Mean IoU":"43.3"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-coco-20i-2-1","task":"Few-Shot Semantic Segmentation","dataset":"COCO-20i (2-way 1-shot)","model":"DCAMA (Swin-B)","rank_in_archive_order":3,"of":6,"metrics":{"mIoU":"31.7"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-coco-20i-5","task":"Few-Shot Semantic Segmentation","dataset":"COCO-20i (5-shot)","model":"DCAMA (Swin-B)","rank_in_archive_order":8,"of":81,"metrics":{"FB-IoU":"76.9","Mean IoU":"58.3"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-coco-20i-5","task":"Few-Shot Semantic Segmentation","dataset":"COCO-20i (5-shot)","model":"DCAMA (ResNet-101)","rank_in_archive_order":28,"of":81,"metrics":{"FB-IoU":"73.3","Mean IoU":"51.9","learnable parameters (million)":"47.7"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-coco-20i-5","task":"Few-Shot Semantic Segmentation","dataset":"COCO-20i (5-shot)","model":"DCAMA (ResNet-50)","rank_in_archive_order":48,"of":81,"metrics":{"FB-IoU":"71.7","Mean IoU":"48.3","learnable parameters (million)":"47.7"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-fss-1000-1","task":"Few-Shot Semantic Segmentation","dataset":"FSS-1000 (1-shot)","model":"DCAMA (Swin-B)","rank_in_archive_order":7,"of":24,"metrics":{"FB-IoU":"93.8","Mean IoU":"90.1"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-fss-1000-1","task":"Few-Shot Semantic Segmentation","dataset":"FSS-1000 (1-shot)","model":"DCAMA (ResNet-101)","rank_in_archive_order":11,"of":24,"metrics":{"FB-IoU":"92.4","Mean IoU":"88.3"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-fss-1000-1","task":"Few-Shot Semantic Segmentation","dataset":"FSS-1000 (1-shot)","model":"DCAMA (ResNet-50)","rank_in_archive_order":12,"of":24,"metrics":{"FB-IoU":"92.5","Mean IoU":"88.2"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-fss-1000-5","task":"Few-Shot Semantic Segmentation","dataset":"FSS-1000 (5-shot)","model":"DCAMA (Swin-B)","rank_in_archive_order":7,"of":22,"metrics":{"FB-IoU":"94.1","Mean IoU":"90.4"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-fss-1000-5","task":"Few-Shot Semantic Segmentation","dataset":"FSS-1000 (5-shot)","model":"DCAMA (ResNet-101)","rank_in_archive_order":10,"of":22,"metrics":{"FB-IoU":"93.1","Mean IoU":"89.1"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-fss-1000-5","task":"Few-Shot Semantic Segmentation","dataset":"FSS-1000 (5-shot)","model":"DCAMA (ResNet-50)","rank_in_archive_order":12,"of":22,"metrics":{"FB-IoU":"92.9","Mean IoU":"88.8"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-pascal-5i-1","task":"Few-Shot Semantic Segmentation","dataset":"PASCAL-5i (1-Shot)","model":"DCAMA (Swin-B)","rank_in_archive_order":11,"of":105,"metrics":{"FB-IoU":"78.5","Mean IoU":"69.3"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-pascal-5i-1","task":"Few-Shot Semantic Segmentation","dataset":"PASCAL-5i (1-Shot)","model":"DCAMA (ResNet-50)","rank_in_archive_order":56,"of":105,"metrics":{"FB-IoU":"75.7","Mean IoU":"64.6"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-pascal-5i-1","task":"Few-Shot Semantic Segmentation","dataset":"PASCAL-5i (1-Shot)","model":"DCAMA (ResNet-101)","rank_in_archive_order":105,"of":105,"metrics":{"FB-IoU":"77.6"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-pascal-5i-5","task":"Few-Shot Semantic Segmentation","dataset":"PASCAL-5i (5-Shot)","model":"DCAMA (Swin-B)","rank_in_archive_order":7,"of":96,"metrics":{"FB-IoU":"82.9","Mean IoU":"74.9"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-pascal-5i-5","task":"Few-Shot Semantic Segmentation","dataset":"PASCAL-5i (5-Shot)","model":"DCAMA (ResNet-50)","rank_in_archive_order":54,"of":96,"metrics":{"FB-IoU":"79.5","Mean IoU":"68.5"},"uses_additional_data":false},{"leaderboard":"/sota/few-shot-semantic-segmentation-on-pascal-5i-5","task":"Few-Shot Semantic Segmentation","dataset":"PASCAL-5i (5-Shot)","model":"DCAMA (ResNet-101)","rank_in_archive_order":56,"of":96,"metrics":{"FB-IoU":"80.8","Mean IoU":"68.3"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2207.08549","atlas_url":"https://app.syntology.ai/?focus=2207.08549","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.08549"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/pawn-sxy/dcama","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/pawn-sxy/DCAMA","reach":{"status":"ok"}}],"summary":{"ran":2,"ran_draft_wrong":2,"unverified":1},"by_repo_kind":{"official":{"samples":5,"ran":4,"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":"5385d0ed2b350edf","entry":"MultiHeadedAttention","repo":"pawn-sxy/DCAMA","repo_kind":"official","path":"model/DCAMA.py","file_url":"https://github.com/pawn-sxy/DCAMA/blob/HEAD/model/DCAMA.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":"5385d0ed2b350edf"}},{"code_sha256_prefix":"760d230fe439888d","entry":"PositionalEncoding","repo":"pawn-sxy/DCAMA","repo_kind":"official","path":"model/DCAMA.py","file_url":"https://github.com/pawn-sxy/DCAMA/blob/HEAD/model/DCAMA.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":"760d230fe439888d"}},{"code_sha256_prefix":"b008136cddaa0337","entry":"attention","repo":"pawn-sxy/DCAMA","repo_kind":"official","path":"model/DCAMA.py","file_url":"https://github.com/pawn-sxy/DCAMA/blob/HEAD/model/DCAMA.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b008136cddaa0337"}},{"code_sha256_prefix":"84ee72bc513b03f8","entry":"clones","repo":"pawn-sxy/DCAMA","repo_kind":"official","path":"model/DCAMA.py","file_url":"https://github.com/pawn-sxy/DCAMA/blob/HEAD/model/DCAMA.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"84ee72bc513b03f8"}},{"code_sha256_prefix":"473fee9a518784e2","entry":"DCAMA_model","repo":"pawn-sxy/DCAMA","repo_kind":"official","path":"model/DCAMA.py","file_url":"https://github.com/pawn-sxy/DCAMA/blob/HEAD/model/DCAMA.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":"473fee9a518784e2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}