From Prototypes to Sparse ECG Explanations: SHAP-Driven Counterfactuals for Multivariate Time-Series Multi-class Classification

📅 2025-10-22
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing multiclass classification models for 12-lead ECG lack interpretability, while current counterfactual explanations suffer from poor sparsity and insufficient physiological plausibility. Method: We propose a prototype-driven sparse counterfactual explanation framework that integrates R-peak alignment for enhanced temporal stability, SHAP-based thresholding to identify critical regions, dynamic time warping (DTW) combined with median clustering to extract physiologically informed prototypes, and interval-rule conversion to generate clinically actionable local perturbations. Results: The method achieves 81.3% overall counterfactual validity—reaching 98.9% for myocardial infarction—improves temporal stability by 43%, and generates explanations in under one second, enabling near-real-time clinical interaction. This work is the first to jointly leverage R-peak alignment and prototype sparsification for ECG counterfactual generation, significantly enhancing both physiological credibility and deployment practicality.

Technology Category

Application Category

📝 Abstract
In eXplainable Artificial Intelligence (XAI), instance-based explanations for time series have gained increasing attention due to their potential for actionable and interpretable insights in domains such as healthcare. Addressing the challenges of explainability of state-of-the-art models, we propose a prototype-driven framework for generating sparse counterfactual explanations tailored to 12-lead ECG classification models. Our method employs SHAP-based thresholds to identify critical signal segments and convert them into interval rules, uses Dynamic Time Warping (DTW) and medoid clustering to extract representative prototypes, and aligns these prototypes to query R-peaks for coherence with the sample being explained. The framework generates counterfactuals that modify only 78% of the original signal while maintaining 81.3% validity across all classes and achieving 43% improvement in temporal stability. We evaluate three variants of our approach, Original, Sparse, and Aligned Sparse, with class-specific performance ranging from 98.9% validity for myocardial infarction (MI) to challenges with hypertrophy (HYP) detection (13.2%). This approach supports near realtime generation (< 1 second) of clinically valid counterfactuals and provides a foundation for interactive explanation platforms. Our findings establish design principles for physiologically-aware counterfactual explanations in AI-based diagnosis systems and outline pathways toward user-controlled explanation interfaces for clinical deployment.
Problem

Research questions and friction points this paper is trying to address.

Generating sparse counterfactual explanations for ECG classification models
Improving interpretability of time-series AI models in healthcare applications
Creating clinically valid explanations with high temporal stability and validity
Innovation

Methods, ideas, or system contributions that make the work stand out.

SHAP thresholds identify critical ECG segments
DTW and medoid clustering extract representative prototypes
R-peak alignment ensures coherent counterfactual explanations
🔎 Similar Papers
No similar papers found.
M
Maciej Mozolewski
Jagiellonian Human-Centered AI Lab, Mark Kac Center for Complex Systems Research, Jagiellonian University, Lojasiewicza 11, Kraków, 30-348, Poland
B
Betül Bayrak
Department of Computer Science, Norwegian University of Science and Technology (NTNU), Høgskoleringen 1, Trondheim, 7034, Norway
Kerstin Bach
Kerstin Bach
Norwegian University of Science and Technology, NTNU
Artificial IntelligenceCase-Based ReasoningMachine LearningKnowledge Management
Grzegorz J. Nalepa
Grzegorz J. Nalepa
Jagiellonian University, Kraków, Poland
Artificial IntelligenceKnowledge EngineeringExplainable AIData MiningAffective Computing