Counterfactual Explanations for Face Forgery Detection via Adversarial Removal of Artifacts
Yang Li, Songlin Yang, Wei Wang, Ziwen He, Bo Peng, Jing Dong
TL;DR
This paper tackles the robustness and explainability gap in face forgery detection by introducing counterfactual explanations based on artifact removal in the StyleGAN latent space. By finetuning an e4e encoder and adversarially searching latent codes under detector supervision, the method produces artifact-removed counterfactuals that support two validation channels: human-friendly counterfactual trace visualizations and transferable adversarial attacks that generalize across detectors. Empirical results show strong attack success rates (over 90%) and improved transferability across multiple datasets and models, with ablations indicating the pivotal role of mid-level forgery artifacts. Overall, the approach offers a principled, generative-space mechanism for explaining detector decisions and diagnosing weaknesses, with practical implications for more robust and interpretable face forgery detection systems.
Abstract
Highly realistic AI generated face forgeries known as deepfakes have raised serious social concerns. Although DNN-based face forgery detection models have achieved good performance, they are vulnerable to latest generative methods that have less forgery traces and adversarial attacks. This limitation of generalization and robustness hinders the credibility of detection results and requires more explanations. In this work, we provide counterfactual explanations for face forgery detection from an artifact removal perspective. Specifically, we first invert the forgery images into the StyleGAN latent space, and then adversarially optimize their latent representations with the discrimination supervision from the target detection model. We verify the effectiveness of the proposed explanations from two aspects: (1) Counterfactual Trace Visualization: the enhanced forgery images are useful to reveal artifacts by visually contrasting the original images and two different visualization methods; (2) Transferable Adversarial Attacks: the adversarial forgery images generated by attacking the detection model are able to mislead other detection models, implying the removed artifacts are general. Extensive experiments demonstrate that our method achieves over 90% attack success rate and superior attack transferability. Compared with naive adversarial noise methods, our method adopts both generative and discriminative model priors, and optimize the latent representations in a synthesis-by-analysis way, which forces the search of counterfactual explanations on the natural face manifold. Thus, more general counterfactual traces can be found and better adversarial attack transferability can be achieved.
