# ReContrast: Domain-Specific Anomaly Detection via Contrastive Reconstruction

**Authors:** Jia Guo, Shuai Lu, Lize Jia, Weihang Zhang, Huiqi Li  
**arXiv:** [2306.02602](https://arxiv.org/abs/2306.02602)  
**Date:** 2023-06-05  
**Summary page:** https://www.summarizepaper.com/en/paper/2306.02602v1/

## Key points

- Most advanced methods in unsupervised anomaly detection rely on pre-trained encoder networks trained on large-scale datasets like ImageNet.
- Pre-trained encoders often extract features that are not well-suited for the target UAD domain, such as industrial inspection and medical imaging.
- The authors propose a novel UAD method called ReContrast to address this issue.
- ReContrast optimizes the entire network to reduce biases towards the pre-trained image domain and aligns it with the target domain.
- ReContrast starts with a feature reconstruction approach that detects anomalies based on errors.
- It incorporates elements of contrastive learning into feature reconstruction to prevent training instability, pattern collapse, and identical shortcut problems.
- This approach simultaneously optimizes both the encoder and decoder on the target domain.
- Extensive experiments were conducted on two popular industrial defect detection benchmarks and three medical image UAD tasks to demonstrate the transferability of ReContrast across different image domains.
- ReContrast outperforms current state-of-the-art methods in terms of accuracy and performance.
- An ablation study was conducted to verify the effectiveness of different elements proposed in ReContrast.
- The method was also evaluated on open-sourced datasets specific to each domain (MVTec AD for industrial defect detection, APTOS for medical imaging).
- The results further validate the superiority of ReContrast in adapting to various medical image modalities.
- Overall, this paper presents a promising approach for domain-specific anomaly detection by reducing biases towards pre-trained encoders and optimizing networks for target domains.

## Summary

In the field of unsupervised anomaly detection (UAD), most advanced methods rely on pre-trained encoder networks that are trained on large-scale datasets like ImageNet. However, these pre-trained encoders often extract features that are not well-suited for the target UAD domain, such as industrial inspection and medical imaging. To address this issue, the authors propose a novel UAD method called ReContrast. ReContrast optimizes the entire network to reduce biases towards the pre-trained image domain and aligns it with the target domain. The method starts with a feature reconstruction approach that detects anomalies based on errors. It incorporates elements of contrastive learning into feature reconstruction to prevent training instability, pattern collapse, and identical shortcut problems. This approach simultaneously optimizes both the encoder and decoder on the target domain. To demonstrate the transferability of ReContrast across different image domains, extensive experiments were conducted on two popular industrial defect detection benchmarks and three medical image UAD tasks. The results show that ReContrast outperforms current state-of-the-art methods in terms of accuracy and performance. An ablation study was also conducted to verify the effectiveness of different elements proposed in ReContrast. Additionally, they evaluated their method on open-sourced datasets specific to each domain (MVTec AD for industrial defect detection, APTOS for medical imaging). The results further validate the superiority of ReContrast in adapting to various medical image modalities. Overall, this paper presents a promising approach for domain-specific anomaly detection by reducing biases towards pre-trained encoders and optimizing networks for target domains. The experimental results highlight its effectiveness in industrial inspection and medical imaging applications.
