Recent survival models integrating longitudinal data achieve strong predictive performance, but their predictions are often difficult to interpret, limiting their clinical use. We propose DynSurvX, a model-agnostic explainability framework for dynamic survival prediction with mixed static and longitudinal covariates. Based on Shapley values, DynSurvX introduces a hierarchical two-phase strategy that first identifies influential longitudinal features and then adaptively refines their temporal importance, enabling fine-grained explanations while reducing computational cost. The framework provides time-resolved explanations that evolve as new patient data become available. Experiments on simulated and two clinical datasets show varying agreement with theoretical importance across prediction models, with closer agreement for better-performing models, alongside clinically interpretable insights in real-world settings. It remains robust across prediction settings and reduces computation time by 41--80% relative to the temporal explanation baseline, making dynamic explanations practical.
Figures & tables
Figure 1: Simulated dataset – Predictive performance. C-index ( left ) and Brier score ( right ) for CoxSig ( top ), DDH ( middle ), and DySurv ( bottom ) at prediction points (tP,δt) .
Figure 2: Simulated dataset – Feature importance ( top ) and interval-wise feature importance ( bottom ). Theoretical values ( left ) and DynSurvX estimates for CoxSig, DDH, and DySurv ( three right panels ) at a prediction time.
Figure 3: Individual interval-wise feature importance . Observed longitudinal data ( top, left ) and DynSurvX explanations for CoxSig ( top, right ), DDH ( bottom, left ), and DySurv ( bottom, right ).
Figure 4: PBCseq dataset – Feature importance ( top ) and interval-wise feature importance ( bottom ) estimated by DynSurvX for CoxSig ( left ), DDH ( middle ) and DySurv ( right ) at a prediction time. The red dashed line separates longitudinal and static features.
Figure 5: Simulated dataset – Feature importance comparison. Theoretical values ( top , left ) and estimates for DynSurvX ( top , right ), WindowSHAP ( bottom , left ) and JointLIME ( bottom , right ).
Figure 6: Simulated dataset - Interval-wise feature importance . Theoretical values ( left ) and estimates for DynSurvX ( middle ), WindowSHAP ( right ).
Figure 7: Runtime comparison.
Appendix figures & tables25 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 8: Illustration of the DynSurvX algorithm during Phase 2 on a longitudinal trajectory (in orange), between two consecutive splitting iterations (q) and (q+1) . At iteration (q) , the second time window ω2 has an importance score exceeding the threshold δ2 and is therefore split into two smaller windows, while the first time window ω1 remains unchanged. The algorithm terminates at iteration (q+1) , as all window importance scores fall below the threshold δ2 .
Figure 9: Dynamic explanations at two prediction times: tP ( top ) and tP′ ( bottom ). Left panels show the observed longitudinal trajectories up to the prediction time and the corresponding expected remaining restricted survival time. Right panels display normalized interval-specific Shapley values produced by DynSurvX , highlighting how feature–time contributions evolve as new observations become available.
Figure 10: Top: longitudinal trajectories X(t) for a randomly selected individual. Bottom: latent risk process w(t) . The red star indicates the first hitting time of the threshold value w⋆=12 .
Figure 11: Simulated dataset – Example longitudinal trajectories for two individuals, recorded up to their observed times ( left , middle ) and the Kaplan–Meier estimate of the event-time distribution ( right ).
Figure 12: PBCseq dataset – Example longitudinal trajectories for two individuals, recorded up to their observed times ( left , middle ) and the Kaplan–Meier estimate of the event-time distribution ( right ).
Dataset
N
Nexp
h
d
m
ρc
Simulation
1000
200
3
5
56.86
2.6%
PBCseq
312
150
2
5
6.52
57%
MSK-Chord
3253
200
5
2
20.13
51%
Appendix
Table 1: Dataset characteristics: number of samples (N) , number of static features (h) , number of longitudinal features (d) , the average number of observations times over individuals (m) , the number of samples to be explained (Nexp) and the censoring level (ρc) .
Figure 13: MSK-Chord dataset – Example longitudinal trajectories for two individuals, recorded up to their observed times ( left , middle ) and the Kaplan–Meier estimate of the event-time distribution ( right ).
Figure 14: Network structure of DDH. Figure is taken from Lee et al. (2019) .
Figure 15: Different number of evaluated coalitions on simulated dataset
Figure 16: PBCseq dataset – Predictive performance. C-Index ( left ) and Brier score ( right ) of the three models: CoxSig ( top ), DDH ( middle ) and DySurv ( bottom ) evaluated at chosen points (tP,δt) .
Figure 17: MSK-Chord dataset – Predictive performance. C-Index ( left ) and Brier score ( right ) of the three models: CoxSig ( top ), DDH ( middle ) and DySurv ( bottom ) evaluated at chosen points (tP,δt) .
Figure 18: Simulated dataset – Feature importance . Theoretical values ( left ) and estimates for DynSurvX for CoxSig, DDH, and DySurv ( three right panels ) at two prediction times tP=2.15 ( top ) and tP=3.75 ( bottom ), with the red vertical line separates longitudinal features from static features.
Figure 19: Simulated dataset – Interval-wise feature importance . Theoretical values ( left ) and estimates for DynSurvX for CoxSig, DDH, and DySurv ( three right panels ) at two prediction times tP=2.15 ( top ) and tP=3.75 ( bottom ).
Figure 20: PBCseq dataset – Feature importance comparison between estimates obtained with DynSurvX for CoxSig ( left ), DDH ( middle ) and DySurv ( right ) at two prediction times tP=2.35 ( top ) and tP=3.95 ( bottom ), with the red vertical line separates longitudinal features from static features.
Figure 21: PBCseq dataset – Interval-wise feature importance comparison between estimates obtained with DynSurvX for CoxSig ( left ), DDH ( middle ) and DySurv ( right ) at two prediction times tP=2.35 ( top ) and tP=3.95 ( bottom ).
Figure 22: MSK-Chord dataset – Feature importance comparison between estimates obtained with DynSurvX for CoxSig ( left ), DDH ( middle ) and DySurv ( right ) at two prediction times tP=3.3 ( top ) and tP=6.4 ( bottom ), with the red vertical line separates longitudinal features from static features.
Figure 23: MSK-Chord dataset – Interval-wise feature importance comparison between estimates obtained with DynSurvX for CoxSig ( left ), DDH ( middle ) and DySurv ( right ) at two prediction times tP=3.3 ( top ) and tP=6.4 ( bottom ).
Figure 24: Elbow-based selection of δ1 on simulated dataset ( left ) and PBC dataset ( right ). Individual-level sorted longitudinal feature importance scores ( orange ) and their population average ( green ). The elbow point of the mean curve defines the threshold δ1 .
Figure 25: Simulated dataset + median survival time as prediction function – Feature importance comparison between the theoretical values ( left ) and estimates obtained with DynSurvX , together with 95% variability intervals shown as error bars, for CoxSig ( middle ) and DDH ( right ) at two prediction times tP=2.15 ( top ) and tP=3.75 ( bottom ).
Figure 26: Simulated dataset + median survival time as prediction function – Interval-wise feature importance comparison between the theoretical values ( left ) and estimates obtained with DynSurvX , together with 95% variability intervals, for CoxSig, DDH, and DySurv ( three right panels ) at two prediction times tP=2.15 ( top ) and tP=3.75 ( bottom ).
Figure 27: PBCseq dataset + median survival time as prediction function – Feature importance comparison between estimates obtained with DynSurvX , together with 95% variability intervals shown as error bars, for CoxSig, DDH, and DySurv ( three right panels ) at two prediction times tP=2.35 ( top ) and tP=3.95 ( bottom ).
Figure 28: PBCseq dataset + median survival time as prediction function – Interval-wise feature importance comparison between estimates obtained with DynSurvX , together with 95% variability intervals shown as error bars, for CoxSig, DDH, and DySurv ( three right panels ) at two prediction times tP=2.35 ( top ) and tP=3.95 ( bottom ).
Figure 29: MSK-Chord dataset + median survival time as prediction function – Feature importance comparison between estimates obtained with DynSurvX , together with 95% variability intervals shown as error bars, for CoxSig, DDH, and DySurv ( three right panels ) at two prediction times tP=3.3 ( top ) and tP=6.4 ( bottom ).
Figure 30: MSK-Chord dataset + median survival time as prediction function – Interval-wise feature importance comparison between estimates obtained with DynSurvX , together with 95% variability intervals shown as error bars, for CoxSig, DDH, and DySurv ( three right panels ) at two prediction times tP=3.3 ( top ) and tP=6.4 ( bottom ).
Deep learning models for dynamic survival analysis (DSA) achieve strong predictive performance by incorporating longitudinal patient data, but their black box nature limits clinical trust and adoption. Existing explainability methods cannot handle longitudinal, irregular inputs and functional survival outputs simultaneously, which limits their usability in DSA. We propose DynSHAP, a SHAP framework suited specifically for dynamic survival analysis. It extends common marginal SHAP estimators to this setting by treating time--feature pairs as players in the Shapley game. We further introduce Temporal DynSHAP, which learns linear dependencies in features over time and uses conditional sampling to address them in explanations. When applied to synthetic data with known ground-truth attributions, Temporal DynSHAP recovers temporally dependent features more accurately than marginal estimators for a given state-of-the-art model. Applied to two real-world clinical datasets and two DSA architectures, DynSHAP produces attributions faithful to model learning, allowing medical experts to see which patient information drove the prediction and when.
Hazard and survival functions are natural, interpretable targets in time-to-event prediction, but their inherent non-additivity fundamentally limits standard additive explanation methods. We introduce Survival Functional Decomposition (SurvFD), a principled approach for analyzing feature interactions in machine learning survival models. By decomposing higher-order effects into time-dependent and time-independent components, SurvFD offers a previously unrecognized perspective on survival explanations, explicitly characterizing when and why additive explanations fail. Building on this theoretical decomposition, we propose SurvSHAP-IQ, which extends Shapley interactions to time-indexed functions, providing a practical estimator for higher-order, time-dependent interactions. Together, SurvFD and SurvSHAP-IQ establish an interaction- and time-aware interpretability approach for survival modeling, with broad applicability across time-to-event prediction tasks.
Sophie Hanna Langbein, Hubert Baniecki, Fabian Fumagalli +3
Leibniz Institute for Prevention Research and Epidemiology – BIPS · Faculty of Mathematics and Computer Science, University of Bremen · University of Warsaw +3
Predictive maintenance relies on accurate Remaining Useful Life estimation, often formulated using survival analysis over multivariate time-series data. While modern deep survival models achieve strong predictive performance, their black-box nature limits their use in safety-critical settings where actionable insight is required. In this work, we introduce SurvCF(t), the first framework for generating counterfactual explanations for survival models operating on time-series data. SurvCF(t) identifies minimal, plausible, and temporally consistent changes to an asset's operational history that increase its predicted life time, framing explanation as a constrained optimization problem combining validity, proximity, sparsity, and plausibility. We evaluate the method on multiple benchmarks, including C-MAPSS, N-CMAPSS, and a real-world case study of the Scania Component_X dataset, demonstrating its ability to produce actionable and interpretable interventions. Our results show that SurvCF(t) bridges the gap between survival prediction and prescriptive maintenance, enabling explainable and decision-oriented AI for maintenance strategies.
Zara Karazian, Panagiotis Papapetrou, Sindri Magnússon +2
Department of Computer and Systems Sciences (DSV) Stockholm University Stockholm, Sweden · Department of Electrical Engineering (ISY) Linköping University Linköping, Sweden