Existing CLIP explanations identify regions important to the model's predictions but do not show how to change them to obtain a different prediction. Visual counterfactual methods can be adapted to CLIP but do not exploit its vision-language representation. We introduce Mask-guided Adaptive Counterfactual Explanations (MACE), a method for generating targeted visual counterfactuals for CLIP zero-shot classification. MACE uses source-target attribution differences and adaptive mask expansion to determine where to edit, and CLIP-guided diffusion inpainting to determine how to edit. We evaluate MACE against strong existing visual counterfactual methods adapted to CLIP zero-shot classification. Across four datasets, multiple CLIP models, and both latent- and pixel-space diffusion generators, MACE achieves near-perfect target-class validity with smaller edits than competing methods. We further show that MACE's small edits often produce counterfactuals specific to the explained model, while larger editable regions increase cross-model validity. By controlling the editable region, MACE can thus navigate the trade-off between small, model-specific edits and more transferable counterfactuals.
翻译:暂无翻译