Topoformer: Topology-Infused Transformers for Medical Imaging
Sayoni Chakraborty ⋅ Philmore Koung ⋅ Baris Coskunuzer
Abstract
Three-dimensional medical imaging provides rich volumetric information for diagnosis and treatment planning, yet learning from 3D MRI and CT remains challenging due to high computational demands, scarce annotations, and the loss of global context in patch-based pipelines. Topological data analysis offers a complementary way to characterize global shape and structure through persistent homology (PH). However, standard cubical PH relies on a cumulative sublevel filtration that can saturate early in volumetric scans, limiting its ability to capture topological structures that emerge at higher intensity thresholds. Moreover, persistence diagrams require subsequent vectorization for downstream learning, which can discard the natural ordering of topological changes. We present Topoformer, a topology-infused transformer framework that integrates sequential topological representations with volumetric image features for data- and compute-efficient 3D medical image classification. We introduce a novel sliding-band cubical filtration that reformulates cubical persistence as an ordered sequence of local topological descriptors. Instead of a single cumulative sublevel filtration, partially overlapping bands move across the full intensity range, with each band isolating voxels within a local intensity interval. For every band, we compute $(\beta_0,\beta_1,\beta_2)$---connected components, tunnels, and cavities---and retain them in intensity order as a sequence of Betti tokens. Unlike global sublevel filtration, which may saturate as large components form, sliding bands continue tracking topology across higher intensity ranges and therefore expose late-emerging morphological structure. The resulting compact topological ``timeline'' is processed directly as a sequence by a Transformer, bypassing persistence-diagram assembly while preserving topological evolution across intensity bands. We further establish an $\ell_1$-stability guarantee for these sequential encodings under small perturbations of the underlying intensity function. Topoformer integrates this sequential topology with the image through two complementary mechanisms. First, TopoGate provides image-conditioned, adaptive multi-width topology. Sliding-band representations are computed at multiple bandwidths, and a lightweight gating mechanism uses the image representation to assign soft weights across them for each case. The resulting convex combination allows the image to determine which topological scales to emphasize rather than requiring manual selection of a single filtration width. Second, we propose Topological Supervised Contrastive Learning (TopoSupCon), which treats the image and its label-preserving topological representation as complementary views of the same case. Same-class samples form positive pairs both within and across modalities, while different-class samples form negatives, encouraging class-consistent alignment between image and topology. This provides topology-aware multi-view supervision while reducing reliance on geometric or generative augmentations that may distort clinically relevant anatomy or labels. We evaluate Topoformer on six public 3D datasets spanning brain MRI, breast MRI, and chest CT, covering glioma grading, MGMT promoter methylation status prediction, intracranial aneurysm detection, breast lesion classification, pulmonary nodule classification, and vertebral fracture classification. Against strong 3D CNN and Transformer baselines, Topoformer achieves the best AUC across all six datasets, with improvements reaching up to 12 AUC points and 8 accuracy points. The largest gains occur on the challenging MGMT promoter methylation and vertebral fracture tasks, while on RSNA 2025 Topoformer maintains balanced performance where several pure 3D baselines exhibit extreme specificity and near-zero sensitivity. Ablations further show that sliding-band filtrations consistently outperform standard sublevel PH under both MLP and Transformer heads, and that topology improves image-only representations even with simple feature concatenation, whereas supervised contrastive learning without topology yields limited or inconsistent gains. Comparisons with alternative sequence-modeling heads further favor Transformer encoding, supporting global attention for modeling dependencies across the ordered intensity-band topology. The full Topoformer, combining sequential sliding-band topology, adaptive multi-width TopoGate, and TopoSupCon, is consistently the strongest among our topological variants. Additional experiments on 2D chest CT and chest radiograph benchmarks demonstrate applicability beyond volumetric imaging. Overall, these results demonstrate that preserving topology as a compact, sequential, and label-stable signal provides an effective structural inductive bias for medical image classification, particularly in limited-data 3D settings.
Chat is not available.
Successful Page Load