Fast Object Detection in Compressed Video

Shiyao Wang, Hongchao Lu, Zhidong Deng

Abstract

Video object detection is traditionally computationally expensive due to the redundant processing of consecutive frames and the high overhead of calculating optical flow for feature propagation. This paper introduces the Motion-aided Memory Network (MMNet), a framework designed to accelerate detection by repurposing metadata already present in compressed video streams, such as H.264. By utilizing motion vectors and residual errors for feature alignment and refinement, MMNet achieves real-time speeds of 40–55 fps—up to 10x faster than high-performance detectors—while maintaining competitive accuracy on the ImageNet VID benchmark.

Introduction

Most deep learning models for video object detection treat video as a sequence of independent static images. This approach is computationally inefficient because it ignores the massive temporal redundancy between frames; neighboring frames in a video are typically very similar. While some researchers have attempted to use optical flow to propagate features from one frame to the next, calculating flow usually requires running an additional heavy CNN (like FlowNet), which often consumes the very computational gains intended by the propagation.

MMNet addresses this by pointing out a clever alternative: video compression standards (codecs) already calculate and store motion information to save space. MMNet seeks to use this "free" metadata to align and update features across frames without the heavy overhead of traditional methods.

Methodology

The Motion-aided Memory Network (MMNet) operates on a Group of Pictures (GOP) structure. It distinguishes between keyframes (I-frames) and predictive frames (P-frames) to optimize processing power.

Overview of the MMNet architecture across a Group of Pictures (GOP), showing feature propagation from keyframes to subsequent predictive frames.

1. Keyframe Feature Extraction

The model only runs a heavy "recognition" CNN (such as ResNet-101) on I-frames. These high-quality features serve as the foundation for the rest of the GOP.

2. Pyramidal Feature Attention ($N_{atten}$)

Propagating only high-level semantic features often leads to poor performance on small objects due to loss of spatial resolution. To combat this, MMNet uses an attention mechanism to combine features from multiple scales (different layers of the CNN). This ensures that the model retains enough detail to detect objects of various sizes as they move through the video stream.

3. Motion-aided LSTM ($N_{m-lstm}$)

For subsequent P-frames, the model avoids the full CNN inference. Instead, it takes the features from the previous frame and "warps" them using Motion Vectors extracted directly from the compressed video bitstream. It then uses Residual Errors—the difference between the predicted and actual frame—to refine those features via a light-weight LSTM. This warping step is essential to keep the network's internal representation spatially aligned with moving objects.

Detailed diagrams of (a) Pyramidal Feature Attention and (b) the Motion-aided LSTM module, illustrating how features are aggregated and refined using motion metadata.

Key Insights and Results

Exploiting "Free" Metadata

The most significant insight of this work is that motion vectors used by video decoders are a "good enough" proxy for optical flow. While less precise than dedicated flow models, they are computationally free because they are already calculated during video encoding. The inclusion of motion vectors and residual errors improved the mAP for fast-moving objects from 27.7% to 43.1% in ablation studies, proving that motion data is vital for tracking rapid changes.

Performance Metrics

The model was evaluated on the ImageNet VID dataset, a large-scale benchmark containing 30 object categories.

  • Speed: MMNet is roughly 3x faster than the single-image R-FCN detector and 10x faster than high-performance video detectors like MANet.
  • Efficiency: It achieves a frame rate of 40–55 fps on an NVIDIA Titan X Pascal, making it suitable for real-time applications.
  • Accuracy: On the ImageNet VID validation set, MMNet achieved 73.0% mAP (mean Average Precision). While slightly lower than the most complex state-of-the-art models (which reach ~78%), it offers a superior trade-off for applications where speed is critical.

Limitations and Future Work

While highly efficient, MMNet faces a trade-off between precision and speed. Motion vectors in compressed video are block-based and can be "noisy" compared to pixel-perfect optical flow, leading to slight accuracy drops for very small or highly detailed objects. Furthermore, the model's performance is currently tied to specific codec standards like H.264.

Future research may involve tighter integration with hardware video decoders to further reduce latency and exploring the impact of more modern codecs (like HEVC/H.265) on detection quality.

Summary updated

BibTeX
@inproceedings{wang2018fast,
  author = {Shiyao Wang and Hongchao Lu and Zhidong Deng},
  title = {{Fast Object Detection in Compressed Video}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2018},
  doi = {10.1109/iccv.2019.00720},
}
Figure