---
title: 'CECAS: Causal Framework for Visual Counterfactuals'
url: https://www.emergentmind.com/topics/cecas
type: topic
---

# CECAS: Causal Framework for Visual Counterfactuals

Searching arXiv for recent papers on CECAS and related counterfactual visual explanation work.
CECAS denotes the framework introduced in “Counterfactual Visual Explanation via Causally-Guided Adversarial Steering” [2507.09881]. It is a method for generating visual counterfactual explanations: given an image \(x\) and a classifier \(f\), it seeks a modified image \(x' = x + \delta\) whose prediction flips to a specified target label while maintaining validity, sparsity, proximity, and realism. Its defining claim is that counterfactuals should preferentially intervene on factors causally related to the label while preserving spurious factors, thereby reducing unintended alterations and semantically incoherent edits. The acronym is unrelated to CESAR, the CERN Experimental areas Software Renovation control system [2202.01705], and to CESIUM, the ComplEx System Integrated Utilities Model for complex engineered system development [2103.12820].

## 1. Problem setting and conceptual motivation

In CECAS, a counterfactual explanation answers the local question of what minimal change to an input would make the model predict a different target label. For image \(x \in \mathcal{X}\), label \(y \in \mathcal{Y} := \{1,\dots,K\}\), and classifier \(f:\mathcal{X}\to\mathcal{Y}\), the objective is to find a perturbation \(\delta\) such that \(x' := x + \delta\) changes the prediction to a target \(y'\) [2507.09881]. The paper treats four properties as central: validity, proximality, sparsity, and realism.

The framework is motivated by three deficiencies attributed to earlier visual counterfactual methods. First, methods driven by global similarity penalties such as \( \ell_1 \) can still introduce local artifacts, including color shifts, shape distortions, extraneous texture changes, and unintended attribute changes. Second, existing approaches may exploit spurious correlations because they optimize whatever image cues most easily flip the classifier. Third, even diffusion-based or generative approaches, although stronger on realism, generally do not distinguish causally relevant factors from spurious factors or nuisance variation.

The paper uses concrete examples to characterize these failure modes. In autonomous driving, a method may change an irrelevant sign-shape cue rather than the causally meaningful content. In face aging, it may introduce beard-like dark patches because beard is spuriously correlated with old in the training data. CECAS is positioned as a response to these cases: it aims to generate counterfactuals that alter the decision through semantically meaningful directions rather than shortcut features [2507.09881].

## 2. Causal abstraction and intervention criterion

CECAS does not construct a full structural causal model with explicit structural equations for all semantic concepts in the image. Instead, it adopts a coarse causal abstraction with variables \(C\), \(S\), \(X\), \(\Delta\), \(X'\), \(\hat{Y}\), and \(\theta\): causal factors \(C\) directly determine the label \(Y\), both causal factors \(C\) and spurious factors \(S\) contribute to the observed image \(X\), and a semantically meaningful perturbation \(\Delta\) transforms \(X\) into the counterfactual image \(X'\) [2507.09881].

The graph structure emphasized in the paper includes \(C \to Y\), \(C \to X\), and \(S \to X\), so that \(X\) is a collider in the form \(C \rightarrow X \leftarrow S\). The paper further stresses that conditioning on \(X\) can induce a spurious path \(Y \leftarrow C \rightarrow X \leftarrow S\), which formalizes why purely image-level optimization can exploit label-associated but noncausal cues. The key modeling assumption is that causal factors \(C\) and spurious factors \(S\) are independent, written as \(C \perp S\), and therefore can be separated into orthogonal subspaces in representation space.

Within this formulation, a causal intervention is approximated operationally rather than structurally. An ordinary perturbation is any change that flips the model. By contrast, a CECAS intervention is a change that drives the target prediction while leaving spurious mechanisms invariant. The paper makes this invariance concrete by extracting a spurious component from internal representations and penalizing changes to it during optimization. This does not amount to a full Pearl-style intervention semantics, but it provides an explicit criterion for distinguishing causally guided edits from unconstrained adversarial steering [2507.09881].

## 3. Two-stage architecture and optimization pipeline

The method consists of two stages: initial causally-guided counterfactual generation, followed by causally-guided post refinement [2507.09881]. In the first stage, CECAS starts from targeted PGD-style optimization. Standard targeted adversarial steering updates the image toward a target class \(y'\) through a projected gradient step, but the paper argues that this alone is insufficient because it may alter spurious factors.

To address this, the explained classifier is viewed as a feature extractor plus a linear classification head. A representation \(R\) is extracted, a spurious factor \(S\) is isolated by subspace projection under the assumption \(C \perp S\), and an auxiliary classifier \(g\) is trained on the spurious factor. The modified optimization then combines a target-label loss with a spurious-preservation loss:
$$
\arg\min_{x'} L(F(x'); y') + \alpha L_S(z,z'),
$$
where \(F\) denotes the DDPM-plus-classifier joint pipeline, \(L(F(x');y')\) enforces target-label validity, \(L_S(z,z')\) penalizes changes in the spurious representation, and \(\alpha\) controls the trade-off between attack strength and causal constraint [2507.09881].

DDPM regularization is used in this stage to suppress high-frequency adversarial noise. The paper describes the standard forward and reverse diffusion processes and conceptually treats denoising as a manifold prior that removes implausible noise while retaining semantically coherent content. The result of stage 1 is an initial counterfactual image that is both target-directed and constrained against altering extracted spurious factors.

Stage 2 addresses a different issue: concept-level preservation is too soft to guarantee pixel-level sparsity. CECAS therefore generates an auxiliary \( \ell_1 \)-regularized target counterfactual,
$$
\arg\min_{x''} L(F(x''); y') + \lambda \|x''-x\|_1,
$$
not as the final output but as a localization device. The local normalized difference between \(x''\) and \(x\) is thresholded to construct a binary mask, optionally enlarged by dilation, that identifies editable regions. Diffusion-based inpainting, following RePaint, then restores the rest of the image from the original while preserving the editable regions. The final output is thus produced by semantically steering first and spatially refining second [2507.09881].

## 4. Experimental design, datasets, and evaluation protocol

The framework is evaluated on eight datasets or subsets spanning faces, traffic scenes, and ImageNet-derived animal-class transitions [2507.09881].

| Dataset group | Configuration |
|---|---|
| CelebA | \(128 \times 128\); Smile and Age |
| CelebA-HQ | \(256 \times 256\); Smile and Age |
| BDD-OIA | traffic scenes; \(512 \times 256\) |
| ImageNet subsets | Cougar vs. Cheetah; Sorrel vs. Zebra; Egyptian Cat vs. Persian Cat |

The classifier backbone is ResNet-50 pretrained by PyTorch for ImageNet, and DenseNet-121 with pretrained weights from prior baselines for the other datasets. The diffusion models use the same pretrained DDPM weights as the baselines for fairness. The comparison set includes STEEX, DiVE, DiVE\(^ {100}\), DiME, and ACE, although some experiments report only the strongest baselines because of space or unavailable reported numbers.

The evaluation protocol is organized around four counterfactual properties. Validity is measured by Flip Rate (FR) and Counterfactual Transition (COUT). Sparsity and proximity are measured by LPIPS, Correlation Difference (CD), and \(S^3\), where \(S^3\) is SimSiam cosine similarity. Realism is measured by FID and sFID, with sFID introduced because standard FID can underestimate changes when original and counterfactual images share many pixels. The paper also adds a VLM-based evaluation using GPT-4o with custom prompts to score validity, sparsity, proximity, and realism from 1 to 10, then average them. Reported hyperparameters vary by dataset, including \(\alpha\), \(\lambda\), \(\gamma\), PGD iterations, and diffusion steps; for example, CelebA Smile uses \(\alpha=0.5\), \(\lambda=0.001\), \(\gamma=0.1\), 50 PGD iterations, and 500 diffusion steps, whereas BDD-OIA uses \(\alpha=0.005\), \(\lambda=0.001\), \(\gamma=0.05\), 50 PGD iterations, and 1000 diffusion steps [2507.09881].

## 5. Empirical performance and qualitative behavior

The reported results present CECAS as strongest overall on multiple datasets, while not being best on every individual metric [2507.09881]. On CelebA Smile, it achieves FR \(99.40\%\), COUT \(0.7325\), LPIPS \(0.0138\), \(S^3\) \(0.9834\), and FID \(3.8\), all listed as best; its sFID \(25.70\) is second-best, slightly behind DiME’s \(25.48\), and its CD \(2.09\) is slightly worse than ACE \(2.05\) and DiME \(1.99\). On CelebA Age, it records FR \(99.95\%\), COUT \(0.6908\), LPIPS \(0.0167\), CD \(2.98\), and sFID \(26.26\) as best, while FID \(4.6\) is slightly behind ACE’s \(4.3\) and \(S^3\) \(0.9830\) is slightly behind ACE’s \(0.9843\).

On BDD-OIA, the method ties ACE on FR at \(99.90\%\), and reports the best COUT at \(0.8240\) and the best LPIPS at \(0.0150\), with \(S^3\) \(0.9952\) very close to ACE’s \(0.9956\). Its FID and sFID are slightly worse than ACE, at \(13.85\) versus \(9.50\) and \(92.48\) versus \(91.70\), respectively. On the ImageNet subsets, CECAS generally improves validity and transition strength relative to ACE. For Sorrel \(\to\) Zebra, FR rises to \(90.00\%\) from \(76.67\%\), COUT to \(0.5442\) from \(0.0967\), and both FID and sFID improve, although LPIPS is slightly worse. Similar patterns hold for Cougar \(\to\) Cheetah and Persian Cat \(\to\) Egyptian Cat: validity and realism-style metrics generally improve, but some similarity metrics do not.

The qualitative findings are central to the paper’s interpretation. On facial datasets, CECAS is reported to avoid inexplicable color shifts, shape distortions, exaggerated facial creases, and dark chin patches in female faces during young-to-old transitions. That beard-like artifact is treated as the clearest example of a spurious correlation that other methods may exploit. On BDD-OIA and the animal subsets, the method produces more localized, human-perceptible modifications while preserving more of the rest of the image. The GPT-4o-based evaluation reports CECAS as best on seven of eight datasets, including CelebA Smile, CelebA Age, CelebA-HQ Smile, CelebA-HQ Age, Sorrel-Zebra, Cougar-Cheetah, and Persian Cat-Egyptian Cat; BDD-OIA is the only case where ACE slightly exceeds it, \(7.86\) versus \(7.77\) [2507.09881].

## 6. Assumptions, limitations, and terminological boundaries

The paper is explicit that CECAS is not a full causal solution [2507.09881]. Its causal formulation models only a coarse separation between causal factors \(C\) and spurious factors \(S\), and it does not explicitly represent finer causal relations among multiple semantic variables. Its effectiveness depends on the quality of spurious-factor extraction from representation space; if disentanglement is poor, the causal guidance may be noisy or incomplete. The assumption \(C \perp S\), which enables orthogonal projection into causal and spurious subspaces, is strong and may not hold exactly in real datasets.

The method is also essentially white-box: it uses gradients and model internals. Relative to ordinary counterfactual generation, it adds spurious-factor extraction, auxiliary classifier training, DDPM denoising, mask generation, and diffusion inpainting, all of which increase computational cost and implementation complexity. The trade-off hyperparameter \(\alpha\) is especially important. The paper reports that as \(\alpha\) increases, realism initially improves because spurious changes are suppressed, but overly large \(\alpha\) can reduce flip rate and eventually harm realism because necessary modifications become overconstrained. The authors further note that automatic balancing among validity, sparsity, proximity, and realism remains future work.

A common source of confusion is purely terminological. In arXiv records, “CECAS” refers to the counterfactual-visual-explanation framework described above [2507.09881]. The near-homophonous CESAR concerns CERN Experimental Area beam control software [2202.01705], and CESIUM refers to a simulation framework for complex engineered system development [2103.12820]. Within machine learning and explainable AI, however, CECAS specifically denotes a two-stage framework that combines targeted adversarial steering, spurious-factor preservation, diffusion denoising, and mask-based inpainting to produce counterfactual images with a balanced trade-off among validity, sparsity, proximity, and realism [2507.09881].

Source: https://www.emergentmind.com/topics/cecas