SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 136640328 · ECCV · 2022

Scale-aware Spatio-temporal Relation Learning for Video Anomaly Detection

Rui Zhao, Xingyu Zeng, Guoqiu Li, Guanxiong Cai

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; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 1 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/136640328.json · badge: /api/ran/136640328.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
nutuniv/SSRL canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
all_gather Ran
ran; our contract draft was wrong, not the code
nutuniv/SSRL/misc.py
pointer only (licence: MIT); the stored copy get_code serves, from kellyiss/situformer, is pointer only (licence: NONE) · get_code("aa6da43d05cfaf65")
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 kellyiss/situformer, 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.

collate_fn Ran
ran; our contract draft was wrong, not the code
nutuniv/SSRL/misc.py
code served (permissive licence) · get_code("4e666c3bca9c9716")
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 tuple. 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
from typing import List

torch.manual_seed(0)

# Create a batch of tensors with different sizes to test padding behavior
# Each tensor has shape (C, H, W) where C=channels, H=height, W=width
tensor1 = torch.randn(3, 4, 5)  # 3 channels, 4 height, 5 width
tensor2 = torch.randn(3, 6, 7)  # 3 channels, 6 height, 7 width (different sizes)

# Create batch items - collate_fn expects a list of tuples
# Based on the code, it zips the batch, so we need tuples where first element is image tensor
batch_item1 = (tensor1, "label1")
batch_item2 = (tensor2, "label2")

batch = [batch_item1, batch_item2]

ARGS = {
    "batch": batch
}
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 tuple — a tuple output has no array shape of its own; none is 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_logger Ran
ran on a synthesized input
nutuniv/SSRL/utils.py
code served (permissive licence) · get_code("014d87639fcaa13f")
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 Logger. 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 logging
import tempfile
import os

# Create a temporary file for logging
temp_dir = tempfile.gettempdir()
log_filename = os.path.join(temp_dir, "test_logger.log")

ARGS = {
    "filename": log_filename,
    "verbosity": 1,
    "name": "test_logger"
}
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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
minmax_norm Ran
ran on a synthesized input
nutuniv/SSRL/utils.py
code served (permissive licence) · get_code("7f5912ffa33612d9")
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 2, dtype family float, shape (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 torch

torch.manual_seed(0)

# Create a small activation map tensor
# Shape: (batch=2, channels=4) - typical activation map dimensions
act_map = torch.randn(2, 4)

# Define ARGS dict with all parameters
ARGS = {
    "act_map": act_map,
    "min_val": None,
    "max_val": None,
}
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 2, dtype family float, shape (2, 4) — shape (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
reduce_dict Ran
ran; our contract draft was wrong, not the code
nutuniv/SSRL/misc.py
pointer only (licence: MIT); the stored copy get_code serves, from kellyiss/situformer, is pointer only (licence: NONE) · get_code("05992505df9ef0cd")
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 kellyiss/situformer, 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.

process_feat Not yet run
unverified (harvested, no recorded run)
nutuniv/SSRL/utils.py
code served (permissive licence) · get_code("14ff324a8acdd140")
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, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 3 later) and 0 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
reduce_dict 33 other papers
8 dated earlier, 20 later, 5 same year, order not determinable
1811.07628 (2018-11)
ATOM: Accurate Tracking by Overlap Maximization
1811.10200 (2018-11)
IDD: A Dataset for Exploring Problems of Autonomous Navigation in Unconstrained Environments
2007.02419 (2020-07)
Attention-based Joint Detection of Object and Semantic Part
and 30 more not named here
all_gather 30 other papers
8 dated earlier, 19 later, 3 same year, order not determinable
1811.07628 (2018-11)
ATOM: Accurate Tracking by Overlap Maximization
1811.10200 (2018-11)
IDD: A Dataset for Exploring Problems of Autonomous Navigation in Unconstrained Environments
2007.02419 (2020-07)
Attention-based Joint Detection of Object and Semantic Part
and 27 more not named here
collate_fn 16 other papers
4 dated earlier, 10 later, 2 same year, order not determinable
1811.07628 (2018-11)
ATOM: Accurate Tracking by Overlap Maximization
2104.00969 (2021-04)
TubeR: Tubelet Transformer for Video Action Detection
2104.08541 (2021-04)
TransVG: End-to-End Visual Grounding with Transformers
and 13 more not named here
get_logger 1 other paper
1 dated earlier
1903.05285 (2019-03)
All You Need is a Few Shifts: Designing Efficient Convolutional Neural Networks for Image Classification
minmax_norm 1 other paper
1 same year, order not determinable
136730727 (2022 (year only))
Self-Supervised Sparse Representation for Video Anomaly Detection
process_feat 1 other paper
1 same year, order not determinable
136730727 (2022 (year only))
Self-Supervised Sparse Representation for Video Anomaly Detection

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

Recent progress in video anomaly detection (VAD) has shown that feature discrimination is the key to effectively distinguishing anomalies from normal events. We observe that many anomalous events occur in limited local regions, and the severe background noise increases the difficulty of feature learning. In this paper, we propose a scaleaware weakly supervised learning approach to capture local and salient anomalous patterns from the background, using only coarse video-level labels as supervision. We achieve this by segmenting frames into nonoverlapping patches and then capturing inconsistencies among different regions through our patch spatial relation (PSR) module, which consists of self-attention mechanisms and dilated convolutions. To address the scale variation of anomalies and enhance the robustness of our method, a multi-scale patch aggregation method is further introduced to enable local-to-global spatial perception by merging features of patches with different scales. Considering the importance of temporal cues, we extend the relation modeling from the spatial domain to the spatio-temporal domain with the help of the existing video temporal relation network to effectively encode the spatio-temporal dynamics in the video. Experimental results show that our proposed method achieves new state-of-the-art performance on UCF-Crime and ShanghaiTech benchmarks. Code are available at https://github.com/nutuniv/SSRL.

For agents

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

get_harvested_code_for_paper("136640328")
get_code_for_paper("136640328")
have("136640328")

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

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

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

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

Connect an agent — have() is free.