Abstract
Ensuring model explainability and robustness is essential for reliable deployment of deep vision systems. Current methods for evaluating robustness rely on collecting and annotating extensive test sets. While this is common practice, the process is labor-intensive and expensive with no guarantee of sufficient coverage across attributes of interest. Recently, model diagnosis frameworks have emerged leveraging user inputs (e.g., text) to assess the vulnerability of the model. However, such dependence on human can introduce bias and limitation given the domain knowledge of particular users. This paper proposes Unsupervised Model Diagnosis (UMO), that leverages generative models to produce semantic counterfactual explanations without any user guidance. Given a differentiable computer vision model (i.e., the target model), UMO optimizes for the most counterfactual directions in a generative latent space. Our approach identifies and visualizes changes in semantics, and then matches these changes to attributes from wide-ranging text sources, such as dictionaries or language models. We validate the framework on multiple vision tasks (e.g., classification, segmentation, keypoint detection). Extensive experiments show that our unsupervised discovery of semantic directions can correctly highlight spurious correlations and visualize the failure mode of target models without any human intervention.
Introduction
Evaluating the robustness of deep learning models is a notorious bottleneck in AI development. Traditionally, researchers rely on massive, manually annotated test sets to identify failure modes. However, these sets are expensive to build and often fail to cover rare "edge cases" or subtle spurious correlations. Recent "model diagnosis" tools have attempted to mitigate this by allowing users to prompt a model with text (e.g., "Does the model fail if the person is wearing a hat?"). Yet, this still relies on human intuition—if a developer doesn't think to check for a specific attribute, the vulnerability remains hidden. Unsupervised Model Diagnosis (UMO) addresses this by automating the discovery of failure modes in a completely unsupervised manner.
The UMO Framework
The UMO framework operates in two main stages: Counterfactual Optimization and Counterfactual Analysis.
1. Counterfactual Optimization
Instead of changing individual pixels, which often creates noisy adversarial images that are uninterpretable to humans, UMO searches the latent space of a generative model (such as StyleGAN or a Diffusion model). It identifies a "direction" in this space that, when applied to an image, causes the target vision model to fail while maintaining visual realism. A multi-direction optimization strategy is employed to discover diverse failure modes, such as changes in lighting or accessories.
2. Counterfactual Analysis
Once a failure direction is identified, UMO explains it by matching visual changes to human-understandable attributes. It utilizes GPT-4 to generate a comprehensive "bank" of potential visual attributes and CLIP to compare the "before" and "after" images. By calculating the difference in the CLIP embedding space, UMO matches the visual change to the most relevant text attributes from the generated bank.
Experimental Results and Insights
The researchers validated UMO across diverse tasks including classification (CelebA, AFHQ), segmentation (ImageNet), and keypoint detection (FITYMI).
Discovery of Spurious Correlations
A key insight from the experiments was the discovery of unintended biases. For instance, in an age classifier, UMO found the model relied heavily on "brown hair" to identify "young" individuals—a classic spurious correlation. Similarly, as shown in the visual results, a gender classifier was found to be biased by "smiling," and an eyeglasses classifier by "lipstick."
Robustness Gains
Beyond diagnosis, the framework enables "Counterfactual Training." By feeding these automatically discovered failure cases back into the model during training, vulnerabilities can be "patched." Experiments showed that models fine-tuned with UMO-generated samples saw their Flip Resistance jump from near 0% to over 96% on certain tasks, without sacrificing standard accuracy.
Conclusion
UMO provides a powerful, task-agnostic method for stress-testing vision models without human intervention. While its effectiveness is currently tied to the expressiveness of the underlying generative model, it represents a significant step toward automated model interpretation and robustness. Future work will explore more disentangled latent spaces to further isolate discovered attributes and improve the precision of visual-to-text translation.
Summary updated