Mind the Way You Select Negative Texts: Pursuing the Distance Consistency in OOD Detection with VLMs
Organizations: Institute of Information Engineering, Chinese Academy of Sciences · School of Cyber Security, University of Chinese Academy of Sciences · Institute of Computing Technology, Chinese Academy of Sciences · Beijing Academy of Artificial Intelligence ·
Abstract
Out-of-distribution (OOD) detection seeks to identify samples from unknown classes, a critical capability for deploying machine learning models in open-world scenarios. Recent research has demonstrated that Vision-Language Models (VLMs) can effectively leverage their multi-modal representations for OOD detection. However, current methods often incorporate intra-modal distance during OOD detection, such as comparing negative texts with ID labels or comparing test images with image proxies. This design paradigm creates an inherent inconsistency against the inter-modal distance that CLIP-like VLMs are optimized for, potentially leading to suboptimal performance. To address this limitation, we propose InterNeg, a simple yet effective framework that systematically utilizes consistent inter-modal distance enhancement from textual and visual perspectives. From the textual perspective, we devise an inter-modal criterion for selecting negative texts. From the visual perspective, we dynamically identify high-confidence OOD images and invert them into the textual space, generating extra negative text embeddings guided by inter-modal distance. Extensive experiments across multiple benchmarks demonstrate the superiority of our approach. Notably, our InterNeg achieves state-of-the-art performance compared to existing works, with a 3.47% reduction in FPR95 on the large-scale ImageNet benchmark and a 5.50% improvement in AUROC on the challenging Near-OOD benchmark.
Figures & tables
| Methods | FPR95 | AUROC | ||
| Near-OOD | Far-OOD | Near-OOD | Far-OOD | |
| Methods requiring training on ID or extra data | ||||
| GEN [ 38 ] | – | – | 78.97 | 90.98 |
| ReAct [ 51 ] | – | – | 79.94 | 93.70 |
| RMDS [ 48 ] | – | – | 80.09 | 92.60 |
| SCALE [ 65 ] | – | – | 81.36 | 96.53 |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Near / Far OOD | Datasets | FPR95 | AUROC |
| Near-OOD | SSB-hard [ 55 ] | 69.96 | 80.24 |
| NINCO [ 3 ] | 60.90 | 84.16 | |
| Mean | 65.43 | 82.20 | |
| Far-OOD | iNaturalist [ 24 ] | 0.40 | 99.71 |
| Textures [ 7 ] | 18.17 | 96.74 | |
| OpenImage-O [ 56 ] | 32.30 | 93.69 |
| Methods | FPR95 | AUROC | ||
| Near-OOD | Far-OOD | Near-OOD | Far-OOD | |
| Methods requiring training on ID or extra data | ||||
| GEN [ 38 ] | – | – | 81.31 | 79.68 |
| VOS [ 13 ] + EBO [ 37 ] | – | – | 80.93 | 81.32 |
| SCALE [ 65 ] | – | – | 80.99 | 81.42 |
| OE [ 21 ] + MSP [ 20 ] | – | – | 88.30 | 81.41 |
| Near / Far OOD | Datasets | FPR95 | AUROC |
| Near-OOD | CIFAR10 [ 30 ] | 60.10 | 84.19 |
| TIN [ 31 ] | 64.99 | 86.71 | |
| Mean | 62.54 | 85.45 | |
| Far-OOD | MNIST [ 9 ] | 0.01 | 99.97 |
| SVHN [ 44 ] | 3.23 | 99.41 | |
| Texture [ 7 ] | 21.16 | 96.84 |
| Methods | FPR95 | AUROC | ||
| Near-OOD | Far-OOD | Near-OOD | Far-OOD | |
| Methods requiring training on ID or extra data | ||||
| PixMix [ 23 ] + KNN [ 52 ] | – | – | 93.10 | 95.94 |
| OE [ 21 ] + MSP [ 20 ] | – | – | 94.82 | 96.00 |
| PixMix [ 23 ] + RotPred [ 22 ] | – | – | 94.86 | 98.18 |
| Zero-shot methods (no training on ID or extra data) | ||||
| Near / Far OOD | Datasets | FPR95 | AUROC |
| Near-OOD | CIFAR100 [ 30 ] | 37.26 | 91.81 |
| TIN [ 31 ] | 10.60 | 98.45 | |
| Mean | 23.93 | 95.13 | |
| Far-OOD | MNIST [ 9 ] | 0.00 | 100.00 |
| SVHN [ 44 ] | 0.06 | 99.97 | |
| Texture [ 7 ] | 0.41 | 99.57 |
| Benchmark | Seed | Mean | Std | ||||
| 0 | 1 | 2 | 3 | 4 | |||
| Four-OOD | 97.43 | 97.38 | 97.38 | 97.45 | 97.51 | 97.43 | 0.05 |
| Near-OOD | 82.20 | 81.56 | 81.50 | 82.29 | 82.59 | 82.03 | 0.46 |
| ID Image Proxies Source | Method | AUROC | FPR95 |
| ImageNet | NegLabel | 93.08 | 29.77 |
| AdaNeg | 96.24 | 19.21 | |
| InterNeg | 96.84 | 18.40 | |
| ImageNet-V2 | NegLabel | 93.90 | 27.64 |
| AdaNeg | 96.19 | 19.97 | |
| InterNeg | 96.96 | 18.18 |
| Method | Mean | iNaturalist | Places | Textures | SUN |
| AdaNeg | 0.0058 | 0.0068 | 0.0046 | 0.0093 | 0.0025 |
| InterNeg | 0.0067 | 0.0074 | 0.0055 | 0.0113 | 0.0029 |
| Source | Method | Average | |
| AUROC | FPR95 | ||
| Common-20K | NegLabel | 90.50 | 43.02 |
| CSP | 92.06 | 36.56 | |
| AdaNeg | 93.12 | 32.39 | |
| InterNeg | 94.58 | 28.77 | |
| Part-of-Speech | NegLabel | 92.71 | 32.12 |
OOD Detection
Out-of-distribution (OOD) detection identifies inputs unlike a model’s training data so systems can flag uncertainty, reject inputs, or adapt safely.
See all 222 papers