Table of Contents
Fetching ...

SparseFocus: Learning-based One-shot Autofocus for Microscopy with Sparse Content

Yongping Zhai, Xiaoxi Fu, Qiang Su, Jia Hu, Yake Zhang, Yunfeng Zhou, Chaofan Zhang, Xiao Li, Wenxin Wang, Dongdong Wu, Shen Yan

TL;DR

SparseFocus tackles the problem of one-shot autofocus failing on sparse content by introducing a two-stage network: Region Importance Network identifies informative image patches and Defocus Prediction Network estimates the defocus distance $d$ from those patches. A large-scale dataset with millions of labeled defocused images under dense, sparse, and extremely sparse conditions supports training and evaluation, with a median-pooling step to obtain the final defocus estimate. The approach yields lower MAE, higher DoF-Accuracy, and DSS above $99\%$ across scenarios, and is integrated into a Whole Slide Imaging system, demonstrating practical impact for high-throughput microscopy. This work advances autofocus robustness in real-world microscopy by leveraging content-aware patch selection and regional defocus estimation, enabling reliable one-shot focusing in diverse content regimes.$

Abstract

Autofocus is necessary for high-throughput and real-time scanning in microscopic imaging. Traditional methods rely on complex hardware or iterative hill-climbing algorithms. Recent learning-based approaches have demonstrated remarkable efficacy in a one-shot setting, avoiding hardware modifications or iterative mechanical lens adjustments. However, in this paper, we highlight a significant challenge that the richness of image content can significantly affect autofocus performance. When the image content is sparse, previous autofocus methods, whether traditional climbing-hill or learning-based, tend to fail. To tackle this, we propose a content-importance-based solution, named SparseFocus, featuring a novel two-stage pipeline. The first stage measures the importance of regions within the image, while the second stage calculates the defocus distance from selected important regions. To validate our approach and benefit the research community, we collect a large-scale dataset comprising millions of labelled defocused images, encompassing both dense, sparse and extremely sparse scenarios. Experimental results show that SparseFocus surpasses existing methods, effectively handling all levels of content sparsity. Moreover, we integrate SparseFocus into our Whole Slide Imaging (WSI) system that performs well in real-world applications. The code and dataset will be made available upon the publication of this paper.

SparseFocus: Learning-based One-shot Autofocus for Microscopy with Sparse Content

TL;DR

SparseFocus tackles the problem of one-shot autofocus failing on sparse content by introducing a two-stage network: Region Importance Network identifies informative image patches and Defocus Prediction Network estimates the defocus distance from those patches. A large-scale dataset with millions of labeled defocused images under dense, sparse, and extremely sparse conditions supports training and evaluation, with a median-pooling step to obtain the final defocus estimate. The approach yields lower MAE, higher DoF-Accuracy, and DSS above across scenarios, and is integrated into a Whole Slide Imaging system, demonstrating practical impact for high-throughput microscopy. This work advances autofocus robustness in real-world microscopy by leveraging content-aware patch selection and regional defocus estimation, enabling reliable one-shot focusing in diverse content regimes.$

Abstract

Autofocus is necessary for high-throughput and real-time scanning in microscopic imaging. Traditional methods rely on complex hardware or iterative hill-climbing algorithms. Recent learning-based approaches have demonstrated remarkable efficacy in a one-shot setting, avoiding hardware modifications or iterative mechanical lens adjustments. However, in this paper, we highlight a significant challenge that the richness of image content can significantly affect autofocus performance. When the image content is sparse, previous autofocus methods, whether traditional climbing-hill or learning-based, tend to fail. To tackle this, we propose a content-importance-based solution, named SparseFocus, featuring a novel two-stage pipeline. The first stage measures the importance of regions within the image, while the second stage calculates the defocus distance from selected important regions. To validate our approach and benefit the research community, we collect a large-scale dataset comprising millions of labelled defocused images, encompassing both dense, sparse and extremely sparse scenarios. Experimental results show that SparseFocus surpasses existing methods, effectively handling all levels of content sparsity. Moreover, we integrate SparseFocus into our Whole Slide Imaging (WSI) system that performs well in real-world applications. The code and dataset will be made available upon the publication of this paper.

Paper Structure

This paper contains 15 sections, 7 equations, 7 figures, 3 tables.

Figures (7)

  • Figure 1: The sparsity challenge in microscopy autofocus. (a) One-shot methods employ neural networks to predict focus distance directly, thus bypassing the iterative adjustments required by traditional hill-climbing techniques. (b) illustrates the sharpness curves for both dense and sparse content scenarios. It is evident that the sharpness curve exhibits significant variations in dense content, whereas the changes are less pronounced in sparse content. (c) presents images of typical pathological slides, with the upper section showing WSI thumbnails. We display both the cases of dense content and sparse content therein.The first three images are dense content, while the latter three are sparse. To facilitate observation, we enlarge one of the sparse samples and randomly select three representative fields of view, each containing only a few cells. (d) This observation raises a critical question: can autofocus be effectively achieved in sparse-content scenarios?
  • Figure 2: Comparing with baselines using regression plots. The regression plots show the results, with the horizontal axis representing the ground-truth values and the vertical axis indicating the predicted results. In (a), we mark the upper and lower boundaries of the DoF with lines to illustrate the distribution of results within this range. An ideal zero-error line is included for reference, indicating that the closer a point is to this line, the smaller the error and the better the outcome. Points within the depth of field represent accurate predictions, whereas those outside indicate significant errors. Incorrect predictions are located in the opposite quadrant. In (b), we compare with baselines using such regression plots with different content sparsity.
  • Figure 3: Comparing with baselines using MAE histogram. The histogram illustrates the MAE performance of our method compared to baseline approaches across various defocus distance for both cell and tissue samples.
  • Figure 4: The asymmetry of PSF. (a) and (b) illustrate the PSF of a microscopy imaging system, highlighting its asymmetry with respect to the focal plane. (c) demonstrates the defocused imaging relative to the focal plane, and (d) presents the comparison of the gray values of pixels at the same positions corresponding to 5µm and -5µm. Both of them provide corroborative evidence for the disparities in images at the corresponding locations.
  • Figure 5: Framework of the SparseFocus Network. (a) is the overview of our method (SparseFocus), (b) shows the structures of the Region Importance Network (RIN) and the Defocus Prediction Network (DPN).
  • ...and 2 more figures