Multi-element analysis method and system for laser-induced breakdown spectroscopy
By combining XGBoost with neural networks, LIBS spectral data processing is optimized, solving the problems of matrix effects and nonlinear influences. This achieves high accuracy and low complexity in multi-element analysis and is suitable for efficient processing of LIBS spectral data.
Patent Information
- Application Number
- CN202311227238.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2043-09-21
AI Technical Summary
Existing technologies using laser-induced breakdown spectroscopy (LIBS) for multi-element analysis suffer from complex and nonlinear effects caused by matrix effects that are difficult to correct effectively, leading to uncertainty in element content determination. Furthermore, traditional machine learning models cannot effectively handle the structural and small data volume issues of LIBS spectral data.
By employing a cascaded combination of XGBoost and neural networks, and constructing both an XGBoost regression model and a neural network model, combined with spectral preprocessing and regularization techniques, we optimize spectral feature extraction and model training, thereby achieving efficient processing of LIBS spectral data.
It improves the accuracy and stability of multi-element analysis, reduces model complexity and overfitting risk, reduces computational resource requirements, and enhances the nonlinear fitting effect of the LIBS spectral inversion process.
Smart Images

Figure CN117291251B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-element analysis technology in substances or materials, specifically to a method and system for multi-element analysis using laser-induced breakdown spectroscopy. More particularly, it relates to a method and system for multi-element analysis using laser-induced breakdown spectroscopy based on a cascaded combination of XGBoost and neural networks for data processing. Background Technology
[0002] The accurate determination of key indicator elements in substances or materials, such as ores, especially iron ore, is a crucial step in many applications. When using laser-induced breakdown spectroscopy (LIBS) to determine the elemental content of substances or materials, it is subject to matrix effects. This means that the intensity of the corresponding spectral lines is not only related to the element's content in the sample, but also to the physical and chemical properties of the sample matrix, as well as the element's chemical speciation within the sample. This multi-layered correlation leads to uncertainty in retrieving elemental content from spectral line intensity in applications. Machine learning methods are often used to build multivariate spectral inversion models to overcome matrix effects in LIBS elemental analysis of substances or materials. However, typical machine learning models comprehensively and one-time correct the impact of these matrix effects on LIBS quantitative analysis. This approach is unsuitable for the highly nonlinear influence of matrix effects on LIBS spectra due to the complexity of their physical mechanisms—a superposition of a linear, systematic bias and a high-order nonlinear, random variance. Furthermore, it is necessary to optimize computational power and improve the efficiency of the inversion model based on the structure of LIBS spectral data, the physical regularity of spectral features, and the typically small data volume encountered in applications. Therefore, it is necessary to optimize the selection of machine learning paradigms and implementation methods to improve the efficiency and accuracy of multivariate inversion models in processing LIBS spectral data, and fully meet the needs of applications.
[0003] Patent document CN103063621A (application number: CN201110323641.7) discloses a method for identifying the elemental composition and content levels in a analyte. The specific steps are: 1) establishing an elemental standard spectral library; 2) acquiring the spectrum of the analyte and determining the wavelength range of the measured spectrum; 3) performing peak-finding processing on the measured spectrum; 4) determining whether the selected element exists in the analyte; 5) calculating the correlation coefficient of the spectrum given the presence of a certain element; and 6) determining the element concentration based on the correlation coefficient. However, this patent cannot solve the existing technical problems. Summary of the Invention
[0004] To address the shortcomings of existing technologies, the purpose of this invention is to provide a multi-element analysis method and system based on laser-induced breakdown spectroscopy.
[0005] The multi-element analysis method for laser-induced breakdown spectroscopy provided by the present invention includes:
[0006] Step S1: Modeling, Sample Preparation, and Spectral Acquisition: Prepare M samples with the content gradient of the j-th target element to be measured, and the corresponding target element label content tensor, denoted as . j = 1, 2, ..., J, where J is the number of target elements; m = 1, 2, ..., M, where M is the number of samples. The samples are arbitrarily divided into a training sample set containing M1 samples and a test sample set containing M2 samples, where M1 + M2 = M. Using laser-induced breakdown spectroscopy, under optimized experimental conditions, the original repeated spectra of all samples are collected through multiple repeated measurements of each sample, denoted as the original spectral intensity tensor. Among the elements The spectral intensities of the k0 spectral channels corresponding to the l0th repeating spectrum of the mth sample, where l0 = 1, 2, ... L0, k0 = 1, 2, ... K0, L0 is the number of original repeating spectra of the mth sample, and K0 is the number of spectral channels of the l0th original repeating spectrum of the mth sample.
[0007] Step S2: Spectral preprocessing and regularization: Preprocess all original repeating spectra of all samples to obtain the preprocessed repeating spectral intensity tensor of all samples. Among the elements The spectral intensity of the k1-th spectral channel corresponding to the l1-th preprocessed repeating spectrum of the m-th sample, where l1 = 1, 2, ..., L1, k1 = 1, 2, ..., K1, L1 is the number of preprocessed repeating spectra of the m-th sample, and K1 is the number of spectral channels of the l1-th preprocessed repeating spectrum of the m-th sample. This is applied to the preprocessed repeating spectrum set of the training samples. and test sample pretreatment repeat spectral set Regularization is performed separately for each given spectral channel, starting with... The calculations are performed, and the obtained regularization parameters are passed to the spectral channels in a one-to-one correspondence. Perform calculations to obtain regularized preprocessed repeating spectral sets for training and test samples, respectively. and
[0008] Step S3: XGBoost Model Construction and Training: Set the maximum number of regression trees, maximum depth, and minimum leaf node weights; determine the overall learning rate of the model; and input the training data set. For the j-th target element, under the supervised learning paradigm, the input data is dynamically divided into a training set and a validation set, cross-validated, and trained to obtain the XGBoost regression model.
[0009] Step S4: Calculate the residuals of XGBoost model predictions: Inputting the XGBoost model yields the calibrated prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m1-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeat spectra of the m1-th sample. The calibration residual vector is then calculated.
[0010] Step S5: Calculation of Spectral Channel Importance and Extraction of Spectral Features: For the training sample set, a correlation data analysis algorithm is used to calculate the regularized preprocessed spectral intensity of a given spectral channel k1. Calibration residuals of corresponding samples Based on the correlation values, the spectral channels are sorted from high to low correlation values, and the K2 spectral channels with the highest correlation values are selected as feature spectral channels to obtain the feature repeating spectrum set of the training samples. k2 = 1, 2, ... K2, where k2 represents the selected spectral channels. Applying the same spectral channel labeling to the test sample set yields a characteristic repeatable spectral set of the test samples.
[0011] Step S6: Neural Network Model Construction and Training for Residuals: Determine the neural network structure, including an input layer with K² neurons matching the spectral features extracted in Step S5, multiple hidden layers, and an output layer with a single neuron to output the predicted content value, input to the training data set. For the j-th target element, a neural network regression model is trained under a supervised learning paradigm. The input data is dynamically divided into training and validation sets, cross-validation is performed, the model parameters are iterated in a loop, and the loss function is gradient descent until the expected value is reached. The model training is terminated, and the model calibration performance parameters are output, including the root mean square error of calibration (RMSEC) and the relative error of calibration (REC).
[0012] Step S7: Conduct tandem combination model tests using independent samples: Regularized preprocessing of repeating spectral sets of test samples Input the XGBoost model to get the test prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m2-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeating spectra of the m2-th sample. This is the characteristic repeating spectrum set of the test samples. Input the neural network model obtained in step S6 to obtain the test prediction output. Among the elements The neural network model prediction value for the j-th target element of the m2-th test sample is obtained by averaging the independent prediction values of the L1 characteristic repeat spectra of the m2-th sample, and the standard deviation of the above independent prediction values is also calculated. Calculate the predicted content value of the j-th target element using the cascade combination model. Its error is The content label value of the j-th target element in the test sample By comparison, the prediction performance parameters of the cascaded combined model were calculated, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP).
[0013] Step S8: Optimize the number of spectral features and apply the final model based on the test results: In one loop, by changing K2, balance the optimization of RMSEC and REC in step S6 and RMSEP and REP in step S7 to obtain the optimized number of spectral feature values K3. Train the neural network with this value. The corresponding cascaded combination model prediction performance parameters are used to evaluate the model's elemental content prediction performance when the model is applied to unknown substances or materials, under the conditions of sample preparation, experimentation, spectral preprocessing, and regularization in the same way.
[0014] Preferably, step S1 includes:
[0015] Step S1.1: Samples are obtained by characterizing real samples collected for the application or by sample preparation, with the number of samples being 10. 1 -10 3 Magnitude;
[0016] Step S1.2: The prepared sample has a flat surface with a diameter of centimeters, which is achieved by pressing powder into a cake;
[0017] Step S1.3: The number of samples in the training set is greater than the number of samples in the test set. The prepared samples are divided into training samples and test samples in a ratio of M1:M2 = 4:1.
[0018] Step S1.4: For a given target element j, the content gradient in the sample covers all content ranges of the element in the application, and the content of the test sample is uniformly distributed within the content range shown by the training sample.
[0019] Step S1.5: For a given sample, the number of repeated spectra is 10. 1 -10 2 On the order of magnitude, each repeating spectrum is acquired in a specific region on the sample surface, and each acquisition region contains 10 0 -10 1 A repeating spectrum is obtained by averaging the spectra of each sampling point from an order of magnitude of 100 sampling points.
[0020] Step S1.6: At each of the above sampling points, accumulate 10 0 -10 1 A laser pulse of a certain magnitude is emitted to obtain a spectrum of a sampling point. Before the spectrum is acquired, the sample surface is pre-etched to remove surface contaminants. The spectrum excited by the pre-etching pulse does not contribute to the sample's repeating spectrum.
[0021] Preferably, step S2 includes:
[0022] Step S2.1: Based on the sensitivity range of the device detector and the specific application requirements in actual applications, select the effective part of the original spectrum for truncation and stitch together the spectra collected by different spectrometer modules;
[0023] Step S2.2: Generate the average repeat spectrum using the ordinary averaging or moving average method, keeping the average repeat spectrum number of each sample at 10. 1 -10 2 Magnitude;
[0024] Step S2.3: Use wavelet transform to remove baselines;
[0025] Step S2.4: Normalize the total spectral intensity or the spectral lines of the internal standard elements;
[0026] Step S2.5: Use [0,1] interval regularization to regularize and preprocess the repeating spectra of the training samples. The calculation formula is These represent the maximum and minimum values of the preprocessed repeated spectra of the k1-th spectral channel for all training samples, respectively.
[0027] Step S2.6: The same spectral channel maxima and minima are passed to the preprocessed repeatable spectra of the test sample in a one-to-one correspondence, and the regularized preprocessed repeatable spectra of the test sample are calculated.
[0028] Step S2.7: Under the same experimental conditions, use matching equipment to acquire spectra and perform the same spectral preprocessing. The preprocessed spectra of unknown samples use the regularization parameters of the preprocessed spectra set of training samples. and Perform regularization on the [0,1] interval.
[0029] Preferably, step S3 includes:
[0030] Step S3.1: In the XGBoost model, the maximum number of regression trees is fixed at 60, the maximum depth of the regression trees is determined to be 6, the weight of the smallest leaf node in the regression tree is set to 3, and the overall learning rate of the model is 0.2.
[0031] Step S3.2: The structure of the XGBoost model is adjusted and optimized according to actual needs;
[0032] Step S3.3: Train the XGBoost model through cross-validation, dynamically dividing 60% of the data into the training dataset and the remaining 40% into the validation dataset.
[0033] Preferably, step S4 includes: adding the residual of each sample as a label to the sample table as the training target for the next stage, that is, listing the element content and the residual of the predicted content of all samples.
[0034] Preferably, step S5 includes:
[0035] Step S5.1: Select the SelectKBest algorithm in conjunction with the f_regression evaluation function to calculate the correlation coefficient between each spectral channel and the residual value calculated in step S4, and sort the spectral channels accordingly; or sort them by the importance of the spectral channels output when training the XGBoost model in step S3.
[0036] Step S5.2: Based on experience and the constraints of practical application, select the K2 spectral channels with the highest correlation values as feature spectral channels, and comprehensively optimize the number of features K2 based on the calibration and prediction characteristics of the model in the later stage.
[0037] Step S5.3: For different target elements, determine the number of features to be input into the subsequent neural network. The basis for feature selection is to minimize the number of features while ensuring that the model prediction accuracy meets the preset conditions.
[0038] Preferably, step S6 includes:
[0039] Step S6.1: Based on the scale of the spectral data, use an empirical formula. To estimate the number of neurons in the hidden layer, where h is the number of neurons in the hidden layer, e is the number of neurons in the input layer, f is the number of neurons in the output layer, and g is an adjustment constant between 1 and 10;
[0040] Step S6.2: For spectral data with a wide band, the hidden layer structure is as follows: the first hidden layer contains 12 neurons and the second hidden layer contains 8 neurons;
[0041] Step S6.3: The number of hidden layers and the number of neurons in each layer are adjusted and optimized according to the actual data.
[0042] Step S6.4: Train the neural network model through cross-validation, dynamically dividing 60% of the data into the training dataset and the remaining 40% into the validation dataset;
[0043] Step S6.5: Train the model using the squared error loss function.
[0044] Preferably, step S7 includes: comparing the element content prediction results of the tandem combination model with the element content marked in the sample table, and calculating the model prediction performance parameters, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP). These parameters are used to calculate the model's element content prediction performance when applied to unknown substances under the same sample preparation method, the same experimental data acquisition method, the same spectral preprocessing method, and the same spectral regularization conditions.
[0045] Preferably, step S8 includes:
[0046] Step S8.1: For a given target element, K2 starts to increase from a small value, REC in step S6 continues to decrease, and REP in step S7 will increase after an initial steady change or a slight decrease. The two change curves intersect at a certain K2 value, and this K2 value is taken as the optimized spectral feature number, i.e., the K3 value.
[0047] Step S8.2: For different feature selection algorithms, the number of feature channels for the same element input into the neural network changes. When changing the feature selection algorithm, it is necessary to rescan the relationship between the number of features and REP and REC.
[0048] The multi-element analysis system for laser-induced breakdown spectroscopy provided by the present invention includes:
[0049] Module M1: Modeling, Sample Preparation, and Spectral Acquisition: Prepare M samples with the content gradient of the j-th target element to be measured, and the corresponding target element label content tensor, denoted as... j = 1, 2, ..., J, where J is the number of target elements; m = 1, 2, ..., M, where M is the number of samples. The samples are arbitrarily divided into a training sample set containing M1 samples and a test sample set containing M2 samples, where M1 + M2 = M. Using laser-induced breakdown spectroscopy, under optimized experimental conditions, the original repeated spectra of all samples are collected through multiple repeated measurements of each sample, denoted as the original spectral intensity tensor. Among the elements The spectral intensities of the k0 spectral channels corresponding to the l0th repeating spectrum of the mth sample, where l0 = 1, 2, ... L0, k0 = 1, 2, ... K0, L0 is the number of original repeating spectra of the mth sample, and K0 is the number of spectral channels of the l0th original repeating spectrum of the mth sample.
[0050] Module M2: Spectral Preprocessing and Regularization: Preprocesses all original repeating spectra of all samples to obtain the preprocessed repeating spectral intensity tensor of all samples. Among the elements The spectral intensity of the k1-th spectral channel corresponding to the l1-th preprocessed repeating spectrum of the m-th sample, where l1 = 1, 2, ..., L1, k1 = 1, 2, ..., K1, L1 is the number of preprocessed repeating spectra of the m-th sample, and K1 is the number of spectral channels of the l1-th preprocessed repeating spectrum of the m-th sample. This is applied to the preprocessed repeating spectrum set of the training samples. and test sample pretreatment repeat spectral set Regularization is performed separately for each given spectral channel, starting with... The calculations are performed, and the obtained regularization parameters are passed to the spectral channels in a one-to-one correspondence. Perform calculations to obtain regularized preprocessed repeating spectral sets for training and test samples, respectively. and
[0051] Module M3: XGBoost Model Building and Training: Set the maximum number of regression trees, maximum depth, and minimum leaf node weights; determine the overall learning rate of the model; input the training data set. For the j-th target element, under the supervised learning paradigm, the input data is dynamically divided into a training set and a validation set, cross-validated, and trained to obtain the XGBoost regression model.
[0052] Module M4: XGBoost Model Prediction Residual Calculation: [The remaining text appears to be incomplete and requires further context.] Inputting the XGBoost model yields the calibrated prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m1-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeat spectra of the m1-th sample. The calibration residual vector is then calculated.
[0053] Module M5: Spectral Channel Importance Calculation and Spectral Feature Extraction: For the training sample set, using a correlation data analysis algorithm, calculates the regularized preprocessed spectral intensity of a given spectral channel k1. Calibration residuals of corresponding samples Based on the correlation values, the spectral channels are sorted from high to low correlation values, and the K2 spectral channels with the highest correlation values are selected as feature spectral channels to obtain the feature repeating spectrum set of the training samples. k2 = 1, 2, ... K2, where k2 represents the selected spectral channels. Applying the same spectral channel labeling to the test sample set yields a characteristic repeatable spectral set of the test samples.
[0054] Module M6: Neural Network Model Construction and Training for Residuals: Determine the neural network structure, including an input layer with K2 neurons matching the spectral features extracted in Module M5, multiple hidden layers, and an output layer with a single neuron to output predicted content values, input to the training data set. For the j-th target element, a neural network regression model is trained under a supervised learning paradigm. The input data is dynamically divided into training and validation sets, cross-validation is performed, the model parameters are iterated in a loop, and the loss function is gradient descent until the expected value is reached. The model training is terminated, and the model calibration performance parameters are output, including the root mean square error of calibration (RMSEC) and the relative error of calibration (REC).
[0055] Module M7: Tandem Combination Model Testing Using Independent Samples: Regularized Preprocessing of Repeated Spectra Sets of Test Samples Input the XGBoost model to get the test prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m2-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeating spectra of the m2-th sample. This is the characteristic repeating spectrum set of the test samples. The neural network model obtained from module M6 is used to obtain the test prediction output. Among the elements The neural network model prediction value for the j-th target element of the m2-th test sample is obtained by averaging the independent prediction values of the L1 characteristic repeat spectra of the m2-th sample, and the standard deviation of the above independent prediction values is also calculated. Calculate the predicted content value of the j-th target element using the cascade combination model. Its error is The content label value of the j-th target element in the test sample By comparison, the prediction performance parameters of the cascaded combined model were calculated, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP).
[0056] Module M8: Optimizes spectral feature number and applies the final model based on test results: In one loop, by changing K2, the RMSEC and REC in module M6 and the RMSEP and REP in module M7 are balanced to obtain the optimized number of spectral feature values K3. This is used to train the neural network. The corresponding cascaded combination model prediction performance parameters are used to evaluate the model's elemental content prediction performance when applied to unknown substances or materials, under the same sample preparation method, the same experimental method, and the same spectral preprocessing and regularization conditions.
[0057] Compared with the prior art, the present invention has the following beneficial effects:
[0058] 1. Compared with traditional linear fitting analysis methods, this method has a stronger ability to handle complex nonlinear functional relationships. In the analysis of multi-element and compound substances or materials, this method effectively calibrates the matrix effect caused by changes in sample matrix and different chemical forms of elements, thereby improving the accuracy of quantitative models and the stability of prediction performance.
[0059] 2. Compared with classic machine learning LIBS spectral data processing methods based on a single algorithm, this method leverages the unique advantages of the XGBoost algorithm in structured spectral data processing, the reduced computational power and time requirements for processing small- to medium-scale LIBS spectral data, and the powerful fitting ability of neural networks for high-order nonlinear function relationships. These two methods are combined in series and applied to regression analysis of LIBS spectra. Guided by prior physical knowledge, the algorithm structure designed in this invention enhances the fitting effect on the nonlinear processes in the LIBS spectral inversion process, improving the accuracy of the inversion from spectrum to elemental composition. Simultaneously, while ensuring model accuracy, it significantly reduces model complexity and scale, minimizing the risk of overfitting.
[0060] 3. Compared with deep learning spectral data processing methods based on CNN and other methods, this method can controllably and visually extract spectral features during model training. In practical applications, it has the advantages of low computational cost, fast computation speed, and simple model in the forward inference process, which can save computer resources and computing power of terminal devices and reduce the hardware requirements of terminal analysis equipment. Attached Figure Description
[0061] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0062] Figure 1 This is a flowchart illustrating the implementation of the method of the present invention;
[0063] Figure 2 (a) to (e) respectively target five target elements, with element label content as independent variable, showing the relevant spectral intensity data of the training sample set spectrum in the preferred embodiment of the present invention, their univariate linear regression models and their R2 values, and also showing the relevant spectral intensity data of the test sample set spectrum in the preferred embodiment of the present invention.
[0064] Figure 3 (a) to (e) in the present invention, with element label content as independent variable, respectively, show the correlation spectral intensity data after normalization of the total spectral intensity of the training sample set spectrum in the preferred embodiment of the present invention, their univariate linear regression models and their R2 values, and at the same time show the correlation spectral intensity data after normalization of the total spectral intensity of the test sample set spectrum in the preferred embodiment of the present invention.
[0065] Figure 4 (a) to (e) respectively target five target elements, with element label content as independent variable, showing the normalized correlation spectral intensity data of the internal standard element (N) of the training sample set spectrum in the preferred embodiment of the present invention, their univariate linear regression models and their R2 values, and also showing the normalized correlation spectral intensity data of the internal standard element (N) of the test sample set spectrum in the preferred embodiment of the present invention.
[0066] Figure 5 (a) to (e) in the figure respectively target five target elements, with element label content as independent variable, showing the predicted values of the training sample set spectra in the preferred embodiment of the present invention through the XGBoost model, their linear fit and R2 value, the predicted values of the test sample set spectra in the preferred embodiment of the present invention through the XGBoost model, the national standard allowable error range for element determination, and the true value 1:1 diagonal. It can be seen that the test results cannot meet the error range allowed by the national standard.
[0067] Figure 6 (a) to (e) respectively target five target elements, with element label content as the independent variable. They show the predicted values of the training sample set spectra in the preferred embodiment of the present invention through the XGBoost+BPNN combined model, their linear fit and R2 value, the predicted values of the test sample set spectra in the preferred embodiment of the present invention through the XGBoost+BPNN combined model, the national standard allowable error range for element determination, and the true value 1:1 diagonal. It can be seen that the test results can meet the error range allowed by the national standard. Detailed Implementation
[0068] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0069] Example 1:
[0070] like Figure 1 This invention provides a multi-element analysis method for laser-induced breakdown spectroscopy, comprising:
[0071] Step S1: Modeling, Sample Preparation, and Spectral Acquisition: Prepare M samples with the content gradient of the j-th target element to be measured, and the corresponding target element label content tensor, denoted as . j = 1, 2, ..., J, where J is the number of target elements; m = 1, 2, ..., M, where M is the number of samples. The samples are arbitrarily divided into a training sample set containing M1 samples and a test sample set containing M2 samples, where M1 + M2 = M. Using laser-induced breakdown spectroscopy, under optimized experimental conditions, the original repeated spectra of all samples are collected through multiple repeated measurements of each sample, denoted as the original spectral intensity tensor. Among the elements The spectral intensities of the k0 spectral channels corresponding to the l0th repeating spectrum of the mth sample, where l0 = 1, 2, ... L0, k0 = 1, 2, ... K0, L0 is the number of original repeating spectra of the mth sample, and K0 is the number of spectral channels of the l0th original repeating spectrum of the mth sample.
[0072] Step S2: Spectral preprocessing and regularization: Preprocess all original repeating spectra of all samples to obtain the preprocessed repeating spectral intensity tensor of all samples. Among the elements The spectral intensity of the k1-th spectral channel corresponding to the l1-th preprocessed repeating spectrum of the m-th sample, where l1 = 1, 2, ..., L1, k1 = 1, 2, ..., K1, L1 is the number of preprocessed repeating spectra of the m-th sample, and K1 is the number of spectral channels of the l1-th preprocessed repeating spectrum of the m-th sample. This is applied to the preprocessed repeating spectrum set of the training samples. and test sample pretreatment repeat spectral set Regularization is performed separately for each given spectral channel, starting with... The calculations are performed, and the obtained regularization parameters are passed to the spectral channels in a one-to-one correspondence. Perform calculations to obtain regularized preprocessed repeating spectral sets for training and test samples, respectively. and
[0073] Step S3: XGBoost Model Construction and Training: Set the maximum number of regression trees, maximum depth, and minimum leaf node weights; determine the overall learning rate of the model; and input the training data set. For the j-th target element, under the supervised learning paradigm, the input data is dynamically divided into a training set and a validation set, cross-validated, and trained to obtain the XGBoost regression model.
[0074] Step S4: Calculate the residuals of XGBoost model predictions: Inputting the XGBoost model yields the calibrated prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m1-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeat spectra of the m1-th sample. The calibration residual vector is then calculated.
[0075] Step S5: Calculation of Spectral Channel Importance and Extraction of Spectral Features: For the training sample set, a correlation data analysis algorithm is used to calculate the regularized preprocessed spectral intensity of a given spectral channel k1. Calibration residuals of corresponding samples Based on the correlation values, the spectral channels are sorted from high to low correlation values, and the K2 spectral channels with the highest correlation values are selected as feature spectral channels to obtain the feature repeating spectrum set of the training samples. k2 = 1, 2, ... K2, where k2 represents the selected spectral channels. Applying the same spectral channel labeling to the test sample set yields a characteristic repeatable spectral set of the test samples.
[0076] Step S6: Neural Network Model Construction and Training for Residuals: Determine the neural network structure, including an input layer with K² neurons matching the spectral features extracted in Step S5, multiple hidden layers, and an output layer with a single neuron to output the predicted content value, input to the training data set. For the j-th target element, a neural network regression model is trained under a supervised learning paradigm. The input data is dynamically divided into training and validation sets, cross-validation is performed, the model parameters are iterated in a loop, and the loss function is gradient descent until the expected value is reached. The model training is terminated, and the model calibration performance parameters are output, including the root mean square error of calibration (RMSEC) and the relative error of calibration (REC).
[0077] Step S7: Conduct tandem combination model tests using independent samples: Regularized preprocessing of repeating spectral sets of test samples Input the XGBoost model to get the test prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m2-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeating spectra of the m2-th sample. This is the characteristic repeating spectrum set of the test samples. Input the neural network model obtained in step S6 to obtain the test prediction output. Among the elements The neural network model prediction value for the j-th target element of the m2-th test sample is obtained by averaging the independent prediction values of the L1 characteristic repeat spectra of the m2-th sample, and the standard deviation of the above independent prediction values is also calculated. Calculate the predicted content value of the j-th target element using the cascade combination model. Its error is The content label value of the j-th target element in the test sample By comparison, the prediction performance parameters of the cascaded combined model were calculated, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP).
[0078] Step S8: Optimize the number of spectral features and apply the final model based on the test results: In one loop, by changing K2, balance the optimization of RMSEC and REC in step S6 and RMSEP and REP in step S7 to obtain the optimized number of spectral feature values K3. Train the neural network with this value. The corresponding cascaded combination model prediction performance parameters are used to evaluate the model's elemental content prediction performance when the model is applied to unknown substances or materials, under the conditions of sample preparation, experimentation, spectral preprocessing, and regularization in the same way.
[0079] Step S1 includes:
[0080] Step S1.1: Samples are obtained by characterizing real samples collected for the application or by sample preparation, with the number of samples being 10. 1 -10 3 Magnitude;
[0081] Step S1.2: The prepared sample has a flat surface with a diameter of centimeters, which is achieved by pressing powder into a cake;
[0082] Step S1.3: The number of samples in the training set is greater than the number of samples in the test set. The prepared samples are divided into training samples and test samples in a ratio of M1:M2 = 4:1.
[0083] Step S1.4: For a given target element j, the content gradient in the sample covers all content ranges of the element in the application, and the content of the test sample is uniformly distributed within the content range shown by the training sample.
[0084] Step S1.5: For a given sample, the number of repeated spectra is 10. 1 -10 2 On the order of magnitude, each repeating spectrum is acquired in a specific region on the sample surface, and each acquisition region contains 10 0 -10 1 A repeating spectrum is obtained by averaging the spectra of each sampling point from an order of magnitude of 100 sampling points.
[0085] Step S1.6: At each of the above sampling points, accumulate 10 0 -10 1 A laser pulse of a certain magnitude is emitted to obtain a spectrum of a sampling point. Before the spectrum is acquired, the sample surface is pre-etched to remove surface contaminants. The spectrum excited by the pre-etching pulse does not contribute to the sample's repeating spectrum.
[0086] Step S2 includes:
[0087] Step S2.1: Based on the sensitivity range of the device detector and the specific application requirements in actual applications, select the effective part of the original spectrum for truncation and stitch together the spectra collected by different spectrometer modules;
[0088] Step S2.2: Generate the average repeat spectrum using the ordinary averaging or moving average method, keeping the average repeat spectrum number of each sample at 10. 1 -10 2 Magnitude;
[0089] Step S2.3: Use wavelet transform to remove baselines;
[0090] Step S2.4: Normalize the total spectral intensity or the spectral lines of the internal standard elements;
[0091] Step S2.5: Use [0,1] interval regularization to regularize and preprocess the repeating spectra of the training samples. The calculation formula is These represent the maximum and minimum values of the preprocessed repeated spectra of the k1-th spectral channel for all training samples, respectively.
[0092] Step S2.6: The same spectral channel maxima and minima are passed to the preprocessed repeatable spectra of the test sample in a one-to-one correspondence, and the regularized preprocessed repeatable spectra of the test sample are calculated.
[0093] Step S2.7: Under the same experimental conditions, use matching equipment to acquire spectra and perform the same spectral preprocessing. The preprocessed spectra of unknown samples use the regularization parameters of the preprocessed spectra set of training samples. and Perform regularization on the [0,1] interval.
[0094] Step S3 includes:
[0095] Step S3.1: In the XGBoost model, the maximum number of regression trees is fixed at 60, the maximum depth of the regression trees is determined to be 6, the weight of the smallest leaf node in the regression tree is set to 3, and the overall learning rate of the model is 0.2.
[0096] Step S3.2: The structure of the XGBoost model is adjusted and optimized according to actual needs;
[0097] Step S3.3: Train the XGBoost model through cross-validation, dynamically dividing 60% of the data into the training dataset and the remaining 40% into the validation dataset.
[0098] Step S4 includes: adding the residual of each sample as a label to the sample table as the training target for the next stage, that is, listing the element content and the residual of the predicted content of all samples.
[0099] Step S5 includes:
[0100] Step S5.1: Select the SelectKBest algorithm in conjunction with the f_regression evaluation function to calculate the correlation coefficient between each spectral channel and the residual value calculated in step S4, and sort the spectral channels accordingly; or sort them by the importance of the spectral channels output when training the XGBoost model in step S3.
[0101] Step S5.2: Based on experience and the constraints of practical application, select the K2 spectral channels with the highest correlation values as feature spectral channels, and comprehensively optimize the number of features K2 based on the calibration and prediction characteristics of the model in the later stage.
[0102] Step S5.3: For different target elements, determine the number of features to be input into the subsequent neural network. The basis for feature selection is to minimize the number of features while ensuring that the model prediction accuracy meets the preset conditions.
[0103] Step S6 includes:
[0104] Step S6.1: Based on the scale of the spectral data, use an empirical formula. To estimate the number of neurons in the hidden layer, where h is the number of neurons in the hidden layer, e is the number of neurons in the input layer, f is the number of neurons in the output layer, and g is an adjustment constant between 1 and 10;
[0105] Step S6.2: For spectral data with a wide band, the hidden layer structure is as follows: the first hidden layer contains 12 neurons and the second hidden layer contains 8 neurons;
[0106] Step S6.3: The number of hidden layers and the number of neurons in each layer are adjusted and optimized according to the actual data.
[0107] Step S6.4: Train the neural network model through cross-validation, dynamically dividing 60% of the data into the training dataset and the remaining 40% into the validation dataset;
[0108] Step S6.5: Train the model using the squared error loss function.
[0109] Step S7 includes: comparing the element content prediction results of the tandem combination model with the element content marked in the sample table, and calculating the model prediction performance parameters, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP). These parameters are used to calculate the model's element content prediction performance when applied to unknown substances under the same sample preparation method, the same experimental data acquisition method, the same spectral preprocessing method, and the same spectral regularization conditions.
[0110] Step S8 includes:
[0111] Step S8.1: For a given target element, K2 starts to increase from a small value, REC in step S6 continues to decrease, and REP in step S7 will increase after an initial steady change or a slight decrease. The two change curves intersect at a certain K2 value, and this K2 value is taken as the optimized spectral feature number, i.e., the K3 value.
[0112] Step S8.2: For different feature selection algorithms, the number of feature channels for the same element input into the neural network changes. When changing the feature selection algorithm, it is necessary to rescan the relationship between the number of features and REP and REC.
[0113] Example 2:
[0114] The present invention also provides a multi-element analysis system for laser-induced breakdown spectroscopy. The multi-element analysis system for laser-induced breakdown spectroscopy can be implemented by executing the process steps of the multi-element analysis method for laser-induced breakdown spectroscopy. That is, those skilled in the art can understand the multi-element analysis method for laser-induced breakdown spectroscopy as a preferred embodiment of the multi-element analysis system for laser-induced breakdown spectroscopy.
[0115] The multi-element analysis system for laser-induced breakdown spectroscopy provided by the present invention includes:
[0116] Module M1: Modeling, Sample Preparation, and Spectral Acquisition: Prepare M samples with the content gradient of the j-th target element to be measured, and the corresponding target element label content tensor, denoted as... j = 1, 2, ..., J, where J is the number of target elements; m = 1, 2, ..., M, where M is the number of samples. The samples are arbitrarily divided into a training sample set containing M1 samples and a test sample set containing M2 samples, where M1 + M2 = M. Using laser-induced breakdown spectroscopy, under optimized experimental conditions, the original repeated spectra of all samples are collected through multiple repeated measurements of each sample, denoted as the original spectral intensity tensor. Among the elements The spectral intensities of the k0 spectral channels corresponding to the l0th repeating spectrum of the mth sample, where l0 = 1, 2, ... L0, k0 = 1, 2, ... K0, L0 is the number of original repeating spectra of the mth sample, and K0 is the number of spectral channels of the l0th original repeating spectrum of the mth sample.
[0117] Module M2: Spectral Preprocessing and Regularization: Preprocesses all original repeating spectra of all samples to obtain the preprocessed repeating spectral intensity tensor of all samples. Among the elements Corresponding to the l1th of the m-th sample
[0118] The spectral intensity of the k1-th spectral channel of the preprocessed repeating spectrum, l1 = 1, 2, ..., L1, k1 = 1, 2, ..., K1, where L1 is the number of preprocessed repeating spectra for the m-th sample, and K1 is the number of spectral channels in the l1-th preprocessed repeating spectrum of the m-th sample. This is the preprocessed repeating spectrum set for the training samples. and test sample pretreatment repeat spectral set Regularization is performed separately for each given spectral channel, starting with... The calculations are performed, and the obtained regularization parameters are passed to the spectral channels in a one-to-one correspondence. Perform calculations to obtain regularized preprocessed repeating spectral sets for training and test samples, respectively. and
[0119] Module M3: XGBoost Model Building and Training: Set the maximum number of regression trees, maximum depth, and minimum leaf node weights; determine the overall learning rate of the model; input the training data set. For the j-th target element, under the supervised learning paradigm, the input data is dynamically divided into a training set and a validation set, cross-validated, and trained to obtain the XGBoost regression model.
[0120] Module M4: XGBoost Model Prediction Residual Calculation: [The remaining text appears to be incomplete and requires further context.] Inputting the XGBoost model yields the calibrated prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m1-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeat spectra of the m1-th sample. The calibration residual vector is then calculated.
[0121] Module M5: Spectral Channel Importance Calculation and Spectral Feature Extraction: For the training sample set, using a correlation data analysis algorithm, calculates the regularized preprocessed spectral intensity of a given spectral channel k1. Calibration residuals of corresponding samples Based on the correlation values, the spectral channels are sorted from high to low correlation values, and the K2 spectral channels with the highest correlation values are selected as feature spectral channels to obtain the feature repeating spectrum set of the training samples. k2 = 1, 2, ... K2, where k2 represents the selected spectral channels. Applying the same spectral channel labeling to the test sample set yields a characteristic repeatable spectral set of the test samples.
[0122] Module M6: Neural Network Model Construction and Training for Residuals: Determine the neural network structure, including an input layer with K2 neurons matching the spectral features extracted in Module M5, multiple hidden layers, and an output layer with a single neuron to output predicted content values, input to the training data set. For the j-th target element, a neural network regression model is trained under a supervised learning paradigm. The input data is dynamically divided into training and validation sets, cross-validation is performed, the model parameters are iterated in a loop, and the loss function is gradient descent until the expected value is reached. The model training is terminated, and the model calibration performance parameters are output, including the root mean square error of calibration (RMSEC) and the relative error of calibration (REC).
[0123] Module M7: Tandem Combination Model Testing Using Independent Samples: Regularized Preprocessing of Repeated Spectra Sets of Test Samples Input the XGBoost model to get the test prediction output. Among the elements The XGBoost model prediction value for the j-th target element of the m2-th sample is obtained by averaging the independent prediction values of the L1 preprocessed repeating spectra of the m2-th sample. This is the characteristic repeating spectrum set of the test samples. The neural network model obtained from module M6 is used to obtain the test prediction output. Among the elements The neural network model prediction value for the j-th target element of the m2-th test sample is obtained by averaging the independent prediction values of the L1 characteristic repeat spectra of the m2-th sample, and the standard deviation of the above independent prediction values is also calculated. Calculate the predicted content value of the j-th target element using the cascade combination model. Its error is The content label value of the j-th target element in the test sample By comparison, the prediction performance parameters of the cascaded combined model were calculated, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP).
[0124] Module M8: Optimizes spectral feature number and applies the final model based on test results: In one loop, by changing K2, the RMSEC and REC in module M6 and the RMSEP and REP in module M7 are balanced to obtain the optimized number of spectral feature values K3. This is used to train the neural network. The corresponding cascaded combination model prediction performance parameters are used to evaluate the model's elemental content prediction performance when applied to unknown substances or materials, under the same sample preparation method, the same experimental method, and the same spectral preprocessing and regularization conditions.
[0125] The module M1 includes:
[0126] Module M1.1: Samples are obtained through either real samples collected for characterizing the application or through sample preparation, with a sample count of 10. 1 -10 3 Magnitude;
[0127] Module M1.2: The prepared sample presents a flat surface with a diameter of centimeters, achieved by pressing powder into a cake;
[0128] Module M1.3: The number of samples in the training set is greater than the number of samples in the test set. The prepared samples are divided into training samples and test samples in a ratio of M1:M2 = 4:1.
[0129] Module M1.4: For a given target element j, the content gradient in the sample covers all content ranges of that element in the application, and the content of the test sample is uniformly distributed within the content range shown by the training sample.
[0130] Module M1.5: For a given sample, the number of repeat spectra is within 10. 1 -10 2 On the order of magnitude, each repeating spectrum is acquired in a specific region on the sample surface, and each acquisition region contains 10 0 -10 1 A repeating spectrum is obtained by averaging the spectra of each sampling point from an order of magnitude of 100 sampling points.
[0131] Module M1.6: Accumulate 10 at each of the above sampling points. 0 -10 1 A laser pulse of a certain magnitude is emitted to obtain a spectrum of a sampling point. Before the spectrum is acquired, the sample surface is pre-etched to remove surface contaminants. The spectrum excited by the pre-etching pulse does not contribute to the sample's repeating spectrum.
[0132] The module M2 includes:
[0133] Module M2.1: Based on the sensitivity range of the device detector and specific application requirements in actual applications, the effective part of the original spectrum is selected for truncation, and the spectra collected by different spectrometer modules are stitched together;
[0134] Module M2.2: Generates average repeat spectra using either ordinary averaging or moving average methods, maintaining an average repeat number of 10 for each sample. 1 -10 2 Magnitude;
[0135] Module M2.3: Baseline removal using wavelet transform;
[0136] Module M2.4: Normalizes the total spectral intensity or the spectral lines of internal standard elements;
[0137] Module M2.5: Uses [0,1] interval regularization to regularize and preprocess repeated spectra of training samples. The calculation formula is These represent the maximum and minimum values of the preprocessed repeated spectra of the k1-th spectral channel for all training samples, respectively.
[0138] Module M2.6: The same spectral channel maxima and minima are passed to the preprocessed repeatable spectra of the test sample in a one-to-one correspondence, and the regularized preprocessed repeatable spectra of the test sample are calculated.
[0139] Module M2.7: Under the same experimental conditions, use matching equipment for spectral acquisition and perform the same spectral preprocessing. The preprocessed spectra of unknown samples use the regularization parameters of the preprocessed spectra of training samples. and Perform regularization on the [0,1] interval.
[0140] The module M3 includes:
[0141] In module M3.1: In the XGBoost model, the maximum number of regression trees is fixed at 60, the maximum depth of the regression trees is determined to be 6, the weight of the smallest leaf node in the regression tree is set to 3, and the overall learning rate of the model is 0.2.
[0142] Module M3.2: The structure of the XGBoost model is adjusted and optimized according to actual needs;
[0143] Module M3.3: Trains the XGBoost model through cross-validation, dynamically dividing 60% of the data into the training dataset and the remaining 40% into the validation dataset.
[0144] The module M4 includes: adding the residual of each sample as a label to the sample table as the training target for the next stage, that is, listing the element content and the residual of the predicted content of all samples.
[0145] The module M5 includes:
[0146] Module M5.1: Select the SelectKBest algorithm in conjunction with the f_regression evaluation function to calculate the correlation coefficient between each spectral channel and the residual value calculated in Module M4, and use this to rank the spectral channels; or use the importance of the spectral channels output when training the XGBoost model in Module M3 to rank them.
[0147] Module M5.2: Based on experience and the constraints of practical applications, select the K2 spectral channels with the highest correlation values as feature spectral channels, and comprehensively optimize the number of features K2 based on the calibration and prediction characteristics of the later model;
[0148] Module M5.3: For different target elements, determine the number of features to be input into the subsequent neural network. The basis for feature selection is to minimize the number of features while ensuring that the model prediction accuracy meets the preset conditions.
[0149] The module M6 includes:
[0150] Module M6.1: Uses empirical formulas based on the scale of the spectral data. To estimate the number of neurons in the hidden layer, where h is the number of neurons in the hidden layer, e is the number of neurons in the input layer, f is the number of neurons in the output layer, and g is an adjustment constant between 1 and 10;
[0151] Module M6.2: For spectral data with a wide band, the hidden layer structure is as follows: the first hidden layer contains 12 neurons and the second hidden layer contains 8 neurons;
[0152] Module M6.3: The number of hidden layers and the number of neurons in each layer are adjusted and optimized based on the actual data.
[0153] Module M6.4: Trains neural network models through cross-validation, dynamically dividing 60% of the data into training datasets and the remaining 40% into validation datasets;
[0154] Module M6.5: Uses the squared error loss function for model training.
[0155] The module M7 includes: comparing the results of the element content prediction by the tandem combination model with the element content marked in the sample table, and calculating the model prediction performance parameters, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP). These parameters are used to calculate the model's element content prediction performance when applied to unknown substances, under the same sample preparation method, the same experimental data acquisition method, the same spectral preprocessing method, and the same spectral regularization conditions.
[0156] The module M8 includes:
[0157] Module M8.1: For a given target element, K2 starts from a small value and increases. REC in Module M6 continuously decreases, and REP in Module M7 increases after an initial steady change or a slight decrease. The two change curves intersect at a certain K2 value. This K2 value is taken as the optimized spectral feature number, i.e., the K3 value.
[0158] Module M8.2: For different feature selection algorithms, the number of feature channels for the same element input into the neural network changes. When changing the feature selection algorithm, it is necessary to rescan the relationship between the number of features and REP and REC.
[0159] Example 3:
[0160] Based on Example 1 or Example 2, this invention provides a laser-induced breakdown spectroscopy (LIBS) multi-element analysis method based on XGBoost and neural network cascaded data processing. Under laboratory conditions, 621 iron ore samples from different origins and brands were collected, powdered, and pressed into cylindrical samples with a diameter and height of approximately 5 mm. The contents of key elements (oxides) for iron ore quality, including Fe (FeOT), Ca (CaO), Mg (MgO), Si (SiO2), and Al (Al2O3), were calibrated. Total iron (FeOT) was determined by redox titration, and the contents of other oxides were determined by X-ray fluorescence spectrometry. Label content tables for the above five elements were obtained for all samples. The samples were arbitrarily divided into training samples and test samples in a 4:1 ratio (M1:M2 = 4:1). The LIBS spectral acquisition equipment consisted of a Q-switched Nd:YAG laser with a pulse width of 10 ns and an output beam diameter of 7 mm. In preliminary experiments, the pulse energy and repetition frequency were optimized, and 55 mJ and 2 Hz were selected for the formal experiments. A four-channel CCD fiber optic spectrometer with a wavelength range of 190-900 nm was used for spectral acquisition, employing external triggering mode with a delay of 0 μs and an integration time of 1 ms. For a given sample, a laser pulse was used to pre-etch the surface at a given location before spectral acquisition. The spectra induced by five subsequent pulses were then accumulated to obtain a single spectrum. Subsequently, 25 spectra were continuously acquired in a 5x5 matrix at 25 ablation points with an adjacent spacing of 0.5 mm, and an average of these was used to obtain one original repeating spectrum for the sample. Six original repeating spectra were acquired for each sample.
[0161] The obtained spectra were preprocessed and regularized; an XGBoost model was constructed, and through testing and optimization, the maximum number of regression trees was determined to be 60, the maximum depth of the regression trees to be 6, the minimum leaf node weight in the regression trees to be 3, and the overall learning rate of the model to be 0.2; the spectral data of the training sample set and the corresponding target element label content of the samples were input, and the dataset was dynamically divided into 60% for training and the remaining 40% for validation, and the XGBoost regression model was trained by cross-validation; the calibration residuals were calculated; the correlation between the spectral channels of the training sample set and the calibration residuals was calculated, and the spectral channels were sorted from high to low according to the correlation to determine the spectral features; a backpropagation neural network (BPNN) model was constructed, including an input layer containing neurons matching the spectral features, a first hidden layer containing 12 neurons, and a second hidden layer containing 8 neurons. The model consists of a second hidden layer and an output layer for a single neuron that outputs the predicted content value. The training sample set's spectral feature data and the corresponding target element's calibration residuals are input. The dataset is dynamically divided into 60% training data and 40% validation data. Cross-validation is performed to train the neural network regression model, and the model's calibration performance is extracted. The test sample set's spectral data is input into the XGBoost and neural network cascaded combination model to obtain the predicted content of the target element. This predicted content is compared with the labeled content of the test sample to obtain the model's prediction performance. Based on the model's calibration and prediction performance, the number of spectral features is optimized for different target elements. Finally, for Fe, Ca, Mg, Si, and Al, the 70, 72, 69, 75, and 67 features with the strongest correlation are selected, respectively, to achieve optimized neural network training.
[0162] The optimization results of the above preferred examples are compared with those of univariate regression, as shown in Table 1, fully demonstrating the effectiveness of this method. The effectiveness of the method can also be found in the appendix to the instruction manual. Figure 2 , 3 This is further reflected in numbers 4, 5, and 6.
[0163] Table 1: Results obtained from the preferred examples of this method
[0164]
[0165] Those skilled in the art will understand that, in addition to implementing the system, apparatus, and their modules provided by this invention in purely computer-readable program code, the same program can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system, apparatus, and their modules provided by this invention can be considered a hardware component, and the modules included therein for implementing various programs can also be considered structures within the hardware component; alternatively, modules for implementing various functions can be considered both software programs implementing the method and structures within the hardware component.
[0166] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A multi-element analysis method for laser-induced breakdown spectroscopy, characterized in that, include: Step S1: Modeling, Sample Preparation, and Spectral Acquisition: Prepare the sample with the spectral data to be measured. Samples with a target element content gradient The number of elements and their corresponding target element label content tensors are denoted as follows: , , The number of target elements, , Given the number of samples, arbitrarily divide the samples into training sample sets, containing... Individual samples, and a test sample set, containing One sample, Using laser-induced breakdown spectroscopy, under optimized experimental conditions, the original repeated spectra of all samples were collected by performing multiple measurements on each sample, and denoted as the original spectral intensity tensor. , of which elements Corresponding to the The first sample A repeating spectrum Spectral intensity of each spectral channel , , For the first The number of original repeat spectra for each sample No. The first sample The number of spectral channels in the original repeating spectrum; Step S2: Spectral preprocessing and regularization: Preprocess all original repeating spectra of all samples to obtain the preprocessed repeating spectral intensity tensor of all samples. , of which elements Corresponding to the The first sample The first preprocessed repeating spectrum Spectral intensity of each spectral channel , , For the first Number of preprocessed repeat spectra per sample No. The first sample The number of spectral channels in the preprocessed repeating spectra, and the number of training sample preprocessed repeating spectra set. and test sample pretreatment repeat spectral set Regularization is performed separately for each given spectral channel, starting with... The calculations are performed, and the obtained regularization parameters are passed to the spectral channels in a one-to-one correspondence. Perform calculations to obtain regularized preprocessed repeating spectral sets for training and test samples, respectively. and ; Step S3: XGBoost Model Construction and Training: Set the maximum number of regression trees, maximum depth, and minimum leaf node weights; determine the overall learning rate of the model; and input the training data set. Regarding the first For each target element, under the supervised learning paradigm, the input data is dynamically divided into training and validation sets, cross-validated, and trained to obtain the XGBoost regression model. Step S4: Calculate the residuals of XGBoost model predictions: Inputting the XGBoost model yields the calibrated prediction output. , of which elements For the first The sample is targeted at the first The XGBoost model prediction value of the nth target element is obtained through the nth... one sample The calibration residual vector is calculated by averaging the independent predicted values of each preprocessed repeating spectrum. ; Step S5: Calculation of Spectral Channel Importance and Extraction of Spectral Features: For the training sample set, a correlation data analysis algorithm is used to calculate the importance of a given spectral channel. Regularized preprocessed spectral intensity Calibration residuals of corresponding samples Based on the correlation values, the spectral channels are sorted from high correlation to low correlation, and the channel with the highest correlation value is selected. Each spectral channel is used as a feature spectral channel to obtain the feature repeating spectrum set of the training samples. , The selected spectral channels are labeled, and the same labeling is applied to the test sample set to obtain a characteristic repeating spectral set of the test samples. ; Step S6: Neural Network Model Construction and Training for Residuals: Determine the neural network structure, including features that match the spectral characteristics extracted in Step S5. The training data consists of an input layer with multiple neurons, multiple hidden layers, and an output layer with a single neuron that outputs the predicted content value. Regarding the first The target element is used to train a neural network regression model under a supervised learning paradigm. The input data is dynamically divided into training and validation sets, cross-validation is performed, the model parameters are iterated in a loop, the loss function is gradient descent until the expected value is reached, the model training is terminated, and the model calibration performance parameters are output, including the root mean square error of calibration RMSEC and the relative error of calibration REC. Step S7: Conduct tandem combination model tests using independent samples: Regularized preprocessing of repeating spectral sets of test samples Input the XGBoost model to get the test prediction output. , of which elements For the first The sample is targeted at the first The XGBoost model prediction value of the nth target element is obtained through the nth... one sample The characteristic repeating spectrum set of the test sample is obtained by averaging the independent predicted values of each preprocessed repeating spectrum. Input the neural network model obtained in step S6 to obtain the test prediction output. , of which elements For the first The test sample is targeted at the first The neural network model predicts the value of the nth target element, through the nth... one sample The average of the independent predicted values of each characteristic repeating spectrum is obtained, and the standard deviation of each independent predicted value is calculated simultaneously. The calculation of the series combination model is for the first Predicted content values of each target element Its error is , Compared with the test sample Content label value of each target element By comparison, the prediction performance parameters of the cascaded combined model were calculated, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP). Step S8: Optimize the spectral feature number and apply the final model based on the test results: In a loop, by changing... The optimized spectral eigenvalues are obtained by balancing and optimizing RMSEC and REC in step S6 and RMSEP and REP in step S7. The neural network is trained in this way, and the corresponding cascaded combined model prediction performance parameters are used to evaluate the model's elemental content prediction performance when the model is applied to unknown substances or materials, under the conditions of sample preparation, experimentation, spectral preprocessing and regularization in the same way.
2. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S1 includes: Step S1.1: Samples are obtained by characterizing real samples collected for the application or by sample preparation, with the number of samples being 10. 1 -10 3 Magnitude; Step S1.2: The prepared sample has a flat surface with a diameter of centimeters, which is achieved by pressing powder into a cake; Step S1.3: The number of samples in the training set is greater than the number of samples in the test set. The prepared samples are divided into training samples and test samples according to the ratio. Step S1.4: For a given target element The content gradient in the sample covers all the content ranges of the element in the application, and the content of the test sample is evenly distributed within the content range shown by the training sample. Step S1.5: For a given sample, the number of repeated spectra is 10. 1 -10 2 On the order of magnitude, each repeating spectrum is acquired in a region on the sample surface, and each acquisition region contains 10 0 -10 1 A repeating spectrum is obtained by averaging the spectra of each sampling point from an order of magnitude of 100 sampling points. Step S1.6: At each of the above sampling points, accumulate 10 0 -10 1 A laser pulse of a certain magnitude is emitted to obtain a spectrum of a sampling point. Before the spectrum is acquired, the sample surface is pre-etched to remove surface contaminants. The spectrum excited by the pre-etching pulse does not contribute to the sample's repeating spectrum.
3. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S2 includes: Step S2.1: Based on the sensitivity range of the device detector and the specific application requirements in actual applications, select the effective part of the original spectrum for truncation and stitch together the spectra collected by different spectrometer modules; Step S2.2: Generate the average repeat spectrum using the ordinary averaging or moving average method, keeping the average repeat spectrum number of each sample at 10. 1 -10 2 Magnitude; Step S2.3: Use wavelet transform to remove baselines; Step S2.4: Normalize the total spectral intensity or the spectral lines of the internal standard elements; Step S2.5: Use [0,1] interval regularization to regularize and preprocess the repeating spectra of the training samples. The calculation formula is , , , respectively representing the first Maximum and minimum values of all preprocessed repeat spectra for all training samples in the spectral channels; Step S2.6: The same spectral channel maxima and minima are passed to the preprocessed repeatable spectra of the test sample in a one-to-one correspondence, and the regularized preprocessed repeatable spectra of the test sample are calculated. ; Step S2.7: Under the same experimental conditions, use matching equipment to acquire spectra and perform the same spectral preprocessing. The preprocessed spectra of unknown samples use the regularization parameters of the preprocessed spectra set of training samples. and Perform regularization on the [0,1] interval.
4. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S3 includes: Step S3.1: In the XGBoost model, the maximum number of regression trees is fixed at 60, the maximum depth of the regression trees is determined to be 6, the weight of the smallest leaf node in the regression tree is set to 3, and the overall learning rate of the model is 0.
2. Step S3.2: The structure of the XGBoost model is adjusted and optimized according to actual needs; Step S3.3: Train the XGBoost model through cross-validation, dynamically dividing 60% of the data into the training dataset and the remaining 40% into the validation dataset.
5. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S4 includes: adding the residual of each sample as a label to the sample table as the training target for the next stage, that is, listing the element content and the residual of the predicted content of all samples.
6. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S5 includes: Step S5.1: Select the SelectKBest algorithm in conjunction with the f_regression evaluation function to calculate the correlation coefficient between each spectral channel and the residual value calculated in step S4, and sort the spectral channels accordingly; or sort them by the importance of the spectral channels output when training the XGBoost model in step S3. Step S5.2: Based on experience and the constraints of practical applications, select the value with the highest correlation. Each spectral channel is used as a characteristic spectral channel, and the number of characteristic channels is adjusted based on the calibration and prediction characteristics of the later model. Perform comprehensive optimization; Step S5.3: For different target elements, determine the number of features to be input into the subsequent neural network. The basis for feature selection is to minimize the number of features while ensuring that the model prediction accuracy meets the preset conditions.
7. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S6 includes: Step S6.1: Based on the scale of the spectral data, use an empirical formula. To estimate the number of neurons in the hidden layer, where This represents the number of neurons in the hidden layer. The number of neurons in the input layer. This represents the number of neurons in the output layer. The adjustment constant is between 1 and 10; Step S6.2: For spectral data with a wide band, the hidden layer structure is as follows: the first hidden layer contains 12 neurons and the second hidden layer contains 8 neurons; Step S6.3: The number of hidden layers and the number of neurons in each layer are adjusted and optimized according to the actual data. Step S6.4: Train the neural network model through cross-validation, dynamically dividing 60% of the data into the training dataset and the remaining 40% into the validation dataset; Step S6.5: Train the model using the squared error loss function.
8. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S7 includes: comparing the element content prediction results of the tandem combination model with the element content marked in the sample table, and calculating the model prediction performance parameters, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP). These parameters are used to calculate the model's element content prediction performance when applied to unknown substances under the same sample preparation method, the same experimental data acquisition method, the same spectral preprocessing method, and the same spectral regularization conditions.
9. The multi-element analysis method for laser-induced breakdown spectroscopy according to claim 1, characterized in that, Step S8 includes: Step S8.1: For a given target element, Starting from a small value, REC in step S6 continuously decreases, while REP in step S7 initially changes steadily or decreases slightly before rising. The two curves then converge at a certain point. The values intersect at this point, take this value. The value is the optimized spectral feature number, i.e. value; Step S8.2: For different feature selection algorithms, the number of feature channels for the same element input into the neural network changes. When changing the feature selection algorithm, it is necessary to rescan the relationship between the number of features and REP and REC.
10. A multi-element analysis system for laser-induced breakdown spectroscopy, characterized in that, The multi-element analysis method using laser-induced breakdown spectroscopy according to any one of claims 1-9 includes: Module M1: Modeling, Sample Preparation, and Spectral Acquisition: Preparing samples with the spectral data to be measured. Samples with a target element content gradient The number of elements and their corresponding target element label content tensors are denoted as follows: , , The number of target elements, , Given the number of samples, arbitrarily divide the samples into training sample sets, containing... Individual samples, and a test sample set, containing One sample, Using laser-induced breakdown spectroscopy, under optimized experimental conditions, the original repeated spectra of all samples were collected by performing multiple measurements on each sample, and denoted as the original spectral intensity tensor. , of which elements Corresponding to the The first sample A repeating spectrum Spectral intensity of each spectral channel , , For the first The number of original repeat spectra for each sample No. The first sample The number of spectral channels in the original repeating spectrum; Module M2: Spectral Preprocessing and Regularization: Preprocesses all original repeating spectra of all samples to obtain the preprocessed repeating spectral intensity tensor of all samples. , of which elements Corresponding to the The first sample The first preprocessed repeating spectrum Spectral intensity of each spectral channel , , For the first Number of preprocessed repeat spectra per sample No. The first sample The number of spectral channels in the preprocessed repeating spectra, and the number of training sample preprocessed repeating spectra set. and test sample pretreatment repeat spectral set Regularization is performed separately for each given spectral channel, starting with... The calculations are performed, and the obtained regularization parameters are passed to the spectral channels in a one-to-one correspondence. Perform calculations to obtain regularized preprocessed repeating spectral sets for training and test samples, respectively. and ; Module M3: XGBoost Model Building and Training: Set the maximum number of regression trees, maximum depth, and minimum leaf node weights; determine the overall learning rate of the model; input the training data set. Regarding the first For each target element, under the supervised learning paradigm, the input data is dynamically divided into training and validation sets, cross-validated, and trained to obtain the XGBoost regression model. Module M4: XGBoost Model Prediction Residual Calculation: [The remaining text appears to be incomplete and requires further context.] Inputting the XGBoost model yields the calibrated prediction output. , of which elements For the first The sample is targeted at the first The XGBoost model prediction value of the nth target element is obtained through the nth... one sample The calibration residual vector is calculated by averaging the independent predicted values of each preprocessed repeating spectrum. ; Module M5: Spectral Channel Importance Calculation and Spectral Feature Extraction: For the training sample set, using a correlation data analysis algorithm, calculates the importance of a given spectral channel. Regularized preprocessed spectral intensity Calibration residuals of corresponding samples Based on the correlation values, the spectral channels are sorted from high correlation to low correlation, and the channel with the highest correlation value is selected. Each spectral channel is used as a feature spectral channel to obtain the feature repeating spectrum set of the training samples. , The selected spectral channels are labeled, and the same labeling is applied to the test sample set to obtain a characteristic repeating spectral set of the test samples. ; Module M6: Neural Network Model Construction and Training for Residuals: Determining the neural network architecture, including features that match the spectral characteristics extracted in Module M5. The training data consists of an input layer with multiple neurons, multiple hidden layers, and an output layer with a single neuron that outputs the predicted content value. Regarding the first The target element is used to train a neural network regression model under a supervised learning paradigm. The input data is dynamically divided into training and validation sets, cross-validation is performed, the model parameters are iterated in a loop, the loss function is gradient descent until the expected value is reached, the model training is terminated, and the model calibration performance parameters are output, including the root mean square error of calibration RMSEC and the relative error of calibration REC. Module M7: Tandem Combination Model Testing Using Independent Samples: Regularized Preprocessing of Repeated Spectra Sets of Test Samples Input the XGBoost model to get the test prediction output. , of which elements For the first The sample is targeted at the first The XGBoost model prediction value of the nth target element is obtained through the nth... one sample The characteristic repeating spectrum set of the test sample is obtained by averaging the independent predicted values of each preprocessed repeating spectrum. The neural network model obtained from module M6 is used to obtain the test prediction output. , of which elements For the first The test sample is targeted at the first The neural network model predicts the value of the nth target element, through the nth... one sample The average of the independent predicted values of each characteristic repeating spectrum is obtained, and the standard deviation of each independent predicted value is calculated simultaneously. The calculation of the series combination model is for the first Predicted content values of each target element Its error is , Compared with the test sample Content label value of each target element By comparison, the prediction performance parameters of the cascaded combined model were calculated, including the root mean square error of prediction (RMSEP) and the relative error of prediction (REP). Module M8: Optimizes spectral feature numbers and applies the final model based on test results: This is done within a loop by changing... The optimization of RMSEC and REC in module M6 and RMSEP and REP in module M7 yields the optimized number of spectral eigenvalues. The neural network is trained in this way, and the corresponding cascaded combined model prediction performance parameters are used to evaluate the model's elemental content prediction performance when the model is applied to unknown substances or materials, under the conditions of sample preparation, experimentation, spectral preprocessing and regularization in the same way.
Citation Information
Patent Citations
Element identification method based on light spectrum correlation
CN103063621A