LIBS inversion method and device based on Bayesian optimization adjustable parameter Softplus neural network
By using the tunable parameter Softplus neural network and Bayesian optimization algorithm in LIBS quantitative analysis, the problem of gradient disappearance of activation function and insufficient adaptability is solved, and more efficient quantitative analysis of chemical components is achieved, improving the nonlinear fitting accuracy and prediction performance of the model.
Patent Information
- Application Number
- CN202510429784.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-08-05
AI Technical Summary
When the existing LIBS quantitative analysis method processes complex spectral data, the classical activation function has problems such as gradient disappearance and insufficient adaptability, resulting in limited model learning ability and stability, low hyperparameter optimization efficiency, and difficult to achieve high-precision quantitative analysis of chemical components.
The adjustable parameter Softplus neural network is used as the hidden layer activation function, and combined with Bayesian optimization algorithm, the model parameters are optimized through K-fold cross-validation and tree structure Bayesian optimization algorithm, and the adjustable parameters of the activation function are dynamically adjusted to improve the adaptability and optimization efficiency of the model.
The nonlinear fitting accuracy and learning ability of LIBS spectral data are significantly improved, the generalization and prediction performance of the model are enhanced, the problems of gradient vanishing and low efficiency of hyperparameter optimization are solved, and more efficient quantitative analysis of chemical components is achieved.
Smart Images

Figure CN120432044A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of spectral analysis, and in particular to a LIBS inversion method and device based on a Bayesian optimization adjustable parameter Softplus neural network. Background Art
[0002] Laser-induced breakdown spectroscopy (LIBS) is a rapid chemical element detection technology based on laser plasma radiation. Due to its advantages such as fast detection speed, wide sample applicability, simultaneous detection of multiple elements, and remote non-destructive analysis, it is widely used in various fields such as environmental monitoring, industrial quality inspection, deep space exploration, and biomedicine. Currently, LIBS is relatively mature in the qualitative analysis of material composition, but achieving high-precision LIBS quantitative analysis still faces many challenges. This is mainly because the generation process of LIBS spectra is affected by multiple factors such as complex physical and chemical matrix effects, fluctuations in experimental conditions, and self-absorption effects, resulting in a highly nonlinear relationship between the spectral signal and the content of the target component. In addition, LIBS spectral data are usually high-dimensional and noisy, further increasing the difficulty of quantitative modeling.
[0003] In the development of LIBS quantitative inversion models, traditional linear models, such as calibration curves, multivariate linear regression, principal component regression, and partial least squares, were initially applied to spectral data analysis. However, because the generation of LIBS spectral data involves complex nonlinear physical processes, its signal characteristics often exhibit highly nonlinear dependence on component content. Traditional linear models are unable to effectively adapt to these complex data characteristics, resulting in limited accuracy and stability of quantitative analysis. To overcome this limitation, researchers have gradually introduced nonlinear modeling techniques, such as neural networks, into LIBS data analysis.
[0004] Compared to traditional linear models, neural network models, with their adaptability and ability to learn nonlinear features, have become a key tool in LIBS quantitative inversion applications. Neural networks demonstrate superior accuracy and robustness when dealing with highly nonlinear and complex data relationships, providing important technical support for the in-depth research and application of LIBS spectral data analysis. The activation function of a neural network has a crucial impact on the performance of the training process. By transforming linear inputs into nonlinear outputs, the activation function enables the neural network to capture the complex feature relationships in LIBS data, effectively performing accurate quantitative analysis of nonlinear LIBS data.
[0005] Although the introduction of neural network models has significantly improved the potential of LIBS quantitative analysis, current classic activation functions have limitations when processing complex spectral data. They struggle to balance learning capabilities and model stability, limiting the performance of LIBS data quantitative models. These shortcomings are primarily reflected in the following two aspects:
[0006] 1. Inherent Problems of Classic Activation Functions
[0007] In deep neural network training, the Sigmoid function is prone to the vanishing gradient problem, which significantly reduces the efficiency of network training in deep structures or when processing large amounts of data. The ReLU function, on the other hand, suffers from neuron death, where some neurons may become permanently inactivated during training, weakening the network's ability to express data features. Furthermore, the Tanh function's output approaches the saturation range when the input value is large (positive or negative), which can also lead to the vanishing gradient problem. Vanishing gradients can slow down weight updates or even completely stagnate. While the narrow Softplus function alleviates the neuron death problem of ReLU to some extent, its computational complexity is high, and its gradient is small when the input is negative, which can lead to slower training speeds, especially when processing high-dimensional LIBS data.
[0008] 2. The activation function is fixed and lacks adaptability
[0009] Classic activation functions such as Sigmoid, ReLU, Tanh, and the narrowly defined Softplus function are fixed in form and lack adjustable parameters, making them incapable of dynamic adjustment based on data characteristics or problem requirements. This limitation makes it difficult for the models to adapt to the highly nonlinear characteristics and complex background interference unique to LIBS spectral data, thus affecting the accuracy of quantitative analysis.
[0010] To address the above issues, the invention application with publication number CN118067691A discloses a LIBS quantitative detection method based on a neural network with adjustable parameters, the Softplus function. The method includes: preparing a training set of detection samples and a test set of detection samples; collecting LIBS spectra of all detection samples; preprocessing the collected spectra; constructing and training a back-propagation neural network (BPNN) model; evaluating the training and testing results; adjusting and optimizing the network parameters of the BPNN model to finally complete the network construction of the BPNN model; inputting the LIBS spectrum of an unknown sample to quantitatively analyze the chemical composition content in the sample. However, although this method improves the learning ability and performance of the model by introducing the adjustable parameter Softplus activation function, its hyperparameter optimization process still relies on manual adjustment, mainly through trial and error and experience to gradually optimize the adjustable parameters. Although the existing LIBS quantitative detection methods can find a better parameter combination and improve the accuracy of LIBS quantitative detection, the hyperparameter optimization efficiency is low, it cannot cover the entire parameter space, and lacks systematicity.
[0011] Hyperparameter optimization significantly impacts the model's convergence speed, prediction accuracy, and generalization capabilities. Besides manual tuning, traditional hyperparameter optimization methods, such as grid search and random search, while somewhat applicable, are inefficient in utilizing computing resources when dealing with complex LIBS spectral data, making it difficult to ensure stable and reproducible results. The lack of adaptive hyperparameter optimization methods further limits the computational efficiency and predictive performance of LIBS quantitative models. Summary of the Invention
[0012] The present invention aims to provide a LIBS inversion method and device based on a Bayesian optimization adjustable parameter Softplus neural network. By adopting a back-propagation neural network to construct a LIBS spectral data inversion model, using the adjustable parameter Softplus function as the hidden layer activation function of the neural network, and using a Bayesian optimization algorithm to search for the optimal value of the adjustable parameter in the activation function, the method is used to significantly improve the efficiency of searching for the optimal parameter value, thereby improving the accuracy and analysis efficiency of LIBS spectroscopy for quantitative analysis of chemical component content.
[0013] The embodiment provides a LIBS inversion method based on a Bayesian optimization adjustable parameter Softplus neural network, comprising the following steps:
[0014] (1) Select standard samples with known chemical composition content as detection samples, collect LIBS spectra of all detection samples, and preprocess the original LIBS spectral dataset;
[0015] (2) Divide the preprocessed LIBS spectral dataset into a training set and a test set;
[0016] (3) Based on the training set, a Softplus neural network model with adjustable parameters is constructed, and the Softplus neural network model with adjustable parameters is trained and preliminarily optimized, wherein the neural network is a back-propagation neural network;
[0017] (4) K-fold cross validation and tree-based Bayesian optimization algorithm are used to optimize the initial adjustable parameter Softplus neural network model, and the model performance is evaluated using the test set as input to construct a Bayesian optimized adjustable parameter Softplus neural network;
[0018] (5) Based on the constructed Bayesian optimization adjustable parameter Softplus neural network, the LIBS spectral data of unknown samples were input to quantitatively analyze the chemical component content.
[0019] In one embodiment, the original LIBS spectral data set is composed of LIBS spectral data, and the LIBS spectral data only includes spectral intensity information.
[0020] In one embodiment, step (1) further includes: determining the content of the chemical components to be analyzed in all detection samples based on the certification certificate of the national standard substance, and making a chemical component content label for each detection sample.
[0021] In one embodiment, the preprocessing includes one or more of dark background subtraction, noise filtering, continuous baseline subtraction, wavelength calibration, and spectral channel stitching.
[0022] Furthermore, the dark background is obtained by collecting several dark background spectra under no excitation conditions and averaging them.
[0023] Furthermore, each LIBS spectrum in the preprocessed LIBS spectrum dataset contains M i data points.
[0024] In one embodiment, the structure of the adjustable parameter Softplus function neural network model in step (3) includes:
[0025] Input layer, the number of neurons in the input layer is consistent with the data points of each LIBS spectrum after preprocessing, set to M i ;
[0026] Batch normalization layer, used to normalize the preprocessed LIBS spectral dataset in each training batch;
[0027] Hidden layer, the number of neurons in the hidden layer is M h , the activation function of the hidden layer is the adjustable parameter Softplus function, expressed as: SofTplus(x)=1 / β*ln(e βx+1), where x is the input variable and β is an adjustable parameter whose value range is a non-negative real number;
[0028] The random dropout layer is used to randomly select a certain ratio of hidden layer neurons for random dropout in each training batch;
[0029] Output layer, the number of neurons in the output layer is set to M o , where M o The value is equal to the amount of chemical component to be analyzed.
[0030] In one embodiment, the training in step (3) takes the training set as input and the labels of the chemical components to be analyzed in the detection sample as output, and is performed iteratively based on the constructed adjustable parameter Softplus neural network model.
[0031] In one embodiment, the iteration employs the AdamW algorithm.
[0032] In one embodiment, step (4) uses K-fold cross validation to optimize the initial adjustable parameter Softplus neural network model, including: dividing the input training set into several subsets, selecting one of the subsets as the validation subset, and the remaining subsets as the training subsets, using the training subsets for training and calculating the mean square error on the validation subsets, iterating multiple times, calculating the average mean square error, and optimizing the adjustable parameter β.
[0033] In one embodiment, the tree-structured Bayesian optimization algorithm described in step (4) optimizes the initial adjustable parameter Softplus neural network model, including:
[0034] A set of initial parameter values are randomly selected and the mean square error is calculated. Two conditional probability density functions are constructed based on the initial parameter values, representing the hyperparameter region with good performance and the hyperparameter region with poor performance, respectively.
[0035] Search for the parameter value with the largest probability density ratio between the hyperparameter region with excellent performance and the hyperparameter region with poor performance as the parameter for the next model performance evaluation, and calculate the corresponding mean square error;
[0036] After multiple iterations, the parameter value corresponding to the minimum mean square error is taken as the optimal parameter to optimize the adjustable parameter β.
[0037] In one embodiment, the secondary optimization of the model parameters using the tree-structured Bayesian optimization algorithm described in step (4) also includes: setting a maximum number of searches, and when the maximum number of searches is reached, optimizing the adjustable parameter β by taking the parameter value corresponding to the minimum average mean square error during the search process as the optimal parameter.
[0038] In one example, the evaluation index of the Bayesian optimization adjustable parameter Softplus neural network is the root mean square error or relative error between the true value and the calculated value of the component content of the detection sample.
[0039] In order to clearly demonstrate the LIBS inversion method based on the Bayesian optimization adjustable parameter Softplus neural network, a LIBS inversion device based on the Bayesian optimization adjustable parameter Softplus neural network is provided, including a memory and a processor, the memory is used to store a computer program, and the processor is used to implement the LIBS inversion method based on the Bayesian optimization adjustable parameter Softplus neural network when executing the computer program.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] (1) By introducing the adjustable Softplus function, the parameter β can be dynamically adjusted according to the data distribution and task objectives to effectively control the complexity and gradient scale, thereby solving the problems of slow calculation and small gradient, and improving the model's learning ability and nonlinear fitting accuracy in complex spectral data. It breaks through the problem of fixed activation function form and lack of flexibility in existing technologies and improves the adaptability of the model.
[0042] (2) The introduction of the Bayesian optimization algorithm, combined with the probability model and feedback information, can dynamically adjust the search direction during the optimization process, obtain the optimal hyperparameter configuration with less computing resources and time cost, improve the efficiency of the optimization process, and enhance the generalization ability and performance stability of the model.
[0043] (3) A multi-level validation mechanism is adopted, including K-fold cross-validation and a multi-index evaluation system. By introducing evaluation indicators such as mean square error and root mean square error, the prediction accuracy and error range of the model are comprehensively quantified, taking into account both the robustness and practicality of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for describing the embodiments or the prior art.
[0045] Figure 1 A schematic diagram of the process of the LIBS inversion method based on the Bayesian optimization adjustable parameter Softplus neural network provided by the present invention;
[0046] Figure 2 This is a data comparison chart of the root mean square error (RMSE) value of the prediction for each sample in the test set using Bayesian optimization and grid search;
[0047] Figure 3This is a data comparison chart of the root mean square error (RMSE) of each sample in the test set using the classic activation function Tanh and Sigmoid, ReLU, narrow Softplus, and adjustable parameter SofTplus functions;
[0048] Figure 4 This is a data comparison chart of the root mean square error (RMSEP) of the entire test set using the classic activation function Tanh, Sigmoid, ReLU, narrow Softplus, and the adjustable parameter Softplus function;
[0049] Figure 5 This is a comparison chart of RMSEP using the adjustable parameter Softplus function under different model complexities. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not limit the scope of protection of the present invention.
[0051] The solution of the embodiment of the present invention is as follows Figure 1 As shown in FIG, a LIBS inversion method based on a Bayesian optimization adjustable parameter Softplus neural network includes the following steps:
[0052] S1. Select standard samples with known chemical composition content as detection samples, collect LIBS spectra of all detection samples, generate raw LIBS spectral datasets and perform preprocessing.
[0053] In this example, there are 30 reference material samples used in the LIBS detection experiment, numbered 1 to 30, namely: 1) andesite, 2) kaolin, 3) soft clay, 4) copper (silver) rich ore, 5) lead ore, 6) carbonate ore, 7) soil 1 (yellow red soil), 8) soil 2 (brick red soil), 9) stream sediment 1 (Wuhan Yangtze River sediment), 10) stream sediment 5 (Hunan Shizhuyuan), 11) granite gneiss, 12) clay, 13) shale, 14) mudstone, 15) polymetallic poor ore, 16) quartzite, 17) quartzite, 18) quartzite, 19) quartzite, 20) quartzite, 21) quartzite, 22) quartzite, 23) quartzite, 24) quartzite, 25) quartzite, 26) quartzite, 27) quartzite, 28) quartzite, 29) quartzite, 30) quartzite, 31) quartzite, 32) quartzite, 33) quartzite, 34) quartzite, 35) quartzite, 36) quartzite, 37) quartzite, 38) quartzite, 39) quartzite, 40) quartzite, 41) quartzite, 42) quartzite, 43) quartzite, 44) quartzite, 45) quartzite, 46) quartzite, 47) quartzite, 48) quartzite, 49) quartzite, 50) quartzite, 51) quartzite, 52) quartzite, 6) Floodplain Sediments, 17) Shale, 18) Polymetallic Poor Ore, 19) Lead Ore, 20) Molybdenum Ore, 21) Stream Sediment 1 (Tongling), 22) Stream Sediment 2 (Kaiyuan), 23) Stream Sediment 3 (Fengshun, Guangdong), 24) Soil 3 (Saline-Alkaline Soil, Hangjinhou Banner, Inner Mongolia), 25) Soil 5 (Gray-Calcite Soil, Shihezi City, Xinjiang), 26) Quartz Sandstone, 27) Stream Sediment 2 (Namtso Sedimentary Area, Tibet), 28) Lead (Zinc)-Rich Ore, 29) Granite, 30) Stream Sediment 4 (Guangxi). In this example, the chemical component to be measured is magnesium oxide (MgO). The national standard number of the national standard material sample and its MgO content (mass percentage, wt%) are shown in Table 1 below.
[0054] Table 1
[0055]
[0056]
[0057] As shown in Table 1, the MgO content distribution range in the 30 standard substance samples in this embodiment is 0.069% to 6.67%. Therefore, the constructed Bayesian optimization-based adjustable parameter SofTplus neural network is suitable for detecting samples within this concentration range.
[0058] For each sample, n LIBS excitation spectra were collected. Each sample was subjected to identical laser and environmental parameters to generate a raw LIBS spectral dataset. In this experiment, n = 60, resulting in a total of 1800 spectra collected from 30 samples. Each spectrum consisted of three band channels, each containing 1800 pixel data points, for a total of 5400 pixel data points per spectrum.
[0059] During acquisition, only conventional LIBS spectra containing only spectral intensity information are required, and LIBS spectra with additional information, such as time-resolved LBS spectra with time dimension information, are not required.
[0060] In the embodiment, d dark background spectra are collected under no excitation conditions and used for preprocessing of the original LIBS spectral data. The preprocessing may include: subtracting the dark background (the dark background of each sample is the average of the d dark background spectra of the sample, and d=3 in this experiment), filtering out noise, subtracting continuous baselines, wavelength calibration, and spectral channel splicing; for the preprocessed LIBS spectral data set, each spectrum contains M i data points.
[0061] After preprocessing, the number of data points of each spectrum in the LIBS spectral dataset has changed significantly. The original data contains 5400 pixel data points per spectrum. After the spectral channel splicing preprocessing effectively eliminated invalid pixels, the number of data points per spectrum was finally reduced to 4506 (i.e., M in this experiment). i ). This preprocessing process not only optimizes the data quality, but also achieves the rational compression of data dimensions.
[0062] S2. Divide the preprocessed LIBS spectral dataset into training set and test set.
[0063] In the embodiment, the preprocessed LIBS spectral dataset is divided into a training set and a test set according to a certain ratio, which are used for subsequent model training, model parameter optimization and final performance testing, respectively.
[0064] S3. Based on the training set, train the Softplus neural network model with adjustable parameters to form an initial Softplus neural network model with adjustable parameters, wherein the neural network is a back propagation neural network.
[0065] In the embodiment, the constructed adjustable parameter SofTplus neural network model structure includes five layers:
[0066] The first layer is the input layer, and the number of neurons is set to M i , which is consistent with the data points of each LIBS spectrum after preprocessing, M i =4506;
[0067] The second layer is the batch normalization layer, which normalizes the input data in each training batch;
[0068] The third layer is the hidden layer, and the number of neurons is set to M h , where M h The value is determined according to the actual situation of the data set. In this embodiment, M h =100, the nonlinear activation function of the hidden layer uses the adjustable parameter Softplus, and the specific expression is:
[0069] Soffplus(x)=1 / β*ln(e βx +1)
[0070] Where x is the input variable, β is an adjustable parameter, and its value range is non-negative real number. When β = 1, it is narrow softplus;
[0071] The fourth layer is the random inactivation layer, which randomly selects a certain ratio of hidden layer neurons for random inactivation in each training batch;
[0072] The fifth layer is the output layer, and the number of neurons is set to M o , where M o The numerical value is equal to the number of chemical components to be analyzed. o =1, only MgO component was analyzed.
[0073] Based on the Softplus neural network model constructed above, the model is iteratively trained using a training set from a preprocessed LIBS spectral dataset as input and the labels of the chemical components to be analyzed in the detected samples as output. During the model training iterations, the iterative optimizer uses the Adam algorithm with a weight decay term, also known as the AdamW algorithm. AdamW avoids the impact of learning rate changes on weight decay during training, making the Softplus neural network model more stable during training, reducing overfitting and improving the model's generalization ability.
[0074] S4. K-fold cross validation and tree-structured Bayesian optimization algorithm are used to optimize the initial adjustable parameter Softplus neural network model, and the model performance is evaluated using the test set as input to construct a Bayesian optimized adjustable parameter Softplus neural network.
[0075] Based on the Softplus neural network model with adjustable parameters initially optimized in step S3, the initial Softplus neural network model with adjustable parameters is optimized twice using K-fold cross validation and a Bayesian optimization algorithm based on a tree structure. Specifically, in this embodiment, a 5-fold cross validation is used to divide the input training set D into 5 non-overlapping subsets D1, D2, ..., D5. For each candidate parameter value β, one subset is selected as the validation subset in each iteration, and the remaining 4 subsets are used as training subsets. For the lth iteration (l = 1, 2, ..., 5), the training subset is The validation subset is Using the training subset Train the model and validate it on the Calculate the mean squared error (MSE) above, MSE l (β) is calculated as follows:
[0076]
[0077] Among them, f β (x) represents the predicted value of the model under the parameter β, (x, y) is the sample in the validation subset, and y is the true value.
[0078] Repeat the above process 5 times, each time selecting a different subset as the validation subset, and finally calculate the average mean square error (MSE) of each iteration CV (β), optimize the adjustable parameter β:
[0079]
[0080] In the embodiment, the Bayesian optimization algorithm is combined with the Tree-structured Parzen Estimator (TPE) to optimize the β parameter in the adjustable Softplus function. After adjusting the parameter β through K-fold cross-validation and the tree-structured Bayesian optimization algorithm, the complexity and gradient scale can be effectively controlled, thereby solving the problems of slow calculation and small gradient.
[0081] Specifically, a set of initial parameter values β are randomly selected and the corresponding mean square error (MSE) is calculated. CV (β). For each iteration, a probability model p(MSE CV |β), TPE effectively guides the hyperparameter search process by constructing and optimizing two conditional probability density functions, representing the hyperparameter region with excellent performance and the hyperparameter region with poor performance, respectively. Specifically, the mathematical formula for optimizing the parameter value β is as follows:
[0082]
[0083] Among them, β new is the β parameter value to be evaluated in the next iteration; B is the search space of the β parameter; γ is the threshold; f(β) = MSE CV (β) represents the β performance index; the excellent hyperparameter region is f(β)≤γ; the p(β|f(β)≤γ) function represents the distribution of β values in the excellent performance region; the poor hyperparameter region is f(β)>γ; the p(β|f(β)>γ) function represents the distribution of β values in the poor performance region. TPE selects the β value that maximizes the probability density ratio of the excellent region to the poor region as the parameter for the next evaluation, and calculates the MSE under the new parameter value β CV (β).
[0084] After completing 5 iterations, the parameter value that minimizes the mean square error is selected as the optimal parameter β opt :
[0085]
[0086] Substitute the optimized parameter β into the adjustable parameter Softplus neural network model to complete the parameter optimization.
[0087] The Bayesian optimization algorithm also sets a maximum number of search attempts, n_trial. When the number of search attempts reaches n_trial, the Bayesian optimization process ends. At this point, the β value that minimizes the mean squared error during the search process is determined as the optimal β parameter and substituted into the adjustable Softplus neural network model to complete the parameter optimization.
[0088] Next, using the test set as input, 60 LIBS spectra were collected for each sample in the test set to evaluate the model performance and construct the final Bayesian optimization Softplus neural network with adjustable parameters. The evaluation metric was the root mean square error (RMSE) or relative error (RE) between the true and calculated values of the component content of the test sample. The RMSE was calculated as:
[0089]
[0090] RMSE represents the error between the predicted value and the true value, and its unit is the same as y i The same can intuitively reflect the actual magnitude of the prediction error. Where n represents the number of spectra of the test sample, y i is the true label value of the i-th spectrum, is the predicted value of the ith spectrum.
[0091] The calculation expression of RE is:
[0092]
[0093] RE is expressed as a percentage, reflecting the relative proportion of the predicted value deviating from the true value. j is the true label value of the jth spectrum, is the predicted value of the jth spectrum.
[0094] S5. Based on the constructed Bayesian optimization and adjustable parameter Softplus neural network, the LIBS spectral data of unknown samples are input to quantitatively analyze the chemical composition content.
[0095] After the final model is determined, the LIBS spectral data of the unknown sample are input into the Softplus neural network with adjustable parameters based on Bayesian optimization to quantitatively invert the content of MgO components.
[0096] The present invention also provides a LIBS inversion device based on a Bayesian optimization adjustable parameter Softplus neural network, comprising a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to implement the LIBS inversion method based on the Bayesian optimization adjustable parameter Softplus neural network when executing the computer program.
[0097] To demonstrate the effectiveness of the LIBS inversion method based on the Bayesian optimization and adjustable parameter Softplus neural network provided by the present invention in chemical composition content analysis, a series of verification experiments were conducted. A total of six samples were tested, with test samples 1 to 6 corresponding to samples 1, 5, 9, 14, 18, and 27 in Table 1, respectively.
[0098] like Figure 2 As shown in the figure, the Softplus neural network with adjustable parameters based on Bayesian optimization used in the present invention has advantages in LIBS quantitative analysis accuracy compared with conventional hidden layer activation functions Sigmoid, ReLU, Tanh and narrow Softplus functions. Figure 2 The RMSE values obtained from quantitative analysis of test set samples using the present invention and a grid search algorithm were compared. Lower RMSE values indicate better model analysis and prediction. The results show that the LIBS inversion method based on the Bayesian optimization and adjustable parameter Softplus neural network provided by the present invention achieves superior RMSE values to the grid search algorithm, demonstrating that the present invention provides better predictive performance and quantitative accuracy.
[0099] like Figure 3 As shown, the RMSE values of five activation functions (Sigmoid, ReLU, Tanh, narrow Softplus function and the adjustable Softplus function of the present invention) obtained by quantitatively analyzing unknown detection samples in the final BPNN model are compared (all parameters of the BPNN model except the hidden layer activation function are consistent). Figure 3 The results show that compared with the conventional hidden layer activation function, the adjustable parameter Softplus function provided by the present invention has the best prediction results for the test set samples. For a single test sample, the RMSE values of test samples 1, 2, 4, 5 and 6 are significantly better than those of other activation functions. Although the RMSE value of the adjustable parameter Softplus function of test sample No. 3 is close to that of ReLu, it is still lower.
[0100] In addition to a horizontal comparison with conventional hidden layer activation functions Sigmoid, ReLU, Tanh and the narrow Softplus function, the adjustable parameter Softplus function provided by the present invention is also compared with the prediction results of the Softplus function for unknown detection samples when only the number of iterations and the number of neurons are reduced while other model parameters remain unchanged.
[0101] like Figure 4 The results show a comparison of the root mean square error (RMSEP) of the conventional hidden layer activation functions Sigmoid, ReLU, Tanh, and the narrow Softplus function, as well as the tunable Softplus function, on the entire test set when the number of iterations is 250 and the number of neurons is 100. The results show that the tunable Softplus function has better prediction performance on the test set samples than the other four classic activation functions.
[0102] like Figure 5 The RMSEP data comparison is shown when the Softplus function has 250 iterations and 100 neurons (Softplus), and when the Softplus function has only half the iterations (Softplus (reduce the number of iterations)) and half the number of neurons (Softpos (reduce the number of neurons)). Figure 4 and Figure 5 The results show that when the number of model iterations and neurons is reduced, the model complexity is reduced, and the prediction performance of the adjustable parameter Softplus function on the test set is slightly reduced, but the overall evaluation index is still significantly better than the Tanh and Sigmoid activation functions, and slightly better than the ReLU and narrow Softplus functions.
[0103] The analysis results show that the constructed Softplus neural network with adjustable parameters based on Bayesian optimization significantly improves the model's computational efficiency and processing speed, enhances computing resource utilization, and accelerates the model's training and prediction processes. Furthermore, the model exhibits enhanced adaptability when processing spectral datasets from diverse samples. The enhanced nonlinear mapping capabilities and flexibility of the BPNN enable it to more effectively adapt to diverse LIBS spectral data, thereby improving the model's generalization and robustness. Therefore, this method can better meet the application requirements of LIBS detection and analysis and has significant value in the field of spectral detection technology.
[0104] The specific implementation methods described above provide a detailed description of the technical solutions and beneficial effects of the present invention. It should be understood that the above is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, supplements and equivalent substitutions made within the scope of the principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A LIBS inversion method based on Bayesian optimization and adjustable parameter Softplus neural network, characterized in that: The following steps are involved: (1) Select standard samples with known chemical composition content as detection samples, collect LIBS spectra of all detection samples, generate original LIBS spectral datasets and perform preprocessing; (2) Divide the preprocessed LIBS spectral dataset into training set and test set; (3) Based on the training set, training the adjustable parameter Softplus neural network model to form an initial adjustable parameter Softplus neural network model, wherein the neural network is a back propagation neural network; (4) K-fold cross validation and tree-based Bayesian optimization algorithm are used to optimize the initial adjustable parameter Softplus neural network model, and the model performance is evaluated using the test set as input to construct a Bayesian optimized adjustable parameter Softplus neural network; (5) Based on the constructed Bayesian optimization adjustable parameter Softplus neural network, the LIBS spectral data of unknown samples were input to quantitatively analyze the chemical component content.
2. The LIBS inversion method according to claim 1, characterized in that: The preprocessing includes one or more of dark background subtraction, noise filtering, continuous baseline subtraction, wavelength calibration, and spectral channel splicing.
3. The LIBS inversion method according to claim 1, characterized in that: The structure of the adjustable parameter Softplus neural network model in step (3) includes: Input layer, the number of neurons in the input layer is consistent with the data points of each LIBS spectrum after preprocessing, set to M i ; Batch normalization layer, used to normalize the preprocessed LIBS spectral dataset in each training batch; Hidden layer, the number of neurons in the hidden layer is M h , the activation function of the hidden layer is the adjustable parameter Softplus function, expressed as: Softplus(x)=1 / β*ln(e βx +1), where x is the input variable and β is an adjustable parameter whose value range is a non-negative real number; The random dropout layer is used to randomly select a certain ratio of hidden layer neurons for random dropout in each training batch; Output layer, the number of neurons in the output layer is set to M o , where M o The value is equal to the amount of chemical component to be analyzed.
4. The LIBS inversion method according to claim 1, characterized in that: The training in step (3) takes the training set LIBS spectral data as input and the labels of the chemical components to be analyzed in the detection samples as output, and is performed iteratively based on the constructed adjustable parameter Softplus neural network model.
5. The LIBS inversion method according to claim 4, characterized in that: The iteration uses the AdamW algorithm.
6. The LIBS inversion method according to claim 1, characterized in that: In step (4), K-fold cross validation is used to optimize the initial adjustable parameter Softplus neural network model, including: dividing the input training set into several subsets, selecting one of the subsets as the validation subset, and the remaining subsets as the training subsets, using the training subsets for training and calculating the mean square error on the validation subsets, iterating multiple times, calculating the average mean square error, and optimizing the adjustable parameter β.
7. The LIBS inversion method according to claim 1, characterized in that: The tree-structured Bayesian optimization algorithm described in step (4) optimizes the initial adjustable parameter Softplus neural network model, including: A set of initial parameter values are randomly selected and the mean square error is calculated. Two conditional probability density functions are constructed based on the initial parameter values, representing the hyperparameter region with good performance and the hyperparameter region with poor performance, respectively. Search for the parameter value with the largest probability density ratio between the hyperparameter region with excellent performance and the hyperparameter region with poor performance as the parameter for the next model performance evaluation, and calculate the corresponding mean square error; After multiple iterations, the parameter value corresponding to the minimum mean square error is taken as the optimal parameter to optimize the adjustable parameter β.
8. The LIBS inversion method according to claim 7, characterized in that: The optimization of the initial adjustable parameter Softplus neural network model using the tree-structured Bayesian optimization algorithm described in step (4) also includes: setting a maximum number of searches, and when the maximum number of searches is reached, optimizing the adjustable parameter β by taking the parameter value corresponding to the minimum average mean square error during the search process as the optimal parameter.
9. The LIBS inversion method according to claim 1, characterized in that: The evaluation index of the Bayesian optimization adjustable parameter Softplus neural network is the root mean square error or relative error between the true value and the calculated value of the component content of the detection sample.
10. A LIBS inversion device based on a Bayesian optimization adjustable parameter Softplus neural network, comprising a memory and a processor, wherein the memory is used to store a computer program, characterized in that: The processor is used to implement the LIBS inversion method based on the Bayesian optimization adjustable parameter Softplus neural network according to any one of claims 1 to 9 when executing the computer program.
Citation Information
Patent Citations
LIBS quantitative detection method based on adjustable parameter Softplus function neural network
CN118067691A
Cited By
LIBS inversion method based on EMA-CNN and weighted loss function
CN122024928A