HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Mean-Shifted Contrastive Loss for Anomaly Detection

Tal Reiss Yedid Hoshen

Mean-Shifted Contrastive Loss for Anomaly Detection

Abstract

Deep anomaly detection methods learn representations that separate between normal and anomalous images. Although self-supervised representation learning is commonly used, small dataset sizes limit its effectiveness. It was previously shown that utilizing external, generic datasets (e.g. ImageNet classification) can significantly improve anomaly detection performance. One approach is outlier exposure, which fails when the external datasets do not resemble the anomalies. We take the approach of transferring representations pre-trained on external datasets for anomaly detection. Anomaly detection performance can be significantly improved by fine-tuning the pre-trained representations on the normal training images. In this paper, we first demonstrate and analyze that contrastive learning, the most popular self-supervised learning paradigm cannot be naively applied to pre-trained features. The reason is that pre-trained feature initialization causes poor conditioning for standard contrastive objectives, resulting in bad optimization dynamics. Based on our analysis, we provide a modified contrastive objective, the Mean-Shifted Contrastive Loss. Our method is highly effective and achieves a new state-of-the-art anomaly detection performance including $98.6\%$ ROC-AUC on the CIFAR-10 dataset.

Code Repositories

talreiss/PANDA
pytorch
Mentioned in GitHub
talreiss/Mean-Shifted-Anomaly-Detection
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
anomaly-detection-on-anomaly-detection-onMeanShifted
Network: ResNet-152
ROC-AUC: 92.6
anomaly-detection-on-mvtec-adMean-Shifted Contrastive Loss
Detection AUROC: 87.2
anomaly-detection-on-one-class-cifar-10Mean-Shifted Contrastive Loss
AUROC: 98.6
anomaly-detection-on-one-class-cifar-100Mean-Shifted Contrastive Loss
AUROC: 96.5
anomaly-detection-on-unlabeled-cifar-10-vsMeanShifted
AUROC: 90.0
Network: ResNet-152

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp