{"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/global-counterfactual-directions","title":"Global Counterfactual Directions","arxiv_id":"2404.12488","date":"2024-04-18","proceeding":null,"authors":["Bartlomiej Sobieski","Przemysław Biecek"],"abstract":"Despite increasing progress in development of methods for generating visual counterfactual explanations, especially with the recent rise of Denoising Diffusion Probabilistic Models, previous works consider them as an entirely local technique. In this work, we take the first step at globalizing them. Specifically, we discover that the latent space of Diffusion Autoencoders encodes the inference process of a given classifier in the form of global directions. We propose a novel proxy-based approach that discovers two types of these directions with the use of only single image in an entirely black-box manner. Precisely, g-directions allow for flipping the decision of a given classifier on an entire dataset of images, while h-directions further increase the diversity of explanations. We refer to them in general as Global Counterfactual Directions (GCDs). Moreover, we show that GCDs can be naturally combined with Latent Integrated Gradients resulting in a new black-box attribution method, while simultaneously enhancing the understanding of counterfactual explanations. We validate our approach on existing benchmarks and show that it generalizes to real-world use-cases.","url_abs":"https://arxiv.org/abs/2404.12488v2","url_pdf":"https://arxiv.org/pdf/2404.12488v2.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":"global-counterfactual-directions","repo_url":"https://github.com/sobieskibj/gcd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.12488","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.12488"}},"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/sobieskibj/gcd","reach":{"status":"ok"}}],"summary":{"ran":1,"unverified":4},"by_repo_kind":{"official":{"samples":5,"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":5,"samples":[{"code_sha256_prefix":"01817e3fcc88ea05","entry":"split_grid","repo":"sobieskibj/gcd","repo_kind":"official","path":"gcd/src/utils/other.py","file_url":"https://github.com/sobieskibj/gcd/blob/HEAD/gcd/src/utils/other.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":"01817e3fcc88ea05"}},{"code_sha256_prefix":"bef266d56c48ca6c","entry":"extract_output_dir_path_from_config","repo":"sobieskibj/gcd","repo_kind":"official","path":"gcd/src/utils/configs.py","file_url":"https://github.com/sobieskibj/gcd/blob/HEAD/gcd/src/utils/configs.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":"bef266d56c48ca6c"}},{"code_sha256_prefix":"d3481b13dfed4ef5","entry":"init_class_from_string","repo":"sobieskibj/gcd","repo_kind":"official","path":"gcd/src/direction_transfer.py","file_url":"https://github.com/sobieskibj/gcd/blob/HEAD/gcd/src/direction_transfer.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":"d3481b13dfed4ef5"}},{"code_sha256_prefix":"47a01f552e6e158e","entry":"init_dae","repo":"sobieskibj/gcd","repo_kind":"official","path":"gcd/src/direction_transfer.py","file_url":"https://github.com/sobieskibj/gcd/blob/HEAD/gcd/src/direction_transfer.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":"47a01f552e6e158e"}},{"code_sha256_prefix":"3385edf6cb6a52a9","entry":"init_loss","repo":"sobieskibj/gcd","repo_kind":"official","path":"gcd/src/direction_transfer.py","file_url":"https://github.com/sobieskibj/gcd/blob/HEAD/gcd/src/direction_transfer.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":"3385edf6cb6a52a9"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}