Manuscript Offprint

arXiv:2611.04960

An Agentic Framework for Quality-Aware and Scenario-Adaptive Image Compression

Zhenghao Chen, Lebin Zhou, Zicong Chen, Naifu Xue, Jiahao Li, Bin Li, Dong Xu, Yan Lu

Zhenghao Chen, Lebin Zhou, Zicong Chen, Naifu Xue, Jiahao Li, Bin Li, Dong Xu, Fellow, IEEE, and Yan Lu

Abstract—Despite decades of progress, image codecs remain difficult to adapt to diverse real-world compression scenarios for two main reasons. First, most image codecs are optimized for a specific objective and require substantial redevelopment when the compression goal changes. Second, they typically assume clean inputs, whereas sensor-captured images often contain degradations that alter rate-quality behavior. To address these challenges, we propose Practical Image Coding Agents (PICA), a multi-agent framework that adapts existing codecs to diverse user requirements and potentially degraded inputs. PICA consists of four collaborative agents: a Perception agent that interprets user intent and analyzes image content, an Improvement agent that jointly considers bitrate and reconstruction quality to guide pre-coding restoration, a Coding agent that refines quality-control settings from global to regional levels, and an After-coding improvement agent that addresses residual degradations and compression-induced artifacts through restoration guided solely by image quality. To enable codec-agnostic regional adaptation, we introduce Agentic ROI Coding (AROIC), which treats the codec as a black box and allows the agent to automatically schedule, execute, evaluate, and reflect ROI coding plans without architectural modifications or codec-specific retraining. We integrate these four agents with a Scenario-Guided Quality–Rate (SGQR) evaluation strategy to enable more effective scenario-adaptive compression across heterogeneous codecs. Comprehensive experiments on clean, noisy, and blurred images across standard, perceptual, and machine-vision compression scenarios demonstrate that PICA consistently enhances the compression performance of both the conventional H.266/VVC codec and the neural Cheng2020 codec, outperforming competing compression methods on the Kodak, CLIC2020, and HEVC datasets.

Index Terms—Image compression, image restoration, agentic systems, perceptual compression, machine-vision compression.

I. INTRODUCTION

IMAGE compression is a fundamental problem in signal processing, as the rapidly growing volume and resolution of visual data impose substantial costs on storage, transmission bandwidth, and communication latency. This has been extensively studied for more than three decades, leading to mature hand-engineered image coding standards such as JPEG [1]. Such traditional codecs remain widely used in practical image storage and communication systems. More recent standards, such as H.266/VVC [2], also support high-efficiency image compression through intra-frame coding. With rapid advances in deep learning, neural image compression (NIC) methods have achieved substantial progress by jointly optimizing nonlinear transforms and entropy models under end-to-end rate-distortion (RD) objectives [3]–[10]. Representative methods such as Cheng2020 [11] have demonstrated RD performance competitive with or superior to those traditional codecs on the standard compression benchmarks.

Despite this tremendous success, most widely deployed codecs are designed primarily for generic pixel-fidelity reconstruction, with their RD performance conventionally optimized and evaluated using distortion metrics such as PSNR, a compression scenario referred to as standard compression. However, modern visual-data ecosystems increasingly involve heterogeneous consumers and objectives with distinct compression intents. For example, some compressed images are primarily expected to preserve visual realism and semantic fidelity for human observers [7], [12]–[14], a compression scenario referred to as perceptual compression. Meanwhile, an increasing proportion of visual data is consumed by downstream machine-learning systems, where compression should preserve task-relevant information and downstream accuracy [15]–[17], a compression scenario referred to as machine-vision compression. Unfortunately, prior studies [7], [14], [16], [17] have shown that commonly used standard codecs can become suboptimal in these specialized compression scenarios.

Developing dedicated codecs for these specialized scenarios provides an intuitive solution. With the flexibility of NIC, several scenario-specific methods have therefore been proposed. For example, machine-vision compression approaches [16], [17] introduce task-aware compression modules to produce latent representations that preserve information relevant to downstream vision tasks. Meanwhile, perceptual NIC methods [7], [13] combine powerful generative models with human-perception-oriented objectives, such as LPIPS [18], to reconstruct visually plausible content. Though these specialized designs achieve substantial improvements in their respective scenarios, they are typically tightly coupled with extensive scenario-specific modules and objectives, thereby requiring considerable architectural redesign and substantial re-optimization when the compression intent changes. Consequently, they exhibit limited generalizability across diverse compression scenarios. This limitation motivates our first research question (RQ): RQ1: Can existing widely-used codecs be rapidly adapted to diverse compression scenarios without architectural redesign or substantial re-optimization?

Zhenghao Chen and Zicong Chen are with The University of Newcastle. (E-mail: zhenghao.chen@newcastle.edu.au, csc20001218@gmail.com)

Lebin Zhou is with Santa Clara University. (E-mail: lzhou@scu.edu)

Naifu Xue is with The Communication University of China (E-mail: aaronxuenf@cuc.edu.cn)

Jiahao Li, Bin Li and Yan Lu are with Microsoft Research Asia. (E-mail: {li,jiahao, libin, yanlu}@microsoft.com).

Dong Xu is with The University of Hong Kong (E-mail: dongxu@hku.hk).

This work was initiated and largely completed during Zhenghao Chen's participation in the Microsoft Research Asia StarTrack Scholars Program.

Bin Li and Yan Lu are the Corresponding Authors.

Zhenghao Chen, Lebin Zhou and Zicong Chen contributed equally.

Beyond their limited generalizability across compression scenarios, most existing codecs are developed under the assumption of clean input images. In practice, however, acquired images may exhibit degradations (e.g., noise) due to limitations of imaging sensors, such as those in smartphone cameras. These degradations not only compromise visual quality but also introduce undesirable signal variations that may increase the number of bits required for compression [19], [20]. To address this issue, recent studies have jointly optimized restoration and compression or introduced restoration-aware compression modules [19]–[25]. However, these approaches still rely on dedicated components and degradation-specific optimization. Moreover, they generally assume that the degradation type and restoration objective are known in advance, rather than autonomously determining whether restoration is necessary and how it should be coordinated before and after coding. It motivates our second RQ: RQ2: Can an existing widely used codec autonomously detect image degradations and adaptively coordinate pre-coding and post-coding restoration without substantial re-development?

To simultaneously address above two RQs, we propose Practical Image Coding Agents (PICA), a multi-agent framework that adapts existing image codecs to diverse degraded inputs and compression scenarios through online and goal-oriented optimization. PICA consists of four collaborative agents: a Perception Agent, an Improvement Agent, a Coding Agent, and an After-Coding Improvement Agent. Specifically, the Perception Agent interprets the user-specified compression intent while analyzing the input image, including its visual content, quality condition, and regions of interest, thereby providing structured guidance for subsequent agents.

To address RQ1, we introduce a Coding Agent with a global-to-regional coding quality refinement scheme. Guided by the compression intent summarized by the Perception Agent, it first performs Global Quality Control (QC) Search, applying estimated QC to the target codec and iteratively refining them based on the measured bitrate and reconstruction quality until the user-specified requirements are satisfied. Starting from this feasible global operating point, we further refine the coding quality of individual regions, motivated by prior studies showing that different compression scenarios assign different importance to image regions. For example, machine-vision compression often requires stronger preservation of task-relevant objects than background regions [16], [17]. However, most existing methods [26] rely on codec-specific ROI coding mechanisms, requiring the underlying codec to be explicitly designed or trained with dedicated ROI functionality and thus limiting their generalizability to heterogeneous codecs without native ROI support.

To overcome this limitation, we introduce Agentic ROI Coding (AROIC), which treats the underlying codec as a black box and follows a scheduling-execution-reflection loop. Specifically, the agent schedules and executes candidate coding plans that adjust the QC settings of the ROIs and background and, when beneficial, apply background downsampling. Each region is independently encoded using the target codec with its assigned QC setting, and the decoded regions are assembled into a complete reconstruction. The agent then evaluates the

compression results and uses the evaluation feedback to refine subsequent coding plans while retaining the best-performing candidate. By relying on the codec's native QC interface, AROIC enables ROI-aware adaptation across heterogeneous codecs without codec-specific redesign or retraining.

Moreover, to address RQ2, we introduce the Improvement Agent and the After-Coding Improvement Agent. First, the Improvement Agent performs quality-rate (QR)-aware pre-coding restoration to mitigate input degradations and improve the overall QR trade-off. Unlike existing restoration agents [27], [28], which focus on correcting all detected degradations, our agent jointly evaluates the coding rate and reconstruction quality resulting from each candidate restoration operation. It retains only operations that improve the QR trade-off under the specified compression objective. Similarly, the After-Coding Improvement Agent performs quality-aware post-coding restoration to mitigate residual degradations and potential compression-induced artifacts in the decoded image. This stage focuses on degradations that primarily affect reconstruction quality and adaptively applies restoration only when it improves the quality of the final decoded image.

To align the collaborative agents with the intended compression scenario, we introduce a Scenario-Guided Quality-Rate (SGQR) evaluation strategy for the Improvement and Coding Agents. Specifically, SGQR evaluates each candidate improvement or coding plan using the bitrate and reconstructed image obtained after compression. It assesses reconstruction quality using scenario-specific metrics and selects the plan that offers the best QR trade-off under the user's compression requirements. Overall, our PICA integrates four collaborative agents with SGQR evaluation to adapt heterogeneous existing codecs to diverse compression scenarios without codec-specific redevelopment. We conduct extensive experiments on clean, noisy, and blurred images across standard, perceptual, and machine-vision compression scenarios. Results on the Kodak [29], CLIC2020 [30], and HEVC [31] datasets demonstrate that PICA consistently improves the compression performance of both H.266/VVC [2] and Cheng2020 [32].

Our main contributions can be summarized as follows:

• Practical Image Coding Agents. We propose a multi-agent framework that adapts existing image codecs to diverse compression scenarios and potentially degraded inputs through SGQR-guided optimization.

  • Quality-Rate-Aware Improvement Agents. We introduce a pre-coding improvement agent that jointly considers bitrate and reconstruction quality to address input degradations, and a post-coding improvement agent to mitigate residual and compression-induced degradations.

• Codec-Agnostic Coding Agent. We introduce a Coding Agent with global-to-regional coding quality refinement together with AROIC, which treats the underlying codec as a black box and enables ROI-aware adaptation across heterogeneous codecs without codec-specific redesign.

References (77)