Introduction
Deep learning classifiers often operate as "black boxes," achieving high accuracy while remaining opaque regarding their decision-making processes. Understanding why a model classifies an image as "perceived older" or "diseased" is critical for trust and safety. Traditional explainability methods, such as Grad-CAM heatmaps, identify where a model looks but fail to specify what attributes (e.g., color, texture, or specific shapes) are influential. GAN-based methods like StylEx can identify attributes but are often restricted to simple, single-object domains and require labor-intensive manual labeling of latent directions.
To address these limitations, we present DiffEx, a novel framework that leverages Vision-Language Models (VLMs) and text-to-image diffusion models to provide fine-grained, hierarchical, and human-readable explanations for classifier decisions.
The DiffEx Framework
DiffEx is a training-free approach that utilizes the semantic power of modern generative AI. The pipeline consists of three primary stages:
- Hierarchical Semantic Corpus: Instead of manual labeling, a VLM (e.g., GPT-4) generates a structured list of attributes for a given domain. For instance, in a bird classification task, the VLM identifies "Beak" as a top-level category, with "Beak Color" and "Beak Shape" as sub-categories, leading down to specific fine-grained values.
- Counterfactual Generation: Utilizing Ledits++ and Stable Diffusion XL (SDXL), the system takes an original image and generates "counterfactual" edits by adding or removing specific attributes from the corpus.
- Beam Search Discovery: To efficiently navigate the vast attribute space, DiffEx employs a beam search-inspired algorithm. It ranks attributes based on their impact on the classifier's logit (confidence) scores, iteratively drilling down from broad categories to specific, influential details.
Experimental Setup and Datasets
The researchers evaluated DiffEx across a diverse array of domains to demonstrate its versatility:
- Faces: FFHQ dataset for age and gender classification.
- Animals: CUB-200-2011 (Birds) and various pet datasets.
- Healthcare: Retinal fundus scans (FLAIR model) for disease detection.
- Agriculture: PlantVillage for plant health assessment.
- Complex Scenes: Food-101, DeepFashion (Formal vs. Casual), and Places365.
Key Insights
Hierarchical Granularity
Classifiers often rely on specific sub-features rather than broad categories. DiffEx is the first to systematically unpack these layers, revealing, for example, that a model might be sensitive to a "Balbo beard" specifically rather than "facial hair" in general.
Revealing Model Bias
DiffEx successfully identifies "shortcuts" or training biases. In a Cat vs. Dog classifier, the presence of a collar significantly increased the "dog" score, indicating the model learned a correlation present in the training data rather than purely biological features.
Multi-Object Reasoning
Unlike GAN-based methods limited to cropped faces, DiffEx can explain complex scenes. It can pinpoint that a "formal" fashion rating is driven by a combination of a specific neckline, a blazer, and even a specific hairstyle.
Results and Impact
- User Preference: In a study with 50 participants, users were significantly better at identifying relevant features using DiffEx (88.4% accuracy) compared to StylEx (76.5%) or Grad-CAM (53%).
- Medical Utility: In retinal disease detection, DiffEx identified clinically relevant features like "macular holes," whereas previous methods only highlighted general regions.
- Data Augmentation: Counterfactual images generated by DiffEx can be used to improve model robustness. Incorporating 100 counterfactual images into the training set improved an age classifier's accuracy on edge cases (e.g., individuals with bangs) from 68% to 96%.
Conclusion and Future Work
While powerful, DiffEx's performance is tied to the VLM's descriptive capabilities and the computational cost of high-quality diffusion generation. Future work will focus on optimizing generation speed and addressing "semantic entanglement," where editing one attribute subtly affects another. Nonetheless, DiffEx represents a significant step toward transparent and interpretable AI through the synergy of generative models and hierarchical reasoning.
Summary updated