Code Monkey home page Code Monkey logo

equivariantpnp's Introduction

Equivariant plug-and-play image reconstruction

arXiv

camera-ready (soon!)

Matthieu Terris, Thomas Moreau, Nelly Pustelnik, Julián Tachella.

To appear in CVPR 2024

tl;dr

Enforcing equivariance of the denoiser to certain transformations within PnP/RED algorithms improves the stability and reconstruction quality of the algorithm.

flexible

Method description

We consider algorithms where gradients (or proximal operators) of explicit priors are replaced by denoisers; these algorithms typically take the form (in the case of PnP)

$$x_{k+1} = \text{D}(x_k - \gamma \nabla f(x_k)),$$

where $\text{D}$ is a denoiser. In our paper, we show that enforcing equivariance of the denoiser with respect to a group of geometric transformations (such as rotations) can improve the Lipschitz constant of the denoiser, and hence the stability of the algorithm. While a trivial way to enforce equivariance with respect to a group of transforms $\mathcal{G}$ is to perform an averaging of the denoiser's output over the group of transformations as $\text{D}_{\mathcal{G}} = \frac{1}{|G|} \sum_{g \in \mathcal{G}} T_g^{-1} \text{D}(T_g)$, we propose to use a Monte-Carlo estimation of the equivariant denoiser at each step of the algorithm. The resulting algorithm reads

$$\begin{align*} &\text{Sample } g_k \sim \mathcal{G} \\\ &\text{Set } \text{D}_{g_k}(x) = T_{g_k}^{-1} \text{D}(T_{g_k} x) \\\ &x_{k+1} = \text{D}_{g_k}(x_k - \gamma \nabla f(x_k)). \end{align*}$$

Code

To reproduce the experiments, first download the test datasets and place them in your data folder. Next, update the config/config.json file to point to the correct data folder. There, there are two folders to specify:

  • ROOT_DATASET: the folder within which the CBSD68 and set3c datasets are located;
  • PATH_MRI_DATA: the path to the fastMRI .pt dataset.

Then, you can run the following scripts to reproduce the experiments:

PnP (click to expand)

without equivariance

On the set3c dataset for the motion blur problem, with the drunet model:

python running_pnp.py --problem='motion_blur' --model_name='drunet' --rand_rotations=0 --dataset_name='set3c' --results_folder='table_4/' --compute_lip=0 --sigma_den=0.02 --noise_level=0.01

with equivariance

On the set3c dataset for the motion blur problem, with the drunet model, and with equivariance:

python running_pnp.py --problem='motion_blur' --model_name='drunet' --rand_rotations=1 --dataset_name='set3c' --results_folder='table_4/' --compute_lip=0 --sigma_den=0.02 --noise_level=0.01
RED (click to expand)

without equivariance

On the set3c dataset for the super-resolution blur problem, with the drunet model (Fig. 6 of the paper):

python running_red.py --problem='sr' --model_name='drunet' --rand_translations=0 --dataset_name='set3c' --sigma_den=0.015 --sr=2

with equivariance

On the set3c dataset for the motion blur problem, with the drunet model, and with equivariance (Fig. 6 of the paper):

python running_red.py --problem='sr' --model_name='drunet' --rand_translations=1 --dataset_name='set3c' --sigma_den=0.015 --sr=2

Feel free to change problem and models!

ULA (click to expand)

without equivariance

On the BSD68 dataset for the super-resolution blur problem, with the drunet model (Fig. 8 of the paper):

python running_ula.py --problem='motion_blur' --model_name='drunet' --rand_translations=0 --dataset_name='subset_BSD20' --sigma_den=0.019

with equivariance

On the BSD10 dataset for the motion blur problem, with the drunet model, and with equivariance (Fig. 8 of the paper):

python running_ula.py --problem='motion_blur' --model_name='drunet' --rand_translations=1 --dataset_name='subset_BSD20' --sigma_den=0.019

Feel free to change problem and models!

Requirements

This code was tested with the following packages:

  • torch 2.2
  • deepinverse 0.1.1

The deepinverse package can be installed with pip install deepinverse or by cloning the repository.

equivariantpnp's People

Contributors

matthieutrs avatar

Stargazers

Y006 avatar LYK avatar  avatar Julián Tachella avatar aishijiedexiao7 avatar Wang Chong avatar  avatar Wei Deliang avatar Tobías Liaudat avatar Yuanzhi Zhu avatar  avatar Pierre-Antoine Comby avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.