Pathology attention-based multi-instance learning predicts single-cell gene expression from histopathology
Abstract
Understanding the tumour microenvironment, its diversity of cell types and underlying gene programs is essential for cancer research and clinical translation. Spatial transcriptomics maps gene expression in intact tissues and has uncovered many biological and prognostic insights, however, the cost and complexity of these methods have limited its application. Furthermore, many well established spatial transcriptomic methods lack the single-cell resolution for detailed characterisation the tumour microenvironment. Deep learning models have been developed to predict gene expression directly from histopathology images, but these models are often constrained to the spatial resolution of the data they are trained on. We developed PathMIL, an interpretable, spatial multi-instance learning approach that uses pathology foundation model extracted features to predict single-cell resolution expression of thousands of genes from standard histopathology images. PathMIL formulates each spot-level measurement as a bag of fine-grained patch-token embeddings. A gene-specific gated attention mechanism assigns distinct attention distributions across tokens, allowing not only for different genes to selectively attend to distinct cellular and morphological niches, but also explainability at gene and pathway levels. The spot-level prediction is supervised via attention-weighted aggregation, enabling the model to infer single-cell spatial expression maps in a single forward pass without requiring cellular-level ground-truth supervision. Applying our model to melanoma Visium datasets for training, we showed accurate prediction at single-cell resolution compared to Xenium ground-truth. The model further benchmarked across 18 HEST-1K breast cancer Xenium single-cell validation slides and demonstrated that PathMIL achieves a mean per-gene Pearson correlation coefficient (PCC) of 0.359, outperforming existing state-of-the-art methods (an increase by 7--160\%) across overlapping spatially variable genes (SVGs). Evaluated on the latest whole-transcriptome 10X Atera data, PathMIL attained PCCs of 0.601 and 0.528 for the top 100 and top 300 SVGs, respectively. With the PathMIL breast cancer trained model applied to H&E images from TCGA-BRCA, IMPRESS and TransNEO cohorts, we demonstrated robust cross-platform generalisation and successfully stratified patients by overall survival and therapeutic responses. Thus, PathMIL offers a scalable approach for single-cell level interpretation of the tumour microenvironment from traditional histopathological tissue images.