Skip to content

Aitical/CPLIR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CPLIR

Paper: Beyond Degradation Redundancy: Contrastive Prompt Learning for All-in-One Image Restoration

Author: Gang Wu, Junjun Jiang*, Kui Jiang, Xianming Liu, and Liqiang Nie

Overview

🔥 What is this about?

All-in-One Image Restoration (AiOIR) aims to address multiple degradation tasks with a single model. A popular way is to use task-aware prompts (a.k.a. instructions or guidance to the restoration backbone). While existing prompt paradigms suffer from two essential issues:

  • Representation Redundancy: adaptive prompt representations become overlapping and entangled across tasks
  • Functional Misalignment: explicit prompts (e.g., from classifiers) are discriminative for classification, not necessarily optimal for reconstruction

This repo implements Contrastive Prompt Learning (CPL), a general plug-and-play framework that fixes both.


Adaptive Prompt

Explicit Prompt

Contrastive Prompt Learning

✨ Key Idea

CPL improves prompt-task alignment through two complementary components:

  1. Sparse Prompt Module (SPM) — fight redundancy with principled sparsity. Instead of softly blending many prompts, SPM uses top-k sparse routing to activate only the most relevant prompt experts, reducing cross-task confusion, and keeps inference efficient.

  2. Contrastive Prompt Regularization (CPR) — align prompts by behavior, not embeddings. Conventional regularization operates on prompt embeddings. CPR is different: it regularizes the restoration outcome.

  • Positive: degraded image + correct prompt
  • Negative: same image + mismatched prompts

If wrong prompts can still produce good restorations, the model is not truly prompt-controlled—CPR explicitly penalizes that.

📊 Results

Benchmark Dataset Pretrained Model Results
WeatherBench Download Model Results

🙏 Acknowledgements

This codebase is built upon and inspired by prior works in AiOIR, including (but not limited to): PromptIR, MioIR, AdaIR, DRSFormer. Thanks a lot for their nice sharing.

📝 Citation

If you find this work useful, please cite:

@article{Wu2025CPLIR,
  title     = {Beyond Degradation Redundancy: Contrastive Prompt Learning for All-in-One Image Restoration},
  author    = {Wu, Gang and Jiang, Junjun and Jiang, Kui and Liu, Xianming and Nie, Liqiang},
  journal   = {IEEE Transactions on Pattern Analysis and Machine Intelligence},
  year      = {2025}
}

About

Beyond Degradation Redundancy: Contrastive Prompt Learning for All-in-One Image Restoration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published