Library / SDK
deepinv/deepinv avatar
deepinv/deepinv

DeepInverse: A PyTorch Toolkit for Inverse Problems in Imaging

DeepInverse: a PyTorch library for solving imaging inverse problems using deep learning

812 stars213 forksPythonBSD-3-Clause

At a glance

What is it?
DeepInverse packages forward operators, denoisers, unfolded networks and diffusion samplers behind one PyTorch interface, so a deblurring or MRI experiment can be assembled from shared parts instead of rebuilt per paper. The judgement: it is a research framework first, and its value depends on whether your problem matches one of its predefined operators.
Who is it for?
Adopt DeepInverse if your reconstruction problem maps onto one of its predefined imaging operators and you want plug-and-play, unfolded or diffusion-based reconstruction in a single PyTorch interface. Do not adopt it if your forward model is bespoke and non-differentiable, or if you need a frozen, version-pinned pipeline for clinical or production inference, because the README describes the project as under active development and the nightly install path uses a git URL.
Can I use it commercially?
Yes. BSD-3-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem DeepInverse targets: reconstruction code that never leaves the paper

Inverse problems in imaging share a shape. A forward operator maps a clean image to measurements, noise is added, and the task is to recover the image. Deblurring, super-resolution, MRI reconstruction, tomography and microscopy all fit this template, yet each paper tends to ship its own data loader, its own operator implementation, its own training loop and its own evaluation code. Reproducing a result means reimplementing someone else's blur kernel, someone else's noise model and someone else's metric before you can check whether the method itself works. DeepInverse is aimed at that duplication. The README describes the library as a common modular framework of problems and algorithms, with predefined imaging operators, pretrained reconstruction models and denoisers, frameworks for plug-and-play restoration, optimization and unfolded architectures, training losses for inverse problems, and sampling algorithms with diffusion models. The intended audience is stated plainly: deep learning researchers across imaging domains, plus new practitioners who would otherwise face a high entry cost. It is a library for people who already know what a forward operator is and want to stop rewriting one.

Forward operators, denoisers and samplers as separate interchangeable objects

The architecture visible in the README is a decomposition rather than a pipeline. Physics lives in the operator layer, which the documentation groups under a physics user guide. Learning lives in the reconstruction layer, split into denoisers, pretrained models, iterative methods, optimization and unfolded architectures. Training lives in a third layer with its own losses and a dataset-building framework. Sampling algorithms and diffusion models sit alongside reconstruction and are described as serving uncertainty quantification. The practical consequence of this split is that a plug-and-play method is not a class you inherit from. It is a composition: pick an operator, pick a denoiser, pick an iterative solver, and the solver calls the denoiser as a prior while enforcing data consistency through the operator. An unfolded architecture follows the same logic with the iterations unrolled into a network whose components are trained end to end. Because each piece is a separate object, swapping a denoiser for a diffusion sampler, or a Gaussian blur operator for a tomography operator, does not require touching the training code. That is the actual mechanism, and it is also the constraint: the framework is only as useful as the operators it already defines, since everything downstream assumes the forward model can be expressed in that layer.

Installing DeepInverse, including the optional dependency groups

The README gives the stable install as a single command requiring Python 3.10 or higher: pip install deepinv. Optional dependencies are grouped by name, and the README shows the syntax with two groups at once: pip install deepinv[dataset,denoisers]. The documentation page linked from the README also covers installing with uv, pixi and conda, so pip is not the only supported route. Because the README states the project is under active development, it also documents a nightly path that installs straight from the repository: pip install git+https://github.com/deepinv/deepinv.git#egg=deepinv. For an existing installation the README gives an upgrade command that deliberately skips dependencies: pip install --upgrade --force-reinstall --no-deps git+https://github.com/deepinv/deepinv.git#egg=deepinv. That --no-deps flag matters. Forcing a reinstall without resolving dependencies avoids pip dragging in a different torch build, but it also means a nightly install will not pull in a newly required package on its own. The README does not list the full set of optional extras, so the group names shown are the two confirmed examples rather than an exhaustive list. Entry points for learning the API are a five minute quickstart tutorial, a set of examples and a user guide, all hosted on deepinv.org.

Where the abstraction breaks: operators, checkpoints and nightly drift

The clearest limitation is the operator layer. A predefined operator encodes a specific physical model with specific assumptions. If your acquisition differs in a way the operator does not express, you are back to writing your own forward model, and the surrounding framework gives you less than it would for a supported modality. The README does not claim universal coverage, and the operator list is a finite set grouped by physics. A second gap is pretrained weights. The README advertises pretrained out-of-the-box reconstruction models and denoisers, but a pretrained denoiser is trained for a particular noise distribution, and plug-and-play reconstruction inherits that assumption. Nothing in the README guarantees a checkpoint exists for your operator and noise level. Third, the release cadence is fast: v0.4.0, v0.4.1 and v0.4.2 landed between March and August 2026. That is healthy for a research library and awkward for anything that needs a frozen environment, especially if you installed the nightly build, which by definition tracks main rather than a tagged release. Diffusion-based sampling is heavier than a feed-forward reconstruction, and the README frames it around uncertainty quantification rather than speed, so treating it as a drop-in replacement for a single forward pass would misread its purpose.

How DeepInverse differs from a general reconstruction toolbox

The obvious alternative for a Python user is to assemble the same thing from PyTorch, a generic optimization library and a model zoo, or to use a modality-specific package such as a dedicated MRI reconstruction framework. The difference is where the abstraction is drawn. A modality-specific package typically hard-codes one forward model and one acquisition geometry, which makes it very direct for that modality and useless outside it. A hand-rolled PyTorch pipeline gives you total control and no shared vocabulary, so nothing transfers between projects. DeepInverse sits between them: it defines operators, denoisers, solvers, losses and datasets as separate interfaces, and the README states the goal is a common modular framework that improves reproducibility across imaging domains. The trade is real. You accept the library's operator definitions and its solver interfaces in exchange for not writing them, and you inherit its release cadence and its dependency choices. If your work is one modality, one operator and one architecture, a smaller purpose-built repository may be less to learn. If you are comparing plug-and-play against unfolded methods against diffusion sampling on the same problem, the shared interfaces are the point.

Licence, maintenance and the cost of tracking a fast release train

DeepInverse is released under BSD-3-Clause, a permissive licence that allows commercial use and modification provided the copyright notice and licence text are retained. This is not legal advice; check the licence file and your own obligations. The maintenance picture from the supplied material is an active project: the default branch is main, the last push is dated 2026-09-10, and three releases shipped in roughly six months. The README names a MAINTAINERS file and points contributors to a contributing guide, and the project is described as community-driven. It also has a JOSS paper, cited as Tachella et al., 2025, which gives you something stable to cite even as the API moves. The upgrade cost is the part worth budgeting for. Semantic versioning at the 0.x level means minor releases can change behaviour, so a pinned version in a requirements file is the difference between a reproducible experiment and a moving target. The nightly install path documented in the README is convenient for tracking fixes and unsuitable as the basis of a result you intend to publish without recording the exact commit.

Who should install DeepInverse, and what to check first

Install it if you are doing research on inverse problems in imaging and your modality appears in the operator list, or if you want to compare plug-and-play, optimization, unfolded and diffusion-based reconstruction without writing four separate codebases. The five minute quickstart and the examples index are the right entry points, and the JOSS paper is the right citation. Do not install it expecting a production inference server or a stable long-term API, and do not install it if your forward model is bespoke enough that you would be writing the operator yourself anyway, since that removes most of the benefit. The first thing to verify is concrete: open the physics documentation, find the operator that matches your acquisition, and check whether its assumptions match your measurement process. The second is to check the pretrained-models page for a checkpoint that matches your operator and noise level before planning around out-of-the-box reconstruction. If neither check passes, DeepInverse is still usable as a source of solvers and losses, but you will be supplying the physics, and that changes the cost calculation.

Editorial conclusion

Adopt DeepInverse if your reconstruction problem maps onto one of its predefined imaging operators and you want plug-and-play, unfolded or diffusion-based reconstruction in a single PyTorch interface. Do not adopt it if your forward model is bespoke and non-differentiable, or if you need a frozen, version-pinned pipeline for clinical or production inference, because the README describes the project as under active development and the nightly install path uses a git URL. Before committing, verify on your own data that the operator matching your modality reproduces your acquisition physics, and check the pretrained-model page for whether a checkpoint exists for your operator rather than assuming one does.

Official sources

  1. deepinv/deepinv on GitHub
  2. License: BSD-3-Clause
  3. Project website
  4. README
  5. Releases
Community notes

Community notes