Prompt-ICM: A Unified Framework towards Image Coding for Machines with Task-driven Prompts

Ruoyu Feng, Jinming Liu, Xin Jin, Xiaohan Pan, Heming Sun, Zhibo ChenarXiv 2023 · DOI

Abstract

Image Coding for Machines (ICM) aims to compress visual data specifically for consumption by artificial intelligence models. Existing ICM paradigms often face a trade-off between the storage overhead of task-specific codecs and the sub-optimal performance of task-agnostic general feature extractors. We present Prompt-ICM, a unified framework that leverages task-driven prompts to bridge this gap. By utilizing "Compression Prompts" for intelligent bit allocation and "Task-Adaptive Prompts" for parameter-efficient model tuning, Prompt-ICM enables a single, fixed feature codec to support diverse downstream tasks. Experimental results across multiple benchmarks demonstrate that Prompt-ICM achieves superior task accuracy at significantly lower bitrates compared to traditional and learned codecs, while requiring only a fraction of the trainable parameters.

Introduction

The rapid advancement of computer vision has shifted the primary consumer of image data from humans to machines. Traditional image compression standards like JPEG and HEVC are optimized for human visual systems, focusing on texture preservation. In contrast, Image Coding for Machines (ICM) prioritizes features relevant to specific AI tasks such as classification, detection, and segmentation. Current ICM approaches typically fall into two categories: task-specific codecs, which lack scalability, and general-purpose feature extractors, which lack task-specific efficiency. Prompt-ICM addresses this "generalization vs. efficiency" dilemma by introducing a prompt-based adaptation mechanism.

Methodology

Prompt-ICM introduces two distinct types of prompts to optimize the compression-analysis pipeline:

  1. Compression Prompts: These are importance maps generated by a lightweight Information Selector (IS) module. The IS analyzes multi-scale features from the vision backbone to identify regions critical for the target task. These prompts guide the feature codec to allocate more bits to essential regions while aggressively compressing task-irrelevant background information.
  2. Task-Adaptive Prompts: Drawing inspiration from prompt tuning in large language models, these are small sets of learnable parameters injected into the vision backbone's decoder stages. They allow the pre-trained model to adapt to compressed features for specific tasks without requiring full-model fine-tuning.
Architecture of the Prompt-ICM framework.

The framework utilizes a Swin Transformer as the vision backbone and a controllable feature codec based on the Mean & Scale (M&S) Hyperprior model. This architecture allows for a unified system where only the lightweight prompts need to be swapped to switch between different AI tasks.

Experiments and Results

The performance of Prompt-ICM was evaluated on standard benchmarks including CUB-200-2011, Stanford Dogs, Stanford Cars, and Oxford Flowers for classification, as well as COCO and Cityscapes for detection and segmentation.

Key findings include:

  • Superior Rate-Distortion: Prompt-ICM consistently outperforms traditional codecs (HEVC-intra, VVC-intra) and state-of-the-art learned codecs like Cheng20. It maintains high accuracy even at extremely low bitrates (0.03–0.1 bpp).
  • Parameter Efficiency: The framework is highly efficient, requiring only approximately 0.87 million trainable parameters to adapt to a new task, compared to the 87.6 million parameters required for full fine-tuning of a Swin-B backbone.
  • Versatility: A single feature codec effectively supports multiple tasks simultaneously through prompt-based adaptation.
Rate-accuracy performance comparison on four classification datasets.

Conclusion

Prompt-ICM represents a significant step toward efficient and unified image coding for machines. By recognizing that machine vision is inherently selective, the framework achieves high performance with minimal bandwidth and storage overhead. Future work will explore advancing parameter-efficient tuning techniques to further enhance performance on dense prediction tasks like high-resolution semantic segmentation.

Summary updated

BibTeX
@misc{feng2023prompt,
  author = {Ruoyu Feng and Jinming Liu and Xin Jin and Xiaohan Pan and Heming Sun and Zhibo Chen},
  title = {{Prompt-ICM: A Unified Framework towards Image Coding for Machines with Task-driven Prompts}},
  year = {2023},
  eprint = {2305.02578},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.02578},
}
Figure