DeepBlur

Blind deblurring and PSF metrology with neural networks, for microscopy

  • Pierre Weiss, Florian Sarron, Minh-Hai NGUYEN

License BSD-3 PyPI Python Version napari hub npe2

DeepBlur estimates the blur of an image with neural networks, without calibration, and deblurs the image. The blur (point spread function, PSF) may vary across the field of view, as in most microscopes. From the estimated PSFs, the plugin also measures the quality of the optics: maps of the EE50, of the FWHM and of the cut-off frequency.

Usage

Open the plugin with Plugins > DeepBlur > DeepBlur, or with napari -w deepblur_napari.

You can drag&drop images, then open the plugin to treat them. An alternative is to just launch the plugin and demo images will be displayed. You can still add yours by drag&drop. The Help button of the plugin explains the main features.

The main processing pipeline is:

  • 1/ add your image
  • 2/ estimate the operator
  • 3/ estimate the noise
  • 4/ deblur
  1. Images: DeepBlur processes 2D grayscale and RGB images. Each image added to napari joins the Active Image menu.
  2. Identification model: the network that estimates the PSF. Use z3_z36 for microscopes and optical blurs, motion or motion_x_z3_z16 for motion blurs.
  3. Operator estimation: Estimate Operator builds the blur operator of the image from the PSFs estimated on overlapping tiles. It uses a single PSF (constant), PSFs interpolated through eigen-PSFs (eigen_psf), or PSFs blended between the tiles (tiled_psf).
  4. Noise: set the Gaussian noise and the bit depth, which sets the Poisson noise, or estimate them with Estimate noise.
  5. Deblurring: Deblur Image with Tikhonov, TV, DPIR or RAM (usually the best).

Metrology: Grid and clicks on the image display the estimated PSFs. EE50 Map, FWHM Map and Cut-off Map map the radius containing 50% of the energy of the PSF, its full width at half maximum, and the cut-off frequency of the optics.

Computations run in the background. The first use of a network downloads its weights.

Installation

DeepBlur needs Python 3.10 to 3.13 (PyTorch has no wheels for Intel Macs). It runs on CPU and, much faster, on NVIDIA GPUs.

In an environment that has napari, install it from napari's plugin manager (Plugins > Install/Uninstall Plugins), or with

pip install deepblur-napari

In a new environment, pip install "deepblur-napari[all]" also installs napari with its Qt backend.

On Linux, the PyTorch wheels of PyPI use CUDA. To get a CPU-only PyTorch, or one for another CUDA version, install it first by following https://pytorch.org/get-started/locally/, then install the plugin.

From the sources

uv creates the environment .venv with the versions locked in uv.lock:

git clone https://github.com/pierre-weiss/deepblur-napari.git
cd deepblur-napari
uv sync --extra all      # add --extra testing for the test tools
uv run napari -w deepblur_napari

uv run python debug.py opens the same window, e.g. to debug the plugin in an editor. With pip, run pip install -e ".[all]" in a new environment, or pip install -e . in an environment that has napari.

Weights

The networks download their weights on first use from the MAMBO server, or from the Hugging Face hub (mhnguyen712/deepblur) if the server is unreachable. They are cached in ~/.cache/deepblur/weights. You can change the server and the cache folder with the environment variables DEEPBLUR_WEIGHTS_URL and DEEPBLUR_CACHE.

Contributing

Contributions are very welcome. Run the tests with uv run pytest (after uv sync --extra all --extra testing) or with tox, and please ensure the coverage at least stays the same before you submit a pull request. The tests download the weights of the networks the first time.

To release, push a tag: git tag v0.1.0 && git push origin v0.1.0. The continuous integration runs the tests, builds the package from a clean checkout (the version comes from the tag) and publishes it on PyPI.

License

Distributed under the terms of the BSD-3 license, deepblur-napari is free and open source software.

Acknowledging this work

If you find this plugin useful for your research, please cite :

Blind spatially varying PSF estimation for fluorescence microscopy Minh Hai Nguyen, Florian Sarron, Paul Escande, Sylvain Cantaloube, Thomas Mangeat and Pierre Weiss

The main contributors to this plugin are

Minh Hai Nguyen, Florian Sarron, Paul Escande, Pierre Weiss

Issues

If you encounter any problems, please file an issue along with a detailed description.

Version:

  • 0.1.0

Last updated:

  • 2026-11-18

First released:

  • 2026-11-18

License:

  • BSD-3-Clause

Supported data:

  • Information not submitted

Plugin type:

Open extension:

Save extension:

Python versions supported:

3.10, 3.11, 3.12, 3.13

Operating system:

  • Information not submitted

Requirements:

  • numpy
  • magicgui
  • napari>=0.6
  • qtpy
  • deepinv>=0.5.0
  • torch>=2.7.0
  • torchvision>=0.22.0
  • pyyaml
  • imageio
  • huggingface_hub
  • napari[all]; extra == "all"
  • tox; extra == "testing"
  • pytest; extra == "testing"
  • pytest-cov; extra == "testing"
  • pytest-qt; extra == "testing"
  • napari[all]; extra == "testing"
Website by the napari team, original design by CZI.