A Preprocessing Framework for Video Machine Vision under Compression

Fei Zhao, Mengxi Guo, Shijie Zhao, Junlin Li, Li Zhang, Xiaodong Xie

TL;DR

This paper introduces a video preprocessing framework designed to optimize video compression specifically for machine vision tasks rather than human perception. By utilizing a novel, differentiable "virtual codec" during training, the framework allows a neural preprocessor to learn how to retain task-critical features, achieving over 15% bitrate savings on downstream tasks like action recognition and object tracking while remaining fully compatible with standard codecs (like H.264 and H.265) at deployment.

What Problem Does This Paper Address?

The vast majority of video data transmitted over the internet today is compressed using traditional standards like H.264/AVC or H.265/HEVC. These codecs are explicitly engineered to eliminate redundancies based on human visual perception—discarding details the human eye won't miss.

However, an increasing amount of video traffic is consumed not by humans, but by machine vision algorithms (e.g., autonomous driving systems, surveillance analytics). Machine vision models often rely on subtle textures or precise inter-frame motion vectors that human-centric compression aggressively discards, leading to severe performance drops at low bitrates. Furthermore, standard codecs are non-differentiable, meaning they act as a "black box" that blocks the backpropagation of gradients, making it impossible to perform end-to-end optimization of deep learning pipelines.

Methods

The authors propose a two-phase framework that bridges the gap between non-differentiable standard codecs and deep learning models.

The overall pipeline of the proposed framework, showing separate training (virtual codec) and testing (real codec) paths.
  1. The Preprocessing Network: Before compression, the raw video passes through a neural preprocessor. As shown in Figure 2, this network splits processing into two distinct branches: a spatial branch (extracting intra-frame details via 2D convolutions) and a temporal branch (stacking frames to extract inter-frame motion via 3D-like convolutions). These features are merged using conditional attention to emphasize task-relevant information.
The architecture of the proposed preprocessor featuring parallel spatial and temporal feature extraction branches.
  1. The Differentiable Virtual Codec: To solve the non-differentiability problem during training, the authors designed a proxy "virtual codec" using differentiable tensor operations. It emulates block splitting, intra/inter prediction, frequency transforms, and quantization. This allows rate-distortion gradients to flow directly back into the preprocessor.
The internal structure of the virtual codec designed to emulate standard video encoding steps differentiably.
  1. Standard Deployment: During testing and deployment, the virtual codec is discarded. The preprocessed video is compressed using standard, unmodified software codecs (like x264 or x265). This ensures the method can be instantly deployed in real-world systems without changing existing infrastructure.

Datasets

The framework was evaluated on two primary downstream machine vision tasks using widely recognized benchmarks:

  • Video Action Recognition: Trained and evaluated on the Kinetics400 dataset across six diverse backbone networks (Slow-only, SlowFast, C2D, I3D, Swin, and TPN).
  • Video Object Tracking: Trained and evaluated on the GOT-10K dataset across four tracking backbones (KYS, DiMP, ATOM, and PrDiMP).

Key Insights and Ideas

  • The "Virtual Proxy" Strategy: Instead of replacing standard codecs with heavy, end-to-end neural compression models (which are computationally expensive and difficult to deploy commercially), this paper uses a lightweight neural proxy only during training. This achieves the benefits of end-to-end learning while retaining the practical deployment advantages of H.264/H.265.
  • Win-Win for Machines and Humans: Intuitively, optimizing video for machine eyes might make it look worse to humans. Surprisingly, the authors found that their preprocessor actually improved human perceptual metrics (VMAF scores increased by ~5-6%). By smoothing out noise and irrelevant details to save bitrate for the machine task, the preprocessor also made the video cleaner and easier to compress for standard human viewing.

Key Results

The performance was measured using the BD-Rate metric, which calculates the percentage of bitrate saved while maintaining equivalent accuracy.

  • Action Recognition: The framework achieved significant data savings across all backbones. For instance, using an H.264 codec, it saved up to 17.6% of the bitrate on the Slow-only backbone and 19.0% on the I3D backbone. On H.265, it delivered up to 18.1% bitrate savings (TPN backbone).
  • Object Tracking: For tracking tasks evaluated via Area Under the ROC Curve (AUC), the method achieved a maximum bitrate saving of 17.5% compared to standard codec anchors.
Rate-accuracy curves demonstrating that the proposed method (marked with 'ours') consistently outperforms standard baselines across various bitrates.

Limitations and Future Work

While the framework demonstrates impressive bitrate savings, a notable limitation is its specificity. The authors note that they individually trained a separate preprocessor for each downstream machine vision network. In a practical large-scale deployment, having to swap out or run multiple preprocessing models for different downstream tasks could introduce overhead.

Future work will likely focus on developing a more generalized, universal preprocessor capable of optimizing videos simultaneously for multiple diverse machine vision tasks without requiring network-specific retraining.

Summary updated

BibTeX
@inproceedings{zhao2024preprocessing,
  author = {Fei Zhao and Mengxi Guo and Shijie Zhao and Junlin Li and Li Zhang and Xiaodong Xie},
  title = {{A Preprocessing Framework for Video Machine Vision under Compression}},
  booktitle = {DCC},
  year = {2024},
  url = {https://openreview.net/forum?id=m8fKonLotQ},
}
Figure