Lune

NeurIPS2023Top-tier venue

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

Charles Guille-Escuret, Pau Rodríguez, David Vázquez, Ioannis Mitliagkas, João Monteiro

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. 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. 1

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

3 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • AutoSciDACT: Automated Scientific Discovery through Contrastive Embedding and Hypothesis Testing cites A Simple Framework for Contrastive Learning of Visual Representations
  • Feature Squeezing: Detecting Adversarial Examples in Deep Neural Networks cites Towards Evaluating the Robustness of Neural Networks
  • Can We Ignore Labels in Out of Distribution Detection? cites Energy-based Out-of-distribution Detection
  • Can We Ignore Labels in Out of Distribution Detection? cites A Simple Framework for Contrastive Learning of Visual Representations
  • Big Self-Supervised Models are Strong Semi-Supervised Learners cites A Simple Framework for Contrastive Learning of Visual Representations
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers3

  1. AutoSciDACT: Automated Scientific Discovery through Contrastive Embedding and Hypothesis TestingSamuel Bright-Thonney, Christina Reissel, Gaia Grosso, Nathaniel Woodward et al.NeurIPS 2025 · 4 citations
  2. LOTTERY: Learning from Reference-Only Samples in Two-Sample Testing under Size AsymmetryXunye Tian, Zhijian Zhou, Liuhua Peng, Feng LiuICML 2026
  3. Can We Ignore Labels in Out of Distribution Detection?Hong Yang, Qi Yu, Travis DesellICLR 2025

Builds on24

  1. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
  2. Towards Evaluating the Robustness of Neural NetworksNicholas Carlini, David A. WagnerS&P 2017 · 9,786 citations
  3. Big Self-Supervised Models are Strong Semi-Supervised LearnersTing Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi et al.NeurIPS 2020 · 2,611 citations
  4. Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
  5. Feature Squeezing: Detecting Adversarial Examples in Deep Neural NetworksWeilin Xu, David Evans, Yanjun QiNDSS 2018 · 1,633 citations

Related papers

  1. Gradient-Based Novelty Detection Boosted by Self-Supervised Binary ClassificationJingbo Sun, Li Yang, Jiaxin Zhang, Frank Liu et al.AAAI 2022 · 17 citations
  2. SSD: A Unified Framework for Self-Supervised Outlier DetectionVikash Sehwag, Mung Chiang, Prateek MittalICLR 2021 · 410 citations
  3. WDiscOOD: Out-of-Distribution Detection via Whitened Linear Discriminant AnalysisYiye Chen, Yunzhi Lin, Ruinian Xu, Patricio A. VelaICCV 2023 · 13 citations
  4. CADE: Detecting and Explaining Concept Drift Samples for Security ApplicationsLimin Yang, Wenbo Guo, Qingying Hao, Arridhana Ciptadi et al.USENIX Security 2021 · 241 citations
  5. Scaling Out-of-Distribution Detection for Real-World SettingsDan Hendrycks, Steven Basart, Mantas Mazeika, Andy Zou et al.ICML 2022 · 653 citations
Dusk over the sea between two cliffs drawn in fine vertical lines