This paper, presented at ICML 2024, tackles a fundamental problem in AI safety: how to reliably detect when a machine learning model is being asked to make a prediction on data it wasn't trained for—known as Out-of-Distribution (OOD) detection.
TL;DR
The authors demonstrate that traditional model ensembles fail at OOD detection because their individual models are "too similar" (mode-connected). By training ensemble members on fundamentally different tasks (e.g., classification vs. contrastive learning), they create a Multi-Comprehension (MC) Ensemble that provides the feature diversity necessary to significantly outperform state-of-the-art OOD detectors.
What Problem Does This Paper Address?
Deep neural networks are notoriously overconfident. When shown an image of something they’ve never seen before (an OOD sample), they often classify it into a known category with high certainty. OOD detection aims to identify these samples so the system can fail gracefully.
Researchers often use ensembles—combining multiple models—to improve robustness. The intuition is that different models will "disagree" on OOD data. However, recent studies suggest that "Deep Ensembles" (multiple models trained with different random seeds) don't actually improve OOD detection much more than a single large model.
The authors identify the root cause: Mode Connectivity. Models trained with the same loss function (like Cross-Entropy), even with different starting points, end up in the same "loss basin." They learn nearly identical feature representations, meaning they don't provide the diverse "second opinions" needed to spot OOD data.
Methods
The authors propose the Multi-Comprehension (MC) Ensemble. Instead of just changing random seeds, they change the supervision task for each model in the ensemble:
- Cross-Entropy (SupCE): Standard mapping of data to labels.
- SimCLR: A self-supervised task that learns by comparing augmented versions of the same image.
- Supervised Contrastive (SupCon): A task that pulls images of the same class together in feature space while pushing different classes away.
To prove these models are actually different, they introduce two new evaluation tools:
- Loss Barrier Visualization: They show that models from different tasks are separated by high "energy barriers" in the loss landscape, making them impossible to align via simple transformations.
- Self-Coupling Index (SCI): A quantitative metric based on Optimal Transport that measures the degree of consistency between two models' feature representations. A low SCI indicates high diversity.
Datasets
The researchers evaluated their approach on standard OOD benchmarks:
- In-Distribution (ID): CIFAR-10 and ImageNet-1K.
- Out-of-Distribution (OOD): SVHN, LSUN, iSUN, Textures, Places365, and iNaturalist.
- Near-OOD: CIFAR-100 (used as OOD for a CIFAR-10 model), which is a much harder task because the classes are semantically similar.
Key Insights and Ideas
- The Illusion of Diversity: Naive ensembles are "self-coupled." Even if you train them on different subsets of data, their features can be aligned by a simple linear transformation. They are essentially the same model in different clothes.
- Task Diversity > Seed Diversity: Changing the objective of the training is the most effective way to break mode connectivity. This forces the models to develop different "comprehensions" of the same data.
- Feature-Level Ensembling: Instead of just averaging final probabilities, the authors show that ensembling at the penultimate feature layer is a powerful "OOD booster" because it reduces the variance of feature estimates for ID data while keeping OOD activations distinct.
Key Results
The MC Ensemble consistently outperformed both single models and naive ensembles across all benchmarks:
- CIFAR-10: Using a KNN-based scoring method, the MC Ensemble achieved an average FPR95 of 5.58% (False Positive Rate at 95% True Positive Rate). For comparison, a standard Deep Ensemble (3xSupCE) had an FPR95 of 27.78%.
- Near-OOD: On the difficult CIFAR-10 vs. CIFAR-100 task, the MC Ensemble reduced the FPR95 by 30.05% compared to a naive ensemble.
- Efficiency: The authors demonstrated that the ensemble's knowledge can be distilled into a single model (using EnD²), maintaining high performance while eliminating the computational overhead of running multiple models at inference time.
Limitations and Future Work
- Task Pool Size: The study only explored a few training tasks (CE, SimCLR, SupCon). The authors note that as more diverse training criteria are developed, the "task pool" could be expanded to find even more diverse combinations.
- Computational Cost: Training multiple models is expensive. While distillation solves the latency issue during deployment, the initial training phase still requires significant resources.
- Selection Logic: While the SCI helps guide model selection, finding the absolute optimal combination of tasks for a specific dataset remains an open area for further study.
Summary updated