{"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/bridge-the-points-graph-based-few-shot","title":"Bridge the Points: Graph-based Few-shot Segment Anything Semantically","arxiv_id":"2410.06964","date":"2024-10-09","proceeding":null,"authors":["Anqi Zhang","Guangyu Gao","Jianbo Jiao","Chi Harold Liu","Yunchao Wei"],"abstract":"The recent advancements in large-scale pre-training techniques have significantly enhanced the capabilities of vision foundation models, notably the Segment Anything Model (SAM), which can generate precise masks based on point and box prompts. Recent studies extend SAM to Few-shot Semantic Segmentation (FSS), focusing on prompt generation for SAM-based automatic semantic segmentation. However, these methods struggle with selecting suitable prompts, require specific hyperparameter settings for different scenarios, and experience prolonged one-shot inference times due to the overuse of SAM, resulting in low efficiency and limited automation ability. To address these issues, we propose a simple yet effective approach based on graph analysis. In particular, a Positive-Negative Alignment module dynamically selects the point prompts for generating masks, especially uncovering the potential of the background context as the negative reference. Another subsequent Point-Mask Clustering module aligns the granularity of masks and selected points as a directed graph, based on mask coverage over points. These points are then aggregated by decomposing the weakly connected components of the directed graph in an efficient manner, constructing distinct natural clusters. Finally, the positive and overshooting gating, benefiting from graph-based granularity alignment, aggregate high-confident masks and filter out the false-positive masks for final prediction, reducing the usage of additional hyperparameters and redundant mask generation. Extensive experimental analysis across standard FSS, One-shot Part Segmentation, and Cross Domain FSS datasets validate the effectiveness and efficiency of the proposed approach, surpassing state-of-the-art generalist models with a mIoU of 58.7% on COCO-20i and 35.2% on LVIS-92i. The code is available in https://andyzaq.github.io/GF-SAM/.","url_abs":"https://arxiv.org/abs/2410.06964v2","url_pdf":"https://arxiv.org/pdf/2410.06964v2.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":"bridge-the-points-graph-based-few-shot","repo_url":"https://github.com/ANDYZAQ/GF-SAM","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"few-shot-image-segmentation","task_name":"Few-Shot Semantic Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"dino","method_name":"DINO"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"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":"residual-connection","method_name":"Residual Connection"},{"method_slug":"sam","method_name":"SAM"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"vision-transformer","method_name":"Vision 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":"GF-SAM (DINOv2)","rank_in_archive_order":2,"of":85,"metrics":{"Mean IoU":"58.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":"GF-SAM (DINOv2)","rank_in_archive_order":2,"of":81,"metrics":{"Mean IoU":"66.8"},"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":"GF-SAM (DINOv2)","rank_in_archive_order":13,"of":24,"metrics":{"Mean IoU":"88"},"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":"GF-SAM (DINOv2)","rank_in_archive_order":11,"of":22,"metrics":{"Mean IoU":"88.9"},"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":"GF-SAM (DINOv2)","rank_in_archive_order":5,"of":105,"metrics":{"Mean IoU":"72.1"},"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":"GF-SAM (DINOv2)","rank_in_archive_order":2,"of":96,"metrics":{"Mean IoU":"82.6"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.06964","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.06964"}},"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/ANDYZAQ/GF-SAM","reach":null}],"summary":{"ran":1,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":4,"ran":2,"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":"4d4aaffd0b403a6d","entry":"MaybeToTensor","repo":"ANDYZAQ/GF-SAM","repo_kind":"official","path":"matcher/GFSAM.py","file_url":"https://github.com/ANDYZAQ/GF-SAM/blob/HEAD/matcher/GFSAM.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4d4aaffd0b403a6d"}},{"code_sha256_prefix":"ad3befe6bda5ddf5","entry":"make_normalize_transform","repo":"ANDYZAQ/GF-SAM","repo_kind":"official","path":"matcher/GFSAM.py","file_url":"https://github.com/ANDYZAQ/GF-SAM/blob/HEAD/matcher/GFSAM.py","link_basis":"first_harvest_node","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":"ad3befe6bda5ddf5"}},{"code_sha256_prefix":"c6286467a5a914a4","entry":"GFSAM","repo":"ANDYZAQ/GF-SAM","repo_kind":"official","path":"matcher/GFSAM.py","file_url":"https://github.com/ANDYZAQ/GF-SAM/blob/HEAD/matcher/GFSAM.py","link_basis":"first_harvest_node","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":"c6286467a5a914a4"}},{"code_sha256_prefix":"57dab3bfa3c4491d","entry":"batch_iterator","repo":"ANDYZAQ/GF-SAM","repo_kind":"official","path":"matcher/GFSAM.py","file_url":"https://github.com/ANDYZAQ/GF-SAM/blob/HEAD/matcher/GFSAM.py","link_basis":"first_harvest_node","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":"57dab3bfa3c4491d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}