Technology


Technology Image

NanoPyx


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

Publication: Saraiva et al. bioRxiv 2023
- 2

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

High-fidelity 3D live-cell nanoscopy through data-driven enhanced super-resolution radial fluctuation
Romain F. Laine, Hannah S. Heil, Simao Coelho, Jonathon Nixon-Abell, Angélique Jimenez, Theresa Wiesner, Damián Martínez, Tommaso Galgani, Louise Régnier, Aki Stubb, Gautier Follain, Samantha Webster, Jesse Goyette, Aurelien Dauphin, Audrey Salles, Siân Culley, Guillaume Jacquemet, Bassam Hajj, Christophe Leterrier, Ricardo Henriques
Paper published in Nature Methods, November 2023
Technologies: CARE, NanoJ, NanoJ-eSRRF, NanoJ-SQUIRREL, NanoJ-SRRF, NanoPyx and Nuclear-Pores as references
Funded by: CZI, EMBO, ERC, FCT, H2021, H2022, InnOValley and Wellcome Trust
News: Photonics.com, The Science Times, Optics.org and Phys.org
Blogs: Springer Nature Protocols and Methods Community
DOI: 10.1038/s41592-023-02057-w
NanoPyx - super-fast bioimage analysis powered by adaptive machine learning
Bruno M. Saraiva, Inês M. Cunha, António D. Brito, Gautier Follain, Raquel Portela, Robert Haase, Pedro M. Pereira, Guillaume Jacquemet, Ricardo Henriques
Preprint published in bioRxiv, August 2023
Technologies: CARE, NanoJ, NanoJ-eSRRF, NanoJ-SQUIRREL, NanoJ-SRRF, NanoJ-VirusMapper and NanoPyx
Funded by: CZI, EMBO, ERC, FCT, H2021 and H2022
DOI: 10.1101/2023.08.13.553080

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: 3