Skip to main content
QUICK REVIEW

[Paper Review] Fast Autofocusing using Tiny Transformer Networks for Digital Holographic Microscopy

Stéphane Cuenat, Louis Andréoli|arXiv (Cornell University)|Mar 15, 2022
Digital Holography and MicroscopyPhysics and Astronomy52 references24 citations
TL;DR

This paper proposes a fast, accurate autofocusing method for digital holographic microscopy using tiny Vision Transformer (TViT), tiny VGG16 (TVGG), and tiny Swin-Transformer (TSwinT) networks to predict the optimal reconstruction distance from single holograms. Trained as a regression problem, the TViT model achieves sub-micron accuracy (1.2 µm mean error on real data, <0.3 µm on simulated data) with inference times under 25 ms on CPU, enabling real-time 3D position sensing without mechanical z-scanning.

ABSTRACT

The numerical wavefront backpropagation principle of digital holography confers unique extended focus capabilities, without mechanical displacements along z-axis. However, the determination of the correct focusing distance is a non-trivial and time consuming issue. A deep learning (DL) solution is proposed to cast the autofocusing as a regression problem and tested over both experimental and simulated holograms. Single wavelength digital holograms were recorded by a Digital Holographic Microscope (DHM) with a 10$\mathrm{x}$ microscope objective from a patterned target moving in 3D over an axial range of 92 $\mu$m. Tiny DL models are proposed and compared such as a tiny Vision Transformer (TViT), tiny VGG16 (TVGG) and a tiny Swin-Transfomer (TSwinT). The proposed tiny networks are compared with their original versions (ViT/B16, VGG16 and Swin-Transformer Tiny) and the main neural networks used in digital holography such as LeNet and AlexNet. The experiments show that the predicted focusing distance $Z_R^{\mathrm{Pred}}$ is accurately inferred with an accuracy of 1.2 $\mu$m in average in comparison with the DHM depth of field of 15 $\mu$m. Numerical simulations show that all tiny models give the $Z_R^{\mathrm{Pred}}$ with an error below 0.3 $\mu$m. Such a prospect would significantly improve the current capabilities of computer vision position sensing in applications such as 3D microscopy for life sciences or micro-robotics. Moreover, all models reach an inference time on CPU, inferior to 25 ms per inference. In terms of occlusions, TViT based on its Transformer architecture is the most robust.

Motivation & Objective

  • To address the challenge of slow, mechanical z-axis focusing in digital holographic microscopy (DHM) by replacing physical scanning with deep learning-based autofocusing.
  • To enable real-time, contactless 3D position sensing in micro-robotics and life sciences with high axial accuracy.
  • To evaluate the performance of tiny deep learning models—specifically TViT, TVGG, and TSwinT—on experimental and simulated holograms for autofocusing.
  • To demonstrate that Transformer-based architectures outperform traditional CNNs like AlexNet and LeNet in robustness to occlusions and inference speed.
  • To achieve high-accuracy depth prediction compatible with real-time applications using low-resource CPU inference.

Proposed method

  • The autofocusing task is formulated as a regression problem: predicting the optimal reconstruction distance Z from a single hologram.
  • Tiny versions of Vision Transformer (TViT), VGG16 (TVGG), and Swin-Transformer (TSwinT) are developed and trained on experimental and simulated holograms.
  • Holograms are recorded using a 10x objective over a 92 µm axial range with a patterned target, and regions of interest (ROIs) are extracted for training.
  • The models are trained to regress the true focusing distance, with loss minimized using mean squared error (MSE) during optimization.
  • Inference is performed on CPU using Intel i9-11900K, achieving sub-25 ms latency per prediction, suitable for real-time robotics and microscopy.
  • Robustness is evaluated under occlusion by masking parts of the hologram, comparing attention-based (ViT) and convolution-based (CNN) architectures.

Experimental results

Research questions

  • RQ1Can tiny Transformer-based networks like TViT achieve high-accuracy autofocusing in digital holographic microscopy with minimal computational cost?
  • RQ2How does the performance of TViT compare to CNN-based models (e.g., TVGG, AlexNet) in terms of accuracy and robustness under occlusion?
  • RQ3What is the inference speed of tiny models on CPU, and can they meet real-time requirements (e.g., 20 Hz) for robotics and live microscopy?
  • RQ4Does training on simulated holograms yield better accuracy than on experimental data, and what accounts for the performance gap?
  • RQ5Can the proposed method surpass the depth of focus (DoF) of the microscope objective by an order of magnitude?

Key findings

  • The TViT model achieves a mean prediction error of 1.2 µm on experimental holograms over a 92 µm axial range, significantly surpassing the microscope’s 15 µm depth of focus.
  • On simulated holograms (pseudo-periodic and USAF patterns), all tiny models achieve a prediction error below 0.3 µm, indicating high generalization potential.
  • The TViT model demonstrates superior robustness to occlusion due to its global self-attention mechanism, which processes the entire hologram uniformly, unlike CNNs that focus on local features.
  • All proposed tiny models achieve inference times below 25 ms on a CPU (Intel i9-11900K), enabling real-time operation at 40 Hz, well above the 20 Hz threshold for robotics applications.
  • The TViT model outperforms both TVGG and TSwinT in occlusion scenarios, suggesting that full-attention mechanisms are more resilient than windowed self-attention in coherent imaging.
  • Despite being trained from scratch on a dataset of 2.3 million ROIs, the TViT model generalizes well, indicating that the diffraction-based spread of depth information across the hologram supports effective pretraining-free learning.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.