{"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/extracting-class-activation-maps-from-non","title":"Extracting Class Activation Maps from Non-Discriminative Features as well","arxiv_id":"2303.10334","date":"2023-03-18","proceeding":"CVPR 2023 1","authors":["Zhaozheng Chen","Qianru Sun"],"abstract":"Extracting class activation maps (CAM) from a classification model often results in poor coverage on foreground objects, i.e., only the discriminative region (e.g., the \"head\" of \"sheep\") is recognized and the rest (e.g., the \"leg\" of \"sheep\") mistakenly as background. The crux behind is that the weight of the classifier (used to compute CAM) captures only the discriminative features of objects. We tackle this by introducing a new computation method for CAM that explicitly captures non-discriminative features as well, thereby expanding CAM to cover whole objects. Specifically, we omit the last pooling layer of the classification model, and perform clustering on all local features of an object class, where \"local\" means \"at a spatial pixel position\". We call the resultant K cluster centers local prototypes - represent local semantics like the \"head\", \"leg\", and \"body\" of \"sheep\". Given a new image of the class, we compare its unpooled features to every prototype, derive K similarity matrices, and then aggregate them into a heatmap (i.e., our CAM). Our CAM thus captures all local features of the class without discrimination. We evaluate it in the challenging tasks of weakly-supervised semantic segmentation (WSSS), and plug it in multiple state-of-the-art WSSS methods, such as MCTformer and AMN, by simply replacing their original CAM with ours. Our extensive experiments on standard WSSS benchmarks (PASCAL VOC and MS COCO) show the superiority of our method: consistent improvements with little computational overhead.","url_abs":"https://arxiv.org/abs/2303.10334v1","url_pdf":"https://arxiv.org/pdf/2303.10334v1.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":"extracting-class-activation-maps-from-non","repo_url":"https://github.com/zhaozhengchen/lpcam","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"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":"cam","method_name":"CAM"},{"method_slug":"heatmap","method_name":"Heatmap"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2303.10334","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.10334"}},"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/zhaozhengchen/lpcam","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/zhaozhengChen/LPCAM","reach":{"status":"ok"}}],"summary":{"ran":3,"ran_draft_wrong":2,"unverified":3},"by_repo_kind":{"official":{"samples":8,"ran":5,"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":8,"samples":[{"code_sha256_prefix":"a6c982393f920735","entry":"Bottleneck","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a6c982393f920735"}},{"code_sha256_prefix":"b29efcd99524103f","entry":"FixedBatchNorm","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b29efcd99524103f"}},{"code_sha256_prefix":"1de3c644bf3c49e2","entry":"ResNet","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1de3c644bf3c49e2"}},{"code_sha256_prefix":"b2dee97c33d89372","entry":"gap2d","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b2dee97c33d89372"}},{"code_sha256_prefix":"42e1b3c302e6f817","entry":"resnet50","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"42e1b3c302e6f817"}},{"code_sha256_prefix":"11509a32eec950d0","entry":"Net","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.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":"11509a32eec950d0"}},{"code_sha256_prefix":"bd0417e203996094","entry":"Net_Feature","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.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":"bd0417e203996094"}},{"code_sha256_prefix":"2680be73f65cd0b9","entry":"make_lpcam","repo":"zhaozhengChen/LPCAM","repo_kind":"official","path":"step/make_lpcam.py","file_url":"https://github.com/zhaozhengChen/LPCAM/blob/HEAD/step/make_lpcam.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":"2680be73f65cd0b9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}