Medical segmentation models trained at one hospital often break at another, because scanners from different vendors, different protocols, and patient motion change how images look. Hospitals also rarely have more than a few expert-drawn masks. The usual fix is semi-supervised learning: the model labels the plentiful unlabeled scans from other sites itself, keeps the labels it is confident about, and trains on them. On unseen hardware this goes wrong in a particular way. The model's self-made labels, called pseudo-labels, can be confident and still anatomically impossible. The myocardium (the ring of heart muscle around the left ventricle) comes out broken open, or the left ventricle splits into two blobs. Confidence scores do not catch this.
This note proposes using a fact that holds at every hospital: the expected shape topology of the anatomy. In a mid-ventricular short-axis cardiac slice, the left ventricle is one connected region with no holes, and the myocardium is one region with exactly one hole. These counts do not depend on vendor, field strength, contrast, or breathing pattern. Because they are known in advance, they can supervise the unlabeled scans from other institutions directly, with no annotation. We use them twice. First, a differentiable loss pushes predictions on unlabeled multi-vendor data toward the correct number of components and loops. Second, the topology of each pseudo-label decides which pixels to trust. The aim is to recover the structural accuracy that current methods lose under domain shift, and to do it in the label-starved regime where it matters most.
Core Claim
Current semi-supervised domain generalization methods, which train on few labels plus unlabeled scans from several sites and then test on an unseen site, filter pseudo-labels with a scalar confidence. The leading example is Enhancing Pseudo Label Quality for Semi-supervised Domain-Generalized Medical Image Segmentation. It swaps the Fourier amplitude spectrum between images to simulate scanner style changes, then down-weights pixels whose predictions change under the swap. Semi-Supervised Domain Generalization for Cardiac Magnetic Resonance Image Segmentation with High Quality Pseudo Labels does the same with two different backbones on motion-corrupted scans.
We claim this confidence signal has two blind spots. It does not see structural errors. It also assumes the domain shift is purely about image style, which fails for motion artifacts and changes in acquisition sequence. Topology covers both: it ignores intensity entirely, and smooth geometric deformation does not change it.
The concrete prediction is about mechanism, not just about which method scores higher. On an unseen vendor, a substantial share of pseudo-label errors will fall inside regions that Fourier-variance confidence marks as reliable. Those same errors will show up as wrong counts of components or loops. Adding a label-free topology prior on the unlabeled data will cut topological error on the unseen vendor, raise Dice, and help most when labels are scarcest.
What Prior Work Does and Does Not Do
The topology machinery comes from Topologically faithful multi-class segmentation in medical images. That work uses persistent homology, a way of summarizing the connected components and loops in a probability map that appear and disappear as a threshold is swept. It matches predicted topological features to ground-truth features (Betti matching) and halves Betti matching error on ACDC, from 0.130 to 0.064. It is purely supervised and single-domain, and it needs a ground-truth mask for every image. We drop that requirement by replacing the per-image ground truth with a per-class anatomical prior. That substitution is what lets the method run on unlabeled data from other sites.
Three tri-directional methods motivate the gap but do not close it. FedSemiDG trains federated across hospitals with dual-teacher pseudo-label refinement. Dual-supervised Asymmetric Co-training trains with labels at one site and unlabeled data at others, using asymmetric pretext tasks. MiDSS (Constructing and Exploring Intermediate Domains in Mixed Domain Semi-supervised Medical Image Segmentation) builds intermediate domains by copy-paste and Fourier mixing. All three judge pseudo-labels pixel by pixel. The co-training authors themselves report difficulty with low-contrast and overlapping structures. Our topology signal plugs into any of these, and we test it on top of the strongest one.
Two results constrain the design. Improved post-hoc probability calibration for out-of-domain MRI segmentation shows that shape priors from denoising autoencoders work for regular structures like the heart but generalize poorly to variable morphology. We therefore restrict claims to anatomies with a stable, known topology: cardiac chambers and spinal cord gray matter. We do not claim tumors. The M&Ms challenge (Multi-Centre, Multi-Vendor and Multi-Disease Cardiac Segmentation: The M&Ms Challenge) found that well-tuned nnU-Net (a self-configuring U-Net pipeline) with intensity augmentation beat elaborate domain-adaptation designs. Any added component must therefore clear a strong plain baseline.
Research Program
The method builds on Confidence-Aware Cross Pseudo Supervision (CACPS), which trains two networks that pseudo-label for each other with Fourier amplitude swapping. We add two pieces on top.
The first piece is a prior-topology loss on unlabeled slices. For each class $c$ and each slice, we compute the persistence diagram of the predicted probability map $p_c$ under a superlevel-set filtration. A persistence diagram lists every component or loop with its birth threshold $b_i$ and death threshold $d_i$, so its persistence $b_i - d_i$ measures how robust the feature is. Let $\beta_c = (\beta_{c,0}, \beta_{c,1})$ be the admissible counts of components and loops. For example, the myocardium has $(1,1)$ at mid-ventricle, and $(0,0)$ or $(1,0)$ at apical or basal slices. The loss is
$$ L_{\text{topo}}(p_c) = \sum_{k\in\{0,1\}} \Big[ \sum_{i \le \beta_{c,k}} \big(1-(b_i-d_i)\big)^2 + \sum_{i > \beta_{c,k}} (b_i-d_i)^2 \Big], $$
where features of dimension $k$ are sorted by decreasing persistence. The expected features are pushed to full persistence and all extra features toward zero.
Slice position decides which admissible configuration applies, and that is the main design risk. We pick the admissible configuration closest in persistence to the current prediction. This lets the loss repair a nearly closed ring without forcing a ring onto an apical slice.
The second piece is topology-aware gating. Spurious persistence pairs, meaning extra components or the breaks that open a ring, map to specific critical pixels in the image. We down-weight the cross pseudo-supervision loss in a small neighborhood of those pixels, alongside the existing Fourier-variance weights.
Before training anything, we run a diagnostic study. We take a CACPS model trained on M&Ms vendors A–C at 2% labels and pseudo-label vendor D. We then measure what fraction of the wrong pixels sit in regions Fourier variance rated confident, and what fraction lie in slices with incorrect topology. If confident-but-wrong errors are rare or rarely topological, the premise fails and we stop.
Baselines
The naive reference is a U-Net trained on the labeled slices alone with standard augmentation, together with the fully supervised upper bound on the same split. A stronger plain reference is nnU-Net with heavy intensity augmentation trained on the labeled data. This is the recipe that won M&Ms and cut the unseen-vendor drop from about 6% to 1.5% with ample labels. We run it on exactly the 2% and 5% label splits used for every other method. Beating it means higher Dice and lower Betti error on vendor D at both label ratios.
The strongest existing competitor is CACPS from Enhancing Pseudo Label Quality. It reports 84.52% Dice on M&Ms at 2% labels and 85.72% at 5%. Its cardiac-motion variant reports 0.828 test Dice and 0.802 myocardium Dice on CMRxMotion (Semi-Supervised Domain Generalization for Cardiac MRI). It is the strongest competitor because it already targets pseudo-label reliability under vendor shift on the same benchmarks. We will reimplement it and report both its published numbers and our rerun. Our method then adds only the two topology pieces to the rerun, with the same backbones, schedule, and number of hyperparameter trials. We also include MiDSS and the dual-supervised co-training method on M&Ms and SCGM where code permits. No Lacuna result was found for MiDSS's M&Ms Dice.
Three ablations isolate the key ingredient. The first applies the topology loss only to the labeled source data, a Betti-matching-on-labels variant. This tests whether supervision on the shifted unlabeled data is what helps. The second uses the loss without gating, and the third uses gating without the loss. The fourth replaces both pieces with morphological pseudo-label cleanup, described below.
Beating CACPS means a reduction in vendor-D Betti error that holds across three seeds, with Dice equal or higher. We expect the gain to be larger at 2% than at 5% labels.
Why not just…?
Why not just clean the pseudo-labels with morphology: keep the largest component and fill holes? This is the most serious threat, and we run it as the fourth ablation using the same CACPS rerun. Keeping the largest component and filling holes fixes extra blobs and pinholes. It cannot close a myocardial ring broken by low contrast, because the fix requires deciding where muscle should exist. Hole-filling would actually destroy the ring's one legitimate loop. If cleanup plus a closing operation matches our method on vendor D, the honest conclusion is that cross-vendor topological errors are local and cheap to fix. We would then report the method as unnecessary.
Why not just apply Betti matching on the labeled source images? That is the supervised recipe of Topologically faithful multi-class segmentation. With 2% labels, it only teaches topology on the source vendors' appearance. The source-only ablation measures directly whether topology supervision must reach the unlabeled, shifted images.
Why not just tune nnU-Net with stronger augmentation? At M&Ms scale, it is hard to beat. Under scarcity, the evidence goes the other way: baselines reach 72.85% at 2% labels against CACPS's 84.52%, and a DeepLabv3+ baseline scored 0.060 myocardium Dice on CMRxMotion. We still run nnU-Net ourselves, on identical splits, rather than relying on those figures.
Why not just trust Fourier-variance confidence? The diagnostic study answers this directly. If confident regions rarely contain topological errors, this proposal loses its rationale.
Proposed Experiments
The primary benchmark is M&Ms under leave-vendor-out evaluation (train on A–C, test on unseen Canon vendor D) at 2% and 5% labels. CMRxMotion tests motion shift, which is non-stylistic and is where the Fourier assumption is weakest. SCGM tests thin, low-contrast structure with a stable single-component prior. As an exploratory check without prior SSDG numbers, MS-CMRSeg tests the shift from the bSSFP sequence to late gadolinium enhancement (LGE). ACDC serves as an in-domain sanity check against the reported supervised Betti error of 0.064.
Metrics are Dice, 95th-percentile Hausdorff distance, Betti matching error, and the fraction of slices with correct topology, all reported per class. The myocardium is the class where we expect the largest effect.
Three checks decide the outcome. The first is the diagnostic overlap between confident and topologically wrong pseudo-labels. The second is whether the full method beats the morphology-cleanup ablation on vendor D. The third is whether the gain grows as labels shrink and as shift grows, comparing vendor D and intensive-breathing scans against seen-vendor and breath-hold scans. That pattern is what the claim that topology is invariant across sites predicts.
References
- Enhancing Pseudo Label Quality for Semi-supervised Domain-Generalized Medical Image Segmentation
- Semi-supervised Domain Generalization for Cardiac Magnetic Resonance Image Segmentation with High Quality Pseudo Labels
- Topologically Faithful Multi-class Segmentation in Medical Images
- FedSemiDG: Domain generalized federated semi-supervised medical image segmentation
- Dual-supervised Asymmetric Co-training for Semi-supervised Medical Domain Generalization
- Constructing and Exploring Intermediate Domains in Mixed Domain Semi-supervised Medical Image Segmentation
- Improved Post-hoc Probability Calibration for Out-of-Domain MRI Segmentation
- Multi-Centre, Multi-Vendor and Multi-Disease Cardiac Segmentation: The M&Ms Challenge