Performance evaluation. (a) Performance comparison between Deep Neural Network (DNN), and traditional autofocus measures across 420 test cases. While only 2 defocused images are provided to the DNN, the traditional autofocus methods receive as an input 13 images. In both cases, the spacing between two consecutive images is 6 µm. On a single image patch with a size of ∼83 × 83 µm2 the DNN outperforms traditional autofocus measures, while on larger image patches (250 × 250 µm2) the DNN and DCTS achieve comparable results. Please note that for the larger image patch the DNN performs its calculation on nine (83 × 83 µm2) patches, and results with certainty (cert) above 0.35 are averaged to achieve the final prediction. (b) Representative examples of defocus level prediction by the DNN on the test dataset (single patch). Each box shows an individual and independent image patch, and the color of the border indicates the value. If the certainty of an image patch is lower than 0.35, the colored border is deleted, and this patch is discarded.