SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_25604 · AAAI · 2023

One-for-All: Proposal Masked Cross-Class Anomaly Detection

Jun Sun, Xincheng Yao, Chongyang Zhang, Zhenyu Liu, Ruoqi Li

Open in the Atlas

Code that ran

8 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 4 violated it and 1 has no contract verdict; 3 failures of our instrument; 4 no recorded run), measured 2026-11-22; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/aaai_25604.json · badge: /api/ran/aaai_25604.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
xcyao00/PMAD canonical (classifier label)
classifier basis: census
8 ran · 4 no recorded run
FunctionStatusWhere it lives
default Ran
ran, violated the contract we drafted
xcyao00/PMAD/dall_e/tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("60fff7c3c400d7ff")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ThomasMrY/VCT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

exists Ran
ran, violated the contract we drafted
xcyao00/PMAD/dall_e/tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("aa5486a3650902d8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ThomasMrY/VCT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_logp Ran
ran on a synthesized input
xcyao00/PMAD/protoflow/modules.py
code served (permissive licence) · get_code("4b0c9ef7ed78e68a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# C: scalar or tensor controlling the constant term
C = 2.0

# z: tensor of shape (batch_size, feature_dim)
# The function sums over dimension 1, so we need at least 2D
z = torch.randn(2, 4)

# logdet_J: tensor of shape (batch_size,) or scalar
# It's added to the result which has shape (batch_size,)
logdet_J = torch.randn(2)

ARGS = {
    "C": C,
    "z": z,
    "logdet_J": logdet_J,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
has_file_allowed_extension Ran
ran, violated the contract we drafted
xcyao00/PMAD/datasets/mvtec_train.py
pointer only (licence: MIT); the stored copy get_code serves, from dlyuangod/vit-1.58b, is pointer only (licence: NONE) · get_code("18ae3e6ef2cf02ec")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dlyuangod/vit-1.58b, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

is_image_file Ran
ran, violated the contract we drafted
xcyao00/PMAD/datasets/mvtec_train.py
pointer only (licence: MIT); the stored copy get_code serves, from dlyuangod/vit-1.58b, is pointer only (licence: NONE) · get_code("8ac50ae8773b9431")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dlyuangod/vit-1.58b, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

make_dataset Ran
ran; our contract draft was wrong, not the code
xcyao00/PMAD/datasets/mvtec_train.py
code served (permissive licence) · get_code("fb6aea1653b20bba")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import os.path
import tempfile
from typing import Tuple, Dict, Optional, Callable, List

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create class subdirectories and some dummy files
class_names = ["cat", "dog"]
for class_name in class_names:
    class_dir = os.path.join(temp_dir, class_name)
    os.makedirs(class_dir, exist_ok=True)
    # Create some dummy files with various extensions
    for i in range(2):
        with open(os.path.join(class_dir, f"image_{i}.jpg"), "w") as f:
            f.write("dummy")
        with open(os.path.join(class_dir, f"image_{i}.png"), "w") as f:
            f.write("dummy")
        with open(os.path.join(class_dir, f"other_{i}.txt"), "w") as f:
            f.write("dummy")

# Define the arguments
directory = temp_dir
class_to_idx = {"cat": 0, "dog": 1}
extensions = (".jpg", ".png")
is_valid_file = None

ARGS = {
    "directory": directory,
    "class_to_idx": class_to_idx,
    "extensions": extensions,
    "is_valid_file": is_valid_file,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
subnet_fc Ran
ran; our contract draft was wrong, not the code
xcyao00/PMAD/protoflow/modules.py
code served (permissive licence) · get_code("f990a171958b014d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function subnet_fc takes dims_in and dims_out as parameters
# dims_in: input dimension (int)
# dims_out: output dimension (int)

ARGS = {
    "dims_in": 4,
    "dims_out": 3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
top_k Ran
ran; our contract draft was wrong, not the code
xcyao00/PMAD/dall_e/tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from junxia97/mole-bert, is pointer only (licence: NONE) · get_code("fc2efb619b6ee2c4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from junxia97/mole-bert, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_model Not yet run
unverified (harvested, no recorded run)
xcyao00/PMAD/train_cross_class.py
code served (permissive licence) · get_code("66edbf4fb608ec02")
How it ran

no invocation recorded.

get_visual_tokenizer Not yet run
unverified (harvested, no recorded run)
xcyao00/PMAD/train_cross_class.py
code served (permissive licence) · get_code("c09a2e93029ceb26")
How it ran

no invocation recorded.

map_pixels Not yet run
unverified (harvested, no recorded run)
xcyao00/PMAD/dall_e/utils.py
code served (permissive licence) · get_code("c7b629c37bc56d66")
How it ran

no invocation recorded.

unmap_pixels Not yet run
unverified (harvested, no recorded run)
xcyao00/PMAD/dall_e/utils.py
code served (permissive licence) · get_code("2cb212f10e0a74e6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 8 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 7 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
exists 486 other papers
138 dated earlier, 202 later, 144 same year, order not determinable, 2 undated · 78 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.04637 (2018-04)
EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models
and 483 more not named here
default 163 other papers
68 dated earlier, 51 later, 43 same year, order not determinable, 1 undated · 27 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1810.00825 (2018-10)
Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks
1907.01470 (2019-07)
Augmenting Self-attention with Persistent Memory
and 160 more not named here
is_image_file 12 other papers
4 dated earlier, 6 later, 2 same year, order not determinable
2203.14415 (2022-03)
Mugs: A Multi-Granular Self-Supervised Learning Framework
2204.08381 (2022-04)
Multiple-environment Self-adaptive Network for Aerial-view Geo-localization
2205.03892 (2022-05)
ConvMAE: Masked Convolution Meets Masked Autoencoders
and 9 more not named here
has_file_allowed_extension 10 other papers
4 dated earlier, 4 later, 2 same year, order not determinable
2203.14415 (2022-03)
Mugs: A Multi-Granular Self-Supervised Learning Framework
2204.08381 (2022-04)
Multiple-environment Self-adaptive Network for Aerial-view Geo-localization
2205.03892 (2022-05)
ConvMAE: Masked Convolution Meets Masked Autoencoders
and 7 more not named here
make_dataset 6 other papers
2 dated earlier, 2 later, 2 same year, order not determinable
2205.03892 (2022-05)
ConvMAE: Masked Convolution Meets Masked Autoencoders
2208.07049 (2022-08)
Self-Supervised Vision Transformers for Malware Detection
2305.00348 (2023-05)
Modality-invariant Visual Odometry for Embodied Vision
and 3 more not named here
subnet_fc 4 other papers
1 dated earlier, 3 later
2107.12571 (2021-07)
CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows
2403.13349 (2024-03)
Hierarchical Gaussian Mixture Normalizing Flow Modeling for Unified Anomaly Detection
2410.20047 (2024-10)
ResAD: A Simple Framework for Class Generalizable Anomaly Detection
and 1 more not named here
top_k 2 other papers
2 dated earlier
2210.16484 (2022-10)
A Systematic Survey of Chemical Pre-trained Models
2212.10368 (2022-12)
Masked Event Modeling: Self-Supervised Pretraining for Event Cameras
map_pixels 1 other paper
1 later
2405.15734 (2024-05)
LM4LV: A Frozen Large Language Model for Low-level Vision Tasks

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

One of the most challenges for anomaly detection (AD) is how to learn one unified and generalizable model to adapt to multi-class especially cross-class settings: the model is trained with normal samples from seen classes with the objective to detect anomalies from both seen and unseen classes. In this work, we propose a novel Proposal Masked Anomaly Detection (PMAD) approach for such challenging multi-and cross-class anomaly detection. The proposed PMAD can be adapted to seen and unseen classes by two key designs: MAEbased patch-level reconstruction and prototype-guided proposal masking. First, motivated by MAE (Masked AutoEncoder), we develop a patch-level reconstruction model rather than the image-level reconstruction adopted in most AD methods for this reason: the masked patches in unseen classes can be reconstructed well by using the visible patches and the adaptive reconstruction capability of MAE. Moreover, we improve MAE by ViT encoder-decoder architecture, combinational masking, and visual tokens as reconstruction objectives to make it more suitable for anomaly detection. Second, we develop a two-stage anomaly detection manner during inference. In the proposal masking stage, the prototype-guided proposal masking module is utilized to generate proposals for suspicious anomalies as much as possible, then masked patches can be generated from the proposal regions. By masking most likely anomalous patches, the "shortcut reconstruction" issue (i.e., anomalous regions can be well reconstructed) can be mostly avoided. In the reconstruction stage, these masked patches are then reconstructed by the trained patchlevel reconstruction model to determine if they are anomalies. Extensive experiments show that the proposed PMAD can outperform current state-of-the-art models significantly under the multi-and especially cross-class settings. Code will be publicly available at https://github.com/xcyao00/PMAD.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("aaai_25604")
get_code_for_paper("aaai_25604")
have("aaai_25604")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/aaai_25604.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/aaai_25604.svg)](https://syntology.ai/paper/aaai_25604)

Connect an agent — have() is free.