RL-RC-DoT: A Block-level RL agent for Task-Aware Video Compression

Uri Gadot, Assaf Shocher, Shie Mannor, Gal Chechik, Assaf Hallak

Introduction

The explosion of video data in autonomous driving and surveillance has shifted the primary consumer of video from humans to AI models. Traditional video codecs like H.264 are optimized for human perceptual quality, often sacrificing details in regions that are critical for computer vision tasks, such as distant objects or specific textures. RL-RC-DoT (Reinforcement Learning Rate Controller for Downstream Tasks) addresses this by introducing a task-aware compression strategy that optimizes video for machine consumption.

The Challenge of Task-Aware Compression

Standard compression techniques treat all pixels with similar importance based on human visual saliency. For a car-detection algorithm, however, maintaining clarity on a distant vehicle is far more important than preserving the texture of the asphalt. While existing task-aware solutions exist, they often require the heavy downstream AI model to be active during the encoding process, making them unsuitable for low-power edge devices. RL-RC-DoT overcomes this by using lightweight encoder statistics to drive a reinforcement learning agent that operates in real-time.

System Architecture and Methodology

The core of RL-RC-DoT is a reinforcement learning agent trained using Proximal Policy Optimization (PPO). Unlike standard rate controllers that set a single Quantization Parameter (QP) for an entire frame, this agent operates at the macro-block level (16x16 pixel patches).

Figure 1: The RL-RC-DoT architecture. The RL agent uses encoder statistics to generate a delta QP map, optimizing the reconstructed frame for downstream task rewards.

As shown in Figure 1, the system workflow involves:

  1. State Representation: The agent receives "per-patch statistics" and a "global statistics vector" directly from the video encoder.
  2. Action Space: The agent outputs a $\Delta$ QP map, adjusting the compression level for each macro-block.
  3. Self-Supervised Reward: During training, the reward is calculated by comparing the downstream task's performance on the raw frame versus the reconstructed (compressed) frame. This "pseudo-ground-truth" approach eliminates the need for manual labels.
  4. Inference Efficiency: At runtime, the agent does not require the downstream AI model. It relies solely on internal codec data, allowing it to process video at 250 FPS.

Experimental Results

The researchers evaluated RL-RC-DoT using the BDD100K dataset, focusing on challenging driving scenarios. The agent was trained to optimize for a YOLOv5 car detector.

Figure 4: Performance comparison between standard x264 and RL-RC-DoT across (a) Precision, (b) Recall, and (c) PSNR for car detection.

Key Findings:

  • Significant Bit-rate Savings: For car detection tasks, RL-RC-DoT achieved a 24.7% reduction in BD-rate. This means the system can maintain the same detection accuracy as standard x264 while using approximately 25% less bandwidth.
  • Task Generalization: Interestingly, a policy trained for YOLOv5 also improved performance for other detectors like SSD and different tasks like semantic segmentation. This suggests the agent learns universal visual features important for computer vision.
  • Human Interpretability: While optimized for machines, the visual quality (PSNR) remains high enough for human debugging and data collection, as seen in Figure 4(c).
  • Real-time Performance: The RL overhead is minimal (approx. 4ms per frame), making it highly suitable for high-speed streaming applications.

Conclusion and Future Directions

RL-RC-DoT demonstrates that reinforcement learning can effectively bridge the gap between traditional video compression and modern AI requirements. By operating at the macro-block level and utilizing internal codec statistics, it provides a scalable, real-time solution for task-aware compression.

Future work includes adapting the agent for more modern codecs like H.265 (HEVC), which use more complex coding structures, and addressing the challenges of generalizing policies across different video resolutions.

Summary updated

BibTeX
@inproceedings{gadot2025rl,
  author = {Uri Gadot and Assaf Shocher and Shie Mannor and Gal Chechik and Assaf Hallak},
  title = {{RL-RC-DoT: A Block-level RL agent for Task-Aware Video Compression}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.01169},
}
Figure