# FPGA-Accelerated SpeckleNN with SNL for Real-time X-ray Single-Particle Imaging

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

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- Builds on 4 of its 23 references that are in the map.
- First posted on arXiv 27 Feb 2025.

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

- [Rethinking floating point for deep learning](https://mlsanity.com/paper/1811.01721/) (2018)
- [Understanding the Impact of Precision Quantization on the Accuracy and Energy of Neural Networks](https://mlsanity.com/paper/1612.03940/) (2016)
- [SpeckleNN: A unified embedding for real-time speckle pattern classification in X-ray single-particle imaging with limited labeled examples](https://mlsanity.com/paper/2302.06895/) (2023)
- [Implementation of a framework for deploying AI inference engines in FPGAs](https://mlsanity.com/paper/2305.19455/) (2023)

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

- [Neural Network Acceleration on MPSoC board: Integrating SLAC's SNL, Rogue Software and Auto-SNL](https://mlsanity.com/paper/2508.21739/) (2025)

## Abstract (arXiv)

We implement a specialized version of our SpeckleNN model for real-time speckle pattern classification in X-ray Single-Particle Imaging (SPI) using the SLAC Neural Network Library (SNL) on an FPGA. This hardware is optimized for inference near detectors in high-throughput X-ray free-electron laser (XFEL) facilities like the Linac Coherent Light Source (LCLS). To fit FPGA constraints, we optimized SpeckleNN, reducing parameters from 5.6M to 64.6K (98.8% reduction) with 90% accuracy. We also compressed the latent space from 128 to 50 dimensions. Deployed on a KCU1500 FPGA, the model used 71% of DSPs, 75% of LUTs, and 48% of FFs, with an average power consumption of 9.4W. The FPGA achieved 45.015us inference latency at 200 MHz. On an NVIDIA A100 GPU, the same inference consumed ~73W and had a 400us latency. Our FPGA version achieved an 8.9x speedup and 7.8x power reduction over the GPU. Key advancements include model specialization and dynamic weight loading through SNL, eliminating time-consuming FPGA re-synthesis for fast, continuous deployment of (re)trained models. These innovations enable real-time adaptive classification and efficient speckle pattern vetoing, making SpeckleNN ideal for XFEL facilities. This implementation accelerates SPI experiments and enhances adaptability to evolving conditions.
