TL;DR
This paper introduces MACEM, a model-agnostic method for generating contrastive explanations for any classification model, even without access to its internal workings. It handles both real and categorical features, offering more comprehensive insights than previous methods by identifying what's minimally sufficient to keep a prediction and what's minimally necessary to change it.
What Problem Does This Paper Address?
The increasing complexity and "black box" nature of modern AI models, especially deep neural networks, have created a critical need for explainability (XAI). While some methods exist for explaining differentiable models with full access, many real-world scenarios involve models where only query access (class probabilities) is available, or the model owner is unwilling to share internal details. Furthermore, existing contrastive explanation methods often make strong assumptions about data types (e.g., only real-valued features with specific interpretations of zero) that limit their applicability to structured data, which frequently includes categorical features. This paper addresses the gap by providing a model-agnostic approach that can explain any classifier on structured data, handling both real and categorical features in a principled way.
Methods
The core contribution is the Model Agnostic Contrastive Explanations Method (MACEM). Unlike prior work that required model gradients, MACEM operates solely on query access to the model, making it applicable to any classifier. Key methodological advancements include:
- Model Agnosticism: MACEM only needs to query the model for class probabilities, allowing it to explain models like random forests, boosted trees, and arbitrary ensembles, not just neural networks.
- Handling Real and Categorical Features: The paper proposes novel formulations for computing "pertinent positives" (PPs) and "pertinent negatives" (PNs) that explicitly address the distinct nature of categorical features. This is achieved through two main approaches:
- Frequency Map Approach (FMA): Maps categorical feature values to an ordered interval based on their frequencies, allowing optimization to proceed in this mapped space.
- Simplex Sampling Approach (SSA): Treats categorical features as one-hot encoded vectors and interpolates the model's output over the resulting simplex.
- Principled Base Value Handling: MACEM generalizes beyond the assumption that '0' is always the least interesting value. It allows users to specify base values and also proposes methods to estimate them (median for real features, mode for categorical features) to better capture the "least informative" state.
- Optimization: The method uses projected FISTA (Fast Iterative Shrinkage-Thresholding Algorithm) for optimization, which is efficient for problems with L1 regularization. Gradient estimation is performed using a two-point evaluation method.
Datasets
The paper evaluates MACEM on five public datasets covering diverse domains:
- German Credit: Finance
- FICO: Finance
- Sky Survey: Astronomy
- Vertebral Column: Health care
- Olfaction: Neuroscience
The Olfaction dataset required a specific binarization strategy for its target variable (pleasantness).
Key Insights and Ideas
- Contrastive Explanations Beyond Neural Networks: The ability to generate contrastive explanations for any black-box classifier, not just differentiable neural networks, significantly broadens the applicability of such interpretability techniques.
- Categorical Features are Fundamentally Different: Treating categorical features with specialized methods (like FMA or SSA) is crucial for generating meaningful explanations, as they don't have the same inherent ordering or continuous nature as real-valued features.
- Base Values Matter: The choice of base values significantly impacts the quality of explanations. Using medians/modes as estimated base values provides a more robust and intuitive starting point than assuming '0' is always the baseline.
- PPs vs. PNs Capture Complementary Information: The paper's qualitative evaluation suggests that PPs tend to capture more global, higher-level features, while PNs capture more detailed, input-dependent information, offering a more holistic understanding of model decisions.
Key Results
- Quantitative Evaluation:
- Correct Classification Percentage (CCP): MACEM achieved 100% accuracy in ensuring that generated PPs still belong to the original class and PNs lead to a different class, outperforming LIME.
- Correct Feature Ranking (CFR): MACEM showed higher correlation with ablation-based rankings, indicating it better captures the true importance of features for explanations.
- Correct Feature Importance Percentage (CFIP): MACEM generally outperformed LIME in identifying important features for both PPs and PNs, with PP results being consistently stronger.
- Qualitative Evaluation:
- Human expert evaluations in finance and neuroscience found MACEM's explanations to be more reasonable and insightful than LIME's, particularly for pertinent negatives.
- Comparisons with decision tree paths showed that MACEM's top features often align with important features in the tree, suggesting its explanations are consistent with the model's internal logic.
Limitations and Future Work
- Limitations:
- The paper acknowledges that while MACEM is model-agnostic, it still requires query access to the model.
- The Simplex Sampling Approach (SSA) can be computationally intensive due to averaging and projections.
- The current work focuses on classification models.
- Future Work:
- Extending MACEM to unstructured data (e.g., text, images) by leveraging embeddings or vectorized representations.
- Further exploring the trade-offs between FMA and SSA for categorical features.
- Investigating applications beyond classification.
Summary updated