Skip to content

Counterfactual Contrastive Analysis

Yunlong He Pietro Gori
Aug 2026
Artificial Intelligence Computer Vision

Abstract

Visual Counterfactual Explanations (VCEs) aim to explain image classifiers by generating minimally edited and realistic versions of an input image that change the classifier's prediction. Existing VCE methods are inherently classifier-dependent and therefore susceptible to classifier biases and failure modes, such as sensitivity to shortcut features and calibration errors. In this paper, we propose a classifier-free approach for visual counterfactual generation based on Contrastive Analysis (CA). Given two datasets corresponding to different classes (e.g., healthy and patients), we disentangle the generative factors that are common across the two datasets from those that are salient to each dataset, and generate counterfactual images by swapping only the salient factors. By operating directly on data distributions rather than decision boundaries, our method provides model-agnostic VCEs that are less sensitive to classifier biases. Our approach leverages the high-quality synthesis and well-structured latent space of StyleGAN2. We use the feature space F, instead than the usual W-space, to improve detail preservation. Unlike conventional CA approaches, which typically assume salient factors in only one dataset, we introduce an adapted framework and loss functions for VCE that allow multiple salient factors in each dataset. We evaluate our method on three medical imaging datasets and demonstrate superior counterfactual generation quality compared to existing approaches.

View source

Similar papers

Spikformer V2: Join the High Accuracy Club on ImageNet with an SNN Ticket

This work introduces a pioneering exploration of Self-Supervised Learning (SSL) within the SNN, and proposes a novel Spiking Self-Attention (SSA) and Spiking Transformer (Spikformer) that achieves 80+% accuracy on ImageNet.

Zhaokun Zhou, Kaiwei Che, Wei Fang et al. · 69 citations · ⚡10
#artificial intelligence Review Dec 2025

Professional Software Developers Don't Vibe, They Control: AI Agent Use for Coding in 2025

Investigating how experienced developers use agents in building software, including their motivations, strategies, task suitability, and sentiments finds that while experienced developers value agents as a productivity boost, they retain their agency in software design and implementation out of insistence on fundamental software quality attributes.

Ruanqianqian Huang, Avery Reyna, Sorin Lerner et al. · 19 citations · ⚡1
#artificial intelligence Review Open access Jan 2026

A systematic review of machine learning techniques to address diagnosis and treatment of autism: challenges and opportunities

This systematic review evaluates 55 studies from 2017 to 2023 on the application of machine learning techniques to ASD, highlighting key challenges and opportunities, particularly the need for models that can integrate complex data to improve diagnostic accuracy and treatment outcomes.

Rafael Muñoz-Terol, Jesús Peral, Sandra Amador et al. · 4 citations · ⚡1

Convergent Evolution: How Different Language Models Learn Similar Number Representations

This paper identifies two different routes through which models can acquire geometrically separable features: they can learn them from complementary co-occurrence signals in general language data, including text-number co-occurrence and cross-number interaction, or from multi-token addition problems.

Deqing Fu, Tianyi Zhou, Mikhail Belkin et al. · 3 citations
#artificial intelligence Open access Feb 2025

Iterative Flow Matching - Path Correction and Gradual Refinement for Enhanced Generative Modeling

This work explores image generation using flow matching using flow matching and proposes an iterative process that can be integrated into virtually any generative modeling technique, thereby enhancing the performance and robustness of image synthesis systems.

Eldad Haber, Shadab Ahamed, Md Shahriar Rahim Siddiqui et al. · 3 citations
#artificial intelligence Preprint Aug 2026

Iterative tensor network transformations for element-wise evaluation of elementary and filtering functions

Tensor networks are powerful formats for compressing large-scale data. However, their application to general data processing has been limited by the difficulty of performing nonlinear operations. Here, we introduce iterative tensor network transformations (ITNTs), a general algorithmic framework for the element-wise evaluation of elementary and nonlinear filtering functions on data encoded as tensor trains (TTs), a class of tensor networks. Our approach operates entirely in the compressed domain, enabling efficient computation on exponentially large datasets while maintaining a controlled computational cost. We demonstrate its power in two key areas: (I) evaluating highly nonlinear elementary and filtering functions on a 3D reactive flow field, enabling high-fidelity reaction rate computation and region filtering, and (II) finding extrema in complex optimization problems, such as solving Max-SAT instances on spaces up to $2^{70}$ configurations. These results establish ITNT as a foundational tool that provides tensor network methods with the capability for general-purpose data science and large-scale optimization.

Xiao Wang, Tomohiro Hashizume, Pia Siegl et al. · 2 citations

Related blog posts