CADet: Fully Self-Supervised Out-Of-Distribution Detection With Contrastive Learning

Charles Guille-Escuret, Pau Rodriguez, David Vazquez, Ioannis Mitliagkas, Joao Monteiro
10/4/2022
cs.LGcs.CV
contrastive-ssl

Official code: charlesGE/OpenOOD-CADet (3 stars, Python, MIT, last commit 2023-10-28).

Abstract

Handling out-of-distribution (OOD) samples has become a major stake in the real-world deployment of machine learning systems. This work explores the use of self-supervised contrastive learning to the simultaneous detection of two types of OOD samples: unseen classes and adversarial perturbations.

Show full abstract

First, we pair self-supervised contrastive learning with the maximum mean discrepancy (MMD) two-sample test. This approach enables us to robustly test whether two independent sets of samples originate from the same distribution, and we demonstrate its effectiveness by discriminating between CIFAR-10 and CIFAR-10.1 with higher confidence than previous work. Motivated by this success, we introduce CADet (Contrastive Anomaly Detection), a novel method for OOD detection of single samples. CADet draws inspiration from MMD, but leverages the similarity between contrastive transformations of a same sample. CADet outperforms existing adversarial detection methods in identifying adversarially perturbed samples on ImageNet and achieves comparable performance to unseen label detection methods on two challenging benchmarks: ImageNet-O and iNaturalist. Significantly, CADet is fully self-supervised and requires neither labels for in-distribution samples nor access to OOD examples.

View on arXivView PDF

Code Implementations(1)

MIT

Fork of OpenOOD with CADet implementation

30Python, Jupyter NotebookOct 28, 20233 years agoMIT

Similar Papers

Cite this paper

@article{guilleescuret2022cadet,
  title  = {CADet: Fully Self-Supervised Out-Of-Distribution Detection With Contrastive Learning},
  author = {Charles Guille-Escuret and Pau Rodriguez and David Vazquez and Ioannis Mitliagkas and Joao Monteiro},
  year   = {2022},
  eprint = {2210.01742},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.01742}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.01742.svg)](https://codeofpaper.com/paper/2210.01742)

Discussion