This repository contains the accompanying code for the preprint:
Joint multi-task learning improves weakly-supervised biomarker prediction in computational pathology
Preprocess your WSI data to obtain feature matrices, slide table and clinical table according to the STAMP protocol. The paper focuses on MSI and HRD combined with signatures from the TME in colorectal cancer and lung adenocarcinoma, respectively. However, this framework is applicable for essentially any combination of categorical and continuous weak labels.
conda create -n joint-mtl-cpath python=3.10 -y
conda activate joint-mtl-cpath
pip install -r requirements.txt
- Edit TrainConfig in
config.py
with the desired targets, data paths and modeling configurations; - Run
python trainer_mtl.py
.
- Edit TestConfig in
config.py
with the respective targets, data paths and modeling configurations; - Run
python test.py
.
The following balancing methods can be selected in the config file:
- Naive -
weight = "equal"
- Uncertainty -
weight = "uncert"
- Dynamic Weight Average -
weight = "dwa"
- Auto-Lambda -
weight = "autol"