Clear improves visual counterfactual explanations preserving image details
CLEAR: Cooperative Latent Flow for Visual Counterfactual Explanations with Accurate Region Preservation
Computer Vision and Pattern Recognition
Summary
Visual counterfactual explanations show what minimal changes would flip an image classifier’s decision, while keeping the image realistic. The authors identified problems in previous methods that work in the image or latent space that make these changes less accurate or slower. They proposed CLEAR, a technique that guides the generation process to cooperate better with the classifier’s goals while preserving unaltered parts of the image. CLEAR produces explanations that are fast, faithful, and keep irrelevant details unchanged, improving over existing methods in various tasks.
What this means in practice
- •For machine learning engineers: Generate efficient, realistic visual explanations to debug and improve image classifiers with reduced artefacts.
- •For ai product teams: Build user-friendly visual explanation features that reveal model decision boundaries clearly and quickly for transparent AI.$Commercial implications: This paper enables development of fast and accurate visual explanation tools that can be marketed as value-added features in AI platforms.
Authors
Yan Zeng, Changlu Guo, Oskar Kristoffersen, Anders Nymark Christensen, Morten Rieger Hannemose, Anders Bjorholm Dahl
Abstract
Visual counterfactual explanations (VCEs) should alter a classifier's prediction while remaining realistic and preserving decision-irrelevant content. Image-space methods provide high-quality counterfactuals but are computationally costly, whereas latent-space methods are more efficient but often less faithful. We identify two sources responsible for this gap. First, latent generation recovers a natural sample from a perturbed representation, whereas classifier guidance pushes it toward a target class, so their update directions may oppose. Second, VAE reconstruction can alter regions that should remain unchanged. We introduce CLEAR, a latent Flow Matching framework for VCEs. CLEAR uses Flow Matching's explicit instantaneous velocity as a reference for the generative direction to decompose classifier guidance into cooperative and conflicting components. It preserves the cooperative component and adaptively attenuates only the conflicting one according to conflict strength. We further analyze conflict frequency and strength throughout generation to reveal how classifier guidance interacts with the generative process. CLEAR also dynamically identifies editable regions, constrains latent modifications, and directly preserves factual content outside them to reduce VAE-induced changes. Across five bidirectional tasks on two datasets, CLEAR retains latent-space efficiency while achieving counterfactual quality comparable to or better than strong image-space baselines, with a 2.5x speedup over the strongest baseline. Project page: https://yan-zen9.github.io/CLEAR/