A Simple Fix to Mahalanobis Distance for Improving Near-OOD Detection
About
Mahalanobis distance (MD) is a simple and popular post-processing method for detecting out-of-distribution (OOD) inputs in neural networks. We analyze its failure modes for near-OOD detection and propose a simple fix called relative Mahalanobis distance (RMD) which improves performance and is more robust to hyperparameter choice. On a wide selection of challenging vision, language, and biology OOD benchmarks (CIFAR-100 vs CIFAR-10, CLINC OOD intent detection, Genomics OOD), we show that RMD meaningfully improves upon MD performance (by up to 15% AUROC on genomics OOD).
Jie Ren, Stanislav Fort, Jeremiah Liu, Abhijit Guha Roy, Shreyas Padhy, Balaji Lakshminarayanan• 2021
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Image Classification | ImageNet-1k (val) | -- | 1453 | |
| Out-of-Distribution Detection | iNaturalist | FPR@9519.47 | 200 | |
| Out-of-Distribution Detection | Textures | AUROC0.8938 | 141 | |
| Out-of-Distribution Detection | OpenImage-O | AUROC92.32 | 107 | |
| Out-of-Distribution Detection | NINCO | AUROC87.31 | 59 | |
| Out-of-Distribution Detection | ImageNet-1k Textures ID OOD | AUROC89.38 | 59 | |
| Image Classification | ImageNet OOD | ImageNet Acc58.4 | 55 | |
| Out-of-Distribution Detection | SSB hard | AUROC (%)72.87 | 51 | |
| Out-of-Distribution Detection | CIFAR100 ID Dnear OOD | AUROC80.15 | 47 | |
| Out-of-Distribution Detection | CIFAR100 (test) | Avg FPR95 (Overall)49.56 | 46 |
Showing 10 of 40 rows