Mitigating Clever Hans Strategies in Image Classifiers through Generating Counterexamples
Sidney Bender, Ole Delzer, Jan Herrmann, Heike Antje Marxfeld, Klaus-Robert Müller, Grégoire Montavon
TL;DR
This work tackles the problem of Clever Hans predictors caused by spurious correlations in image classifiers, including foundation models. It introduces Counterfactual Knowledge Distillation (CFKD), which uses a counterfactual explainer and teacher feedback to generate and label counterfactuals, enriching the training data and distilling robust decision boundaries without requiring confounder labels. CFKD demonstrates strong, balanced generalization across five datasets, with ablations showing the crucial role of the SCE counterfactual explainer and the choice of teacher. The approach scales to multiple confounders and performs well in low-data settings, offering practical impact for robust AI in safety-critical domains such as medical imaging and industrial quality control.
Abstract
Deep learning models remain vulnerable to spurious correlations, leading to so-called Clever Hans predictors that undermine robustness even in large-scale foundation and self-supervised models. Group distributional robustness methods, such as Deep Feature Reweighting (DFR) rely on explicit group labels to upweight underrepresented subgroups, but face key limitations: (1) group labels are often unavailable, (2) low within-group sample sizes hinder coverage of the subgroup distribution, and (3) performance degrades sharply when multiple spurious correlations fragment the data into even smaller groups. We propose Counterfactual Knowledge Distillation (CFKD), a framework that sidesteps these issues by generating diverse counterfactuals, enabling a human annotator to efficiently explore and correct the model's decision boundaries through a knowledge distillation step. Unlike DFR, our method not only reweights the undersampled groups, but it also enriches them with new data points. Our method does not require any confounder labels, achieves effective scaling to multiple confounders, and yields balanced generalization across groups. We demonstrate CFKD's efficacy across five datasets, spanning synthetic tasks to an industrial application, with particularly strong gains in low-data regimes with pronounced spurious correlations. Additionally, we provide an ablation study on the effect of the chosen counterfactual explainer and teacher model, highlighting their impact on robustness.
