PrAViC: Probabilistic Adaptation Framework for Real-Time Video Classification

Magdalena Tredowicz, Lukasz Struski, Marcin Mazur, Szymon Janusz, Arkadiusz Lewicki, Jacek Tabor · DOI

Abstract

PrAViC is a novel framework designed to bridge the gap between high-accuracy offline video classification and the low-latency requirements of real-time applications. By integrating a probabilistic "early exit" mechanism and causal architectural modifications into standard 3D Convolutional Neural Networks (CNNs), PrAViC enables models to make reliable predictions based on the earliest possible frames of a video stream. Evaluated on diverse datasets including action recognition and medical imaging, PrAViC demonstrates a superior balance of speed and accuracy compared to existing online models.

Introduction

In computer vision, a fundamental trade-off exists between accuracy and processing speed. Offline models, which analyze an entire video clip before outputting a result, achieve high accuracy but are unsuitable for time-sensitive tasks like autonomous driving or medical monitoring. Conversely, online models process video frame-by-frame for immediate feedback but often rely on hand-tuned heuristics or specialized architectures that lack the robustness of their offline counterparts.

PrAViC (Probabilistic Adaptation Framework for Real-Time Video Classification) addresses this by providing a mathematically grounded method to adapt powerful offline 3D CNNs for real-time use. The framework allows researchers to tune a "speed-accuracy knob," forcing the model to provide the most accurate answer possible as quickly as possible.

Methods

The PrAViC framework consists of three core technical innovations:

1. Architectural Adaptation

To function in a real-time (online) environment, a model must be "causal"—it cannot use information from future frames to predict the current state. Standard 3D CNNs often "cheat" during training by using symmetric padding that looks ahead in time. PrAViC modifies these architectures by implementing causal convolutions, typically through replication padding of the initial frames and ensuring that the temporal receptive field only extends into the past.

Comparison of standard 3D convolutions versus PrAViC's causal approach, which ensures the model does not access future frames.

2. Recursive Head Design and Early Exit

Rather than re-processing the entire video history for every new frame, PrAViC uses a recursive aggregation strategy. It maintains a "memory" of classification scores from previous frames and combines them with the features of the current frame. This structured information aggregation allows the model to build confidence over time.

The decision to "exit" (i.e., provide a final classification) is governed by a probabilistic model. As frames are processed, the model calculates the probability of each class. When the confidence reaches a certain threshold, the model exits early.

The PrAViC probabilistic model processes input frames to generate class probabilities, which are then aggregated to make an early exit decision.

3. The Early-Exit Loss Function

The training process is guided by a specialized loss function incorporating a parameter $\lambda$. This parameter acts as a penalty for delay: a low $\lambda$ prioritizes speed, pushing the model to make decisions earlier, while a high $\lambda$ allows the model more time to maximize accuracy. This creates a Pareto front of optimal solutions for different application needs.

Evaluation and Results

The researchers validated PrAViC across several benchmarks:

  • Action and Gesture Recognition: On datasets like UCF101, Kinetics-400, EgoGesture, and Jester, PrAViC-adapted models consistently outperformed dedicated online architectures such as 3D-SqueezeNet.
  • Medical Utility: In a high-stakes application using Doppler Ultrasound videos of newborn hearts, PrAViC achieved a decision much faster than baseline models with only a marginal dip in accuracy (from ~94% to ~90%). In clinical settings, this reduction in latency can be life-saving.
  • Latency Reduction: On Kinetics-400, models like X3D-S64 achieved a Normalized Exit Time (NET) of 0.03, indicating that accurate decisions were made after seeing only 3% of the video duration.

Discussion and Limitations

PrAViC demonstrates that structured temporal aggregation can sometimes improve the performance of the underlying baseline model. However, the framework currently focuses on 3D CNNs and does not yet support newer architectures like Video Transformers. Additionally, while the accuracy loss is minimal, there is a small "accuracy tax" because the model intentionally ignores residual information in the final frames of a clip to prioritize speed.

Future work will involve extending PrAViC to Transformer-based models and exploring multi-modal data integration to further enhance real-time video understanding.

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 Tredowicz and Lukasz Struski and Marcin Mazur and Szymon Janusz and Arkadiusz Lewicki and Jacek Tabor},
  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