TorchSurv: A Lightweight Package for Deep Survival Analysis
TorchSurv is a Python package that serves as a companion tool to perform deep survival modeling within the PyTorch environment (Paszke et al., 2019).With its lightweight design, minimal input requirements, full PyTorch backend, and freedom from restrictive parameterizations, TorchSurv facilitates efficient deep survival model implementation and is particularly beneficial for high-dimensional and complex data analyses.At its core, TorchSurv features calculations of log-likelihoods for prominent survival models (Cox proportional hazards model (Cox, 1972), Weibull Accelerated Time Failure (AFT) model (Carroll, 2003)) and offers evaluation metrics, including the time-dependent Area Under the Receiver Operating Characteristic (ROC) curve (AUC), the Concordance index (C-index) and the Brier Score.TorchSurv has been rigorously tested using both open-source and synthetically generated survival data, against R and Python packages.The package is thoroughly documented and includes illustrative examples.The latest documentation for TorchSurv can be found on our website. Statement of needSurvival analysis plays a crucial role in various domains, such as medicine, economics or engineering.Sophisticated survival analysis using deep learning, often referred to as "deep survival analysis," unlocks new opportunities to leverage new data types and uncover intricate relationships.However, performing comprehensive deep survival analysis remains challenging.Key issues include the lack of flexibility in existing tools to define survival model parameters with custom architectures and limitations in handling complex, high-dimensional datasets.Indeed, existing frameworks often lack the computational efficiency necessary to process large datasets efficiently, making them less suitable for real-world applications where time and resource constraints are paramount.To address these gaps, we propose a library that allows users to define survival model parameters using custom PyTorch-based neural network architectures.By combining computational efficiency with ease of use, this toolbox opens new opportunities to advance deep survival analysis research and application.Figure 1 compares the functionalities of TorchSurv with those of auton-survival (Nagpal et al., 2022), pycox (Kvamme et al., 2019), torchlife (Abeywardana, 2021), scikit-survival (Plsterl, 2020), lifelines (Davidson-Pilon, 2019), and deepsurv (Katzman et al., 2018).We notice that existing libraries constrain users to predefined functional forms for defining the parameters (e.g., linear function of covariates).Additionally, while there exist log-likelihood functions in the libraries, they cannot be leveraged.The limitations on the log-likelihood functions include protected functions (locked model architecture), specialized input requirements (format or class type), and reliance on external libraries like NumPy or Pandas.Dependence on external libraries hinders automatic gradient
Authors
- Nicholas Petrick (ORCID: https://orcid.org/0000-0001-5167-8899)
- David Ohlssen
- Peter Krusche
- Mélodie Monod (ORCID: https://orcid.org/0000-0001-6448-2051)
- Thibaud Coroller (ORCID: https://orcid.org/0000-0001-7662-8724)
- Berkman Sahiner (ORCID: https://orcid.org/0000-0003-2804-2264)
- Qian Cao (ORCID: https://orcid.org/0000-0002-1732-8817)
Institutions
- Novartis (Switzerland) (CH)
- Center for Devices and Radiological Health (US)
- Novartis (United States) (US)
Publication Details
- Journal
- The Journal of Open Source Software
- Published
- 2024-12-30
- DOI
- https://doi.org/10.21105/joss.07341
- Citations
- 4
- Primary Topic
- Domain Adaptation and Few-Shot Learning
- Type
- article
- Field-Weighted Citation Impact
- 1.39