{"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/investigating-and-simplifying-masking-based-1","title":"Investigating and Simplifying Masking-based Saliency Methods for Model Interpretability","arxiv_id":"2010.09750","date":"2020-10-19","proceeding":null,"authors":["Jason Phang","Jungkyu Park","Krzysztof J. Geras"],"abstract":"Saliency maps that identify the most informative regions of an image for a classifier are valuable for model interpretability. A common approach to creating saliency maps involves generating input masks that mask out portions of an image to maximally deteriorate classification performance, or mask in an image to preserve classification performance. Many variants of this approach have been proposed in the literature, such as counterfactual generation and optimizing over a Gumbel-Softmax distribution. Using a general formulation of masking-based saliency methods, we conduct an extensive evaluation study of a number of recently proposed variants to understand which elements of these methods meaningfully improve performance. Surprisingly, we find that a well-tuned, relatively simple formulation of a masking-based saliency model outperforms many more complex approaches. We find that the most important ingredients for high quality saliency map generation are (1) using both masked-in and masked-out objectives and (2) training the classifier alongside the masking model. Strikingly, we show that a masking model can be trained with as few as 10 examples per class and still generate saliency maps with only a 0.7-point increase in localization error.","url_abs":"https://arxiv.org/abs/2010.09750v1","url_pdf":"https://arxiv.org/pdf/2010.09750v1.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":"investigating-and-simplifying-masking-based-1","repo_url":"https://github.com/zphang/saliency_investigation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"tasks":[{"task_slug":null,"task_name":"counterfactual"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2010.09750","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2010.09750"}},"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/zphang/saliency_investigation","reach":{"status":"ok","spdx":"BSD-3-Clause"}}],"summary":{"unverified":19},"by_repo_kind":{"official":{"samples":19,"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":"688c38ac8517471a","entry":"accuracy","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/train_utils.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/train_utils.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"688c38ac8517471a"}},{"code_sha256_prefix":"ca4396c9e5d986b8","entry":"apply_uniform_random_value_mask_func","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/criterion.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/criterion.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"ca4396c9e5d986b8"}},{"code_sha256_prefix":"c75a899b50d166b6","entry":"binary_gumbel_softmax","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/archs.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/archs.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"c75a899b50d166b6"}},{"code_sha256_prefix":"8f29059810883f70","entry":"default_infill_func","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/criterion.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/criterion.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"8f29059810883f70"}},{"code_sha256_prefix":"ccefd8f533a37c96","entry":"get_activation","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/ext/dfnet.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/ext/dfnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"ccefd8f533a37c96"}},{"code_sha256_prefix":"a2f9db8c0650f2df","entry":"get_mask","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/model_basics.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/model_basics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a2f9db8c0650f2df"}},{"code_sha256_prefix":"544506b6b4e94b6e","entry":"get_masked_images","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/casme_utils.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/casme_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"544506b6b4e94b6e"}},{"code_sha256_prefix":"b257e814f0b02a0e","entry":"get_masked_images_v2","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/casme_utils.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/casme_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"b257e814f0b02a0e"}},{"code_sha256_prefix":"1eef12cb27f7130e","entry":"get_masks_and_check_predictions","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/model_basics.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/model_basics.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"1eef12cb27f7130e"}},{"code_sha256_prefix":"22f472dba4017016","entry":"get_norm","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/ext/dfnet.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/ext/dfnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"22f472dba4017016"}},{"code_sha256_prefix":"1715f300a6a58899","entry":"gram_matrix","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/ext/pytorch_inpainting_with_partial_conv.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/ext/pytorch_inpainting_with_partial_conv.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"1715f300a6a58899"}},{"code_sha256_prefix":"9c25a48e312acd33","entry":"ignore_superclass_signature","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/core.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/core.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"9c25a48e312acd33"}},{"code_sha256_prefix":"a29a81ff6ff8a73e","entry":"mask_to_stats","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/stats.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/stats.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a29a81ff6ff8a73e"}},{"code_sha256_prefix":"ab33a7e0d32b0259","entry":"random_mask","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/ext/pconv_keras.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/ext/pconv_keras.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"ab33a7e0d32b0259"}},{"code_sha256_prefix":"afc608bf21aa9f05","entry":"replace_prefix","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/archs.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/archs.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"afc608bf21aa9f05"}},{"code_sha256_prefix":"72d2ca5c8b19b945","entry":"resize_like","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/ext/dfnet.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/ext/dfnet.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"72d2ca5c8b19b945"}},{"code_sha256_prefix":"f067739c23018f46","entry":"resnet50shared","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/archs.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/archs.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"f067739c23018f46"}},{"code_sha256_prefix":"dedfa1b69056bdc7","entry":"total_variation_loss","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/ext/pytorch_inpainting_with_partial_conv.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/ext/pytorch_inpainting_with_partial_conv.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"dedfa1b69056bdc7"}},{"code_sha256_prefix":"b0a0259ffdb9c7d8","entry":"weights_init","repo":"zphang/saliency_investigation","repo_kind":"official","path":"casme/ext/pytorch_inpainting_with_partial_conv.py","file_url":"https://github.com/zphang/saliency_investigation/blob/HEAD/casme/ext/pytorch_inpainting_with_partial_conv.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"b0a0259ffdb9c7d8"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}