Search

CN-122024928-A - LIBS inversion method based on EMA-CNN and weighted loss function

CN122024928ACN 122024928 ACN122024928 ACN 122024928ACN-122024928-A

Abstract

The invention discloses a LIBS inversion method based on EMA-CNN and a weighted loss function, and relates to deep learning and spectrum analysis. And constructing an LIBS spectrum inversion model based on the depth convolution neural network CNN, introducing a high-efficiency multi-scale attention mechanism EMA, and designing a weighted mean square error loss function to realize multi-component content collaborative prediction. The EMA module can effectively guide a model to perform more reasonable attention focusing, and the extraction and learning efficiency of key features is remarkably improved. The conventional loss function is easy to face the problem of unbalanced loss components caused by the order of magnitude difference of the contents of all the components, and the loss function can weight the loss components correspondingly for all the components so as to cooperatively improve the prediction accuracy of all the components. The LIBS multi-component synchronous inversion method has the advantages of accuracy, stability and high efficiency, and is suitable for LIBS multi-component synchronous inversion tasks under a large data volume scene.

Inventors

  • SHU RONG
  • CUI ZHICHENG
  • LI LUNING
  • XU WEIMING
  • ZHANG XUCHEN
  • XU XUESEN
  • LIU XIANGFENG
  • XU YUSHENG
  • WANG JIANYU

Assignees

  • 中国科学院上海技术物理研究所

Dates

Publication Date
20260512
Application Date
20260129

Claims (10)

  1. 1. A LIBS inversion method based on EMA-CNN and a weighted loss function is characterized in that a LIBS spectrum inversion model is built based on a deep convolutional neural network CNN, an efficient multi-scale attention mechanism EMA is introduced, an EMA-CNN model is formed, a weighted mean square error loss function is designed, and accurate collaborative prediction of multi-component content is achieved.
  2. 2. A LIBS inversion method based on EMA-CNN and weighted loss functions according to claim 1 wherein the LIBS inversion method based on EMA-CNN and weighted loss functions comprises the steps of: S1, preparing a standard sample for collecting laser-induced breakdown spectroscopy LIBS, recording the name and substance component content information of each sample, preparing a substance component content summary table covering all N samples, determining the real contents of L target substance components of each sample based on a quantitative task, and constructing a target substance component content label vector; s2, acquiring LIBS spectrums of all detection samples by using a LIBS spectrum detection device at a fixed detection distance, wherein the LIBS spectrums acquired by experiments are defined as an original spectrum data set; S3, preprocessing the LIBS spectrum in the original spectrum data set, wherein the general preprocessing steps comprise dark background removal, wavelength calibration, radiation calibration, invalid pixel screening and channel splicing, and the preprocessed LIBS spectrum is defined as the LIBS spectrum data set; S4, sorting all samples according to the content of a target component from large to small, dividing the LIBS spectrum data set into P LIBS spectrum data subsets by using a system sampling strategy, defining the LIBS spectrum data subsets as Fold 1-P respectively, ensuring that the number of samples of each LIBS spectrum data subset is basically consistent, and meeting the same data distribution condition; s5, constructing a deep convolutional neural network model fused with an EMA module, wherein the deep convolutional neural network model is defined as an EMA-CNN model, and the EMA-CNN model is structurally designed in such a way that a layer 1 is a batch standardization layer, a layer 2, a layer 4, a layer 6, a layer 7 and a layer 9 are convolutional layers, an activation function is a linear rectification function ReLU, a layer 3, a layer 5 and a layer 8 are pooling layers, the pooling method is a maximum pooling strategy, a layer 10 is inserted into the EMA module, a layer 11 is a flat layer, a layer 12 is a full connection layer, an activation function is a ReLU, and a layer 13 is a full connection layer; S6, designing a Weighted mean square error loss function weighted_ MSELoss, reasonably calculating the weight of a corresponding loss component according to the content distribution range of each material component, and taking a minimized weighted_ MSELoss value as a model optimization target in the EMA-CNN model training process; S7, training and verifying the EMA-CNN model on the LIBS spectrum data subsets Fold1 to Fold P-1 by using a K-Fold cross verification strategy, and optimizing training super-parameters of the EMA-CNN model; S8, inputting the unknown LIBS spectrum of the test set into the EMA-CNN model which is verified through training, predicting the content of the target substance component of the corresponding sample, and evaluating the quantitative inversion performance of the EMA-CNN model in multiple directions according to two sets of evaluation indexes including the prediction root mean square error and the decision coefficient.
  3. 3. A LIBS inversion method based on EMA-CNN and weighted loss function as claimed in claim 2, wherein in step S1, the true contents of L target substance components of each sample are selected from the total substance component contents of all N known component samples, the component content label vector C of each sample is represented as a1 xL matrix, and the component label vector C i of sample i is Wherein c i1 represents the content of the 1 st component in the substance component information table, namely the mass percent (wt.%), and the meaning of the label vector of the content of other components such as 0≤c i1 ≤ 100 wt.%;c i2 and the like is similar.
  4. 4. The method of claim 2, wherein in step S2, when the LIBS spectrum detection device is used for spectrum acquisition, all key device parameters are set to fixed values including spectrum acquisition times, integration time, delay time and focusing position, and relevant environmental parameters are monitored in real time and maintained in a stable state including detection distance, environmental temperature, air pressure and air composition.
  5. 5. The method of claim 2, wherein in the step S3, the dark background removing operation is to subtract a dark background spectrum from an original LIBS spectrum to obtain an effective spectrum, the dark background spectrum is a spectrum responded by a spectrometer when no laser is excited, the wavelength scaling is to convert a sequence number of pixels of the spectrometer into a wavelength value through a multiple quadratic fitting function, the radiometric scaling is to convert the response of the pixels of the spectrometer into spectral radiance through a multiple linear fitting function, the ineffective pixel removing operation is to remove pixel response values of each band of the LIBS spectrum beyond a wavelength range, and the channel splicing is to splice the plurality of bands of LIBS spectra screened by the ineffective pixels into a whole band in wavelength sequence.
  6. 6. The method for LIBS inversion based on EMA-CNN and the weighted loss function according to claim 2, wherein in step S4, a system sampling scheme is adopted in the LIBS spectrum data set dividing process, all samples in the LIBS spectrum data set are ordered according to the content of a target component, the first P samples are sequentially used as the starting points of P subsets, one sample is taken every P samples to be placed in the corresponding subsets, all the subsets meet the data same distribution condition, so that the LIBS spectrum data set is divided into P subsets, and meanwhile, the LIBS spectrum data set dividing scheme strictly follows the highest principle of 'independent sample dimension', namely all LIBS spectrums of any samples are distributed in only one subset, and absolute isolation among the subsets is ensured.
  7. 7. The LIBS inversion method based on EMA-CNN and the weighted loss function is characterized in that in step S5, an EMA module adopts a parallel double-branch structure, namely a 1X 1 convolution kernel branch, which is used for extracting cross-channel relation, a 1X 3 convolution kernel branch, which is used for capturing local space structure context information, outputs of the two branches are subjected to global average pooling operation and Softmax normalization operation to obtain respective channel coding vectors and basic attention force diagram, then the basic attention force diagram of each branch is subjected to matrix multiplication with the channel coding vectors of the other branch to generate two attention force diagrams subjected to cross-scale space-channel information interaction enhancement, finally the two attention force diagrams are added and calculated through a Sigmoid activation function to obtain attention force diagram finally based on multi-scale feature information perception, then the attention force diagram and an input feature diagram sequence are multiplied element by element, and output to a next layer network, and the EMA-CNN model structure is adjusted and optimized according to specific LIBS spectrum data set characteristics and task requirements.
  8. 8. The method of claim 2, wherein in step S6, the weight design scheme of weighted_ MSELoss comprehensively considers the content distribution range of each target component, and assigns a specific weight coefficient w l to the corresponding loss component, the loss component refers to the mean square error of the predicted value and the true value of the content of one target component, the calculation method of weighted_ MSELoss is that the component content label vector of one sample is R, the LIBS spectrum detection device acquires M LIBS spectrums for the sample altogether, the component content predicted vector output by the EMA-CNN model for the jth LIBS spectrum of the sample is P j , L values are respectively recorded in the vector R and the vector P j , wherein the first value is R l and P jl , and the calculation formula of weighted_ MSELoss is The weight coefficient w l determines the preliminary range according to the ratio between the loss components of the target components, and then the final value is determined through manual selection.
  9. 9. The method for LIBS inversion based on EMA-CNN and a Weighted loss function according to claim 2, wherein in step S7, training of the EMA-CNN model adopts a K-Fold cross validation strategy, and a training iterative optimizer adopts an adaptive moment estimation AdamW algorithm for correcting weight attenuation, wherein the loss function is weighted_ MSELoss; firstly sequentially selecting 1 LIBS spectrum data subsets Fold1 to Fold P-1 as verification sets for monitoring performance change of an EMA-CNN model in a training process in real time, using the rest P-2 subsets as training sets for training the EMA-CNN model, obtaining performance prediction results of the EMA-CNN model on all subsets after P-1 rounds of circulation, inputting LIBS spectrum samples of the training sets and component content label vectors corresponding to each LIBS spectrum sample for the training process, outputting target component content prediction values output by the EMA-CNN model for each training set LIBS spectrum sample, optimizing EMA-CNN model weight parameters by AdamW algorithm with reference to a weight value of the minimum target component content prediction values and real values, optimizing the training parameters by using the AdamW algorithm, inputting the LIBS spectrum samples of the verification set samples, outputting target component content prediction values output by the EMA-CNN model for the verification set LIBS spectrum samples according to the training process, then optimizing performance of the EMA-CNN model on the verification sets according to the training set LIBS spectrum samples, performing optimal performance prediction values in the training set, performing optimal performance search by using the optimal combination of the optimal combination in a search space, namely, optimizing the training parameters in a multi-dimensional array, and optimizing the training process, and executing exhaustive search, independently starting a complete model training and verification process based on each group of training hyper-parameter combinations, and finally taking the weighted_ MSELoss value on the verification set as a performance judgment criterion, selecting the training hyper-parameter combination which can minimize the weighted_ MSELoss value as an optimal combination, thereby completing EMA-CNN model training.
  10. 10. The method for LIBS inversion based on EMA-CNN and the weighted loss function of claim 2, wherein in step S8, all LIBS spectra in LIBS spectrum data subset Fold P are input into an EMA-CNN model which is subjected to training verification, and a predicted value of the content of a target substance component of a corresponding sample is obtained; the LIBS spectrum data subset Fold P is defined as a test set, and LIBS spectrum of the test set does not participate in the training-verification process of the EMA-CNN model, two sets of evaluation indexes of a prediction Root Mean Square Error (RMSEP) and a decision coefficient (R 2 ) are adopted, quantitative analysis is carried out on quantitative inversion performance of the EMA-CNN model on the test set from two complementary angles of prediction accuracy and fitting goodness, and the performance of the EMA-CNN model in practical application is objectively reflected; After the EMA-CNN model is built and the Weighted mean square error loss function Weighted MSELoss is designed to train and optimize the EMA-CNN model, the EMA-CNN model can be utilized to perform multi-component synchronous inversion on the unknown LIBS spectrum.

Description

LIBS inversion method based on EMA-CNN and weighted loss function Technical Field The invention relates to the technical field of deep learning and spectrum analysis, in particular to a LIBS inversion method based on EMA-CNN and a weighted loss function. The method builds a LIBS spectrum inversion model based on a deep Convolutional Neural Network (CNN), innovatively introduces a high-efficiency multi-scale attention mechanism (EMA), designs a novel weighted mean square error loss function, and can realize multi-component content collaborative prediction. Background The Laser-induced breakdown spectroscopy (Laser-Induced Breakdown Spectroscopy, LIBS) is an atomic emission spectrum detection technology, and by using high-power pulse Laser to irradiate on the surface of a sample, plasma is excited, and the emission spectrum of the sample is obtained by using a spectrometer, so that the composition and the content of the components of the sample are qualitatively analyzed and quantitatively inverted according to the spectrum form and the intensity. The method has the advantages of excellent remote detection capability, detection without pretreatment of samples, easy realization of technology, quick response, micro damage of samples, simultaneous analysis of multiple elements and the like, so that the method is widely applied to industrial detection, environmental monitoring, biomedical treatment, geological investigation and the like. Particularly, the special advantage of remote detection is achieved, so that the LIBS technology is widely used for the field of deep space detection, is successfully applied to multiple Mars detection at present, and is hopeful to be applied to the detection of extraterrestrial celestial bodies such as moon, golden star and wooden star. Based on LIBS spectrum data, people can utilize a chemometric model to identify and classify substances such as soil, rock and the like on the surface of the Mars and quantitatively detect chemical components. Chemometric models can be divided into two main categories, qualitative analysis and quantitative inversion. Qualitative analysis refers to analyzing the element types contained in the measured sample through the wavelength position of the LIBS spectrum characteristic spectral line, quantitative inversion refers to inverting the content of the corresponding element or substance component in the measured sample through the intensity value of the characteristic spectral line, and a mathematical relation model between the two is established. Through LIBS spectrum data inversion, the detected sample substances can be identified and classified, and the component content can be detected. Due to the matrix effect which is common in the spectroscopy measurement technology and the possible self-absorption effect in LIBS spectrum detection, a complex nonlinear relationship is often formed between the LIBS characteristic spectral line intensity value and the content concentration of the corresponding element of the spectral line. In addition, the LIBS spectrum comprises a discrete characteristic spectral line generated by electron energy level transition, and also comprises a continuous background spectrum generated by bremsstrahlung and composite radiation, wherein the existence of the continuous background also brings additional complexity to the characterization of the characteristic spectral line intensity. In addition, the LIBS detection process is also relatively sensitive to conditions such as instrument performance, laser parameters (e.g., light intensity, pulse width, focal spot size), experimental environment (e.g., temperature, gas pressure, gas composition), detection distance, and physicochemical properties of the sample, which results in low stability and repeatability of the LIBS spectrum. The LIBS spectral characteristics described above present a significant challenge to quantitative inversion models. The development of LIBS quantitative inversion method based on data driving goes through the evolution process from simple linear calibration to machine learning to deep learning algorithm. Early LIBS quantitative inversion models were often based on traditional linear algorithms, such as calibration curve methods, partial Least Squares (PLS) algorithms, and the like. In 2013 Wiens et al tried to construct quantitative inversion models for each principal element oxide separately using partial least squares algorithm, trained and optimized separately, and used this as an official quantitative inversion scheme for ChemCam spark LIBS spectra up to 2017 [1]. With the development of machine learning, the strong learning and generalization capability of the artificial neural network is widely accepted, and advanced algorithms represented by a back propagation neural network algorithm (BPNN) and an integrated learning algorithm are used for LIBS quantitative inversion model construction, so that the fitting capability of nonlinear mapping relat