
The complexity of cancer as a disease is in large part driven by its heterogeneity: No two tumors are alike. This heterogeneity manifests itself not only within the individual cancerous cells in terms of their genetic and epigenetic diversity, but also at the scale of the tissue. Cancerous tissues vary enormously between patients, between disease stages, and even within a single tumor, in the kinds of cells present (cancerous and non-cancerous), the states they are in, and how they are arranged in space. And this spatial arrangement matters: How a tumor progresses and whether it responds to treatments depend not just on the cancer cells themselves but on how they interact with their surroundings, in particular the immune system and stroma. Understanding the spatial structure of the tumor microenvironment thus becomes crucial for precision oncology.
Advances in bioimaging methods have made it possible to reveal this structure of the tumor in great detail. Spatial proteomics methods such as multiplexed immunofluorescence and imaging mass cytometry can map the spatial distribution of dozens of proteins in intact tissue at subcellular resolution, thereby exposing cell types, states, signaling mechanisms and interactions between tumor, immune and stromal cells.
However, there is a catch: The complexity of the multiplexed images exceeds what can be interpreted by a human and thus requires computational methods. Moreover, the flexibility that makes the assays powerful has splintered the field. Every study selects its own antibody panel, protocol and imaging platform, so datasets differ in the number and combination of markers they measure as well as their dynamic range and noise. Conventional computational methods are typically defined on a fixed set of markers and thus cannot handle this heterogeneity.
To address these obstacles, we built Virtual Tissues (VirTues), the first foundation model for spatial proteomics, which is trained across cohorts, panels and technologies to learn robust representations of multiplexed tissue images, unlocking various downstream use cases across scales.
A Foundation Model Tailored to Multiplexed Images
Building such a foundation model for spatial proteomics required addressing the unique domain- and data-specific challenges of multiplexed tissue images:
- High dimensionality of the tissue images. Measured at subcellular resolution (typically 0.25 to 1 µm/px), spatial proteomics images range in size from hundreds (tissue microarrays) to tens of thousands (whole-slide images) of pixels per axis. Compared to RGB-based histopathology images, the additional channel axis of the multiplexed measurements further increases the dimensionality of each sample by a factor of 10 to 20.
- Small cohort sizes. Because imaging remains costly, individual cohorts are typically small, ranging from tens to a few thousand samples. This makes data-efficient pretraining across cohorts essential.
- Varying number and combination of measured markers. Spatial proteomics technologies allow flexible measurement of different marker panels. These panels are typically customized to the disease, the tissue of origin, and the goals of each individual study, so the resulting multiplexed images differ both in the number of channels and in the biological meaning of each channel. Existing convolutional and transformer-based architectures are not designed for such heterogeneous inputs, as they assume a fixed number of channels with a fixed meaning.
- Multi-scale requirements of tissue analysis. The expected use cases of spatial proteomics images span scales: cell typing and segmentation at the cell level, biomarker discovery at the niche level, cancer typing and grading at the tissue level and patient stratification at the patient level. Addressing these use cases with a single foundation model requires representations that capture information across scales.
VirTues addresses these challenges through a new vision transformer architecture and pretraining strategy tailored to spatial proteomics.
Biologically Informed Multi-Channel Tokenization
To handle varying numbers and combinations of measured markers, VirTues introduces a novel, biologically informed multi-channel tokenization procedure. Conventional RGB-based vision transformers split an input image into a 2D grid of flattened patches, so each token merges information from all three color channels. VirTues instead tokenizes each channel separately, producing a 3D grid of tokens. Each token is then fused with an embedding of its corresponding marker, derived from a protein language model. Because the subsequent transformer is otherwise permutation-equivariant, these embeddings are what inform it of each token’s biological identity. Since a protein language model can generate embeddings for any protein in the proteome, this tokenization procedure allows VirTues to recognize and distinguish even markers it never encountered during training.

Summary Tokens, Sparse Attention and Multi-Scale Representations
Before passing the multiplex tokens through the encoder, VirTues appends an additional 2D layer of so-called patch summary tokens. Initialized with learnable weights, this layer captures a spatial feature map of the image during encoding, with a dimensionality that is independent of the number of input tokens. The encoder, a transformer, processes the full token set using two attention mechanisms. In spatial attention, tokens attend only to other tokens from the same channel, whereas in marker attention, tokens attend only to other tokens at the same spatial position. These sparse attention mechanisms serve two purposes: they reduce the computational cost that would otherwise arise from the large number of channels, and hence tokens, and they disentangle the learning of spatial patterns from the learning of marker interactions.
Finally, the encoded patch summary tokens are aggregated at the scale of the downstream task. For cell-level tasks, they are pooled over each cell’s segmentation mask to obtain per-cell representations. For niche- and tissue-level tasks, they are aggregated either by mean pooling or, when downstream labels are available for fine-tuning, by attention-based pooling.

Bottlenecked Masked Autoencoder Pretraining
VirTues is pretrained with a masked autoencoder objective. For each input channel, a random fraction of patches is masked independently and excluded from the encoder. Because masking is independent across channels, the model must learn both spatial patterns and interactions between markers. The decoder then reconstructs the masked patches from the encoded tokens, with one key constraint: each channel is reconstructed separately, and the decoder receives only that channel’s encoded unmasked tokens together with the encoded patch summary tokens. All information from other channels must therefore pass through the patch summary tokens, which act as an information bottleneck and force the model to store a rich, cross-channel representation in them. Encoder and decoder are trained jointly by minimizing the mean squared error between the reconstructed and original masked patches.

Generalization Across Cohorts and Panels
VirTues’ encoder-decoder architecture and multi-scale representations support a broad range of downstream tasks, including virtual staining, cell segmentation and typing, diagnostic and therapeutic prediction, biomarker discovery and patient stratification. Crucially, because VirTues learns a shared representation space across marker panels, it generalizes to new cohorts on these tasks, even when they were imaged with different panels. Two applications showcase this ability in detail:
Cross-Cohort Cell Segmentation and Typing
Almost every spatial proteomics analysis starts with the same two steps: segmenting individual cells and assigning each a cell type. Subsequent downstream analyses depend on these annotations, yet they are typically generated anew for every study, using generic segmentation tools and dataset-specific labeling procedures. Annotating a new cohort remains slow, expert-driven work, and the resulting labels are often inconsistent across studies.
VirTues’ shared representation space allows us to simplify and harmonize this annotation process by fine-tuning a segmentation head on top of the patch summary tokens. The head jointly predicts instance masks, which separate individual cells, and semantic masks, which assign their types. To evaluate this approach, we first harmonized cell-type annotations across nine datasets. We then trained the segmentation head in a leave-one-dataset-out scheme: in each turn, one dataset was held out entirely and used only for evaluation, providing a direct test of generalization to unseen cohorts.
VirTues outperformed the established segmentation tools Cellpose, InstanSeg and StarDist on 8 of 9 datasets. On manual inspection, its masks were often more accurate than the provided ground truth. For cell typing, it surpassed the specialized methods MAPS and Astir on all but one dataset, with gains of up to 27%, and performed more consistently across cell types.

These experiments demonstrate that a single model can segment and annotate a previously unseen cohort out of the box, a major step toward consistent, atlas-scale annotation of spatial proteomics data.
Automated Biomarker Discovery and Response Prediction
Immune checkpoint inhibitors have transformed cancer therapy, yet only a subset of patients respond. Biomarkers that predict response therefore hold great potential, both for personalizing treatment and for uncovering the biological mechanisms that drive or hold back response. However, most existing biomarkers rely on hand-crafted, panel-dependent features, which makes it difficult to apply them, and thus validate them, across independent cohorts.
VirTues enables us to automatically discover virtual biomarkers in one cohort and easily transfer them to another. In the triple-negative breast cancer cohort of the NeoTRIP trial, in which 138 patients received chemotherapy plus the anti-PD-L1 antibody atezolizumab, we embedded every cell with VirTues and ran an automated, iterative search combining clustering and scoring to identify latent signatures predictive of response. We retained the four signatures with the strongest individual predictive power: two associated with response and two with non-response. Combined, their per-patient frequencies predicted response with an AUROC of 0.823, outperforming both the hand-crafted, state-of-the-art spatial predictor of Wang et al. (+5%) and classical immune-ratio biomarkers (+26–32%).
To test generalization, we transferred the signatures using simple classifier models to an independent triple-negative breast cancer cohort that was used neither for pretraining nor for discovery. In this independent cohort, we observed that the same signatures stratified patients into groups with distinct disease-free survival (a surrogate task since response labels were not reported) and reached a concordance index of 0.628, exceeding the cohort’s original stratification system and ratio-based baselines.

Outlook: Toward Virtual Patient Representations
VirTues shows that a single model can learn a shared representation of tissue that holds across cohorts, marker panels and technologies. We see this as a first step toward a larger goal: a virtual representation of the patient.
Spatial proteomics captures only one view of a patient. Clinical decisions draw on many more modalities, such as histopathology, genomics or transcriptomics. The next step is to integrate all of these modalities into a single patient representation that can be queried for any biological or clinical question.
Such a representation should not stop at a snapshot. Tumors evolve, both on their own and under treatment, and the questions that matter most in the clinic are about the future: How will the disease progress? How would this patient respond to one treatment rather than another? A virtual patient model that captures not only the current state but also forecasts its dynamics, including counterfactual treatment responses, could make these questions answerable, helping clinicians choose the right treatment for each patient.
