{"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/affinity-attention-graph-neural-network-for","title":"Affinity Attention Graph Neural Network for Weakly Supervised Semantic Segmentation","arxiv_id":"2106.04054","date":"2021-06-08","proceeding":null,"authors":["Bingfeng Zhang","Jimin Xiao","Jianbo Jiao","Yunchao Wei","Yao Zhao"],"abstract":"Weakly supervised semantic segmentation is receiving great attention due to its low human annotation cost. In this paper, we aim to tackle bounding box supervised semantic segmentation, i.e., training accurate semantic segmentation models using bounding box annotations as supervision. To this end, we propose Affinity Attention Graph Neural Network ($A^2$GNN). Following previous practices, we first generate pseudo semantic-aware seeds, which are then formed into semantic graphs based on our newly proposed affinity Convolutional Neural Network (CNN). Then the built graphs are input to our $A^2$GNN, in which an affinity attention layer is designed to acquire the short- and long- distance information from soft graph edges to accurately propagate semantic labels from the confident seeds to the unlabeled pixels. However, to guarantee the precision of the seeds, we only adopt a limited number of confident pixel seed labels for $A^2$GNN, which may lead to insufficient supervision for training. To alleviate this issue, we further introduce a new loss function and a consistency-checking mechanism to leverage the bounding box constraint, so that more reliable guidance can be included for the model optimization. Experiments show that our approach achieves new state-of-the-art performances on Pascal VOC 2012 datasets (val: 76.5\\%, test: 75.2\\%). More importantly, our approach can be readily applied to bounding box supervised instance segmentation task or other weakly supervised semantic segmentation tasks, with state-of-the-art or comparable performance among almot all weakly supervised tasks on PASCAL VOC or COCO dataset. Our source code will be available at https://github.com/zbf1991/A2GNN.","url_abs":"https://arxiv.org/abs/2106.04054v1","url_pdf":"https://arxiv.org/pdf/2106.04054v1.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":"affinity-attention-graph-neural-network-for","repo_url":"https://github.com/zbf1991/A2GNN","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"box-supervised-instance-segmentation","task_name":"Box-supervised Instance Segmentation"},{"task_slug":"graph-neural-network","task_name":"Graph Neural Network"},{"task_slug":"instance-segmentation","task_name":"Instance Segmentation"},{"task_slug":"model-optimization","task_name":"Model Optimization"},{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"weakly-supervised-semantic-segmentation-1","task_name":"Weakly supervised Semantic Segmentation"},{"task_slug":"weakly-supervised-semantic-segmentation","task_name":"Weakly-Supervised Semantic Segmentation"}],"methods":[{"method_slug":"graph-neural-network","method_name":"Graph Neural Network"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2106.04054","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.04054"}},"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/zbf1991/A2GNN","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":4},"by_repo_kind":{"official":{"samples":4,"ran":0,"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":"5923609f4e3abca6","entry":"box_mil_loss","repo":"zbf1991/A2GNN","repo_kind":"official","path":"mytool.py","file_url":"https://github.com/zbf1991/A2GNN/blob/HEAD/mytool.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":"5923609f4e3abca6"}},{"code_sha256_prefix":"cbf674333d6a35ea","entry":"box_mp_loss_with_consistency_checking","repo":"zbf1991/A2GNN","repo_kind":"official","path":"mytool.py","file_url":"https://github.com/zbf1991/A2GNN/blob/HEAD/mytool.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":"cbf674333d6a35ea"}},{"code_sha256_prefix":"95dfca01d7656b7c","entry":"convert_mxnet_to_torch","repo":"zbf1991/A2GNN","repo_kind":"official","path":"network/resnet38d.py","file_url":"https://github.com/zbf1991/A2GNN/blob/HEAD/network/resnet38d.py","link_basis":"harvester_set","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":"95dfca01d7656b7c"}},{"code_sha256_prefix":"f5d28e4a72b09ed9","entry":"read_xml_annotation","repo":"zbf1991/A2GNN","repo_kind":"official","path":"mytool.py","file_url":"https://github.com/zbf1991/A2GNN/blob/HEAD/mytool.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":"f5d28e4a72b09ed9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}