Accelerating Learnt Video Codecs with Gradient Decay and Layer-Wise Distillation

Tianhao Peng, Ge Gao, Heming Sun, Fan Zhang, David Bull

This paper, presented at a recent conference, addresses a major bottleneck in the field of neural video compression: while deep learning-based codecs are becoming incredibly efficient at squashing data, they are often too "heavy" to run in real-time on consumer hardware.

TL;DR

Researchers have developed a model-agnostic pruning framework that slashes the computational complexity of neural video decoders by up to 65%. By combining a novel Gradient Decay technique with Adaptive Layer-wise Distillation, they achieved a 2× speedup in decoding time with a negligible loss in video quality (less than 0.3dB).

What Problem Does This Paper Address?

End-to-end (E2E) learnt video codecs (like FVC or DCVC) have recently begun to outperform traditional standards like H.265/HEVC. However, these models are computationally expensive. They require massive amounts of memory and high-end GPUs to decode video, which limits their use on mobile devices and increases their carbon footprint.

The standard way to fix this is structured pruning—deleting entire "filters" or neurons from the network. The challenge is that pruning usually causes a sharp drop in video quality. Existing methods often rely on "Straight-Through Estimation" (STE) to train pruned models, but STE suffers from instability and "mismatching" when you try to remove a large percentage of the network (high sparsity).

Methods

The authors propose two primary innovations to make pruning more effective for video:

  1. Gradient Decay (GD): In traditional pruning, "dead" weights are often allowed to receive gradient updates so they can potentially "wake up" if needed. However, as training progresses, this creates noise. Gradient Decay progressively reduces (anneals) the gradients of pruned weights. This allows for flexible exploration in early training stages but stabilizes the model's structure in later stages.
  2. Adaptive Layer-wise Distillation (ALD): Training a video codec is complex because it involves multiple sub-modules (motion estimation, residual coding, etc.). Pruning them all at once is difficult. ALD uses a "Teacher-Student" approach: a large, pre-trained "Teacher" model guides a smaller, pruned "Student" model. Instead of just looking at the final output, the Student is forced to match the intermediate feature maps of the Teacher in stages, ensuring it inherits the Teacher's "knowledge" even with fewer parameters.

The focus is specifically on the decoder side, as that is the component required for end-user playback.

Datasets

  • Training: The models were trained using the Vimeo-90K septuplet dataset, a standard benchmark for video processing tasks.
  • Evaluation: The team tested their approach on two high-definition (1080p) datasets:
  • UVG (Ultra Video Group): Known for high-quality, high-frame-rate sequences.
  • MCL-JCV: A dataset specifically designed for video quality assessment.

Key Insights and Ideas

  • The "Identity" Problem: The authors identified that the standard STE method (which treats pruned weights as if they were still there during backpropagation) becomes problematic at high sparsity levels (e.g., 75% of weights removed). Gradient Decay acts as a "soft exit" for these weights.
  • Normalization Matters: When performing distillation, the authors found that comparing normalized hidden states (feature maps) was more effective than comparing raw values. This helps the student model learn the structure of the data rather than just trying to mimic the Teacher's signal magnitude.
  • Global vs. Local Optimization: While video codecs are usually trained module-by-module, pruning must be global to be efficient. ALD bridges this gap by providing stage-wise supervision while maintaining a global sparsity constraint.

Key Results

The researchers applied their method to three state-of-the-art codecs: FVC, DCVC, and DCVC-HEM.

  • Complexity Reduction: They achieved up to a 65% reduction in MACs (Multiply-Accumulate operations) and a 70% reduction in model size.
  • Speedup: Real-world decoding latency was reduced by approximately 50% (2× faster).
  • Quality Retention: Despite the massive reduction in "brain power," the models only saw a 0.24dB to 0.29dB drop in BD-PSNR, a difference virtually imperceptible to the human eye in most scenarios.
  • Efficiency Frontier: As shown in their performance-complexity plots, the pruned models consistently sat "above and to the left" of existing benchmarks, meaning they provide better quality for the same amount of computational work.

Limitations and Future Work

  • I/O Bottlenecks: While the math (MACs) was reduced by 65%, the actual speedup was only 50%. This is because certain operations, like "warping" (moving pixels based on motion vectors) and arithmetic coding, are I/O intensive and don't benefit as much from neural network pruning.
  • Granularity: This paper focused on "structured" pruning (removing whole filters). The authors suggest that future work could explore "N:M sparsity" (a more granular approach supported by modern NVIDIA GPUs) to squeeze out even more performance.
  • Distillation Metrics: The study used Mean Squared Error (MSE) for distillation; the authors noted that exploring other metrics like KL-divergence might further improve results.

Summary updated

Abstract

In recent years, end-to-end learnt video codecs have demonstrated their potential to compete with conventional coding algorithms in term of compression efficiency. However, most learning-based video compression models are associated with high computational complexity and latency, in particular at the decoder side, which limits their deployment in practical applications. In this paper, we present a novel model-agnostic pruning scheme based on gradient decay and adaptive layer-wise distillation. Gradient decay enhances parameter exploration during sparsification whilst preventing runaway sparsity and is superior to the standard Straight-Through Estimation. The adaptive layer-wise distillation regulates the sparse training in various stages based on the distortion of intermediate features. This stage-wise design efficiently updates parameters with minimal computational overhead. The proposed approach has been applied to three popular end-to-end learnt video codecs, FVC, DCVC, and DCVC-HEM. Results confirm that our method yields up to 65% reduction in MACs and 2× speedup with less than 0.3dB drop in BD-PSNR. Supporting code and supplementary material can be downloaded from: https://jasminepp.github.io/lightweighltdvc/.
BibTeX
@inproceedings{peng2024accelerating,
  author = {Tianhao Peng and Ge Gao and Heming Sun and Fan Zhang and David Bull},
  title = {{Accelerating Learnt Video Codecs with Gradient Decay and Layer-Wise Distillation}},
  booktitle = {PCS},
  year = {2024},
  doi = {10.1109/pcs60826.2024.10566283},
}

Loading related content...

Figure