All-in-One Image Restoration (AiOIR), which addresses diverse degradation types with a unified model, presents significant challenges in designing task-aware prompts that effectively guide restoration across multiple degradation scenarios. While adaptive prompt learning enables end-to-end optimization, it often yields overlapping or redundant task representations. Conversely, explicit prompts derived from pretrained classifiers enhance discriminability but discard critical visual information needed for reconstruction. To address these limitations, we introduce Contrastive Prompt Learning (CPL), a framework that aims to improve prompt-task alignment through two complementary components: a Sparse Prompt Module (SPM) that efficiently captures degradation-aware representations while reducing redundancy, and a Contrastive Prompt Regularization (CPR) that explicitly strengthens task boundaries by incorporating negative prompt samples across different degradation types. Unlike previous approaches that focus primarily on degradation classification, CPL directly optimizes the interaction between prompts and the restoration model. Extensive experiments across five benchmarks show that CPL consistently boosts the performance of strong AiOIR baselines across diverse scenarios. Our approach achieves state-of-the-art average performance on these benchmarks, providing a general and robust solution for AiOIR. The code is available at https://github.com/Aitical/CPLIR
翻译:一体化图像复原(AiOIR)旨在通过统一模型处理多种退化类型,其核心挑战在于设计能够有效指导跨多种退化场景复原的任务感知提示。虽然自适应提示学习支持端到端优化,但其产生的任务表示往往存在重叠或冗余。相反,基于预训练分类器构建的显式提示虽增强了可区分性,却丢失了重建所需的关键视觉信息。为克服这些局限,本文提出对比提示学习(CPL)框架,该框架通过两个互补组件提升提示与任务的对齐:稀疏提示模块(SPM)高效捕获退化感知表示并减少冗余;对比提示正则化(CPR)通过引入跨不同退化类型的负提示样本,显式强化任务边界。与先前主要关注退化分类的方法不同,CPL直接优化提示与复原模型间的交互。在五个基准测试上的大量实验表明,CPL能持续提升强基线AiOIR模型在多样化场景下的性能。本方法在这些基准测试中实现了最先进的平均性能,为AiOIR提供了通用且鲁棒的解决方案。代码发布于 https://github.com/Aitical/CPLIR