Papers › DiAD: A Diffusion-based Framework for Multi-class Anomaly Detection

DiAD: A Diffusion-based Framework for Multi-class Anomaly Detection

11 Dec 2023arXiv:2312.06607archive 2025-07-28

Haoyang He, Jiangning Zhang, Hongxu Chen, Xuhai Chen, Zhishan Li, Xu Chen, Yabiao Wang, Chengjie Wang, Lei Xie

Reconstruction-based approaches have achieved remarkable outcomes in anomaly detection. The exceptional image reconstruction capabilities of recently popular diffusion models have sparked research efforts to utilize them for enhanced reconstruction of anomalous images. Nonetheless, these methods might face challenges related to the preservation of image categories and pixel-wise structural integrity in the more practical multi-class setting. To solve the above problems, we propose a Difusion-based Anomaly Detection (DiAD) framework for multi-class anomaly detection, which consists of a pixel-space autoencoder, a latent-space Semantic-Guided (SG) network with a connection to the stable diffusion's denoising network, and a feature-space pre-trained feature extractor. Firstly, The SG network is proposed for reconstructing anomalous regions while preserving the original image's semantic information. Secondly, we introduce Spatial-aware Feature Fusion (SFF) block to maximize reconstruction accuracy when dealing with extensively reconstructed areas. Thirdly, the input and reconstructed images are processed by a pre-trained feature extractor to generate anomaly maps based on features extracted at different scales. Experiments on MVTec-AD and VisA datasets demonstrate the effectiveness of our approach which surpasses the state-of-the-art methods, e.g., achieving 96.8/52.6 and 97.2/99.0 (AUROC/AP) for localization and detection respectively on multi-class MVTec-AD dataset. Code will be available at https://lewandofskee.github.io/projects/diad.

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

Code

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

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

lewandofskee/DiAD officialmentioned on GitHubpytorchApache-2.0 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; 8 ran; 0 honoured the contract we drafted; 3 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.

2ran · violated contract
2ran · our draft was wrong
4ran
3unverified

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 lewandofskee/DiAD. “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.

data_transforms lewandofskee/DiAD/mvtecad_dataloader.py official repository ran Apache-2.0 (permissive) · aace8d0be1f68d91 · report
default lewandofskee/DiAD/ldm/modules/attention.py official repository ran · violated contract Apache-2.0 (permissive) · 424012cb37b31172 · report
exists lewandofskee/DiAD/ldm/modules/attention.py official repository ran · violated contract Apache-2.0 (permissive) · aa5486a3650902d8 · report
get_node_name lewandofskee/DiAD/build_model.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 0dbf855dab1ab575 · report
gt_transforms lewandofskee/DiAD/mvtecad_dataloader.py official repository ran Apache-2.0 (permissive) · 237671f7fa1d1c84 · report
isimage lewandofskee/DiAD/ldm/util.py official repository ran Apache-2.0 (permissive) · b1368330cf0f5642 · report
ismap lewandofskee/DiAD/ldm/util.py official repository ran Apache-2.0 (permissive) · d72762b700feee6f · report
uniq lewandofskee/DiAD/ldm/modules/attention.py official repository ran · our draft was wrong Apache-2.0 (permissive) · 9a299fe5ae09e407 · report
get_state_dict lewandofskee/DiAD/finetune_autoencoder.py official repository unverified Apache-2.0 (permissive) · cfc17707f35e7ec4 · report
load_state_dict lewandofskee/DiAD/finetune_autoencoder.py official repository unverified Apache-2.0 (permissive) · df733a879693145d · report
log_txt_as_img lewandofskee/DiAD/ldm/util.py official repository unverified Apache-2.0 (permissive) · 6b4c1a8ce5fb7282 · report

Tasks

Anomaly DetectionDenoisingImage ReconstructionMulti-class Anomaly Detection

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Multi-class Anomaly Detection MVTec AD DiAD Detection AUROC 97.2 #12 of 13 Archive leaderboard report
Multi-class Anomaly Detection MVTec AD DiAD Segmentation AUROC 96.8 #12 of 13 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

Diffusion

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