Git Product home page Git Product logo

mcg_diffusion's Introduction

Improving Diffusion Models for Inverse Problems using Manifold Constraints (NeurIPS 2022)

Official PyTorch implementation of the NeurIPS 2022 paper "Improving Diffusion Models for Inverse Problems using Manifold Constraints". Code modified from guided-diffusion and score_sde_pytorch.

arXiv arXiv concept concept concept

For each task, we additionally provide some re-implementations of diffusion model-based inverse problem solvers.

Improving Diffusion Models for Inverse Problems using Manifold Constraints
Hyungjin Chung, Hyungjin Chung, Jong Chul Ye
NeurIPS 2022

Abstract:
Recently, diffusion models have been used to solve various inverse problems in an unsupervised manner with appropriate modifications to the sampling process. However, the current solvers, which recursively apply a reverse diffusion step followed by a projection-based measurement consistency step, often produce sub-optimal results. By studying the generative sampling path, here we show that current solvers throw the sample path off the data manifold, and hence the error accumulates. To address this, we propose an additional correction term inspired by the manifold constraint, which can be used synergistically with the previous solvers to make the iterations close to the manifold. The proposed manifold constraint is straightforward to implement within a few lines of code, yet boosts the performance by a surprisingly large margin. With extensive experiments, we show that our method is superior to the previous methods both theoretically and empirically, producing promising results in many applications such as image inpainting, colorization, and sparse-view computed tomography.

Getting Started

Setting the environment

Our code was tested on the following environment

  • Ubuntu 20.04
  • CUDA 10.2
  • PyTorch 1.6.0

We provide the install script in install.sh. Be sure to have conda ready, as we will be using conda to build the environment. Once ready, simply run the following command:

source install.sh

The above command will create a conda environment, and install the dependencies listed in requirements.txt.

Pretrained checkpoints

The install script will automatically download the pre-trained checkpoints and place it in the checkpoints directory. Alternatively, you may download the pre-trained checkpoints used for each task from the links below.

FFHQ 256x256 ImageNet 256x256 LSUN-bedroom AAPM Original repository
Inpainting Link Link Link - Guided diffusion
Colorization Link - Link - Score-SDE
SV-CT - - - Link -

Solving Inverse Problems with MCG

For all tasks, we provide some sample data, which is contained in the samples folder, which will be automatically downloaded with the install script. You may alternatively get the data here. All results will be saved in the results folder.

Inpainting

Run the following command to perform inpainting with the default configurations.

bash run_inpainting.sh

You may try other sampling strategies other than MCG by changing the flag --sample_method to vanilla (score-SDE), or repaint (RePAINT).

Colorization

Run the following command. Change the parameters directly in the python script as needed.

python run_colorization.py

Sparse-view CT reconstruction (SV-CT)

Run the following command. Change the parameters directly in the python script as needed.

python run_CT_recon.py

We additionally provide our re-implementation of this paper. Set solver='song' when you wish to run the solver introduced in Song et al..

Citation

If you find our work interesting, please consider citing

@InProceedings{chung2022improving,
  title={Improving Diffusion Models for Inverse Problems using Manifold Constraints},
  author={Chung, Hyungjin and Sim, Byeongsu and Ye, Jong Chul},
  journal={Advances in Neural Information Processing Systems},
  year={2022}
}

mcg_diffusion's People

Contributors

hj-harry 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.