Counterfactual Explanations on Robust Perceptual Geodesics

Eslam Zaher, Maciej Trzaskowski, Quan Nguyen, Fred Roosta · 2026

Read Counterfactual Explanations on Robust Perceptual Geodesics by Eslam Zaher, Maciej Trzaskowski, Quan Nguyen, Fred Roosta (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-18678.txt.

Introduction

Eslam Zaher and three colleagues hone a way to tell a user what small change would flip a model's call. Such a tale, called a counterfactual, should be small, close to real cases, and in line with how the facts hang as one. Past ways pick the change by a flat gap count. A flat count can pick changes that look near on the page but could never occur in life.

The team pick the change by a path that rides the true shape of the data. That shape is built from how real cases spread in the model's hid space. A path on that shape keeps the tale in the world of real cases. Such tales could help a user act: to gain a loan, say, by a change they can truly make. Fair tales count for trust in smart calls.

Catalog record

CREATOREslam Zaher, Maciej Trzaskowski, Quan Nguyen, Fred Roosta
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE101 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2601-18678

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Counterfactual Explanations on Robust Perceptual Geodesics Eslam Zaher, Maciej Trzaskowski, Quan Nguyen, Fred Roosta Abstract Latent-space optimization methods for counterfactual explanations—framed as minimal semantic perturbations that change model predictions—inherit the ambiguity of Wachter et al.’s objective: the choice of distance metric dictates whether perturbations are meaningful or adversarial. Existing approaches adopt flat or misaligned geometries, leading to off-manifold artifacts, semantic drift, or adversarial collapse. We introduce Perceptual Counterfactual Geodesics (PCG), a method that constructs counterfactuals by tracing geodesics under a perceptually Riemannian metric induced from robust vision features. This geometry aligns with human perception and penalizes brittle directions, enabling smooth, on-manifold, semantically valid transitions. Experiments on three vision datasets show that PCG outperforms baselines and reveals failure modes hidden under standard metrics. 1 Introduction As deep learning models grow in scale and impact, interpretability becomes paramount as it offers a crucial lens into their internal reasoning. Traditional saliency-based methods, which highlight influential input features ( 63 , 75 , 68 , 36 , 57 , 60 , 52 ) , have been widely adopted for vision models but produce static, often noisy attributions that lack guidance on how predictions could be altered. Counterfactual explanation (CE) methods have emerged as a complementary paradigm grounded in the fundamental human capacity to contemplate “what if?” scenarios ( 79 , 78 , 34 , 3 ) . Rather than merely highlighting salient regions, CEs specify which semantic features should be modified—and how—to produce a different prediction. Wachter et al. ( 79 ) formalized this notion as a solution to an optimization problem: \displaystyle\min_{x}\;\underbrace{r(x^{\star},x)}_{\text{Similarity Distance}}\;+\;\lambda\underbrace{\ell(f(x),y^{\prime})}_{\text{Classification Loss}}, (1) where x^{\star} is the original input, y^{\prime} the desired class, f the classifier, \ell a loss function (e.g., cross-entropy), r a distance metric, and \lambda a hyperparameter balancing classification and similarity. Considerable debate has emerged around whether a CE is fundamentally distinct from an adversarial example (AE), as both arise from the same optimization problem ( 79 , 10 , 55 , 18 ) . The choice of distance metric r plays a central role: while it may support meaningful CEs, it can also encourage AEs if it favors imperceptibly small, distributed perturbations. Wachter et al. 79 acknowledged this ambiguity, noting that “AEs are counterfactuals by another name,” proposing distinction on two grounds: (i) a misalignment of the distance metric with meaningful feature changes—since metrics typically used for AEs favor such dispersed modifications, thereby diminishing their explanatory value, and (ii) adversarial perturbations are non-semantic signals that displace inputs out of the possible world—i.e., off-manifold regions that do not correspond to valid examples under the data distribution. Rather than directly solving eq. 1 , some approaches leverage generative models to produce visual CEs by exploiting low-dimensional semantic representations ( 5 , 54 , 51 , 65 , 49 , 45 ) . For instance, 65 trained a conditional GAN to produce exaggerated CEs, while 49 used a conditional StyleGAN2 -based approach to generate sparse visual CEs along disentangled classifier-relevant style-space directions. 45 used cycle-consistent losses to train transformations between factual and counterfactual distributions in generative latent spaces. Though visually compelling, these methods rely on exhaustive techniques that depart from the direct optimization formulation and ignore the geometry of the data manifold. Other research adopt eq. 1 in the latent space of generative models ( 34 , 14 , 13 , 56 ) , but either assume flat Euclidean geometry ( 34 , 13 ) , failing to capture the manifold’s intrinsic curvature, or use geometrically informed yet adversarially vulnerable distance metrics ( 56 ) . For example, REVISE ( 34 ) solves the objective in eq. 1 in a VAE latent space under Euclidean assumptions, using explicit \ell_{1}/\ell_{2} distance terms. 13 discard explicit similarity terms and employ Stochastic Gradient Descent (SGD) assuming flat geometry misaligned with the underlying data manifold. Figure 1: Schematic of PCG. An input is mapped through an encoder-generator pair. A linear latent path to a perceptually plausible target-class sample (Class B, brown region) is refined in Phase 1 into the blue geodesic by minimizing robust perceptual energy. In Phase 2, the endpoint and intermediate points are jointly optimized under classification loss and robust energy, resulting in the red counterfactual geodesic. The green trajectory (REVISE, VSGD) ignores manifold geometry, strays off-manifold and produces off-manifold AEs. The yellow trajectory (RSGD/-C) conforms to a fragile geometry, getting stuck in on-manifold adversarial regions (Class B, outside brown region). This misalignment often causes perturbations to stray off-manifold, leading to implausible or off-manifold AEs. 56 proposed equipping the latent space with a Riemannian metric induced by the generator and optimizing with Riemannian SGD (RSGD) to account for the geometry of the data manifold. However, their induced metric is typically derived by pulling back either the pixel-space \ell_{2} or a standard classifier’s feature space metric. Both are problematic in the vision domain: the \ell_{2} norm is a poor proxy for human perception ( 66 , 33 , 58 ) , while a standard feature-based metric is semantically brittle as it inherits the adversarial vulnerabilities of non-robust vision models ( 67 , 23 ) . Such methods acutely fail in the high-dimensional vision domain, where the counterfactual optimization process can’t distinguish between CEs and AEs. 10 proposed the notion of a semantic divide —a distinction between perturbations that affect human-understandable semantic features or low-level, uninterpretable features. Perturbations with rich semantic content fall on the explanatory side; pixel-level or low-level ones fall on the adversarial side. 10 argue that neither distance metrics nor appeals to “possible worlds” fully resolve this distinction; instead, semantic relevance only determines whether a result is a valid CE or an AE. We agree with 10 that the second criterion proposed by Wachter et al.–displacement to off-manifold regions–fails to adequately differentiate AEs from CEs. Several studies have shown that on-manifold AEs exist ( 32 , 21 , 71 ) , and can be generated via generative models ( 74 , 83 ) , representing a subclass of AEs that reside within Wachter et al.’s “possible worlds”. However, we challenge the assertion that distance metrics are inherently incapable of making the distinction. We show that if the data manifold is endowed with a semantically robust Riemannian metric, solving the counterfactual optimization–when guided appropriately–can cross the semantic divide and produce valid CEs. Failure Modes of Previous Approaches. We attribute the failure of previous latent-space counterfactual optimization methods in the high-dimensional image data regime to three core limitations: (i) Off-manifold Traversal. Optimization in latent space often disregards the geometry of the data manifold, leading to off-manifold AEs or semantically implausible counterfactuals ( 56 ) . (ii) Local Gradient Optimization. Without global structural guidance, single-point geometry-aware gradient methods operate locally and overlook the global manifold structure, including the existence of on-manifold adversarial regions. As a result, they often converge to either semantically distant counterfactuals or on-manifold AEs. (iii) Versatility of Generators. Even when accounting for manifold geometry, high-capacity generators can exploit non-robust or misaligned distance metrics to produce on-manifold AEs ( 74 , 83 , 25 ) , fooling the metric rather than producing semantically meaningful perturbations that genuinely cross the semantic barrier. Contributions. Motivated by findings in adversarial robustness that show robust models exhibit perceptually aligned gradients ( 20 , 73 , 61

Read the complete text