Viyan

Viyan AI

Attributing Patient Risk with DynSHAP

DynSHAP assigns attribution scores to longitudinal patient data in survival analysis models by treating time-feature pairs as individual players.

DynSHAP assigns attribution scores to longitudinal patient data in dynamic survival analysis models, replacing the opaque predictions typical of deep learning approaches. In survival analysis, features are both temporally dependent and functional, meaning the model predicts a survival probability curve over time rather than a static classification. To resolve this, DynSHAP treats every time-feature pair as a discrete player in the game. It computes the Shapley value for each pair by taking the weighted average of the change in the survival curve across all possible permutations of these pairs. By testing how the output shifts as you add or remove a specific time-feature pair from the subset, the algorithm isolates the exact influence of that data point on the final survival projection.

The Mechanism of Conditional Attribution

Temporal DynSHAP uses conditional sampling specifically to account for linear dependencies in features over time. The framework treats a patient's history as a sequence of states. To isolate the impact of a new measurement, it uses an auxiliary model, such as a recurrent neural network, to predict the current feature's value based on all preceding observations. For any specific subset used in the Shapley calculation, the model's prediction is compared against a version where the target time-feature pair is replaced by its conditional expectation. This subtraction is the core calculation for a single subset; it effectively zeros out contributions that were already predictable from earlier data. Aggregating these values across all possible permutations allows the system to isolate the innovation provided by each clinical event.

Evaluating Temporal Influence

Consider a patient in a study on heart failure. A model might flag a patient as high risk based on a sudden change in blood pressure at month four. Standard attribution methods might mistakenly attribute this risk to the average blood pressure over the entire study. Temporal DynSHAP isolates the conditional change at month four from the preceding months. The difference between the survival curve generated with the observed value and the curve generated with the conditional expectation highlights the specific temporal influence the model assigned to that clinical event. A clinician interprets these scores by comparing the attribution of physiologically plausible markers against erratic or out-of-range sensor readings, which often represent noise rather than clinical signal.

While this framework effectively maps individual events to model output, it remains a technique for interpreting existing models rather than a way to improve the underlying predictive power. It assumes the auxiliary model accurately captures the data's dependencies; if the auxiliary model fails to model the temporal relationships correctly, the attribution scores will not accurately reflect the primary model's decision-making process. The reliability of the attribution depends entirely on the accuracy of the conditional expectations derived by this auxiliary step, which is an open area for validation in complex, multi-modal clinical datasets.

Sources