Introduction
Deep learning models are notoriously overconfident, often assigning high probability scores to out-of-distribution (OOD) samples or random noise. This lack of reliability is a significant hurdle for deploying AI in safety-critical industrial settings. Current solutions for monitoring network reliability often require modifying the training process or using large auxiliary outlier datasets. This paper introduces Topological Uncertainty (TU), a novel post-hoc metric that monitors a network's internal state to detect when predictions should not be trusted, without the need for retraining.
Methodology
The authors propose analyzing the "shape" of internal activation patterns using Topological Data Analysis (TDA). The process involves three main steps:
- Activation Graph Construction: For every new input, each layer of the network is treated as a bipartite graph. The edge weights are determined by the product of the input neuron's value and the absolute weight of the connection.
- Topological Summarization: To efficiently summarize these massive graphs, the authors compute a Maximum Spanning Tree (MST) for each layer. The distribution of edge weights in this tree forms a "persistence diagram"—a topological signature of the network's internal state.
- The TU Score: During a one-time calibration phase, the average signature (the Fréchet mean) is calculated for each class in the training set. The Topological Uncertainty (TU) is then defined as the distance between a new observation's signature and the typical signature for its predicted class.
Key Results and Insights
The authors evaluated TU across a diverse range of data types, including standard image benchmarks (MNIST, CIFAR-10), textures (DTD), and chemical graph datasets (MUTAG, COX2).
- Model Selection: When picking the best pre-trained model for an unlabeled dataset, using TU as a criterion led to a +14.8% increase in accuracy on MNIST compared to random selection, significantly outperforming standard confidence scores. As shown in Figure 5, the TU score (average Topological Uncertainty) correlates strongly with model accuracy.
- OOD Detection: On graph datasets, TU achieved a 0.0 False Positive Rate (FPR) at 95% True Positive Rate, whereas standard confidence baselines failed completely (FPR > 90%).
- Shift Detection: In experiments with pixel corruption, the network's accuracy plummeted while its confidence stayed near 100%. However, the TU score increased linearly with the corruption level, successfully signaling the data drift.
Discussion and Limitations
TU provides a mathematically independent "sanity check" for neural networks. By looking at the entire network's internal wiring rather than just the final Softmax output, it captures "dissonance" in early layers that might otherwise be smoothed over.
However, some limitations remain. Computing MSTs for very large, dense layers can introduce computational overhead (approximately 0.9 seconds per sample for a 784x512 layer). Additionally, while TU performed well on most benchmarks, it was less effective on complex texture datasets, suggesting that 0-dimensional topology (MSTs) might not be rich enough for all data types. Future work will focus on optimizing these computations and extending the framework to non-sequential architectures like Transformers.
Summary updated