Topological Structure Learning for Weakly-Supervised Out-of-Distribution Detection

Rundong He, Rongxue Li, Zhongyi Han, Yilong Yin

Abstract

Out-of-distribution (OOD) detection is critical for the safe deployment of machine learning models in open-world environments. However, traditional methods often require large labeled datasets, which are costly to obtain. This paper introduces Topological Structure Learning (TSL), a novel framework designed for the Weakly-Supervised Out-of-Distribution Detection (WSOOD) setting. In this scenario, models are trained with very few labeled in-distribution (ID) samples and a large, unlabeled pool containing a mixture of ID and OOD data. TSL employs self-supervised representation learning and reciprocal neighbor mining to reconstruct a topological space that effectively separates ID from OOD instances. Experimental results demonstrate that TSL significantly outperforms existing methods, reducing the False Positive Rate (FPR95) by over 15% on key benchmarks.

The Challenge of Weakly-Supervised OOD Detection

In real-world applications, such as autonomous driving or medical diagnosis, models frequently encounter data that does not belong to any predefined training class. A robust system must be able to identify these "unknown" inputs. While standard OOD detection assumes a fully labeled ID dataset, the WSOOD setting reflects a more practical reality: expert labels are scarce, but raw, unlabeled data is abundant.

The WSOOD framework: combining limited labeled ID data with a large unlabeled mix of ID and OOD data to train a robust detection model.

The primary difficulty in WSOOD is that models trained on minimal labeled data tend to overfit and fail to extract generalizable features. Consequently, the unlabeled pool—which contains both useful ID data and distracting OOD data—becomes difficult to partition without a sophisticated structural approach.

Methodology: Topological Structure Learning (TSL)

TSL addresses the limitations of sparse labeling through a three-stage process:

  1. Topological Space Representation Learning: The model first undergoes self-supervised contrastive learning (SimCLR) using the entire dataset (labeled and unlabeled). This allows the model to learn the underlying manifold of the data without relying on labels.
  2. Topological Connection Mining: TSL moves beyond simple proximity metrics. It identifies reciprocal neighbors—pairs of points that mutually rank each other as top neighbors. This reciprocity serves as a high-confidence signal for class similarity. It also uses Mahalanobis distance to identify distant negative pairs, ensuring that the model doesn't push away valid ID clusters.
  3. Topological Structure Reconstruction: The model builds a "topological skeleton" from the few available labeled samples. It then "fleshes out" this structure by pulling reciprocal positive pairs closer and pushing mined negative pairs apart. This process maximizes the margin between the ID distribution and the OOD noise.

Experimental Evaluation

The authors tested TSL on standard benchmarks adapted for low-label regimes, such as CIFAR-10 (25 labels/class) and CIFAR-100 (4 labels/class). The OOD sets included TinyImageNet and LSUN.

Visual representation of In-Distribution (ID) data (top) vs. Out-of-Distribution (OOD) data (bottom) used in testing.

Key Results

TSL consistently outperformed previous state-of-the-art methods like STEP and traditional OOD methods like ODIN or MAH across nearly all benchmarks:

  • Superior Performance: On the CIFAR-10 vs. TinyImageNet task, TSL achieved a 15.37% reduction in FPR95 compared to STEP.
  • Generalization to Unseen OOD: The model successfully detected OOD classes that were not present in the unlabeled training pool, proving that it learns a general concept of "in-distribution" rather than just memorizing the unlabeled noise.
  • Hyperparameter Robustness: The method is relatively insensitive to the choice of the number of neighbors ($K$), simplifying its application in diverse scenarios.

Conclusion and Future Directions

Topological Structure Learning provides a powerful solution for OOD detection when labeled data is at a premium. By leveraging the inherent geometric structure of the data through reciprocal mining, TSL creates a robust boundary for the "known" world. While the method is powerful, future research may focus on optimizing the computational efficiency of neighbor mining and refining the balance of negative pair repulsion to further enhance stability in highly skewed data environments.

Summary updated

BibTeX
@inproceedings{he2023topological,
  author = {Rundong He and Rongxue Li and Zhongyi Han and Yilong Yin},
  title = {{Topological Structure Learning for Weakly-Supervised Out-of-Distribution Detection}},
  booktitle = {ACM Multimedia},
  year = {2023},
  doi = {10.1145/3581783.3612195},
}
Figure