Method for quantitative analysis of elements in laser-induced breakdown spectroscopy based on machine learning optimization

By combining PLSR and 1D-CNN machine learning methods, the problems of insufficient accuracy and low efficiency of multi-component detection in LIBS quantitative analysis are solved, sample-level dynamic fusion is realized, and the quantitative analysis capability of LIBS in nuclear-related material detection is improved.

CN122117159BActive Publication Date: 2026-07-07INNER MONGOLIA UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INNER MONGOLIA UNIV OF TECH
Filing Date
2026-04-29
Publication Date
2026-07-07

AI Technical Summary

Technical Problem

Existing LIBS quantitative analysis technology suffers from problems such as insufficient quantitative accuracy, poor signal stability, significant matrix effects, spectral line overlap interference, and lack of instrument standards in the detection of nuclear materials. These problems lead to inaccurate detection results and low computational efficiency when detecting multiple components, making it impossible to meet the needs of online detection.

Method used

By combining partial least squares regression (PLSR) and one-dimensional convolutional neural network (1D-CNN), an adaptive machine learning model is constructed through data preprocessing, feature spectral line matching and calibration, gated fusion and hyperparameter search, to achieve sample-level dynamic fusion and improve detection accuracy and robustness.

Benefits of technology

It significantly improves the accuracy and stability of LIBS quantitative analysis, adapts to multi-component detection, and can provide accurate quantitative analysis results, especially in the detection of nuclear materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122117159B_ABST
    Figure CN122117159B_ABST
Patent Text Reader

Abstract

The application discloses a laser-induced breakdown spectroscopy element quantitative analysis method based on machine learning optimization, belongs to the technical field of cross of spectroscopy analysis, chemometrics and machine learning, and comprises the following steps: collecting one-dimensional spectrum data of a sample and calibrating and matching, and dividing a training set and a test set; performing SNV normalization, baseline correction and smoothing pretreatment on the spectrum; constructing a PLSR linear base learner, determining optimal latent variable parameters and outputting a prediction result; building a 1D-CNN nonlinear base learner and outputting a prediction result; calculating sample distribution deviation and prediction divergence to generate a gating weight; taking the minimum training set RMSE as a target to search for an optimal gating form and parameters, and completing fusion; and fixing parameters to infer the test set, and outputting a prediction result, an evaluation index and a gating weight. The laser-induced breakdown spectroscopy element quantitative analysis method based on machine learning optimization improves the problems of insufficient LIBS quantitative generalization ability and low fusion interpretability of existing LIBS.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary fields of spectral analysis, chemometrics, and machine learning, and in particular to a laser-induced breakdown spectroscopy elemental quantitative analysis method optimized based on machine learning. Background Technology

[0002] This invention relates to elemental quantitative analysis technology using laser-induced breakdown spectroscopy (LIBS), belonging to the interdisciplinary field of spectroscopic analysis, chemometrics, and machine learning. LIBS technology, with its advantages of rapid, in-situ, online, and non-contact detection, is widely used in energy, environmental, and materials testing fields. It possesses unique value in the in-situ online detection of nuclear materials, enabling tasks such as nuclear material identification and sorting, compositional characterization, and contamination scanning.

[0003] While qualitative analysis techniques using LIBS have matured, insufficient precision in quantitative analysis remains a core technological bottleneck. Affected by factors such as unstable signal sources, complex plasma excitation processes, significant matrix effects, spectral line overlap interference, and the lack of instrument standards, the accuracy and stability of quantitative detection results are difficult to meet the needs of practical applications. This problem is even more prominent in scenarios involving nuclear materials where stringent requirements for detection precision are placed.

[0004] Machine learning algorithms offer effective solutions for improving the accuracy of LIBS quantitative analysis. Partial Least Squares Regression (PLSR), a linear algorithm, is robust in scenarios with small samples and data containing multicollinearity and noise, but it has poor adaptability to nonlinear data and cross-scenario distribution drift. One-dimensional Convolutional Neural Networks (1D-CNN), a nonlinear deep learning model, can automatically extract nonlinear features of the spectrum and adapt to detection scenarios with complex spectral lines, but it suffers from high dependence on training data, easily declining generalization ability, and poor interpretability of results. Both types of algorithms have their advantages and limitations, and their complementarity is significant.

[0005] Existing fusion methods often employ fixed weights or simple averaging to fuse the prediction results of linear PLSR and nonlinear 1D-CNN models, failing to dynamically select reliable model outputs based on sample-level features. Furthermore, simple gated fusion struggles to absorb systematic residuals, making it difficult to further reduce cross-scene errors, and the fusion process lacks interpretability, hindering engineering diagnostics. Moreover, existing methods are prone to a dramatic increase in complexity and decreased computational efficiency when detecting multiple elements simultaneously, failing to meet the application requirements of LIBS online multi-component detection.

[0006] Therefore, there is an urgent need to develop a LIBS elemental quantitative analysis method that can integrate the advantages of PLSR and 1D-CNN to achieve dynamic adaptive fusion at the sample level, taking into account detection accuracy, robustness and interpretability, while ensuring computational efficiency, adapting to scenarios where multiple components are detected simultaneously, and especially meeting the quantitative detection needs of complex matrix samples such as nuclear materials. Summary of the Invention

[0007] The purpose of this invention is to provide a laser-induced breakdown spectroscopy elemental quantitative analysis method based on machine learning optimization, which solves the problems of insufficient accuracy of LIBS quantitative analysis, the limitations of using linear PLSR and nonlinear 1D-CNN algorithms alone and the failure to effectively leverage their complementarity, the inability of existing integration methods to achieve sample-level dynamic adaptive fusion, the difficulty in reducing cross-scene errors, the poor interpretability of fusion results, and the insufficient computational efficiency and adaptability when detecting multiple components simultaneously.

[0008] To achieve the above objectives, this invention provides a laser-induced breakdown spectroscopy elemental quantitative analysis method optimized based on machine learning, comprising the following steps:

[0009] S1. Sample Preparation, Data Acquisition and Processing: Laser-Induced Breakdown Spectroscopy (LIBS) was performed on all samples. The acquired spectra are the raw spectra. The samples are divided into two categories: one is the training set, and the other is a set of samples that are used to construct a training set. The training set contains a matrix of material composition, where... For the types of material components, One type is the number of samples; the other is the test set, where the component content of the samples does not need to be known. Data preprocessing: SNV normalization is performed on all spectral data to remove extreme values, baseline correction is performed to remove matrix effects, and smoothing is performed to enhance the overall fit. The processed spectral data is then output and saved as preprocessed spectra. , as the input of S2;

[0010] S2, Input the preprocessed spectrum obtained in step S1. The spectra of the two types of samples were matched and calibrated based on the elemental characteristic spectral line information in the NIST database to determine the position and attribution of the characteristic spectral lines of the target analyte. The number of target elements is A, the number of training set samples is B, and the number of test set samples is C, ultimately forming a training set calibration spectral matrix of size A * B. A test set calibration spectral matrix of size A * C ;

[0011] S3. Constructing the PLSR linear basis learner network: Deployed and run using MATLAB's Deep Learning Toolbox and Statistical and Machine Learning Toolbox; Construct the PLSR linear basis learner using Partial Least Squares Regression (PLSR) as the core algorithm, and input the training set calibration spectral matrix. The regression coefficients are selected by searching for the latent parameter nComp that minimizes the root mean square error (RMSE). After training, the calibration spectral matrix is ​​input from the test set. The prediction results of the PLSR model were obtained. Standardized parameters are determined during the training phase and used for consistency processing during the prediction phase.

[0012] S4. Constructing a 1D-CNN Nonlinear Base Learner Network: Using MATLAB's Deep Learning Toolbox, construct a 1D-CNN nonlinear base learner network with a basic architecture of a one-dimensional convolutional neural network (1D-CNN). During the training phase, the network input is the calibration spectral matrix of the training set. After training, input the test set to calibrate the spectral matrix. Finally, the prediction results of the 1D-CNN model for the calibration spectral matrix of the test set were obtained. Standardized parameters are determined during the training phase and used for consistency processing during the prediction phase.

[0013] S5. Preparation of fused gating parameters: Load the prediction results of the PLSR model and the 1D-CNN model on the test set. , Calculate the distribution deviation of the sample. Disagreement with forecast ;based on and Generate gate weights ;

[0014] S6. Gating Calculation and Hyperparameter Search: The goal is to minimize the root mean square error (RMSE) of the calibration spectral matrix in the training set. The gating form and its parameters are determined through a search. Gating forms include four types: constant weights, weights based on divergence, weights based on distribution deviation, and combined feature gating. The hyperparameter search algorithm uses random search, Bayesian optimization, or genetic evolution to complete the first-level fusion. The fusion gating expression is:

[0015] ;

[0016] The average root mean square error (RMSE) of each component is selected as the training set error to determine the optimal gating form and parameter combination.

[0017] S7. Test Set Inference and Result Output: Fix the optimal gating combination parameters and input the test set calibration spectrum matrix. After constructing and standardizing the gating features, calculate The first-level fusion prediction output is obtained by following the fusion gating expression in step S6. Output the test set prediction results, evaluation metrics, and gating weights. .

[0018] Preferably, the training set in step S1 consists of standard samples with known content of substance components used to train the model, and the number of samples is no less than 70% of the total number of samples. When there are different species in the samples, at least 30% of the total number of samples of each species shall be selected, and the total number of samples shall not be less than 70. The training set samples are only used for training and not for testing.

[0019] After the training set is completed, the remaining samples constitute the test set, which is used to test the predictive ability of the model.

[0020] Preferably, in step S1, SNV normalization is performed as vector normalization;

[0021] The baseline correction algorithm uses the adaptive iterative reweighted penalized least squares method (AirPLS); the penalty factor of the baseline correction algorithm is... The maximum number of iterations is 10-50, and the stopping criterion is the change in the relative distance between two adjacent baselines. If the maximum number of iterations is exceeded but the stopping criterion is not met, the iteration will stop and a new round of iterations will begin.

[0022] The Savitzky-Golay smoothing method was selected; the smoothing window size was 7-15, and the polynomial order was 2; when oversmoothing or excessive baseline subtraction occurred, a rollback was performed.

[0023] Preferably, oversmoothing involves comparing the spectra before and after smoothing and performing a consistency check. If any of the following conditions are met, it is determined to be oversmoothed and a rollback is initiated:

[0024] The Pearson coefficient r of the smoothed and unsmoothed spectra is less than 0.985;

[0025] The full width at half maximum (FWHM) of representative spectral lines increased by more than 15% compared to before smoothing.

[0026] The peak height of the target element's feature line decreases by more than 10% compared to before smoothing;

[0027] Excessive baseline subtraction involves comparing the spectra before and after baseline subtraction. Excessive baseline subtraction is determined and reverted when any of the following conditions are met:

[0028] The proportion of sampling points with an intensity less than 0 in the spectrum after baseline subtraction exceeds 10%;

[0029] The peak area of ​​the top 5 most intense spectral lines within a fixed window, after deduction, results in an additional loss of over 7%.

[0030] After deduction, a significant negative trough appears, with its minimum value below -3. ,in, The standard deviation of background fluctuation is obtained by statistically analyzing the sampling points after drift correction of the peakless spectral signal.

[0031] Preferably, the calibration process parameters in step S2 include: center wavelength Peak integral window, peak height ≥ baseline mean The peak detection threshold, where, The standard deviation of intensity fluctuation of spectral signal in the peakless background band. The number of spectral lines.

[0032] Preferably, the network structure of the 1D-CNN nonlinear base learner network in step S4 is as follows:

[0033] Layer 1: Input Layer;

[0034] Layer 2: One-dimensional convolutional layer CONV1D, parameter settings: input channel = 1, output channel = 32, kernel_size = 3, padding = 1;

[0035] Layer 3: Batch Norm (BN) layer, BatchNorm1d=32;

[0036] Layer 4: ReLU activation layer, with ReLU as the activation function;

[0037] Layer 5: Pooling layer, with the pooling function being Max Pooling;

[0038] Layer 6: Convolutional layer, parameter settings: input channel = 32, output channel = 64, kernel_size = 3, padding = 1;

[0039] Layer 7: BatchN layer, BatchNorm1d=64;

[0040] Layer 8: ReLU activation layer, with ReLU as the activation function;

[0041] Layer 9: Pooling layer, with Max Pooling as the pooling function;

[0042] Layer 10: Convolutional layer, parameter settings: input channel = 64, output channel = 128, kernel_size = 3, padding = 1;

[0043] Layer 11: Batch Norm (BN) layer, BatchNorm1d=128;

[0044] Layer 12: Activation layer, with ReLU activation function;

[0045] Layer 13: Pooling layer, with the pooling function being Max Pooling;

[0046] Layer 14: Global Average Pooling layer, with the pooling function being Global Average Pooling;

[0047] Layer 15: Dropout layer with random inactivation rate of 0.5;

[0048] Layer 16: Output layer.

[0049] Preferably, the parameters of the 1D-CNN nonlinear basis learner in step S4 are:

[0050] The training parameters are configured as follows: the optimizer is Adam;

[0051] The training method is mini-batch gradient descent with a batch size of 32, a maximum number of training rounds of 150, an initial learning rate of 1e-3, L2 regularization of 1e-4, random shuffling of samples in each round, and loss function is mean squared error (RMSE) or Huber loss.

[0052] Preferably, the distribution deviation in step S5 The specific calculation and judgment steps are as follows:

[0053] S511, Data Preprocessing: Preprocessing the raw spectrum Perform consistent standardization processing to obtain the preprocessed spectrum. ;

[0054] S512, PCA Projection: Calibrate the spectral matrix of the test set. Projecting onto the PCA subspace yields the score vector. The calculation formula is:

[0055]

[0056] in, The projection matrix is ​​determined using the eigenvalue decomposition method; For training mean, , The total number of samples, For sample indexing, For a single training set sample;

[0057] S513, Deviation Calculation: Calculated using the L2 norm of the score vector. The formula is:

[0058] ;

[0059] in, for The L2 norm;

[0060] S514. Determination of deviation threshold:

[0061] For all test set samples, calculate using the same method described above. ;

[0062] Statistical test set The distribution is used, and the 99th percentile is taken as the deviation threshold. ;

[0063] S515, Deviation Judgment Rule:

[0064] When the sample distribution of the test set calibration spectral matrix deviates > When this occurs, it is determined to be an out-of-distribution sample;

[0065] When the sample distribution of the test set calibration spectral matrix deviates ≤ When: it is determined to be an in-distribution sample;

[0066] Predicting the degree of divergence The specific calculation and judgment steps are as follows:

[0067] S521. Predicted Value Acquisition: Calibrate the spectral matrix for the test set. Obtain the PLSR model prediction values ​​respectively. And 1D-CNN model predictions ;

[0068] S522. Divergence Calculation: Divergence is the difference between two predicted values. The formula is:

[0069] ;

[0070] S523, Conflict Quantification Judgment Rules:

[0071] The root mean square error (RMSE) of predictions for the PLSR model and the 1D-CNN model were obtained in the training set, respectively.

[0072] when When the average RMSE difference between the two models in the training set is 1, it is determined that there is a significant conflict between the two models for this sample, triggering the fusion gating intervention.

[0073] Gating weights The specific construction steps are as follows:

[0074] S531, Gate Control Scoring Value calculate:

[0075] ;

[0076] in, As a reference bias, The effect of distribution deviation on gating, To predict the impact of divergence on gating;

[0077] S532, Sigmoid mapping: Gating score values Mapped to The interval is used to obtain the gating weight. :

[0078]

[0079] ;

[0080] in, For the Sigmoid function, .

[0081] Preferably, the four gating methods in step S6 are specifically defined as follows:

[0082] Constant weights: ,in, For combined weights, ;

[0083] Based on divergence Weights: ,in, The slope For the threshold, For Sigmoid mapping functions;

[0084] Based on distribution deviation Weights: ;

[0085] Combined feature gating: .

[0086] Therefore, the laser-induced breakdown spectral elemental quantitative analysis method optimized by machine learning described above has the following beneficial effects:

[0087] (1) Compared to a single base learner, it cannot cover all sample data types. If the data type and the processing model do not match, the model performance will drop significantly, resulting in poor quantitative analysis results. Furthermore, a single base learner is difficult to effectively analyze full-spectrum data, which may lead to missing some useful features and thus actively weakening the model performance.

[0088] (2) Compared with a single PLSR base learner, the present invention can significantly improve the fitting ability to deal with nonlinear data and has stronger anti-interference ability and feature extraction ability; compared with a single CNN base learner, the present invention can have a more robust degradation strategy (back-off or conservative fusion) under large-scale distribution drift and abnormal collection conditions, thereby ensuring the basic line of the prediction results.

[0089] (3) The present invention adopts a first-level fusion + gated fusion + hyperparameter search strategy. The first-level fusion strategy can take into account the abnormal and deviation situations of the samples and can still maintain stable operation output under the condition of large-scale abnormal collection. When the output results of the base learner differ greatly, the gated fusion strategy immediately triggers the gate threshold and the fusion gate intervenes to take over the subsequent operation. This strategy can ensure the correct output of the model under the condition of large external influence and fuzzy data type boundaries. Hyperparameter search can effectively reduce the workload of parameter tuning, reduce human intervention, and automatically search for the optimal parameter combination to ensure that the model can output at full power.

[0090] (4) The present invention also has great potential for expansion. For example, it can perform secondary fusion on the basis of primary fusion to build a multi-level fusion system, realize multiple corrections and multiple verifications, and increase the robustness and accuracy of the system. The base learner can be flexibly adjusted according to the dimension, range, quantity and other parameters of the input spectral data. By calling the MATLAB toolbox, the entire network can be built, reducing the construction cost.

[0091] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0092] Figure 1 This is a flowchart illustrating the overall technical solution of an embodiment of the present invention;

[0093] Figure 2 This is a diagram of the convolutional neural network architecture according to an embodiment of the present invention. Detailed Implementation

[0094] The following detailed description of embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0095] This invention discloses a laser-induced breakdown spectroscopy elemental quantitative analysis method optimized based on machine learning. The overall technical process is as follows: Figure 1 As shown, proceed with the following steps:

[0096] I. Data Acquisition and Analysis

[0097] The spectral data files of ChemCam and their corresponding reference component files were obtained from the publicly available dataset MSL-M-CHEMCAM-LIBS-2-EDR-V1.0 of the NASA Planetary Data System (PDS). The spectral data files were parsed to extract the wavelength-intensity sequence of each sample, forming a sample spectral vector. Simultaneously, the reference component file is parsed to obtain the multi-component content labels corresponding to the samples, and a unique correspondence is established between the sample identifier and the label.

[0098] II. Data Cleaning and Matching

[0099] The parsed spectral and component label data are cleaned to remove samples with missing component labels, missing or duplicate sample identifiers, incomplete spectral files, or missing key fields. Each spectral vector is then processed using the sample identifier as the primary key. Its corresponding ingredient label By performing one-to-one pairing, we ensure that each spectrum has a corresponding label and each label has a corresponding spectrum, thereby obtaining a standardized dataset that can be used for supervised learning.

[0100] III. Wavelength Axis Unification and Spectral Preprocessing

[0101] (a) Wavelength axis unification

[0102] The wavelength axis of the paired samples is unified, and the spectra of different samples are mapped to a consistent wavelength grid through interpolation or resampling to achieve consistent wavelength coordinates for all sample spectra. Peak position correction is performed by combining the characteristic spectral anchor point information provided by the NIST atomic spectroscopy database to eliminate systematic errors caused by wavelength shift.

[0103] (II) Spectral Preprocessing

[0104] Spectrum after unifying wavelength axis Preprocessing is performed, with the following logic: SNV normalization to remove extreme values, baseline correction to remove matrix effects, and smoothing to enhance the overall fit. No other processing is performed. Specific parameters and operational requirements are as follows:

[0105] SNV normalization uses vector normalization.

[0106] Baseline correction uses the adaptive iterative reweighted penalized least squares method (AirPLS), with a penalty factor of [missing information]. The maximum number of iterations is 10-50, and the stopping criterion is the change in the relative distance between two adjacent baselines. ;

[0107] The smoothing method used was Savitzky–Golay, with a smoothing window size of 7-15 and a polynomial order of 2.

[0108] During preprocessing, strict checks are performed to determine if there is excessive smoothing or excessive baseline subtraction. If any such issues are found, the process is immediately rolled back. The criteria for determination are as follows:

[0109] Oversmoothing is determined by meeting any one of the following conditions:

[0110] 1. The Pearson coefficient r of the smoothed and unsmoothed spectra is less than 0.985;

[0111] 2. The half-width at half-maximum (FWHM) of representative spectral lines increased by more than 15% compared to before smoothing;

[0112] 3. The peak height of the target element's feature line decreases by more than 10% compared to before smoothing;

[0113] Excessive baseline deduction is determined if any one of the following conditions is met:

[0114] 1. The proportion of sampling points with an intensity less than 0 in the spectrum after baseline subtraction exceeds 10%;

[0115] 2. The peak area of ​​the top 5 most intense spectral lines within a fixed window, after deduction, results in an additional loss of over 7%;

[0116] 3. After deduction, a significant negative trough appears, with its minimum value below -3. ,in, The standard deviation of background fluctuation is obtained by statistically analyzing the sampling points after drift correction of the peakless spectral signal.

[0117] After the above processing, a standardized preprocessed spectrum is output. , which serves as the input data for model training.

[0118] IV. Dataset Partitioning, Feature Spectral Line Matching, and Calibration

[0119] Dataset partitioning

[0120] Sample grouping involves randomly selecting at least 70% of the total number of samples to form the training set. If the samples contain different types, at least 30% of each type should be selected to form a training set comprising at least 70% of the total number of samples. After selecting the training set, the remaining samples constitute the test set. A [specific method / mechanism] is constructed for each training set sample. The matrix of the content of different types of substances, among which, For the types of material components, This represents the number of samples. The training set is used for model parameter learning, model selection, and gating fusion configuration determination. The test set is only used for final performance evaluation and result output. No model parameters or gating parameters are adjusted during the testing phase to avoid evaluation bias caused by leakage of test set information.

[0121] Characteristic spectral line matching and calibration

[0122] Input the preprocessed spectrum obtained in step S1 The spectra of the two types of samples were matched and calibrated based on the elemental characteristic spectral line information in the NIST database to determine the position and attribution of the characteristic spectral lines of the target analyte. The number of target elements is A, the number of training set samples is B, and the number of test set samples is C, ultimately forming a training set calibration spectral matrix of size A * B. A test set calibration spectral matrix of size A * C ;

[0123] The calibration process parameters include: center wavelength Peak integral window, peak height ≥ baseline mean The peak detection threshold, where, The standard deviation of intensity fluctuation of spectral signal in the peakless background band. The number of spectral lines.

[0124] V. Training and Prediction of Linear and Nonlinear Basis Learners

[0125] (I) Training and Prediction of Linear PLSR Basis Learners

[0126] A linear basis learner is constructed using Partial Least Squares Regression (PLSR) as the core algorithm. This learner is automatically generated using the MATLAB Statistics and Machine Learning Toolbox. The specific training and prediction steps are as follows:

[0127] Input training set calibration spectral matrix The regression coefficients are selected by searching for the latent variable parameter nComp that minimizes the regression coefficient. After training, the calibration spectral matrix is ​​input from the test set. The prediction results of the PLSR base learner are obtained. The core parameter is the latent variable parameter nComp, and the value of nComp is selected individually for each different substance. The algorithm automatically searches and selects a set of latent variable parameters that minimizes RMSECV, and obtains a set of regression coefficients corresponding to the prediction target.

[0128] (II) Training and prediction of nonlinear basis 1D-CNN learners, such as Figure 2 As shown

[0129] A nonlinear base learner is constructed using a one-dimensional convolutional neural network (1D-CNN) as its core, implemented through the MATLAB Deep Learning Toolbox. The specific network structure, training parameters, and prediction steps are as follows:

[0130] The network inputs are the calibration spectral matrix of the training set and the calibration spectral matrix of the test set.

[0131] Network structure: Layer 1: Input layer;

[0132] Layer 2: One-dimensional convolutional layer CONV1D, parameter settings: input channel = 1, output channel = 32, kernel_size = 3, padding = 1;

[0133] Layer 3: Batch Norm (BN) layer, BatchNorm1d=32;

[0134] Layer 4: ReLU activation layer, with ReLU as the activation function;

[0135] Layer 5: Pooling layer, with the pooling function being Max Pooling;

[0136] Layer 6: Convolutional layer, parameter settings: input channel = 32, output channel = 64, kernel_size = 3, padding = 1;

[0137] Layer 7: BatchN layer, BatchNorm1d=64;

[0138] Layer 8: ReLU activation layer, with ReLU as the activation function;

[0139] Layer 9: Pooling layer, with Max Pooling as the pooling function;

[0140] Layer 10: Convolutional layer, parameter settings: input channel = 64, output channel = 128, kernel_size = 3, padding = 1;

[0141] Layer 11: Batch Norm (BN) layer, BatchNorm1d=128;

[0142] Layer 12: Activation layer, with ReLU activation function;

[0143] Layer 13: Pooling layer, with the pooling function being Max Pooling;

[0144] Layer 14: Global Average Pooling layer, with the pooling function being Global Average Pooling;

[0145] Layer 15: Dropout layer with random inactivation rate of 0.5;

[0146] Layer 16: Output layer.

[0147] The 1D-CNN network parameters are as follows: the optimizer is Adam, the training method is mini-batch gradient descent, the batch size is 32, the maximum number of training rounds is 150, the initial learning rate is 1e-3, the L2 regularization is 1e-4, the samples are randomly shuffled in each round, and the loss function is the mean squared error RMSE or Huber loss.

[0148] Model training: The network input is the calibration spectral matrix of the training set. Standardized parameters are determined based on the training set, and these parameters are used for consistency processing during the prediction stage of the test set. Early stopping and model selection are performed based on the training set error to obtain a stable 1D-CNN model.

[0149] Predicted output: After training, input the calibration spectral matrix from the test set. Finally, the prediction results of the nonlinear basis learner 1D-CNN on the calibration spectral matrix of the test set are obtained. .

[0150] VI. Preparation of Fusion Gating Parameters

[0151] Load the training and prediction results of the PLSR base learner and the 1D-CNN base learner on the training set samples, and calculate the core parameters of the gating function, including the distribution deviation. Disagreement with forecast The specific calculation and judgment rules are as follows:

[0152] (a) Distribution Deviation Calculation and Judgment

[0153] For the original spectrum Perform consistent standardization processing to obtain the preprocessed spectrum. ;

[0154] Calibrate the spectral matrix of the test set. Projecting onto the PCA subspace yields the score vector. ,

[0155] in, The projection matrix is ​​determined using the eigenvalue decomposition method; For training mean, , The total number of samples, For sample indexing, For a single training set sample;

[0156] The distribution deviation is calculated using the L2 norm of the score vector, as shown in the formula: ;

[0157] Calculate the same method for all samples in the training set. Statistical training set The distribution is used, and the 99th percentile is taken as the deviation threshold. ;

[0158] Judgment rule: If the sample distribution of the calibration spectral matrix of the test set deviates... > If the sample is determined to be out of proportion to the training distribution (out-of-distribution sample); ≤ It is determined to be an in-distribution sample.

[0159] (ii) Predicting the degree of divergence Calculation and Judgment

[0160] Calibrate the spectral matrix for the test set Extract its PLSR model prediction values Compared with the predictions of the 1D-CNN model According to the formula Calculate the degree of divergence. A smaller value indicates a higher consistency between the two models' predictions. The larger the value, the more significant the conflict between the two models' predictions;

[0161] Judgment rule: Calculate the root mean square error (RMSE) of predictions for the PLSR model and the 1D-CNN model respectively in the training set. When If the difference in RMSE between the two models in the training set exceeds 1 times, it is determined that there is a significant conflict between the two models for this sample, and fusion gating intervention is immediately triggered.

[0162] (III) Construction of basic gating weight functions

[0163] Based on distribution deviation Disagreement with forecast Construct the basic function for gating weights, and use logical functions to generate gating weights. The formula is: , , ;in, The coefficients for the hyperparameter search are... As a reference bias, The impact of sample deviation on gating. To predict the impact of divergence on gating, after Sigmoid mapping... .

[0164] VII. Gating Fusion and Determination of Optimal Gating Configuration

[0165] With the goal of minimizing the RMSE of the training set, the gating scheme and its optimal parameter combination are determined as follows:

[0166] Four types of gated functions are selected for traversal optimization, namely:

[0167] 1. Constant weights: ,in, ;

[0168] 2. Based on the degree of divergence Weights: ;

[0169] 3. Based on distribution deviation Weights: ;

[0170] 4. Combined feature gating: ;

[0171] The hyperparameter search is performed using one of the following algorithms: random search, Bayesian optimization, or genetic evolution. The search parameters include the slope. Threshold Combined weights And so on, and set the search range according to the requirements of the corresponding algorithm;

[0172] According to the fusion formula The prediction results of the two base learners are fused at the first level. The RMSE of each component is calculated separately, and the average value is taken as the training set error.

[0173] Based on the criterion of minimizing the training set error, the optimal gating form and parameter combination are selected as the best gating configuration. Once determined, this configuration is fixed and used for subsequent test set inference.

[0174] VIII. Test Set Reasoning and Result Output

[0175] With the parameters of the above optimal gating configuration fixed, inference operations are performed on the test set samples. The specific steps are as follows:

[0176] The test set samples are input into the trained PLSR model and 1D-CNN model respectively to obtain the corresponding prediction results. and ;

[0177] The distribution deviation of the test set samples is calculated using the methods employed during the training phase. Disagreement with forecast Construct gated features and standardize them according to the statistics of the training phase;

[0178] Substituting the standardized gating features into the optimal gating function yields the gating weights for each test set sample. ;

[0179] According to the fusion formula Calculate the first-level fusion output to obtain the final prediction results for the test set samples.

[0180] The final output includes the prediction results and evaluation metrics for the test set, including the content of each element, root mean square error (RMSE), and coefficient of determination (R²). 2 It also outputs the gating weights for each sample. This is used to explain the fusion ratio of the linear PLSR model and the nonlinear 1D-CNN model in the prediction results of each sample, thereby improving the interpretability and engineering usability of the results.

[0181] Therefore, this invention adopts the above-mentioned laser-induced breakdown spectroscopy elemental quantitative analysis method based on machine learning optimization, which integrates the advantages of partial least squares regression and one-dimensional convolutional neural network, and achieves sample-level dynamic fusion through adaptive gating, effectively improving the accuracy, stability and adaptability of laser-induced breakdown spectroscopy quantitative analysis, and is suitable for online detection of multiple components, especially nuclear materials analysis.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A laser-induced breakdown spectroscopy elemental quantitative analysis method optimized based on machine learning, characterized in that, Includes the following steps: S1. Sample Preparation, Data Acquisition and Processing: Laser-Induced Breakdown Spectroscopy (LIBS) was performed on all samples. The acquired spectra are the raw spectra. ; The samples are divided into two categories: one is the training set, and the other is a set of samples that are used to construct a training set. The training set contains a matrix of material composition, where... For the types of material components, One type is the number of samples; the other is the test set, where the component content of the samples does not need to be known. Data preprocessing: SNV normalization is performed on all spectral data to remove extreme values, baseline correction is performed to remove matrix effects, and smoothing is performed to enhance the overall fit. The processed spectral data is then output and saved as preprocessed spectra. , as the input of S2; S2, Input the preprocessed spectrum obtained in step S1. The spectra of the two types of samples were matched and calibrated based on the elemental characteristic spectral line information in the NIST database to determine the position and attribution of the characteristic spectral lines of the target analyte. The number of target elements is A, the number of training set samples is B, and the number of test set samples is C, ultimately forming a training set calibration spectral matrix of size A * B. A test set calibration spectral matrix of size A * C ; S3. Constructing the PLSR linear basis learner network: Deployed and run using MATLAB's Deep Learning Toolbox and Statistical and Machine Learning Toolbox; Construct the PLSR linear basis learner using Partial Least Squares Regression (PLSR) as the core algorithm, and input the training set calibration spectral matrix. The regression coefficients are selected by searching for the latent parameter nComp that minimizes the root mean square error (RMSE). After training, the calibration spectral matrix is ​​input from the test set. The prediction results of the PLSR model were obtained. Standardized parameters are determined during the training phase and used for consistency processing during the prediction phase. S4. Constructing a 1D-CNN Nonlinear Base Learner Network: Using MATLAB's Deep Learning Toolbox, construct a 1D-CNN nonlinear base learner network with a basic architecture of a one-dimensional convolutional neural network (1D-CNN). During the training phase, the network input is the calibration spectral matrix of the training set. After training, input the test set to calibrate the spectral matrix. Finally, the prediction results of the 1D-CNN model for the calibration spectral matrix of the test set were obtained. Standardized parameters are determined during the training phase and used for consistency processing during the prediction phase. S5. Preparation of fused gating parameters: Load the prediction results of the PLSR model and the 1D-CNN model on the test set. , Calculate the distribution deviation of the sample. Disagreement with forecast ;based on and Generate gate weights ; S6. Gating Calculation and Hyperparameter Search: The goal is to minimize the root mean square error (RMSE) of the calibration spectral matrix in the training set. The gating form and its parameters are determined through a search. Gating forms include four types: constant weights, weights based on divergence, weights based on distribution deviation, and combined feature gating. The hyperparameter search algorithm uses random search, Bayesian optimization, or genetic evolution to complete the first-level fusion. The fusion gating expression is: ; The average root mean square error (RMSE) of each component is selected as the training set error to determine the optimal gating form and parameter combination. S7. Test Set Inference and Result Output: Fix the optimal gating combination parameters and input the test set calibration spectrum matrix. After constructing and standardizing the gating features, calculate The first-level fusion prediction output is obtained by following the fusion gating expression in step S6. Output the test set prediction results, evaluation metrics, and gating weights. .

2. The laser-induced breakdown spectral elemental quantitative analysis method based on machine learning optimization according to claim 1, characterized in that, The training set in step S1 consists of standard samples with known compositional content used to train the model, comprising no less than 70% of the total number of samples. When there are different species in the samples, at least 30% of the total number of samples of each species shall be selected, and the total number of samples shall not be less than 70. The training set samples are only used for training and not for testing. After the training set is completed, the remaining samples constitute the test set, which is used to test the predictive ability of the model.

3. The laser-induced breakdown spectral elemental quantitative analysis method based on machine learning optimization according to claim 1, characterized in that, In step S1, SNV normalization is converted to vector normalization; The baseline correction algorithm uses the adaptive iterative reweighted penalized least squares method (AirPLS). The penalty factor for the baseline correction algorithm is The maximum number of iterations is 10-50, and the stopping criterion is the change in the relative distance between two adjacent baselines. If the maximum number of iterations is exceeded but the stopping criterion is not met, the iteration will stop and a new round of iterations will begin. The Savitzky-Golay smoothing method was selected; the smoothing window size was 7-15, and the polynomial order was 2; when oversmoothing or excessive baseline subtraction occurred, a rollback was performed.

4. The laser-induced breakdown spectral elemental quantitative analysis method based on machine learning optimization according to claim 3, characterized in that, Oversmoothing is checked for consistency by comparing the spectra before and after smoothing. If any of the following conditions are met, it is judged as oversmoothing and reverted: The Pearson coefficient r of the smoothed and unsmoothed spectra is less than 0.985; The full width at half maximum (FWHM) of representative spectral lines increased by more than 15% compared to before smoothing. The peak height of the target element's feature line decreases by more than 10% compared to before smoothing; Excessive baseline subtraction involves comparing the spectra before and after baseline subtraction. Excessive baseline subtraction is determined and reverted when any of the following conditions are met: The proportion of sampling points with an intensity less than 0 in the spectrum after baseline subtraction exceeds 10%; The peak area of ​​the top 5 most intense spectral lines within a fixed window, after deduction, results in an additional loss of over 7%. After deduction, a significant negative trough appears, with its minimum value below -3. ,in, The standard deviation of background fluctuation is obtained by statistically analyzing the sampling points after drift correction of the peakless spectral signal.

5. The laser-induced breakdown spectral elemental quantitative analysis method based on machine learning optimization according to claim 1, characterized in that, The calibration process parameters in step S2 include: center wavelength Peak integral window, peak height ≥ baseline mean The peak detection threshold, where, The standard deviation of intensity fluctuation of spectral signal in the peakless background band. The number of spectral lines.

6. The laser-induced breakdown spectral elemental quantitative analysis method based on machine learning optimization according to claim 1, characterized in that, The network structure of the 1D-CNN nonlinear base learner network in step S4 is as follows: Layer 1: Input Layer; Layer 2: One-dimensional convolutional layer CONV1D, parameter settings: input channel = 1, output channel = 32, kernel_size = 3, padding = 1; Layer 3: Batch Norm (BN) layer, BatchNorm1d=32; Layer 4: ReLU activation layer, with ReLU as the activation function; Layer 5: Pooling layer, with the pooling function being Max Pooling; Layer 6: Convolutional layer, parameter settings: input channel = 32, output channel = 64, kernel_size = 3, padding = 1; Layer 7: BatchN layer, BatchNorm1d=64; Layer 8: ReLU activation layer, with ReLU as the activation function; Layer 9: Pooling layer, with Max Pooling as the pooling function; Layer 10: Convolutional layer, parameter settings: input channels = 64, output channels = 128, kernel_size = 3, padding = 1; Layer 11: Batch Norm (BN) layer, BatchNorm1d=128; Layer 12: Activation layer, with ReLU activation function; Layer 13: Pooling layer, with the pooling function being Max Pooling; Layer 14: Global Average Pooling layer, with the pooling function being Global Average Pooling; Layer 15: Dropout layer with random inactivation rate of 0.5; Layer 16: Output layer.

7. The laser-induced breakdown spectral elemental quantitative analysis method based on machine learning optimization according to claim 1, characterized in that, The parameters of the 1D-CNN nonlinear basis learner in step S4 are: The training parameters are configured as follows: the optimizer is Adam; The training method is mini-batch gradient descent with a batch size of 32, a maximum number of training rounds of 150, an initial learning rate of 1e-3, L2 regularization of 1e-4, random shuffling of samples in each round, and loss function is mean squared error (RMSE) or Huber loss.

8. The laser-induced breakdown spectral elemental quantitative analysis method based on machine learning optimization according to claim 1, characterized in that, Distribution deviation in step S5 The specific calculation and judgment steps are as follows: S511, Data Preprocessing: Preprocessing the raw spectrum Perform consistent standardization processing to obtain the preprocessed spectrum. ; S512, PCA Projection: Calibrate the spectral matrix of the test set. Projecting onto the PCA subspace yields the score vector. The calculation formula is: in, The projection matrix is ​​determined using the eigenvalue decomposition method; For training mean, , The total number of samples, For sample indexing, For a single training set sample; S513, Deviation Calculation: Calculated using the L2 norm of the score vector. The formula is: ; in, for The L2 norm; S514. Determination of deviation threshold: For all test set samples, calculate using the same method described above. ; Statistical test set The distribution is used, and the 99th percentile is taken as the deviation threshold. ; S515, Deviation Judgment Rule: When the sample distribution of the test set calibration spectral matrix deviates > When this occurs, it is determined to be an out-of-distribution sample; When the sample distribution of the test set calibration spectral matrix deviates ≤ When: it is determined to be an in-distribution sample; Predicting the degree of divergence The specific calculation and judgment steps are as follows: S521. Predicted Value Acquisition: Calibrate the spectral matrix for the test set. Obtain the PLSR model prediction values ​​respectively. And 1D-CNN model predictions ; S522. Divergence Calculation: Divergence is the difference between two predicted values. The formula is: ; S523, Conflict Quantification Judgment Rules: The root mean square error (RMSE) of predictions for the PLSR model and the 1D-CNN model were obtained in the training set, respectively. when When the average RMSE difference between the two models in the training set is 1, it is determined that there is a significant conflict between the two models for this sample, triggering the fusion gating intervention. Gating weights The specific construction steps are as follows: S531, Gate Control Scoring Value calculate: ; in, As a reference bias, The effect of distribution deviation on gating, To predict the impact of divergence on gating; S532, Sigmoid mapping: Gating score values Mapped to The interval is used to obtain the gating weight. : ; in, For the Sigmoid function, .

9. The laser-induced breakdown spectroscopy elemental quantitative analysis method based on machine learning optimization according to claim 8, characterized in that, The four gating methods in step S6 are specifically defined as follows: Constant weights: ,in, For combined weights, ; Based on divergence Weights: ,in, The slope For the threshold, For Sigmoid mapping functions; Based on distribution deviation Weights: ; Combined feature gating: .