Multi-exposure diffraction image high dynamic range fusion method and system based on transformer

By adopting a Transformer-based high dynamic range fusion method for multiple exposure diffraction images, the problem of insufficient information retention in multiple exposure diffraction image fusion is solved, and high dynamic range and high precision sample spatial structure reconstruction are achieved.

CN123032541APending Publication Date: 2026-11-03HEFEI HAOYU CORE LIGHT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611138947.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing technologies struggle to fully uncover the deep feature relationships between different exposure images during multi-exposure diffraction image fusion, leading to information loss in bright areas and insufficient recovery of details in weak signal areas, thus affecting the dynamic range expansion effect of the fused diffraction intensity image.

Method used

A high dynamic range fusion method based on Transformer-based multiple exposure diffraction images is adopted. By acquiring multiple diffraction intensity images at different exposure times, preprocessing and generating exposure-aware information, extracting features using the cross-exposure Transformer fusion mechanism, and combining radial frequency domain prior constraints, a high dynamic range diffraction intensity image is generated. Finally, phase recovery is performed to reconstruct the spatial structure of the sample.

Benefits of technology

It improves the information retention capability of multi-exposure diffraction image fusion, generates diffraction intensity images with higher dynamic range and more complete structural information, and improves the reliability and accuracy of sample spatial structure reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123032541A_ABST
    Figure CN123032541A_ABST
Patent Text Reader

Abstract

The application provides a multi-exposure diffraction image high dynamic range fusion method and system based on a Transformer, and relates to the fields of image processing and artificial intelligence reconstruction. The method comprises the following steps: obtaining multiple diffraction intensity images of the same sample formed under multiple different exposure times, and performing preprocessing to obtain preprocessed diffraction images; generating exposure perception information according to the preprocessed diffraction images; extracting multi-exposure diffraction image features based on the exposure perception information; performing cross-exposure Transformer fusion on the multi-exposure diffraction image features to obtain initial fusion features; performing radial frequency domain prior constraint on the initial fusion features to obtain high dynamic range fusion features; generating a high dynamic range diffraction intensity image based on the high dynamic range fusion features; and performing phase recovery according to the high dynamic range diffraction intensity image to obtain a sample spatial structure reconstruction result. The technical problem of insufficient effective information retention capability in the multi-exposure diffraction image fusion process of the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of image processing and artificial intelligence reconstruction technology, and in particular to a method and system for high dynamic range fusion of multiple exposure diffraction images based on Transformer. Background Technology

[0002] With the development of computational diffraction imaging technology, methods for reconstructing sample structures based on diffraction intensity information have been widely applied in fields such as microstructure detection, material analysis, and biological sample imaging. To improve the information integrity of diffraction images, existing methods typically process multi-exposure diffraction images using exposure time weighting, pixel-level fusion, or traditional high dynamic range imaging algorithms. This involves selecting effective regions from different exposure images and synthesizing their intensities to obtain a diffraction intensity image with expanded dynamic range. A phase retrieval algorithm is then used to reconstruct the sample's spatial structure based on the fused diffraction intensity information. However, due to the significant spatial distribution differences between strong and weak signal regions in diffraction images, traditional fusion methods often rely on fixed weights or local pixel information for fusion. This makes it difficult to fully explore the deep feature relationships between different exposure images, easily leading to the loss of information in bright areas and insufficient recovery of details in weak signal areas, thus affecting the dynamic range expansion effect of the fused diffraction intensity image. Therefore, a method is urgently needed to address the technical problem of insufficient effective information retention in the multi-exposure diffraction image fusion process of existing technologies. Summary of the Invention

[0003] This application provides a method and system for high dynamic range fusion of multiple exposure diffraction images based on Transformer, which solves the technical problem of insufficient effective information retention in the process of multiple exposure diffraction image fusion in the prior art.

[0004] To achieve the above objectives, this application adopts the following technical solution: Firstly, a Transformer-based method for high dynamic range fusion of multiple exposure diffraction images is provided, comprising: acquiring multiple diffraction intensity images of the same sample at multiple different exposure times; wherein the multiple diffraction intensity images include short-exposure diffraction images, medium-exposure diffraction images, and long-exposure diffraction images; preprocessing the multiple diffraction intensity images to obtain preprocessed diffraction images; generating exposure sensing information based on the preprocessed diffraction images; extracting features of the multiple exposure diffraction images based on the exposure sensing information; performing cross-exposure Transformer fusion on the features of the multiple exposure diffraction images to obtain initial fusion features; applying radial frequency domain prior constraints to the initial fusion features to obtain high dynamic range fusion features; generating a high dynamic range diffraction intensity image based on the high dynamic range fusion features; and performing phase retrieval based on the high dynamic range diffraction intensity image to obtain the sample spatial structure reconstruction result.

[0005] In conjunction with the first aspect mentioned above, in one possible implementation, multiple diffraction intensity images are preprocessed to obtain preprocessed diffraction images. This includes: performing dark field correction and flat field correction on each exposure diffraction image to eliminate detector dark current noise and pixel response inhomogeneity, thereby obtaining a corrected diffraction image; performing bad pixel repair and random noise suppression on the corrected diffraction image to obtain a noise-corrected image; normalizing the intensity of the noise-corrected image according to the exposure time corresponding to each exposure diffraction image so that different exposure diffraction images correspond to the same physical intensity scale, thereby obtaining a normalized exposure diffraction image; and performing spatial registration on the normalized exposure diffraction image so that the corresponding pixel positions of different exposure diffraction images remain consistent, thereby obtaining the preprocessed diffraction image.

[0006] In conjunction with the first aspect mentioned above, in one possible implementation, generating exposure-aware information based on the preprocessed diffraction images includes: obtaining the exposure time corresponding to each preprocessed diffraction image, and determining the exposure time code based on each exposure time, wherein the exposure time code is mapped to a fixed-dimensional exposure code vector using a positional encoding method; performing pixel-by-pixel traversal on each preprocessed diffraction image according to a preset saturation threshold, determining whether the grayscale value of each pixel has reached saturation, and generating a corresponding saturation region binary mask based on the determination result; expanding the exposure code vector to a feature dimension consistent with the feature space of the corresponding diffraction image to obtain exposure code features; converting the saturation region binary mask into a mask matrix consistent with the spatial size of the corresponding diffraction image, and associating the exposure code features with the mask matrix to generate exposure-aware information.

[0007] In conjunction with the first aspect mentioned above, in one possible implementation, exposure coding features are correlated with a mask matrix to generate exposure-aware information. This includes: mapping the exposure coding features to the feature space of the corresponding exposure diffraction images according to their correspondence, obtaining an exposure coding feature set; mapping the mask matrix to the same spatial resolution as the corresponding exposure diffraction image features, and aligning it with the corresponding exposure diffraction image features according to pixel positions, obtaining an aligned mask matrix; applying mask constraints to the corresponding exposure diffraction image features based on the aligned mask matrix, suppressing feature responses in saturated regions and retaining effective feature responses in unsaturated regions, obtaining mask-constrained features; and fusing the mask-constrained features with the corresponding exposure coding feature set to obtain exposure-aware information.

[0008] In conjunction with the first aspect mentioned above, one possible implementation involves extracting multi-exposure diffraction image features based on exposure perception information, including: inputting exposure perception information into a feature extraction network for convolutional encoding to extract local texture information and edge structure information corresponding to each exposure diffraction image, obtaining a shallow feature map; performing multi-layer feature mapping and downsampling processing on the shallow feature map to extract global structure information and spatial features in the diffraction image, obtaining a deep feature map; performing feature aggregation on the shallow feature map and the deep feature map to obtain a multi-scale fusion feature map; performing feature vectorization processing on the multi-scale fusion feature map to convert spatial features into feature sequences, obtaining an exposure feature sequence; and performing sequence position identification on the exposure feature sequence to obtain multi-exposure diffraction image features.

[0009] In conjunction with the first aspect mentioned above, in one possible implementation, cross-exposure Transformer fusion is performed on the features of multi-exposure diffraction images to obtain initial fused features. This includes: mapping the features of multi-exposure diffraction images to query features, key features, and value features respectively, to obtain query matrices, key matrices, and value matrices; calculating cross-exposure attention weights between diffraction images of different exposures based on the query matrix and key matrix, to obtain cross-exposure correlation matrices; using the cross-exposure correlation matrix to perform weighted aggregation on the value matrix, to obtain cross-exposure fused features; performing residual connections and layer normalization on the cross-exposure fused features, to obtain normalized fused features; and inputting the normalized fused features into a feedforward network for nonlinear mapping, to obtain initial fused features.

[0010] In conjunction with the first aspect mentioned above, in one possible implementation, radial frequency domain prior constraints are applied to the initial fusion features to obtain high dynamic range fusion features. This includes: calculating the radial distance between each feature position in the initial fusion features and the image center based on the center position of the diffraction image corresponding to the initial fusion features, obtaining radial distance distribution data; dividing the initial fusion features into a central low-frequency feature region, a mid-frequency structural feature region, and an edge high-frequency feature region based on the radial distance distribution data, obtaining frequency domain region segmentation features; determining the feature constraint weights corresponding to each frequency domain region based on the frequency domain region segmentation features, obtaining a frequency domain constraint weight matrix, wherein the central low-frequency feature region corresponds to a strong signal preservation weight, the mid-frequency structural feature region corresponds to a structural information preservation weight, and the edge high-frequency feature region corresponds to a weak signal enhancement weight; using the frequency domain constraint weight matrix to perform weighted adjustments on the central low-frequency feature region, the mid-frequency structural feature region, and the edge high-frequency feature region respectively, obtaining a frequency domain optimized fusion feature; and performing region stitching on the frequency domain optimized fusion feature to obtain high dynamic range fusion features.

[0011] In conjunction with the first aspect mentioned above, in one possible implementation, generating a high dynamic range diffraction intensity image based on high dynamic range fusion features includes: inputting the high dynamic range fusion features into an image reconstruction network for feature decoding; recovering the spatial resolution corresponding to the high dynamic range fusion features through stepwise upsampling to obtain a spatial reconstruction feature map; performing channel mapping processing on the spatial reconstruction feature map to convert multi-channel features into single-channel intensity features to obtain a predicted intensity feature map; performing intensity recovery processing on the predicted intensity feature map to obtain linear intensity distribution data; and generating a corresponding high dynamic range diffraction intensity image based on the linear intensity distribution data.

[0012] In conjunction with the first aspect mentioned above, in one possible implementation, phase retrieval based on the high dynamic range diffraction intensity image is used to obtain the sample spatial structure reconstruction result. This includes: calculating the square root of the intensity value of each pixel in the high dynamic range diffraction intensity image to obtain the corresponding initial diffraction amplitude data; constructing an initial complex amplitude based on the initial diffraction amplitude data, and converting the initial complex amplitude to the frequency domain through Fourier transform to obtain frequency domain complex amplitude data; iteratively updating the frequency domain complex amplitude data using the frequency domain constraints corresponding to the high dynamic range diffraction intensity image and the sample spatial constraints to obtain optimized complex amplitude data; performing an inverse Fourier transform on the optimized complex amplitude data to obtain the sample spatial domain complex amplitude distribution; and extracting amplitude and phase information based on the sample spatial domain complex amplitude distribution to generate the sample spatial structure reconstruction result.

[0013] Secondly, a Transformer-based high dynamic range fusion system for multiple exposure diffraction images is provided, executing the method described in the first aspect and any possible implementation thereof. The system includes: a data acquisition module for acquiring multiple diffraction intensity images of the same sample formed at multiple different exposure times; wherein the multiple diffraction intensity images include short-exposure diffraction images, medium-exposure diffraction images, and long-exposure diffraction images; an image preprocessing module for preprocessing the multiple diffraction intensity images to obtain preprocessed diffraction images; and an exposure sensing information generation module for generating information based on the preprocessed diffraction images. The system generates exposure-aware information; a multi-exposure feature extraction module is used to extract multi-exposure diffraction image features based on the exposure-aware information; a Transformer fusion module is used to perform cross-exposure Transformer fusion of multi-exposure diffraction image features to obtain initial fused features; a radial frequency domain constraint module is used to apply radial frequency domain prior constraints to the initial fused features to obtain high dynamic range fusion features; an image reconstruction module is used to generate a high dynamic range diffraction intensity image based on the high dynamic range fusion features; and a phase recovery module is used to perform phase recovery based on the high dynamic range diffraction intensity image to obtain the sample spatial structure reconstruction result.

[0014] This application provides a Transformer-based method and system for high dynamic range fusion of multiple exposure diffraction images. It utilizes complementary information between diffraction intensity images at different exposure times, guides multi-exposure feature extraction through exposure-aware information, and combines a cross-exposure Transformer fusion mechanism to achieve deep correlation modeling of features from different exposure images, improving the completeness of multi-exposure diffraction information fusion. Simultaneously, it enhances the information retention capability of different frequency regions in the fused features through radial frequency domain prior constraints, reducing information loss caused by saturation in strong signal regions and detail attenuation in weak signal regions. This generates diffraction intensity images with higher dynamic range and more complete structural information, providing more accurate intensity constraints for subsequent phase recovery, improving the reliability and accuracy of sample spatial structure reconstruction, and solving the technical problem of insufficient effective information retention in the multi-exposure diffraction image fusion process in existing technologies.

[0015] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description

[0016] Figure 1 A system architecture diagram of a Transformer-based high dynamic range fusion system for multiple exposure diffraction images is provided for embodiments of this application; Figure 2 A flowchart illustrating a Transformer-based high dynamic range fusion method for multiple exposure diffraction images provided in this application embodiment. Figure 1 ; Figure 3 A flowchart illustrating a Transformer-based high dynamic range fusion method for multiple exposure diffraction images provided in this application embodiment. Figure 2 ; Figure 4 A flowchart illustrating a Transformer-based high dynamic range fusion method for multiple exposure diffraction images provided in this application embodiment. Figure 3 ; Figure 5 A flowchart illustrating a Transformer-based high dynamic range fusion method for multiple exposure diffraction images provided in this application embodiment. Figure 3 ; Figure 6 A schematic diagram of the radial frequency domain structure prior module provided in the embodiments of this application. Detailed Implementation

[0017] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.

[0018] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0019] Example 1: The Transformer-based high dynamic range fusion method for multiple exposure diffraction images provided in this application can be applied to, for example... Figure 1 The Transformer-based high dynamic range fusion system for multiple exposure diffraction images shown is as follows: Figure 1As shown, the system includes: a data acquisition module 101, used to acquire multiple diffraction intensity images of the same sample formed at multiple different exposure times; wherein, the multiple diffraction intensity images include short-exposure diffraction images, medium-exposure diffraction images, and long-exposure diffraction images; an image preprocessing module 102, used to preprocess the multiple diffraction intensity images to obtain preprocessed diffraction images; an exposure perception information generation module 103, used to generate exposure perception information based on the preprocessed diffraction images; a multi-exposure feature extraction module 104, used to extract multi-exposure diffraction image features based on the exposure perception information; a Transformer fusion module 105, used to perform cross-exposure Transformer fusion of the multi-exposure diffraction image features to obtain initial fusion features; a radial frequency domain constraint module 106, used to perform radial frequency domain prior constraints on the initial fusion features to obtain high dynamic range fusion features; an image reconstruction module 107, used to generate high dynamic range diffraction intensity images based on high dynamic range fusion features; and a phase recovery module 108, used to perform phase recovery based on the high dynamic range diffraction intensity images to obtain the sample spatial structure reconstruction result.

[0020] Example 2: To address the technical problem of insufficient effective information retention in the fusion of multi-exposure diffraction images in existing technologies, this application provides a Transformer-based high dynamic range fusion method for multi-exposure diffraction images. Figure 2 A flowchart illustrating the high dynamic range fusion method for multiple exposure diffraction images based on Transformer provided in this application embodiment. Figure 1 ,like Figure 2 As shown, the method includes: S201. Obtain multiple diffraction intensity images of the same sample at multiple different exposure times.

[0021] Among them, the diffraction intensity image is the light intensity distribution image carrying sample structural information, which is acquired by the detection device after the sample is irradiated by coherent light; different exposure times are used to adjust the response range of the detection device to different light intensity regions; multiple diffraction intensity images include short exposure diffraction images, medium exposure diffraction images and long exposure diffraction images.

[0022] In one possible implementation, the system controls the diffraction imaging device to perform multiple exposures on the same sample. By setting different exposure time parameters, corresponding diffraction intensity images are obtained respectively, and the images are classified according to the exposure time from short to long to obtain short exposure diffraction images, medium exposure diffraction images, and long exposure diffraction images, so that the diffraction intensity information collected under different exposure conditions can cover different signal intensity ranges.

[0023] It should be noted that the diffraction images corresponding to different exposure times should maintain the same sample position, optical path and detection area to ensure that there is a correspondence between different exposure images during the subsequent fusion process.

[0024] As an example, the complex amplitude distribution of the sample Calculate the ideal high dynamic range diffraction intensity image :

[0025] in, This represents the Fourier transform.

[0026] Then, multiple exposure images are generated based on different exposure times. :

[0027] in, This indicates the exposure time or exposure ratio, and can be 0.1, 1, or 10, corresponding to short exposure, medium exposure, and long exposure, respectively. This indicates the noise term. It can be composed of both Poisson noise and Gaussian noise. This indicates the detector's maximum grayscale value or saturation value. This indicates a saturation truncation operation.

[0028] Based on the above steps, this step acquires diffraction intensity information under different exposure conditions, enabling the system to simultaneously obtain imaging information of both strong and weak signal regions, thereby improving the coverage of effective information in the subsequent fusion process.

[0029] S202. Preprocess multiple diffraction intensity images to obtain preprocessed diffraction images.

[0030] Among them, the preprocessed diffraction image refers to the diffraction image data after detector error correction, noise suppression, intensity unification and spatial position calibration, which is used to eliminate the influence of non-sample factors during the acquisition process.

[0031] In one possible implementation, dark field correction and flat field correction are performed on each exposure diffraction image to eliminate detector dark current noise and pixel response non-uniformity, resulting in a corrected diffraction image. The corrected diffraction image is then subjected to bad pixel repair and random noise suppression to obtain a noise-corrected image. The noise-corrected image is then normalized in intensity according to the exposure time corresponding to each exposure diffraction image, ensuring that different exposure diffraction images correspond to the same physical intensity scale, resulting in a normalized exposure diffraction image. Finally, the normalized exposure diffraction image is spatially registered to ensure that the corresponding pixel positions of different exposure diffraction images remain consistent, resulting in a preprocessed diffraction image.

[0032] As an example, the system first acquires the original pixel intensity values ​​of each exposure diffraction image and then performs dark-field correction and flat-field correction using dark-field data collected by the detector and standard uniform illumination data, respectively. Dark-field correction removes the fixed current response generated by the detector under no-light conditions, while flat-field correction corrects the response differences between different pixel units. The system performs abnormal pixel detection on the corrected diffraction image. When a pixel response value deviates from a preset range of the surrounding area, the abnormal pixel is repaired using neighborhood interpolation. Simultaneously, random noise is suppressed using a noise filtering model to obtain a noise-corrected image. Based on the spatial offset between different exposure diffraction images, the system calculates spatial transformation parameters using feature point matching or image registration algorithms, and uses these parameters to correct the position of each exposure diffraction image, ensuring that the sample diffraction regions under different exposure conditions maintain pixel-level correspondence, resulting in a preprocessed diffraction image.

[0033] It should be noted that the preprocessing process does not change the effective information corresponding to the sample structure in the diffraction image, but reduces the impact of detector response differences, random noise, and position offset on the subsequent fusion results.

[0034] S203. Generate exposure sensing information based on the preprocessed diffraction image.

[0035] Among them, exposure perception information is used to describe the exposure state corresponding to different exposure diffraction images and the degree of effective information in each region, including exposure condition information and effective exposure area information.

[0036] In one possible implementation, the system first acquires the exposure time parameters corresponding to each preprocessed diffraction image and converts these parameters into exposure coding information that can be input into the neural network. Simultaneously, based on the relationship between the pixel intensity of the diffraction image and a preset saturation threshold, the system performs a validity assessment on each pixel, generating mask information to represent the location of saturated regions. Further, the system maps the exposure coding information to a dimension corresponding to the feature space of the diffraction image and spatially correlates the exposure coding features with the saturated region information, ensuring that each image region simultaneously possesses both an exposure state description and a validity description, thus obtaining exposure perception information.

[0037] It should be noted that exposure perception information is not directly fused from images with different exposures, but rather provides the network with prior constraints on the reliability of images under different exposure conditions before fusion, so that the subsequent feature extraction and fusion processes can distinguish the effective regions in images with different exposures.

[0038] Based on the above steps, this step constructs exposure perception information that includes exposure status and regional validity, enabling the fusion network to perceive information differences between images with different exposures and improving the ability to utilize multi-exposure information.

[0039] S204. Extract features from multi-exposure diffraction images based on exposure perception information.

[0040] Among them, multi-exposure diffraction image features refer to feature data extracted from exposure perception information that can represent sample structure, diffraction texture, and the relationship between different exposure responses.

[0041] In one possible implementation, the system inputs exposure-aware information into a feature extraction network. Convolutional layers calculate the local receptive field of the input data, extracting edge variations, texture distribution, and local intensity changes in the diffraction image to obtain a shallow feature map. The system performs multi-scale feature mapping on the shallow feature map, expanding the feature receptive range through layer-by-layer convolution and size adjustment. This enables the network to extract structural information at different spatial scales, resulting in a deep feature map containing global spatial relationships. The system then fuses the shallow and deep feature maps, forming a multi-scale fused feature map through channel concatenation or feature weighting. This multi-scale fused feature map is then unfolded into a feature sequence, converting the two-dimensional spatial features into a one-dimensional feature representation suitable for Transformer processing.

[0042] It should be noted that the feature extraction process preserves both local details and overall structural information in images with different exposures, avoiding the loss of weak signal areas or high-frequency structural information due to single-scale features.

[0043] Based on the above steps, this step extracts multi-scale features from the exposure perception information to effectively express structural and detail information in diffraction images with different exposures, thereby improving the feature integrity in the subsequent fusion process.

[0044] S205. Perform cross-exposure Transformer fusion on the features of the multi-exposure diffraction image to obtain the initial fused features.

[0045] Cross-exposure Transformer fusion refers to using the attention calculation mechanism in the Transformer structure to model the correlation between diffraction image features extracted under different exposure conditions, and to achieve adaptive feature fusion based on the information reliability of different regions.

[0046] In one possible implementation, the features of multi-exposure diffraction images are mapped to query features, key features, and value features, respectively, to obtain query matrices, key matrices, and value matrices. Cross-exposure attention weights between diffraction images of different exposures are calculated based on the query matrix and key matrix, resulting in a cross-exposure correlation matrix. The value matrix is ​​then weighted and aggregated using the cross-exposure correlation matrix to obtain cross-exposure fusion features. Residual connections and layer normalization are applied to the cross-exposure fusion features to obtain normalized fusion features. These normalized fusion features are then input into a feedforward network for nonlinear mapping to obtain initial fusion features.

[0047] Preferably, the cross-exposure Transformer fusion model converts features from images with different exposures into a token sequence: ; ; Then merge the three sets of tokens: The fused features are obtained by performing self-attention calculation through a Transformer encoder: ,in, These are exposure-perceived features of short-exposure, medium-exposure, and long-exposure images, respectively, after shallow feature extraction and the addition of exposure time encoding. For feature segmentation function, For splicing operations, For transformer fusion networks.

[0048] Preferably, in another embodiment, a cross-attention mechanism can be used, with medium exposure features as query Q and short and long exposure features as key K and value V, thereby realizing a fusion strategy that uses medium exposure as a reference and short and long exposure as supplementary information.

[0049] Based on the above steps, a global attention mechanism is used to achieve intelligent selection and complementarity of multi-exposure information, overcoming the limitation of the weighted average method in handling complex spatial variation relationships, and improving the information integrity and accuracy of fused features.

[0050] S206. Apply radial frequency domain prior constraints to the initial fusion features to obtain high dynamic range fusion features.

[0051] Among them, the radial frequency domain prior constraint is based on the concentric ring-shaped frequency distribution pattern unique to diffraction images. It applies structured guidance to the fusion features in accordance with physical expectations, aiming to correct the frequency domain structural distortion that may be generated by the pure data-driven model, and ensure that the fusion result maintains the consistency of diffraction physics while expanding the dynamic range.

[0052] In one possible implementation, the system divides the feature space into different frequency bands, such as the central low-frequency region, the mid-frequency structure region, and the edge high-frequency region, based on the radial distance of the feature location relative to the image center. Differentiated constraint weights or modulation functions are set for each frequency band, such as enhancing signal fidelity in the low-frequency region and enhancing weak signal response in the high-frequency region, thereby optimizing the frequency domain distribution characteristics of the fused features.

[0053] It should be noted that the implementation of radial frequency domain prior is not limited to fixed partition weighting. It can also be a learnable radial basis function, frequency domain filter, or physical loss regularization term. The number of regions and boundaries can be preset fixed values ​​or dynamically determined based on the input image.

[0054] Based on the above steps, by explicitly embedding the physical laws of diffraction into the feature optimization process, non-physical artifacts that may be introduced during the fusion process are effectively suppressed, ensuring the authenticity of the output features in the frequency domain structure, and providing physically constrained feature support for high-quality image reconstruction.

[0055] S207. Generate high dynamic range diffraction intensity images based on high dynamic range fusion features.

[0056] Generating a high dynamic range diffraction intensity image is the process of decoding and restoring abstract high-dimensional fusion features into two-dimensional intensity distribution data with clear physical dimensions. This image should simultaneously possess accurate central strong signal values ​​and clear edge weak signal details, and its dynamic range should be superior to any single-exposure input image.

[0057] In one possible implementation, high dynamic range fusion features are input into an image reconstruction network for feature decoding. The spatial resolution corresponding to the high dynamic range fusion features is recovered by progressive upsampling to obtain a spatial reconstruction feature map. The spatial reconstruction feature map is then processed by channel mapping to convert multi-channel features into single-channel intensity features, resulting in a predicted intensity feature map. The predicted intensity feature map is then processed by intensity recovery to obtain linear intensity distribution data. Finally, a corresponding high dynamic range diffraction intensity image is generated based on the linear intensity distribution data.

[0058] It should be noted that the specific path of image generation can be end-to-end direct prediction or multi-stage cascaded reconstruction. The output format can be a linear intensity map or a logarithmic intensity map. If the output is in logarithmic form, it needs to be exponentially restored before subsequent use. In addition, additional post-processing steps such as denoising or sharpening can be introduced to further improve visual quality and data usability.

[0059] Preferably, since the diffraction image has a very large dynamic range, directly predicting the linear intensity can easily lead to the strong central signal dominating the training. Therefore, this embodiment prefers the network to predict the logarithmic intensity. :

[0060] Then, linear strength is restored through exponential transformation. :

[0061] This approach can take into account both strong signals at the center and weak signals at the edges, thereby improving the stability of model training and the ability to recover high-frequency details.

[0062] Optionally, the image reconstruction network adopts a U-Net decoding structure symmetrical to the feature extraction network, containing four upsampling modules. Each module consists of bilinear interpolation upsampling (upsampling factor of 2), 3×3 convolution, batch normalization, and ReLU activation. The number of channels decreases progressively from 512 to 256, 128, and 64, and finally, the feature channels are mapped to single-channel intensity outputs through 1×1 convolutions.

[0063] Based on the above steps, this step achieves accurate mapping from abstract fusion features to real physical diffraction images, solving the dual defects of center saturation and low edge signal-to-noise ratio in single-exposure images in one go, and outputting a diffraction data source adapted for high-precision phase recovery.

[0064] S208. Phase recovery is performed based on the high dynamic range diffraction intensity image to obtain the sample spatial structure reconstruction result.

[0065] In one possible implementation, the initial diffraction amplitude data is obtained by calculating the square root of the intensity value of each pixel in the high dynamic range diffraction intensity image; an initial complex amplitude is constructed based on the initial diffraction amplitude data, and the initial complex amplitude is converted to the frequency domain through Fourier transform to obtain frequency domain complex amplitude data; the frequency domain complex amplitude data is iteratively updated using the frequency domain constraints corresponding to the high dynamic range diffraction intensity image and the sample space constraints to obtain optimized complex amplitude data; an inverse Fourier transform is performed on the optimized complex amplitude data to obtain the sample spatial domain complex amplitude distribution; amplitude information and phase information are extracted based on the sample spatial domain complex amplitude distribution to generate the sample spatial structure reconstruction result.

[0066] As an example, the system extracts the diffraction amplitude pixel by pixel by taking the square root of the HDR diffraction pattern to construct the initial spatial complex amplitude distribution; it is then transformed to the frequency domain by Fourier transform, and the sample spatial support constraints and diffraction amplitude constraints are simultaneously superimposed. An iterative algorithm is used to repeatedly correct the phase and amplitude of the frequency domain complex amplitude; after the iteration converges, an inverse Fourier transform is performed to restore the spatial domain complex amplitude, and the amplitude and phase components are separated to reconstruct the complete sample microstructure.

[0067] As an example, phase retrieval uses a mixed-input-output (HIO) algorithm for iterative updates, with 200 iterations, or until the relative error between two adjacent iterations is less than a preset threshold of 10. 6 The frequency domain constraint is to replace the magnitude of the frequency domain complex amplitude with the square root of the high dynamic range diffraction intensity image. The sample spatial constraint is to set the complex amplitude outside the sample support domain to zero, while keeping the complex amplitude inside the support domain unchanged.

[0068] Preferably, a joint loss function is used when training the exposure-aware Transformer fusion network. :

[0069] Among them, logarithmic strength loss for: Linear intensity The loss is: Exposure consistency The loss is: ,in, Gradient Preservation Loss for: Radial intensity distribution loss for: ,in, This represents the function for calculating the radial average strength curve. In the above formula, To predict log strength, To restore linear intensity, This is an ideal high dynamic range diffraction intensity image.

[0070] This application first acquires diffraction intensity information under different exposure conditions and eliminates acquisition errors through preprocessing. Then, exposure-aware information is constructed to enable the fusion process to identify the validity of information in different exposure regions. Furthermore, a Transformer is used to achieve cross-exposure feature interaction, and the fusion result is optimized by combining radial frequency domain prior constraints. Finally, a high dynamic range diffraction intensity image is generated and phase retrieval is completed. Through the above processing, the ability to retain effective diffraction information during multi-exposure diffraction image fusion is improved, enhancing the sample structure reconstruction effect under complex dynamic range conditions.

[0071] Example 3: In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 3 As shown, the above S203 can be specifically implemented through the following S301 to S304, which are explained in detail below: S301. Obtain the exposure time corresponding to each preprocessed diffraction image, and determine the exposure time code based on each exposure time.

[0072] Among them, the exposure time encoding adopts the position encoding method to map to a fixed-dimensional exposure encoding vector; the exposure time encoding is a feature information used to describe the differences in exposure state during different diffraction image acquisition processes. By converting continuous exposure time parameters into a fixed-dimensional vector, different exposure conditions can be identified by the feature extraction network.

[0073] In one possible implementation, the system acquires the exposure time parameters corresponding to short-exposure diffraction images, medium-exposure diffraction images, and long-exposure diffraction images, normalizes the exposure time parameters, and maps the continuous exposure time to a preset value range. Further, the normalized exposure time is input into the exposure encoding mapping module, and an exposure encoding vector of the corresponding dimension is generated through position encoding, so that each diffraction image corresponds to an encoding vector containing exposure information.

[0074] It should be noted that exposure time encoding does not directly alter the original diffraction intensity data. Instead, it serves as auxiliary information, inputting it along with image features into the subsequent fusion process, enabling the fusion network to distinguish the sources of feature information under different exposure conditions. Sine position encoding is a preferred method for exposure time encoding.

[0075] Preferably, exposure time encoding Satisfy the following formula:

[0076] in, Features of the diffraction image with an exposure time of t. This is the exposure time encoding function, used to map exposure time information into an encoding vector that matches the dimensions of image features.

[0077] S302. Based on the preset saturation threshold, each preprocessed diffraction image is traversed pixel by pixel to determine whether the gray value of each pixel has reached the saturation state, and a corresponding binary mask of the saturation region is generated based on the determination result.

[0078] Among them, the saturation region binary mask is used to identify the intensity saturation region in the diffraction image caused by excessive exposure time. By locating the saturation region, distorted intensity information is avoided during the subsequent fusion process.

[0079] In one possible implementation, the system acquires each preprocessed exposure diffraction image, compares the pixel intensity value in each diffraction image with a preset saturation threshold; when the pixel intensity value is greater than or equal to the saturation threshold, the pixel is marked as a saturated pixel and assigned a value of 1; when the pixel intensity value is less than the saturation threshold, the pixel is marked as a valid pixel and assigned a value of 0; after traversing the entire diffraction image, a binary mask of the saturated region with the same size as the original diffraction image is generated.

[0080] Preferably, a binary mask for the saturated region. Satisfy the following formula:

[0081] in, This represents the intensity value of the corresponding pixel in the preprocessed diffraction image; This indicates the preset saturation threshold.

[0082] It should be noted that the saturation region determination process is performed separately for each exposure diffraction image, so that the information-deficient regions caused by dynamic range limitations under different exposure times can be independently identified.

[0083] Based on the above steps, this step establishes pixel-level saturation region identification relationships, enabling the subsequent fusion process to identify invalid regions in images with different exposures and reduce the impact of saturation information on the fusion result.

[0084] S303. Extend the exposure coding vector to the same feature dimension as the corresponding diffraction image feature space to obtain the exposure coding features.

[0085] Among them, exposure coding features refer to converting low-dimensional exposure time coding into high-dimensional feature representations that match the diffraction image features, in order to achieve data fusion between exposure information and image spatial features.

[0086] In one possible implementation, the system inputs the exposure encoding vector into a linear mapping layer, and converts the dimension of the exposure encoding vector into a feature dimension consistent with the number of feature channels of the diffraction image through a fully connected mapping; according to the spatial size of the corresponding diffraction image, the mapped exposure encoding is copied and expanded so that each spatial location has corresponding exposure information, thus obtaining the exposure encoding features.

[0087] It should be noted that the exposure coding features are only used to provide exposure condition constraints and do not replace the spatial information of the diffraction image itself. Therefore, the consistency of exposure information is maintained during the expansion process.

[0088] As an example, when the diffraction image is processed by initial feature extraction to form a 256-dimensional channel feature map, the system maps the exposure coding vector to a 256-dimensional vector and expands it to the same size as the feature map to form the exposure coding feature.

[0089] Based on the above steps, this step converts the exposure information into a representation that matches the image feature space, thereby achieving a unified expression of exposure parameters and spatial features and improving the accuracy of subsequent exposure fusion.

[0090] S304. Convert the binary mask of the saturated region into a mask matrix with the same spatial size as the corresponding diffraction image, and associate the exposure coding features with the mask matrix to generate exposure sensing information.

[0091] Exposure perception information is used to simultaneously characterize the exposure state, saturation region distribution, and effective information region of the diffraction image, and serves as input data for subsequent multi-exposure feature extraction.

[0092] In one possible implementation, based on the correspondence between each exposure diffraction image, the exposure coding features are mapped to the feature space of the corresponding exposure diffraction image to obtain an exposure coding feature set; the mask matrix is ​​mapped to the same spatial resolution as the corresponding exposure diffraction image features and aligned with the corresponding exposure diffraction image features according to pixel position to obtain an aligned mask matrix; based on the aligned mask matrix, the corresponding exposure diffraction image features are mask-constrained to suppress the feature response in saturated regions and retain the effective feature response in unsaturated regions to obtain mask-constrained features; the mask-constrained features are fused with the corresponding exposure coding feature set to obtain exposure sensing information.

[0093] This application embodiment establishes a correspondence between diffraction image content and exposure conditions by encoding exposure time, detecting saturated regions, and associating exposure information with spatial features. This enables the subsequent Transformer fusion process to more accurately distinguish between effective and distorted regions in different exposure images, thereby improving the reconstruction quality of high dynamic range diffraction images.

[0094] Example 4: In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 4 As shown, the above S204 can be implemented by the following S401 to S404, which are explained in detail below: S401. Input the exposure perception information into the feature extraction network for convolutional encoding, extract the local texture information and edge structure information corresponding to each exposure diffraction image, and obtain a shallow feature map.

[0095] Among them, the exposure perception information is the diffraction image feature data after fusing exposure coding information and saturation region constraint information, which is used to characterize the effective information distribution of diffraction images under different exposure conditions.

[0096] In one possible implementation, the system inputs exposure-sensing information into a feature extraction network, which includes multiple consecutively connected convolutional layers, activation layers, and normalization layers. The convolutional layers perform local receptive field calculations on the exposure-sensing information, encode the intensity variation relationship between adjacent pixels, and extract diffraction spot edge changes, local texture changes, and detailed structural information. The activation function enhances the nonlinear feature representation capability, and the normalization process reduces the feature distribution differences between different exposure images, resulting in shallow feature maps corresponding to each exposure diffraction image.

[0097] It should be noted that the shallow feature extraction process preserves the local spatial response relationship in the diffraction image and does not fuse images from different exposures, so as to avoid aliasing of effective information in the initial feature stage.

[0098] As an example, when three sets of exposure perception information—short exposure, medium exposure, and long exposure—are input, the system performs convolutional encoding through a feature extraction network with shared parameters to obtain three corresponding shallow feature maps.

[0099] Based on the above steps, this step extracts detailed structural information from diffraction images with different exposures by encoding local features of the exposure perception information, thereby improving the ability to identify effective local information in the subsequent fusion process.

[0100] S402. Perform multi-layer feature mapping and downsampling on the shallow feature map to extract global structural information and spatial features from the diffraction image, and obtain the deep feature map.

[0101] Among them, deep feature maps are used to characterize cross-regional relationships and structural information between different spatial locations in diffraction images.

[0102] In one possible implementation, the system inputs a shallow feature map into a deep coding network composed of multiple feature mapping units. Through successive convolution operations, the feature receptive range is expanded, enabling the network to acquire the diffraction intensity variation patterns within a larger region. Simultaneously, downsampling operations are used to reduce the feature space size and increase the feature channel dimension, allowing the feature network to focus on high-level semantic structure information. After multiple layers of feature mapping, a deep feature map containing global spatial relationships is output.

[0103] It should be noted that a feature compression method that preserves key structural information is used during the downsampling process, so that both the low-frequency intensity distribution and high-frequency structural changes in the diffraction image can be preserved.

[0104] Based on the above steps, this step obtains global structural information in the diffraction image through deep feature mapping, so that spatial information with complementary relationships under different exposure conditions can be effectively utilized in the subsequent fusion stage.

[0105] S403. Perform feature aggregation on the shallow feature map and the deep feature map to obtain a multi-scale fused feature map.

[0106] Among them, the multi-scale fusion feature map is used to simultaneously contain local detail information from shallow features and global structural information from deep features.

[0107] In one possible implementation, the system upsamples the deep feature map based on the spatial size relationship between the shallow and deep feature maps, so that its spatial resolution is consistent with that of the shallow feature map; the upsampled deep feature map and the shallow feature map are concatenated along the channel dimension, and the concatenated features are compressed and mapped through a feature fusion convolutional layer to remove redundant responses, thereby obtaining a multi-scale fused feature map.

[0108] It should be noted that by retaining feature information at different scales at the same time, we can avoid the problems of losing local details due to relying solely on deep features, or the problem of insufficient overall structural expression due to relying solely on shallow features.

[0109] Based on the above steps, this step improves the integrity of diffraction image feature representation by fusing feature information at different scales, providing richer input features for subsequent cross-exposure Transformer fusion.

[0110] S404. Perform feature vectorization processing on the multi-scale fused feature map, convert the spatial features into feature sequences, obtain the exposure feature sequence, and mark the sequence position of the exposure feature sequence to obtain the multi-exposure diffraction image features.

[0111] Among them, the exposure feature sequence is a one-dimensional feature representation that converts two-dimensional spatial features into one-dimensional features suitable for Transformer processing, which is used to establish long-distance correlations between different spatial locations.

[0112] In one possible implementation, the system divides the multi-scale fused feature map into multiple feature regions according to a preset window size, and unfolds each feature region into a one-dimensional feature vector; all feature vectors are combined in spatial order to form an exposure feature sequence; further, a corresponding spatial position code is added to each feature vector so that the Transformer network can perceive the spatial position information corresponding to each feature and obtain multi-exposure diffraction image features.

[0113] It should be noted that the location identification process only adds spatial location information without changing the original feature content, so that the subsequent Transformer module can simultaneously use spatial relationship and exposure difference information for fusion.

[0114] Preferably, the feature extraction network comprises four convolutional modules, each consisting of a convolutional layer, a batch normalization layer, and a ReLU activation function. The first convolutional module uses a 7×7 convolutional kernel with a stride of 2 and 64 output channels; the second to fourth modules all use 3×3 convolutional kernels with a stride of 1 and output channels of 128, 256, and 512 respectively, and each module is followed by a 2×2 max-pooling layer for downsampling. Feature aggregation uses a channel concatenation method, where shallow feature maps are adjusted for the number of channels using a 1×1 convolution and then concatenated with deep feature maps upsampled to the same size, followed by a 3×3 convolution to compress them to a uniform number of channels, resulting in a multi-scale fused feature map.

[0115] Based on the above steps, this step converts multi-scale spatial features into feature sequences with positional relationships, so that the diffraction image features meet the input requirements of the Transformer structure while preserving spatial structure information.

[0116] This application embodiment uses a multi-scale feature extraction process guided by exposure perception information to obtain local detail information and global structural information in diffraction images, and converts two-dimensional spatial features into sequence features suitable for Transformer fusion, thereby improving the effective information exchange capability between diffraction images with different exposures.

[0117] Example 5: In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 5 As shown, the above S206 can be implemented by the following S501 to S505, which are explained in detail below: S501. Based on the center position of the diffraction image corresponding to the initial fusion feature, calculate the radial distance between each feature position in the initial fusion feature and the image center to obtain the radial distance distribution data.

[0118] Among them, the image center position is the center position of the diffraction pattern, which usually corresponds to the zeroth order diffraction position; the radial distance is used to characterize the spatial distance of each feature position relative to the diffraction center.

[0119] In one possible implementation, the system first obtains the two-dimensional spatial coordinates corresponding to the initial fusion features, and establishes a radial distance calculation model based on the coordinates of the center of the diffraction image. The Euclidean distance between each feature position and the image center is calculated, and all distances are stored according to their corresponding positions to form radial distance distribution data, so that each feature position has corresponding radial distance information.

[0120] It should be noted that the coordinates of the image center can be determined based on experimental calibration results or automatically estimated based on the energy distribution of the diffraction image; this application does not impose any limitations on this.

[0121] Preferably, radial distance Satisfy the following formula:

[0122] in, The center position of the diffraction image. This is the characteristic location.

[0123] Based on the above steps, this step establishes the correspondence between the fusion features and the diffraction radio frequency domain space, so that the subsequent frequency domain region division has a unified spatial basis.

[0124] S502. Based on the radial distance distribution data, the initial fusion features are divided into a central low-frequency feature region, a mid-frequency structural feature region, and an edge high-frequency feature region to obtain frequency domain region division features.

[0125] Among them, the central low-frequency feature region mainly corresponds to the low-frequency energy region in the diffraction image, the mid-frequency structural feature region corresponds to the main structural information region, and the edge high-frequency feature region corresponds to the detail information region.

[0126] In one possible implementation, the system divides all feature locations into intervals based on the radial distance. Feature locations with a radial distance less than a first distance threshold are assigned to the central low-frequency feature region, feature locations with a radial distance between the first and second distance thresholds are assigned to the mid-frequency structural feature region, and feature locations with a radial distance greater than the second distance threshold are assigned to the edge high-frequency feature region, and corresponding frequency domain region division features are generated.

[0127] It should be noted that the first distance threshold and the second distance threshold can be set proportionally according to the image size, or they can be adaptively determined based on the cumulative distribution of diffraction energy.

[0128] As an example, for a diffraction image with radius R, the system uses 0.3R and 0.7R as region division boundaries to divide all features into three frequency domain regions. Figure 6 This is a schematic diagram of the radial frequency domain structure a priori module provided in an embodiment of this application, as shown below. Figure 6 As shown, based on the radial energy distribution characteristics of the diffraction image, and taking the center position of the diffraction image as a reference, the radial distance *r* between each feature or pixel and the image center is calculated. The diffraction image is then divided into a central low-frequency region, a mid-frequency structural region, and an edge high-frequency region based on these radial distances. By introducing a region division mechanism based on radial distance, different spatial locations can select corresponding exposure information to participate in fusion according to their own imaging characteristics, thereby improving the accuracy and detail representation of HDR reconstruction of multi-exposure diffraction images.

[0129] Based on the above steps, this step enables independent management of the characteristics corresponding to different frequency regions, improving the pertinence of subsequent frequency domain constraints.

[0130] S503. Determine the feature constraint weights corresponding to each frequency domain region based on the frequency domain region division characteristics to obtain the frequency domain constraint weight matrix.

[0131] Among them, the central low-frequency feature region corresponds to the strong signal preservation weight, the mid-frequency structural feature region corresponds to the structural information preservation weight, and the edge high-frequency feature region corresponds to the weak signal enhancement weight.

[0132] In one possible implementation, the system assigns constraint weights based on the characteristic attributes corresponding to each frequency domain region, so that the central low-frequency characteristic region corresponds to a larger strong signal and retains the weight, the mid-frequency structural characteristic region corresponds to a structural information and retains the weight, and the edge high-frequency characteristic region corresponds to a weak signal enhancement and generates a frequency domain constraint weight matrix according to the region to which each characteristic position belongs.

[0133] It should be noted that the weights for each region can be fixed parameters or dynamically updated based on the training process.

[0134] Based on the above steps, this step can implement differentiated constraints according to the importance of different frequency domain regions, thereby improving the ability to retain information at different frequencies.

[0135] S504. Using the frequency domain constraint weight matrix, the central low-frequency feature region, the mid-frequency structural feature region, and the edge high-frequency feature region are weighted and adjusted respectively to obtain the frequency domain optimized fusion feature.

[0136] The weighted adjustment is used to change the characteristic response intensity of different frequency domain regions.

[0137] In one possible implementation, the system multiplies each feature position in the initial fusion feature by the corresponding constraint weight according to the correspondence of the frequency domain constraint weight matrix, so that the low frequency region maintains the original energy response, the mid frequency region maintains structural stability, and the high frequency region enhances the weak signal response, and finally obtains the frequency domain optimized fusion feature.

[0138] Based on the above steps, this step can enhance weak diffraction signals while avoiding excessive changes in low-frequency strong signals, thereby improving the dynamic range of the fusion results.

[0139] S505. Perform regional stitching on the frequency domain optimized fusion features to obtain high dynamic range fusion features.

[0140] Among them, region stitching refers to restoring the spatial correspondence between all frequency domain regions according to their original spatial locations.

[0141] In one possible implementation, the system recombines the central low-frequency feature region, the mid-frequency structural feature region, and the edge high-frequency feature region into a complete feature map based on the spatial position of each frequency domain region in the initial fusion feature, while maintaining the consistent position of the boundary of each region, and outputs high dynamic range fusion features.

[0142] It should be noted that the correspondence between all feature positions remains unchanged during the region stitching process to ensure that the diffraction intensity information can be correctly recovered in the subsequent image reconstruction stage.

[0143] Based on the above steps, this step forms a high dynamic range fusion feature that takes into account low-frequency energy preservation, high-frequency detail enhancement, and mid-frequency structural stability, thereby improving the quality of subsequent HDR diffraction image reconstruction.

[0144] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, disclosure, and appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.

[0145] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.

Claims

1. A high dynamic range fusion method for multiple exposure diffraction images based on Transformer, characterized in that, include: Multiple diffraction intensity images of the same sample formed at multiple different exposure times are acquired; wherein, the multiple diffraction intensity images include short exposure diffraction images, medium exposure diffraction images and long exposure diffraction images; The multiple diffraction intensity images are preprocessed to obtain preprocessed diffraction images; Exposure perception information is generated based on the preprocessed diffraction image; Based on the exposure perception information, multi-exposure diffraction image features are extracted; The multi-exposure diffraction image features are fused using a cross-exposure Transformer to obtain initial fused features; Radial frequency domain prior constraints are applied to the initial fusion features to obtain high dynamic range fusion features; A high dynamic range diffraction intensity image is generated based on the aforementioned high dynamic range fusion features; Phase recovery is performed based on the high dynamic range diffraction intensity image to obtain the sample spatial structure reconstruction result.

2. The method according to claim 1, characterized in that, The preprocessing of the multiple diffraction intensity images to obtain a preprocessed diffraction image includes: Dark field correction and flat field correction are performed on each exposure diffraction image to eliminate detector dark current noise and pixel response non-uniformity, thus obtaining the corrected diffraction image. The corrected diffraction image is then subjected to bad pixel repair and random noise suppression to obtain a noise-corrected image; The noise correction image is normalized in intensity according to the exposure time corresponding to each exposure diffraction image, so that different exposure diffraction images correspond to the same physical intensity scale, thus obtaining a normalized exposure diffraction image. Spatial registration is performed on the normalized exposure diffraction image to ensure that the corresponding pixel positions of different exposure diffraction images are consistent, thus obtaining the preprocessed diffraction image.

3. The method according to claim 1, characterized in that, The step of generating exposure-aware information based on the preprocessed diffraction image includes: The exposure time corresponding to each preprocessed diffraction image is obtained, and the exposure time code is determined according to each exposure time. The exposure time code is mapped to a fixed-dimensional exposure code vector using a positional coding method. The preprocessed diffraction images are traversed pixel by pixel according to the preset saturation threshold to determine whether the gray value of each pixel has reached the saturation state, and a corresponding binary mask of the saturation region is generated based on the judgment result. The exposure coding vector is extended to a feature dimension consistent with the feature space of the corresponding diffraction image to obtain the exposure coding feature; The binary mask of the saturated region is converted into a mask matrix with the same spatial size as the corresponding diffraction image, and the exposure coding features are associated with the mask matrix to generate exposure sensing information.

4. The method according to claim 3, characterized in that, The step of associating the exposure encoding features with the mask matrix to generate exposure sensing information includes: Based on the correspondence of each exposure diffraction image, the exposure coding features are mapped to the feature space of the corresponding exposure diffraction image to obtain the exposure coding feature set; The mask matrix is ​​mapped to the same spatial resolution as the corresponding exposure diffraction image features, and aligned with the corresponding exposure diffraction image features according to pixel positions to obtain an aligned mask matrix; Based on the alignment mask matrix, the corresponding exposure diffraction image features are mask-constrained to suppress the feature response in the saturated region and retain the effective feature response in the unsaturated region, thus obtaining the mask-constrained features. The mask constraint features are fused with the corresponding exposure coding feature set to obtain exposure perception information.

5. The method according to claim 1, characterized in that, The extraction of multi-exposure diffraction image features based on the exposure perception information includes: The exposure perception information is input into the feature extraction network for convolutional encoding to extract the local texture information and edge structure information corresponding to each exposure diffraction image, thus obtaining a shallow feature map. Multi-layer feature mapping and downsampling are performed on the shallow feature map to extract global structural information and spatial features from the diffraction image, thereby obtaining a deep feature map. The shallow feature map and the deep feature map are combined to obtain a multi-scale fused feature map; The multi-scale fused feature map is processed by feature vectorization to convert spatial features into feature sequences, thereby obtaining an exposure feature sequence. The exposure feature sequence is identified by sequence position to obtain multi-exposure diffraction image features.

6. The method according to claim 1, characterized in that, The step of performing cross-exposure Transformer fusion on the multi-exposure diffraction image features to obtain initial fused features includes: The features of the multi-exposure diffraction image are mapped to query features, key features, and value features respectively, to obtain query matrix, key matrix, and value matrix; The cross-exposure attention weights between diffraction images with different exposures are calculated based on the query matrix and the key matrix to obtain the cross-exposure association matrix; The cross-exposure correlation matrix is ​​used to perform weighted aggregation on the value matrix to obtain cross-exposure fusion features; The cross-exposure fusion features are subjected to residual connection and layer normalization to obtain normalized fusion features; The normalized fusion features are input into the feedforward network for nonlinear mapping to obtain the initial fusion features.

7. The method according to claim 1, characterized in that, The step of applying radial frequency domain prior constraints to the initial fused features to obtain high dynamic range fused features includes: Based on the center position of the diffraction image corresponding to the initial fusion feature, the radial distance between each feature position in the initial fusion feature and the image center is calculated to obtain radial distance distribution data; Based on the radial distance distribution data, the initial fusion features are divided into a central low-frequency feature region, a mid-frequency structural feature region, and an edge high-frequency feature region to obtain frequency domain region division features; Based on the frequency domain region division characteristics, the feature constraint weights corresponding to each frequency domain region are determined to obtain a frequency domain constraint weight matrix, wherein the central low-frequency feature region corresponds to the strong signal preservation weight, the mid-frequency structural feature region corresponds to the structural information preservation weight, and the edge high-frequency feature region corresponds to the weak signal enhancement weight. The frequency domain constraint weight matrix is ​​used to weight and adjust the central low-frequency feature region, the mid-frequency structural feature region, and the edge high-frequency feature region respectively to obtain the frequency domain optimized fusion feature. The frequency domain optimized fusion features are spliced ​​into regions to obtain high dynamic range fusion features.

8. The method according to claim 1, characterized in that, The generation of a high dynamic range diffraction intensity image based on the high dynamic range fusion features includes: The high dynamic range fusion features are input into the image reconstruction network for feature decoding. The spatial resolution corresponding to the high dynamic range fusion features is restored by upsampling at each level to obtain the spatial reconstruction feature map. The spatial reconstruction feature map is processed by channel mapping to convert multi-channel features into single-channel intensity features, thus obtaining a predicted intensity feature map. The predicted intensity feature map is subjected to intensity recovery processing to obtain linear intensity distribution data; A corresponding high dynamic range diffraction intensity image is generated based on the linear intensity distribution data.

9. The method according to claim 1, characterized in that, The step of performing phase recovery based on the high dynamic range diffraction intensity image to obtain the sample spatial structure reconstruction result includes: The initial diffraction amplitude data is obtained by calculating the square root of the intensity value of each pixel in the high dynamic range diffraction intensity image. An initial complex amplitude is constructed based on the initial diffraction amplitude data, and the initial complex amplitude is converted to the frequency domain by Fourier transform to obtain frequency domain complex amplitude data; The frequency domain constraints and sample space constraints corresponding to the high dynamic range diffraction intensity image are used to iteratively update the frequency domain complex amplitude data to obtain optimized complex amplitude data. Perform an inverse Fourier transform on the optimized complex amplitude data to obtain the complex amplitude distribution in the spatial domain of the sample; Amplitude and phase information are extracted based on the complex amplitude distribution in the sample spatial domain to generate the sample spatial structure reconstruction result.

10. A Transformer-based high dynamic range fusion system for multiple exposure diffraction images, used to implement the method described in any one of claims 1 to 9, characterized in that, The system includes: The data acquisition module is used to acquire multiple diffraction intensity images of the same sample formed at multiple different exposure times; wherein, the multiple diffraction intensity images include short exposure diffraction images, medium exposure diffraction images and long exposure diffraction images; An image preprocessing module is used to preprocess the multiple diffraction intensity images to obtain a preprocessed diffraction image. An exposure perception information generation module is used to generate exposure perception information based on the preprocessed diffraction image. A multi-exposure feature extraction module is used to extract multi-exposure diffraction image features based on the exposure perception information; The Transformer fusion module is used to perform cross-exposure Transformer fusion on the multi-exposure diffraction image features to obtain initial fused features. The radial frequency domain constraint module is used to apply radial frequency domain prior constraints to the initial fusion features to obtain high dynamic range fusion features. The image reconstruction module is used to generate a high dynamic range diffraction intensity image based on the high dynamic range fusion features; The phase recovery module is used to perform phase recovery based on the high dynamic range diffraction intensity image to obtain the sample spatial structure reconstruction result.