Counter-DECEIVR: Counterfactual Explanations for Deepfake Detectors using Detector-Guided Rectified Flow Inversion
Organizations: Information Technologies Institute / CERTH, Thessaloniki, Greece · Queen Mary University of London, London, UK
Abstract
Deep-learning-generated media are increasingly passed off as real, driving an arms race between image generators and deepfake detectors. Trust in the latter is limited by their often black-box nature; and, while region-based explanations can sometimes be extracted, these become less useful as generation quality improves. Counterfactual examples, which show the minimal change that flips a detector's decision, reveal what evidence drives a verdict, helping analysts decide whether to trust it. This work introduces Counter-DECEIVR (DEtector-guided reCtifiEd flow InVeRsion for counterfactuals), a novel training-free framework that generates counterfactual examples. Counter-DECEIVR steers latents in the velocity field of a rectified flow model using gradients from off-the-shelf deepfake detectors, without training a generator or adapting the detector; unlike prior methods, it requires no per-instance or per-detector fitting and no diffusion training on the target data. It also leverages the detector's explanation maps to concentrate editing to salient regions, turning low-level feature importance into localised counterfactual edits. A single parameter controls the strength of the edits. Across two deepfake detectors and two widely used forensics datasets, Counter-DECEIVR outperforms prior counterfactual generation methods, including training-based ones. Code will be made available upon acceptance.
Figures & tables
| Dataset | Detector | Method | FR↑ | COUT↑ | FID | LPIPS | SSIM |
| FF++ [ 17 ] | EfficientNet | DISC [ 22 ] | 1.000 | 0.189 | 14.34 | 0.018 | 0.963 |
| ACE [ 5 ] | 0.550 | -0.095 | 27.96 | 0.033 | 0.960 | ||
| Stable Diffusion V1.4 [ 25 ] | 0.983 | 0.437 | 18.73 | 0.053 | 0.913 | ||
| Counter-DECEIVR | 0.998 | 0.815 | 18.65 | 0.036 | 0.963 | ||
| Swin V2 | ACE [ 5 ] | 0.500 | -0.089 | 18.81 | 0.020 | 0.971 | |
| Stable Diffusion V1.4 [ 25 ] | 0.955 | 0.729 | 19.37 | 0.043 | 0.939 |
| Masking | FR↑ | COUT↑ | FID | LPIPS | SSIM |
| No Masking | 1.000 | 0.617 | 21.25 | 0.057 | 0.866 |
| Proposed Grad-CAM-based Masking | 0.998 | 0.815 | 18.65 | 0.036 | 0.963 |
Counterfactual Explanations
Counterfactual explanations show how changing an input could alter a model’s prediction, supporting model understanding, auditing, and actionable recourse.
See all 126 papers