CounterNet: End-to-End Training of Prediction Aware Counterfactual Explanations
Hangzhi Guo, Thanh Hong Nguyen, Amulya Yadav
Abstract
This work presents CounterNet, a novel end-to-end learning framework which integrates Machine Learning (ML) model training and the generation of corresponding counterfactual (CF) explanations into a single end-to-end pipeline. Counterfactual explanations offer a contrastive case, i.e., they attempt to find the smallest modification to the feature values of an instance that changes the prediction of the ML model on that instance to a predefined output. Prior techniques for generating CF explanations suffer from two major limitations: (i) all of them are post-hoc methods designed for use with proprietary ML models --- as a result, their procedure for generating CF explanations is uninformed by the training of the ML model, which leads to misalignment between model predictions and explanations; and (ii) most of them rely on solving separate time-intensive optimization problems to find CF explanations for each input data point (which negatively impacts their runtime). This work makes a novel departure from the prevalent post-hoc paradigm (of generating CF explanations) by presenting CounterNet, an end-to-end learning framework which integrates predictive model training and the generation of counterfactual (CF) explanations into a single pipeline. Unlike post-hoc methods, CounterNet enables the optimization of the CF explanation generation only once together with the predictive model. We adopt a block-wise coordinate descent procedure which helps in effectively training CounterNet's network. Our extensive experiments on multiple real-world datasets show that CounterNet generates high-quality predictions, and consistently achieves 100% CF validity and low proximity scores (thereby achieving a well-balanced cost-invalidity trade-off) for any new input instance, and runs 3X faster than existing state-of-the-art baselines.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
3 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
Cited by top-tier papers3
- Causal Explanation-Guided Learning for Organ AllocationAlessandro Marchese, Jeroen Berrevoets, Sam VerbovenNeurIPS 2025 · 1 citation
- Counterfactual Concept Bottleneck ModelsGabriele Dominici, Pietro Barbiero, Francesco Giannini, Martin Gjoreski et al.ICLR 2025
- Explain Yourself, Briefly! Self-Explaining Neural Networks with Concise Sufficient ReasonsShahaf Bassan, Ron Eliav, Shlomit GurICLR 2025
Builds on11
- Manipulating and Measuring Model InterpretabilityForough Poursabzi-Sangdeh, Daniel G. Goldstein, Jake M. Hofman, Jennifer Wortman Vaughan et al.CHI 2021 · 663 citations
- HYDRA: Pruning Adversarially Robust Neural NetworksVikash Sehwag, Shiqi Wang, Prateek Mittal, Suman JanaNeurIPS 2020 · 242 citations
- Evaluation of Neural Architectures trained with square Loss vs Cross-Entropy in Classification TasksLike Hui, Mikhail BelkinICLR 2021 · 199 citations
- Towards Robust and Reliable Algorithmic RecourseSohini Upadhyay, Shalmali Joshi, Himabindu LakkarajuNeurIPS 2021 · 145 citations
- Explanation by Progressive ExaggerationSumedha Singla, Brian Pollack, Junxiang Chen, Kayhan BatmanghelichICLR 2020 · 116 citations
Related papers
- MaskDiME: Adaptive Masked Diffusion for Precise and Efficient Visual Counterfactual ExplanationsChanglu Guo, Anders Nymark Christensen, Anders Bjorholm Dahl, Morten Rieger HannemoseCVPR 2026 · 2 citations
- CLEAR: Generative Counterfactual Explanations on GraphsJing Ma, Ruocheng Guo, Saumitra Mishra, Aidong Zhang et al.NeurIPS 2022 · 83 citations
- LeapFactual: Reliable Visual Counterfactual Explanation Using Conditional Flow MatchingZhuo Cao, Xuan Zhao, Lena Krieger, Hanno Scharr et al.NeurIPS 2025 · 5 citations
- CF-OPT: Counterfactual Explanations for Structured PredictionGermain Vivier-Ardisson, Alexandre Forel, Axel Parmentier, Thibaut VidalICML 2024 · 3 citations
- Cycle-Consistent Counterfactuals by Latent TransformationsSaeed Khorram, Fuxin LiCVPR 2022 · 27 citations
