Papers › GLAD: Towards Better Reconstruction with Global and Local Adaptive Diffusion Models...

GLAD: Towards Better Reconstruction with Global and Local Adaptive Diffusion Models for Unsupervised Anomaly Detection

11 Jun 2024arXiv:2406.07487archive 2025-07-28

Hang Yao, Ming Liu, Haolin Wang, Zhicun Yin, Zifei Yan, Xiaopeng Hong, WangMeng Zuo

Diffusion models have shown superior performance on unsupervised anomaly detection tasks. Since trained with normal data only, diffusion models tend to reconstruct normal counterparts of test images with certain noises added. However, these methods treat all potential anomalies equally, which may cause two main problems. From the global perspective, the difficulty of reconstructing images with different anomalies is uneven. Therefore, instead of utilizing the same setting for all samples, we propose to predict a particular denoising step for each sample by evaluating the difference between image contents and the priors extracted from diffusion models. From the local perspective, reconstructing abnormal regions differs from normal areas even in the same image. Theoretically, the diffusion model predicts a noise for each step, typically following a standard Gaussian distribution. However, due to the difference between the anomaly and its potential normal counterpart, the predicted noise in abnormal regions will inevitably deviate from the standard Gaussian distribution. To this end, we propose introducing synthetic abnormal samples in training to encourage the diffusion models to break through the limitation of standard Gaussian distribution, and a spatial-adaptive feature fusion scheme is utilized during inference. With the above modifications, we propose a global and local adaptive diffusion model (abbreviated to GLAD) for unsupervised anomaly detection, which introduces appealing flexibility and achieves anomaly-free reconstruction while retaining as much normal information as possible. Extensive experiments are conducted on three commonly used anomaly detection datasets (MVTec-AD, MPDD, and VisA) and a printed circuit board dataset (PCB-Bank) we integrated, showing the effectiveness of the proposed method.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 15 code samples harvested from 1 repository linked to this paper: 13 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 3 honoured, 1 violated, 4 with no contract checked; 5 where Syntology's instrument failed) · 2 unverified. Where Syntology's instrument failed: 4 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 15 samples from 1 repository, 13 ran (8 with no instrument failure; 5 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 3 of the 13 samples that ran have no recorded date.

hyao1/glad officialmentioned in papermentioned on GitHubpytorchMITSyntology: 15 samples, 13 ran (5 instrument-failed) · 2 unverified 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

15 samples harvested: 13 ran (of which 0 constructed an object rather than computing a result; 8 with no instrument failure: 3 honoured, 1 violated, 4 with no contract checked; 5 where Syntology's instrument failed) · 2 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

3ran · honoured contract
1ran · violated contract
4ran · our draft was wrong
1ran; the contract check could not run
4ran
2unverified

Licence: 8 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. For 8 of them, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from hyao1/glad. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

hyao1/glad official repository 15 samples, 13 ran (5 instrument-failed) · 2 unverified
betas_for_alpha_bar in 123 papers ddim_scheduling.py ran · honoured contract MIT (permissive) here; the stored copy is pointer only · f1e3f7493aad4745 · report fixture: signature num_diffusion_timesteps:int/0/int, max_beta:float/0/float, alpha_transform_type:str/0/str · returned Tensor · level recorded 2026-09-22
bool_flag in 47 papers dino/utils.py ran · violated contract MIT (permissive) here; the stored copy is pointer only · c19231378e41dc5a · report fixture: signature s:str/0/str · returned bool · level recorded 2026-09-24
clip_gradients in 31 papers dino/utils.py ran · honoured contract MIT (permissive) · 2b5489053b222e00 · report fixture: signature model:callable/0/?, clip:float/0/float · returned list · level recorded 2026-09-24
cosine_scheduler in 74 papers dino/utils.py ran · honoured contract fingerprinted MIT (permissive) · 361a6b24f11fc50a · report fixture: signature base_value:float/0/float, final_value:float/0/float, epochs:int/0/int, niter_per_ep:int/0/int, warmup_epochs:int/0/int, start_warmup_value:float/0/float · returned ndarray · level recorded, date not recorded
drop_path in 325 papers
census: 27 implementations from 61 papers, 5 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 2 of 2, arg 1: rank 2, kind float, dtype float32
dino/vision_transformer.py ran; the contract check could not run (RAISES) · metamorphic tier: invariant fingerprinted MIT (permissive) here; the stored copy is pointer only · 55120f2026b56aa2 · report fixture: signature x:Tensor/2/float, drop_prob:float/0/float, training:bool/0/bool · returned Tensor · level recorded, date not recorded
encode_prompt in 54 papers main_multi.py ran MIT (permissive) · d846bc783d914e10 · report fixture: signature text_encoder:callable/0/?, text_inputs_ids:Tensor/2/int, device:str/0/str · returned Tensor · level recorded 2026-09-24
generate_fractal_noise_2d in 6 papers dataset/perlin_noise.py ran MIT (permissive) here; the stored copy is pointer only · 293a2b1189b747fd · report fixture: signature shape:tuple/1/int, res:tuple/1/int, octaves:int/0/int, persistence:float/0/float · returned ndarray · level recorded 2026-09-25
generate_perlin_noise_2d in 7 papers dataset/perlin_noise.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · ed9e127befc02046 · report fixture: signature shape:tuple/1/int, res:tuple/1/int · returned ndarray · level recorded 2026-09-25
lerp_np in 9 papers dataset/perlin_noise.py ran MIT (permissive) here; the stored copy is pointer only · 4de91a4627a51ea2 · report fixture: signature x:ndarray/2/float, y:ndarray/2/float, w:ndarray/2/float · returned ndarray · level recorded 2026-09-25
loss_fucntion train_dino.py ran MIT (permissive) · 1606edd39398af6c · report fixture: signature i:list/1/Tensor, r:list/1/Tensor, fi:list/1/Tensor, fr:list/1/Tensor, lmd:float/0/float · returned Tensor · level recorded 2026-09-24
rescale_noise_cfg in 63 papers
census: 2 implementations from 21 papers, 1 distinct output on one shared input this sample: bucket 1 of 1, arg 1: rank 4, kind float, dtype float32 · arg 2: rank 4, kind float, dtype float32
pipeline.py ran · our draft was wrong fingerprinted MIT (permissive) · bea2d776a332f2b0 · report fixture: signature noise_cfg:Tensor/4/float, noise_pred_text:Tensor/4/float, guidance_rescale:float/0/float · returned Tensor · level recorded, date not recorded
rescale_zero_terminal_snr in 14 papers ddim_scheduling.py ran · our draft was wrong fingerprinted MIT (permissive) here; the stored copy is pointer only · 6b47c0cd573d42ff · report fixture: signature betas:Tensor/1/float · returned Tensor · level recorded 2026-09-24
tokenize_prompt in 23 papers dataset/dataset_multiclass.py ran · our draft was wrong MIT (permissive) here; the stored copy is pointer only · a67a2074238bd9ef · report fixture: signature tokenizer:callable/0/?, prompt:str/0/str, tokenizer_max_length:int/0/int · returned dict · level recorded 2026-09-22
compute_text_embeddings in 6 papers main_multi.py unverified MIT (permissive) · 551bb566734184cc · report
parse_args in 355 papers main_multi.py unverified MIT (permissive) · 752b8d77518927c2 · report

Tasks

Anomaly DetectionDenoisingUnsupervised Anomaly Detection

Datasets

Introduced by this paper, per the archive.

PCB-Bank

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Anomaly Detection MPDD GLAD Detection AUROC 97.5 #5 of 16 Archive leaderboard report
Anomaly Detection MPDD GLAD Segmentation AUROC 98.7 #5 of 16 Archive leaderboard report
Anomaly Detection MVTec AD GLAD Detection AUROC 99.3 #39 of 148 Archive leaderboard report
Anomaly Detection MVTec AD GLAD Segmentation AP 70.9 #39 of 148 Archive leaderboard report
Anomaly Detection MVTec AD GLAD Segmentation AUPRO 95.3 #39 of 148 Archive leaderboard report
Anomaly Detection MVTec AD GLAD Segmentation AUROC 98.6 #39 of 148 Archive leaderboard report
Anomaly Detection VisA GLAD Detection AUROC 99.5 #2 of 50 Archive leaderboard report
Anomaly Detection VisA GLAD F1-Score 98.3 #2 of 50 Archive leaderboard report
Anomaly Detection VisA GLAD Segmentation AUPRO 94.3 #2 of 50 Archive leaderboard report
Anomaly Detection VisA GLAD Segmentation AUPRO (until 30% FPR) 94.3 #2 of 50 Archive leaderboard report
Anomaly Detection VisA GLAD Segmentation AUROC 98.6 #2 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

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