PtychoFM: A Foundation Model for Ptychographic Imaging
Authors: Aileen Luo, Emon Dey, Ming Du, Tao Zhou, Peco Myint, Himanshu Goel, Shashank Subramanian, Xiangyu Yin, Tekin Bicer, Siniša Veseli, Cheng-Chu Chung, Jeffrey A. Klug, Aldo Peña Pérez, Llorenç Fanals-i-Batllori, Christopher Kenney, Henry Shi, Lorenzo Rota, Angelo Dragone, Zirui Gao, Douglas A. Bennett, John A. B. Mates, Leila R. Vale, Michael R. Vissers, Yi Jiang, Junjing Deng, Tejas Guruswamy, Varuni K. Sastry, Bowen Zheng, Takenori Shimamura, Oliver Hoidn, Aashwin Mishra, Hannah Parraga, Brandon Stone, Jonathan Baldwin, Aaron Michelson, Michael Wojcik, Xiaoyin Zheng, Robert Underwood, Yijiang Li, Jinxing Jiang, Nicholas Schwarz, Apurva Mehta, Johanna Nelson Weker, Hassina Bilheux, Joel N. Ullom, Alexander Hexemer, Antonino Miceli, Kibaek Kim, Hanfei Yan, Mathew J. Cherukara, Alec R. Sandy, Stefan Vogt, Laurent C. Chapon
Ptychography provides high-resolution lensless imaging across X-ray, electron, and optical microscopy, but reconstructing images from diffraction measurements generally requires computationally intensity iterative phase retrieval. These methods often require experiment-specific analysis, limiting real-time feedback as data acquisition rates increase. Here, we demonstrate PtychoFM, a physics-aware foundation model for ptychographic imaging that combines large-scale pre-training with experiment-specific fine-tuning to reconstruct complex object images directly from individual diffraction patterns. Trained using a differentiable forward model without object-space labels, PtychoFM transfers from step-scan training data on one sample to fly-scan measurements of other samples with different feature sizes, morphologies, and refraction indices. At a synchrotron beamline, diffraction frames were streamed from the detector to a single GPU for inference at up to 200 frames per second and returned for real-time visualization. PtychoFM provides a practical route to rapid, transferable ptychographic reconstruction and live experimental feedback under nonideal conditions.
Image reconstruction recovers images, volumes, or scenes from incomplete, noisy, indirect, or compressed measurements using physical models and learned priors.
Ptychographic phase reconstruction is commonly formulated as an iterative inverse problem, requiring repeated object-probe updates and resulting in substantial computational cost for large-scale 4D-STEM data. We present a direct local-to-global learning framework that reconstructs full-field phase maps from diffraction measurements without iterative refinement during inference. The proposed network predicts local wrapped-phase patches from individual diffraction patterns using a sine-cosine representation, and the predictions are assembled into a full-field reconstruction using calibrated scan positions and Gaussian-weighted stitching. To evaluate generalization beyond the training domain, the model is trained on one material and directly applied to another in a zero-shot setting without target-domain fine-tuning. Experiments on AuPd and MoS2 demonstrate consistent cross-material transfer in both directions, with the proposed method achieving the best full-field MSE, PSNR, and MS-SSIM among the evaluated learning-based methods. Compared with the iterative ePIE approach, the proposed direct local-to-global pipeline reduces end-to-end reconstruction time by approximately 10×, demonstrating its potential for efficient and transferable ptychographic reconstruction.
Wen-Chun Lin, Kuan-Peng Chen, Nan-Yow Chen +2
Institute of Computational Intelligence, College of Artificial Intelligence, National Yang Ming Chiao Tung University, Taiwan · National Center for High-performance Computing, National Institutes of Applied Research, Taiwan
Iterative ptychographic reconstruction algorithms are widely used for coherent diffractive imaging but can exhibit slow convergence under realistic experimental conditions. We propose a machine learning-augmented approach that accelerates iterative ptychographic reconstruction by introducing a learned fast-forward operator applied during reconstruction. Following an initial warm-up using standard iterations, the fast-forward operator advances the reconstruction toward a more converged state, after which conventional iterative updates are resumed. This strategy preserves the physical consistency and flexibility of established ptychographic solvers while reducing the number of iterations required for convergence. The model is trained on diverse ptychographic datasets and evaluated on experimental data acquired in a different year, demonstrating robustness and temporal generalization. Compared with conventional iterative solvers, the machine learning-augmented method achieves comparable reconstruction quality while converging faster in terms of Poisson negative log-likelihood, yielding over a two-fold reduction in wall-clock time. The approach has been integrated into an existing reconstruction pipeline and deployed in production at a synchrotron beamline, demonstrating practicality for real-time experimental operation.
Bowen Zheng, Katayun Kamdin, David Shapiro +10
Advanced Light Source, Lawrence Berkeley National Laboratory, Berkeley, CA 94720, USA · Department of Physics, Massachusetts Institute of Technology, Cambridge, MA 02139, USA · Department of Materials Science and Engineering, University of California Davis, Davis, CA 95616, USA +6
Ptychography neural networks suffer from scaling inconsistencies when generalizing out of distribution, limiting their real world viability. We address this scaling mismatch using a factorization strategy which decouples the learned object texture from measurement scaling, enabling a single trained network to produce measurement-consistent reconstructions across varying illumination conditions. This requires predicting the learned object in real and imaginary units instead of the canonical amplitude and phase representation. We additionally introduce a synthetic object sampling strategy that minimizes phase distribution mismatch between synthetic training data and experimental targets. These improvements yield up to a 5x reduction in Fourier error over the previous PtychoPINN-torch baseline across 5 experimental datasets spanning multiple beamlines and facilities.
Albert Vong, Steven Henke, Oliver Hoidn +6
Argonne National Laboratory, Lemont, Illinois 60439, USA · SLAC National Accelerator Laboratory, Menlo Park, California 94025, USA · Lawrence Berkeley National Laboratory, 1 Cyclotron Road, Berkeley, California 94720, USA