Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

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

About

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.

Charles Guille-Escuret, Pau Rodriguez, David Vazquez, Ioannis Mitliagkas, Joao Monteiro• 2022

Related benchmarks

TaskDatasetResultRank
Error detectionAdversarial Attacks (test)
AUC70.02
40
OOD DetectionCoComageNet
Detection AUC0.5688
40
Error detectionIn-distribution (test)
AUC0.565
40
Error detectionCorruptions (test)
AUC90.11
40
Error detectionAverage All shifts (test)
AUC71.49
40
OOD DetectionCoComageNet mono
Detection AUC0.5224
40
Distribution Shift DetectionBROAD (test)
Novel Classes AUC66.79
40
OOD DetectioniNaturalist OOD
AUROC95.28
31
Distribution Shift DetectionCIFAR-10 vs CIFAR-10.1
Average Rejection Rate1
27
OOD DetectionImageNet-O
AUROC0.8229
18
Showing 10 of 13 rows

Other info

Code

Follow for update