# Convolutional Neural Network (CNN) vs Vision Transformer (ViT) for Digital Holography

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

## Key facts

- Cited by 8 papers in the map (data through 14 Oct 2026).
- Builds on 5 of its 16 references that are in the map.
- First posted on arXiv 20 Aug 2021.

## Builds on (most cited first, 5 of 5)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https://mlsanity.com/paper/2010.11929/) (2020)
- [Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization](https://mlsanity.com/paper/1610.02391/) (2016)
- [Densely Connected Convolutional Networks](https://mlsanity.com/paper/1608.06993/) (2016)
- [Convolutional neural network-based regression for depth prediction in digital holography](https://mlsanity.com/paper/1802.00664/) (2018)

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

- [On the use of deep learning for phase recovery](https://mlsanity.com/paper/2308.00942/) (2023)
- [Fast Autofocusing using Tiny Transformer Networks for Digital Holographic Microscopy](https://mlsanity.com/paper/2203.07772/) (2022)
- [Computer Vision for Transit Travel Time Prediction: An End-to-End Framework Using Roadside Urban Imagery](https://mlsanity.com/paper/2211.12322/) (2022)
- [If At First You Don't Succeed: Test Time Re-ranking for Zero-shot, Cross-domain Retrieval](https://mlsanity.com/paper/2303.17703/) (2023)
- [Image-Based Vehicle Classification by Synergizing Features from Supervised and Self-Supervised Learning Paradigms](https://mlsanity.com/paper/2302.00648/) (2023)
- [RetSeg: Retention-based Colorectal Polyps Segmentation Network](https://mlsanity.com/paper/2310.05446/) (2023)
- [Security Fence Inspection at Airports Using Object Detection](https://mlsanity.com/paper/2311.12064/) (2023)
- [Enhancing Digital Hologram Reconstruction Using Reverse-Attention Loss for Untrained Physics-Driven Deep Learning Models with Uncertain Distance](https://mlsanity.com/paper/2403.12056/) (2024)

## Abstract (arXiv)

In Digital Holography (DH), it is crucial to extract the object distance from a hologram in order to reconstruct its amplitude and phase. This step is called auto-focusing and it is conventionally solved by first reconstructing a stack of images and then by sharpening each reconstructed image using a focus metric such as entropy or variance. The distance corresponding to the sharpest image is considered the focal position. This approach, while effective, is computationally demanding and time-consuming. In this paper, the determination of the distance is performed by Deep Learning (DL). Two deep learning (DL) architectures are compared: Convolutional Neural Network (CNN) and Vision Transformer (ViT). ViT and CNN are used to cope with the problem of auto-focusing as a classification problem. Compared to a first attempt [11] in which the distance between two consecutive classes was 100μm, our proposal allows us to drastically reduce this distance to 1μm. Moreover, ViT reaches similar accuracy and is more robust than CNN.
