Ultrafast and Robust Restoration of Neural Imaging Data with Linear Expansion of SubSpace Thresholding
Overview
LESS (Linear Expansion of SubSpace thresholding) is an ultrafast and robust denoising algorithm engineered specifically for neuron imaging. By leveraging noise statistics and the intrinsic low-rank structure of neural data, LESS effectively eliminates noise while strictly preserving neuronal morphology and activity patterns. Its unique combination of processing speed and high-fidelity restoration makes it the ideal choice for rapid prototyping and real-time analysis workflows.

⭐️ Key Features
- Extreme computational efficiency: achieve >1000-fold speed improvements compared to recent self-supervised denoising algorithms
- Superior restoration quality: validated on both simulated and real-world datasets across various challenging imaging conditions
- Theoretical reliability : clear mathematical principles, making the processing transparent and interpretable
- Broad accessibility: available as a comprehensive library (Python, MATLAB, and Java) and user-friendly plugins in napari and ImageJ
Algorithm Principle
(To be refined) The LESS framework leverages the intrinsic low-rank structure of neural imaging data to achieve efficient denoising. The algorithm operates through a three-stage process: subspace decomposition, component-wise denoising, and iterative reconstruction.
Subspace Decomposition
The raw fluorescence video data is first reshaped into a matrix , where denotes the total number of pixels (height times width ) and represents the number of frames. The method performs singular value decomposition (SVD) to decompose the observed data:
where:
- contains the spatial components (left singular vectors), each representing a spatial pattern across the field of view
- contains the singular values, quantifying the energy contribution of each component
- contains the temporal components (right singular vectors), each representing a temporal trace over the imaging duration
- is the rank of the decomposition
Component-wise Subspace Thresholding
The thresholding process operates independently on each spatiotemporal component pair :
1. Spatial Denoising (2D Processing): Each spatial component is reshaped into a 2D image and denoised using a patch-based approach:
- Block matching: For each reference patch, the algorithm finds the most similar patches within a local search window using normalized cross-correlation
- Linear expansion: Similar patches are grouped and denoised by solving a least-squares problem that estimates each patch as a linear combination of its neighbors
- Weighted aggregation: Denoised patches are aggregated back into the image grid using adaptive weights based on the linear expansion coefficients
2. Temporal Denoising (1D Processing): Each temporal component is denoised using an adaptive median filter:
- The algorithm searches for the optimal window size that minimizes reconstruction error
- For each time point, the denoised value is computed as the median of neighboring points within the optimal window
- This approach effectively removes temporal noise while preserving sharp transitions in calcium transients
Iterative Reconstruction with Early Stopping
The denoised components are accumulated iteratively to reconstruct the signal:
where and are the denoised spatial and temporal components, respectively. The algorithm employs an early stopping mechanism based on reconstruction loss:
- After processing each component, the reconstruction loss is computed
- If the loss increases for a specified number of consecutive components (patience parameter), the algorithm stops and returns the optimal reconstruction
- This adaptive approach automatically determines the optimal number of components to include, balancing noise reduction with signal preservation
The final denoised video is obtained by reshaping back to its original 3D format .
Code Implementation
The LESS algorithm has been implemented in multiple programming languages and environments.
Installation
pip install less-denoiseBasic Usage
from less import less_denoise
# Denoise with automatic parameter estimation
denoised = less_denoise(
data_input='data/demoMovie.tif', # Use demo file or your own data
save_path='denoised_output.tif',
estimate_params=True,
verbose=True
)Plugins
We have developed plugins for popular imaging platforms to make LESS easily accessible. Each plugin provides a user-friendly interface with GUI screenshots shown below:
Installation
pip install napari-lessUsage
- Open Napari
- Load your image layer or use the Browse button in the plugin.
- Go to
Plugins > LESS Denoise(or use the command palette). - Adjust parameters in the Advanced Options section.
- Click Run to start the denoising process.
- Use the Stop button if you need to cancel the operation.

- Note: To accelerate performance for large data, we have incorporated randomized SVD in the napari plugin.
Installation
- Download the
LESS_Denoising.jarplugin from the releases page - Download and install CLIJ2 (for GPU acceleration; use Fiji's built-in updater and search for CLIJ2, or download from the CLIJ website)
- Place
LESS_Denoising.jarin the ImageJ/Fijipluginsfolder - Restart ImageJ/Fiji
- Note: To accelerate performance for large data, we have incorporated randomized SVD in the ImageJ plugin.

Performance
LESS has been optimized for performance across different platforms, operating systems, and hardware configurations:
| Platform | Image Size | Processing Time | Hardware |
|---|---|---|---|
| Python (CPU) | 512×512×5000 | ~125s | Intel i7-9700K |
| Python (GPU) | 512×512×5000 | ~15s | NVIDIA RTX 3080 |
| Python (GPU×2) | 512×512×5000 | ~8s | 2× NVIDIA RTX 3080 |
| Python (GPU×4) | 512×512×5000 | ~5.5s | 3× NVIDIA RTX 3080 |
| Python (GPU×8) | 512×512×5000 | ~2.2s | 8× NVIDIA RTX 3080 |
| Python (CPU) | 1024×1024×10000 | ~45s | 8× NVIDIA RTX 3080 |
| Python (GPU) | 1024×1024×10000 | ~45s | 8× NVIDIA RTX 3080 |
| Python (GPU×8) | 1024×1024×10000 | ~45s | 8× NVIDIA RTX 3080 |
| MATLAB (CPU) | 512×512×10000 | ~150s | Intel i7-9700K |
| MATLAB (GPU) | 512×512×10000 | ~150s | Intel i7-9700K |
| MATLAB (Mac) | 512×512×10000 | ~150s | Intel i7-9700K |
| ImageJ/Fiji (CPU) | 512×512×5000 | ~200s | Intel i7-9700K |
| ImageJ/Fiji (GPU) | 512×512×5000 | ~200s | Intel i7-9700K |
GPU benchmarks require CUDA-capable devices. Performance may vary based on system configuration.
Examples
Here are video demonstrations showing the effectiveness of LESS denoising on various neuron imaging datasets. Click on any video to start playing.
📊 Two-Photon Calcium Imaging

Two-photon calcium imaging of cortical neurons with high noise level (SNR ~5 dB). Shows dramatic SNR improvement from 5 dB to 18 dB.
🔬 Dendritic Spine Imaging

Confocal microscopy of dendritic spines showing 3.2× contrast improvement and enhanced spine detection rate from 45% to 92%.
🎥 Live Axon Tracking

Time-lapse imaging of axonal growth cones with real-time tracking capability. Tracking accuracy improved from 78% to 95%.
⚡ Synaptic Puncta Detection

Super-resolution imaging of synaptic puncta with 81% increase in detection rate (32 to 58 puncta) and sub-pixel localization precision.
🌐 3D Neuron Reconstruction

3D confocal stack of neuronal morphology with 94.2% volume accuracy and 98% branch detection rate for primary branches.
Citation
If you use LESS in your research, please cite:
@article{less2026,
title={Ultrafast and Robust Restoration of Neural Imaging Data with Linear Expansion of SubSpace Thresholding},
author={Z. Yan, R. Chrapkiewicz, S. Haziza, B. Weng, K. Brown, C. Huang, T. Blu, J. Li, M. Schnitzer},
year={2026}
}Support
For questions, bug reports, or feature requests:
- GitHub Issues: https://github.com/TISGroup/LESS/issues
- Email: jzli@ee.cuhk.edu.hk (J. Li) and 1155226762@link.cuhk.edu.hk (Z. Yan)
License
LESS is released under the MIT License. See LICENSE file for details.