Abstract
The spatial distribution of immune cells in the tumor microenvironment (TME) is a key determinant of immunotherapy response, while current methods are limited by sequencing dependence and restricted spatial resolution. We developed SpaHE-Infil, a multimodal computational framework integrating spatial transcriptomics and whole-slide images to train a Random forest model, extracting morphological, textural, and density features to identify 12 core TME cell types in situ, with dynamic calibration correcting immune cell proportion biases in clinical samples. Cross-cancer validation confirmed its accurate spatial cell distribution prediction, consistent with mIHC and canonical deconvolution algorithms. In clinical cohorts, TME immune infiltration stratification via H&E images predicted enhanced immunotherapy response and prolonged recurrence-free survival across multiple cancers. This framework provides a clinically applicable tool for spatial TME characterization, supporting tumor immunology research, and precision immunotherapy practice.