Reinforced Bit Allocation under Task-Driven Semantic Distortion Metrics

Jun Shi, Zhibo Chen

This paper presents a novel approach to image and video compression that prioritizes "machine vision" over human vision. By using Reinforcement Learning (RL), the authors optimize bit allocation to ensure that AI tasks—like object detection and classification—remain accurate even at very low bitrates, achieving up to 73% bit-rate savings compared to standard HEVC.

TL;DR

The researchers developed a Deep Q-Learning (DQN) framework that automatically adjusts compression levels (QP) for different parts of an image based on their "semantic importance." By focusing bits on regions critical for AI tasks rather than uniform pixel fidelity, they significantly reduce file sizes without sacrificing the performance of downstream computer vision models.

What Problem Does This Paper Address?

Traditional video coding standards, such as HEVC (H.265), are designed to optimize for Pixel Fidelity (making pixels look identical to the original) or Perceptual Fidelity (making the image look good to a human). However, we are entering an era where more video is "watched" by machines (surveillance, autonomous driving, medical AI) than by humans.

Standard compression often wastes bits on background textures that an AI doesn't need, or conversely, blurs small details that are critical for a detection algorithm. The challenge is that "Semantic Distortion"—the drop in an AI's accuracy due to compression—is difficult to integrate into traditional encoders because it isn't a simple mathematical formula like Mean Square Error (MSE).

Methods

The authors propose a Reinforcement Learning (RL) approach to bridge the gap between traditional encoders and semantic tasks.

  1. The RL Agent: They formulate bit allocation as a Markov Decision Process (MDP). A Deep Q-Network (DQN) acts as the agent, deciding the Quantization Parameter (QP) for each Coding Tree Unit (CTU) in an image.
  2. Importance Maps: To help the agent "see" what matters, they use two pre-processing tools:
  3. Grad-CAM: Identifies which regions a classification model (like VGG-16) relies on to make a decision.
  4. Mask R-CNN: Identifies foreground objects for detection and segmentation tasks.
  5. State and Reward: The agent’s "state" includes local information (the block's pixels and importance map) and global context (how many blocks are left, current bit usage). The "reward" function is a balance: it rewards the agent for saving bits but penalizes it if the "Semantic Distortion" (loss in task accuracy) is too high.
  6. The Encoder: The agent sits "on top" of a standard HEVC encoder, providing the QP decisions that the encoder then executes.

Datasets

The authors established a new Task-driven Bit Allocation (TBA) Dataset to train their agents:

  • Detection/Segmentation: 1,000 images from the TUD-Brussels pedestrian dataset.
  • Classification: 2,400 high-resolution images from the ImageNet test set.
  • Encoding Data: All images were encoded using HEVC reference software (HM 16.9) across a range of QPs (22 to 51) to provide the RL agent with a rich environment of bit-rate vs. distortion trade-offs.

Key Insights and Ideas

  • Semantic vs. Pixel Fidelity: The paper highlights that high-quality pixels do not always equal high-quality semantics. An RL agent might choose to heavily compress a grassy background (high pixel distortion) to save bits for a sharp rendering of a pedestrian's face (low semantic distortion).
  • RL as a Non-Differentiable Bridge: Because you cannot easily calculate the "derivative" of a classification accuracy score, standard optimization fails. RL is the perfect tool here because it only needs a reward signal, allowing it to optimize for "black box" AI models.
  • Global Awareness: The agent doesn't just look at one block in isolation. By including a 15-dimensional global feature vector (tracking things like the "mask ratio" of the entire frame), the agent learns to manage a "bit budget" across the whole image.

Key Results

The proposed method was compared against standard HEVC (fixed QP) and two baseline versions designed to match either the bit-rate or the distortion of the proposed model.

  • Bit-rate Savings: The approach achieved 43.1% to 73.2% bit-rate savings over standard HEVC while maintaining equivalent task performance.
  • Task-Specific Efficiency:
    • For Classification, the model saved roughly 85% of bits compared to a high-quality anchor while maintaining similar top-5 accuracy.
  • For Detection and Segmentation, the agent learned to prioritize object boundaries, which are critical for Intersection over Union (IoU) metrics.
  • Visual Evidence: Qualitative results show the agent "spending" bits on the face of a fox while letting the surrounding forest blur, a strategy that preserves the AI's ability to identify the animal while drastically shrinking the file size.

Limitations and Future Work

  • Intra-coding Only: This research focuses on HEVC "intra" mode (essentially still image compression). It does not yet address "inter" mode, which involves motion estimation between video frames.
  • Computational Overhead: Running Grad-CAM or Mask R-CNN to generate importance maps before encoding adds significant computational cost, which might limit real-time applications.
  • Future Directions: The authors plan to extend this framework to inter-mode coding and explore more complex video-level semantic metrics.

Summary updated

BibTeX
@inproceedings{shi2020reinforced,
  author = {Jun Shi and Zhibo Chen},
  title = {{Reinforced Bit Allocation under Task-Driven Semantic Distortion Metrics}},
  booktitle = {ISCAS},
  year = {2020},
  url = {https://openreview.net/forum?id=SPiC9aXwhHs},
}
Figure