# DeepInverse: a PyTorch library for imaging inverse problems

> DeepInverse collects imaging operators, denoisers, pretrained reconstruction models and training losses behind one PyTorch interface. It suits researchers who want to swap physics or priors without rewriting a pipeline, and it is a poor fit for anyone who wants a single pretrained model and no training loop.

**deepinv/deepinv** — DeepInverse: a PyTorch library for solving imaging inverse problems using deep learning

- Repository: https://github.com/deepinv/deepinv
- Website: http://deepinv.org/
- Stars: 821 · Forks: 219
- Language: Python
- License: BSD-3-Clause
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/deepinv-deepinv

## The problem DeepInverse addresses: physics, priors and training kept apart

Imaging inverse problems share a shape. A forward operator maps a clean image to measurements, noise is added, and a reconstruction method tries to invert the process. Deblurring, MRI, tomography, microscopy and super-resolution differ in the operator and in the noise, not in the overall skeleton. In practice, most research code reimplements that skeleton per project, so a new denoiser cannot be dropped into an existing MRI pipeline without rewriting the data handling around it.

DeepInverse is built to make those pieces interchangeable. The README describes it as a library that "accelerates deep learning research across imaging domains" and "enhances research reproducibility via a common modular framework of problems and algorithms". The intended audience is research groups and graduate students who already write PyTorch and want to compare a plug-and-play prior against an unrolled network against a diffusion sampler on the same operator, without maintaining three codebases.

It is not aimed at someone who wants to denoise a folder of photographs. There is no command line tool, no service, and no configuration file. Everything is Python objects composed in a script.

## How the operator, the prior and the reconstruction loop fit together

The library is organised around a small number of abstractions that appear throughout the documentation: predefined imaging operators under the physics guide, deep neural networks and pretrained reconstruction models under the reconstruction guide, and losses under the training guide. A typical script builds a physics operator, generates or loads measurements, picks a reconstruction method, and evaluates it with a metric. Because the operator is an object and not a fixed dataset transform, the same reconstruction method can be pointed at a different operator.

The four reconstruction families listed in the README are the interesting part of the design. Plug-and-play restoration treats a denoiser as a prior inside an iterative solver. Optimization covers the classical iterative side. Unfolded architectures turn a fixed number of solver iterations into network layers. Sampling algorithms and diffusion models cover uncertainty quantification, where you get a distribution of reconstructions instead of one image.

Those four families are usually separate research literatures with separate codebases. Putting them behind one interface is the actual contribution, and it is also where the abstraction cost shows up: you inherit DeepInverse's way of describing a problem, including how it parameterises noise and how it batches measurements. The documentation is the only reliable guide here, and the repository ships an examples directory with separate folders for plug-and-play, unfolded, sampling, self-supervised-learning, blind-inverse-problems and physics, which is a fair map of what is actually exercised.

## Installing deepinv and running a first reconstruction

The README requires Python 3.10 or higher and gives a single pip command for the stable release. Optional dependency groups are installed with the same command plus an extras list.

```bash
pip install deepinv
```

For datasets and denoisers, the README shows the extras form. The extras named there are dataset and denoisers, and pyproject.toml also defines a test group and a doc group, so the exact set available depends on the version.

```bash
pip install deepinv[dataset,denoisers]
```

If you need unreleased work, the README documents installing from the main branch. This is the nightly path, and the same page gives the force-reinstall variant for updating an existing checkout.

```bash
pip install git+https://github.com/deepinv/deepinv.git#egg=deepinv
```

The README points to a five minute quickstart tutorial at deepinv.org for the first reconstruction, along with a user guide and a gallery of examples. Follow that tutorial rather than improvising, because the class names for operators, denoisers and reconstruction methods are not listed in the README itself. What you should see after a successful install is a deepinv package importable from Python 3.10 or newer, with torch>=2.2.0 pulled in as a dependency. If the import fails on a missing optional package, that is the extras group, not the core install.

## Where DeepInverse gets in the way

The most concrete limitation is stated by the project itself. pyproject.toml carries the classifier "Development Status :: 4 - Beta", and the README says that because the library is under active development you can install a nightly build from main. Beta plus a nightly channel means the API you write against today is not a contract. Pinning a release version is the only way to keep a paper's code reproducible six months later, and the release history shows why: v0.4.0, v0.4.1 and v0.4.2 landed within roughly six months of each other.

The second constraint is weight. The core dependency list includes torch, torchvision, torchmetrics, numpy, matplotlib, tqdm, einops, requests, h5py and natsort, with torch pinned at 2.2.0 or newer. That is a reasonable footprint for a research environment and an unreasonable one for a small inference service.

Third, DeepInverse is a framework, not a model. If your task is one specific reconstruction and a pretrained checkpoint already exists for it, importing the full abstraction layer to call one model buys you nothing. The pretrained models page is where that decision should be made: if a model there matches your operator, use the model; reach for the framework when you need to change the operator or train something new. The README does not document a rollback procedure for a bad upgrade, so version pinning is the practical answer.

## DeepInverse compared with rolling your own PyTorch pipeline

The realistic alternative is not another library. It is the script you would write yourself: a Dataset that applies a blur kernel, a small U-Net, a training loop, and a PSNR call. That script is maybe two hundred lines and you understand every one of them. For a single paper with a single operator, it is often the faster route, and nothing in DeepInverse will beat it on time to first result.

The difference appears when the comparison set grows. A reviewer asks how your method does against a plug-and-play prior with the same denoiser, or against a diffusion sampler, or with a different forward operator. In your own script, each of those is a rewrite of the loop. In DeepInverse, the README describes a "common modular framework of problems and algorithms", which is the claim that the operator and the reconstruction method are separable. That is the trade: you accept the library's abstractions and its beta API in exchange for not rewriting the solver each time the question changes. If you never change the question, the trade is a loss.

The second alternative is a domain-specific package tied to one modality. Those tend to encode one scanner's geometry and one reconstruction pipeline well. DeepInverse spreads across MRI, tomography, microscopy and general deblurring, so it will be shallower in any single modality than a dedicated package. Check the physics guide for your geometry before assuming coverage.

## Maintenance, releases and what the BSD-3-Clause licence means for you

The repository is not archived, and the last push was on 2026-09-10, so the project is being worked on. Releases are tagged rather than continuous: v0.4.2 on 2026-08-30, v0.4.1 on 2026-06-06, v0.4.0 on 2026-03-11. The current version in pyproject.toml is 0.4.2. That cadence is fast enough that an unpinned dependency will drift, and slow enough that a pinned version will not go stale immediately.

Upgrade cost is mostly API churn in a beta project. The README offers a nightly install and a force-reinstall command for updating, which is convenient for development and a hazard for production. Treat the release tags as the supported surface and the main branch as a preview.

The licence is BSD-3-Clause, declared both in pyproject.toml and in the repository's LICENSE file. That is a permissive licence: it allows commercial use and modification, and it requires retaining the copyright notice and disclaimer. The repository also ships a NOTICE file, which is worth reading alongside the licence text. This is a description of what the files say, not legal advice; if you are shipping a product, have your own counsel review the notices you redistribute.

## Conclusion

Adopt DeepInverse if you are doing imaging research in Python and want the forward operator, the prior and the training loss to be separable components you can swap. Do not adopt it if you need a supported product with a stable API and no PyTorch dependency, or if you only want to run one pretrained model once. Before committing, check the physics and reconstruction pages of the documentation against your own operator, confirm which optional extra your denoiser needs, and pin the version you install, because the project describes itself as being under active development and ships nightlies from the main branch.

## FAQ

### What Python version does DeepInverse require?

The README says to install with Python 3.10 or higher, and pyproject.toml sets requires-python to >=3.10 while listing classifiers for 3.10, 3.11 and 3.12.

### How do I install DeepInverse?

The README gives pip install deepinv for the stable release, and pip install deepinv[dataset,denoisers] to add the optional dataset and denoisers dependencies. It also documents installing the nightly build from the main branch with pip.

### Is DeepInverse under active development?

The repository is not archived, the last push was on 2026-09-10, and the most recent release is v0.4.2 from 2026-08-30. The README states that the library is under active development and offers a nightly install from the main branch.

### What licence does DeepInverse use?

Both pyproject.toml and the repository's LICENSE file declare BSD-3-Clause. The repository also includes a NOTICE file alongside the licence.

### Which reconstruction methods does DeepInverse cover?

The README lists plug-and-play restoration, optimization, unfolded architectures, and sampling algorithms with diffusion models for uncertainty quantification. It also lists predefined imaging operators, pretrained reconstruction models and denoisers, training losses, and a framework for building datasets.

## Sources

- [deepinv/deepinv on GitHub](https://github.com/deepinv/deepinv)
- [License: BSD-3-Clause](https://github.com/deepinv/deepinv/blob/main/LICENSE)
- [Project website](http://deepinv.org/)
- [README](https://github.com/deepinv/deepinv/blob/main/README.md)
- [Releases](https://github.com/deepinv/deepinv/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/deepinv-deepinv
