This release is a pre-release and may not be stable for production use.
Multimodal machine learning for oncology: whole-slide pathology, radiology, and clinical records, with time-to-event prediction.
Getting Started | Documentation | Examples | Contributing | Architecture
KaleCancer is an oncology library built on PyKale, a library in the PyTorch ecosystem, aiming to make cancer machine learning more accessible to interdisciplinary research by bridging gaps between clinical data, software, and end users. Both machine learning experts and clinical researchers can do better research with our accessible, scalable, and sustainable design, guided by green machine learning principles. KaleCancer inherits PyKale's unified pipeline-based API and extends it where oncology needs more: multimodal learning across pathology, radiology, and clinical records, and survival analysis for time-to-event outcomes such as overall and disease-specific survival.
Cancer prediction is rarely single-modality. A prognosis draws on a whole-slide image, a CT or MRI scan, and a clinical record at once, and its outcome is a time to an event that is usually censored rather than a class label. MONAI covers 3D medical imaging well but provides neither multimodal fusion nor survival modelling, while general survival libraries provide neither the imaging encoders nor a shared workflow. KaleCancer supplies both in one pipeline, so that a unimodal baseline and a fused multimodal model are the same code path under a different configuration.
Pipeline-based API
loaddataloads tables and patch features keyed by patient id, with survival and classification targets and patient-level splittingprepdatapreprocesses clinical tablesmodelencodes each modality, fuses them (unimodal, early, intermediate or late) and predicts with a survival or classification headevaluatecomputes survival and classification metrics with bootstrap confidence intervals, and cross-validates by patientinterpretexplains predictions, starting with attention weights over patchespipelineruns the workflow: onePipelinefor every model and target, built in Python or from YAML
See architecture for more details.
How to Use
Step 0: Installation
KaleCancer supports Python 3.11 or 3.12.
Install kalecancer from PyPI with uv into your own project:
uv add kalecancer
Or with pip:
pip install kalecancer
KaleCancer is in alpha. Once a final release is out, a newer alpha needs --prerelease allow in uv or --pre in pip. To install the development version from GitHub instead, use uv add "kalecancer @ git+https://github.com/pykale/cancer.git" or pip install "git+https://github.com/pykale/cancer.git".
Heavy libraries are kept out of the core install and grouped into extras, so that a pathology workflow does not pull in a radiology stack. Add one with uv add "kalecancer[<name>]" or pip install "kalecancer[<name>]":
| Extra | Packages | When to use |
|---|---|---|
tabular |
tabicl | Clinical tables through a tabular foundation model |
Step 1: Tutorials and Examples
Run the synthetic example from a clone of the repository. It generates its own cohort, trains an intermediate-fusion Cox model and runs on a CPU in under a minute:
uv run python examples/synthetic/survival.py
The quickstart lists the other examples, including fused multimodal models on real data, and how they differ.
Ask questions on PyKale's GitHub Discussions tab if you need help or create an issue if you find something wrong.
Step 2: Building and Contributing
This is an open-source project welcoming your contributions. You can contribute in three ways:
- Star and fork KaleCancer to follow its latest developments, share it with your networks, and ask questions about it.
- Use KaleCancer in your project and let us know any bugs (& fixes) and feature requests/suggestions via creating an issue.
- Contribute new features, functions, examples or fixes by following the contribution guide to become one of the contributors.
Who We Are
The Team
KaleCancer is developed within the PyKale project at the University of Sheffield, with contributions from many other contributors.
Citation
KaleCancer does not have a publication of its own yet. Please consider citing the PyKale CIKM2022 paper below if you find KaleCancer useful to your research.
@inproceedings{pykale-cikm2022,
title = {{PyKale}: Knowledge-Aware Machine Learning from Multiple Sources in {Python}},
author = {Haiping Lu and Xianyuan Liu and Shuo Zhou and Robert Turner and Peizhen Bai and Raivo Koot and Mustafa Chasmai and Lawrence Schobs and Hao Xu},
booktitle = {Proceedings of the 31st ACM International Conference on Information and Knowledge Management (CIKM)},
doi = {10.1145/3511808.3557676},
year = {2022}
}
Acknowledgements
KaleCancer is built on PyKale and inherits its acknowledgements. The examples use the HANCOCK dataset, a multimodal head and neck cancer cohort released under CC BY 4.0 and licensed separately from this software.
Metadata
Release files for kalecancer 0.1.0a2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kalecancer-0.1.0a2.tar.gz | 108.5 kB | With provenance | Details for kalecancer-0.1.0a2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kalecancer-0.1.0a2-py3-none-any.whl | Python 3 | none | any | Details for kalecancer-0.1.0a2-py3-none-any.whl |
Total release size: 231.9 kB
Release files / kalecancer-0.1.0a2.tar.gz
| Download URL | kalecancer-0.1.0a2.tar.gz |
|---|---|
| Size | 108.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1e463359edac7437c702e8be5f3d133022098ff22bfd63919bb8da646d4e88ca
|
|
BLAKE2b-256 checksum How to use checksums |
ddfb99a63d4323aa2d3c3696fad8f43b54bf92c9cbc6af5882ea40bb067d88a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.
Transparency logRelease files / kalecancer-0.1.0a2-py3-none-any.whl
| Download URL | kalecancer-0.1.0a2-py3-none-any.whl |
|---|---|
| Size | 123.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3254d63ebc5eeaf2a9956edb54adfd2f29672b2f489e04b5b1ab3eb5c4e6b990
|
|
BLAKE2b-256 checksum How to use checksums |
5da95c7230e5ab3788a19fe8555b896cd6b1f8675db4d1dce1bdd381555a3620
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.
Transparency logSecurity for kalecancer 0.1.0a2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for kalecancer-0.1.0a2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.