Probabilistically Plausible Counterfactual Explanations with Normalizing Flows

Patryk Wielopolski,Oleksii Furman,Jerzy Stefanowski,Maciej Zięba
2024-08-07
Abstract:We present PPCEF, a novel method for generating probabilistically plausible counterfactual explanations (CFs). PPCEF advances beyond existing methods by combining a probabilistic formulation that leverages the data distribution with the optimization of plausibility within a unified framework. Compared to reference approaches, our method enforces plausibility by directly optimizing the explicit density function without assuming a particular family of parametrized distributions. This ensures CFs are not only valid (i.e., achieve class change) but also align with the underlying data's probability density. For that purpose, our approach leverages normalizing flows as powerful density estimators to capture the complex high-dimensional data distribution. Furthermore, we introduce a novel loss that balances the trade-off between achieving class change and maintaining closeness to the original instance while also incorporating a probabilistic plausibility term. PPCEF's unconstrained formulation allows for efficient gradient-based optimization with batch processing, leading to orders of magnitude faster computation compared to prior methods. Moreover, the unconstrained formulation of PPCEF allows for the seamless integration of future constraints tailored to specific counterfactual properties. Finally, extensive evaluations demonstrate PPCEF's superiority in generating high-quality, probabilistically plausible counterfactual explanations in high-dimensional tabular settings. This makes PPCEF a powerful tool for not only interpreting complex machine learning models but also for improving fairness, accountability, and trust in AI systems.
Machine Learning,Artificial Intelligence,Methodology
What problem does this paper attempt to address?
The problem that this paper attempts to solve is how to generate **Probabilistically Plausible Counterfactual Explanations (PPCEs)**. Specifically, the author proposes a new method, PPCEF (Probabilistically Plausible Counterfactual Explanations with Normalizing Flows), aiming to generate counterfactual explanations by combining the probability formula of the data distribution and optimizing plausibility. ### Main Problems and Challenges 1. **Limitations of Existing Methods** - Existing methods usually assume specific parametric distribution families, which limits their adaptability to complex high - dimensional data. - Some methods, while ensuring the effectiveness of counterfactual explanations (i.e., achieving class changes), fail to well maintain the closeness and plausibility to the original instance. - Most methods rely on simple density estimators (such as kernel density estimation or Gaussian mixture models) and are difficult to apply to high - dimensional data. 2. **Objectives** - Propose a new method that can ensure not only the effectiveness but also the plausibility and consistency with the original data distribution when generating counterfactual explanations. - Design an efficient optimization framework that can handle high - dimensional data and significantly improve the computational speed. ### Solutions To overcome the above challenges, the PPCEF method adopts the following strategies: 1. **Use Normalizing Flows for Density Estimation** - Normalizing Flows are a powerful class of density estimators that can capture the distribution of complex high - dimensional data. - Through Normalizing Flows, the probability density of data points can be directly calculated without assuming a specific parametric distribution. 2. **Introduce a New Loss Function** - The loss function balances three objectives: achieving class changes, maintaining closeness to the original instance, and ensuring the probability plausibility of counterfactual explanations. - The new loss function includes constraint terms for effectiveness and plausibility and is optimized by the gradient descent method. 3. **Unconstrained Optimization Framework** - Adopt an unconstrained optimization framework that allows direct optimization of the plausibility property and avoids the strict convexity assumption in traditional methods. - This framework enables PPCEF to efficiently utilize batch - processing techniques, significantly improving computational efficiency. ### Experimental Verification The paper verifies the effectiveness of the PPCEF method through a series of experiments, especially in the following aspects: - **Performance on High - Dimensional Data**: PPCEF performs excellently on high - dimensional datasets and can generate high - quality and probabilistically plausible counterfactual explanations. - **Time Efficiency**: Compared with existing methods, PPCEF has an order - of - magnitude improvement in computational speed. - **Multi - Classification Tasks**: PPCEF is not only applicable to binary classification tasks but can also effectively handle multi - classification problems. In summary, the main contribution of this paper is to propose a new, normalizing - flow - based probabilistically plausible counterfactual explanation method, which solves the limitations of existing methods in high - dimensional data and computational efficiency, providing new ideas and technical means for generating high - quality counterfactual explanations.