TL;DR
Conventional anomaly segmentation relies on static score thresholds to turn continuous heatmaps into binary defect masks—a fragile approach that breaks when test data shifts even slightly from training data. TopoOT ditches fixed thresholds entirely, instead looking at the geometry of the anomaly map across multiple scales to find true structural defects that persist while noise fades away. By combining topological data analysis with optimal transport, it adapts models on the fly at 121 FPS without needing source data or labels, boosting segmentation F1 scores by up to 24.1%.
What Problem Does This Paper Address?
Imagine you have a vision model inspecting factory parts for defects. Usually, these models output a continuous "anomaly heatmap," where brighter pixels mean "more suspicious." To make an actual decision—defect or no defect—you have to pick a cutoff threshold to binarize that map.
Here is the catch: thresholds calibrated on clean validation data are notoriously brittle. If lighting changes at test time, or a new type of defect appears (a test-time distribution shift), a static cutoff either misses the defect entirely or floods the mask with false-alarm noise. Furthermore, slicing a map pixel-by-pixel completely ignores spatial structure—like whether suspicious pixels actually form a coherent crack or hole.
Test-time adaptation (TTA) tries to adjust models on the fly during inference, often without access to original training data ("source-free"). However, existing TTA methods still rely on noisy heuristics or entropy thresholds to generate pseudo-labels, which collapse under severe shifts. The authors ask: Can we replace brittle score-thresholding with principled, multi-scale structural reasoning during test-time adaptation?
Methods
TopoOT keeps the pretrained anomaly-detection backbone frozen and attaches a tiny, fast segmentation head that adapts to each unlabelled test image (or 3D point cloud) on the fly. The magic lies in how it generates clean pseudo-labels to train that head:
- Multi-scale Topological Filtering: Instead of picking one threshold, TopoOT sweeps across a sequence of thresholds—both from the bottom up (sublevel filtrations, tracking how connected blobs merge) and top down (superlevel filtrations, tracking how holes and loops evolve). Using Persistent Homology (a tool from Topological Data Analysis), it records when each structural feature is "born" and when it "dies" across thresholds, summarizing them in Persistence Diagrams (PDs). Long-lived features represent real structural anomalies; short-lived blips are noise.
- Optimal Transport (OT) Chaining (Novel): Raw persistence diagrams are still noisy. Rather than blurring them together via averaging, the authors introduce OT Chaining. Using entropy-regularized Optimal Transport (Sinkhorn distances), they sequentially match topological features across adjacent thresholds (cross-PD) and between the bottom-up and top-down views (cross-level). Features that survive this transport chain with low cost earn high "geodesic stability scores."
- Back-projection & Online Training: The top-$K$ most stable topological features are projected back onto the image grid as binary pseudo-labels. These supervise the lightweight MLP head using two losses: an OT-consistency loss (forcing predictions to match the stable topological structures) and a contrastive loss (pushing anomalous and normal pixel embeddings apart to sharpen boundaries).
Datasets
No new datasets are introduced; the authors evaluate across five standard industrial anomaly benchmarks spanning 2D and 3D modalities:
- 2D RGB Images: MVTec AD, VisA, and Real-IAD (paired with PatchCore, PaDiM, Dinomaly, and MambaAD backbones).
- 3D Multimodal & Point Clouds: MVTec 3D-AD (RGB + point clouds) and Anomaly-ShapeNet (pure point clouds), paired with CMM, M3DM, and PO3AD backbones.
Key Insights and Ideas
- Anomalies are topological disruptions, not just bright pixels: Treating binarization as a structural tracking problem rather than a statistical cutoff problem naturally filters out scattered, high-scoring noise islands while preserving faint but structurally coherent defects.
- Sublevel and superlevel views are better together: Ablation studies show that aligning features within a single filtration gives only modest gains. The major performance jump comes from cross-level OT alignment—requiring an anomaly candidate to make sense both as an emerging component and as an evolving boundary/void.
- Plug-and-play modularity: Because TopoOT only needs frozen features and an anomaly map, you can mix and match—pairing the feature extractor of one model (e.g., PatchCore) with the anomaly scorer of another (e.g., MambaAD) at test time and still beat standard baselines.
Key Results
Because standard AUROC metrics can look deceptively high even when binary masks are terrible (due to massive background-pixel imbalance), the evaluation focuses on pixel-level Precision, Recall, F1, and IoU.
- 2D Benchmarks: TopoOT outperforms the prior TTA state-of-the-art (TTT4AS) by up to +24.1% F1 on MVTec AD (with PaDiM), +19.7% F1 on VisA, and +21.3% F1 on Real-IAD (with Dinomaly). Over standard statistical thresholding (THR), gains reach +38.6% F1.
- 3D Benchmarks: Gains translate cleanly to 3D, beating TTT4AS by +10.2% F1 on MVTec 3D-AD (with CMM) and +1.9% F1 on Anomaly-ShapeNet.
- Efficiency: For 2D inference, the TTA module runs at 121 FPS while consuming only 349 MB of VRAM on an RTX 5090.
Limitations and Future Work
- Garbage in, garbage out: Because the backbone is frozen, TopoOT's ceiling is strictly bounded by the quality of the initial anomaly map. If a backbone completely misses a defect on a tricky texture, topology cannot resurrect it.
- 3D Speed Bottlenecks: While 2D runs at real-time speeds (121 FPS), 3D inference has noticeably lower FPS due to heavy point-cloud operations.
- Future Directions: The authors suggest accelerating persistence computations, tighter integration with representation learning (unfreezing or co-adapting features), extending to spatiotemporal (video) anomalies, and designing stronger unsupervised losses for complex textures.
Summary updated