Official implementation of PathoSlot, accepted by MICCAI 2026.
Create a Python environment and install the required packages:
conda create -n pathoslot python=3.10
conda activate pathoslot
pip install torch numpy pandas h5py pyyaml tqdm matplotlib seaborn scikit-learn scikit-survivalInstall the CUDA-enabled PyTorch build that matches your system if you plan to train on GPU.
The training scripts expect:
- A split CSV/TSV with sample IDs, fold columns, biomarker labels, and survival labels.
- A task config YAML. See
my_datatsets/zhongshan_config.yamlfor the expected fields. - One
.h5embedding file per sample ID in the embedding directory.
Each .h5 file should contain:
vis_featurestext_featuresname_embedding
Set paths with environment variables:
export PATHOSLOT_SPLIT=/path/to/split.csv
export PATHOSLOT_TASK_CONFIG=/path/to/config.yaml
export PATHOSLOT_EMBEDDINGS_DIR=/path/to/embeddings
export PATHOSLOT_RESULTS_DIR=/path/to/output_dirTrain and evaluate:
python train_slot.pyEvaluate an existing checkpoint:
python test_slot.pyBy default, the scripts fall back to repository-relative placeholder paths under data/ and outputs/.