Papers
Topics
Authors
Recent
Search
2000 character limit reached

TopoTTA: Topology-Enhanced Test-Time Adaptation

Updated 7 July 2026
  • The paper presents a novel two-stage framework using TopoMDCs and TopoHG to adapt CNNs for topology-sensitive segmentation under domain shifts.
  • It introduces patch-specific routing weights to preserve pretrained features while addressing topological discrepancies and maintaining continuous tubular structures.
  • Experimental results demonstrate significant improvements in clDice and Dice metrics across multiple tubular segmentation benchmarks, validating the framework’s efficiency.

Searching arXiv for the specified TopoTTA and related topology-aware test-time adaptation papers. arXiv search query: all:"TopoTTA" OR ti:"Topology-enhanced Test-Time Adaptation" OR ti:"Test-Time Adaptation for Anomaly Segmentation via Topology-Aware Optimal Transport Chaining" OR ti:"Learning Topology-Aware Representations via Test-Time Adaptation for Anomaly Segmentation" Topology-enhanced Test-Time Adaptation (TopoTTA) is a test-time adaptation framework that incorporates topological priors into deployment-time model updating under domain shift. In its original and most specific usage, TopoTTA denotes a two-stage framework for tubular structure segmentation (TSS), where domain adaptation must preserve connectivity and continuity in thin, elongated foregrounds such as retinal vessels, roads, neuronal processes, and OCTA vessels (Zhou et al., 1 Aug 2025). Related later work extended the broader idea of topology-aware TTA to anomaly segmentation, but the canonical TopoTTA formulation is the TSS method built from Topological Meta Difference Convolutions (TopoMDCs) and Topology Hard sample Generation (TopoHG) (Zhou et al., 1 Aug 2025).

1. Scope, motivation, and problem setting

Tubular structure segmentation is unusually sensitive to domain shift because errors affect both appearance and topology. The original TopoTTA formulation distinguishes appearance shifts—including changes in contrast, noise, texture, imaging device, and acquisition style—from topological shifts, including changes in trajectory, curvature, branching patterns, and thickness (Zhou et al., 1 Aug 2025). In TSS, a small number of incorrect pixels can interrupt a centerline, create gaps, destroy skeleton connectivity, or inflate topology errors. Consequently, overlap-oriented adaptation alone is inadequate.

The source-to-target TTA setting used by TopoTTA is standard. A labeled source dataset is written as

Ds={(xis,yis)}i=1Ns,\mathcal D^s=\{(\mathbf x_i^s,\mathbf y_i^s)\}_{i=1}^{N^s},

and a model F(;θs)\mathcal F(\cdot;\theta^s) is first trained by

θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].

The target dataset is unlabeled,

Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},

and online per-image adaptation follows

θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),

with θ0t=θs\theta_0^t=\theta^s (Zhou et al., 1 Aug 2025).

Within this setting, TopoTTA is described as the first test-time adaptation framework designed specifically for TSS. The central premise is that TTA for tubular structures must address both topological discrepancy across domains and fragile continuity inside predicted structures. This suggests a division of labor between a structural adaptation stage and a continuity-restoration stage, which is exactly how the framework is organized.

2. Two-stage architecture

TopoTTA consists of two stages (Zhou et al., 1 Aug 2025). Stage 1, Topological Structure Adaptation, uses Topological Meta Difference Convolutions to adapt representations to domain-specific topological patterns while updating only a small set of router parameters. Stage 2, Topological Continuity Refinement, uses Topology Hard sample Generation to synthesize local pseudo-breaks and trains the model to recover continuity by prediction alignment on these hard samples.

Stage Main mechanism Function
Stage 1 TopoMDCs Adapt to cross-domain topological discrepancies
Stage 2 TopoHG + prediction alignment Improve topological continuity on hard samples

This decomposition is technically important. Stage 1 targets structural changes in tubular geometry, while Stage 2 targets local foreground-background discrimination around critical regions where continuity is easily broken. A common misconception is that topology-aware TTA necessarily means direct topological loss optimization over the whole model. In TopoTTA, the adaptation is more constrained: pretrained convolution weights are preserved in Stage 1, and the second stage uses teacher-student consistency on synthesized pseudo-break regions rather than whole-network retraining (Zhou et al., 1 Aug 2025).

The framework is designed as a plug-and-play TTA solution for CNN-based TSS models. It is evaluated with U-Net and CS2Net, and a variant is also reported on DSCNet. TopoMDCs replace all 3×33\times3 convolution layers in the encoder, while Stage 2 adds the teacher-student refinement branch (Zhou et al., 1 Aug 2025).

3. Stage 1: Topological Meta Difference Convolutions

TopoMDCs are motivated by the limitations of Central Difference Convolution (CDC). CDC emphasizes local differences between a center pixel and its neighbors, but the TopoTTA paper argues that TSS requires explicit modeling of directional elongation, continuity along curves, and local tubular topology such as branches, bends, and thin junctions (Zhou et al., 1 Aug 2025).

For a 3×33\times3 neighborhood,

R={(1,1),(0,1),,(1,0),(1,1)},\mathcal R = \{(1,1),(0,1),\cdots,(-1,0),(-1,-1)\},

the vanilla convolution is

C0(rx,ry)=(Δrx,Δry)Rw(Δrx,Δry)xin(rxΔrx,ryΔry).\mathcal C_0(r_x,r_y) = \sum_{(\Delta r_x,\Delta r_y)\in\mathcal R} w(\Delta r_x,\Delta r_y)\cdot \mathbf x_{in}(r_x-\Delta r_x,r_y-\Delta r_y).

CDC is described in center-difference form as

F(;θs)\mathcal F(\cdot;\theta^s)0

TopoMDCs then define eight directional operators,

F(;θs)\mathcal F(\cdot;\theta^s)1

to encode eight directional topological patterns (Zhou et al., 1 Aug 2025).

For example, the top-left directional operator is

F(;θs)\mathcal F(\cdot;\theta^s)2

with

F(;θs)\mathcal F(\cdot;\theta^s)3

The appendix provides analogous definitions for the other seven directions, spanning orthogonal and diagonal patterns (Zhou et al., 1 Aug 2025).

A distinctive design choice is that TopoMDCs do not introduce new parameters into convolution layers and inherit the pretrained convolution weights. Instead, the method patchifies the input into F(;θs)\mathcal F(\cdot;\theta^s)4 non-overlapping patches and learns patch-specific routing weights F(;θs)\mathcal F(\cdot;\theta^s)5. For patch F(;θs)\mathcal F(\cdot;\theta^s)6, the output feature is

F(;θs)\mathcal F(\cdot;\theta^s)7

Here, F(;θs)\mathcal F(\cdot;\theta^s)8 supplies the standard convolutional response, the eight F(;θs)\mathcal F(\cdot;\theta^s)9 terms inject directional topology-aware differences, and θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].0 selects directionally relevant patterns on a patch basis (Zhou et al., 1 Aug 2025).

Stage 1 adapts only the router parameters via entropy minimization:

θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].1

with update rule

θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].2

The stated rationale for updating only θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].3 is to reduce search-space complexity, avoid interference between parameter updates, preserve pretrained representations, and provide sample-specific topological adaptation with greater stability (Zhou et al., 1 Aug 2025). This is empirically reinforced by the ablation in which updating all parameters underperforms router-only updating.

4. Stage 2: Topology Hard sample Generation and continuity refinement

Stage 2 addresses continuity failures that persist after structural adaptation. The mechanism is Topology Hard sample Generation, which constructs pseudo-break regions that resemble broken tubular structures and then trains the model to recover continuity under teacher-student prediction alignment (Zhou et al., 1 Aug 2025).

The first step is confident key-point selection. Given teacher prediction θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].4, the method keeps

θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].5

then randomly samples

θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].6

points from θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].7. The number of sampled points therefore grows with the amount of highly confident foreground (Zhou et al., 1 Aug 2025).

The second step slides a background window around each selected foreground point. For a point θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].8, a foreground window θs=argminθs  E(xs,ys)Ds[Lseg(F(xs;θs),ys)].\theta^s = \arg\min_{\theta^s}\; \mathbb{E}_{(\mathbf x^s,\mathbf y^s)\sim \mathcal D^s} \left[\mathcal L_{seg}(\mathcal F(\mathbf x^s;\theta^s),\mathbf y^s)\right].9 of size Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},0 is centered on the point, and a same-sized background window is searched over nearby non-overlapping areas to find the region Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},1 with the lowest pseudo-label confidence. A lower threshold Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},2 rejects candidate background windows that still contain too much foreground (Zhou et al., 1 Aug 2025).

The third step creates pseudo-breaks through low-frequency swapping in the Fourier domain. With FFT, inverse FFT, and low-frequency mask Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},3,

Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},4

and

Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},5

Foreground pixels from the pseudo-label are then selectively replaced:

Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},6

The resulting patch Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},7 is intended to weaken continuity while preserving essential foreground structure and avoiding the unnatural artifacts associated with crude corruption (Zhou et al., 1 Aug 2025).

Prediction alignment uses a teacher-student scheme. The teacher produces pseudo-labels Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},8 on the original image, while the student predicts Dt={xit}i=1Nt,\mathcal D^t=\{\mathbf x_i^t\}_{i=1}^{N^t},9 on the hard sample. The weighted consistency loss is

θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),0

with weight map

θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),1

The student is updated by

θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),2

and the teacher is updated with EMA of student parameters (Zhou et al., 1 Aug 2025). Final inference is performed on the original, unmodified input.

5. Experimental profile, metrics, and ablations

TopoTTA is evaluated on 10 datasets grouped into four scenarios: retinal vessel segmentation (DRIVE, STARE, CHASEDB1), road extraction (DeepGlobe, Massachusetts road, CNDS), microscopic neuronal segmentation (Neub1, Neub2), and retinal OCT-angiography vessel segmentation (ROSE1, OCTA500) (Zhou et al., 1 Aug 2025). The reported metrics are Dice, clDice, and Betti error θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),3, with clDice emphasized because it evaluates skeleton-level continuity.

The headline result is an average 31.81% improvement in clDice over source-only testing across the four scenarios (Zhou et al., 1 Aug 2025). Average results over ten datasets are reported as follows.

Backbone Source Only TopoTTA
U-Net Dice 50.56, clDice 42.19, θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),4 51.94 Dice 69.44, clDice 74.00, θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),5 43.01
CS2Net Dice 50.31, clDice 51.17, θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),6 54.35 Dice 67.68, clDice 72.70, θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),7 43.86

Per-scenario examples further illustrate the topology-sensitive gains. On DRIVE θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),8 CHASE, TopoTTA reaches Dice 70.73, clDice 77.05, and θit=argminθi1tLtta(F(;θi1t),xit),\theta_i^t = \arg\min_{\theta_{i-1}^t}\mathcal L_{tta}(\mathcal F(\cdot;\theta_{i-1}^t), \mathbf x_i^t),9 25.38. On CHASE θ0t=θs\theta_0^t=\theta^s0 DRIVE, it reports Dice 72.96, clDice 70.26, and θ0t=θs\theta_0^t=\theta^s1 79.15. On DeepGlobe θ0t=θs\theta_0^t=\theta^s2 CNDS, it reports Dice 89.15, clDice 96.35, and θ0t=θs\theta_0^t=\theta^s3 5.98. On ROSE θ0t=θs\theta_0^t=\theta^s4 OCTA500, it reports Dice 70.70, clDice 78.24, and θ0t=θs\theta_0^t=\theta^s5 31.88 (Zhou et al., 1 Aug 2025).

The ablation studies support both stages. A representative ablation reports: baseline at Dice 65.37, clDice 61.69, θ0t=θs\theta_0^t=\theta^s6 82.24; baseline + TopoMDCs at Dice 68.70, clDice 65.14, θ0t=θs\theta_0^t=\theta^s7 76.28; baselineθ0t=θs\theta_0^t=\theta^s8 + TopoHG at Dice 68.82, clDice 66.61, θ0t=θs\theta_0^t=\theta^s9 73.63; and full TopoTTA at Dice 69.87, clDice 67.81, 3×33\times30 73.27 (Zhou et al., 1 Aug 2025). The TopoMDC variant study shows the full eight-direction set outperforming CDC-only, orthogonal-only, and diagonal-only alternatives. The TopoHG comparison against Gaussian blur, random Gaussian noise, and spatial image swap attributes its advantage to preserving high-frequency cues while generating realistic pseudo-breaks (Zhou et al., 1 Aug 2025).

A practically important ablation compares updating all parameters with updating only the router parameters 3×33\times31. The reported results favor router-only adaptation: Dice 70.73, clDice 77.05, 3×33\times32 25.38 versus Dice 70.07, clDice 72.58, 3×33\times33 30.23 when all parameters are updated. The paper also notes that 3×33\times34 adds only 1280 parameters (Zhou et al., 1 Aug 2025). This directly contradicts the assumption that stronger test-time adaptation necessarily requires broader parameter updates.

Implementation details reinforce the lightweight design: all datasets are resized to 3×33\times35; test-time adaptation uses six iterations per image, split as three for Stage 1 and three for Stage 2; Adam is used with Stage 1 learning rate 3×33\times36 and Stage 2 learning rate 3×33\times37; mask binarization uses threshold 3×33\times38; and key TopoMDC/TopoHG hyperparameters include 3×33\times39, window size 3×33\times30, and 3×33\times31 (Zhou et al., 1 Aug 2025).

6. Broader topology-aware TTA variants, limitations, and conceptual significance

Later work extended the same general intuition—topology as a deployment-time adaptation signal—into anomaly segmentation, but with a substantially different technical stack. A 2026 anomaly-segmentation method also named TopoTTA converts anomaly score maps into cubical complexes, computes persistent homology on sublevel and superlevel filtrations, retains the most persistent components as pseudo-labels, fuses them with an Euler-aware Intersection rule,

3×33\times32

and trains only a lightweight shallow MLP called PCES on frozen backbone features using a margin-based contrastive loss; it is evaluated on MVTec AD, VisA, Real-IAD, MVTec 3D-AD, AnomalyShapeNet, and MVTec LOCO, and reports an average 3×33\times33 F1 improvement over state-of-the-art methods (Zia et al., 26 Jun 2026). A closely related framework, TopoOT, uses multi-filtration persistence diagrams and Optimal Transport Chaining to derive geodesic stability scores, generate stability-aware pseudo-labels, and adapt a lightweight head online; it reports gains of up to +24.1% mean F1 on 2D datasets and +10.2% on 3D AS benchmarks (Zia et al., 28 Jan 2026).

These anomaly-segmentation methods show that the phrase “topology-aware TTA” no longer refers to a single mechanism. In the original TSS TopoTTA, topology enters through directional convolutions and synthetic continuity breaks. In the anomaly-segmentation variants, topology enters through persistent homology, cubical complex filtrations, Euler-consistent fusion, and, in TopoOT, entropy-regularized optimal transport across persistence diagrams (Zia et al., 26 Jun 2026, Zia et al., 28 Jan 2026). A plausible implication is that the term now denotes a family of methods united more by their use of structural invariants during test-time updating than by any single architectural recipe.

The limitations of the original TopoTTA remain specific and concrete. It is designed for CNN-based architectures, not arbitrary backbones. Stage 2 adds runtime cost because it requires patch selection and pseudo-break synthesis. Hyperparameters such as patch size, region count, and confidence thresholds matter. For some challenging cases, clDice may be undefined when skeletonization fails. The DSCNet variant omits Stage 1 because deformable kernels reduce compatibility with TopoMDCs, indicating that TopoMDC integration is not universal across all architectures (Zhou et al., 1 Aug 2025).

Conceptually, TopoTTA is significant because it reframes test-time adaptation for topology-sensitive segmentation as more than a distribution-calibration problem. In TSS, the framework explicitly separates adaptation to structural discrepancy from restoration of local continuity. In later anomaly-segmentation formulations, the same broader principle appears as persistent-homology-based pseudo-labeling that replaces brittle raw-score thresholding. Across these variants, the unifying proposition is that under domain shift, segmentation quality depends not only on confidence or pixel intensity but also on the preservation of connected components, holes, branch continuity, and related structural invariants (Zhou et al., 1 Aug 2025, Zia et al., 26 Jun 2026, Zia et al., 28 Jan 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Topology-enhanced Test-Time Adaptation (TopoTTA).