SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.26842 · 2026

VAN-AD: Visual Masked Autoencoder with Normalizing Flow for Time Series Anomaly Detection

Yan Sun, Shang Wang, Yuan Chang, Xiaohou Shi, Pengyu Chen, Sajal Das

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 2 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2603.26842.json · badge: /api/ran/2603.26842.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
PenyChen/VAN-AD canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
get_dataloader Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PenyChen/VAN-AD/data_factory/data_loader.py
code served (permissive licence) · get_code("3eec29737cf6a0b5")
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 DataLoader. 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 numpy as np
from torch.utils.data import Dataset

torch.manual_seed(0)

# Create a minimal config class with required attributes
class Config:
    def __init__(self):
        self.data = 'msl'
        self.batch_size = 2
        self.num_workers = 0
    
    def __getitem__(self, key):
        return getattr(self, key)

# Create a minimal dataset class that satisfies the DataLoader requirements
class MinimalDataset(Dataset):
    def __init__(self, config, mode, seq_len=None, pre_len=None, step=None, data_ratio=1.0):
        self.config = config
        self.mode = mode
        self.seq_len = seq_len or 10
        self.pre_len = pre_len or 5
        self.step = step or 1
        self.data_ratio = data_ratio
        self.length = 8
    
    def __len__(self):
        return self.length
    
    def __getitem__(self, idx):
        x = torch.randn(self.seq_len, 4)
        y = torch.randn(self.pre_len, 4)
        return x, y

# Monkey-patch the dataset imports to return our minimal dataset
import sys
from unittest.mock import MagicMock

mock_module_msl = MagicMock()
mock_module_msl.MSLDatasetNF = MinimalDataset

mock_module_cicids = MagicMock()
mock_module_cicids.CICIDSDatasetNF = MinimalDataset

mock_module_psm = MagicMock()
mock_module_psm.PSMDatasetNF = MinimalDataset

mock_module_smd = MagicMock()
mock_module_smd.SMDDatasetNF = MinimalDataset

mock_module_gecco = MagicMock()
mock_module_gecco.GECCODatasetNF = MinimalDataset

mock_module_tab = MagicMock()
mock_module_tab.TABDatasetNF = MinimalDataset

sys.modules['data_factory'] = MagicMock()
sys.modules['data_factory.msl_dataset'] = mock_module_msl
sys.modules['data_factory.cicids_dataset'] = mock_module_cicids
sys.modules['data_factory.psm_dataset'] = mock_module_psm
sys.modules['data_factory.smd_dataset'] = mock_module_smd
sys.modules['data_factory.gecco_dataset'] = mock_module_gecco
sys.modules['data_factory.TAB_dataset'] = mock_module_tab

config = Config()

ARGS = {
    'config': config,
    'mode': 'train',
    'seq_len': 10,
    'pre_len': 5,
    'step': 1,
    'shuffle': True,
    'drop_last': False,
    'data_ratio': 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
data_factory, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader output the recorded ndim 0 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
get_train_dataloader Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PenyChen/VAN-AD/data_factory/data_loader.py
code served (permissive licence) · get_code("6ca93a0e8d25fecb")
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 DataLoader. 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
from torch.utils.data import Dataset
from types import SimpleNamespace

torch.manual_seed(0)

# Create a minimal mock dataset class
class MockDatasetNF(Dataset):
    def __init__(self, config, mode, seq_len, pre_len, step, data_ratio):
        self.config = config
        self.mode = mode
        self.seq_len = seq_len
        self.pre_len = pre_len
        self.step = step
        self.data_ratio = data_ratio
        self.length = 10
    
    def __len__(self):
        return self.length
    
    def __getitem__(self, idx):
        x = torch.randn(4)
        y = torch.randn(3)
        return x, y

# Monkey-patch the dataset imports to return our mock
import sys
from unittest.mock import MagicMock

mock_module = MagicMock()
mock_module.MSLDatasetNF = MockDatasetNF
mock_module.CICIDSDatasetNF = MockDatasetNF
mock_module.PSMDatasetNF = MockDatasetNF
mock_module.SMDDatasetNF = MockDatasetNF
mock_module.GECCODatasetNF = MockDatasetNF
mock_module.TABDatasetNF = MockDatasetNF

sys.modules['data_factory.msl_dataset'] = mock_module
sys.modules['data_factory.cicids_dataset'] = mock_module
sys.modules['data_factory.psm_dataset'] = mock_module
sys.modules['data_factory.smd_dataset'] = mock_module
sys.modules['data_factory.gecco_dataset'] = mock_module
sys.modules['data_factory.TAB_dataset'] = mock_module

# Create a minimal config object
config = SimpleNamespace(
    data='msl',
    batch_size=2,
    num_workers=0,
    seq_len=5,
    data_ratio=1.0
)

ARGS = {
    'config': config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
data_factory, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader output the recorded ndim 0 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
is_st Ran
ran, violated the contract we drafted
PenyChen/VAN-AD/data_factory/utils.py
code served (permissive licence) · get_code("e007c6e1d443ec54")
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 bool, ndim 0, dtype family float, shape () 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 pandas as pd

# Create a valid spatial-temporal format DataFrame
# The function checks for:
# 1. shape[1] == 4 (exactly 4 columns)
# 2. 'id' in data.columns

data = pd.DataFrame({
    'id': [1, 2, 3],
    'timestamp': ['2021-01-01', '2021-01-02', '2021-01-03'],
    'location': ['A', 'B', 'C'],
    'value': [10.5, 20.3, 15.7]
})

ARGS = {
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () 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
process_data_np Ran
ran, honoured the contract we drafted
PenyChen/VAN-AD/data_factory/utils.py
code served (permissive licence) · get_code("f7e29dedfd7c9299")
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 ndarray, ndim 3, dtype family float, shape (5, 2, 3) 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 pandas as pd
import numpy as np

# Create a small sample DataFrame with spatial-temporal data
# Structure: date, id (sensor), cols (feature), data (value)
dates = pd.date_range('2023-01-01', periods=5, freq='D')
sensor_ids = [1, 2, 3]
features = ['temperature', 'humidity']

data_list = []
for date in dates:
    for sensor_id in sensor_ids:
        for feature in features:
            data_list.append({
                'date': date,
                'id': sensor_id,
                'cols': feature,
                'data': np.random.rand() * 100
            })

df = pd.DataFrame(data_list)

ARGS = {
    'df': df,
    'nrows': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (5, 2, 3) — shape (5, 2, 3) 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
read_data Ran
ran, honoured the contract we drafted
PenyChen/VAN-AD/data_factory/utils.py
code served (permissive licence) · get_code("3545a60c5b984582")
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 ndarray, ndim 3, dtype family float, shape (3, 2, 4) 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 pandas as pd
import numpy as np
import tempfile
import os

# Create a temporary CSV file with spatial-temporal format data
# The function is_st checks if shape[1] == 4 and 'id' in columns
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, "test_data.csv")

# Create spatial-temporal format data: date, id, cols, data
dates = ['2023-01-01', '2023-01-02', '2023-01-03'] * 4
sensor_ids = [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4]
features = ['temp', 'temp', 'temp', 'temp', 'temp', 'temp', 'humidity', 'humidity', 'humidity', 'humidity', 'humidity', 'humidity']
values = [20.5, 21.0, 20.8, 19.5, 20.0, 19.8, 65.0, 66.0, 65.5, 70.0, 71.0, 70.5]

df_to_save = pd.DataFrame({
    'date': dates,
    'id': sensor_ids,
    'cols': features,
    'data': values
})

df_to_save.to_csv(csv_path, index=False)

# Define ARGS for read_data function
ARGS = {
    'path': csv_path,
    'nrows': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (3, 2, 4) — shape (3, 2, 4) 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
get_test_dataloader Not yet run
unverified (harvested, no recorded run)
PenyChen/VAN-AD/data_factory/data_loader.py
code served (permissive licence) · get_code("39060335d43c5001")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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.

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-23.

Repositories linked to this paper

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

Abstract

Time series anomaly detection (TSAD) is essential for reliable and secure IoT-enabled service systems. However, dataset-specific training limits the generalization of existing methods, especially when target-domain training data are scarce. Although foundation models offer a promising direction, current attempts based on large language models or large-scale timeseries pre-training still suffer from cross-modal gaps or indomain heterogeneity. In this paper, we investigate the applicability of large-scale vision models to TSAD. Specifically, we adapt a visual Masked Autoencoder (MAE) pre-trained on ImageNet to the TSAD task. However, directly transferring MAE to TSAD introduces two key challenges: over-generalization and limited local perception. To address these challenges, we propose VAN-AD, a framework that adapts an ImageNet-pre-trained visual MAE to TSAD, which combines adaptive reconstruction postprocessing and flow-based density estimation. To alleviate the over-generalization issue, we design an Adaptive Distribution Modulation Module (ADMM) as a training-free post-processing operation, which recalibrates the MAE reconstruction using the local statistics of the input window to amplify discrepancies caused by abnormal patterns. To overcome the limitation of local perception, we further develop a Normalizing Flow Module (NFM), which combines MAE with normalizing flow to estimate the probability density of the current window under the global distribution. Extensive experiments on nine realworld datasets demonstrate that VAN-AD consistently outperforms existing state-of-the-art methods across multiple evaluation metrics. We make our code and datasets available at https://github.com/PenyChen/VAN-AD.

For agents

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

get_harvested_code_for_paper("2603.26842")
get_code_for_paper("2603.26842")
have("2603.26842")

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

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

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

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

Connect an agent — have() is free.