DeepSurv

Statistics
Introduced by
Jared Katzman
Year
2018
Type
Neural network-based survival model
Family
Deep Learning

What does it do?

DeepSurv is a survival model that replaces the linear covariate term of the Cox proportional hazards model with a deep neural network, so the effect of covariates on risk can be nonlinear and can include interactions.

Katzman et al. introduced it in 2018, presenting it as a tool for personalized treatment recommendation, and it builds on the earlier neural proportional hazards model of Faraggi and Simon (1995). It is trained with the Cox partial likelihood and is suited to time-to-event data with many covariates.

The intuition behind the method

Cox regression models the log hazard as a linear function of the covariates, so curved effects or treatment-by-covariate interactions must be specified by hand. DeepSurv passes the covariates through a neural network instead. The network's single output for each subject is the log-partial hazard, a log relative risk compared with a reference subject. This output is not the hazard function itself: an individual's hazard is obtained by combining the log-partial hazard with a baseline hazard estimated after fitting. Training uses the same partial likelihood as Cox regression, so the model keeps the Cox-style comparison of risks between subjects while letting the risk score depend nonlinearly on the covariates.

History

Faraggi and Simon (1995) proposed a feed-forward neural network as the nonlinear component of a proportional hazards model for censored survival data, fitted by maximum likelihood. Katzman et al. (2018) introduced DeepSurv as a Cox proportional hazards deep neural network and applied it to personalized treatment recommendation.

When to use it

Choose DeepSurv when there are many covariates, when the relationship between covariates and risk is expected to be nonlinear or to include interactions, and when the goal is individual-level prediction or treatment comparison, for example when treatment effects differ between patient subgroups. It needs enough observed events for the network to be estimated reliably. Do not use the standard form when the proportional hazards structure is doubtful: the network still multiplies a time-dependent baseline hazard by a covariate-dependent factor, so the hazard ratio between two subjects stays constant over time. Do not use it when covariates change over time, or when the main aim is coefficient-level estimates with formal inference; in those cases Cox regression or a parametric model is usually the better choice. Prefer Cox regression when preliminary analysis shows the covariate effects are close to linear.

Limitations and considerations

  • The network has far more parameters than a Cox model, so it needs substantially more data to estimate reliably and can fit noise when events are scarce
  • Architecture choices (depth, width, activation, regularisation strength, learning rate) must be tuned, and results depend on these settings
  • Hazard ratios remain constant over time, so the nonlinear covariate function does not relax the proportional hazards assumption, and time-varying covariate effects are not captured by the standard form
  • A learned hidden representation does not give one coefficient per covariate, so feature importance must be assessed with separate analysis
  • Training is more computationally demanding than fitting a Cox model, and fits from different random starting values can differ

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Models nonlinear covariate effects and interactions directly from the data, without the manual feature engineering a linear Cox model needs to represent treatment-by-covariate interactions
  • Gives an individual risk score (log-partial hazard) and personalized survival curves for each subject, which can support individual treatment comparisons
  • Handles large numbers of covariates through learned representations in the hidden layers, rather than requiring each interaction to be specified in advance
  • Uses the Cox partial likelihood as its training objective, so its risk ranking can be judged with the same concordance-based measures used for Cox models
  • Can be compared directly with Cox regression on the same data, because the two share an objective and differ mainly in the covariate function, which makes it possible to test whether the extra flexibility is needed

Applications

  • Clinical prediction: estimating individual survival for patients from clinical and genetic covariates, as in Katzman et al. (2018), who trained the model on simulated and real clinical survival data
  • Treatment recommendation: comparing predicted survival under alternative treatments for individual patients, where treatment effects differ between patient subgroups (Katzman et al., 2018)
  • Prognostic modelling: Faraggi and Simon (1995) illustrated their neural proportional hazards model, the predecessor of DeepSurv, on survival data for men with prostatic carcinoma. The cited studies concern clinical survival data, and evidence for other domains is not covered here.

How it works

How it works

1

Define the network: an input layer with one unit per covariate, followed by hidden layers with chosen widths and activation functions. The output is a single scalar, the log-partial hazard (log relative risk) for each subject, not a hazard value or a survival probability.

2

Fit the network by minimising the negative Cox partial log-likelihood with gradient-based optimisation and backpropagation, using the observed event times and censoring indicators. L1 or L2 regularisation penalises large weights to limit overfitting.

3

For a new subject, pass the covariate vector through the trained network to obtain its log-partial hazard. Individual survival curves are then obtained by combining this score with an estimate of the baseline cumulative hazard, which is computed from the training data after the network has been fitted.

4

Assess discrimination on held-out test data with the concordance index (C-index), and assess fit with the log-likelihood and calibration plots, before relying on the predicted survival probabilities. The C-index is the proportion of comparable pairs of subjects in which the model assigns the higher risk score to the subject who experiences the event first; under censoring, only pairs whose event order is known are compared. A C-index at chance level indicates little discrimination, and a value approaching perfect ordering indicates strong discrimination. The C-index measures only how well risk is ranked, not whether predicted survival probabilities are accurate, so a model can rank subjects well and still be poorly calibrated. For calibration, compare predicted and observed survival at fixed time horizons, for example by grouping subjects by predicted risk and comparing the average predicted survival with the Kaplan–Meier estimate in each group. Because absolute survival probabilities depend on the baseline cumulative hazard estimated after fitting, a calibration check tests both the network and that baseline estimate.

Common pitfalls

  • Overfitting when regularisation is weak or the validation data are not kept separate from tuning; a high training concordance does not indicate good generalisation
  • Treating the network output as a hazard: the output is a log relative risk, and absolute survival probabilities require the baseline hazard estimated after fitting
  • Applying the model without checking whether proportional hazards is reasonable, since a nonlinear covariate function does not remove the constant hazard ratio assumption
  • Selecting depth and width on a single data split or by fit to the training data rather than by cross-validated concordance, which tends to give architectures that generalise poorly

Frequently asked questions

How does DeepSurv differ from Cox regression?

Cox regression assumes a linear relationship between log-hazards and covariates. DeepSurv replaces this linear term with a neural network, allowing it to learn nonlinear transformations of the covariates. Both use the same partial likelihood objective, but DeepSurv can capture interactions and complex patterns without them being specified in advance.

What is the baseline hazard in DeepSurv, and how is it estimated?

The network estimates only the covariate part, the log-partial hazard, not the baseline hazard. The baseline cumulative hazard is estimated separately after the network is fitted, using the Breslow estimator, the standard estimator for Cox-type models. It is computed from the observed event times and the subjects still at risk at each event time, using the risk scores the fitted network gives those subjects, so it can only be obtained once training is complete.

How many subjects do I need to train a reliable DeepSurv model?

There is no fixed rule. Deep networks generally need more events than Cox regression to be estimated reliably, and the requirement grows with network size. When events are limited, a Cox model or a regularised linear model is usually preferable, and a deeper network should be justified by better validation performance.

Can DeepSurv handle time-varying covariates?

The standard DeepSurv formulation assumes covariates are fixed at baseline, as in Cox regression. Models that accommodate covariates changing over time require a different formulation and go beyond the original method.

How should I choose the network architecture?

Start with a small network and increase its size only if validation performance improves. Tune width, depth, and regularisation strength by cross-validation using the concordance index, and use early stopping on a validation set. L1 or L2 penalties are commonly used to limit overfitting.

What software packages implement DeepSurv?

Several software implementations exist, so the choice should rest on each implementation's documentation. For any implementation, check how the baseline cumulative hazard is estimated after fitting, which regularisation options it provides, whether its concordance index accounts for censoring, and whether the code version matches the method described in the original publication.

Related methods

Sources

  1. Faraggi, D., & Simon, R. (1995). A neural network model for survival data. Statistics in Medicine, 14(1), 73–82.

    Open DOI reference
  2. Katzman, J. L., et al. (2018). DeepSurv: Personalized treatment recommender system using a Cox proportional hazards deep neural network. Journal of Machine Learning Research, 40, 40–51.

    Open DOI reference
  3. Lee, C., Zame, W., Yoon, J., & van der Schaar, M. (2018). Deephit: A deep learning approach for dynamic survival analysis. AAAI Conference on Artificial Intelligence, 32(1).

    Open publication reference