SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.11681 · 2023

VadCLIP: Adapting Vision-Language Models for Weakly Supervised Video Anomaly Detection

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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 0 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2308.11681.json · badge: /api/ran/2308.11681.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
nwpu-zxr/vadclip canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
FunctionStatusWhere it lives
CLAS2 Ran
ran; our contract draft was wrong, not the code
nwpu-zxr/vadclip/src/ucf_train.py
code served (permissive licence) · get_code("722deffccfe046dc")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Set device to CPU
device = 'cpu'

# Create batch_size=2, sequence_length=4, logits dimension=1
batch_size = 2
max_sequence_length = 4
logits_dim = 1

# logits: shape (batch_size, max_sequence_length, logits_dim) - gets reshaped to (batch_size, max_sequence_length)
logits = torch.randn(batch_size, max_sequence_length, logits_dim)

# labels: shape (batch_size, 1) - only first column [0] is used
labels = torch.randint(0, 2, (batch_size, 1)).float()

# lengths: list/tensor of actual sequence lengths for each sample in batch
# values should be <= max_sequence_length
lengths = torch.tensor([3, 2])

ARGS = {
    'logits': logits,
    'labels': labels,
    'lengths': lengths,
    'device': device
}
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 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
CLAS2 Ran
ran; our contract draft was wrong, not the code
nwpu-zxr/vadclip/src/xd_train.py
code served (permissive licence) · get_code("39a9a85ba0b976d9")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

device = 'cpu'

# Batch size: 2
# Number of sequences/timesteps: 3 (different from batch to avoid ambiguity)
# Logits dimension: 4
batch_size = 2
seq_len = 3
logits_dim = 4

# logits: shape (batch_size, seq_len) after reshape
# The function does: logits.reshape(logits.shape[0], logits.shape[1])
# and accesses logits[i, 0:lengths[i]]
# So logits should be 2D with shape (batch_size, seq_len)
logits = torch.randn(batch_size, seq_len)

# labels: shape (batch_size, 1) initially
# The function does: labels = 1 - labels[:, 0].reshape(labels.shape[0])
# This extracts first column and reshapes to (batch_size,)
labels = torch.randint(0, 2, (batch_size, 1)).float()

# lengths: list or tensor of length values for each sample in batch
# Used in: torch.topk(logits[i, 0:lengths[i]], k=int(lengths[i] / 16 + 1))
# Should be integers, one per batch element
# Max value should be <= seq_len (3)
lengths = torch.tensor([2, 3])

ARGS = {
    'logits': logits,
    'labels': labels,
    'lengths': lengths,
    'device': device
}
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 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
image_crop Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
nwpu-zxr/vadclip/src/crop.py
code served (permissive licence) · get_code("8126e661e2da6d6e")
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 int, shape (224, 224, 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 cv2
import numpy as np

# Create a small test image: 400x300 BGR image
# Using random values to simulate a real image
np.random.seed(0)
image = np.random.randint(0, 256, (300, 400, 3), dtype=np.uint8)

# Test with type 0 (one of the valid crop types)
crop_type = 0

ARGS = {
    "image": image,
    "type": crop_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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 int, shape (224, 224, 3) — shape (224, 224, 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
video_crop Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
nwpu-zxr/vadclip/src/crop.py
code served (permissive licence) · get_code("2b5eff3ede9ce667")
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 4, dtype family int, shape (2, 224, 224, 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 numpy as np

# Create a small video frame array with shape (num_frames, height, width, channels)
# The function expects frames in BGR format (OpenCV standard)
# After resize to (340, 256), we need at least that size
num_frames = 2
height = 340
width = 256
channels = 3

# Create dummy video frames (BGR format)
video_frame = np.random.randint(0, 255, size=(num_frames, height, width, channels), dtype=np.uint8)

# Test with type 0 (center crop with flip option 0)
crop_type = 0

ARGS = {
    "video_frame": video_frame,
    "type": crop_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 4, dtype family int, shape (2, 224, 224, 3) — shape (2, 224, 224, 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
CLASM Not yet run
unverified (harvested, no recorded run)
nwpu-zxr/vadclip/src/ucf_train.py
code served (permissive licence) · get_code("be63c876347199d0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 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
CLAS2 1 other paper
1 later
aaai_28423 (2024 (year only))
VadCLIP: Adapting Vision-Language Models for Weakly Supervised Video Anomaly Detection
CLAS2 1 other paper
1 later
aaai_28423 (2024 (year only))
VadCLIP: Adapting Vision-Language Models for Weakly Supervised Video Anomaly Detection
CLASM 1 other paper
1 later
aaai_28423 (2024 (year only))
VadCLIP: Adapting Vision-Language Models for Weakly Supervised Video Anomaly Detection
image_crop 1 other paper
1 later
aaai_28423 (2024 (year only))
VadCLIP: Adapting Vision-Language Models for Weakly Supervised Video Anomaly Detection
video_crop 1 other paper
1 later
aaai_28423 (2024 (year only))
VadCLIP: Adapting Vision-Language Models for Weakly Supervised 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-24.

Repositories linked to this paper

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

Abstract

The recent contrastive language-image pre-training (CLIP) model has shown great success in a wide range of image-level tasks, revealing remarkable ability for learning powerful visual representations with rich semantics. An open and worthwhile problem is efficiently adapting such a strong model to the video domain and designing a robust video anomaly detector. In this work, we propose VadCLIP, a new paradigm for weakly supervised video anomaly detection (WSVAD) by leveraging the frozen CLIP model directly without any pre-training and fine-tuning process. Unlike current works that directly feed extracted features into the weakly supervised classifier for frame-level binary classification, VadCLIP makes full use of fine-grained associations between vision and language on the strength of CLIP and involves dual branch. One branch simply utilizes visual features for coarse-grained binary classification, while the other fully leverages the fine-grained language-image alignment. With the benefit of dual branch, VadCLIP achieves both coarse-grained and fine-grained video anomaly detection by transferring pre-trained knowledge from CLIP to WSVAD task. We conduct extensive experiments on two commonly-used benchmarks, demonstrating that VadCLIP achieves the best performance on both coarse-grained and fine-grained WSVAD, surpassing the state-of-the-art methods by a large margin. Specifically, VadCLIP achieves 84.51% AP and 88.02% AUC on XD-Violence and UCF-Crime, respectively. Code and features are released at https://github.com/nwpu-zxr/VadCLIP.

For agents

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

get_harvested_code_for_paper("2308.11681")
get_code_for_paper("2308.11681")
have("2308.11681")

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

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

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

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

Connect an agent — have() is free.