TLDR: DeepAf is a new auto-focus system for digital pathology that uses a single image and combines spatial and spectral features to quickly and accurately find the optimal focus. It transforms conventional microscopes into efficient slide scanners, reducing focusing time by 80% and achieving high diagnostic accuracy in cancer classification, making digital pathology more accessible in resource-constrained settings.
Digital pathology is transforming how diseases are detected and classified, but the high cost of advanced Whole Slide Imaging (WSI) scanners often limits access in many healthcare settings. Traditional automated microscopes struggle with consistent focus, while existing auto-focus methods are either too slow, requiring multiple images, or lack the ability to adapt to different tissue types and staining methods.
Addressing these challenges, researchers have introduced DeepAf, a novel auto-focus framework designed to make digital pathology more accessible and efficient. This system uniquely combines spatial and spectral features from a single input image to predict the optimal focal point, effectively turning conventional microscopes into high-performance slide scanners.
How DeepAf Works
DeepAf operates on a simple yet powerful principle: it analyzes a single out-of-focus image to determine the precise distance to the optimal focal plane. This is possible because defocusing creates distinct patterns in the frequency domain of an image, which correlate directly with the defocus distance. The system uses a hybrid architecture, inspired by the Y-Net, which simultaneously learns features from both the spatial (visual patterns) and frequency (spectral) domains. This dual-encoder approach allows DeepAf to generalize effectively across various tissue types and staining protocols, a significant improvement over previous methods.
The automated microscopic system built around DeepAf includes a conventional manual microscope, a motorized stage with three stepper motors for precise x-y slide positioning and z-direction focus adjustment, a dual-mode camera for both low-resolution tissue detection and high-resolution image capture, and a Raspberry Pi control system to coordinate all movements and image acquisition based on DeepAf’s predictions.
The digitization process involves four stages: slide scanning, initial tissue detection using low-resolution images, single-shot auto-focus prediction by DeepAf, and finally, high-resolution image capture at the predicted optimal focal position.
Key Advantages and Performance
DeepAf offers several significant advantages:
- Speed: It reduces focusing time by 80% compared to traditional stack-based methods, which require capturing multiple images at different focal depths.
- Efficiency: It achieves focus accuracy of 0.18µm on same-lab samples, matching the performance of methods that require two input images, but with half the input requirements.
- Generalization: The spatiospectral approach demonstrates robust cross-lab generalization, with only 0.72% false focus predictions and 90% of predictions falling within the depth of field. This means the system can perform reliably even with samples prepared under different protocols.
- Accessibility: By transforming conventional microscopes, DeepAf enables accessible, real-time digital pathology in resource-constrained settings.
Also Read:
- Advancing Oral Cancer Detection with a Multi-Modal AI Approach
- Advancing Mammogram View Translation with Anatomically Aware Diffusion Models
Clinical Validation
To validate its real-world utility, the DeepAf system was used in an extensive clinical study involving 536 brain tissue samples from Brigham and Women’s Hospital in Boston. The system scanned these samples at 4× magnification, a lower magnification than typical 20× WSI scans, resulting in faster scanning times (approximately 400 seconds per slide).
The images captured by DeepAf were then used to train a binary classifier for brain cancer, distinguishing between high/low-grade glioma (cancer) and inflammatory/normal tissue. This classifier achieved an impressive 0.90 AUC (Area Under the Curve) score, demonstrating that the high-quality images produced by the DeepAf system are highly relevant and valid for automated cancer diagnosis in a clinical setting, even at lower magnifications.
This research, detailed in the paper DeepAf: One-Shot Spatiospectral Auto-Focus Model for Digital Pathology, marks a significant step towards democratizing high-precision diagnosis, making advanced pathology tools available to a wider range of healthcare providers globally.


