Model Card for THREADS 🧵
A multimodal foundation model for molecular and morphologic data in oncology
Nature Cancer (2026)
[Journal article] | [GitHub repo] | [Benchmark (Patho-Bench)] | [Cite]
What is THREADS?
THREADS is a slide encoder for hematoxylin and eosin (H&E) whole-slide images (WSIs). It takes the CONCH v1.5 patch embeddings of a slide and returns one 1,024-dimensional slide embedding.
THREADS was pretrained on MBTG-47K: 47,171 H&E WSIs from 39 organs, collected at Mass General Hospital, Dana-Farber Cancer Institute/Brigham and Women's Hospital, GTEx and TCGA. Each slide is paired with the molecular profile of the same tissue: bulk RNA sequencing (26,615 slides) or DNA variants and copy-number changes from a targeted gene panel (20,556 slides). During pretraining, contrastive learning pulls each slide embedding towards the embedding of its own molecular profile. On 107 oncology tasks, a linear model on frozen THREADS embeddings, trained with a fixed cost and no tuning, ranked first on 75 tasks against PRISM, GigaPath and CHIEF, with the largest gains in small treatment-response cohorts (see Benchmark for how the evaluation was run).
Requesting Access
As mentioned in the gated prompt, you must agree to the outlined terms of use, with the primary email for your Hugging Face account matching your institutional email. If your primary email is a personal email (@gmail/@hotmail/@qq) your request will be denied. To fix this, you can: (1) add your official institutional email to your HF account, and confirm your email address to verify, and (2) set your institutional email as your primary email in your HF account. Other reasons for your request access being denied include other mistakes in the form submitted, for example: full name includes abbreviations, affiliation is not spelled out, the described research use is not sufficient, or email domain address not recognized.
Model Description
- Developed by: Mahmood Lab AI for Pathology @ Harvard/BWH
- Model type: Multi-head attention-based multiple instance learning (ABMIL) slide encoder, 11.3M parameters
- Input: CONCH v1.5 patch embeddings (768 dimensions) of 512 × 512 px patches at 20× magnification
- Output: one 1,024-dimensional embedding per slide (or per patient)
- Pretraining dataset: MBTG-47K, 47,171 H&E WSIs paired with bulk RNA sequencing or targeted DNA sequencing, from MGH, DFCI/BWH, GTEx and TCGA
- Repository: https://github.com/mahmoodlab/threadsmodel
- Article: https://doi.org/10.1038/s43018-026-01252-w
- License: CC-BY-NC-ND-4.0
Only the slide encoder is released. The RNA and DNA encoders used during pretraining are not part of this repository.
Requirements
pip install git+https://github.com/mahmoodlab/threadsmodel.git
This installs torch, einops and huggingface_hub. THREADS was developed with Python 3.10 and PyTorch 2.3, and runs on GPU or CPU.
Model Usage
Log in to Hugging Face with a User Access Token after your access request is approved:
huggingface-cli login
Extract CONCH v1.5 patch embeddings with TRIDENT (this also needs access to CONCH v1.5):
python run_batch_of_slides.py --task all --wsi_dir ./wsis --job_dir ./trident_processed --patch_encoder conch_v15 --mag 20 --patch_size 512
Then turn the patch embeddings of a slide into a slide embedding:
import h5py
import torch
from threadsmodel.inference import create_model_from_pretrained
# load model
model, precision, embedding_dim = create_model_from_pretrained(
checkpoint_path="hf_hub:MahmoodLab/threads",
cache_dir="./model_assets",
)
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)
# load CONCH v1.5 patch embeddings of one slide
with h5py.File("trident_processed/20x_512px_0px_overlap/features_conch_v15/SLIDE_ID.h5", "r") as f:
patch_features = torch.from_numpy(f["features"][:]).unsqueeze(0) # (1, num_patches, 768)
# extract slide embedding
with torch.inference_mode(), torch.autocast(device_type=device, dtype=precision):
slide_embedding = model(patch_features.to(device))
print(slide_embedding.shape) # torch.Size([1, 1024])
For a patient with several WSIs, concatenate the patch embeddings of all their slides along the patch dimension and pass them through the model once.
Benchmark
THREADS was evaluated on 107 tasks from 35 cohorts. Every number below comes from linear probing of frozen slide embeddings, with one recipe for all slide encoders and no hyperparameter search (the benchmark has no validation sets):
- Classification: logistic regression (scikit-learn) with a fixed cost of C = 0.5, the L-BFGS solver, balanced class weights and up to 10,000 iterations.
- Survival: CoxNet (scikit-survival) with a fixed α of 0.07 for overall survival and 0.01 for progression-free survival.
- Cost ablation: to check that the ranking does not depend on the choice of C, the paper repeats the 97 classification tasks with C = 0.001, 0.01, 0.1, 0.5, 1 and 10 and with an adaptive cost. THREADS has the best average performance at every cost (Extended Data Fig. 2 and Supplementary Table 54 of the paper).
Each task uses its own metric (AUC, balanced accuracy, quadratic weighted kappa or concordance index), and family scores are the average over the tasks in that family. TITAN numbers were produced after the paper with the same tasks, splits and fixed-cost linear-probing recipe. They are not part of the published article, and TITAN is not part of the cost ablation.
Linear probe on frozen slide embeddings, fixed cost C = 0.5 (classification) and fixed CoxNet α (survival). Mean over the tasks in each row.
| Task family | Tasks | THREADS | TITAN | PRISM | GigaPath | CHIEF |
|---|---|---|---|---|---|---|
| Patch encoder | CONCH v1.5 | CONCH v1.5 | Virchow | Prov-GigaPath | CTransPath | |
| Full benchmark | 107 | 0.705 | 0.673 | 0.642 | 0.629 | 0.649 |
| Subtyping, grading and TME characterization | 37 | 0.654 | 0.613 | 0.595 | 0.586 | 0.613 |
| Mutation prediction | 35 | 0.762 | 0.726 | 0.692 | 0.697 | 0.702 |
| IHC status prediction | 15 | 0.804 | 0.788 | 0.747 | 0.696 | 0.733 |
| Prognosis and treatment response | 20 | 0.627 | 0.603 | 0.561 | 0.539 | 0.561 |
The eight treatment response tasks in the benchmark. Linear probe on frozen slide embeddings, fixed cost C = 0.5 (classification) and fixed CoxNet α (survival). The best model on each task is in bold.
| Treatment response task | Cohort | Patients | Metric | THREADS | TITAN | PRISM | GigaPath | CHIEF |
|---|---|---|---|---|---|---|---|---|
| Bevacizumab response, ovarian cancer | OV-Bevacizumab | 36 | AUC | 0.863 | 0.593 | 0.430 | 0.593 | 0.620 |
| Temozolomide response, glioblastoma | GBM-Response (in-house) | 93 | AUC | 0.741 | 0.707 | 0.624 | 0.598 | 0.575 |
| Hormonal therapy response, prostate adenocarcinoma | NADT-Prostate | 36 | AUC | 0.732 | 0.625 | 0.722 | 0.575 | 0.683 |
| Residual cancer burden after neoadjuvant therapy, breast cancer | BC Therapy | 159 | Balanced accuracy | 0.350 | 0.332 | 0.270 | 0.267 | 0.321 |
| Trastuzumab response, HER2-positive breast cancer | HER2-Tumor-ROIs | 85 | AUC | 0.635 | 0.657 | 0.510 | 0.630 | 0.685 |
| Chemotherapy response (RECIST), metastatic breast cancer | MBC | 76 | Weighted kappa | 0.252 | 0.287 | 0.206 | 0.010 | 0.230 |
| Overall survival after chemotherapy, metastatic breast cancer | MBC | 75 | C-index | 0.550 | 0.600 | 0.508 | 0.435 | 0.460 |
| Progression-free survival, high-grade serous ovarian cancer | BOEHMK | 183 | C-index | 0.541 | 0.542 | 0.503 | 0.536 | 0.521 |
Labels and splits for the 95 tasks built on public cohorts are available through Patho-Bench. The other 12 tasks use in-house cohorts that are not public.
License and Terms of Use
This model and associated code are released under the CC-BY-NC-ND 4.0 license and may only be used for non-commercial, academic research purposes with proper attribution. Any commercial use, sale, or other monetization of the THREADS model and its derivatives, which include models trained on outputs from the THREADS model or datasets created from the THREADS model, is prohibited and requires prior approval. Downloading the model requires prior registration on Hugging Face and agreeing to the terms of use. By downloading this model, you agree not to distribute, publish or reproduce a copy of the model. If another user within your organization wishes to use the THREADS model, they must register as an individual user and agree to comply with the terms of use. Users may not attempt to re-identify the deidentified data used to develop the underlying model. If you are a commercial entity, please contact the corresponding author or Mass General Brigham Innovation Office.
Contact
For any additional questions or comments, contact Faisal Mahmood (faisalmahmood@bwh.harvard.edu),
Anurag Vaidya (avaidya@mit.edu),
Andrew Zhang (andrewzh@mit.edu),
or Guillaume Jaume (gjaume@bwh.harvard.edu).
Acknowledgements
THREADS was built on OpenCLIP (contrastive pretraining) and scGPT (RNA encoder). Patch embeddings come from CONCH v1.5, and slides were processed with TRIDENT. We thank the authors and developers for their contributions.
BibTeX
If you find our work useful in your research, please cite our paper:
Vaidya, A.*, Zhang, A.*, Jaume, G.* et al. A multimodal foundation model for molecular and morphologic data in oncology. Nature Cancer (2026). https://doi.org/10.1038/s43018-026-01252-w
@article{vaidya2026multimodal,
title={A multimodal foundation model for molecular and morphologic data in oncology},
author={Vaidya, Anurag and Zhang, Andrew and Jaume, Guillaume and Song, Andrew H and Ding, Tong and Wagner, Sophia J and Lu, Ming Y and Robertson, Harry and Williamson, Drew F K and Doucet, Paul and Almagro-P{\'e}rez, Cristina and Chen, Richard J and ElHarouni, Dina and Ayoub, Georges and Bossi, Connor and Ligon, Keith L and Patrick, Ellis and Beltran, Himisha and MacConaill, Laura and Lindeman, Neal and Sholl, Lynette and Gerber, Georg K and Le, Long Phi and Mahmood, Faisal},
journal={Nature Cancer},
year={2026},
doi={10.1038/s43018-026-01252-w}
}