The Virtual Tissues foundation model resolves spatial proteomics across scales

Wait 5 sec.

MainTissues, particularly in cancer, display pronounced heterogeneity across patients, disease stages and within individual tumours, evident in diverse cell phenotypes, states and spatial organization1. Tumour development and therapy response depend not only on cancer cells but also on their interactions with the surrounding environment, making the spatial organization and function of the tumour microenvironment (TME) central to cancer treatment.Capturing this organization requires molecular imaging beyond traditional methods4. Spatial proteomics technologies, including multiplexed immunofluorescence and imaging mass cytometry (IMC)5, now measure dozens to hundreds of proteins in intact tissue at subcellular resolution, revealing tumour-immune interactions, prognostic spatial niches and mechanisms of therapy resistance across cancer types6 (Fig. 1a).Fig. 1: Overview of the VirTues platform.Full size imagea, Flow chart depicting VirTues capabilities. VirTues converts highly multiplexed images of tissue to virtual tissue representations useful for clinical and biological investigations at cell, niche and sample level, including the retrieval of similar tissue samples for clinical decision support. b, VirTues is trained and evaluated on 15 IMC datasets with a focus on tumours and their TMEs originating from 8 different organ sites, measuring 146 distinct markers in total. The polar plot depicts used marker panels per dataset. A legend of the dataset colour codes is provided in Extended Data Fig. 1a. c, Origins and sizes of datasets in terms of patients, tissue samples and 256 × 256 image crops. d, Multiplexed images are processed crop-wise into three-dimensional grids of image tokens, representing patches of each marker at each position. Marker tokens, derived from a PLM, are fused with the respective image tokens using a linear projection and addition. VirTues is a new ViT architecture trained with a masked autoencoding objective. Input tokens are concatenated with patch summary tokens, which are initialized with learnable weights. During inference, VirTues’ encoder processes this set of tokens. The encoded patch summaries are subsequently convolved with the cell segmentation mask into cell summary tokens or aggregated to niche and tissue summary tokens. For training, a random subset of tokens is selected and masked independently for each channel. VirTues’ decoder predicts channel-wise reconstructions receiving as input the encoded, non-masked tokens from the target channel along with all patch summary tokens. VirTues encoder uses sparse attention mechanisms restricting direct token interactions to either positions (marker attention) or channels (spatial attention). e, Comparison of computational cost (left) and prediction performance (right) between CA-MAE31 and VirTues as a function of the number of markers used.Yet the flexibility that makes these assays powerful also fragments the field: each study uses a customized antibody panel, protocol and platform, so datasets differ in marker identity and number (Fig. 1b), dynamic range and noise. Workflows built for a single assay make it hard to transfer knowledge across cohorts or platforms, reuse annotated references or establish biomarkers that generalize beyond their study of origin7,8. Realizing the field’s promise calls for a unified atlas: a harmonized representation in which heterogeneous cohorts, panels and technologies can be analysed jointly. This has been out of reach because conventional encoders assume a fixed panel and cannot relate markers they were not trained on.Foundation models are suited precisely to this setting: single models trained by self-supervision on large heterogeneous corpora and reused across tasks9. They have reshaped natural language processing10,11,12,13, computer vision14,15,16,17 and biology18,19,20, and now support oncology diagnosis from pathology and radiology21,22,23,24,25. Yet no general-purpose model operates directly on high-plex spatial proteomics across heterogeneous panels: existing encoders require fixed marker panels26,27,28,29,30, scale poorly to highly multiplexed data31,32 or are evaluated on narrow tasks rather than cross-cohort biomarker discovery33,34,35, and most ignore molecular priors about protein structure and function.Here we introduce VirTues—a foundation model for spatial proteomics that captures tissue organization across scales. We use the term ‘virtual tissue’ for a computational, spatially resolved representation of measured tissue state that can be queried, compared, reconstructed and reused across tasks, extending the vision of the ‘AI virtual cell’36. VirTues combines protein language model (PLM) embeddings with a new factorized transformer whose attention scales to high-dimensional multiplex data while preserving interpretability. By embedding every marker through its protein sequence, it places heterogeneous panels in a shared space, turning fragmented cohorts into a queryable virtual tissue atlas. We assemble the largest open-source collection of spatial proteomics data to date: a core resource of 15 IMC cohorts (3,102 patients, 146 markers) underlying most of our analyses, extended to a multi-technology corpus of 32 cohorts spanning four imaging technologies, including CODEX37, Orion4 and MIBI38, more than 5,100 patients and 239 markers (Fig. 1c). Although developed and evaluated primarily on IMC, VirTues is technology-agnostic.Across tasks, VirTues outperforms existing methods and shows the strongest cross-technology generalization among the baselines we evaluate. Trained on IMC alone, it remains competitive with multi-technology competitors, indicating robust zero-shot transfer under marker panel and technology shifts. Beyond these performance gains, VirTues spans the spatial proteomics workflow from end to end: it transforms the earliest steps of analysis workflows, including cell segmentation and cell typing, enables virtual experimentation by virtually staining markers that were never measured and pushes the frontier of discovery. In triple-negative breast cancer (TNBC)2, the spatial signatures it learns predict anti-programmed death-ligand 1 (PD-L1) chemo-immunotherapy response and stratify disease-free survival in an independent cohort3, outperforming previously reported spatial biomarkers2 and current clinical stratification schemes. These signatures mark a new generation of spatial biomarkers: rather than single markers or cell-type frequencies, foundation models capture complex multi-cellular signatures spanning the phenotypes and spatial arrangement of many cell populations. More broadly, VirTues offers a reusable computational layer for spatial proteomics and a blueprint for foundation models that couple tissue understanding with clinically actionable biomarker discovery.A foundation model for spatial proteomicsA pivotal characteristic of foundation models is their ability to leverage larger and more diverse training datasets to achieve superior performance across diverse downstream tasks. However, current vision models for biological imaging27,29,31,32,33, including Vision Transformers14 (ViTs), face several limitations when applied to multiplexed data (Fig. 1e) that constrain their scalability to large, heterogeneous collections. First, their computational complexity scales quadratically with spatial dimensions and channel number, making them impractical for high-dimensional spatial data. Second, their token-based representations treat all channels equally, failing to capture important marker-specific information and to discount redundant information from different markers. Third, they lack explicit mechanisms for integrating datasets with differing marker panels or for incorporating previous knowledge about the probed molecules (for example, protein sequence and structure).We designed VirTues to overcome these challenges as a purpose-built ViT model for multiplexed imaging of proteins and mRNAs. By disentangling the transformer’s attention39,40 into marker and spatial components, VirTues can be trained on images with dozens of channels (Fig. 1e) and separately learns the spatial arrangement and cellular composition that shape a tissue’s molecular profile together with the interrelations between protein and RNA markers. Another critical innovation is a new tokenization scheme for spatial biology: by combining PLM embeddings18 with spatially patched channel information and learnable patch summary tokens, we enable flexible processing of variable marker combinations while incorporating the biological meaning and subcellular spatial distribution of markers (Fig. 1d; Methods). This tokenization and multi-scale design36,41 thus allows VirTues to incorporate markers not seen during training and to integrate heterogeneous datasets measured with different marker combinations (Fig. 1b). Such multiplex-aware tokenization is critical: modality-agnostic designs neither scale nor capitalize on additional markers, whereas VirTues improves consistently with marker depth, especially for the first 20 markers (Fig. 1e).We train and evaluate VirTues on a collection of 15 IMC datasets spanning 8 organ sites (Fig. 1c and Supplementary Table 1) and, to assess cross-technology generalization, extend this corpus with public CODEX, Orion and MIBI studies, resulting in a dataset encompassing 32 clinical cohorts from 17 different tissue origins (Extended Data Fig. 1a–c and Supplementary Table 2). Built on the masked autoencoder (MAE) framework15, VirTues comprises an Encoder and Decoder trained jointly and unsupervised to reconstruct partially masked marker-space tensors (Fig. 2; Methods). By recovering missing information it captures patterns across subcellular, cellular and multi-cellular scales. From this representation, VirTues generates patch, cell, niche and tissue summary tokens (Fig. 1d)—a hierarchical readout that supports tasks from cell annotation and marker inpainting to clinical prediction and biological discovery (Figs. 3–5).Fig. 2: VirTues learns tissue architecture and marker relationships.Full size imagea–c, Masking strategies and reconstruction examples in primary lung cancer42 and breast cancer43 tissue. Visualized images are rescaled to [0, 1] by inverting preprocessing and dividing by the 99th percentile. a, Independent masking. Tokens of each channel are masked independently with a channel-wise random masking ratio of 60–100%. b, Marker masking. All tokens of one randomly chosen marker are masked, other channels remain unmasked. Each row shows inpainting of different channels from the same tissue sample. Scale bar, 100 µm. c, Niche masking. A subset of spatial positions is chosen and all tokens across markers at these positions are masked. Each row shows niche reconstructions of different channels from the same sample. d, Per-dataset reconstruction performance (Pearson correlation, averaged across markers) for independent (circle), marker (cross) and niche (triangle) masking. Baselines predict the mean visible pixel intensity per channel (light grey squares) or infer each marker from its most correlated partner (dark grey diamonds). Performance is assessed on masked tokens only. Dataset colour codes follow Extended Data Fig. 1a. e, Overview of zero-shot marker expression prediction. During training (top), VirTues encodes multiplexed tissue images into a shared virtual tissues space. At inference (bottom), a new dataset with possibly previously unseen markers is encoded by the same model into this space without retraining. Resulting representations support both reconstruction and prediction tasks. f, UMAP of ESM-2-derived marker token embeddings. Markers in the panel of the dataset from Rigamonti et al. 8 are shown in blue, and others in light grey. Circles denote markers seen during pretraining (excluding ref. 8); crosses denote markers unique to that dataset. g, Zero-shot reconstructions of CD14 (seen) and CD63 (unseen) from ref. 8, compared with reconstructions from a model also pretrained on this dataset. h, Marker-wise reconstruction performance on primary lung cancer tissue8 in the zero-shot versus non-zero-shot setting, grouped by seen (left) and unseen (right) markers. Dashed lines indicate per-group averages under marker masking.Fig. 3: VirTues segments and annotates tissues at the single-cell scale.Full size imagea, Cell types are classified with logistic regression using individual cell summary tokens. b, F1 scores for cell type classification for VirTues, KRONOS35 and CA-MAE31 on Cords et al.42, Wang et al.2, Hoch et al.48 and Danenberg et al.6. c, Comparison of F1 scores for cell type classifications between VirTues trained on all pretraining datasets and VirTues trained only on dataset from Danenberg et al.6. d, Comparison of cell type classification performance in the zero-shot and the non-zero-shot setting measured by macro-averaged F1 score. Results are shown for datasets from Cords et al.42, Wang et al.2, Hoch et al.48, Danenberg et al.6. e, VirTues enables cross-cohort cell segmentation and typing. Using harmonized cell type annotations from several datasets, we trained a segmentation head on VirTues’ patch-level representations to jointly predict cell instance masks and semantic cell type masks. The resulting model generalizes to previously unseen datasets, enabling simultaneous segmentation and annotation of tissue images without target-specific retraining or fine-tuning. f, Instance segmentation performance, reported as F1 score at IoU = 0.5, for VirTues, Cellpose49, InstanSeg50 and StarDist51 on datasets excluded from corresponding segmentation model training. g, Cell type classification performance, reported as macro-averaged F1 score, for VirTues, MAPS54 and Astir55 on datasets excluded from corresponding segmentation model training. A legend of the dataset colour codes used in f and g is provided in Extended Data Fig. 1a. h, Comparison of instance segmentation F1 scores across varying IoU thresholds against segmentation baselines (left), and comparison of per-cell type F1 scores with cell typing baselines (right). i, Representative cell type mask generated by VirTues. We compare against the underlying multiplexed imaging data (left) and against the prediction obtained by combining Cellpose49 instance segmentation with Astir55 cell type assignment (right). Error bars (b–d,g,h), 95% confidence intervals estimated using n = 1,000 bootstrap resamples and centred around the bootstrap mean.Fig. 4: Clinical applications of VirTues: risk stratification, diagnostic predictions, and tissue retrieval by similarity.Full size imagea–c, TME-based patient risk stratification. a, Cell-level VirTues representations of oestrogen receptor positive (ER+) METABRIC patients6,57 are clustered with k-means. Per-patient cluster proportion vectors are then re-clustered to define risk groups. b, UMAP of cell summary tokens coloured by risk level. KDE overlays show distributions of cells from vascular stroma and APC-enriched TME structures, previously linked to decreased and increased hazard ratios6. c, Kaplan–Meier survival curves for high- and low-risk groups with log-rank P value. d, Risk ratios of each TME structure in the high-risk group with 95% Wald confidence intervals (n = 541 patients). e, Clinical patient features predicted from patch summary tokens using ABMIL. f, Macro-averaged F1 scores for tissue-level prediction on datasets from refs. 2,6,46. Error bars, 95% confidence intervals (n = 5 training runs). For response prediction on data from ref. 2, performance is reported separately for biopsies collected before, during or after treatment. g, VirTues retrieves similar patient cases from a database of niche summary token representations using optimal transport-based similarity. h–j, Retrieval statistics on Cords et al.42 comparing VirTues, KRONOS35, CA-MAE31 and ResNet26. Red dashed lines, random retrieval; error bars, 95% confidence intervals (n = 1,000 bootstrap resamples). h, Top-three mean precision for cancer subtype, grade, lymph node metastasis and relapse retrieval. P values from two-sided McNemar tests compare VirTues against random retrieval. i, Cell type composition similarity between query and closest match (L1 distance between cell type proportion vectors). j, Molecular composition similarity between query and closest match (sliced Wasserstein distance between marker intensity vectors). k, Exemplary retrieval results on Cords et al.42: each column shows a query tissue and its three closest matches as colour-coded cell type masks with proportional composition colour bars.Fig. 5: Discovery of VirTues biomarkers for treatment response and survival prediction.Full size imagea, NeoTRIP cohort2,59 of 138 patients with breast cancer received chemo-immunotherapy (67 complete pathological responders), sampled before, during and after treatment. b, Virtual tissue (left) and raw mean marker intensity (right) distributions across treatment stages for non-responders and responders (KDE plots over UMAP). The responder signal is detectable only in foundation model-based representations. Black arrows connect the barycenters of consecutive biopsy phases in the UMAP embedding. c, Pre-treatment cell-level virtual tissue representations are iteratively clustered by Leiden at several resolutions. The most predictive clusters serve as biomarkers for joint response prediction. d, UMAP of pre-treatment cell-level representations coloured by cell type. Dashed contours indicate response signature (RS) and non-response signature (NRS) distributions. e, Cross-validated AUROC for response prediction on pre-treatment samples versus the spatial predictor of Wang et al.2 and immune-ratio baselines (tumour-to-CD4 T cell, CD8 T cell and B cell ratios)45,46. Boxes show quartiles; whiskers span 5th–95th percentiles; grey brackets significance versus second-best method (two-sided t-test, P = 2.43 × 10−4, n = 100 splits). f, Cell type composition of signatures and overall proportions. g, Neighbourhood density analysis for apoptotic cells (RS1), CD4 T cells (RS2), and B/plasma cells (RS1). Tree diagrams compare neighbour type frequencies inside (black arrows) versus outside (grey arrows) each signature. Solid arcs indicate significant differences (P