Sparse reconstruction method and system of X-ray diffraction spectrum based on dynamic dictionary

By combining dynamic dictionary learning and compressed sensing theory with deep learning, the XRD analysis method solves the problems of low data acquisition efficiency, poor dictionary adaptability and severe noise interference in traditional XRD analysis, and realizes efficient and accurate XRD spectrum analysis of new materials.

CN120496713BActive Publication Date: 2025-09-30CHANGSHU INSTITUTE OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510985228.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-17
Publication Date
2025-09-30
Estimated Expiration
2045-07-17

AI Technical Summary

Technical Problem

Traditional XRD analysis methods have low data acquisition efficiency, poor fixed dictionary adaptability, severe noise interference, and insufficient intelligence in the analysis process in high-throughput screening of new materials, making it difficult to quickly and accurately analyze the XRD spectra of complex materials.

Method used

A dynamic dictionary-based X-ray diffraction spectrum sparse reconstruction method is adopted. The initial dictionary is generated by generative adversarial network, combined with online dictionary learning and compressed sampling, dynamic optimization of observation matrix and reconstruction algorithm, and end-to-end analysis combined with crystallographic constraints and deep learning.

Benefits of technology

Significantly improve data acquisition efficiency, enhance spectral characterization capabilities, improve reconstruction accuracy and noise resistance, and achieve end-to-end intelligent analysis, making it suitable for high-throughput material screening.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120496713B_ABST
    Figure CN120496713B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for sparse reconstruction of X-ray diffraction spectra based on a dynamic dictionary. The method generates an initial dictionary, dynamically optimizes and updates the dictionary, and obtains a sparse dictionary. Based on the sparse dictionary, a subset of X-ray diffraction scanning angles is selected, an observation matrix is ​​constructed, the observation process is encoded, and compressed sampled X-ray diffraction projection data is obtained. Sparse vectors are obtained from the obtained compressed sampled X-ray diffraction projection data to obtain a reconstructed spectrum. The accuracy of the sparse representation is improved. The present invention provides a high-throughput XRD material spectrum analysis method that combines dynamic dictionary learning, compressed sensing theory, and deep learning, aiming to improve the efficiency and accuracy of crystal structure identification and phase composition analysis in new material research and development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of X-ray diffraction spectrum analysis, and relates to a method and system for sparse reconstruction of X-ray diffraction spectrum based on a dynamic dictionary. Background Art

[0002] X-ray diffraction (XRD) is an indispensable structural characterization method in materials science. By analyzing the X-ray diffraction pattern of a material, key information such as crystal structure, phase composition, grain size, and stress can be obtained. However, traditional XRD analysis methods have exposed many bottlenecks when meeting the growing demand for high-throughput screening of new materials and analysis of complex systems.

[0003] First, data acquisition efficiency is low. Traditional XRD measurements usually use a full-angle scanning mode, that is, data is collected point by point in small steps over a wide range of diffraction angles (for example, 2θ from 10° to 80°) to ensure that all possible diffraction peaks are captured. For a single sample, this process can take tens of minutes or even hours. In the process of exploring and optimizing new materials, a large number of candidate samples often need to be quickly characterized. The scanning speed of traditional XRD has become the main bottleneck for high-throughput screening. Although some studies have tried to speed up by reducing the number of scanning points or random sampling, without the cooperation of effective reconstruction algorithms, the quality of the spectrum and the integrity of the information are often sacrificed.

[0004] Secondly, there are the limitations of fixed sparse representations. To recover high-quality XRD spectra from undersampled or noisy data, compressed sensing theory was introduced. Its core lies in the sparsity of the signal in a certain transform domain. However, existing methods mostly use fixed, universal sparse bases (such as Fourier basis, wavelet basis, discrete cosine transform basis) or dictionaries constructed based on standard diffraction peak shapes (such as Gaussian and Lorentzian functions). These fixed dictionaries are insufficient for sparse representation when describing XRD spectra of advanced materials with complex peak shapes, highly overlapping peaks, or containing amorphous components (such as high entropy alloys, amorphous / nanocrystalline composites, organic-inorganic hybrid perovskites, etc.), resulting in low reconstruction accuracy and difficulty in accurately resolving weak diffraction peaks or distinguishing similar phases.

[0005] Thirdly, there are the problems of noise interference and weak signal identification. Various noises are inevitably present in XRD spectra, such as photon statistical noise, detector dark current, background scattering, etc. These noises will mask low-intensity diffraction peaks (weak peaks), making it very difficult to detect trace phases or identify small structural changes. Traditional denoising methods (such as smoothing filtering) often lead to peak broadening and reduced resolution. Compressed sensing theoretically has a certain noise resistance capability, but its performance is highly dependent on the appropriate selection of the observation matrix and sparse basis, as well as the robustness of the reconstruction algorithm.

[0006] Finally, the existing analytical process is fragmented and lacks intelligence. The current XRD data processing process is often carried out in a step-by-step process: data acquisition, preprocessing (such as background subtraction and smoothing), peak search, and phase calibration. Each step can introduce errors and relies on operator experience. While deep learning methods have been applied to the automatic classification or parameter extraction of XRD spectra, most models are trained on full-spectrum data and are separate from the compressed sampling and sparse reconstruction processes. This separation makes it impossible to achieve end-to-end optimization from compressed data to final analytical results.

[0007] Therefore, there is an urgent need for a new XRD analysis method that can achieve fast data acquisition, strong robustness, high-precision analysis, and adaptive learning of material diffraction characteristics to meet the needs of modern materials science for high-throughput and intelligent characterization technology. Summary of the Invention

[0008] The purpose of the present invention is to provide a method and system for sparse reconstruction of X-ray diffraction spectra based on a dynamic dictionary, so as to solve the problems in the prior art such as long XRD spectrum acquisition time, poor adaptability of fixed dictionaries, severe noise interference, and low intelligence of the analysis process.

[0009] The technical solutions for achieving the purpose of the present invention are:

[0010] A method for sparse reconstruction of X-ray diffraction spectra based on a dynamic dictionary comprises the following steps:

[0011] S01: Generate an initial dictionary, dynamically optimize and update the dictionary to obtain a sparse dictionary;

[0012] S02: Select a subset of X-ray diffraction scanning angles based on a sparse dictionary, construct an observation matrix, encode the observation process, and obtain compressed sampled X-ray diffraction projection data;

[0013] S03: Obtain a sparse vector from the obtained compressed sampled X-ray diffraction projection data to obtain a reconstructed spectrum.

[0014] In the preferred technical solution, the method for generating the initial dictionary in step S01 includes:

[0015] A low-dimensional random latent vector is generated by the generator G. Mapping to a generated spectrum similar to the real X-ray diffraction spectrum , is the number of spectrum points, is the latent space dimension;

[0016] The discriminator D distinguishes whether the input spectrum comes from the real data distribution Or generated by generator G , the authenticity probability of the output spectrum:

[0017] ;

[0018] are the parameters of the discriminator network:

[0019] Use generative adversarial networks to pre-train X-ray diffraction spectra. The training objectives are:

[0020] ;

[0021] in, is a 1-Lipschitz function space, is the gradient penalty coefficient, is the true spectral distribution, express From the true spectrum distribution , is the generated spectral distribution, express From the generated spectrum , is the linear interpolation distribution between the real spectrum and the generated spectrum, express From , is the Euclidean norm of the vector, represents entropy, 、 、 It means that 、 as well as The probability of classification as true data, Indicates that Gradient calculation operator of ;

[0022] After the training is completed, the X-ray diffraction spectrum is sampled from the generator G and the generated X-ray diffraction spectrum is selected as the initial dictionary atoms, of which is the initial number of dictionary atoms.

[0023] In the preferred technical solution, the method for dynamically optimizing and updating the dictionary includes:

[0024] For new X-ray diffraction data , L is the new X-ray diffraction spectrum number, the goal is to find a sparse representation and the updated dictionary , such that:

[0025] ;

[0026] in, represents the Frobenius norm, represents the 0 norm, Represents a sparse representation matrix No. List, is the sparsity constraint;

[0027] Sparse coding and dictionary atomic updates are performed alternately through an online dictionary learning algorithm;

[0028] First perform sparse coding, including a fixed dictionary ,right Each column Solution:

[0029] ; Use greedy algorithm to solve;

[0030] Then update the dictionary, , first find all sample index sets that use this atom ,in Representation matrix No. Rank The elements of the column; then construct the residual matrix , Representation matrix No. Rank The elements of the column; finally Perform SVD decomposition , we get the unitary matrix pair 、 , the diagonal singular value matrix , updated ,in Represents the first diagonal element of the diagonal singular value matrix;

[0031] If the reconstructed residual of the newly added data is greater than the threshold, or the existing dictionary cannot represent the new features, a pre-trained generative adversarial network is used to generate new candidate atoms and add them to the dictionary. At the same time, atoms with low usage frequency or redundancy are removed to maintain the dictionary size.

[0032] In the preferred technical solution, step S02 specifically includes:

[0033] S21: Based on the obtained sparse dictionary , and combined with the mutual information criterion or the energy distribution characteristics of dictionary atoms, select the optimal X-ray diffraction scanning angle subset ,in ;

[0034] S22: Constructing the observation matrix , The row corresponding to the selected sampling angles, usually the identity matrix Row sampling; encoding the observation process;

[0035] X-ray diffraction projection data obtained after compressed sampling for:

[0036] ;

[0037] in, is the original full-spectrum signal, Is it in the dictionary The sparse vector under is the observation noise.

[0038] In a preferred technical solution, the method for obtaining the reconstructed spectrum in step S03 includes:

[0039] from Recover sparse vectors from , the objective function is:

[0040] ;

[0041] in, is the reconstructed sparse vector, is a regularization parameter used to control sparsity, represents the L1 norm, which is solved by iterative reweighted L1 norm optimization algorithm;

[0042] Combined with the adaptive grid division algorithm, the discrete grid of the diffraction angle is adjusted in the iterative process, and the reconstructed full spectrum signal is , the background is modeled as a low-frequency smooth signal during the reconstruction process and is converted from Or separation from the residuals during reconstruction.

[0043] In the preferred technical solution, after step S03, physical constraint embedding is further included, and the method includes:

[0044] Embed crystallographic prior knowledge as constraints into the optimization process;

[0045] For each atom in the dictionary , extract its Peak , which corresponds to the interplanar spacing satisfy:

[0046] ;

[0047] in, is the X-ray wavelength, is the diffraction order;

[0048] The deviation between the peak position and the theoretical interplanar spacing is added to the objective function as a penalty term:

[0049] ;

[0050] in, is the theoretical peak position calculated for multiple hypothetical crystal phases. is the peak deviation penalty weight, It is The weight coefficient of the peak position, is the total number of theoretical peaks, is the total number of estimated peak positions;

[0051] If the atom Most of the peak positions in cannot match any reasonable combination of lattice parameters and crystal planes, i.e. ,in To allow for deviation, the atom is considered to have little physical significance, and its weight is reduced or removed.

[0052] In the preferred technical solution, step S03 further includes CNN classification and phase composition analysis, including:

[0053] Build a convolutional neural network classification module;

[0054] The convolutional neural network classification module is pre-trained on a large number of X-ray diffraction spectra of known phases to identify the crystal structure and space group of the material or directly perform phase calibration;

[0055] The input of the convolutional neural network classification module is the entire spectrum or the extracted peak list features, and the output is the category probability of the phase. For mixtures, the convolutional neural network classification module is trained to output the content ratio of each phase:

[0056] ;

[0057] in, For physical information, is the phase ratio, are the parameters of the CNN network;

[0058] The reconstructed X-ray diffraction spectrum Or the extracted peak list features are input into the pre-trained convolutional neural network classification module for CNN classification and phase composition analysis.

[0059] The present invention also discloses a dynamic dictionary-based X-ray diffraction spectrum sparse reconstruction system, comprising:

[0060] Dynamic dictionary learning and construction module generates an initial dictionary, dynamically optimizes and updates the dictionary, and obtains a sparse dictionary;

[0061] The compressed sampling optimization module selects a subset of X-ray diffraction scanning angles based on a sparse dictionary, constructs an observation matrix, encodes the observation process, and obtains the compressed sampling X-ray diffraction projection data;

[0062] The analytical module is jointly optimized to obtain sparse vectors from the acquired compressed sampled X-ray diffraction projection data and obtain a reconstructed spectrum.

[0063] The present invention further discloses a computer storage medium on which a computer program is stored. When the computer program is executed, the above-mentioned X-ray diffraction spectrum sparse reconstruction method based on a dynamic dictionary is implemented.

[0064] Compared with the prior art, the present invention has the following significant advantages:

[0065] 1. Significantly improve data acquisition efficiency: Through compressed sampling, only a small amount of angle data needs to be collected, which greatly shortens the experimental time and is suitable for high-throughput material screening.

[0066] 2. Enhanced spectral representation capabilities: Dynamic dictionary learning enables the dictionary to adapt to the diffraction characteristics of the material, especially for complex systems and new materials, improving the accuracy of sparse representation.

[0067] 3. Improve reconstruction accuracy and noise resistance: Combining optimized observation matrix design with a robust reconstruction algorithm and the introduction of physical constraints, it is possible to recover high-quality XRD spectra from undersampled and noisy data and effectively identify weak peaks.

[0068] 4. Achieve end-to-end intelligent parsing: Closely integrate dynamic dictionary learning, compression reconstruction, and CNN object recognition to form a jointly optimized parsing framework, improving the level of automation and intelligence. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 This is a flow chart of the method for sparse reconstruction of X-ray diffraction spectra based on a dynamic dictionary in this embodiment. DETAILED DESCRIPTION

[0070] The principle of the present invention is: the present invention provides a high-throughput XRD material spectrum analysis method that combines dynamic dictionary learning, compressed sensing theory and deep learning, aiming to improve the efficiency and accuracy of crystal structure identification and phase composition analysis in new material research and development.

[0071] Example 1:

[0072] like Figure 1 As shown, a sparse reconstruction method of X-ray diffraction spectrum based on a dynamic dictionary includes the following steps:

[0073] S01: Generate an initial dictionary, dynamically optimize and update the dictionary to obtain a sparse dictionary;

[0074] S02: Select a subset of X-ray diffraction scanning angles based on a sparse dictionary, construct an observation matrix, encode the observation process, and obtain compressed sampled X-ray diffraction projection data;

[0075] S03: Obtain a sparse vector from the obtained compressed sampled X-ray diffraction projection data to obtain a reconstructed spectrum.

[0076] Specifically, step 1: dynamic dictionary learning and construction, this step aims to build a sparse dictionary that can adaptively learn and characterize the XRD spectrum characteristics of different materials. Specifically:

[0077] Step 1.1: Initial dictionary generation. Use a generative adversarial network (GAN) to pre-train a large number of XRD spectra in a preset material database (such as ICSD, COD, etc.). This includes:

[0078] Generator G (Generator): Its function is to convert a low-dimensional random latent vector Mapping to a generated spectrum similar to the real XRD spectrum . is the number of spectrum points, is the dimension of the latent space. The generator usually adopts a deep convolutional neural network structure, such as the convolutional autoencoder with residual connection (Res-CAE). Its mathematical expression is:

[0079] ;

[0080] in are the parameters of the generator network.

[0081] Discriminator D (Discriminator): Its function is to distinguish whether the input spectrum comes from the real data distribution Or generated by generator G The discriminator usually also adopts a deep convolutional neural network structure, such as PatchGAN, which outputs the authenticity probability of the spectrum:

[0082] .

[0083] GAN training objectives:

[0084] ;

[0085] in, is a 1-Lipschitz function space, is the gradient penalty coefficient, is the true spectral distribution, express From the true spectrum distribution , is the generated spectral distribution, express From the generated spectrum , is the linear interpolation distribution between the real spectrum and the generated spectrum, express From , is the Euclidean norm of the vector, represents entropy, 、 、 It means that 、 as well as The probability of classification as true data, Indicates that Gradient calculation operator of ;

[0086] After the training is completed, a large number of high-quality XRD spectrum fragments or complete spectra are sampled from the generator G, and representative generated spectra are directly selected as the initial dictionary through clustering algorithms (such as K-means) or atoms, of which is the initial number of dictionary atoms.

[0087] Step 1.2: Incremental update of the dictionary: Based on the newly added material sample data that does not appear in the initial training library, the dictionary is dynamically optimized and updated through an online dictionary learning algorithm (such as K-SVD).

[0088] For a new batch of XRD spectrum data , the goal is to find a sparse representation and the updated dictionary , such that:

[0089] ;

[0090] in, represents the Frobenius norm, represents the 0 norm, Represents a sparse representation matrix No. List, is the sparsity constraint.

[0091] The K-SVD algorithm alternates between sparse coding and dictionary atomic updates.

[0092] Then sparse coding is performed, and the dictionary is fixed ,right Each column Solution:

[0093] ;

[0094] is the Euclidean norm of the vector;

[0095] A greedy algorithm such as OMP (Orthogonal Matching Pursuit) can be used to solve it.

[0096] Then update the dictionary and update the dictionary atoms , first find all sample index sets that use this atom . Then construct the residual matrix Finally Perform SVD decomposition , we get the unitary matrix pair 、 , the diagonal singular value matrix , updated ,in Represents the first diagonal element of the diagonal singular value matrix.

[0097] If the reconstruction residual of the newly added data is large, or the existing dictionary cannot well represent the new features, a pre-trained GAN can be used to generate new candidate atoms and add them to the dictionary based on certain criteria (such as their contribution to improving the representation ability, or based on the contribution of the candidate atoms to the reconstruction residual and their irrelevance to the existing dictionary atoms). At the same time, atoms with low historical usage frequency, redundancy, or low reconstruction contribution of the existing dictionary atoms are removed to maintain the dictionary size.

[0098] Step 2: Compressed sampling optimization step, which aims to replace full-angle scanning by intelligently sampling a small number of data points. Specifically:

[0099] Step 2.1: Optimal angle subset selection. Based on the current dynamically optimized sparse dictionary , and combined with the mutual information criterion or the energy distribution characteristics of dictionary atoms, select the most critical XRD scan angle subset for reconstruction ,in .

[0100] Step 2.2: Construction and encoding of the observation matrix. Construction of the observation matrix . The row corresponding to the selected sampling angles, usually the identity matrix To improve noise immunity, the observation process can be encoded. In this scenario, this can be understood as designing a structured random measurement matrix whose row vectors (or some transformation thereof) have good orthogonality, thereby dispersing the effects of noise in the frequency domain or transform domain. More directly, random matrices with specific correlation properties can be designed, such as Gaussian random matrices or partial Hadamard matrices. These matrices have good uncorrelation with the sparse basis and satisfy the restricted isometry property (RIP).

[0101] Obtained compressed low-dimensional XRD projection data for:

[0102] ;

[0103] in, is the original full-spectrum signal, Is it in the dictionary The sparse vector under is the observation noise.

[0104] Step 3: Joint optimization of the analysis step, which aims to restore the full spectrum from the compressed data with high precision and perform phase identification. Specifically:

[0105] Step 3.1: Multi-task sparse reconstruction. Recover sparse vectors from The objective function is usually:

[0106] ;

[0107] in, is a regularization parameter that controls sparsity. represents the L1 norm, which can be solved using an iteratively reweighted L1 norm optimization algorithm (such as Iteratively Reweighted Least Squares - IRLS, or FISTA). In order to locate the peak more accurately, an adaptive grid partitioning algorithm can be combined to adjust the discrete grid of the diffraction angle during the iteration process. The reconstructed full spectrum signal is The background noise can be suppressed synchronously during the reconstruction process, for example, the background can be modeled as a low-frequency smooth signal and Or separation from the residuals during reconstruction.

[0108] Step 3.2: Physical constraint embedding. In order to ensure the physical meaning of the reconstructed spectrum, crystallographic prior knowledge (such as the Bragg equation) can be embedded as a constraint in the optimization process. For example, for the identified peak position , which corresponds to the interplanar spacing Should meet:

[0109] ;

[0110] in, is the X-ray wavelength, is the diffraction order. The deviation between the peak position and the theoretical interplanar spacing can be added to the objective function as a penalty term.

[0111] ;

[0112] in, is allowed for multiple hypothetical crystalline phases (and their corresponding lattice parameters and space groups A series of theoretical peak positions calculated from the surface is the peak deviation penalty weight, is the total number of theoretical peaks, is the total number of estimated peak positions.

[0113] Step 3.3: CNN classification and phase composition analysis. The reconstructed high-quality XRD spectrum The input (or its characteristic representation) is fed into a pre-trained convolutional neural network (CNN) classification module. This CNN model, pre-trained on a large number of XRD spectra of known phases, is used to identify the material's crystal structure, space group, or directly perform phase calibration. The CNN input can be the entire spectrum or a list of extracted peak features. The output can be the phase classification probability. For mixtures, the CNN can be trained to output the content ratio of each phase.

[0114] ;

[0115] in, For physical information, is the phase ratio, are the parameters of the CNN network.

[0116] In another embodiment, a computer storage medium stores a computer program, which, when executed, implements the above-mentioned dynamic dictionary-based sparse reconstruction method for X-ray diffraction spectra. The above-mentioned reconstruction method is adopted and will not be described in detail here.

[0117] In another embodiment, a dynamic dictionary-based X-ray diffraction spectrum sparse reconstruction system includes:

[0118] Dynamic dictionary learning and construction module generates an initial dictionary, dynamically optimizes and updates the dictionary, and obtains a sparse dictionary;

[0119] The compressed sampling optimization module selects a subset of X-ray diffraction scanning angles based on a sparse dictionary, constructs an observation matrix, encodes the observation process, and obtains the compressed sampling X-ray diffraction projection data;

[0120] The analytical module is jointly optimized to obtain sparse vectors from the acquired compressed sampled X-ray diffraction projection data and obtain a reconstructed spectrum.

[0121] Specifically, the workflow of the X-ray diffraction spectrum sparse reconstruction system based on a dynamic dictionary is described below using a preferred embodiment as an example:

[0122] Dynamic dictionary construction and update based on GAN

[0123] 1. Data preparation: Collect 100,000 calculated XRD spectra of different inorganic compounds from ICSD (Inorganic Crystal Structure Database) and COD (Crystallography Open Database) radiation, The range is 10°-80°, the step size is 0.02°, and there are 3501 data points in total, that is, ). All spectra were normalized to the range of [0,1].

[0124] 2. GAN network structure:

[0125] Generator G: Input is a 128-dimensional standard normal distribution random vector The network structure uses multiple layers of 1D transposed convolution (Deconvolution) and residual blocks (ResBlock). Each ResBlock contains two convolutional layers, batch normalization (BN) and ReLU activation, as well as skip connections.

[0126] Discriminator D: Input is The network structure uses multi-layer 1D convolution. The WGAN-GP loss function is used for training, and the gradient penalty coefficient is .

[0127] 3. Initial dictionary generation: After GAN training for 200 cycles, 10,000 different random vectors are input from the generator G , generate 10,000 high-quality XRD spectra. Using K-means algorithm ( ) Cluster these generated spectra and obtain 1024 cluster centers as the initial dictionary of atoms.

[0128] 4. Dynamic dictionary update:

[0129] Assume there is a new batch of experimentally measured XRD spectrum data (e.g. from new perovskite materials).

[0130] Sparse coding: For Each spectrum in , using the OMP algorithm in the current dictionary Solve the sparse vector (sparseness ).

[0131] Atomic Update and Extension:

[0132] Calculate the usage frequency of each atom. Remove atoms whose usage frequency in the past 10 batches is lower than a threshold (for example, used less than 5 times).

[0133] For the reconstruction error Large spectra (e.g., greater than 0.05) are considered to be poorly represented by the current dictionary. These spectra (or their main residual components) are used as new candidate atoms, or GAN is used to generate new candidate atoms based on the characteristics of these spectra (e.g., obtaining their potential representations through the encoder and slightly perturbing them before feeding them into the generator).

[0134] The K-SVD algorithm is used to optimize active atoms (atoms with high usage frequency) and their corresponding sparse vectors.

[0135] Add the screened new atoms to the dictionary, keeping the dictionary size within a certain range (e.g., 1000-1500 atoms).

[0136] 5. Physical constraint refinement (periodically performed after dictionary update):

[0137] For each atom in the dictionary , extract its main peak position Assuming that the system to be measured may be a cubic system, the lattice parameter Within a certain range. Enumerate reasonable low-index crystal planes (like ), calculate the theoretical peak position. Most of the peak positions in the Combination matching (i.e. ,in is the allowable deviation), the atom is considered to have little physical significance, and its weight is reduced or removed.

[0138] Compressed sampling and joint parsing based on dynamic dictionary

[0139] 1. Material system: Take a powder sample containing three known phases (A, B, C) as an example.

[0140] 2. Compressed sampling:

[0141] Use the latest dynamic dictionary obtained in Example 1 .

[0142] Angle selection: According to dictionary The energy of atoms is mainly distributed region, and considering the characteristic peak positions of the standard spectra of phases A, B, and C, combined with the mutual information maximization strategy (simplified to selecting angles with large energy contributions in multiple atoms and angles covering known characteristic peaks), select from the full angle range (10°-80°, 3501 points) sampling points (compression rate 10%).

[0143] Observation Matrix is a row sampling matrix.

[0144] Perform XRD experiments and collect only the data points at these 350 angles to obtain compressed data. .

[0145] 3. Joint optimization analysis:

[0146] Sparse reconstruction: solving the optimization problem:

[0147] ;

[0148] Use FISTA algorithm to solve, set . Get sparse vector , reconstructed spectrum .

[0149] Background subtraction: In FISTA iterations, the background can be modeled as a smooth curve superimposed by a few broad peaks (such as a Gaussian function), whose parameters are also used as optimization variables, or the current residual is smoothed and fitted as the background estimate and subtracted after each iteration.

[0150] CNN phase recognition:

[0151] CNN model: A ResNet-18 1D CNN was pre-trained. The training data consisted of simulated XRD spectra of phases A, B, and C, and their mixtures in varying proportions (with varying levels of noise and background added). The CNN output layer consisted of a Softmax layer, which outputted the probabilities (or concentrations) of the three phases.

[0152] Input: Reconstruct the spectrum Or its denoised and smoothed version is fed into CNN.

[0153] Output: CNN outputs the recognition probabilities and estimated contents of phases A, B, and C. For example, the output is {A: 0.95, B: 0.88, C: 0.92} and the contents are {A: 30%, B: 50%, C: 20%}.

[0154] 4. Performance evaluation:

[0155] The reconstructed spectrum obtained by this method Compared with the real spectrum obtained by full-angle scanning The root mean square error (RMSE) and peak position deviation were calculated for comparison. The phases and contents identified by the CNN were compared with the true composition of the sample. Experimental results showed that compared with compressed sensing methods using a fixed dictionary, the proposed method reduced the RMSE by approximately 30% and increased the detection rate of weak peaks (signal-to-noise ratio <3) by 40%. The accuracy of phase identification exceeded 98%. The total analysis time (including sampling and calculation) was shortened by approximately 80% compared to traditional full-spectrum scanning and manual analysis.

[0156] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be considered as equivalent replacement methods and are included in the scope of protection of the present invention.

Claims

1. A method for sparse reconstruction of X-ray diffraction spectra based on a dynamic dictionary, characterized in that: The following steps are involved: S01: Generate an initial dictionary, dynamically optimize and update the dictionary to obtain a sparse dictionary; The method for generating the initial dictionary includes: A low-dimensional random latent vector is generated by the generator G. Mapping to a generated spectrum similar to the real X-ray diffraction spectrum , is the number of spectrum points, is the latent space dimension; The discriminator D distinguishes whether the input spectrum comes from the real data distribution Or generated by generator G , the authenticity probability of the output spectrum: , are the parameters of the discriminator network: Use generative adversarial networks to pre-train X-ray diffraction spectra. The training objectives are: , in, is a 1-Lipschitz function space, is the gradient penalty coefficient, is the true spectral distribution, express From the true spectrum distribution , is the generated spectral distribution, express From the generated spectrum , is the linear interpolation distribution between the real spectrum and the generated spectrum, express From , is the Euclidean norm of the vector, represents entropy, 、 、 It means that 、 as well as The probability of classification as true data, Indicates that Gradient calculation operator of ; After the training is completed, the X-ray diffraction spectrum is sampled from the generator G and the generated X-ray diffraction spectrum is selected as the initial dictionary atoms, of which is the number of initial dictionary atoms; S02: Select a subset of X-ray diffraction scanning angles based on a sparse dictionary, construct an observation matrix, encode the observation process, and obtain compressed sampled X-ray diffraction projection data; S03: Obtain a sparse vector from the obtained compressed sampled X-ray diffraction projection data to obtain a reconstructed spectrum.

2. The method for sparse reconstruction of X-ray diffraction spectrum based on dynamic dictionary according to claim 1, characterized in that: Methods for dynamically optimizing and updating dictionaries include: For new X-ray diffraction data , L is the new X-ray diffraction spectrum number, the goal is to find a sparse representation and the updated dictionary , such that: , in, represents the Frobenius norm, represents the 0 norm, Represents a sparse representation matrix No. List, is the sparsity constraint; Sparse coding and dictionary atomic updates are performed alternately through an online dictionary learning algorithm; First perform sparse coding, including a fixed dictionary ,right Each column Solution: , solve using greedy algorithm; Then update the dictionary, , first find all sample index sets that use this atom ,in Representation matrix No. Rank The elements of the column; then construct the residual matrix , Representation matrix No. Rank The elements of the column; finally Perform SVD decomposition , we get the unitary matrix pair 、 , the diagonal singular value matrix , updated ,in Represents the first diagonal element of the diagonal singular value matrix; If the reconstructed residual of the newly added data is greater than the threshold, or the existing dictionary cannot represent the new features, a pre-trained generative adversarial network is used to generate new candidate atoms and add them to the dictionary. At the same time, atoms with low usage frequency or redundancy are removed to maintain the dictionary size.

3. The method for sparse reconstruction of X-ray diffraction spectrum based on dynamic dictionary according to claim 1, characterized in that: Step S02 specifically includes: S21: Based on the obtained sparse dictionary , and combined with the mutual information criterion or the energy distribution characteristics of dictionary atoms, select the optimal X-ray diffraction scanning angle subset ,in ; S22: Constructing the observation matrix , The row corresponding to the selected sampling angles, usually the identity matrix Row sampling; encoding the observation process; X-ray diffraction projection data obtained after compressed sampling for: , in, is the original full-spectrum signal, Is it in the dictionary The sparse vector under is the observation noise.

4. The method for sparse reconstruction of X-ray diffraction spectrum based on dynamic dictionary according to claim 3, characterized in that: The method for obtaining the reconstructed spectrum in step S03 includes: from Recover sparse vectors from , the objective function is: , in, is the reconstructed sparse vector, is a regularization parameter used to control sparsity, represents the L1 norm, which is solved by iterative reweighted L1 norm optimization algorithm; Combined with the adaptive grid division algorithm, the discrete grid of the diffraction angle is adjusted in the iterative process, and the reconstructed full spectrum signal is , the background is modeled as a low-frequency smooth signal during the reconstruction process and is converted from Or separation from the residuals during reconstruction.

5. The method for sparse reconstruction of X-ray diffraction spectrum based on dynamic dictionary according to claim 4, characterized in that: After step S03, physical constraint embedding is also included, and the method includes: Embed crystallographic prior knowledge as constraints into the optimization process; For each atom in the dictionary , extract its Peak , which corresponds to the interplanar spacing satisfy: , in, is the X-ray wavelength, is the diffraction order; The deviation between the peak position and the theoretical interplanar spacing is added to the objective function as a penalty term: , in, is the theoretical peak position calculated for multiple hypothetical crystal phases. is the peak deviation penalty weight, It is The weight coefficient of the peak position, is the total number of theoretical peaks, is the total number of estimated peak positions; If the atom Most of the peak positions in cannot match any reasonable combination of lattice parameters and crystal planes, i.e. ,That To allow for deviation, the atom is considered to have little physical significance, and its weight is reduced or removed.

6. The method for sparse reconstruction of X-ray diffraction spectrum based on dynamic dictionary according to claim 4, characterized in that: Step S03 also includes CNN classification and phase composition analysis, including: Build a convolutional neural network classification module; The convolutional neural network classification module is pre-trained on a large number of X-ray diffraction spectra of known phases to identify the crystal structure and space group of the material or directly perform phase calibration; The input of the convolutional neural network classification module is the entire spectrum or the extracted peak list features, and the output is the category probability of the phase. For mixtures, the convolutional neural network classification module is trained to output the content ratio of each phase: , in, For physical information, is the phase ratio, are the parameters of the CNN network; The reconstructed X-ray diffraction spectrum Or the extracted peak list features are input into the pre-trained convolutional neural network classification module for CNN classification and phase composition analysis.

7. A dynamic dictionary-based X-ray diffraction spectrum sparse reconstruction system, characterized in that: include: Dynamic dictionary learning and construction module generates an initial dictionary, dynamically optimizes and updates the dictionary, and obtains a sparse dictionary; The methods for generating the initial dictionary in the dynamic dictionary learning and construction module include: A low-dimensional random latent vector is generated by the generator G. Mapping to a generated spectrum similar to the real X-ray diffraction spectrum , is the number of spectrum points, is the latent space dimension; The discriminator D distinguishes whether the input spectrum comes from the real data distribution Or generated by generator G , the authenticity probability of the output spectrum: , are the parameters of the discriminator network: Use generative adversarial networks to pre-train X-ray diffraction spectra. The training objectives are: , in, is a 1-Lipschitz function space, is the gradient penalty coefficient, is the true spectral distribution, express From the true spectrum distribution , is the generated spectral distribution, express From the generated spectrum , is the linear interpolation distribution between the real spectrum and the generated spectrum, express From , is the Euclidean norm of the vector, represents entropy, 、 、 It means that 、 as well as The probability of classification as true data, Indicates that Gradient calculation operator of ; After the training is completed, the X-ray diffraction spectrum is sampled from the generator G and the generated X-ray diffraction spectrum is selected as the initial dictionary atoms, of which is the number of initial dictionary atoms; The compressed sampling optimization module selects a subset of X-ray diffraction scanning angles based on a sparse dictionary, constructs an observation matrix, encodes the observation process, and obtains the compressed sampling X-ray diffraction projection data; The analytical module is jointly optimized to obtain sparse vectors from the acquired compressed sampled X-ray diffraction projection data and obtain a reconstructed spectrum.

8. A computer storage medium having a computer program stored thereon, characterized in that: When a computer executes the computer program, the method for sparse reconstruction of X-ray diffraction spectra based on a dynamic dictionary according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Statistical dictionary learning-based radar high range resolution profile target identification method

    CN108133232A

  • Dynamic magnetic resonance parallel reconstruction method based on adaptive orthogonal dictionary learning

    CN110148193A