NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

RankByGene: Gene-Guided Histopathology Representation Learning Through Cross-Modal Ranking Consistency

Wentao Huang, Meilong Xu, Xiaoling Hu, Shahira Abousamra, Aniruddha Ganguly, Saarthak Kapse, Alisa Yurovsky, Prateek Prasanna, Tahsin Kurc, Joel Saltz, Michael L. Miller, Chao Chen

TL;DR

RankByGene is a novel framework that bridges the gap between histopathology images and molecular biology by aligning image features with spatial transcriptomics (ST) data. By enforcing consistent similarity rankings across modalities and using self-supervised distillation, it learns "gene-informed" image representations that significantly outperform existing methods in predicting gene expression, cancer mutations, and patient survival.

What Problem Does This Paper Address?

In digital pathology, H&E-stained slides are the gold standard for diagnosis. However, visual morphology alone often fails to capture the underlying functional state of cells—information typically hidden in gene expression. Spatial Transcriptomics (ST) can map these gene expressions directly onto tissue locations, but it is prohibitively expensive for routine clinical use.

The challenge lies in "distilling" this molecular knowledge into image-based models. Existing cross-modal alignment methods often struggle with:

  1. Spatial Distortions: ST data and histology images rarely align perfectly.
  2. Modality Noise: Gene expression data is high-dimensional and extremely sparse (often >80% zeros).
  3. Representation Drift: During training, an image encoder might "forget" important visual features while trying too hard to match noisy gene signals.

Methods

The authors propose RankByGene, a framework designed for robust multi-modal alignment. Its architecture consists of three main pillars:

  1. Cross-Modal Ranking Consistency Loss ($L_{rank}$): Instead of just trying to match a specific image patch to its corresponding gene profile (local alignment), this loss ensures that the relative similarity between different spots is preserved across both modalities. If spot A's gene profile is more similar to spot B's than to spot C's, the model forces the image features to follow that same ranking. This provides a global structural constraint that is more robust to noise than exact similarity matching.
  2. Intra-Modal Distillation Loss ($L_{distil}$): To prevent representation drift, the authors use a teacher-student architecture. A "teacher" encoder processes weakly augmented patches, while a "student" processes strongly augmented versions. The student is trained to match the teacher's output, acting as a stability anchor that preserves visual grounding.
  3. Gene-Image Contrastive Loss ($L_{gene-image}$): A standard InfoNCE loss is used to pull paired image and gene features together in a shared latent space.
Overview of the RankByGene framework, showing the teacher-student architecture and the various loss functions used for alignment.

To make the $O(N^3)$ triplet ranking loss computationally feasible, the authors implemented an efficient sampling strategy that reduces complexity to $O(N^2)$ without sacrificing accuracy.

Datasets

The model was trained and evaluated on a diverse set of public datasets:

  • HEST-1k: A large-scale collection of breast and lung ST data used for pretraining.
  • 10x Genomics Visium: Two external breast ST samples (Breast-ST1 and Breast-ST2) for rigorous testing.
  • TCGA (The Cancer Genome Atlas): BRCA (breast) and LUAD (lung) cohorts used for downstream tasks like mutation classification and survival analysis.
  • BCNB: A breast cancer dataset used for slide-level classification.

Key Insights and Ideas

  • Ranking is More Robust than Matching: The "aha moment" here is that relative rankings are more reliable than absolute similarity values when dealing with noisy, sparse biological data. By focusing on the order of similarities, the model tolerates modality-specific distortions better.
  • Global Structure Matters: Most previous methods only looked at local spot-to-spot pairs. RankByGene looks at how spots relate to each other across the entire slide, capturing broader biological patterns.
  • Stability via Distillation: The teacher-student setup acts as a "sanity check," ensuring the image encoder doesn't lose its ability to recognize basic pathology features while chasing complex gene signals.
Comparison of gene-image distances. RankByGene shows a much stronger linear correlation ($R^2=0.422$) compared to baselines, indicating superior cross-modal alignment.

Key Results

RankByGene demonstrated state-of-the-art performance across several benchmarks:

  • Gene Expression Prediction: Achieved a Pearson Correlation Coefficient (PCC) improvement of 9% to 34% over baselines for top-expressed genes.
  • Mutation Classification: Showed superior AUC scores for predicting critical mutations like EGFR, KRAS, and TP53 from images alone.
  • Survival Analysis: Outperformed existing models in predicting patient mortality risk (C-Index).
  • Qualitative Alignment: t-SNE visualizations show that RankByGene features form distinct clusters that align closely with biological markers like ERBB2 (tumor) and COL3A1 (stroma), far exceeding the clustering quality of standard self-supervised methods.
Fig. 1: t-SNE [14] visualization of image features of different spots in an ST slide. We show the feature learned using different methods, including (a) SSL on natural images, (b) SSL on histopathology images, (c) CL on ST data using InfoNCE loss [15], and (d) RankByGene. Learning with gene information (c) clearly outperforms learning with images alone ((a) and (b)). Furthermore, our method (d) achieves even greater improvement, demonstrating better inter-class separability than (c), thanks to the proposed contributions. Each spot is assigned a label via K-means clustering on gene expression values; the corresponding image features are then color-coded by these labels. We also provide quantitative measures using v-score [16], where a higher value indicates better alignment of image features with gene expression.

Limitations and Future Work

While powerful, the authors note a few areas for growth:

  • Data Scarcity: Although ST data is growing, it is still limited compared to pure histology datasets. The model's performance is currently bound by the availability of high-quality paired ST-image data.
  • Tissue Specificity: The current study focuses heavily on breast and lung cancers. Extending this to a wider variety of tissue types and rare diseases remains a future challenge.
  • Computational Cost: Even with optimized sampling, training on massive whole-slide images with high-dimensional gene profiles requires significant GPU resources.

Overall, RankByGene represents a significant step toward "virtual transcriptomics," where deep learning can extract deep molecular insights from simple, inexpensive H&E slides.

Summary updated

BibTeX
@misc{huang2024rankbygene,
  author = {Wentao Huang and Meilong Xu and Xiaoling Hu and Shahira Abousamra and Aniruddha Ganguly and Saarthak Kapse and Alisa Yurovsky and Prateek Prasanna and Tahsin Kurc and Joel Saltz and Michael L. Miller and Chao Chen},
  title = {{RankByGene: Gene-Guided Histopathology Representation Learning Through Cross-Modal Ranking Consistency}},
  year = {2024},
  eprint = {2411.15076},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.15076},
}
Figure