A soil XRF spectrum background subtraction method based on XRF-EGAN model
Through the soil XRF spectral background subtraction method based on the XRF-EGAN neural network model, the traditional method has solved the shortcomings in accuracy and robustness, and the effect of improving the correlation between element net peak area and content is achieved.
Patent Information
- Application Number
- CN202210523696.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-13
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-05-13
AI Technical Summary
The traditional soil XRF spectral background subtraction method has shortcomings in terms of accuracy and robustness, and it is difficult to effectively improve the correlation between element net peak area and content.
The XRF-EGAN neural network model is used to build a generator through one-dimensional fully convolutional network layer and residual connection, and a discriminator is built in combination with one-dimensional convolution and full connection layer. The XRF-EGAN model is trained using an adversarial training mode to obtain a trained generator for background deduction of soil XRF spectral.
The correlation between the net peak area and content of element in soil XRF spectrum is improved, the robustness and adaptability of the model are enhanced, and element content analysis can be carried out more accurately.
Smart Images

Figure CN114861541B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of XRF spectrum background subtraction, and in particular to an XRF spectrum background subtraction method based on an XRF-EGAN deep network model. Background Art
[0002] There are many methods for soil XRF spectrum background subtraction, such as wavelet transform, Fourier transform, peak clipping, polynomial fitting, etc. In practical applications, before using soil XRF spectrum to quantitatively analyze the element content contained in the soil, it is necessary to use the background subtraction method to perform baseline calibration on the background noise of the XRF spectrum to make the element content analysis more accurate. The accuracy of traditional background subtraction methods in soil XRF spectrum baseline calibration still needs to be improved, and the robustness and adaptability of traditional methods are relatively weak. The development of deep neural network technology and the strong robustness and adaptability of convolutional neural networks provide a new implementation method for soil XRF spectrum background subtraction.
[0003] Generative adversarial neural network (GAN) is a neural network model that learns through adversarial training. Compared with other neural network structures, GAN has multiple characteristics: (1) The GAN model consists of a generator and a discriminator, and the generator and the discriminator can be composed of different network layers, which has high flexibility. (2) GAN adopts adversarial training learning. The generator of the GAN model is responsible for generating samples or denoising the input samples, and the discriminator is responsible for helping the generator complete the adversarial training of the model. Because the GAN network model has these advantages, it has been widely studied in the fields of image generation and denoising, speech denoising, etc. The research of the present invention mainly focuses on: how to use the GAN model to design a more accurate XRF background subtraction network model, propose a soil XRF spectrum background subtraction method with robustness and adaptability, improve the accuracy of soil XRF spectrum background subtraction, and then improve the correlation between the XRF characteristic peak area and content of the element, so that the XRF data processed by this method can more accurately analyze the content of the element. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a soil XRF background subtraction method based on the XRF-EGAN neural network model to improve the correlation between the element net peak area and the element content of the soil XRF spectrum.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] A soil XRF background subtraction method based on an XRF-EGAN model, based on the design pattern of a GAN model, uses a one-dimensional fully convolutional network layer and a residual connection to construct a model generator, uses a one-dimensional convolution and a fully connected layer to construct a model discriminator, and uses an adversarial training mode to train the XRF-EGAN model to obtain a trained generator and discriminator, and the generator is a soil XRF background subtraction model, thereby improving the correlation between the net peak area and content of the soil XRF elements.
[0007] Furthermore, the trained and optimized generator is obtained by adversarial training of the XRF-EGAN model, and the generator is used in the soil XRF spectrum background subtraction task. In addition to being applied to soil XRF spectra, the XRF-EGAN model can also be applied to alloy XRF spectra, spectrum alloy XRF spectra, and XRF spectral data obtained by XRF fluorescence analyzer.
[0008] Furthermore, the soil XRF background subtraction method based on the XRF-EGAN model includes the following steps:
[0009] Step 1: Use an XRF fluorescence analyzer to collect the XRF spectrum data of the soil sample, and manually subtract the background of the XRF spectrum data of the sample to finally obtain the soil XRF spectrum data before background subtraction. noisy and soil XRF spectrum data without background clean ;
[0010] Step 2: Collect data noisy Data and Data clean The data is used to train the XRF-EGAN neural network model, and the network model parameters of the generator of the optimal XRF-EGAN model after training are saved;
[0011] Step 3: Load the generator network model of XRF-EGAN, perform XRF spectrum background subtraction on the new soil XRF spectrum data measured by XRF fluorescence analyzer using the generator network of XRF-EGAN, and obtain the output after background subtraction.
[0012] Furthermore, the loss function expression used in the training of the XRF-EGAN neural network model generator in step 2 is as follows:
[0013]
[0014] Where z∈R 1×1024represents noise that obeys the standard normal distribution; x represents the input XRF spectrum data containing background; G represents the generator; G(z,x) represents the output obtained by inputting z and x into the generator, that is, the output result of XRF background subtraction; D represents the discriminator; (D(G(z,x))-1) 2 represents the mean square error between the discriminator output and 1; x c represents XRF spectrum data without background; ||||1 represents L1 norm; λ represents the coefficient of L1 norm.
[0015] Furthermore, the loss function expression used in the discriminator training of the XRF-EGAN neural network model in step 2 is as follows:
[0016]
[0017] Where z∈R 1×1024 represents noise that obeys the standard normal distribution; x represents the input XRF spectrum data containing background; G represents the generator; G(z,x) represents the output obtained by inputting z and x into the generator, that is, the output result of XRF background subtraction; D represents the discriminator; D(G(z,x)) 2 represents the mean square error between the discriminator output and 0.
[0018] Furthermore, the forward propagation process of the XRF-EGAN network model in step 2 is to input the soil XRF spectrum data x containing the background into the generator model, and after a series of one-dimensional convolution operations and residual connections, the input XRF spectrum x is subjected to feature compression encoding and decoding processes, and finally the background subtraction result with the same dimension as the input x is obtained. The output of the generator The input sample x corresponds to x without background c Input them into the discriminator D together, and finally obtain the output o∈R of the discriminator 1×2 , and calculate the corresponding loss value according to the loss function to optimize the generator and discriminator models of XRF-EGAN.
[0019] Furthermore, before inputting the XRF spectrum x with background into the XRF-EGAN network model in step 2, x needs to be preprocessed. The expression for processing x is as follows:
[0020]
[0021] Where x i It represents the count value of the ith channel of the 2048 channels of the XRF spectrum. After taking the logarithm of the input x, the result y=[y1 y2 L y 2048 ] to normalize the maximum and minimum values, the mathematical expression is as follows:
[0022]
[0023] Where y represents the output result after taking the logarithm of XRF input x; z i Indicates the result y after taking the logarithm of the i-th channel i The normalized result of .
[0024] Furthermore, the generator of the XRF-EGAN network model in step 3 performs background subtraction on the input soil XRF spectrum data x, and the output result needs to be denormalized, and the expression is as follows:
[0025]
[0026] Where y represents the output result after taking the logarithm of the XRF input x; G(x) represents the output result of the generator of the XRF-EGAN model after the input x passes through; Represents the denormalized result. After the denormalization is completed, the denormalized result is To take the index, the formula is as follows:
[0027]
[0028] In the formula Represents the denormalized result of the i-th value of the output matrix of the generative model G; Express Take the result of exponentialization.
[0029] The beneficial effects of the present invention are as follows: the present invention proposes a new soil XRF spectrum background subtraction method-XRF-EGAN soil XRF spectrum background subtraction method, uses an XRF-EGAN generative adversarial network model composed of a generator and a discriminator to model soil XRF spectrum background subtraction, obtains an XRF-EGAN model capable of realizing soil XRF spectrum background subtraction through adversarial training, and uses the generator in the trained XRF-EGAN model to realize background subtraction of soil XRF spectrum, and finally realizes improving the correlation between the net peak area and content of the elements in the soil XRF spectrum. In addition, the present invention applies the XRF-EGAN soil XRF spectrum background subtraction method to improve the correlation between the net peak area of the copper (Cu) element and the Cu element content in the soil XRF spectrum, and the method can effectively improve the correlation between the net peak area of the copper (Cu) element and the Cu element content in the soil XRF spectrum. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 The present invention is a flowchart of the soil XRF spectrum background subtraction method based on the XRF-EGAN model;
[0031] Figure 2This is the XRF-EGAN model diagram;
[0032] Figure 3 It is a schematic diagram of the structure of the XRF-EGAN generator model;
[0033] Figure 4 It is a structural diagram of the XRF-EGAN discriminator model;
[0034] Figure 5 A sample diagram of soil XRF spectrum data of an embodiment;
[0035] Figure 6 This is a schematic diagram of the soil XRF spectrum data of the embodiment after background subtraction by XRF-EGAN;
[0036] Figure 7 Schematic diagram of the correlation results of the Cu element before and after background subtraction by XRF-EGAN. DETAILED DESCRIPTION
[0037] The present invention proposes a new soil XRF background subtraction method based on an XRF-EGAN neural network model, which is used to implement soil XRF spectrum background subtraction and improve the correlation between the net peak area of the soil XRF spectrum and the element content. The XRF-EGAN background subtraction network model is trained by using soil XRF spectrum data, and the scheme is analyzed and verified by using a test data set. As an XRF background subtraction model constructed based on a GAN model, the XRF-EGAN network model is different from the traditional XRF background subtraction method. The XRF-EGAN model has strong robustness and adaptability, and can be learned through adversarial training of a generator and a discriminator, so that the generator of the XRF-EGAN model learns the background-free XRF spectrum after the background subtraction of the soil XRF spectrum data, and effectively improves the correlation between the net peak area of the soil XRF spectrum element and the element content. Therefore, the present invention can implement background subtraction of the soil XRF spectrum through the XRF-EGAN model, thereby effectively improving the correlation between the net peak area of the copper (Cu) element in the soil XRF spectrum and the copper (Cu) element content. Based on the above ideas, the embodiment provides a soil XRF spectrum background subtraction method based on the XRF-EGAN model to improve the correlation between the XRF spectrum net peak area of the soil copper (Cu) element and the Cu element content. The workflow is as follows: Figure 1 As shown, the specific steps are as follows:
[0038] Step 1: Collect soil XRF spectrum data through XRF spectrometer, and manually subtract the background of the XRF spectrum of each soil sample to finally obtain soil sample x with background and soil sample x without background. c ;
[0039] Step 2: Transform the dataset (x,x c ) is divided into training data sets And the test dataset
[0040] Step 3: Use the training data set (x,x c ) Train the XRF-EGAN network model. The structure of the XRF-EGAN network is as follows Figure 2 , Figure 3 and Figure 4 As shown, the XRF spectrum background subtraction model XRF-EGAN was finally obtained through training;
[0041] Step 4: Use the generator G of the trained XRF-EGAN background subtraction model to test the dataset Perform background subtraction on each XRF spectrum sample in the test to obtain the background subtraction results of the XRF spectra of all test samples;
[0042] Step 5: Use the XRF spectrum of the soil sample with background subtracted by the XRF-EGAN model to analyze the correlation between the main component and content of the specified element to obtain the correlation result.
[0043] The following is a further explanation of the embodiment in conjunction with a specific example - correlation analysis of the main component and content of soil Cu element based on the XRF-EGAN model. The test data are shown in Table 1 below:
[0044] Table 1 Number of soil XRF spectra collected in the embodiment
[0045]
[0046]
[0047] During the experiment, the training environment used was NVDIA 1050Ti graphics card in Windows environment, and the number of XRF-EGAN model training iterations was 100 iterations.
[0048] Step 1: Collect XRF spectrum sample data x of 132 soil samples through XRF fluorescence analyzer, and divide the collected data set into training data set x train And the test data set x test , of which 73 sets are used for training data and 59 sets are used for testing data. The soil spectrum data used in the experiment are as follows Figure 5 As shown. For the training data x train All soil XRF spectrum sample data in the above table are manually deducted from the background of all soil XRF samples to obtain XRF spectrum data without background.
[0049] Step 2: Construct the XRF-EGAN soil XRF background subtraction model and use the XRF spectrum data with background noise in the training data set x train and clean XRF spectrum data after artificial background removal Train the XRF-EGAN neural network model and obtain the trained XRF-EGAN soil XRF background subtraction model.
[0050] Step 3: Through the test data set x test The XRF-EGAN soil XRF background subtraction model was evaluated and verified. Each sample in the test data set was input into the XRF-EGAN model, and the input soil XRF spectrum was background subtracted through the generator, and finally the XRF spectrum data of all test samples after background subtraction was obtained. The results of the experiment using the XRF-EGAN model to perform soil XRF spectrum background subtraction are shown in the figure below. Figure 6 shown.
[0051] Step 4: Obtain the net peak area of Cu element corresponding to the XRF spectrum after soil background subtraction, and analyze the correlation between the net peak area of Cu element and Cu element content.
[0052] Through the above steps, the correlation results between the main components and content of Cu element after soil XRF background subtraction based on the XRF-EGAN model are finally obtained, as shown in Figure 7 As shown. Figure 7 It can be seen that the correlation between the main component and content of Cu element is improved by using XRF-EGAN model to realize the background subtraction of soil XRF spectrum. At the same time, compared with the soil XRF spectrum without background subtraction, the comparison results are shown in Table 2:
[0053] Table 2 Comparison of the correlation between the net peak area of Cu element in soil and the Cu element content
[0054]
[0055] Therefore, it can be judged that the background subtraction of soil XRF spectrum using XRF-EGAN neural network model can effectively improve the correlation between the net peak area and content of XRF spectrum of Cu element, and the result is consistent with the experimental scheme, which proves the effectiveness of the embodiment.
Claims
1. A soil XRF background subtraction method based on the XRF-EGAN model, characterized in that: Based on the design mode of GAN model, a one-dimensional fully convolutional network layer and residual connection are used to build the generator of the model, and a one-dimensional convolution and fully connected layer are used to build the discriminator of the model. The adversarial training mode is used to train the XRF-EGAN model to obtain the trained generator and discriminator. The generator is a soil XRF background subtraction model, thereby improving the correlation between the net peak area and content of the elements in soil XRF. The soil XRF background subtraction method based on the XRF-EGAN model comprises the following steps: Step 1: Use an XRF fluorescence analyzer to collect the XRF spectrum data of the soil sample, and manually subtract the background of the XRF spectrum data of the sample to finally obtain the soil XRF spectrum data before background subtraction. noisy and soil XRF spectrum data without background clean ; Step 2: Collect data noisy Data and Data clean The data is used to train the XRF-EGAN neural network model, and the network model parameters of the generator of the optimal XRF-EGAN model after training are saved; Step 3: Load the generator network model of XRF-EGAN, perform XRF spectrum background subtraction on the new soil XRF spectrum data measured by XRF fluorescence analyzer using the generator network of XRF-EGAN, and obtain the output after background subtraction; The loss function expression used in the training of the XRF-EGAN neural network model generator in step 2 is as follows: Where z∈R 1×1024 represents noise that obeys the standard normal distribution; x represents the input XRF spectrum data containing background; G represents the generator; G(z,x) represents the output obtained by inputting z and x into the generator, that is, the output result of XRF background subtraction; D represents the discriminator; (D(G(z,x))-1) 2 represents the mean square error between the discriminator output and 1; x c represents XRF spectrum data without background; || ||1 represents L1 norm; λ represents the coefficient of L1 norm; The loss function expression used in the discriminator training of the XRF-EGAN neural network model in step 2 is as follows: Where z∈R 1×1024 represents noise that obeys the standard normal distribution; x represents the input XRF spectrum data containing background; G represents the generator; G(z,x) represents the output obtained by inputting z and x into the generator, that is, the output result of XRF background subtraction; D represents the discriminator; D(G(z,x)) 2 represents the mean square error between the discriminator output and 0.
2. The soil XRF background subtraction method based on the XRF-EGAN model according to claim 1, characterized in that: The trained and optimized generator is obtained by adversarial training of the XRF-EGAN model, and the generator is used in the soil XRF spectrum background subtraction task. In addition to being applied to soil XRF spectra, the XRF-EGAN model can also be applied to alloy XRF spectra and spectrum alloy XRF spectra obtained using XRF fluorescence analyzer.
3. The soil XRF background subtraction method based on the XRF-EGAN model according to claim 1, characterized in that: The forward propagation process of the XRF-EGAN network model in step 2 is to input the soil XRF spectrum data x containing the background into the generator model, and after a series of one-dimensional convolution operations and residual connections, the input XRF spectrum x is subjected to feature compression encoding and decoding processes, and finally the background subtraction result with the same dimension as the input x is obtained. The output of the generator The input sample x corresponds to x without background c Input them into the discriminator D together, and finally obtain the output o∈R of the discriminator 1×2 , and calculate the corresponding loss value according to the loss function to optimize the generator and discriminator models of XRF-EGAN.
4. The soil XRF background subtraction method based on the XRF-EGAN model according to claim 1, characterized in that: Before inputting the XRF spectrum x with background into the XRF-EGAN network model in step 2, x needs to be preprocessed. The expression for processing x is as follows: Where x i It represents the count value of the ith channel of the 2048 channels of the XRF spectrum. After taking the logarithm of the input x, the result y=[y1 y2…y 2048 ] to normalize the maximum and minimum values, the mathematical expression is as follows: Where y represents the output result after taking the logarithm of XRF input x; z i Indicates the result y after taking the logarithm of the i-th channel i The normalized result of .
5. The soil XRF background subtraction method based on the XRF-EGAN model according to claim 1, characterized in that: The generator of the XRF-EGAN network model in step 3 performs background subtraction on the input soil XRF spectrum data x, and the output result needs to be denormalized. The expression is as follows: Where y represents the output result after taking the logarithm of the XRF input x; G(x) represents the output result of the generator of the XRF-EGAN model after the input x passes through; Represents the denormalized result. After the denormalization is completed, the denormalized result is To take the index, the formula is as follows: In the formula Represents the denormalized result of the i-th value of the output matrix of the generative model G; Express Take the result of exponentialization.
Citation Information
Patent Citations
Antibacterial effectiveness evaluation method for antibacterial glass
CN109187609A
Inverse synthetic aperture radar imaging method based on generative adversarial network
CN111077523A