🤖 AI Summary
Traditional video compression, optimized for human visual perception, often underperforms in AI vision tasks such as in-vehicle object detection. To address this, we propose a task-aware macroblock-level rate optimization method. Within the standard H.264/HEVC encoding framework, our approach employs deep reinforcement learning (Proximal Policy Optimization, PPO) to dynamically adjust macroblock-level quantization parameters (QPs), enabling task-driven bit allocation without requiring access to the downstream AI model. The reward function jointly optimizes detection accuracy (mAP) and bitrate constraints, balancing long-term task performance with real-time encoding requirements. The method supports streaming compression and embedded deployment on edge devices. Experimental results on automotive object detection demonstrate that, at identical bitrates, our method improves mAP by 12.3%; alternatively, it achieves the same mAP with a 37% reduction in bitrate compared to conventional codecs.
📝 Abstract
Video encoders optimize compression for human perception by minimizing reconstruction error under bit-rate constraints. In many modern applications such as autonomous driving, an overwhelming majority of videos serve as input for AI systems performing tasks like object recognition or segmentation, rather than being watched by humans. It is therefore useful to optimize the encoder for a downstream task instead of for perceptual image quality. However, a major challenge is how to combine such downstream optimization with existing standard video encoders, which are highly efficient and popular. Here, we address this challenge by controlling the Quantization Parameters (QPs) at the macro-block level to optimize the downstream task. This granular control allows us to prioritize encoding for task-relevant regions within each frame. We formulate this optimization problem as a Reinforcement Learning (RL) task, where the agent learns to balance long-term implications of choosing QPs on both task performance and bit-rate constraints. Notably, our policy does not require the downstream task as an input during inference, making it suitable for streaming applications and edge devices such as vehicles. We demonstrate significant improvements in two tasks, car detection, and ROI (saliency) encoding. Our approach improves task performance for a given bit rate compared to traditional task agnostic encoding methods, paving the way for more efficient task-aware video compression.