Tissue-level Prediction#
The pipeline run_tissue_level_tasks tests a model’s ability to capture
clinically relevant local and global tissue features with pathology tasks such as
cancer grading, subtyping, and treatment response prediction. The model embeds each
tissue as a sequence of tile embeddings; a gated attention-based multiple-instance
learning (ABMIL) classifier trained on the training patients predicts the
patient-level label of the test patients.
Running the Benchmark#
python -m spora_bench.benchmarks.run_tissue_level_tasks \
model_config=<path-to-model-config> \
datasets_config=<path-to-datasets-config> \
benchmarks_config=<path-to-benchmarks-config>
For example, all tissue-level tasks on cords2024cancer using VirTues:
python -m spora_bench.benchmarks.run_tissue_level_tasks \
model_config=configs/models/virtues.yaml \
datasets_config=configs/datasets/virtues/cords2024cancer.yaml \
benchmarks_config=configs/benchmarks/tissue_level/cords2024cancer.yaml
As with cell phenotyping, batched submission of dataset and benchmark configs is possible via lists or wildcards.
The ABMIL architecture and training settings (learning rate, epochs, early
stopping, validation fraction) are read from
configs/downstream_models/abmil.yaml.
Outputs#
Tile embeddings are cached in output_dir/<model_name>/tile_tokens/. For each
task, a classification report and
a bootstrapped classification report (1,000 resamples) are saved to
output_dir/<model_name>/results/.
Benchmark Config#
datasets:
<dataset_name>:
benchmarks:
tissue_level:
<task_name>:
label_col: <column_name>
excluded_classes: <list of classes to exclude>
label_col is a column of metadata/tissues.parquet. Classes listed in
excluded_classes are filtered out prior to training and evaluation.
The datasets and configs used in the paper are listed in the Task Zoo.