[Paper Review] The Clever Hans Effect in Anomaly Detection
This paper introduces an explainable AI (XAI) framework to detect the 'Clever Hans' effect—where anomaly detectors rely on spurious, irrelevant features—across diverse unsupervised anomaly detection models. By embedding models in a unified three-layer neural architecture and using pixel-wise explanation matching, it reveals that Clever Hans effects are widespread and structurally induced, not data-driven; however, a simple bagging ensemble of models reduces these effects and improves detection robustness and generalization.
The 'Clever Hans' effect occurs when the learned model produces correct predictions based on the 'wrong' features. This effect which undermines the generalization capability of an ML model and goes undetected by standard validation techniques has been frequently observed for supervised learning where the training algorithm leverages spurious correlations in the data. The question whether Clever Hans also occurs in unsupervised learning, and in which form, has received so far almost no attention. Therefore, this paper will contribute an explainable AI (XAI) procedure that can highlight the relevant features used by popular anomaly detection models of different type. Our analysis reveals that the Clever Hans effect is widespread in anomaly detection and occurs in many (unexpected) forms. Interestingly, the observed Clever Hans effects are in this case not so much due to the data, but due to the anomaly detection models themselves whose structure makes them unable to detect the truly relevant features, even though vast amounts of data points are available. Overall, our work contributes a warning against an unrestrained use of existing anomaly detection models in practical applications, but it also points at a possible way out of the Clever Hans dilemma, specifically, by allowing multiple anomaly models to mutually cancel their individual structural weaknesses to jointly produce a better and more trustworthy anomaly detector.
Motivation & Objective
- To investigate whether the Clever Hans effect—where models exploit spurious correlations—occurs in unsupervised anomaly detection, despite the absence of labeled data.
- To develop a unified, explainable AI (XAI) framework applicable across diverse anomaly detection models to identify which input features drive predictions.
- To quantify the Clever Hans effect in anomaly detection using pixel-wise ground-truth annotations, distinguishing it from data-induced spurious correlations.
- To evaluate whether ensemble methods like bagging can mitigate structural weaknesses leading to Clever Hans behavior and improve detection performance and robustness.
- To demonstrate that model structure, not data, is the primary source of Clever Hans effects in anomaly detection, challenging assumptions from supervised learning.
Proposed method
- Embeds diverse anomaly detection models (KDE, autoencoder, deep autoencoder) into a common three-layer neural network: (i) feature extraction, (ii) distance computation, (iii) pooling, enabling consistent explanation extraction.
- Applies backpropagation through the unified architecture to compute saliency maps identifying input features most influential in the anomaly score.
- Uses a normalized L2-saliency map to quantify feature relevance and computes a 'Clever Hans score' via pixel-wise intersection-over-union (IoU) with ground-truth anomaly annotations.
- Employs a bagging ensemble strategy: averaging standardized outlier scores from KDE, autoencoder, and deep autoencoder models to create a joint detector.
- Standardizes individual model scores over training data to have zero mean and unit variance before averaging, enabling fair comparison and ensemble learning.
- Visualizes and compares explanations across models using the same test images to assess feature coverage and alignment with true anomalies.
Experimental results
Research questions
- RQ1To what extent does the Clever Hans effect manifest in unsupervised anomaly detection models, and in what forms does it appear?
- RQ2Are Clever Hans effects in anomaly detection primarily driven by data spurious correlations or by inherent structural limitations of the models themselves?
- RQ3Can a unified XAI framework be effectively applied across diverse anomaly detection models to extract and compare feature-level explanations?
- RQ4Does combining multiple anomaly detectors via bagging reduce the Clever Hans effect and improve detection performance and generalization?
- RQ5How does the feature coverage of explanations in ensemble models compare to individual models in terms of alignment with ground-truth anomalies?
Key findings
- The Clever Hans effect is widespread in anomaly detection models, with each model exhibiting unique, structurally induced strategies that rely on irrelevant features.
- The Clever Hans effect in anomaly detection is primarily due to model architecture rather than data spurious correlations, as confirmed by analysis across MNIST-C and MVTec datasets.
- The bagged anomaly detector outperforms individual models in terms of robustness and generalization, despite lower ROC AUC scores, because it reduces Clever Hans behavior.
- Explanations from the bagged model show broader and more diverse feature support, with higher IoU to ground-truth anomalies, indicating better alignment with true anomalous regions.
- The average Clever Hans score across all MVTec classes is significantly lower for the bagged model compared to individual models, confirming reduced reliance on spurious features.
- The unified XAI framework successfully enables cross-model comparison of explanations and quantification of model behavior, revealing structural flaws invisible through standard evaluation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.