# Learning to Autofocus

arXiv: https://arxiv.org/abs/2004.12260 · HTML: https://mlsanity.com/paper/2004.12260/

## Key facts

- Cited by 26 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 26 Apr 2020.

## Built on by (most cited first, 26 of 26)

- [Defocus Map Estimation and Deblurring from a Single Dual-Pixel Image](https://mlsanity.com/paper/2110.05655/) (2021)
- [Bridging Unsupervised and Supervised Depth from Focus via All-in-Focus Supervision](https://mlsanity.com/paper/2108.10843/) (2021)
- [DC2: Dual-Camera Defocus Control by Learning to Refocus](https://mlsanity.com/paper/2304.03285/) (2023)
- [Rawformer: Unpaired Raw-to-Raw Translation for Learnable Camera ISPs](https://mlsanity.com/paper/2404.10700/) (2024)
- [Learning Depth from Focus in the Wild](https://mlsanity.com/paper/2207.09658/) (2022)
- [Defocus to focus: Photo-realistic bokeh rendering by fusing defocus and radiance priors](https://mlsanity.com/paper/2306.04506/) (2023)
- [Trustworthy Multimodal Fusion for Sentiment Analysis in Ordinal Sentiment Space](https://mlsanity.com/paper/2404.08923/) (2024)
- [Deep Depth from Focal Stack with Defocus Model for Camera-Setting Invariance](https://mlsanity.com/paper/2202.13055/) (2022)
- [Autofocus for Event Cameras](https://mlsanity.com/paper/2203.12321/) (2022)
- [Learning Single Image Defocus Deblurring with Misaligned Training Pairs](https://mlsanity.com/paper/2211.14502/) (2022)
- [Learning Lens Blur Fields](https://mlsanity.com/paper/2310.11535/) (2023)
- [Learning Dual-Pixel Alignment for Defocus Deblurring](https://mlsanity.com/paper/2204.12105/) (2022)
- [Continuous Cost Aggregation for Dual-Pixel Disparity Extraction](https://mlsanity.com/paper/2306.07921/) (2023)
- [DepthFocus: Controllable Depth Estimation for See-Through Scenes](https://mlsanity.com/paper/2511.16993/) (2025)
- [DMTNet: Dynamic Multi-scale Network for Dual-pixel Images Defocus Deblurring with Transformer](https://mlsanity.com/paper/2209.06040/) (2022)
- [BaMBNet: A Blur-aware Multi-branch Network for Defocus Deblurring](https://mlsanity.com/paper/2105.14766/) (2021)
- [DASHA: Decentralized Autofocusing System with Hierarchical Agents](https://mlsanity.com/paper/2108.12842/) (2021)
- [Experts-Guided Unbalanced Optimal Transport for ISP Learning from Unpaired and/or Paired Data](https://mlsanity.com/paper/2512.05635/) (2025)
- [Learning to Refocus with Video Diffusion Models](https://mlsanity.com/paper/2512.19823/) (2025)
- [Deep Reinforcement Learning Based System for Intraoperative Hyperspectral Video Autofocusing](https://mlsanity.com/paper/2307.11638/) (2023)
- [Optimal Sample Lens Positioning in Digital Camera Systems](https://mlsanity.com/paper/2407.01789/) (2024)
- [Revisiting Disparity from Dual-Pixel Images: Physics-Informed Lightweight Depth Estimation](https://mlsanity.com/paper/2411.04714/) (2024)
- [EAP4EMSIG -- Enhancing Event-Driven Microscopy for Microfluidic Single-Cell Analysis](https://mlsanity.com/paper/2504.00047/) (2025)
- [DeepAf: One-Shot Spatiospectral Auto-Focus Model for Digital Pathology](https://mlsanity.com/paper/2510.05315/) (2025)
- [DANCE: Dynamic 3D CNN Pruning: Joint Frame, Channel, and Feature Adaptation for Energy Efficiency on the Edge](https://mlsanity.com/paper/2603.17275/) (2026)
- [DP-SfM: Dual-Pixel Structure-from-Motion without Scale Ambiguity](https://mlsanity.com/paper/2605.01852/) (2026)

## Abstract (arXiv)

Autofocus is an important task for digital cameras, yet current approaches often exhibit poor performance. We propose a learning-based approach to this problem, and provide a realistic dataset of sufficient size for effective learning. Our dataset is labeled with per-pixel depths obtained from multi-view stereo, following "Learning single camera depth estimation using dual-pixels". Using this dataset, we apply modern deep classification models and an ordinal regression loss to obtain an efficient learning-based autofocus technique. We demonstrate that our approach provides a significant improvement compared with previous learned and non-learned methods: our model reduces the mean absolute error by a factor of 3.6 over the best comparable baseline algorithm. Our dataset and code are publicly available.
