TL;DR
PromptCIR is a novel, lightweight prompt-learning framework designed for blind compressed image restoration. By implicitly encoding degradation information through spatially flexible, dynamic prompts and incorporating a hybrid local-global attention mechanism, it eliminates the need for heavy quality-factor prediction networks. The approach achieved first place in the NTIRE 2024 Blind Compressed Image Enhancement challenge, delivering state-of-the-art restoration quality with minimal parameter overhead.
What Problem Does This Paper Address?
When images are compressed—most commonly using the JPEG codec—they suffer from unwanted artifacts like blocking, blurring, and ringing. Restoring these images without knowing the compression level (the Quality Factor, or QF) is known as Blind Compressed Image Restoration (CIR).
Traditional deep learning approaches typically handle this by using an auxiliary sub-network to explicitly predict the numerical QF to guide the restoration network. However, this strategy suffers from two major drawbacks:
- Loss of Spatial Information: A single numerical QF scalar lacks spatial awareness. It cannot adapt to varying image content and textures, which degrade differently even under the same compression level.
- High Parameter Overhead: Explicit predictor and controller networks introduce significant computational and parameter overhead, making them difficult to deploy on edge devices like mobile phones.
PromptCIR addresses these challenges by replacing explicit prediction with implicit, content-aware prompt learning.
Methods
The authors introduce PromptCIR, a U-shaped encoder-decoder network built upon the powerful Restormer backbone, enhanced with two key architectural innovations:
- Dynamic Prompt Block: Instead of predicting a scalar QF, the network uses a Dynamic Prompt Generation Module (DPM). It takes a set of small ($1 \times 1$) learned prompt bases and interacts them with weights generated dynamically from the input image features. This creates a spatially flexible prompt map that implicitly encodes both the distortion level and the local image content. A Prompt Interaction Module (PIM) then fuses this guidance into the restoration chain.
- Residual Hybrid Attention Group (RHAG): JPEG compression operates on local $8 \times 8$ pixel blocks, meaning local context is vital for artifact removal. Standard global transformer blocks can struggle with this local extraction. The authors replace the transformer blocks in the first two stages of the network with RHAGs (inherited from the Hybrid Attention Transformer, HAT). RHAGs combine shifted window-based self-attention with parallel channel attention blocks to powerfully capture both local and long-range pixel dependencies.
The overall architecture showing the U-Net structure and module placement is illustrated below:
The internal structure of the RHAG component, which targets local block artifacts, is detailed here:
Datasets
The model was trained and evaluated using several standard image restoration datasets:
- Training: Initially trained on DF2K (a combination of DIV2K and Flickr2K). To push performance boundaries, the authors scaled up training using LSDIR (Large-Scale Dataset for Image Restoration), which contains 84,991 high-quality images.
- Evaluation: Tested on classic benchmarks including LIVE1, BSDS500, ICB, and the official DIV2K validation set from the NTIRE 2024 challenge.
Key Insights and Ideas
- Implicit Spatially-Varying Prompts > Explicit Scalars: Implicitly modeling degradation via dynamic prompt bases preserves spatial variations. This allows the network to apply different restoration strengths to smooth regions versus highly textured areas.
- Early-Stage Locality is Crucial: Global token attention is highly efficient in deeper network layers, but early layers benefit significantly from localized window attention (like RHAG) to directly target the block-based grid structures introduced by JPEG compression.
- Data Scale Synergy: The representative power of hybrid attention networks scales exceptionally well with massive datasets. Switching from DF2K to LSDIR yielded substantial performance gains, particularly on ultra-high-resolution datasets like ICB.
Key Results
PromptCIR achieved state-of-the-art performance across all evaluated benchmarks and won first place in the NTIRE 2024 challenge for blind compressed image enhancement.
- Efficiency: PromptCIR achieves superior results to explicit prediction networks like FBCNN while cutting the parameter count roughly in half (34.75M vs. 71.92M parameters).
- Quantitative Performance: On the LIVE1 dataset under blind restoration conditions, PromptCIR achieved a PSNR of 32.45 dB, outperforming FBCNN (32.08 dB) and the baseline PromptIR (32.34 dB).
- Data Scaling: Incorporating the large-scale LSDIR dataset boosted performance further, yielding an additional average PSNR gain of up to 0.29 dB on the high-resolution ICB dataset.
Qualitatively, the network successfully removes block artifacts and restores sharp, vivid textures without introducing unnatural blurring.
Limitations and Future Work
Not explicitly discussed in the paper. However, because the framework is optimized around the block-based nature of JPEG codecs, its direct efficacy on non-block-based compression artifacts (such as those from neural/AI-based image compressors or specific video streaming codecs) remains an open question for future exploration.
Summary updated