Introduction
Traditional video compression standards, such as H.265/HEVC, have historically been optimized to minimize pixel-level distortion (Mean Squared Error) or to maximize human-perceived quality (Structural Similarity Index). However, as machine vision systems increasingly become the primary consumers of video data—for tasks ranging from autonomous driving to medical diagnostics—this human-centric approach is becoming suboptimal.
There is a fundamental "metric mismatch": features that are visually pleasing to a human eye may be irrelevant to an AI, while subtle textures critical for machine classification might be discarded as noise by standard encoders. Furthermore, while modern deep-learning codecs are end-to-end differentiable and easy to optimize, industry-standard "hybrid" codecs are complex, non-differentiable black boxes. This paper proposes a Reinforcement Learning (RL) based framework to bridge this gap, intelligently steering traditional codecs to prioritize semantic information.
The RSC Framework
The authors introduce RL-based Semantic Coding (RSC), a framework that treats the traditional codec as an environment and utilizes an RL agent to perform optimal bit allocation. The architecture consists of three primary components: semantic map generation, a Deep Q-Network (DQN) agent, and a task-specific reward function.
Semantic Map Generation
To guide the encoder, the system generates pixel-wise importance maps that identify which regions are critical for specific AI tasks. For classification, the framework employs Grad-CAM to highlight regions the model uses to determine a label. For detection and segmentation, Mask R-CNN is used to pinpoint object boundaries and masks. This approach creates a "universal language" of importance, allowing the same RL architecture to adapt to diverse vision tasks.
Reinforcement Learning for Bit Allocation
The bit allocation process is formulated as a Markov Decision Process (MDP). A DQN agent observes the state of the current coding unit (CU), its spatial neighbors, and the corresponding semantic map. The agent’s action is to select the optimal Quantization Parameter (QP) for each block.
The reward function is the core of the optimization, designed to balance two competing objectives: maximizing semantic fidelity (minimizing the loss of information needed by the AI) and maximizing bitrate reduction. Because the RL agent is trained off-policy, it can operate in parallel with the traditional encoder, making it a viable plug-in for existing hybrid coding frameworks like HEVC.
Experimental Results
The RSC framework was evaluated using a custom Universal Task-driven Semantic Coding (TSC) dataset, comprising 2,300 high-resolution images from ImageNet for classification and 1,000 images from the TUD-Brussels pedestrian dataset for detection and segmentation.
As shown in the performance curves, the RSC method significantly outperforms the standard HEVC anchor across all tested tasks. Key findings include:
- Bitrate Savings: The framework achieved average bitrate savings between 34.39% and 52.62% while maintaining equivalent task accuracy.
- Accuracy Improvements: At identical bitrates, the RSC method improved Top-5 classification accuracy by 2.38% and mean Intersection over Union (mIOU) for segmentation by 5.02%.
- Semantic Prioritization: Qualitative analysis confirms that the encoder preserves sharp details on primary subjects (e.g., a rabbit's head) while heavily blurring background elements that do not contribute to the AI's task performance.
Conclusion and Future Work
By using Reinforcement Learning as a bridge to optimize non-differentiable codecs, this research demonstrates that traditional standards can be effectively repurposed for machine vision. While the current implementation focuses on HEVC intra-coding and introduces some computational overhead for semantic map generation, it paves the way for more efficient machine-to-machine communication. Future work will focus on extending this framework to inter-frame coding (temporal optimization) and exploring multi-task optimization where a single bitstream must satisfy multiple vision algorithms simultaneously.
Summary updated