A New Machine Learning Method Is Making 3D X-Ray Imaging of Proteins and Viruses Faster Than Ever

A New Machine Learning Method Is Making 3D X-Ray Imaging of Proteins and Viruses Faster Than Ever
Illustration of XFEL SPI image acquisition and online processing. Credit: Nature Communications (2025)

Researchers working with one of the world’s most powerful X-ray facilities have developed a new machine learning algorithm that dramatically speeds up the process of reconstructing three-dimensional images from X-ray data. The method, called X-RAI (X-Ray Single Particle Imaging with Amortized Inference), was created by scientists at the Department of Energy’s SLAC National Accelerator Laboratory, in collaboration with Stanford University, and has been reported in Nature Communications.

At its core, this work tackles a long-standing bottleneck in X-ray science: how to turn millions of two-dimensional X-ray snapshots into a clear and accurate 3D structure quickly enough to be useful during real experiments. With X-RAI, researchers can now analyze data in real time, opening the door to faster discoveries and even the possibility of making movies of molecules in motion.


Why 3D X-Ray Imaging Matters

Modern X-ray free-electron lasers, or XFELs, allow scientists to study matter at incredibly small scales and incredibly fast times. These machines produce ultrashort, extremely intense X-ray pulses that can capture snapshots of atoms, proteins, viruses, and other tiny particles as they exist and move.

At SLAC, this work takes place at the Linac Coherent Light Source (LCLS), widely regarded as the most powerful X-ray free-electron laser in the world. Each pulse lasts only a few millionths of a billionth of a second, short enough to capture structural details before radiation damage destroys the sample.

When an X-ray pulse hits a particle, the X-rays scatter and form a 2D diffraction pattern on a detector. Each image represents the particle at a random orientation. To reconstruct the particle’s full 3D structure, researchers must combine hundreds of thousands to millions of these images, each taken from a different angle.

That reconstruction step is where things traditionally slow down.


The Problem With Traditional Reconstruction Algorithms

Conventional algorithms used for X-ray single particle imaging work by analyzing each diffraction image separately. For every single snapshot, the algorithm attempts to determine how that 2D pattern fits into a growing 3D model.

This approach has two major drawbacks:

  • Computational cost increases sharply as the number of images grows.
  • Processing often takes hours or even days, long after the experiment has ended.

This delay is especially problematic because beam time at LCLS is extremely limited and competitive. Researchers are often granted only a few days to run experiments. If they cannot analyze results quickly, they may not know whether an experiment is working until it is already over.

X-RAI was designed specifically to remove this bottleneck.


How the X-RAI Algorithm Works

X-RAI introduces a machine learning-based approach that learns continuously as data are collected. Instead of treating every image as a completely new problem, the algorithm builds shared knowledge across the entire dataset.

The system relies on a neural network that performs two key tasks at the same time:

  • It examines incoming 2D diffraction images and predicts the 3D orientation of the particle that produced them.
  • It also works in reverse, generating 2D projections from a 3D model and comparing them with real detector data.

This bidirectional learning process allows X-RAI to refine both the particle orientation estimates and the 3D reconstruction simultaneously. As more data come in, the model becomes more accurate and more efficient.

A key advantage of this approach is that it uses amortized inference, meaning the cost of processing new images does not increase dramatically as the dataset grows. In practical terms, this means the algorithm can handle near-limitless amounts of data without slowing down.


Real-Time Performance and Speed

One of the most striking results reported by the researchers is X-RAI’s speed. In demonstrations described in the study, the algorithm was able to process up to 160 diffraction images per second while continuously updating the 3D structure on screen.

This makes real-time reconstruction during experiments possible. Instead of waiting until data collection is complete, scientists can watch the reconstruction evolve as the experiment runs and make informed decisions on the spot.

This capability could fundamentally change how experiments at XFEL facilities are planned and executed.


Sharper Reconstructions Than Existing Methods

Speed alone would not matter if the results were lower quality. To test accuracy, the team compared X-RAI with two established reconstruction algorithms using real biological targets.

They focused on:

  • A ribosomal subunit, a complex molecular machine essential for protein synthesis.
  • ATP synthase, a protein responsible for producing energy inside cells.

In both cases, X-RAI produced sharper and more detailed 3D reconstructions than the competing methods. This demonstrated that the algorithm is not just faster, but also more precise when dealing with large datasets.


Making Better Use of X-Ray Laser Facilities

Facilities like LCLS are among the most advanced scientific tools on Earth, but access is limited. Thousands of research teams compete for a small number of experimental slots.

By enabling on-the-fly data analysis, X-RAI helps researchers get more value from every second of beam time. If a setup needs adjustment, scientists can see that immediately instead of discovering problems days later.

This efficiency could lead to more successful experiments, fewer wasted runs, and faster scientific progress overall.


Toward Movies of Molecules in Motion

Beyond static structures, X-RAI may help scientists study dynamic biological processes. With enough diffraction images collected over time, it becomes possible to reconstruct a sequence of 3D structures.

This raises the possibility of creating molecular movies, showing how enzymes change shape, how proteins interact with drugs, or how viruses assemble and disassemble.

Understanding motion at this scale is crucial for fields like drug discovery, structural biology, and materials science.


A Broader Look at X-Ray Single Particle Imaging

X-ray single particle imaging has long promised atomic-level insight without the need for crystallizing samples, a major limitation of traditional X-ray crystallography. However, the sheer volume of data generated by XFELs has made analysis a challenge.

Machine learning approaches like X-RAI represent a new generation of computational tools designed to match the data output of modern experimental facilities. As XFELs continue to increase their repetition rates, scalable algorithms will become even more essential.


What Comes Next

The researchers hope that X-RAI will be adopted not only at SLAC but also at X-ray laser facilities around the world. Because the method scales well with dataset size, it is well suited for future instruments that will produce even larger volumes of data.

As machine learning and experimental physics continue to intersect, tools like X-RAI show how AI can directly accelerate scientific discovery, not by replacing experiments, but by making their results available faster and more clearly than ever before.


Research Paper:
https://doi.org/10.1038/s41467-025-62226-7

Also Read

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments