PrAViC: Probabilistic Adaptation Framework for Real-Time Video Classification

Magdalena Trędowicz, Marcin Mazur, Szymon Janusz, Arkadiusz Lewicki, Jacek Tabor, Łukasz Struski · Submission to ICLR 2025 · Rejected

TL;DR

PrAViC is a unified probabilistic framework that transforms standard offline 3D CNNs into fast, causal online models capable of making early classification decisions. By penalizing late detections through an expected-exit-time loss term, PrAViC significantly shortens decision latency while matching or even exceeding the accuracy of state-of-the-art online baselines.

What Problem Does This Paper Address?

In video classification, models generally fall into two camps: offline models, which process the entire clip at once to maximize accuracy, and online models, which process incoming frames sequentially to detect critical events (e.g., medical anomalies, traffic accidents, equipment failure) as early as possible.

Offline 3D CNNs perform well because they capture rich spatiotemporal context, but they cannot run in real time. Conversely, existing online video models often rely on heuristic early-exit thresholds, ad-hoc 2D temporal-shift tricks, or entirely separate architectures that compromise accuracy. The authors address the lack of a theoretically grounded, unified framework that can adapt pre-trained offline 3D CNNs into streaming, early-exiting online classifiers.

Methods

PrAViC combines a probabilistic formulation of early decision-making with causal architectural modifications:

  • Probabilistic Early-Exit Modeling: The authors model the decision threshold as a random variable $\tau \sim \text{Uniform}[0, 1]$. This formulation enables computing the expected exit time $\mathbb{E}(W)$ and its normalized counterpart, $\text{NE}(V) \in [0, 1]$.
  • Early-Detection Loss: To encourage prompt decisions without provoking false alarms, the training objective augments standard binary cross-entropy with a latency penalty: $$\text{loss}_\lambda(V, y) = \text{BCE\_loss}(V, y) + y \log(\lambda + (1 - \lambda)\text{NE}(V))$$ Here, $\lambda \in [0, 1]$ controls the trade-off between decision speed and prediction confidence. Only positive cases ($y=1$, representing critical events) are penalized for delay.

  • Causal Architecture Adaptation: Offline 3D CNNs are modified to prevent "future leakage":

  • 3D Convolutions: Kernels are front-padded (by replicating initial frames) rather than symmetrically padded, ensuring output frames depend strictly on current and past frames.
  • Batch Normalization: Running statistics are computed statically across earlier depth channels to maintain temporal causality.
  • Streaming Head & Caching: Per-frame spatial feature representations $v_i$ are aggregated via an online running mean $w_t = \frac{1}{t+1} \sum_{i=0}^t v_i$ before passing through a linear classifier and sigmoid. Historical activations are cached so new frames only require computing incremental slices.

Datasets

The authors evaluated PrAViC across five diverse benchmarks:

  • Public Action & Gesture Datasets:
  • UCF101 (action recognition)
  • EgoGesture and Jester (first-person and dynamic hand gestures)
  • Kinetics-400 (large-scale human action recognition)
  • Clinical Ultrasound Dataset (Private): 18,365 Doppler ultrasound recordings of newborn hearts used to detect congenital heart defects (e.g., Tetralogy of Fallot, Hypoplastic Left Heart Syndrome).

Key Insights and Ideas

  • Thresholds as Probabilities: Instead of treating early-exit thresholds as a post-hoc heuristic tuning parameter, treating $\tau$ as uniformly distributed allows deriving an exact, differentiable closed-form expression for the normalized expected exit time ($\text{NE}$).
  • Asymmetric Latency Penalty: In real-world monitoring, the "negative" class usually denotes normal operation, whereas the "positive" class denotes an anomaly or hazard. Penalizing latency only on positive instances prevents the model from prematurely jumping to negative conclusions before seeing enough evidence.
  • Zero-Waste State Caching: Because causal padding guarantees that future frames do not change past representations, prior layer activations can be cached in a FIFO buffer, enabling efficient frame-by-frame inference without redundant recalculations.

Key Results

  • Superior Streaming Performance: On EgoGesture and Jester, PrAViC outperformed online baselines across standard backbones (3D-SqueezeNet, 3D-ShuffleNetV1/V2, 3D-MobileNetV2). On EgoGesture, Top-1 accuracy improved substantially (e.g., MobileNetV2 jumped from 90.31% to 99.24%).
  • Controllable Latency ($\lambda$): Tuning $\lambda$ smoothly traded exit latency for precision. On EgoGesture with MobileNetV2, setting $\lambda = 0.9$ slashed the normalized exit time (NET) from 0.6 to 0.1 while retaining 99.58% Top-1 accuracy.
  • Kinetics-400 & CoX3D: When paired with Continual 3D CNNs (CoX3D), PrAViC consistently beat the baseline while making decisions much earlier. For example, on X3D-M16, accuracy increased from 62.80% to 70.42%, while the normalized exit time dropped from 1.0 (full video) to 0.59.
  • Clinical Efficacy: On neonatal cardiac ultrasound video, PrAViC achieved ~91% accuracy (compared to 94% for a heavy offline model) while reaching diagnostic decisions in near real-time.

Limitations and Future Work

  • Loss of Future Context in Residual Connections: Enforcing strict temporal causality prevents the network from using bidirectional temporal context, leading to minor accuracy degradation compared to unconstrained offline models.
  • Initial Buffer Warm-up: The model requires an initial warm-up buffer (e.g., 16 frames in the ultrasound experiments) to populate internal receptive fields before reliable predictions can begin.
  • Focus on Binary Decisions: The formal expected-exit math was formulated around binary decision processes; extending the theoretical derivation directly to fine-grained multi-label or multi-class streaming tasks remains an open direction.

Summary updated

Abstract

Video processing is generally divided into two main categories: processing of the entire video, which typically yields optimal classification outcomes, and real-time processing, where the objective is to make a decision as promptly as possible. The latter is often driven by the need to identify rapidly potential critical or dangerous situations. These could include machine failure, traffic accidents, heart problems, or dangerous behavior. Although the models dedicated to the processing of entire videos are typically well-defined and clearly presented in the literature, this is not the case for online processing, where a plethora of hand-devised methods exist. To address this, we present PrAViC, a novel, unified, and theoretically-based adaptation framework for dealing with the online classification problem for video data. The initial phase of our study is to establish a robust mathematical foundation for the theory of classification of sequential data, with the potential to make a decision at an early stage. This allows us to construct a natural function that encourages the model to return an outcome much faster. The subsequent phase is to present a straightforward and readily implementable method for adapting offline models to the online setting with recurrent operations. Finally, PrAViC is evaluated through comparison with existing state-of-the-art offline and online models and datasets, enabling the network to significantly reduce the time required to reach classification decisions while maintaining, or even enhancing, accuracy.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Kinetics-400PrAViC₁ (X3D-S64)Accuracy67.60%+0.27 vs baselinesplit: test · fine-tuned · backbone=X3D-S64 · clip-selection=temporally-centered · clips-per-video=1
Source quote
L230: X3D-S\textsubscript{64} │ 67.33 │ 1 │ 67.60 │ 0.03
Kinetics-400PrAViC₁ (X3D-S64)NET0.03split: test · fine-tuned · backbone=X3D-S64 · clip-selection=temporally-centered · clips-per-video=1
Source quote
L230: X3D-S\textsubscript{64} │ 67.33 │ 1 │ 67.60 │ 0.03
EgoGesturePrAViC₁ with 3D-ShuffleNetACC@1 (top-1 accuracy)99.04split: test · fine-tuned · classes=83 · backbone=3D-ShuffleNet · clip-length=192 frames
Source quote
L263: \multirow{2}{*}{\rotatebox{45}{EgoGesture}} │ ACC@1 │ 88.23 │ 91.84 │ 89.93 │ 99.04 │ 90.44 │ 98.49 │ 90.31 │ 99.24
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
Kinetics-400CoX3D (X3D-S64) baselineAccuracy67.33%split: test · fine-tuned · backbone=X3D-S64 · clip-selection=temporally-centered · clips-per-video=1
Source quote
L230: X3D-S\textsubscript{64} │ 67.33 │ 1 │ 67.60 │ 0.03
Kinetics-400CoX3D (X3D-S64) baselineNET1split: test · fine-tuned · backbone=X3D-S64 · decision-frame=last · clips-per-video=1
Source quote
L230: X3D-S\textsubscript{64} │ 67.33 │ 1 │ 67.60 │ 0.03
BibTeX
@misc{tredowicz2024pravic,
  author = {Magdalena Trędowicz and Marcin Mazur and Szymon Janusz and Arkadiusz Lewicki and Jacek Tabor and Łukasz Struski},
  title = {{PrAViC: Probabilistic Adaptation Framework for Real-Time Video Classification}},
  year = {2024},
  eprint = {2406.11443},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.11443},
}
Figure