Papers › CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional...

CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows

27 Jul 2021arXiv:2107.12571archive 2025-07-28

Denis Gudovskiy, Shun Ishizaka, Kazuki Kozuka

Unsupervised anomaly detection with localization has many practical applications when labeling is infeasible and, moreover, when anomaly examples are completely missing in the train data. While recently proposed models for such data setup achieve high accuracy metrics, their complexity is a limiting factor for real-time processing. In this paper, we propose a real-time model and analytically derive its relationship to prior methods. Our CFLOW-AD model is based on a conditional normalizing flow framework adopted for anomaly detection with localization. In particular, CFLOW-AD consists of a discriminatively pretrained encoder followed by a multi-scale generative decoders where the latter explicitly estimate likelihood of the encoded features. Our approach results in a computationally and memory-efficient model: CFLOW-AD is faster and smaller by a factor of 10x than prior state-of-the-art with the same input setting. Our experiments on the MVTec dataset show that CFLOW-AD outperforms previous methods by 0.36% AUROC in detection task, by 1.12% AUROC and 2.5% AUPRO in localization task, respectively. We open-source our code with fully reproducible experiments.

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="2107.12571")

Code

Syntology Ran 3 of 12 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 1 ran · honoured contract; 1 ran · our draft was wrong; 1 ran with no contract checked.

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

gudovskiy/cflow-ad officialmentioned in papermentioned on GitHubpytorchBSD-3-Clause report
caoyunkang/IKD mentioned on GitHubpytorch 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

12 samples harvested; 3 ran; 1 honoured the contract we drafted; 9 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.

1ran · honoured contract
1ran · our draft was wrong
1ran
9unverified

Licence: 0 of the 12 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 gudovskiy/cflow-ad. “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.

conv1x1 gudovskiy/cflow-ad/custom_models/resnet.py official repository ran · our draft was wrong BSD-3-Clause (permissive) · 2a80220dabcb742a · report
rescale gudovskiy/cflow-ad/utils.py official repository ran · honoured contract fingerprinted BSD-3-Clause (permissive) · f51e6ad9c7104a5a · report
warmup_learning_rate gudovskiy/cflow-ad/custom_models/utils.py official repository ran BSD-3-Clause (permissive) · a7e2b063f1913a27 · report
conv3x3 gudovskiy/cflow-ad/custom_models/resnet.py official repository unverified BSD-3-Clause (permissive) · 436bb4b1f6464d1b · report
denormalization gudovskiy/cflow-ad/visualize.py official repository unverified BSD-3-Clause (permissive) · d731362a1a10fe78 · report
get_logp gudovskiy/cflow-ad/utils.py official repository unverified BSD-3-Clause (permissive) · 2ab96791722158f7 · report
load_weights2 gudovskiy/cflow-ad/cflow-to-onnx.py official repository unverified BSD-3-Clause (permissive) · 5ed0a07d8083a744 · report
load_weights2 gudovskiy/cflow-ad/cflow-to-onnx2.py official repository unverified BSD-3-Clause (permissive) · 0b96b4820206a0ff · report
positionalencoding2d gudovskiy/cflow-ad/model.py official repository unverified BSD-3-Clause (permissive) · fd31dcc4742a6774 · report
resnet18 gudovskiy/cflow-ad/custom_models/resnet.py official repository unverified BSD-3-Clause (permissive) · fdc6bc5bd1f2e3c8 · report
subnet_fc gudovskiy/cflow-ad/model.py official repository unverified BSD-3-Clause (permissive) · 3f068df64f534372 · report
t2np gudovskiy/cflow-ad/utils.py official repository unverified BSD-3-Clause (permissive) · 993e5b3dd131459c · report

Tasks

Anomaly ClassificationAnomaly DetectionAnomaly SegmentationUnsupervised Anomaly Detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Anomaly Classification GoodsAD CFLOW-AD AUPR 75.3 #4 of 11 Archive leaderboard report
Anomaly Classification GoodsAD CFLOW-AD AUROC 71.2 #4 of 11 Archive leaderboard report
Anomaly Detection MVTec AD CFLOW-AD Detection AUROC 98.26 #63 of 148 Archive leaderboard report
Anomaly Detection MVTec AD CFLOW-AD FPS 27 #63 of 148 Archive leaderboard report
Anomaly Detection MVTec AD CFLOW-AD Segmentation AUPRO 94.6 #63 of 148 Archive leaderboard report
Anomaly Detection MVTec AD CFLOW-AD Segmentation AUROC 98.62 #63 of 148 Archive leaderboard report
Anomaly Detection VisA CFLOW Detection AUROC 91.5 #28 of 50 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Normalizing Flows

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