In the world of digital pathology, Hematoxylin and Eosin (H&E) stained images are the bread and butter of cancer diagnosis. They are cheap, ubiquitous, and reveal the structural "architecture" of a tumor. However, they don't tell the whole story. To understand the underlying biology, researchers use Spatial Transcriptomics (ST)—a technology that maps gene expression directly onto tissue sections.
The challenge? ST is expensive and data-intensive. Most AI models treat ST as a "teacher" during training and then throw it away during inference, relying solely on images. A new paper, "HistoTx: Early fusion of H&E images and spatial transcriptomics at varying spatial transcriptomics resolution with self-supervised learning," proposes a different path: a model that treats images and genes as equal partners.
TL;DR
HistoTx is a multimodal foundation model that uses "early fusion" to combine pathology images and spatial transcriptomics into a single transformer architecture. By tokenizing both modalities and training with self-supervised learning, it outperforms image-only models at predicting gene expression and can leverage molecular data during inference when available.
What Problem Does This Paper Address?
Current machine learning approaches in pathology usually follow a "vision-centric" strategy. They use ST data to supervise an image encoder (often via contrastive learning like CLIP), but at the end of the day, the model only "sees" pixels during actual clinical use. This leaves a lot of information on the table.
Furthermore, ST data is messy. Different platforms produce data at different scales: Visium provides coarse "spots" (55 µm diameter), while Xenium provides high-resolution coordinates for individual transcript molecules. Building a single model that can handle these varying resolutions and platforms has been a significant hurdle.
Methods
The authors introduce HistoTx, an early-fusion Vision Transformer (ViT). Here’s how it works:
- Unimodal Tokenization: The model breaks H&E images into standard patches. Simultaneously, it converts ST data into "transcript tokens." For Xenium, it counts gene detections in $T \times T$ pixel regions; for Visium, it uses the aggregated spot data.
- Gene Encoding: These transcript count vectors are processed through a frozen Geneformer (a pretrained foundation model for gene expression) to create embeddings.
- Early Fusion: Unlike "late fusion" (where you average results at the very end), HistoTx concatenates the image tokens and transcript tokens into a single sequence. This allows the transformer blocks to model deep, cross-modal interactions between pixels and genes from the start.
- Self-Supervised Pretraining: The model is "warm-started" from a vision-only foundation model and then undergoes continued pretraining using the DINOv2 framework. To force the model to learn cross-modal relationships, they include transcripts in "global views" but keep "local views" image-only, effectively distilling molecular knowledge into the visual encoder.
Datasets
- HEST-1k: A massive dataset containing 1,229 whole slide images (WSIs) with paired Visium or Xenium ST data across 26 organs.
- TCGA (The Cancer Genome Atlas): Used for image-only pretraining (7,924 slides) to ensure the model doesn't lose its fundamental ability to process histology images.
- Downstream Benchmarks: Evaluated on a battery of tasks including breast cancer classification (BACH, BRACS, BreakHis), prostate grading (PANDA, Gleason TMA), and nuclei segmentation (CoNSeP, MoNuSAC).
Key Insights and Ideas
- The "Molecular Booster" Effect: Even when transcripts are not provided at inference, HistoTx performs better than pure vision models on molecular tasks (like gene expression prediction). The multimodal training "reorients" the visual encoder to look for morphological features that correlate with gene activity.
- Resolution Agnosticism: By counting transcripts in flexible $T \times T$ grids, the model can seamlessly train on both high-res Xenium and low-res Visium data within the same architecture.
- Deep Interaction: Early fusion allows the model to learn that a specific visual pattern (like a cluster of immune cells) corresponds directly to specific transcriptomic signatures, rather than just trying to align two abstract feature vectors at the very end.
Key Results
- Gene Expression Prediction: On the HEST-Bench task (predicting 50 highly variable genes from images), HistoTx achieved a Pearson correlation of 0.40, significantly higher than the image-only baseline (0.34) and the contrastive SEAL-CONCH model (0.38).
- Multimodal Inference: When 1,000 input genes were provided alongside the image at inference, the correlation for predicting a target gene panel jumped to 0.38 (compared to 0.32 for image-only).
- Image-Only Performance: For standard classification tasks (like tumor subtyping), HistoTx remained competitive with state-of-the-art vision models, proving that adding molecular knowledge doesn't "break" the model's ability to see.
Limitations and Future Work
The authors noted a slight performance dip in some breast cancer subtyping tasks (e.g., BreakHis). They hypothesize a trade-off: as the model aligns more closely with gene expression, it might lose some of the "subtle morphological detail" required for specific visual subtyping.
Future work could explore whether this trade-off is tissue-specific and how to better balance fine-grained visual discrimination with broad molecular understanding. Additionally, as high-resolution Xenium data becomes more common, the model's ability to capture subcellular transcript patterns will likely become even more powerful.
Summary updated