Skip to main content
QUICK REVIEW

[Paper Review] SPot-the-Difference Self-Supervised Pre-training for Anomaly Detection and Segmentation

Zou, Yang, Jongheon Jeong|arXiv (Cornell University)|Jul 28, 2022
Anomaly Detection Techniques and ApplicationsComputer Science15 citations
TL;DR

This paper introduces SPot-the-Difference (SPD), a self-supervised pre-training method that enhances local sensitivity for anomaly detection by regularizing contrastive learning with a spot-the-difference loss. It also releases VisA, the largest industrial anomaly detection dataset (10,821 images, 1,200 anomalies), showing SPD improves AU-PR by 5.9% over SimSiam and 6.8% over supervised pre-training in 2-class high-shot settings.

ABSTRACT

Visual anomaly detection is commonly used in industrial quality inspection. In this paper, we present a new dataset as well as a new self-supervised learning method for ImageNet pre-training to improve anomaly detection and segmentation in 1-class and 2-class 5/10/high-shot training setups. We release the Visual Anomaly (VisA) Dataset consisting of 10,821 high-resolution color images (9,621 normal and 1,200 anomalous samples) covering 12 objects in 3 domains, making it the largest industrial anomaly detection dataset to date. Both image and pixel-level labels are provided. We also propose a new self-supervised framework - SPot-the-difference (SPD) - which can regularize contrastive self-supervised pre-training, such as SimSiam, MoCo and SimCLR, to be more suitable for anomaly detection tasks. Our experiments on VisA and MVTec-AD dataset show that SPD consistently improves these contrastive pre-training baselines and even the supervised pre-training. For example, SPD improves Area Under the Precision-Recall curve (AU-PR) for anomaly segmentation by 5.9% and 6.8% over SimSiam and supervised pre-training respectively in the 2-class high-shot regime. We open-source the project at http://github.com/amazon-research/spot-diff .

Motivation & Objective

  • To address the challenge of limited anomalous data in industrial surface defect detection by developing a self-supervised pre-training method that enhances local sensitivity to defects.
  • To create a large-scale, high-resolution, multi-domain industrial anomaly dataset with both image and pixel-level annotations to support robust benchmarking.
  • To improve generalization and performance in low-shot and 2-class anomaly detection setups using a novel contrastive self-supervision framework.
  • To demonstrate that SPD outperforms both contrastive and supervised pre-training across multiple benchmarks and backbone architectures.

Proposed method

  • Proposes a spot-the-difference (SPD) loss that encourages models to detect subtle local differences between augmented image views, improving sensitivity to small defects.
  • Uses SmoothBlend augmentation to generate synthetic image pairs with localized differences, simulating real-world anomalies during pre-training.
  • Integrates the SPD loss as a regularizer with existing contrastive self-supervised methods like SimSiam, MoCo, and SimCLR.
  • Applies the SPD-regularized representations to downstream anomaly detection and segmentation using state-of-the-art methods like PaDiM and PatchCore.
  • Employs a learnable hyperparameter η to balance the SPD loss with the main contrastive objective during pre-training.
  • Validates the method on two benchmarks: VisA (newly released) and MVTec-AD, under 1-class and 2-class training regimes.

Experimental results

Research questions

  • RQ1Can a self-supervised pre-training method that emphasizes local differences improve anomaly detection performance compared to standard contrastive or supervised pre-training?
  • RQ2Does the proposed SPD framework generalize across different backbones and downstream anomaly detection architectures?
  • RQ3How does the SPD method perform in low-shot and 2-class settings where anomalous data is available?
  • RQ4Can the SPD-regularized representations improve both classification and pixel-level segmentation of anomalies?
  • RQ5Does the SPD method also improve generalization on standard ImageNet classification, indicating broader utility?

Key findings

  • SPD improves AU-PR for anomaly segmentation by 5.9% over SimSiam and 6.8% over supervised pre-training in the 2-class high-shot regime on VisA.
  • On VisA, SPD boosts AU-PR by 0.5% and 0.9% for classification and segmentation, respectively, when applied to supervised ImageNet pre-training.
  • SPD consistently improves performance across multiple contrastive baselines (SimSiam, MoCo, SimCLR) and backbones (ResNet-50, Wide ResNet-50).
  • The SPD loss with η=0.1 yields the best performance and is selected as the default hyperparameter setting.
  • SPD improves ImageNet top-1 accuracy by 0.4% for ResNet-18 and 0.3% for ResNet-50, indicating broader benefits beyond anomaly detection.
  • Qualitative analysis shows that SPD enhances GradCAM attention maps, focusing more on local defects compared to standard pre-training.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.