A framework for transparent modeling of spatial signaling in the tumor microenvironment
SpatialMMKPNN is a graph-based framework that makes spatial transcriptomics interpretable. It integrates Graph Attention Networks (GATs) with a Knowledge-Primed Neural Network (KPNN) decoder so that cell–cell communication is not only predicted but explained through biological programs—pathways, ligand–receptor pairs, and regulatory modules.
Unlike conventional GNNs, SpatialMMKPNN introduces a concept bottleneck, constraining latent representations to known molecular concepts. The framework reveals how tumors spatially organize signaling programs—where angiogenic, fibrotic, or immune-modulatory axes localize, and how they rewire after therapy. It bridges machine learning interpretability and spatial systems biology, producing pathway-level maps that can be validated across datasets and laboratories.
SpatialMMKPNN constructs a tissue graph where nodes represent spatially resolved spots or cells, and edges encode both geometric proximity and transcriptomic similarity.
A GAT encoder learns neighborhood attention weights reflecting local communication strength, while a biologically constrained decoder projects embeddings onto pathway and transcription-factor layers (Reactome, KEGG, Omnipath).
The attribution module computes node- and edge-level relevance via integrated gradients and attention maps, linking model predictions to interpretable molecular mechanisms.
To ensure transparency and reproducibility, each module—Prototype, Immune Exclusion vs Infiltration (IEvI), Stromal Remodeling, and Therapy-Induced Rewiring (TIR)—is implemented as a self-contained notebook with annotated logic, figures, and automated output export.
SpatialMMKPNN captures both the structure and meaning of spatial communication across progressively complex contexts:
-
Prototype Module – a controlled demonstration in which synthetic ligand–receptor axes (CXCL12→CXCR4, TGFB1→TGFBR2, IFNG→IFNGR1) were embedded into the spatial design. The model successfully recovered all seeded pairs, achieving high correspondence between predicted and known signaling locations (r ≈ 0.93), validating interpretability and sensitivity of the concept-bottleneck design.
-
Immune Exclusion vs Infiltration (IEvI) – identifies rim-enriched VEGFA→KDR and SPP1→Integrin signaling, exposing angiogenic and adhesive barriers that restrict immune access to tumors.
-
Stromal Remodeling – quantifies fibrotic (TGFB) and adhesive (SPP1) programs defining stromal interfaces, demonstrating robustness in FFPE slides and under variable RNA quality.
-
Therapy-Induced Rewiring (TIR) – tracks spatial relocation of signaling axes after treatment, distinguishing magnitude shifts from spatial redistribution (e.g., VEGFA–KDR inward shift Δshare +0.16).
Across all applications, pathway attributions and ligand–receptor rankings remain stable across seeds and perturbations (attribution consistency ≈0.9), confirming robust interpretability and biological reproducibility.
SpatialMMKPNN improves spatial coherence and interpretability relative to baseline GNN and Squidpy pipelines. It achieves higher clustering concordance (+12% silhouette) and greater overlap between inferred and curated pathways (≈0.8), while maintaining attribution reproducibility above 0.9 across independent runs. All benchmarks and evaluation scripts are provided in the repository.
SpatialMMKPNN is dataset-agnostic and can be applied to any 10x Visium, Slide-seq, or Stereo-seq dataset with available coordinates and gene expression matrices. Users can adapt pathway layers, integrate imaging or methylation features, or modify graph construction to suit different spatial resolutions. Outputs include H&E tissue overlays, spatial attention heatmaps, pathway activation maps, and ligand–receptor driver plots, offering intuitive visualization of molecular programs for translational or histopathological studies. These interpretable visual outputs make the framework directly usable in collaborative research and pathology-driven analysis.
SpatialMMKPNN currently models cell–cell communication within a single-tissue graph without cross-sample normalization. While results remain consistent across seeds and noise levels, systematic robustness analyses are underway to quantify attribution stability under subsampling, noise injection, and random initialization.
A planned cross-dataset validation will extend the framework to a second spatial cohort to evaluate conserved immune, stromal, and therapy-induced signaling mechanisms. Ongoing work also benchmarks performance against Squidpy, SpaGCN, and transformer-based spatial models, expanding interpretability metrics and improving scalability for larger slides.
These developments form the basis of the forthcoming manuscript “SpatialMMKPNN: Interpretable Graph Models of Spatial Signaling in Cancer.”
Yepes, S. “SpatialMMKPNN: Interpretable Spatial Graph Framework for the Tumor Microenvironment.” GitHub Repository, 2025.
DOI: 10.5281/zenodo.17189130
SpatialMMKPNN is part of the MM-KPNN framework family, extending interpretable graph modeling from single-cell to spatial tissue contexts.