Source-linked AI summary
Semantic-Aware Subgraph State Space Model for WSI Classification in Histopathology
Feixing Chen, Hao Lu, Lin Luo, Yan Xu
TL;DR
Patch-based WSI representations can fragment irregular histological units and fail to preserve their spatial organization, while contextualizing numerous distant units remains challenging. SASG-SSM groups connected patches into topology-preserving subgraphs and combines GNN encoding with Mamba-based contextualization. Experiments across four TCGA cohorts report strong overall performance, particularly in small-cohort and few-shot settings.
Problem
Fixed-patch representations may fragment irregular semantic units and fail to preserve their internal spatial organization, while efficiently modeling relationships among numerous spatially separated units remains challenging.
Source: §1 · p. 2Method
SASG-SSM groups spatially related patches into irregular topology-preserving subgraphs, then uses GNN topology encoding and Mamba-based contextualization across subgraphs.
Source: §1 · p. 3Results
Experiments on four TCGA cohorts demonstrate strong overall performance, particularly under small-cohort and few-shot settings.
Source: §5 · p. 14Takeaways & Limitations
SASG-SSM combines local topology encoding with long-range contextualization to support histopathological WSI subtyping.
Source: §5 · p. 14The current implementation uses SAM2-derived visual-semantic priors and mask-constrained adaptive random walks; future work may explore pathology-specific priors and learnable construction, external multi-center cohorts, and grading or staging tasks.
Source: §5 · p. 14
Abstract
from arXiv · showhide
Histopathological subtyping relies on the recognition of characteristic histological patterns. These patterns may be expressed by individual tissue structures or by the spatial distribution and co-occurrence of multiple structures, and they often span irregularly shaped tissue regions, termed semantic units in this work. However, conventional patch-based representations may fragment such units and fail to explicitly preserve their internal spatial organization, while efficiently modeling relationships among numerous spatially separated units remains challenging. To address these limitations, we propose the Semantic-Aware Subgraph State Space Model (SASG-SSM), a flexible and efficient framework for whole slide image (WSI) classification. Semantic-Aware Subgraphs (SASGs) first approximate irregularly shaped semantic units by adaptively grouping spatially connected patches guided by class-agnostic visual-semantic priors. By representing patches as graph nodes with adjacency edges, SASGs preserve their internal spatial organization rather than treating them as an unordered set. A Subgraph State Space Module (SG-SSM) subsequently combines a graph neural network encoder for intra-subgraph topology encoding with a Mamba-based state space encoder for efficient contextualization across large numbers of subgraphs. This module integrates local structural information within semantic units with global contextual information arising from their distribution and co-occurrence across the WSI, while efficiently modeling a large number of spatially distributed regions. Extensive experiments across four WSI subtyping datasets demonstrate consistent advantages over representative state-of-the-art methods. Further evaluations under small-cohort and few-shot settings demonstrate robustness and data efficiency under limited training data. Code will be released at https://github.com/HLSvois/SASG-SSM.
1 Introduction
Histological patterns can span irregular semantic units and depend on both tissue morphology and spatial relationships, creating challenges for patch-based and slide-level modeling. SASG-SSM represents these units as topology-preserving subgraphs and models their long-range context with a GNN and Mamba-based module.
1 Introduction
- Semantic units are spatially connected, histologically coherent regions conveying recognizable patterns, whose morphology and spatial distribution can both matter.Histopathological subtyping supports treatment selection and prognostic assessment.Source: §1 · pp. 1–2
- Fixed patches can fragment irregular semantic units, while sub-bags omit internal spatial organization and patch graphs do not represent multi-patch structures as integrated units.These units can be characterized by individual structures as well as their spatial distribution and co-occurrence.Source: §1 · p. 2
- Efficiently modeling relationships among numerous spatially separated units remains challenging, despite the importance of their distribution and co-occurrence for slide-level context.Mamba offers input-dependent information propagation and linear complexity with sequence length, while existing WSI Mamba methods mainly model patch-level sequences.Source: §1 · pp. 2–3
- SASG-SSM jointly represents histologically meaningful semantic units and models contextual dependencies among them.SASGs group spatially related patches into irregular connected subgraphs while preserving intra-unit topology, reducing fragmentation from fixed square patches; SG-SSM combines GNN topology encoding with Mamba-based long-range contextualization.Source: §1 · p. 3
2 Related Work
Prior WSI methods use fixed-patch bags, graphs at several granularities, or sequence models for contextualization. SASG-SSM instead uses connected irregular multi-patch subgraphs and contextualizes their topology-aware representations.
2.1 WSI Classification
- MIL methods commonly represent slides as fixed-grid patch-feature bags, while DTFD-MIL groups patches into pseudo-bags that need not be spatially connected or preserve internal organization.SASGs instead organize connected patches into topology-preserving subgraphs with irregular support.Source: §2.1 · p. 3
2.2 Graph-Based WSI Analysis
- Graph-based WSI methods use entities such as nuclei, cells, regions, or clusters, whereas SASG models connected irregular multi-patch subgraphs and retains intra-unit adjacency.The cited approaches include CGC-Net, HACT, PatchGCN, Graph-Transformer, and SGMF.Source: §2.2 · p. 3
2.3 State Space Models for WSI Analysis
- Existing SSM approaches model patch sequences, groups, or graph nodes, while SG-SSM encodes topology within each irregular SASG before Mamba contextualizes its topology-aware representation.Mamba's input-dependent selective state-space parameters have linear complexity [15].Source: §2.3 · pp. 3–4
2.4 Visual Foundation Models
- The paper uses SAM2 to generate class-agnostic region masks as visual-semantic priors that provide coarse boundary cues for constructing spatially coherent SASGs.The related work distinguishes general-purpose VFMs such as CLIP and GLIP from pathology-specific models such as UNI and CONCH.Source: §2.4 · p. 4
3 Methodology
SASG-SSM combines irregular topology-preserving representations of semantic units with long-range contextual modeling among them. Its framework construction uses visual-semantic priors, graph encoding, and Mamba-based contextualization.
3 Methodology
- An auxiliary visual-semantic prior constrains an adaptive random walk over patch nodes to construct irregular topology-preserving subgraphs approximating candidate semantic units.These Semantic-Aware Subgraphs (SASGs) provide irregular, topology-preserving representations of semantic units.Source: Figure 2 · p. 4, §3 · p. 4
- The Subgraph State Space Module integrates each SASG's internal topology and models long-range contextual dependencies among subgraphs.A GNN encodes intra-subgraph topology; pooled representations are spatially serialized and contextualized by a Mamba-based SSM encoder.Source: Figure 2 · p. 4, §3 · p. 4
- Enhanced subgraph representations are aggregated for slide-level subtype classification.Source: Figure 2 · p. 4
3.1 Semantic-Aware Subgraphs
Semantic-Aware Subgraphs (SASGs) approximate semantic units—spatially connected, histologically coherent regions—using irregular, topology-preserving groups of patches. Class-agnostic visual-semantic priors guide their construction, while adaptive sampling preserves spatial extent and adjacency.
3.1 Semantic-Aware Subgraphs
- SASGs approximate semantic units with irregular, topology-preserving subgraphs whose adaptive extent is guided by visual-region cues from a class-agnostic semantic prior.A semantic unit is a spatially connected, histologically coherent region conveying a recognizable pattern.Source: §3.1 · p. 5
3.1.1 Auxiliary Semantic Prior
- Class-agnostic masks provide coarse visual boundary cues that guide subgraph construction and constrain expansion across visually distinct tissue regions.The masks are generated with SAM2.Source: §3.1.1 · p. 5
3.1.2 Irregular Subgraph Sampling
- Unlike fixed square patches, connected subgraphs support irregular extents and retain adjacency, allowing a GNN to model patches’ local structural arrangement.Representing adjacent patches as graph nodes connected by edges preserves intra-region relationships that an unordered set would discard.Source: §3.1.2 · p. 5
- A mask-constrained adaptive random walk starts from randomly selected seed patches and expands through adjacent patches until mask, ambiguity, neighborhood, or size conditions stop it.The walk uses 8-nearest neighbors, stops after three consecutive low-purity patches, and is capped at 10 nodes.Source: §3.1.2 · p. 5
3.2 Subgraph State Space Module
The Subgraph State Space Module combines GNN-based encoding of local topology with Mamba-based contextualization across subgraphs. Its default serial design passes topology-aware representations into the state-space encoder for local-to-global information flow.
3.2 Subgraph State Space Module
- SG-SSM combines a GNN for intra-subgraph topology encoding with a Mamba-based state-space encoder for long-range contextualization among spatially separated SASGs.This pairs local structural information with contextual relationships among histological regions.Source: §3.2 · p. 6
3.2.1 Long-Range Context among Subgraphs
- Mamba processes pooled subgraph tokens in a spatially informed left-top-to-bottom-right scan, while zero-step subgraphs preserve complete slide coverage.The sequence length is the number of multi-patch plus zero-step subgraphs.Source: §3.2.1 · p. 6
3.2.2 Local Topology inside Subgraphs
- A GNN propagates information along intra-subgraph edges before pooling the updated node features into topology-aware subgraph representations.Direct pooling alone would discard SASG topology.Source: §3.2.2 · p. 6
3.2.3 Incorporation of Encoders
- The default serial design applies the GNN first and then contextualizes its topology-aware representations with the SSM, establishing explicit local-to-global information flow.The paper adopts this configuration because it reports superior results to the parallel alternative.Source: §3.2.3 · p. 7
3.3 Classification and Loss Function
The classification stage uses contextualized zero-step subgraphs as a unique patch-level readout set, aggregates them with gated attention, and produces slide-level predictions trained with cross-entropy loss.
3.3 Classification and Loss Function
- Contextualized zero-step subgraphs provide a unique patch-level readout set, avoiding duplicated evidence from overlapping multi-patch SASGs.The selected representations are aggregated using gated attention.Source: §3.3 · p. 7
- Gated attention weights the zero-step subgraph representations to form a slide-level feature that is used for prediction.The final prediction is produced by applying a linear layer and softmax.Source: §3.3 · p. 7
- For C-class subtyping, the model is trained with cross-entropy loss.The paper specifies the cross-entropy objective for the classification task.Source: §3.3 · p. 7
4 Experiments
The experiments evaluate WSI subtyping on four TCGA cohorts, with additional reduced-training-set settings and patient-level fivefold cross-validation. The reported setup uses patch-based preprocessing and assesses F1, AUC, and accuracy.
4.1 Datasets
- The evaluation covers ESCA, BRCA, NSCLC, and RCC cohorts for WSI subtyping.The listed cohorts include two subtypes each for ESCA, BRCA, and NSCLC, and three for RCC.Source: §4.1 · p. 7
- Training sets for BRCA, NSCLC, and RCC are downsampled to sizes comparable to ESCA while preserving class proportions to test limited-data conditions.Table 1 summarizes dataset and training-split details.Source: §4.1 · p. 7, Table 1 · p. 8
4.2 Implementation Details
- Foreground tissue is segmented into non-overlapping 256 × 256 patches at 20× magnification, with SAM2 masks guiding spatially coherent patch grouping.Tiles are 2560 × 2560 pixels with 256-pixel overlap to reduce boundary discontinuities.Source: §4.2 · p. 8
- SAM2 segmentation uses point prompts sampled from threshold-partitioned regions, motivated by staining-intensity differences between tumor and stroma.Source: §4.2 · p. 8
- The models are trained with Adam using a 2 × 10^-5 learning rate and 1 × 10^-5 weight decay, with batch size 1, up to 200 epochs, and early stopping.Source: §4.2 · p. 8
- Performance is assessed with F1, AUC, and accuracy using fivefold cross-validation with patient-level splits.Source: §4.2 · p. 8
4.3 Comparisons with State-of-the-Art
SASG-SSM is compared with representative WSI methods under standard and few-shot settings. It leads in F1 across both dataset-size settings and shows strong overall F1 and AUC performance when training slides are limited.
4.3 Comparisons with State-of-the-Art
- The comparison covers four MIL-based, two GNN-based, and two SSM-based methods, using the same fivefold cross-validation splits and a standardized ResNet50 feature encoder.The feature encoder produces 1024-dimensional outputs; other baseline settings follow the original studies.Source: §4.3 · p. 8
4.3.1 Overall Comparison
- SASG-SSM achieves the highest F1 scores in both small- and large-set settings, with the best small-set F1 and AUC across datasets.On TCGA-ESCA small-set evaluation, it reaches 92.17% F1, 95.71% AUC, and 91.09% ACC, exceeding second-best results by 2.93, 0.71, and 3.87 points, respectively.Source: §4.3.1 · p. 8
4.3.2 Few-Shot Comparison
- Under few-shot training, SASG-SSM consistently achieves the strongest overall F1 and AUC across evaluated settings.Training slides are randomly subsampled from fivefold training splits while validation splits remain unchanged.Source: §4.3.2 · p. 8
4.4 Ablation Study
Ablations show that the WSI graph, SASGs, and SG-SSM each contribute to performance. The reported benefits are linked to preserving coherent regional structure, modeling long-range context, and covering the slide.
4.4 Ablation Study
- SASGs support regional-pattern analysis by preserving the integrity and connectivity of irregular semantic units rather than fragmented patch cues.SG-SSM models long-range relationships among SASGs, while the WSI graph's ablation suggests complete slide coverage supports modeling spatially distributed units.Source: §4.4 · p. 10
- Removing the WSI graph, SASGs, or SG-SSM reduces performance; the combined components yield improvements beyond their incremental benefits alone.Table 4 evaluates these three removals.Source: §4.4 · p. 8, Table 4 · p. 10
4.5 Further Analysis
Further analyses examine how SASGs represent semantic units and how SG-SSM structures contextual representations. The reported comparisons favor informative region priors, adaptive construction, topology preservation, and serial local-to-global encoding.
4.5.1 Analysis of Semantic-Aware Subgraphs (SASGs)
- In the EAD and ESCC examples, SASGs retain irregular glandular or nested tumor architecture and keratinization that individual patches represent only as local fragments.The ESCC example includes concentric keratinization suggestive of keratin pearl formation.Source: Figure 3 · p. 10, §4.5.1 · p. 11
- SAM2 gives the strongest overall performance among prior settings, separating tumor nests from surrounding stromal and necrotic regions more effectively than SLIC or no prior.SLIC provides local boundaries but lacks comparable region-level visual information.Source: §4.5.1 · p. 11, Figure 4 · p. 11, Table 5 · p. 11
- Adaptive termination outperforms fixed walk length, while the ambiguity and nocandidate conditions shape subgraph extent without imposing a fixed geometric size.The ambiguity condition limits propagation near uncertain mask boundaries; the nocandidate condition prevents repeated sampling.Source: §4.5.1 · p. 12
- Topology-preserving subgraphs outperform sub-bags with the same patches, while k-hop and random-walk expansion perform comparably under the same prior and adaptive stopping criteria.The slight random-walk advantage may arise from greater stochastic sampling diversity.Source: §4.5.1 · p. 12, Table 6 · p. 12
4.5.2 Analysis of Subgraph State Space Module (SG-SSM)
- After SG-SSM, UMAP clusters are more compact and separated with fewer noise samples, and spatial projections form less-fragmented, more coherent regions.The output clusters preserve boundaries between morphologically distinct compartments, including tumor-infiltrated, epithelial, and muscular regions.Source: §4.5.2 · pp. 12–13, Figure 5 · p. 12, Figure 6 · p. 13
- Removing either the GNN or SSM encoder reduces performance, supporting their complementary roles in local topology and long-range context modeling.Table 7 compares the encoder ablations.Source: §4.5.2 · p. 13, Table 7 · p. 13
- Serial incorporation outperforms parallel incorporation, suggesting that progressively updating representations across graph and sequence spaces supports a more effective local-to-global flow.Source: §4.5.2 · p. 13
- Placing multi-patch subgraphs before zero-step subgraphs performs consistently better, while changing spatial scan direction has a smaller effect.The authors suggest richer regional information may establish a more informative contextual state; the smaller direction effect is consistent with no canonical WSI orientation.Source: §4.5.2 · pp. 13–14, Table 8 · p. 14
5 Conclusion
SASG-SSM represents irregular semantic units with topology-preserving subgraphs and uses GNN-based encoding followed by Mamba-based contextualization. Experiments across four TCGA cohorts show strong overall performance, particularly in small-cohort and few-shot settings, while the implementation and future evaluation have stated boundaries.
- SASG-SSM preserves semantic-unit spatial organization with subgraphs, then combines GNN topology encoding and Mamba-based long-range contextualization across the WSI.Source: §5 · p. 14
- Experiments across four TCGA cohorts show strong overall performance, particularly in small-cohort and few-shot settings; ablations and qualitative analyses support the framework's contributions.Source: §5 · p. 14
- The implementation uses SAM2-derived visual-semantic priors and mask-constrained adaptive random walks; future work includes pathology-specific priors, learnable construction, external cohorts, and grading or staging tasks.Source: §5 · p. 14