Enhancing digital hologram reconstruction using reverse-attention loss for untrained physics-driven deep learning models with uncertain distance

Xiwen Chen, Hao Wang, Zhao Zhang, Zhenmin Li, Huayu Li, Tong Ye, Abolfazl Razi

Abstract

Digital In-line Holography (DIH) faces a significant challenge in the "twin-image" problem, typically requiring precise knowledge of the object-to-sensor distance ($z$) for accurate reconstruction. This paper presents a novel reverse-attention loss mechanism for untrained, physics-driven deep learning models that enables high-quality reconstruction without prior knowledge of the exact distance. By employing a weighted sum of losses across multiple candidate distances, the model autonomously identifies the optimal distance during a single reconstruction pass. Experimental results demonstrate that this method achieves performance comparable to reconstructions with perfectly known distances while offering a five-fold speed improvement over traditional autofocusing techniques.

Introduction

In Digital In-line Holography (DIH), a 2D interference pattern, or hologram, is captured and used to reconstruct a 3D image of microscopic objects. A primary obstacle in this process is the twin-image problem, where out-of-focus artifacts obscure the reconstructed image. While untrained deep learning models—which do not require large labeled datasets—have shown promise in artifact removal, their effectiveness is highly sensitive to the object distance ($z$). Even minor deviations in $z$ can lead to failed reconstructions.

Traditionally, this "autofocusing" problem is solved through brute-force methods: reconstructing images at numerous candidate distances and selecting the sharpest result based on specific focus metrics. This approach is computationally intensive and slow. Supervised learning models can predict distance but require extensive annotated datasets, which are often unavailable in specialized microscopy. This paper addresses the need for an efficient, data-free method to handle distance uncertainty in DIH.

Methods

The proposed strategy integrates a reverse-attention loss into an untrained, physics-driven CNN model (based on the DeepDIH architecture). Unlike standard approaches that require a single precise distance, this method utilizes a set of candidate distances {$z_1, z_2, ..., z_n$}.

Comparison of reconstruction strategies: (a) One-time reconstruction with known distance, (b) Conventional multi-time autofocusing, and (c) The proposed one-time reconstruction with reverse-attention loss.

Reverse-Attention Loss

The core innovation is the reverse-attention loss ($\mathcal{L}_{ra}$). The model calculates a loss for every candidate distance simultaneously. Instead of treating these losses equally, it assigns a learnable weight to each distance based on the inverse of its loss. Distances that yield lower errors—indicating they are closer to the true object distance—receive higher weights.

To ensure stability during optimization, the authors employ gradient detaching, treating the weights as constants during the back-propagation step. This prevents the weights from exploding and ensures smooth convergence.

One-Time Reconstruction

By incorporating the distance search into the image reconstruction loop, the method performs a single optimization process. This allows the model to converge on both the correct distance and a clear, artifact-free image simultaneously, bypassing the need for generating and evaluating large image stacks.

Experimental Setup and Results

The method was evaluated using simulated holograms of three distinct samples: a 1951 USAF Resolution Target, a biological cell, and a dendrite tag. Holograms were simulated at a distance of $5000\mu m$, with the model provided a candidate range from $4500\mu m$ to $5500\mu m$ in $100\mu m$ increments.

Reconstruction results for the USAF target at different candidate distances. The image at the true distance ($z=5000$) is sharp, while others exhibit significant blurring and artifacts.

Performance and Efficiency

The proposed method demonstrated exceptional accuracy, outperforming alternative strategies like alternating descent by up to 15dB in Peak Signal-to-Noise Ratio (PSNR). The reconstructions were nearly indistinguishable from those where the distance was perfectly known, with differences of less than 1dB in PSNR and 0.002 in Structural Similarity Index (SSIM).

In terms of efficiency, the reverse-attention approach significantly reduced processing time. For a set of 11 candidate distances, the proposed method completed reconstruction in approximately 15 minutes, compared to 77 minutes for conventional autofocusing—a reduction of over 80%.

Discussion and Conclusion

The success of this method stems from the fact that the physics of light propagation acts as a natural supervisor. Because incorrect distances cannot physically generate a hologram that matches the captured data, the model's reverse-attention mechanism naturally gravitates toward the correct distance. The authors have mathematically demonstrated that this loss function shares the same optimal point and convergence rate as models with perfectly known distances.

While the method requires a predefined range of candidate distances and increases GPU memory load due to simultaneous loss calculations, it represents a significant step toward self-calibrating holographic microscopes. Future work may extend this reverse-attention logic to other uncertain parameters, such as illumination wavelength or sensor tilt angles.

Summary updated

Abstract

Untrained Physics-based Deep Learning (DL) methods for digital holography have gained significant attention due to their benefits, such as not requiring an annotated training dataset, and providing interpretability since utilizing the governing laws of hologram formation. However, they are sensitive to the hard-to-obtain precise object distance from the imaging plane, posing the Autofocusing challenge. Conventional solutions involve reconstructing image stacks for different potential distances and applying focus metrics to select the best results, which apparently is computationally inefficient. In contrast, recently developed DL-based methods treat it as a supervised task, which again needs annotated data and lacks generalizability. To address this issue, we propose reverse-attention loss, a weighted sum of losses for all possible candidates with learnable weights. This is a pioneering approach to addressing the Autofocusing challenge in untrained deep-learning methods. Both theoretical analysis and experiments demonstrate its superiority in efficiency and accuracy. Interestingly, our method presents a significant reconstruction performance over rival methods (i.e. alternating descent-like optimization, non-weighted loss integration, and random distance assignment) and even is almost equal to that achieved with a precisely known object distance. For example, the difference is less than 1dB in PSNR and 0.002 in SSIM for the target sample in our experiment.
BibTeX
@misc{chen2024enhancing,
  author = {Xiwen Chen and Hao Wang and Zhao Zhang and Zhenmin Li and Huayu Li and Tong Ye and Abolfazl Razi},
  title = {{Enhancing digital hologram reconstruction using reverse-attention loss for untrained physics-driven deep learning models with uncertain distance}},
  year = {2024},
  eprint = {2403.12056},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2403.12056},
}
Figure