Technology


Technology Image

NanoPyx


GitHub:
- HenriquesLab/NanoPyx
- HenriquesLab/napari-NanoPyx

Publication: Saraiva et al. Nature Methods 2025
- 4

Introduction

NanoPyx is an adaptive bioimage analysis framework designed to accelerate the processing of large and complex microscopy datasets. At its core is the Liquid Engine, an agent-based machine learning system that dynamically optimizes image analysis by predicting the best implementation strategies.

Moving Beyond Traditional Frameworks

NanoPyx innovates by moving beyond traditional frameworks that rely on single algorithms or implementations. The Liquid Engine generates multiple variations of code using different parallelization approaches, including:

  • Multi-threading with OpenMP
  • GPU acceleration with OpenCL
  • Just-in-time compilation with Numba

This creates a competitive environment where different versions of the algorithms race against each other, with the Liquid Engine selecting the fastest one moment-to-moment based on factors like available hardware and properties of the input data.

Liquid Engine Components

The Liquid Engine features three main components:

  1. Meta-programming tools: Automatically generate optimized CPU and GPU implementations from code snippets, avoiding tedious manual coding of parallelized versions.

  2. Automatic benchmarking system: Profiles and records execution times for each implementation across diverse hardware configurations and input data, logging runtime metrics locally to train models.

  3. Supervisor agent: Uses benchmarking data to choose the best combination of implementations to maximize speed, employing machine learning approaches to detect delays and probabilistically select alternatives.

Accelerating Super-Resolution Microscopy Analysis

NanoPyx accelerates key super-resolution microscopy analysis steps, including:

  • Drift correction
  • Channel registration
  • Reconstruction algorithms
  • Resolution assessment

It builds on ImageJ plugins like NanoJ-SRRF and NanoJ-SQUIRREL but brings them into an optimized Python ecosystem.

Accessibility and Interfaces

To ensure accessibility, NanoPyx offers three interfaces:

  1. Python library for developers
  2. Jupyter notebooks with graphical widgets for non-coders
  3. Napari plugin for an interactive experience

Continuous Auto-Tuning

The Liquid Engine agent continually monitors execution times and detects delays. If a chosen implementation suddenly slows down due to factors like hardware hiccups, the agent adjusts by probabilistically switching methods for optimum speed. This auto-tuning allows NanoPyx to learn patterns over time.

Performance and Future Development

In initial testing, NanoPyx delivered a 10x speedup for tasks like super-resolution reconstruction. The adaptability of the Liquid Engine is key, as the optimal implementation varies across users' devices. NanoPyx runs tests to select the ideal approach for each platform. Ongoing development will focus on supporting emerging techniques like AI-assisted imaging.

Final overview

NanoPyx introduces an innovative design that departs from traditional bioimage analysis frameworks. By dynamically optimizing parallelization strategies tailored to users' environments, it accelerates critical processing workflows for microscopy. The Liquid Engine enables continuous auto-tuning to maximize speeds as data scales expand. With accessibility via multiple interfaces, NanoPyx makes state-of-the-art analysis methods readily usable by the research community.


Publications featuring NanoPyx

Expansion and fluctuations-enhanced microscopy for nanoscale molecular profiling of cells and tissues
Dominik Kylies, Hannah S. Heil, Arturo G. Vesga, Mario Del Rosario, Maria Schwerk, Malte Kuehl, Milagros N. Wong, Victor G. Puelles, Ricardo Henriques
Paper published in Nature Protocols, July 2025
Technologies: NanoJ (), NanoJ-eSRRF (), NanoJ-SQUIRREL (), NanoJ-SRRF (), NanoPyx () and Nuclear-Pores as references
Funded by: CZI, EMBO, ERC, FCT, H2021 and H2022
DOI: 10.1038/s41596-025-01178-0
ReScale4DL - Balancing Pixel and Contextual Information for Enhanced Bioimage Segmentation
Mariana G. Ferreira, Bruno M. Saraiva, António D. Brito, Mariana G. Pinho, Ricardo Henriques, Estibaliz Gómez-de-Mariscal
Preprint published in bioRxiv, April 2025
Technologies: BioImage Model Zoo (), DeepBacs (), DL4MicEverywhere (), NanoPyx (), Rescale4DL () and ZeroCostDL4Mic ()
Funded by: CZI, EMBO, ERC, H2021 and H2022
DOI: 10.1101/2025.04.09.647871
Efficiently accelerated bioimage analysis with NanoPyx, a Liquid Engine-powered Python framework
Bruno M. Saraiva, Inês Cunha, António D. Brito, Gautier Follain, Raquel Portela, Robert Haase, Pedro M. Pereira, Guillaume Jacquemet, Ricardo Henriques
Paper published in Nature Methods, January 2025
Technologies: Fast4DReg (), NanoJ (), NanoJ-eSRRF (), NanoJ-SQUIRREL () and NanoPyx ()
Funded by: CZI, EMBO, ERC, FCT, H2021 and H2022
News: Tempo.pt, Nouvelles du monde and RTP
DOI: 10.1038/s41592-024-02562-6

Funding contributing to NanoPyx

3D Nanoscope - a highly accessible, high-performance device for live cell nanoscopy
Arturo G. Vesga
Alias: 3DNanoScope4All
Funded by: Marie Curie - HORIZON TMA MSCA Postdoctoral Fellowships
Duration: March 2024 - February 2026
Cutting-edge super-resolution image analysis in napari through NanoJ
Bruno Saraiva, Ricardo Henriques
Funded by: CZI - Applications - napari Plugin Foundations grants
Duration: January 2023 - December 2023
Publications: 4