logo

Towards adaptable synchrotron image restoration pipeline

ACCELERATOR, RAY TECHNOLOGY AND APPLICATIONS

Towards adaptable synchrotron image restoration pipeline

Chun Li
Xiao-Xue Bi
Yu-Jun Zhang
Zhen Zhang
Li-Wen Wang
Jian Zhuang
Dong-Liang Chen
Yu-Hui Dong
Yi Zhang
Nuclear Science and TechniquesVol.35, No.10Article number 167Published in print Oct 2024Available online 20 Sep 2024
21007

Synchrotron microscopic data commonly suffer from poor image quality with degraded resolution incurred by instrumentation defects or experimental conditions. Image restoration methods are often applied to recover the reduced resolution, providing improved image details that can greatly facilitate scientific discovery. Among these methods, deconvolution techniques are straightforward, yet either require known prior information or struggle to tackle large experimental data. Deep learning (DL)-based super-resolution (SR) methods handle large data well, however data scarcity and model generalizability are problematic. In addition, current image restoration methods are mostly offline and inefficient for many beamlines where high data volumes and data complexity issues are encountered. To overcome these limitations, an online image-restoration pipeline that adaptably selects suitable algorithms and models from a method repertoire is promising. In this study, using both deconvolution and pretrained DL-based SR models, we show that different restoration efficacies can be achieved on different types of synchrotron experimental data. We describe the necessity, feasibility, and significance of constructing such an image-restoration pipeline for future synchrotron experiments.

SynchrotronDeconvolutionDeep learningSuper-resolutionPipeline
1

Introduction

Synchrotron radiation microscopy is a powerful tool for uncovering the internal structure and function of matter in biology [1], medicine [2], and materials science [3]. For example, in biomedical imaging, the three-dimensional (3D) characterization of human organs from the organ level to the cellular scale is achieved using hierarchical phase-contrast tomography [4] at the European Synchrotron Radiation Facility, which is critical for understanding system-level behaviors in health or disease [4]. However, synchrotron microscopic experiments often suffer from disturbances from system vibration, defects in imaging systems, and other limitations in experimental conditions, resulting in poor image quality in experimental data, which complicates the retrieval of useful information and hinders the scientific discovery process. Therefore, image restoration methods are used to recover high-resolution (HR) images from their low-resolution (LR) counterparts. On the one hand, image restoration effectively improves image quality with enhanced resolution, providing more details for the entire image as well as for its regions of interest (ROIs), which greatly helps researchers interpret synchrotron experimental data. On the other hand, to achieve a resolution much higher than the original focused spot size, is difficult. Almost every micro/nano-focused synchrotron radiation beamline or laboratory-based microfocus X-ray source strives to overcome the limitations of the physical size of the focused X-ray spot. In such efforts, oversampling is used where each movement step is smaller than the focused spot size [5], and the oversampled data are corrected by deconvolution, which in practice is considered a representative image restoration technique. Thus, resolution improvement can be achieved without major investment or when the resolution limit restricted by instrumentation is reached.

Because the experimental image obtained can be regarded as a convolution of the HR image and the point-spread function (PSF) of the imaging system, deconvolution aims to “deconvolve” the PSF from the experimental image and recover the HR component. As a straightforward classical method, deconvolution is widely used to improve the quality of data acquired using different methods, such as wide-field fluorescence microscopy [6], confocal microscopy [7], structured illumination microscopy [8], and spectroscopic techniques [9]. Deconvolution can be categorized into non-blind and blind approaches. Non-blind methods include inverse filters and iterative methods. Inverse filters include Wiener deconvolution [10], Tikhonov filtering [11], linear least squares [12], and naïve inverse filtering [13], including Richardson-Lucy [14], Jansson-Van Cittert [15], Landweber [16], and nonlinear Tikhonov-Miller [17]. Non-blind methods inherently require a known PSF that cannot be estimated efficiently in most scenarios. In synchrotron experiments, the PSF is usually considered equivalent to the intensity distribution of the incident X-ray beam, and efforts have been made to estimate its formulaic form. For example, the point scan and knife-edge methods have been used to estimate the PSF [18,19] for non-blind deconvolution. However, both methods require additional instrumentation and only work for certain experiments, which may complicate the hardware configurations in the hutch and may not be a general solution for all beamlines.

In contrast, blind deconvolution techniques circumvent the search for the PSF. Instead, they estimate the PSF from the input image. Without prior knowledge of the PSF as a prerequisite, blind deconvolution is considered more practical in scenarios where the PSF cannot be easily estimated, such as synchrotron experiments. However, because blind deconvolution minimizes the error by iteratively updating the estimated PSF and image, its computational cost may pose a critical concern, particularly when encountering a massive amount of experimental data. Computational concerns also exist regarding non-blind methods. In addition, as model-driven approaches, both non-blind and blind deconvolution techniques assume that the data are deterministic and theoretically reasonable, which is not the case in synchrotron experiments, where data are usually produced with different dimensions and types. Hence, deconvolution often struggles to take full advantage of the correlation information within large experimental datasets.

To avoid PSF estimation as a prerequisite while taking advantage of the immense amount of experimental data, more suitable solutions are needed. Unlike deconvolution, which is a model-driven approach, data-driven methods are the most suitable generic solutions. Data-driven methods [20-22] are essentially state-of-the-art deep learning (DL)-based models that perform super-resolution (SR) tasks owing to the powerful learning capability of DL on large experimental data. SR expands each dimension of the input images with variable-scale factors, adding more image details with an increased image size. The first DL-based SR solution was the SRCNN [23] model introduced by Dong et al., in which a convolutional neural network (CNN) was used. Subsequently, Ledig et al. proposed the SRGAN [24] using a generative adversarial network (GAN) in 2017. It was not until 2018 when Wang et al. introduced the ESRGAN [25] that a milestone in SR techniques was established. They enhanced the SRGAN in terms of the visual quality with more realistic textures [25]. The ESRGAN improved critical components of the SRGAN including network architecture, adversarial loss, and perceptual loss [25], yielding better performance in terms of visual quality. Later, ESRGAN was extended into the Real-ESRGAN [26], which is a more practical implementation of ESRGAN aiming at processing real-world images. Currently, Real-ESRGAN is still considered one of the best-performing SR models and has been frequently used for natural image SR tasks, particularly on those images containing anime characters.

Despite this progress, the adoption of these advanced DL-based SR models in synchrotron experiments remains a concern, mostly in terms of data scarcity and model generalizability. Models that excel in natural image SR tasks are usually trained using many LR–HR pairs. However, in synchrotron experiments, the collection of LR-HR data pairs is often impossible owing to limited beamtime or strictly controlled radiation dosage, particularly for biological samples. Therefore, unsupervised or self-supervised learning [27] strategies that do not require paired experimental data, are more practical for synchrotron beamlines. In contrast, models that perform well on natural images should be carefully adjusted to adapt to synchrotron experimental images [28], which often differ from natural images in aspects such as intensity distribution, dynamic range, and ROIs. Therefore, the direct application of high-performing pretrained models designed for natural images to synchrotron experimental images is perfunctory, and it is preferable to delve into pretrained models using X-ray-like images, such as microscopic images of bio-samples. One research direction is to incorporate the Fourier channel attention (FCA) mechanism into the DL model [29], which helps the network learn high-frequency information from diverse datasets.

In summary, as a classical model-driven method, deconvolution is widely used, while either requiring a PSF as a prerequisite or scrambling to tackle large experimental data. As an evolving data-driven approach, DL-based SR handles large experimental datasets better, although there are still concerns regarding data scarcity and model generalizability. Therefore, no single algorithm or model can completely fulfill the image restoration requirement in synchrotron experiments, and the sporadic application of designated restoration methods for certain tasks is inefficient. In addition, current restoration solutions, including deconvolution algorithms and DL-based SR models, are still considered offline post-processing methods. Synchrotron experiments are shifting from two-dimensional (2D) static characterization to high-throughput [30], cross-scale [31], multimodal [32], dynamic [33], and time-resolved [34] characterization with soaring experimental data volumes and increased data complexity involving convoluted hierarchical structures [35], which causes data deluge problems [36]. Under such circumstances, offline methods often fall short of timeliness and efficiency, incurring raw data congestion and imposing a tremendous burden on computing resources, which eventually impedes the scientific discovery process. Hence, an adaptable synchrotron image restoration pipeline (ASIRP) that autonomously selects the best-suited algorithms and models for online processing is essential. The pipeline adaptably selects appropriate algorithms and models from a method repertoire comprising both deconvolution and DL-based SR techniques. The ASIRP cohesively synthesizes different techniques that are otherwise isolated in the repertoire into complementary online solutions. By merging the unified experimental control and data acquisition software framework [37-39] developed for next-generation synchrotron light sources [40,41], the ASIRP is expected to relieve the data congestion problem and computational burden at future beamlines.

In this study, we first performed image restoration on two synchrotron experimental data types: micro-X-ray fluorescence (µ-XRF) mapping images and synchrotron tomographic data. Non-blind and blind deconvolution methods, as well as pretrained DL-based models designed for either natural images or microscopic biological images, were tested. We demonstrate that the deconvolution methods achieved satisfactory results on µ-XRF data, while certain DL-based models showed good results on tomographic data. Considering the strengths and weaknesses of each model in terms of data scarcity and model generalizability, we then discuss our thoughts on the necessity, feasibility, and significance of the ASIRP. In the future, by using algorithmic and software advancements, ASIRP can help pave the way towards a more automatic, intelligent, streamlined, and user-friendly image restoration workflow for new-generation synchrotron beamlines.

2

Material and methods

2.1
Data acquisition

The μ-XRF data were acquired at the X-ray microanalysis beamline (4W1B) in Beijing Synchrotron Radiation Facility (BSRF), which has an electron energy of 2.5 GeV with a current of 250 mA. A polychromatic beam (pink beam) with incident X-ray energy ranging from 10–18 keV was used. The size of the beam spot was focused by a polycapillary half-lens. A four-element Hitachi Vortex®-ME4 silicon drift detector coupled to a Quantum Detectors Xspress3 four-channel analyzer system was used to detect XRF photon counts. Data acquisition was performed in fly scan mode using Mamba [39], experimental process control, and data acquisition software. The X-ray beam was focused to be approximately 50 μm × 50 μm. Two copper-mechanical grid samples were used. The first was AG175, which was mapped with different step sizes and had a mesh density of 175 lines/in (69 lines/cm). It had a hole width of 108 μm and a bar width of 37 μm. The second grid was the AG300 mesh grid, which was used in the intensity analysis. It had a hole width of 58 μm and a bar width of 25 μm.

The tomography data were one of 67 tomograms of a lithium nickel manganese cobalt oxide battery cathode particle downloaded from TomoBank [42]. Data were collected using nano-CT at the Stanford Synchrotron Radiation Lightsource with an incident X-ray energy of 8348 eV. A total of 180 projection images were acquired at different angles.

2.2
μ-XRF data mapping and tomographic reconstruction

We found that when the concentration of a certain element was low, the PyMca software application failed to fit the spectra, whereas the concentration of that element could be successfully obtained by simply adding intensities within the channel of interest. Therefore, we developed a new software tool to achieve the “channel-adding” functionality. This software was developed using the PyQt5 toolkit. Thus, the acquired raw μ-XRF data were either processed using PyMca [43] or by intensity summation within the channels of interest using our self-developed software. Currently at BSRF, our “channel-adding” software is becoming more popular amongst the user community due to its time efficiency. The μ-XRF data were stored in hierarchical data format (HDF5), which is a compatible data format, enabling them to be processed by either PyMca or our software. The graphical user interface (GUI) of the software is presented in the Results section. For tomographic data, reconstruction from the acquired projections was performed using TomoPy [44] on a computer equipped with a 6-core 2.6 GHz Intel Core i7 CPU, and the final reconstructed 3D volume was constructed by stacking the reconstructions using ImageJ software [45]. Orthoslices of 3D volume were obtained using the ImageJ 3D Viewer plugin.

2.3
Deconvolution and DL-based methods

Non-blind and blind deconvolution methods were used, and both types of method were implemented using MATLAB’s built-in functionality. In addition, a non-blind method using the Richardson-Lucy algorithm, was initially implemented in Python script. The algorithm was packaged as an executable “. exe” program using “pyinstaller” and then delivered to beamline users to improve their experimental data. Later, this deconvolution script was integrated into the “channel-adding” software with a user-friendly GUI design, as described below in the Results section.

Popular DL-based SR methods used included zero-shot models such as ZSSR [46], models using GAN architectures such as ESRGAN and Real-ESRGAN, and models using the FCA mechanism such as deep FCA GAN. ZSSR is an unsupervised image-specific CNN model trained at testing time. During testing, the training data was completely extracted from internal image information of the LR test image; The Real-ESRGAN adopted the same generator used in ESRGAN, which comprised several residual-in-residual dense blocks. The discriminator used was a U-Net-shaped architecture with spectral normalization applied, which helped stabilize the training process. The FCA model featured the FCA mechanism, which was embedded in the residual groups [29]. The model was built on the framework of an adversarial network [47-49] (cGAN). In our experiments, we configured the development environment using a workstation equipped with an NVIDIA GeForce RTX 3060 GPU. The environment included configured Python (v3.6), TensorFlow (v2.6.2), and Keras (v2.6.0).

3

Results

3.1
Restoration using deconvolution

Deconvolution methods, including non-blind and blind approaches, were both applied to the µ-XRF images of the copper grid sample AG175, which were acquired using variable step sizes from the 4W1B beamline at the BSRF. We then present the deconvolution results using packaged “channel-adding” software, which has been thoroughly tested and delivered to beamline users. Finally, a graphical analysis of the intensity fluctuations of the mapped data was conducted to validate the effectiveness of the deconvolution.

3.1.1
Deconvolution applied to µ-XRF mapping images

Deconvolution techniques, including both non-blind and blind methods, were applied to µ-XRF mapping images acquired using variable step sizes of 5, 10, 25, and 50 µm. Since the focused beam size was 50 µm, oversampling occurred when the step size was equal to 5, 10, and 25 µm. Fig. 1 compares the deconvolved images with the original images with increasing scan steps. The red arrows indicate improvements. The real-world microscopy image and PSFs recovered using the blind deconvolution method are also shown.

Fig. 1
(Color online) Deconvolution results on a copper mesh grid sample (AG175) with variable step sizes. The different columns (left to right) reflect the increasing step sizes and the original microscopy image. The scans with different step sizes were performed within the same region of interest (ROI)
pic

The “black lines (gaps)” present in the 5 µm and 10 µm images were caused by the periodic yet inconsistent intensity of the incident X-ray at the beamline. Because the X-ray beam at the BSRF during data acquisition was generated under the parasitic mode of the Beijing Electron-Positron Collider, the current of the electrons increased following injection and decayed following electron-positron collisions, where injection and collisions occurred alternately. Therefore, the intensity of the resultant X-rays was periodic, with a sawtooth waveform. These lines could not be completely removed from the mapping images even though intensity normalization was performed using the ionization chamber. However, with larger step sizes such as 25 and 50 µm, the scanning speed increased and the whole sample area was scanned within a single injection-collision period. In those instances, no “gaps” were observed in the mapping images in Fig. 1.

The results shown in Fig. 1 were obtained using MATLAB’s built-in non-blind and blind deconvolution functionalities [50,51]. On average, it took 0.4 s for the non-blind algorithm and 0.8 s for the blind algorithm. The number of iterations was set to 10. However, based on our operational experience installing and learning additional commercial software such as MATLAB to process data may be cumbersome for beamline users, to the detriment of the entire experimental experience. Therefore, open-source, installation-free software with a low learning curve that runs on popular operating systems is preferred.

In addition to MATLAB, the deconvolution was performed in Python. We first packaged the Python scripts that perform both plotting and deconvolution into an executable “.exe” application using “pyinstaller” (or “py2exe”). Also, a “.ini” configuration file was provided, which allowed users to input configuration parameters such as the data directory, channel range, plot colors, plot threshold, PSF size, standard deviation, and number of deconvolution iterations. The software uses a channel-adding method to generate the elemental concentration. It has been suggested by the beamline that this is superior to the PyMca fitting method in which the characteristic peaks of some less-concentrated elements are too weak to be successfully fitted by PyMca. The software also normalizes the photon counts by the counts around the Ar emission energy instead of using the intensity from the ionizing chamber. The restoration results obtained using the packaged software are shown in the Supplementary Information (Fig. S1).

Although this program performs deconvolution without installing proprietary software such as MATLAB, the lack of an intuitive GUI is still an inherent drawback. We received feedback from users and beamline staff that modifying the “.ini” configuration file may be less intuitive for some users. Considering this, we developed an updated data-processing software with a GUI included. We have continued updating the software providing new functionality in response to user requests. The software inherited the same “channel-adding” mechanism and normalization method as the packaged software. Fig. 2 shows the updated software using a GUI. Numerous functionalities include original data loading in the HDF format, automatic data dimension calculation, plotting threshold and color map selection, flip and rotation, ROI selection, and data visualization before and after deconvolution. The software saved the processed data, such as the plotted 2D mapping and deconvolved mapping, into local storage. It also saved the counts of all scanned points as a one-dimensional array, combined with the relative coordinates along both scan directions in “.txt” files, which provided users with the option of plotting using Origin software. This software runs on multiple platforms and is distributed to beamline users with a detailed software manual. The time required to deconvolve the data was 20 s for five iterations. The data dimensions were 182 (H) × 162 (V) scanned points. Using the fastest fly scan speed (5 mm/s) in the BSRF-4W1B beamline, the data acquisition process required approximately 2.5 minutes to complete. Therefore, the data processing speed was better than that of data acquisition.

Fig. 2
(Color online) The data processing software. In this design, the left column of the GUI comprises functionalities such as HDF5 data loading, automatic data dimension calculation, step size setting, concentration threshold setting, colormap selection, flip and rotation, and ROI selection. The right column features visual comparisons between the original and the deconvolved data
pic
3.1.2
Graphical analysis on intensity fluctuations

To further validate the effectiveness of deconvolution, we studied the intensity fluctuations before and after deconvolution by plotting them across the entire 2D mapping. The sample used this time was the AG300 copper mesh grid scanned using µ-XRF with a step size of 25 µm. The PSF size was 3×3 pixels and 10 iterations were performed. The time taken to process this data was 0.01 s and 0.03 s for the non-blind and blind algorithms, respectively.

Figure 3 shows that after applying deconvolution, the intensity fluctuated more dramatically than that of the original, implying an improved image contrast. The standard deviation of the intensity of the original image was 25.13, and it improved to 40.82 and 40.53 after non-blind and blind deconvolution, respectively. To improve the visualization of the intensity fluctuations, grayscale 2D mapping was applied. The middle column illustrates the intensity fluctuation, while the right column is a side view of the intensity distribution. A more dramatic intensity fluctuation implies a greater standard deviation of the intensity, indicating contrast improvements by the deconvolution algorithms.

Fig. 3
(Color online) Intensity fluctuations before and after deconvolution: (a) Original; (b) Non-blind; (c) Blind
pic
3.2
Restoration using DL

The restoration results obtained using three distinct DL methods are presented. These models were selected deliberately to address our concerns regarding data scarcity and model generalizability, as each model showed their respective strengths and weaknesses. The first was a self-supervised model, zero-shot SR (ZSSR), which used internal learning without requiring paired LR–HR images as training data; the second was a GAN approach, Real-ESRGAN, which is currently considered one of the best-performers in the SR field for natural images; the third DL model embedded the FCA mechanism, which was pre-trained on microscopic bio-images similar to certain types of synchrotron experimental data. The first model related to the data scarcity concern, whereas the latter two dealt with the generalizability issue.

3.2.1
ZSSR

HR experimental images are often difficult to acquire in practice. Although such HR images are available, the labeling process can be tedious and is often completed manually. The lack of HR image counterparts at beamlines often causes data scarcity, and self-supervised or unsupervised learning strategies are considered more promising. Among these, the ZSSR generates training data from the test image itself, and the training process occurs during the testing phase without requiring a paired and labeled external database. It is considered an image-specific CNN that extracts training data from the test image. The results obtained using the ZSSR are included in the Supplementary Information. Without HR image counterparts, data scarcity has become a concern for µ-XRF data, and self-supervised learning methods struggle to achieve satisfactory recovery (Fig. S2).

3.2.2
Real-ESRGAN

In addition to the self-supervised model, a high-performing GAN model pretrained on natural images was tested on both natural and µ-XRF images. The results are shown in the Supplementary Information. As with the self-supervised model, the GAN model offered a limited resolution boost on µ-XRF images, although it performed well on natural images (Fig. S3). Therefore, generalizability is a concern. Good generalizability often implies that models trained using one type of data are also effective for other types of data. However, this model lacks generalizability.

3.2.3
Embedded FCA mechanism

For better generalizability of the synchrotron experimental data, DL models can be directly trained using synchrotron data or using data that resembles synchrotron experimental data. Therefore, the DL model with the FCA mechanism was tested on two synchrotron experimental data types, including µ-XRF data and tomography data. Rather than using natural images, this model was trained on microscopic biological images, which resembled synchrotron experimental images in terms of channel number, dynamic range, intensity distribution, and ROI locations.

Figure 4 shows the SR results obtained using the model with the FCA mechanism. The images used were µ-XRF images. Improvements in the image quality after restoration were observed. The FCA method, as well as both deconvolution algorithms, super-resolved and restored the original data. The dimensions of the copper grid image were 1488 (H) × 744 (V). It took 25 min to super-resolve such data with doubled horizontal and vertical resolutions. The dimensions of the Cardamine violifolia seed sample image [52] were 771 (H) × 1108 (V). The seed data were acquired by another beamline user [52] with a configuration like that used for the copper mesh grid sample. It took 20 min to super-resolve the seed data with double horizontal and vertical resolutions. Although the data acquisition process is dramatically expedited thanks to fly scan techniques, the SR process can still keep up with or even lead the data acquisition process, which typically takes 1 h to acquire data from a 30 mm by 30 mm sample with a period of 0.01 s and a step size of 50 µm (at 5 mm/s maximum fly scan speed). In addition, processing time can be further reduced using GPU acceleration. Figure 4 also shows the results obtained using the deconvolution algorithms for comparison. For the non-blind algorithm, the computation time was 1.92 s; and for the blind algorithm, the computation time was 3.71 s. The environment was established by configuring Python, TensorFlow, and Keras into standalone versions on a workstation equipped with an NVIDIA GeForce RTX 3060 GPU. Deconvolution results were also shown.

Fig. 4
(Color online) SR results on µ-XRF images using the model with FCA mechanism compared with deconvolution algorithms
pic

Based on the SR results obtained from the μ-XRF images, we tested the SR capability of the models using synchrotron tomography data. Fig. 5 shows the results obtained using non-blind deconvolution, blind deconvolution, and the FCA model. Improvements are shown in one of the 2D projections and in the orthoslices of the 3D reconstructed volume from before and after applying image restoration techniques. The 3D reconstructed volume was stacked from 512 2D reconstructions obtained by using TomoPy [44]. Using the non-blind deconvolution, the blind deconvolution, and the FCA model, the averaged time required to process one projection image was 0.15 s (10 iterations), 0.31 s (10 iterations), and 36 s, respectively. The FCA model benefitted from GPU acceleration. For example, although the training required tens of hours to complete, once trained, the prediction required less than 1 s to reconstruct an image with 1024 × 1024 pixels [29].

Fig. 5
SR results on synchrotron tomographic data using non-blind deconvolution, blind deconvolution, and the model with FCA mechanism
pic

To improve the visualization of the SR effect, magnified images of the boxed regions of the orthoslices are shown in Fig. 6. The capability of the FCA DL model to restore image details is demonstrated. The information that could not be recovered by non-blind or blind algorithms was recovered using the DL model with FCA mechanism. An improvement on each slice of the 3D reconstruction implies that the whole 3D reconstructed volume was super-resolved with enhanced data details.

Fig. 6
(Color online) Magnified images of the boxed regions on XY and YZ orthoslices
pic
4

Towards ASIRP

Thus far, we have demonstrated the strengths and weaknesses of deconvolution methods and pre-trained DL models in synchrotron image restoration tasks. We have shown that deconvolutions perform well on µ-XRF images, while being less effective on tomography data. In addition, deconvolution either requires prerequisite PSF information or incurs heavy computational costs. However, the DL methods face challenges in terms of data scarcity and generalizability. For example, when data scarcity was encountered in µ-XRF experiments, the ZSSR (self-supervised) method provided limited restoration outcome (Fig. S2), and the high-performing Real-ESRGAN DL model for natural images struggled to effectively restore the µ-XRF images (Fig. S3); finally, the DL model with the FCA mechanism showed its SR capability on both µ-XRF (Fig. 4) and tomography data (Figs. 5 and 6). In summary, both the deconvolution and DL methods showed strengths and weaknesses. The challenges of requiring prior information, high computational costs, data scarcity, and model generalizability cannot be fully addressed using a single method.

In addition, no single algorithm, technique, or model can completely fulfill the diverse image-restoration requirements across different characterization methods and beamlines. In real-world scenarios, it is often impractical to efficiently test the capability of a particular method with specific experimental data. It is imperative to adaptively select the algorithms and models that are most suitable for specific data types from a readily available pool. Through the algorithm selection process, distinct techniques that are otherwise isolated can complement each other and function synergistically. To this end, the strategy of adaptable algorithm selection represents a promising approach.

Another concern regarding the different techniques is that they lack online operational functionalities, which may hinder the realization of real-time processing. Currently, real-time data processing is a developing trend in synchrotron radiation experiments. The best solution is to formulate an online image restoration pipeline using the selected algorithms and models. The pipeline acts as a downstream system following beamline experiment control and data acquisition software frameworks such as Mamba[39]. Together with Mamba, the pipeline can make full use of the large amount of experimental data to perform restoration tasks online, which may, in turn, provide feedback to the data acquisition framework to help adjust experimental strategies and guide experimental processes. The practicality and efficiency of such pipelines are demonstrated by the experiments and discussions presented above in the results section. The time required to super-resolve the experimental data was proven to be less than that required to acquire such data, which makes the pipeline suitable for real-time or online deployment at beamlines.

Therefore, not only adaptability but also the requirement for online processing must be met. For image restoration tasks in the synchrotron experiments, we considered an ASIRP to be the optimal solution. The ASIRP improves the synchrotron experimental experience through both an adaptable algorithm selection strategy and an online image restoration technique achieved by integrating experimental control and a data acquisition framework [39]. The design of the ASIRP and its interoperability with other components are illustrated in Fig. 7.

Fig. 7
(Color online) ASIRP overview
pic

The ASIRP is integrated into the experiment control and data acquisition framework Mamba. The pipeline provides online feedback from the restored data to the data acquisition process. The methods repertoire collects and adaptably selects suitable deconvolution or DL methods to perform image restoration tasks. The white arrows in Fig. 7 show the directions of data flow including both the forward and the feedback path. The translucent ring encircling the methods repertoire cube indicates adaptable algorithm selection from candidate algorithms or methods.

5

Discussion

In this study, we divided synchrotron image restoration methods into two categories: deconvolution techniques and DL-based SR methods. Both the deconvolution techniques and DL methods have respective capabilities and limitations. These limitations are mostly related to prerequisite priors, computational burden, data scarcity, or model generalizability. In addition, there were significant differences in the data types across the beamlines. Such differences occur not only between natural images and synchrotron experimental images but also across different beamlines. Experiments have shown that certain methods that are effective for one data type may not work well for other types. To this end, an ASIRP can adaptably select methods that are best suited to each experiment and cater to the data diversity at future beamlines.

Data diversity is particularly common in multimodal experiments and is considered as one of the most typical experimental modes of fourth-generation synchrotron light sources. In certain experiments, such diversity exists not only in experimental data with different dimensionalities but also in data with the same shape. For instance, diffraction and transmission microscopy images are both two-dimensional. Although the shapes of the two data types are the same, the effective image restoration techniques used can be different. At beamlines, where multimodal characterization is routinely conducted, the ability to use multiple image restoration methods is more desirable than elsewhere. Therefore, by providing suitable restoration techniques, the ASIRP can handle the data diversity challenge in multimodal experiments more effectively, offering a universal restoration solution across different beamlines.

However, the lack of potential for online processing may hinder its application in synchrotron experiments. Because of limited beam time, experiments are often unrepeatable, making a powerful feedback mechanism highly valued. The feedback mechanism allows for more convincing experimental process control during data acquisition. Although efficacious, many restoration solutions are post-processing methods or considered to be offline. Therefore, they struggle to provide timely feedback to the data acquisition process. Instead, the ASIRP is designed as a pipeline that aims to deliver online feedback, both spatially and temporally. Spatially, ASIRP constantly monitors and restores acquired images during data acquisition, with image details containing meaningful physical information being continuously improved. With enhanced details, scientists and users can improve their determination of ROIs on an image, which can then be used for subsequent finer scans within the ROI. Temporally, in X-ray diffraction experiments during the data acquisition process, the ASIRP discerns minute changes in the shape of diffraction patterns in real time, which often reflect physical events, such as phase changes within materials. By determining the time interval at which a physical event of interest occurs, researchers can improve their understanding of how materials behave in-situ in a time series, which helps them make ad hoc experimental decisions.

Finally, by taking advantage of the ASIRP, some downstream tasks can also be performed in a more streamlined manner. For example, in synchrotron XRF experiments conducted at the BSRF, users seek effective ways to obtain 3D volumes from scanned 2D mappings. Such tasks are currently completed by manually registering and aligning 2D mappings, which is inefficient requiring a huge amount of time and human effort. Owing to the outstanding progress made in generative AI technology, 3D volumes can be generated from their 2D counterparts. This 2D-to-3D technique can be naturally integrated between the “Restored Data” and the “Data Analysis” modules of the ASIRP. Our preliminary 2D-to-3D generative results obtained using the 2D XRF mapping images are shown in Fig. S4 in the Supplementary Information. The generative model used was Zero-1-to-3 [53].

The ASIRP project is still in the planning stages. In this study, we showed that no single algorithm or model can address the data processing challenges encountered at next-generation beamlines, whether for good model generalizability, less stringent data dependency, or the requirements for online or multimodal processing. Therefore, the proposed construction of such a pipeline is imperative, and this study lays a solid foundation for achieving such ambitious goals.

6

Conclusion

We demonstrated the strengths and limitations of stand-alone image restoration methods for different synchrotron experimental data types. The studied methods include deconvolution techniques and DL-based SR methods. The deconvolutions excel on µ-XRF images, however, they require prior information or can incur excessive computation cost. The DL-based SR models perform well using tomographic data, however, concerns remain regarding data scarcity and model generalizability. Thus, no standalone method can simultaneously fulfill the adaptability and online processing requirements needed to support the software advancements of future beamlines. To this end, the ASIRP adaptably selects suitable methods from a method repertoire. This repertoire consists of both deconvolution techniques and DL-based SR models. By integrating it with the software framework Mamba, the ASIRP streamlines the image restoration workflow through an adaptable algorithm selection mechanism, which helps make timely experimental decisions, guide experimental processes, and facilitate substantial research outcomes for the broader X-ray microscopy community.

References
1. M. Tałanda, V. Fernandez, E. Panciroli et al.,

Synchrotron tomography of a stem lizard elucidates early squamate anatomy

. Nature 611, 99104 (2022). https://doi.org/10.1038/s41586-022-05332-6
Baidu ScholarGoogle Scholar
2. M. Wranik, T. Weinert, C. Slavov et al.,

Watching the release of a photopharmacological drug from tubulin using time-resolved serial crystallography

. Nat. Commun. 14, 903 (2023). https://doi.org/10.1038/s41467-023-36481-5
Baidu ScholarGoogle Scholar
3. T.M. Ajayi, N. Shirato, T. Rojas et al.,

Characterization of just one atom using synchrotron X-rays

. Nature 618, 6973 (2023). https://doi.org/10.1038/s41586-023-06011-w
Baidu ScholarGoogle Scholar
4. C.L. Walsh, P. Tafforeau, W.L. Wagner et al.,

Imaging intact human organs with local resolution of cellular structures using hierarchical phase-contrast tomography

. Nat. Methods 18, 15321541 (2021). https://doi.org/10.1038/s41592-021-01317-x
Baidu ScholarGoogle Scholar
5. R. Sun, Y.P. Wang, J. Zhang et al.,

Synchrotron radiation X-ray imaging with large field of view and high resolution using micro-scanning method

. J. Synchrotron Radiat. 29, 12411250 (2022). https://doi.org/10.1107/S1600577522007652
Baidu ScholarGoogle Scholar
6. Q.Y. Zhou, Z.Y. Chen, Y.H. Liu et al.,

Three-dimensional wide-field fluorescence microscopy for transcranial mapping of cortical microcirculation

. Nat. Commun. 13, 7969 (2022). https://doi.org/10.1038/s41467-022-35733-0
Baidu ScholarGoogle Scholar
7. Y.C. Wu, X.F. Han, Y.J. Su et al.,

Multiview confocal super-resolution microscopy

. Nature 600, 279284 (2021). https://doi.org/10.1038/s41586-021-04110-0
Baidu ScholarGoogle Scholar
8. Y.C. Wu, H. Shroff,

Faster, sharper, and deeper: structured illumination microscopy for biological imaging

. Nat. Methods 15, 10111019 (2018). https://doi.org/10.1038/s41592-018-0211-z
Baidu ScholarGoogle Scholar
9. S.P. Meisburger, D. Xu, N. Ando,

REGALS: a general method to deconvolve X-ray scattering data from evolving mixtures

. IUCrJ 8, 225237 (2021). https://doi.org/10.1107/S2052252521000555
Baidu ScholarGoogle Scholar
10. F. Orieux, J.F. Giovannelli, T. Rodet,

Bayesian estimation of regularization and point spread function parameters for Wiener-Hunt deconvolution

. J. Opt. Soc. Am. A Opt. Image Sci. Vis. 27, 15931607 (2010). https://doi.org/10.1364/JOSAA.27.001593
Baidu ScholarGoogle Scholar
11. S. Gutta, S.K. Kalva, M. Pramanik et al.,

Accelerated image reconstruction using extrapolated Tikhonov filtering for photoacoustic tomography

. Med. Phys. 45, 3749-3767 (2018). https://doi.org/10.1002/mp.13023
Baidu ScholarGoogle Scholar
12. A.J. Berkhout,

Least-squares inverse filtering and wavelet deconvolution

. Geophysics 42, 13691383 (1977). https://doi.org/10.1190/1.1440798
Baidu ScholarGoogle Scholar
13. D. Sage, L. Donati, F. Soulez et al.,

DeconvolutionLab2: an open-source software for deconvolution microscopy

. Methods 115, 2841 (2017). https://doi.org/10.1016/j.ymeth.2016.12.015
Baidu ScholarGoogle Scholar
14. W. Richardson,

Bayesian-based iterative method of image restoration

. J. Opt. Soc. Am. 62, 5559 (1972). https://doi.org/10.1364/JOSA.62.000055
Baidu ScholarGoogle Scholar
15. G. Coote,

Iterative smoothing and deconvolution of one- and two-dimensional elemental distribution data

. Nucl. Instrum. Meth. B 130, 118122 (1997). https://doi.org/10.1016/S0168-583X(97)00218-8
Baidu ScholarGoogle Scholar
16. R. Real, Q.N. Jin,

A revisit on Landweber iteration

. Inverse Probl. 36, 075011 (2020). https://doi.org/10.1088/1361-6420/ab8bc4
Baidu ScholarGoogle Scholar
17. Y.L. You, M. Kaveh,

A regularization approach to joint blur identification and image restoration

. IEEE Trans. Image Process. 5, 416428 (1996). https://doi.org/10.1109/83.491316
Baidu ScholarGoogle Scholar
18. J. Yang, Z.J. Zhang, Q.M. Cheng,

Resolution enhancement in micro-XRF using image restoration techniques

. J. Anal. At. Spectrom. 37, 750758 (2022). https://doi.org/10.1039/D1JA00425E
Baidu ScholarGoogle Scholar
19. M. Dehlinger, C. Fauquet, S. Lavandier et al.,

Spatial resolution of confocal XRF technique using capillary optics

. Nanoscale Res. Lett. 8, 271 (2013). https://doi.org/10.1186/1556-276X-8-271
Baidu ScholarGoogle Scholar
20. Y.J. Xu, X. Liu, X. Cao et al.,

Artificial intelligence: a powerful paradigm for scientific research

. Innov. 2, 100179 (2021). https://doi.org/10.1016/j.xinn.2021.100179
Baidu ScholarGoogle Scholar
21. L.W. Yue, H.F. Shen, J. Li et al.,

Image super-resolution: The techniques, applications, and future

. Signal Process. 128, 389408 (2016). https://doi.org/10.1016/j.sigpro.2016.05.002
Baidu ScholarGoogle Scholar
22. Z.H. Wang, J. Chen, S.C.H. Hoi,

Deep learning for image super-resolution: a survey

. IEEE Trans. Pattern Anal. Mach. Intell. 43, 33653387 (2021). https://doi.org/10.1109/TPAMI.2020.2982166
Baidu ScholarGoogle Scholar
23. C. Dong, C. C. Loy, K.M. He et al.,

Image super-resolution using deep convolutional networks

. IEEE T. Pattern Anal. Mach. Intell. 38, 295307. https://doi.org/10.1109/TPAMI.2015.2439281
Baidu ScholarGoogle Scholar
24. C. Ledig, L. Theis, F. Huszár et al.,

Photo-realistic single image super-resolution using a generative adversarial network

. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, pp. 105-114 (2017). https://doi.org/10.1109/CVPR.2017.19
Baidu ScholarGoogle Scholar
25. X.T. Wang, K. Yu, S.X. Wu et al.,

ESRGAN: enhanced super-resolution generative adversarial networks

. In: Leal-Taixé, L., Roth, S. (eds) Computer Vision – ECCV 2018 Workshops. ECCV 2018. Lecture Notes in Computer Science, Springer, Cham. Vol. 11133, pp. 6379 (2018). https://doi.org/10.1007/978-3-030-11021-5_5
Baidu ScholarGoogle Scholar
26. X.T. Wang, L.B. Xie, C. Dong et al.,

Real-ESRGAN: training real-world blind super-resolution with pure synthetic data

. 2021 IEEE/CVF International Conference on Computer Vision Workshops (ICCVW). Montreal, BC, Canada. IEEE, 1905-1914 (2021). https://doi.org/10.1109/ICCVW54120.2021.00217
Baidu ScholarGoogle Scholar
27. X. Liu, F.J. Zhang, Z.Y. Hou et al.,

Self-supervised learning: generative or contrastive

. IEEE Trans. Knowl. Data Eng. 35, 857876 (2023). https://doi.org/10.1109/TKDE.2021.3090866
Baidu ScholarGoogle Scholar
28. Z.Z. Zhou, C. Li, X.X. Bi et al.,

A machine learning model for textured X-ray scattering and diffraction image denoising

. NPJ Comput. Mater. 9, 58 (2023). https://doi.org/10.1038/s41524-023-01011-w
Baidu ScholarGoogle Scholar
29. C. Qiao, D. Li, Y.T. Guo et al.,

Evaluation and development of deep neural networks for image super-resolution in optical microscopy

. Nat. Methods 18, 194202 (2021). https://doi.org/10.1038/s41592-020-01048-5
Baidu ScholarGoogle Scholar
30. X. Li, Y. Zhang, Y. Liu et al.,

A high-throughput big-data orchestration and processing system for the High Energy Photon Source

J. Synchrotron Radiat. 30, 10861091 (2023). https://doi.org/10.1107/S1600577523006951
Baidu ScholarGoogle Scholar
31. S.L. Li, Y. Li, Y.K. Wang et al.,

Multiscale residual stress evaluation of engineering materials/components based on neutron and synchrotron radiation technology

. Acta Metall. Sin. 59, 10011014 (2023). https://doi.org/10.11900/0412.1961.2023.00157
Baidu ScholarGoogle Scholar
32. J. Brunet, C.L. Walsh, W.L. Wagner et al.,

Preparation of large biological samples for high-resolution, hierarchical, synchrotron phase-contrast tomography with multimodal imaging compatibility

. Nat. Protoc. 18, 14411461 (2023). https://doi.org/10.1038/s41596-023-00804-z
Baidu ScholarGoogle Scholar
33. Y. Huang, T.G. Fleming, S.J. Clark et al.,

Keyhole fluctuation and pore formation mechanisms during laser powder bed fusion additive manufacturing

. Nat. Commun. 13, 1170 (2022). https://doi.org/10.1038/s41467-022-28694-x
Baidu ScholarGoogle Scholar
34. X. Wei, B.B. Zhang, D.R. Sun et al.,

Ultrafast X-ray diffraction development at high repetition rate in Beijing Synchrotron Radiation Facility

. Nucl. Tech. (in Chinese) 40, 100101 (2017). https://doi.org/10.11889/j.0253-3219.2017.hjs.40.100101
Baidu ScholarGoogle Scholar
35. P. Zhang, W.Z. Dou, H.P. Liu,

Hierarchical data structures for flowchart

. Sci. Rep. 13, 5800 (2023). https://doi.org/10.1038/s41598-023-31968-z
Baidu ScholarGoogle Scholar
36. C.P. Wang, U. Steiner, A. Sepe,

Synchrotron big data science

. Small 14, 1802291 (2018). https://doi.org/10.1002/smll.201802291
Baidu ScholarGoogle Scholar
37. Y.H. Dong, C. Li, Y. Zhang et al.,

Exascale image processing for next-generation beamlines in advanced light sources

. Nat. Rev. Phys. 4, 427428 (2022). https://doi.org/10.1038/s42254-022-00465-z
Baidu ScholarGoogle Scholar
38. S. Hauf, B. Heisen, S. Aplin et al.,

The Karabo distributed control system

. J. Synchrotron Radiat. 26, 14481461 (2019). https://doi.org/10.1107/s1600577519006696
Baidu ScholarGoogle Scholar
39. Y. Liu, Y.D. Geng, X.X. Bi et al.,

Mamba: a systematic software solution for beamline experiments at HEPS

. J. Synchrotron Radiat. 29, 664669 (2022). https://doi.org/10.1107/s1600577522002697
Baidu ScholarGoogle Scholar
40. Y. Jiao, G. Xu, X.H. Cui et al.,

The HEPS project

. J. Synchrotron Radiat. 25, 16111618 (2018). https://doi.org/10.1107/s1600577518012110
Baidu ScholarGoogle Scholar
41. G. Pacchioni,

An upgrade to a bright future

. Nat. Rev. Phys. 1, 100101 (2019). https://doi.org/10.1038/s42254-019-0019-5
Baidu ScholarGoogle Scholar
42. F. De Carlo, D. Gürsoy, D.J. Ching et al.,

TomoBank: a tomographic data repository for computational X-ray science

. Meas. Sci. Technol. 29, 034004 (2018). https://doi.org/10.1088/1361-6501/aa9c19
Baidu ScholarGoogle Scholar
43. V.A. Solé, E. Papillon, M. Cotte et al.,

A multiplatform code for the analysis of energy-dispersive X-ray fluorescence spectra

. Spectrochim. Acta. Part. B. At. Spectrosc. 62, 6368 (2007). https://doi.org/10.1016/j.sab.2006.12.002
Baidu ScholarGoogle Scholar
44. D. Gürsoy, F. De Carlo, X. Xiao et al.,

TomoPy: a framework for the analysis of synchrotron tomographic data

. J. Synchrotron Radiat. 21, 11881193 (2014). https://doi.org/10.1107/S1600577514013939
Baidu ScholarGoogle Scholar
45. J. Schindelin, I. Arganda-Carreras, E. Frise et al.,

Fiji: an open-source platform for biological-image analysis

. Nat. Meth. 9, 676682 (2012). https://doi.org/10.1038/nmeth.2019
Baidu ScholarGoogle Scholar
46. A. Shocher, N. Cohen, M. Irani,

Zero-shot super-resolution using deep internal learning

. 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City, UT, USA. IEEE, 3118-3126 (2018). https://doi.org/10.1109/CVPR.2018.00329
Baidu ScholarGoogle Scholar
47. Z.Y. Tan, M.L. Gao, X.H. Li et al.,

A flexible reference-insensitive spatiotemporal fusion model for remote sensing images using conditional generative adversarial network

. IEEE Trans. Geosci. Remote. Sens. 60, 5601413 (2022). https://doi.org/10.1109/TGRS.2021.3050551
Baidu ScholarGoogle Scholar
48. J.J. Qiao, H.H. Song, K.H. Zhang et al.,

Image super-resolution using conditional generative adversarial network

. IET Image Processing 13, 26732679 (2019). https://doi.org/10.1049/iet-ipr.2018.6570
Baidu ScholarGoogle Scholar
49. S.P. Liu, H.M. Zhao, J.M. Hong et al.,

Medical image synthesis using robust conditional GAN

. Acta Electron. Sin. 51, 427437 (2023). https://doi.org/10.12263/DZXB.20210051
Baidu ScholarGoogle Scholar
50. D.S. Biggs, M. Andrews,

Acceleration of iterative image restoration algorithms

. Appl. Opt. 36, 17661775 (1997). https://doi.org/10.1364/ao.36.001766
Baidu ScholarGoogle Scholar
51. R.J. Hanisch, R.L. White, R.L. Gilliland, Deconvolutions of Hubble Space Telescope Images and Spectra, in Deconvolution of Images and Spectra, Ed. P.A. Jansson, 2nd ed. (Academic Press, CA, 1997).
52. H.X. Xie, X. Tian, L.N. He et al.,

Spatial metallomics reveals preferable accumulation of methylated selenium in a single seed of the hyperaccumulator cardamine violifolia

. J. Agric. Food Chem. 71, 26582665 (2023). https://doi.org/10.1021/acs.jafc.2c08112
Baidu ScholarGoogle Scholar
53. R.S. Liu, R.D. Wu, B. V. Hoorick et al.,

Zero-1-to-3: Zero-shot one image to 3D object

. 2023 IEEE/CVF International Conference on Computer Vision (ICCV), Paris, France, 2023, pp. 9264-9275. https://doi.org/10.1109/ICCV51070.2023.00853
Baidu ScholarGoogle Scholar
Footnote

The authors declare that they have no competing interests.