{"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/complementary-patch-for-weakly-supervised","title":"Complementary Patch for Weakly Supervised Semantic Segmentation","arxiv_id":"2108.03852","date":"2021-08-09","proceeding":"ICCV 2021 10","authors":["Fei Zhang","Chaochen Gu","Chenyue Zhang","Yuchao Dai"],"abstract":"Weakly Supervised Semantic Segmentation (WSSS) based on image-level labels has been greatly advanced by exploiting the outputs of Class Activation Map (CAM) to generate the pseudo labels for semantic segmentation. However, CAM merely discovers seeds from a small number of regions, which may be insufficient to serve as pseudo masks for semantic segmentation. In this paper, we formulate the expansion of object regions in CAM as an increase in information. From the perspective of information theory, we propose a novel Complementary Patch (CP) Representation and prove that the information of the sum of the CAMs by a pair of input images with complementary hidden (patched) parts, namely CP Pair, is greater than or equal to the information of the baseline CAM. Therefore, a CAM with more information related to object seeds can be obtained by narrowing down the gap between the sum of CAMs generated by the CP Pair and the original CAM. We propose a CP Network (CPN) implemented by a triplet network and three regularization functions. To further improve the quality of the CAMs, we propose a Pixel-Region Correlation Module (PRCM) to augment the contextual information by using object-region relations between the feature maps and the CAMs. Experimental results on the PASCAL VOC 2012 datasets show that our proposed method achieves a new state-of-the-art in WSSS, validating the effectiveness of our CP Representation and CPN.","url_abs":"https://arxiv.org/abs/2108.03852v1","url_pdf":"https://arxiv.org/pdf/2108.03852v1.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":"complementary-patch-for-weakly-supervised","repo_url":"https://github.com/Ferenas/CPN","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"segmentation","task_name":"Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":null,"task_name":"Triplet"},{"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":"cam","method_name":"CAM"},{"method_slug":"cpn","method_name":"CPN"},{"method_slug":"convolution","method_name":"Convolution"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/weakly-supervised-semantic-segmentation-on-1","task":"Weakly-Supervised Semantic Segmentation","dataset":"PASCAL VOC 2012 test","model":"CPN","rank_in_archive_order":54,"of":60,"metrics":{"Mean IoU":"68.5"},"uses_additional_data":false},{"leaderboard":"/sota/weakly-supervised-semantic-segmentation-on","task":"Weakly-Supervised Semantic Segmentation","dataset":"PASCAL VOC 2012 val","model":"CPN","rank_in_archive_order":61,"of":73,"metrics":{"Mean IoU":"67.8"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.03852","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.03852"}},"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/Ferenas/CPN","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":1,"ran_draft_wrong":2,"unverified":12},"by_repo_kind":{"official":{"samples":15,"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":0,"samples":[{"code_sha256_prefix":"4c323e44c38f5fb2","entry":"adaptive_min_pooling_loss","repo":"Ferenas/CPN","repo_kind":"official","path":"train_cpn.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/train_cpn.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4c323e44c38f5fb2"}},{"code_sha256_prefix":"4de99c8ad78aceee","entry":"do_python_eval","repo":"Ferenas/CPN","repo_kind":"official","path":"evaluation_cam.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/evaluation_cam.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4de99c8ad78aceee"}},{"code_sha256_prefix":"b2dee97c33d89372","entry":"gap2d","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/torchutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/torchutils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b2dee97c33d89372"}},{"code_sha256_prefix":"40bf8abef0c6e4b2","entry":"affinity_sparse2dense","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/indexing.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/indexing.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":"40bf8abef0c6e4b2"}},{"code_sha256_prefix":"95dfca01d7656b7c","entry":"convert_mxnet_to_torch","repo":"Ferenas/CPN","repo_kind":"official","path":"network/resnet38d.py","file_url":"https://github.com/Ferenas/CPN/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":"d3b122efb6e32fed","entry":"edge_to_affinity","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/indexing.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/indexing.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":"d3b122efb6e32fed"}},{"code_sha256_prefix":"50fe7cd84374ba59","entry":"hide_patch","repo":"Ferenas/CPN","repo_kind":"official","path":"tool/imutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/tool/imutils.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":"50fe7cd84374ba59"}},{"code_sha256_prefix":"4d5584b87aef6565","entry":"hide_patch_ss","repo":"Ferenas/CPN","repo_kind":"official","path":"tool/imutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/tool/imutils.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":"4d5584b87aef6565"}},{"code_sha256_prefix":"94c2437fbb7c88f7","entry":"max_onehot","repo":"Ferenas/CPN","repo_kind":"official","path":"tool/imutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/tool/imutils.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":"94c2437fbb7c88f7"}},{"code_sha256_prefix":"03816bd33ff47d91","entry":"pil_rescale","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/imutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/imutils.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":"03816bd33ff47d91"}},{"code_sha256_prefix":"4e4bdca77f683cf7","entry":"pil_resize","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/imutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/imutils.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":"4e4bdca77f683cf7"}},{"code_sha256_prefix":"802a057433809fc1","entry":"random_resize_long","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/imutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/imutils.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":"802a057433809fc1"}},{"code_sha256_prefix":"8129bde610e5350b","entry":"split_dataset","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/torchutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/torchutils.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":"8129bde610e5350b"}},{"code_sha256_prefix":"fa36a8f1f0a5a428","entry":"to_one_hot","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/pyutils.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/pyutils.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":"fa36a8f1f0a5a428"}},{"code_sha256_prefix":"2d78188bd6f7f6dc","entry":"to_transition_matrix","repo":"Ferenas/CPN","repo_kind":"official","path":"misc/indexing.py","file_url":"https://github.com/Ferenas/CPN/blob/HEAD/misc/indexing.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":"2d78188bd6f7f6dc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}