Video Scope Classifier

Decides how much of a video a VLM needs in order to answer a user's question, so that a query router fetches only that much: FRAME (a few stills), CLIP (one contiguous section) or WHOLE (the full video).

  • numpy only at runtime: no torch, no scikit-learn, and no pickle. The weights are JSON + .npz, loaded with allow_pickle=False.
  • 7.6 MB, about 0.4 ms per query on one CPU core, about 2,300 queries/s/core.
  • Returns probabilities, a cost-aware decision that prefers the wider scope when unsure, and the evidence modality (VISUAL / OCR / SPEECH).
Scope Sent to the VLM Example
FRAME 4 stills: top-k by text-image similarity What colour is the news presenter's coat?
CLIP 16 frames from the best-matching window What does the monkey do after it gets rescued?
WHOLE 32 frames across the whole video What is the video mainly about?

Quick start

import sys
from huggingface_hub import snapshot_download

path = snapshot_download("alok098/video-scope-classifier")
sys.path.insert(0, f"{path}/src")
from intent.runtime import ScopeRuntime

clf = ScopeRuntime.load(f"{path}/models/scope_classifier")
clf.add_video("v1", srt_text, duration_s=612.0)   # optional, at ingestion: indexes the subtitles
print(clf.predict("what does the monkey do after it gets rescued", "v1"))
# {'scope': 'CLIP', 'n_frames': 16, 'retrieval': 'frames from the best-matching contiguous window ...',
#  'probabilities': {'FRAME': 0.15, 'CLIP': 0.79, 'WHOLE': 0.06}, 'confidence': 0.79,
#  'modality': 'VISUAL', 'modality_plan': 'frames only', 'latency_ms': 0.4, ...}

You can also run python example.py after downloading. video_id is optional. Without it, the subtitle features are simply off.

How it works

Feature group What Cost
A lexical TF-IDF of word 1–2-grams and character 3–5-grams (tolerates typos) ~75 µs
B rubric cues 19 cue flags (global, exhaustive, order, count, anchor, action, cause, attribute, OCR, speech, …), the first wh-word, and the decision of a hand-written rule list as a prior ~90 µs
D semantics 256-d potion-base-8M static embedding, re-implemented in numpy with an int8 table (cosine ≥ 0.9999 to float32) ~30–95 µs
E retrieval shape BM25 over the video's own subtitles in 30 s chunks; uses the shape of the hits (peak, entropy, time spread, coverage), not the scores ~55 µs

A multinomial logistic regression on these features gives the probabilities. The scope is then the choice with the lowest expected cost, frames/32 + λ·[scope narrower than needed], with λ = 2: losing the answer costs at least a re-ask with WHOLE.

Results

The evaluation covers 270 Video-MME questions from 90 videos, with 5 × 5-fold cross-validation grouped by video and 95% video-cluster bootstrap CIs.

Model macro-F1 [95% CI] p50 latency Size
task_type lookup (uses benchmark metadata) 0.617 [0.559, 0.667] – –
Hand-written rules only 0.695 [0.642, 0.743] 0.08 ms ~0
This model 0.708 [0.657, 0.753] 0.42 ms 7.6 MB
MiniLM-L6 (frozen, ONNX int8) replacing D 0.703 [0.653, 0.746] 6.8 ms 24.5 MB
MiniLM-L6 int8 added to D 0.710 [0.661, 0.756] 6.9 ms 31.5 MB
  • vs a transformer. Within 0.002 macro-F1 of the best MiniLM variant, at 1/16 of its latency.
  • Selection-adjusted. Nested CV gives 0.698.
  • Label ambiguity is the ceiling. macro-F1 is 0.817 on the 160 unambiguous labels and 0.528 on the 110 ambiguous ones.
  • Routing (λ = 2). Under-routing is 6.2%, and a WHOLE question is sent as FRAME only 0.7% of the time. The router closes 92% of the routing gap at 68% of always-WHOLE compute; an oracle needs 58.5%.
  • User-style queries. Trained with rewrites (keywords, casual, typos), it scores 0.67–0.68 on them, against 0.62–0.66 without.

accuracy vs latency routing quality vs compute confusion

Labels

Video-MME has no scope labels. The 270 intent labels in labels/intent_labels.csv were written by an LLM judge against a 12-rule rubric (labels/labeling_rubric.md). Each label has a confidence, the rule that decided it, and a one-line rationale. The file holds question IDs only. The questions themselves are in aintropy-ai/video-mme-sample10.

An earlier attempt to measure labels with a 4-bit Qwen2-VL-7B teacher produced unusable labels (accuracy flat from 4 to 32 frames), which is why intent labels were used instead.

Limitations

  • Labels. They were produced with an LLM-as-judge protocol: a written 12-rule rubric, one rule and one rationale per label, and confidence flags. This is the same approach as published work on this benchmark. A blind 60-question human audit is in progress. The cue lexicon and rules were designed on the same 270 questions they are evaluated on, so their scores may be optimistic; the nested-CV estimate (0.698) corrects for model selection but not for this.
  • Small sample. With 270 questions from 90 videos, differences below about 0.04 macro-F1 cannot be resolved.
  • Language and query style. English only. Real user queries were approximated by deterministic rewrites of benchmark questions.
  • Tail latency. It grows with question length: p99 is about 0.9 ms on user-style queries, and about 1.8 ms on the rare questions over 40 words.

Files

src/intent/          runtime (numpy): runtime.py, text.py, embed.py, retrieval.py, subtitles.py, paths.py
models/              scope_classifier.json + .npz (0.64 MB), potion-base-8M-int8.npz (7.0 MB)
labels/              intent_labels.csv, labeling_rubric.md
results/             ladder, ablation, robustness, λ sweep, transformer comparison, figures
example.py           runnable demo

License

MIT for the code, weights and labels. The int8 embedding table is derived from minishlab/potion-base-8M (MIT). Video-MME (Fu et al., CVPR 2025) videos and questions are not included; see the dataset's terms.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for alok098/video-scope-classifier

Finetuned
(12)
this model

Dataset used to train alok098/video-scope-classifier

Evaluation results

  • macro-F1 (5x5-fold CV grouped by video) on Video-MME 10% sample, intent labels
    test set self-reported
    0.708
  • accuracy (5x5-fold CV grouped by video) on Video-MME 10% sample, intent labels
    test set self-reported
    0.715