CSI: Novelty Detection via Contrastive Learning on Distributionally Shifted Instances
About
Novelty detection, i.e., identifying whether a given sample is drawn from outside the training distribution, is essential for reliable machine learning. To this end, there have been many attempts at learning a representation well-suited for novelty detection and designing a score based on such representation. In this paper, we propose a simple, yet effective method named contrasting shifted instances (CSI), inspired by the recent success on contrastive learning of visual representations. Specifically, in addition to contrasting a given sample with other instances as in conventional contrastive learning methods, our training scheme contrasts the sample with distributionally-shifted augmentations of itself. Based on this, we propose a new detection score that is specific to the proposed training scheme. Our experiments demonstrate the superiority of our method under various novelty detection scenarios, including unlabeled one-class, unlabeled multi-class and labeled multi-class settings, with various image benchmark datasets. Code and pre-trained models are available at https://github.com/alinlab/CSI.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Image Classification | CIFAR-10 (test) | Accuracy94.8 | 3381 | |
| Image Classification | ImageNet-1K | Top-1 Acc74.27 | 836 | |
| Out-of-Distribution Detection | Textures | AUROC0.8647 | 141 | |
| Out-of-Distribution Detection | CIFAR-100 | AUROC89.2 | 107 | |
| Out-of-Distribution Detection | CIFAR-10 | AUROC96.87 | 105 | |
| Out-of-Distribution Detection | CIFAR-10 vs CIFAR-100 (test) | AUROC92.2 | 93 | |
| Anomaly Detection | WBC | ROCAUC0.504 | 87 | |
| Anomaly Detection | MVTec AD | Overall AUROC92.6 | 83 | |
| Out-of-Distribution Detection | CIFAR-10 (ID) vs SVHN (OOD) (test) | AUROC99.8 | 79 | |
| OOD Detection | Places (OOD) | AUROC76.27 | 76 |