Abstract
Electron microscopy (EM) is a foundational tool for directly assessing the structure of materials. Recent advances in direct electron detectors have improved signal-to noise ratios via single-electron counting. However, accurately counting electrons at high fluence remains challenging. We developed a new method of electron counting for direct electron detectors, Back-Propagation Counting (BPC). BPC uses machine learning techniques designed for mathematical operations on large tensors but does not require large training datasets. In synthetic data, we show BPC is able to count multiple electron strikes per pixel and is robust to increasing occupancy. In experimental data, frames counted with BPC are shown to reconstruct diffraction peaks corresponding to individual nanoparticles with relatively higher intensity and produce images with improved contrast when compared to a standard counting method. Together, these results show that BPC excels in experiments where pixels see a high flux of electron irradiation such as in situ TEM movies and diffraction.
Introduction
Modern electron microscopy relies on direct electron detectors to achieve high signal-to-noise ratios by counting individual electron strikes. However, standard counting algorithms—which typically use simple intensity thresholds or local peak detection—struggle under high-occupancy conditions. Two primary issues arise: coincidence loss, where multiple simultaneous strikes in close proximity are misidentified as a single event, and the Landau tail, where high-energy single strikes are erroneously counted multiple times. These errors lead to artifacts like "halos" around bright diffraction peaks and a limited dynamic range, hindering high-intensity 4D-STEM and in situ experiments.
The Back-Propagation Counting (BPC) Method
To address these challenges, we introduce Back-Propagation Counting (BPC). Unlike traditional deep learning approaches that require massive training datasets, BPC treats electron counting as an optimization problem solved per-frame.
The method assumes that each electron strike produces a characteristic 2D Gaussian intensity distribution on the detector. The algorithm maintains a "count grid" ($C^k$) which is convolved with this known Gaussian kernel to produce a reconstructed frame ($P^k$). The difference between this reconstruction and the raw detector data ($F$) is calculated as a loss function ($L_k$). Using the Adam optimizer and back-propagation, the values in the count grid are iteratively adjusted to minimize this loss.
To further refine accuracy, a Poisson-based statistical prior is incorporated. This prior helps distinguish between true multiple hits and single high-energy hits (the Landau tail) by penalizing high local counts that are statistically improbable given the average flux.
Results and Discussion
BPC was validated using synthetic data generated via Geant4 simulations and experimental 4D-STEM data of NaYF4 nanoparticles collected at 87,000 Hz.
Synthetic Validation at High Flux
In synthetic tests, BPC demonstrated remarkable robustness as electron occupancy increased. While standard counting methods began to fail at higher fluences—underestimating peak intensities and losing spatial resolution—BPC accurately reconstructed the electron distribution even at 1,000 electrons per frame.
Experimental Performance
Experimental results confirmed these findings. In nanoparticle diffraction patterns, BPC-reconstructed peaks exhibited significantly higher intensity and better contrast compared to standard methods. Notably, BPC eliminated the "halo" artifacts commonly seen around bright peaks in standard counting, which occur when algorithms incorrectly forbid adjacent counts. This effectively extends the usable dynamic range of the detector, allowing researchers to increase beam brightness without sacrificing data fidelity.
Conclusion
Back-Propagation Counting provides a robust framework for high-fluence electron microscopy. By shifting from simple inference to per-frame optimization, BPC extends the dynamic range of direct detectors and improves image quality in challenging experimental conditions. While computationally more intensive than thresholding—currently achieving ~7 fps on an NVIDIA A100—BPC offers a significant leap in data fidelity for 4D-STEM and in situ imaging. Future work will focus on optimizing processing speed and adapting the method for varying detector geometries and electron energies.
Summary updated