Papers › ResAD: A Simple Framework for Class Generalizable Anomaly Detection

ResAD: A Simple Framework for Class Generalizable Anomaly Detection

26 Oct 2024arXiv:2410.20047archive 2025-07-28

Xincheng Yao, Zixin Chen, Chao GAO, Guangtao Zhai, Chongyang Zhang

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.20047")

Code

Syntology Ran 0 of 11 code samples harvested from 1 repository linked to this paper; 11 have no recorded run.

By repository: official repository: 11 samples from 1 repository, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

xcyao00/resad officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 0 ran; 0 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

11unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from xcyao00/resad. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

calculate_log_barrier_occ_loss xcyao00/resad/losses/loss.py official repository unverified MIT (permissive) · 09544c0c0a013039 · report
calculate_occ_loss xcyao00/resad/losses/loss.py official repository unverified MIT (permissive) · 5ac595999ee650c5 · report
get_logp_a xcyao00/resad/losses/utils.py official repository unverified MIT (permissive) · 4864e6c6c42523f8 · report
get_logp_boundary xcyao00/resad/losses/loss.py official repository unverified MIT (permissive) · 6871690b7d7c52ca · report
get_normal_boundary xcyao00/resad/losses/utils.py official repository unverified MIT (permissive) · 97bb30729343aee3 · report
get_position_encoding xcyao00/resad/models/modules.py official repository unverified MIT (permissive) · 5461edac0e02cae6 · report
load_and_transform_vision_data xcyao00/resad/main_ib.py official repository unverified MIT (permissive) · 5697b41685ddd400 · report
load_mc_reference_features xcyao00/resad/main_all.py official repository unverified MIT (permissive) · 8724d875b88a147c · report
load_mc_reference_features xcyao00/resad/main_ib.py official repository unverified MIT (permissive) · 38f73e38d215dec7 · report
load_reference_features xcyao00/resad/cpr.py official repository unverified MIT (permissive) · 247b256eed3c80d3 · report
subnet_fc xcyao00/resad/models/fc_flow.py official repository unverified MIT (permissive) · 3f068df64f534372 · report

Tasks

Anomaly Detection

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections