ReContrast: Domain-Specific Anomaly Detection via Contrastive Reconstruction

Jia Guo, Shuai Lu, Lize Jia, Weihang Zhang, Huiqi Li
2/12/2026

No official code found. Best implementation: guojiajeremy/ReContrast (50 stars, last commit 2024-07-18).

Abstract

Most advanced unsupervised anomaly detection (UAD) methods rely on modeling feature representations of frozen encoder networks pre-trained on large-scale datasets, e.g. ImageNet. However, the features extracted from the encoders that are borrowed from natural image domains coincide little with the features required in the target UAD domain, such as industrial inspection and medical imaging. In this paper, we propose a novel epistemic UAD method, namely ReContrast, which optimizes the entire network to reduce biases towards the pre-trained image domain and orients the network in the target domain. We start with a feature reconstruction approach that detects anomalies from errors. Essentially, the elements of contrastive learning are elegantly embedded in feature reconstruction to prevent the network from training instability, pattern collapse, and identical shortcut, while simultaneously optimizing both the encoder and decoder on the target domain. To demonstrate our transfer ability on various image domains, we conduct extensive experiments across two popular industrial defect detection benchmarks and three medical image UAD tasks, which shows our superiority over current state-of-the-art methods.

View on arXivView PDF

Code Implementations(1)

[NeurIPS2023] Official Implementation of "ReContrast: Domain-Specific Anomaly Detection via Contrastive Reconstruction".

5011PythonMay 30, 20232 years ago
anomaly-detection

Cite this paper

@article{guo2026recontrast,
  title  = {ReContrast: Domain-Specific Anomaly Detection via Contrastive Reconstruction},
  author = {Jia Guo and Shuai Lu and Lize Jia and Weihang Zhang and Huiqi Li},
  year   = {2026},
  eprint = {2306.02602},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/pdf/2306.02602},
  journal = {NEURIPS 2023 2023}
}

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/2306.02602.svg)](https://codeofpaper.com/paper/2306.02602)

Discussion