MaskDiME: Adaptive Masked Diffusion for Precise and Efficient Visual Counterfactual Explanations

Changlu Guo, Anders Nymark Christensen, Anders Bjorholm Dahl, Morten Rieger Hannemose
2/21/2026
cs.CV

No official code found. Best implementation: clguo/MaskDiME (4 stars, MIT, last commit 2026-04-27).

Abstract

Visual counterfactual explanations aim to reveal the minimal semantic modifications that can alter a model's prediction, providing causal and interpretable insights into deep neural networks. However, existing diffusion-based counterfactual generation methods are often computationally expensive, slow to sample, and imprecise in localizing the modified regions. To address these limitations, we propose MaskDiME, a simple, fast, and effective diffusion framework that unifies semantic consistency and spatial precision through localized sampling. Our approach adaptively focuses on decision-relevant regions to achieve localized and semantically consistent counterfactual generation while preserving high image fidelity. Our training-free framework, MaskDiME, achieves over 30x faster inference than the baseline method and achieves comparable or state-of-the-art performance across five benchmark datasets spanning diverse visual domains, establishing a practical and generalizable solution for efficient counterfactual explanation.

View on arXivView PDF

Code Implementations(1)

clguo/MaskDiMECommunity68%
MIT

Official implementation for the paper MaskDiME: Adaptive Masked Diffusion for Precise and Efficient Visual Counterfactual Explanations

40CSS, HTMLFeb 21, 20265 months agoMIT

Similar Papers

Cite this paper

@article{guo2026maskdime,
  title  = {MaskDiME: Adaptive Masked Diffusion for Precise and Efficient Visual Counterfactual Explanations},
  author = {Changlu Guo and Anders Nymark Christensen and Anders Bjorholm Dahl and Morten Rieger Hannemose},
  year   = {2026},
  eprint = {2602.18792},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.18792v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.18792.svg)](https://codeofpaper.com/paper/2602.18792)

Discussion