{"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/adapting-grad-cam-for-embedding-networks","title":"Adapting Grad-CAM for Embedding Networks","arxiv_id":"2001.06538","date":"2020-01-17","proceeding":null,"authors":["Lei Chen","Jianhui Chen","Hossein Hajimirsadeghi","Greg Mori"],"abstract":"The gradient-weighted class activation mapping (Grad-CAM) method can faithfully highlight important regions in images for deep model prediction in image classification, image captioning and many other tasks. It uses the gradients in back-propagation as weights (grad-weights) to explain network decisions. However, applying Grad-CAM to embedding networks raises significant challenges because embedding networks are trained by millions of dynamically paired examples (e.g. triplets). To overcome these challenges, we propose an adaptation of the Grad-CAM method for embedding networks. First, we aggregate grad-weights from multiple training examples to improve the stability of Grad-CAM. Then, we develop an efficient weight-transfer method to explain decisions for any image without back-propagation. We extensively validate the method on the standard CUB200 dataset in which our method produces more accurate visual attention than the original Grad-CAM method. We also apply the method to a house price estimation application using images. The method produces convincing qualitative results, showcasing the practicality of our approach.","url_abs":"https://arxiv.org/abs/2001.06538v1","url_pdf":"https://arxiv.org/pdf/2001.06538v1.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":"adapting-grad-cam-for-embedding-networks","repo_url":"https://github.com/shinmura0/Faster-Grad-CAM","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"image-captioning","task_name":"Image Captioning"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2001.06538","atlas_url":"https://app.syntology.ai/?focus=2001.06538","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2001.06538"}},"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/shinmura0/Faster-Grad-CAM","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":2},"by_repo_kind":{"listed":{"samples":3,"ran":1,"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":"4ab1904969c894fa","entry":"get_score_arc","repo":"shinmura0/Faster-Grad-CAM","repo_kind":"listed","path":"janken_demo.py","file_url":"https://github.com/shinmura0/Faster-Grad-CAM/blob/HEAD/janken_demo.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4ab1904969c894fa"}},{"code_sha256_prefix":"afab5118b5b62122","entry":"cosine_similarity","repo":"shinmura0/Faster-Grad-CAM","repo_kind":"listed","path":"janken_demo.py","file_url":"https://github.com/shinmura0/Faster-Grad-CAM/blob/HEAD/janken_demo.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":"afab5118b5b62122"}},{"code_sha256_prefix":"57949f1d1cbd1496","entry":"predict_faster_gradcam","repo":"shinmura0/Faster-Grad-CAM","repo_kind":"listed","path":"janken_demo.py","file_url":"https://github.com/shinmura0/Faster-Grad-CAM/blob/HEAD/janken_demo.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":"57949f1d1cbd1496"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}