Seedlabs
Source research

From Visual Explanations to Counterfactual Explanations with Latent Diffusion

Tung Luu, Nam Le, Duc Le, Bac Hoai Le · 2025 · 10 citationsRead the paper

Visual counterfactual explanations are ideal hypothetical images that change the decision-making of the classifier with high confidence toward the desired class while remaining visually plausible and close to the initial image. In this paper, we propose a new approach to tackle two key challenges in recent prominent works: i) determining which specific counterfactual features are crucial for distinguishing the “concept” of the target class from the original class, and ii) supplying valuable explanations for the non-robust classifier without relying on the support of an adversarially robust model. Our method identifies the essential region for modification through algorithms that provide visual explanations, and then our framework generates realistic counterfactual explanations by combining adversarial attacks based on pruning the adversarial gradient of the target classifier and the latent diffusion model. The proposed method outperforms previous state-of-the-art results on various evaluation criteria on ImageNet and CelebA-HQ datasets. In general, our method can be applied to arbitrary classifiers, highlight the strong association between visual and counterfactual explanations, make semantically meaningful changes from the target classifier, and provide observers with subtle counterfactual images.

What the full text shows

Working prototype
  • ECED outperformed ACE and DVCE across all evaluation criteria on ImageNet, specifically in realism (FID/sFID) and sparsity (l1, l2, S3). — FID for ECED-v (Egyptian Cat-Persian Cat) was 27.4 vs. DVCE 163.2 (ImageNet dataset using VGG-16 and ResNet50 classifiers)
  • ECED achieved high validity (Flip Ratio) while maintaining sparse changes compared to baselines. — FR of 100.0% for ECED-v and ECED-r in Egyptian Cat-Persian Cat task (ImageNet dataset)
  • The method preserves background identity more effectively than pixel-space denoising methods. — Average MSE background content loss of 0.0077 ± 0.0012 (100 randomly selected images)
  • A trade-off exists between sparsity and validity based on the foreground threshold ξ. — ξ=0.5 yielded 100% FR; ξ=0.7 yielded 95% FR (100 random samples)
  • ECED provides better identity preservation and sparse changes on CelebA-HQ than other methods, though slightly lower realism than ACE. (CelebA-HQ dataset focusing on 'Smile' and 'Age' attributes)
Setup
Evaluated on ImageNet (7,800 images) and CelebA-HQ (2,000 images) using VGG-16, ResNet50, and DenseNet121 classifiers; images rescaled to 512x512 pixels.
How
The ECED framework uses class activation maps to define a foreground mask for modification and a background mask for preservation. It generates counterfactual images by combining a blended latent diffusion model with adversarial gradient pruning-based attacks to iteratively update latent features.
Limitations
High temporal requirement for generation (approx. 150 seconds per image). · Requires manual adjustment of the foreground-background separation hyperparameter (ξ).

Summarized by Gemma 4 from the open-access full text · 22 Nov 2026. Read it