CounterFlow: Target-Conditioned Flow Matching for Visual Counterfactuals
Organizations: Univ Rennes, CNRS, Inria, IRISA - UMR 6074, F35000 Rennes, France · Stellantis Inc. 78300 Poissy, France · Univ Rennes, INSA Rennes, CNRS, Inria, IRISA - UMR 6074, F35000 Rennes, France
Abstract
In eXplainable AI, counterfactual explanations have gained significant traction by offering users direct, intuitive, and actionable insights into model decisions. We introduce CounterFlow, a novel framework based on Conditional Flow Matching that generates visual counterfactual explanations by directly steering a source image toward a user-specified target class. By leveraging target-conditioned vector fields, CounterFlow identifies highly realistic semantic modifications while requiring substantially lower computational overhead than traditional GAN- or diffusion-based architectures. Empirical evaluations on standard benchmarks demonstrate that CounterFlow achieves state-of-the-art performance in both visual realism and target class switching. By working directly in the raw pixel space, CounterFlow offers a more practical solution for real-world deployment.
Figures & tables
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | MNIST | CIFAR10 |
|---|---|---|
| Training steps | 200,000 | 400,000 |
| Warmup steps | 5,000 | 5,000 |
| Minibatch size | 256 | 256 |
| Optimizer | Adam | Adam |
| Learning rate | ||
| EMA decay | 0.9999 | 0.9999 |
| Ablated factor | CV | FID t | FID s |
|---|---|---|---|
| (no ) † | 68.9 | 67.64 | 112.94 |
| (default) | 100.0 | 62.54 | 117.03 |
| 100.0 | 66.78 | 119.77 | |
| 100.0 | 74.01 | 121.82 | |
| (no ) † | 48.9 | 444.88 | 406.14 |
| Ablated factor | CV | FID t | FID s |
|---|---|---|---|
| (default) | 100.0 | 62.54 | 117.03 |
| No context † | 8.6 | 121.72 | 83.24 |
| Explained classifier | Acc. | CV | FID t | FID s |
|---|---|---|---|---|
| RepVGG-A2 (default) | 94.8 | 100.0 | 62.54 | 117.03 |
| RepVGG-A2 w/o input normalization | 86.3 | 100.0 | 64.03 | 115.30 |
| Robust PreActResNet-18 ( Gowal et al., 2021 ) † | 87.5 | 83.5 | 55.72 | 119.89 |
Counterfactual Explanations
Counterfactual explanations show how changing an input could alter a model’s prediction, supporting model understanding, auditing, and actionable recourse.
See all 117 papers