Counterfactual Explainer Framework for Deep Reinforcement Learning Models Using Policy Distillation

Kurt Debattista, Amir Samadi, Konstantinos Koufos, Mehrdad DianatiarXiv 2023 · DOI

Abstract

Deep Reinforcement Learning (DRL) has achieved significant success in complex decision-making tasks, but its "black-box" nature limits its adoption in safety-critical domains like autonomous driving. This paper proposes the Policy Distillation Counterfactual (PDCF) framework to provide interpretable explanations for DRL models. PDCF leverages policy distillation to map high-dimensional image inputs to low-dimensional, human-understandable features. By generating counterfactuals in this feature space, the framework identifies the minimal changes needed to alter an agent's action while ensuring physical plausibility. Evaluations on Highway-env, Roundabout-env, and Atari Pong demonstrate that PDCF outperforms existing methods in validity, sparsity, and realism.

Introduction: The Interpretability Challenge in DRL

While DRL agents excel at navigating complex environments, understanding the rationale behind their specific actions remains difficult. In autonomous driving, for instance, a sudden lane change must be justifiable to engineers and users. Counterfactual (CF) explanations address this by answering "what if" questions: identifying the smallest modification to the input that would lead the agent to choose a different action.

However, generating CF explanations for image-based DRL is fraught with challenges. Existing generative approaches often result in adversarial noise—pixel-level changes that fool the model but lack human meaning—or implausible states, where generative models like GANs synthesize physically impossible scenarios, such as "ghost" vehicles or multiple game elements.

Conceptual diagram of a counterfactual explainer potentially producing adversarial noise.
Baseline counterfactual methods often generate 'ghost' artifacts and implausible states.

The PDCF Framework

The authors introduce PDCF to bridge the gap between high-dimensional visual inputs and human logic. The framework operates in four distinct stages:

  1. Teacher Training: A primary DRL agent (the "Teacher") is trained on high-dimensional inputs, such as Bird’s Eye View (BEV) images.
  2. Policy Distillation: The Teacher's policy is distilled into a "Student" network. Unlike the Teacher, the Student operates on a low-dimensional set of human-understandable features, such as the relative positions and velocities of surrounding objects.
  3. Counterfactual Generation: Using the Student's simplified feature space, the framework applies gradient-based optimization (specifically the Wachter method) to find the minimal feature adjustments required to flip the predicted action.
  4. Validation: The generated counterfactual is validated against the original image-based Teacher model to ensure the explanation remains faithful to the actual black-box decision logic.

Experimental Evaluation

The PDCF framework was tested across three environments: Highway-env, Roundabout-env, and OpenAI Gym Atari Pong, using DQN, A2C, and PPO architectures.

Key Results

PDCF demonstrated superior performance over baseline methods (Olson et al. and Huber et al.) across several key metrics:

  • Validity: In the Highway environment, PDCF achieved a validity score of 97.38%, indicating high reliability in predicting action changes in the Teacher model.
  • Sparsity: PDCF explanations were significantly cleaner, requiring changes to only 1.5% to 1.9% of input features. In contrast, baseline methods often modified over 80% of the input, leading to noisy explanations.
  • Realism: By modifying object attributes rather than synthesizing pixels from scratch, PDCF maintained high image quality and physical consistency, as measured by FID and LPIPS metrics.

Discussion and Future Work

A core insight of this work is that policy distillation acts as a crucial filter against adversarial noise. By forcing explanations into a structured feature space, PDCF ensures that the resulting "what-if" scenarios are both logical and actionable. Furthermore, these counterfactuals can be aggregated to extract global decision rules, transforming a neural network's weights into inspectable "if-then" logic.

The current limitation of PDCF is its requirement for environments that provide dual representations (images and feature lists). Future research aims to utilize "disentangled representations" to automatically extract these features from raw pixels, expanding the framework's applicability to a broader range of visual DRL tasks.

Conclusion

PDCF represents a significant step toward transparent DRL. By prioritizing plausibility and sparsity through policy distillation, it provides a robust method for auditing complex agents in real-world, safety-critical scenarios.

Summary updated

BibTeX
@misc{debattista2023counterfactual,
  author = {Kurt Debattista and Amir Samadi and Konstantinos Koufos and Mehrdad Dianati},
  title = {{Counterfactual Explainer Framework for Deep Reinforcement Learning Models Using Policy Distillation}},
  year = {2023},
  eprint = {2305.16532},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.16532},
}
Figure