ResAD: A Simple Framework for Class Generalizable Anomaly Detection

Xincheng Yao, Zixin Chen, Chao Gao, Guangtao Zhai, Chongyang Zhang
10/26/2024
cs.CVcs.LG

Official code: xcyao00/ResAD (94 stars, MIT, last commit 2025-10-18). 1 more implementation below.

Abstract

This paper explores the problem of class-generalizable anomaly detection, where the objective is to train one unified AD model that can generalize to detect anomalies in diverse classes from different domains without any retraining or fine-tuning on the target data. Because normal feature representations vary significantly across classes, this will cause the widely studied one-for-one AD models to be poorly classgeneralizable (i.e., performance drops dramatically when used for new classes). In this work, we propose a simple but effective framework (called ResAD) that can be directly applied to detect anomalies in new classes. Our main insight is to learn the residual feature distribution rather than the initial feature distribution. In this way, we can significantly reduce feature variations. Even in new classes, the distribution of normal residual features would not remarkably shift from the learned distribution. Therefore, the learned model can be directly adapted to new classes. ResAD consists of three components: (1) a Feature Converter that converts initial features into residual features; (2) a simple and shallow Feature Constraintor that constrains normal residual features into a spatial hypersphere for further reducing feature variations and maintaining consistency in feature scales among different classes; (3) a Feature Distribution Estimator that estimates the normal residual feature distribution, anomalies can be recognized as out-of-distribution. Despite the simplicity, ResAD can achieve remarkable anomaly detection results when directly used in new classes. The code is available at https://github.com/xcyao00/ResAD.

View on arXivView PDF

Code Implementations(2)

xcyao00/ResADOfficial100%
MIT

[NeurIPS 2024 Spotlight] Pytorch Implementation for NeurIPS 2024 paper: ResAD: A Simple Framework for Class Generalizable Anomaly Detection

946PythonOct 29, 20241 years agoMIT
anomaly-detectionclass-generalizable-anomaly-detectionresidual-features
MIT

Extending 'ResAD: A Simple Framework for Class Generalizable Anomaly Detection (NeurIPS 2024) for Hauptseminar: Advanced Machine Learning for Anomaly Detection - Summer'25

00PythonJul 16, 20257 months agoMIT

Similar Papers

Cite this paper

@article{yao2024resad,
  title  = {ResAD: A Simple Framework for Class Generalizable Anomaly Detection},
  author = {Xincheng Yao and Zixin Chen and Chao Gao and Guangtao Zhai and Chongyang Zhang},
  year   = {2024},
  eprint = {2410.20047},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2410.20047},
  url    = {http://arxiv.org/abs/2410.20047v1},
  journal = {NEURIPS 2024 2024}
}

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

Discussion