Laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18
By converting one-dimensional spectral data into two-dimensional data matrix and training using the bidirectional ResNet18 model, the quantitative analysis accuracy problem of matrix effect on laser induced breakdown spectroscopy technology is solved, and high-precision chemical element detection is achieved.
Patent Information
- Application Number
- CN202510610127.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-08-15
AI Technical Summary
When facing matrix effects, the existing laser induced breakdown spectroscopy technology has insufficient quantitative analysis results, making it difficult to effectively reduce the interference of chemical substances and physical states on the analytical signals.
The one-dimensional spectral data is converted into a two-dimensional data matrix and trained and predicted through a bidirectional ResNet18 model. The data rolling method and optimization algorithm Adam are used, combining bidirectional convolutional blocks and jump connections to enhance the model's local and global feature perception capabilities.
It effectively reduces the influence of matrix effects and realizes high-precision quantitative detection of chemical elements.
Smart Images

Figure CN120490059A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of laser induced breakdown spectroscopy, and in particular relates to a laser induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18. Background Art
[0002] Laser-Induced Breakdown Spectroscopy (LIBS) uses ultrashort laser pulses to focus on the sample surface to form a plasma. The plasma's emission spectrum is then analyzed to determine the sample's material composition and content. LIBS is primarily used for qualitative and quantitative analysis of chemical elements. Its basic principle is to focus a high-energy laser pulse on the sample surface to generate a high-temperature plasma. Following the laser pulse's cessation, the high-energy ions and atoms in the plasma transition to a lower-energy state and emit radiation with a specific energy. This radiation carries distinct elemental signatures. Light of specific wavelengths is then collected and sent to the spectrometer for analysis. Because the wavelengths of ion and atomic spectra individually correspond to specific elements and have a certain quantitative relationship, the elemental composition and content of the sample can be determined based on the wavelength and intensity of the emission lines.
[0003] LIBS has the advantages of simple sample preparation, low sample loss, high detection efficiency, and the ability to achieve online detection. It has been widely used in clinical medicine, archaeology, industry and other fields. However, current LIBS-based detection equipment has important constraints such as matrix effects. Matrix effects generally refer to the interference of other chemical substances in the sample or the physical state of the sample on the analytical signal, which can be divided into chemical matrix effects and physical matrix effects. Specifically, the physical properties of the sample, such as the surface roughness, density or water content of different samples, will affect the excitation efficiency of the laser; and other components in the sample, such as organic matter or metal ions, may interfere with the signal of the target element and introduce errors. These matrix effects make the relationship between the element's spectral intensity and actual concentration complex and highly nonlinear, making it difficult to accurately model using traditional methods. As a result, most LIBS based on specific spectral line intensity for quantitative analysis often have inaccurate and unreliable quantitative analysis results when studying samples with significant matrix effects. Summary of the Invention
[0004] The purpose of the present invention is to provide a quantitative detection method of laser induced breakdown spectroscopy based on data rolling bidirectional ResNet18 to solve the above-mentioned technical problems.
[0005] To address the above technical issues, the present invention proposes a quantitative detection method for laser-induced breakdown spectroscopy based on a data-rolling bidirectional ResNet18. By converting one-dimensional spectral data into a two-dimensional data matrix using a data-rolling method, and then training and predicting it using a bidirectional ResNet18 model, the impact of matrix effects is reduced, achieving high-precision quantitative detection. The specific technical solution is as follows:
[0006] A quantitative detection method for laser-induced breakdown spectroscopy based on data rolling bidirectional ResNet18 includes the following steps:
[0007] Step 1: Obtain spectral data on different samples as training data and prediction data;
[0008] Step 2: Perform ICP-OES detection on the sample to obtain the label of the training data;
[0009] Step 3: Convert the acquired one-dimensional spectral data into a two-dimensional data matrix through the data rolling method;
[0010] Step 4: Put the converted two-dimensional data matrix into the bidirectional ResNet18 model for training;
[0011] Step 5: Use the new prediction data to obtain highly accurate chemical element prediction results.
[0012] Furthermore, the step 1 includes the following steps:
[0013] Multiple spectral data are acquired on the same sample and averaged.
[0014] Furthermore, in step 3, there are three data scrolling methods available, including data scrolling V1, data scrolling V2, and data scrolling V3. You can choose any one of these data scrolling methods. These data scrolling methods use the original one-dimensional spectral data as the first row of the two-dimensional data matrix, move the first data feature of the first row of data to the end as the second row of the two-dimensional data matrix, move the first two data features of the first row of data to the end as the third row of the two-dimensional data matrix, and so on, until all feature data are moved to the end. The algorithm formula is as follows:
[0015] X i =i-1
[0016] Among them, Xi represents the number of features to which the i-th row of data is moved.
[0017] Furthermore, in the data rolling V1 method, the data features that are moved to the end of each row are arranged in a forward direction;
[0018] In the data scrolling V2 method, the data features that are moved to the end of each row are arranged in reverse order; in the data scrolling V3 method, the data features that are moved to the end of each row are sorted alternately in positive and reverse order.
[0019] Furthermore, the bidirectional ResNet18 model in step 4 adopts the optimization algorithm Adam, whose formula is as follows:
[0020]
[0021] Among them, θ t+1 represents the parameter value of the next iteration, θ t Represents the parameter value of the current iteration, α represents the learning rate, m_hat represents the first-order moment estimate, v_hat represents the second-order moment estimate, ε is a small positive number for numerical stability, and t represents the current number of iterations.
[0022] Furthermore, the bidirectional ResNet18 model in step 4 uses ResNet as the network core. This structure enables the network to learn the residual, i.e., F(x). The algorithm formula is:
[0023] F(x)=x+F(x)
[0024] Among them, x represents an input feature map received by the residual block. The first convolutional layer applies a convolution operation on the input x, and the second convolutional layer applies the convolution operation again. ResNet uses a skip connection to add the input x to the output of the previous convolutional layer, that is, the output is x+F(x), where F(x) represents the output of the previous convolutional layer.
[0025] Furthermore, the evaluation index correlation coefficient R, loss function mean square error loss function RMSE, mean absolute error MAE and residual prediction deviation RPD of the bidirectional ResNet18 model in step 4 are as follows:
[0026]
[0027] Among them, n represents the number of samples, y i represents the true target value, Represents the predicted value of the model.
[0028] Furthermore, the network structure of the bidirectional ResNet18 model in step 4 includes Layer 0, Layer 1, Layer 2, Layer 3, Layer 4, an adaptive global average pooling layer, a flattening layer, and a fully connected layer;
[0029] The Layer0 includes a bidirectional convolution block, a batch normalization layer, a RELU function, and a maximum pooling layer with an input channel of 1 and an output channel of 64;
[0030] The bidirectional convolution block includes a forward convolution layer and a backward convolution layer. When a feature is input, it passes through the forward convolution layer to generate a forward feature. The feature is flipped along the height and width directions and then passes through the backward convolution layer to generate a backward feature. The forward feature and the flipped backward feature are added as the output of the bidirectional convolution block.
[0031] Layer 1 includes a bidirectional convolution block, a batch normalization layer, and a RELU function, with 64 input and output channels.
[0032] The Layer2, Layer3, and Layer4 maintain the same structural design as ResNet18;
[0033] The fully connected layer has an input feature number of 512 and an output feature number of 1 to adapt to quantitative detection tasks.
[0034] The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 of the present invention has the following advantages:
[0035] Data rolling (V1) expands the local receptive field of the convolution kernel, achieves limited interaction between adjacent feature points, and promotes the first interaction between the initial and final feature points in the sequence.
[0036] The data matrix generated by data scrolling (V2) retains the staggered ordering of data scrolling (V1) in the upper left corner, while the lower right corner contains the original spectral data in reverse order. Extensive data interaction occurs at the diagonal boundary between these two regions, so that the data features at the end interact with every feature.
[0037] The data matrix generated by data rolling (V3) similarly maintains the upper left region unchanged. In the lower right region, a combination of forward / reverse ordering and staggered shifting ensures that each convolution operation involves at most all non-repeating features, achieving true global data interaction. The combination of the upper left and lower right regions forms a bimodal data pattern that includes both local and global spectral features.
[0038] The three data rolling methods proposed in the present invention can effectively improve the local receptive field of the model, enhance the data interaction between the various spectral data features, and effectively reduce the influence of the matrix effect.
[0039] The bidirectional ResNet18 model introduces bidirectional convolution blocks based on the ResNet18 model. In addition to retaining the original advantages of the ResNet model, it also enhances the global feature perception capability, allowing the model to adapt to the complex data patterns brought by data rolling (V3) and achieve better quantitative detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a flow chart of a method in an embodiment of the present invention.
[0041] Figure 2 is a diagram of three data scrolling methods.
[0042] Figure 3 It is a structural diagram of the bidirectional ResNet18 model. DETAILED DESCRIPTION
[0043] In order to better understand the purpose, structure and function of the present invention, the following is a further detailed description of the quantitative detection method of laser-induced breakdown spectroscopy based on data rolling bidirectional ResNet18 in conjunction with the accompanying drawings.
[0044] like Figure 1 As shown, the quantitative detection method of laser-induced breakdown spectroscopy based on data rolling bidirectional ResNet18 of the present invention includes the following steps:
[0045] Step 1: Obtain spectral data on different samples as training data and prediction data;
[0046] The purpose of acquiring spectral data on different samples is to provide sufficient learning samples for the model. Considering the fluctuations between samples, a single spectral data cannot accurately represent the chemical element reference value information of the sample. Therefore, multiple spectral data need to be acquired on the same sample and averaged.
[0047] Step 2: Perform ICP-OES detection on the sample to obtain the label of the training data;
[0048] Step 3: Convert the acquired one-dimensional spectral data into a two-dimensional data matrix through the data rolling method;
[0049] In step 3, there are three data scrolling methods available: Figure 2 As shown, there are three methods, namely data rolling (V1), data rolling (V2), and data rolling (V3). You can select any one of them. These data rolling methods take the original one-dimensional spectral data as the first row of the two-dimensional data matrix, move the first data feature of the first row of data to the end as the second row of the two-dimensional data matrix, move the first two data features of the first row of data to the end as the third row of the two-dimensional data matrix, and so on, until all feature data are moved to the end. The algorithm formula is as follows:
[0050] X i =i-1
[0051] Among them, X i Indicates the number of features to which the i-th row of data is moved.
[0052] In the data scrolling (V1) method, the data features moved to the end of each row are arranged in a forward direction.
[0053] In the data scrolling (V2) method, the data features moved to the end of each row are arranged in reverse order.
[0054] In the data rolling (V3) method, the data features moved to the end of each row are sorted alternately in positive and negative order.
[0055] Step 4: Put the converted two-dimensional data matrix into the bidirectional ResNet18 model for training;
[0056] The bidirectional ResNet18 model uses the optimization algorithm Adam, whose formula is as follows:
[0057]
[0058] Among them, θ t+1 represents the parameter value of the next iteration, θ t Represents the parameter value of the current iteration, α represents the learning rate, m_hat represents the first-order moment estimate, v_hat represents the second-order moment estimate, ε is a small positive number used for numerical stability (to avoid division by zero errors), and t represents the current iteration number.
[0059] The bidirectional ResNet18 model uses ResNet as the network core. This structure enables the network to learn the residual (i.e., F(x)), making it easier to train very deep networks because it allows gradients to propagate back to earlier layers more easily, avoiding the gradient vanishing problem and thus better mining the information of LIBS spectral lines. The algorithm formula is:
[0060] F(x)=x+F(x)
[0061] Here, x represents an input feature map received by the residual block. The first convolutional layer applies a convolution operation on the input x, and the second convolutional layer applies the convolution operation again, usually with different parameters from the first convolutional layer. In particular, ResNet uses skip connections to add the input x to the output of the previous convolutional layer, that is, the output is x + F(x), where F(x) represents the output of the previous convolutional layer.
[0062] The evaluation indicators of the bidirectional ResNet18 model, correlation coefficient R, loss function mean square error loss function RMSE, mean absolute error MAE and residual prediction deviation RPD, are as follows:
[0063]
[0064]
[0065] Among them, n represents the number of samples, y i represents the true target value, Represents the predicted value of the model.
[0066] like Figure 3 As shown in the figure, the network structure of the bidirectional ResNet18 model includes Layer 0, Layer 1, Layer 2, Layer 3, Layer 4, adaptive global average pooling layer, flattening layer and fully connected layer.
[0067] The Layer0 includes a bidirectional convolution block, a batch normalization layer, a RELU function, and a maximum pooling layer with an input channel of 1 and an output channel of 64.
[0068] The bidirectional convolutional block consists of a forward convolutional layer and a backward convolutional layer. After a feature input, it passes through the forward convolutional layer to generate a forward feature. The feature is flipped along the height and width directions and then passed through the backward convolutional layer to generate a backward feature. The forward feature and the flipped backward feature are added together to form the output of the bidirectional convolutional block.
[0069] The Layer 1 includes a bidirectional convolution block, a batch normalization layer, and a RELU function, and both the input channel and the output channel are 64.
[0070] The Layer2, Layer3, and Layer4 maintain the same structural design as ResNet18.
[0071] The fully connected layer has an input feature number of 512 and an output feature number of 1 to adapt to quantitative detection tasks.
[0072] Step 5: Use the new prediction data to obtain highly accurate chemical element prediction results.
[0073] In this example, rice leaves were used as experimental subjects, with cadmium as the target element. Sixty spectral data points were collected from a 2 x 15 mm rectangular area of a single rice leaf sample and averaged. A total of 288 spectral data points were obtained from rice leaf samples with varying degrees of cadmium contamination, and chemical reference values corresponding to the samples were determined using ICP-OES. These samples were divided into a training set and a test set in a 7:2 ratio.
[0074] In the present invention, each spectral data contains 1024 data features, and the spectral range is 211-231 nm. The data rolling (V3) method is used as the conversion method, and the data matrix with a size of 1024×1024 is finally generated.
[0075] In the example of the present invention, the network structure of the bidirectional ResNet18 model includes Layer0, Layer1, Layer2, Layer3, Layer4, adaptive global average pooling layer, flattening layer and fully connected layer.
[0076] The Layer0 includes a bidirectional convolution block, a batch normalization layer, a RELU function, and a maximum pooling layer with an input channel of 1 and an output channel of 64.
[0077] The bidirectional convolutional block consists of a forward convolutional layer and a backward convolutional layer. After a feature input, it passes through the forward convolutional layer to generate a forward feature. The feature is flipped along the height and width directions and then passed through the backward convolutional layer to generate a backward feature. The forward feature and the flipped backward feature are added together to form the output of the bidirectional convolutional block.
[0078] The Layer 1 includes a bidirectional convolution block, a batch normalization layer, and a RELU function, and both the input channel and the output channel are 64.
[0079] The Layer2, Layer3, and Layer4 maintain the same structural design as ResNet18.
[0080] The fully connected layer has an input feature number of 512 and an output feature number of 1 to adapt to quantitative detection tasks.
[0081] To test the prediction performance of the combination of the data rolling method and the model, the classic machine learning method and the combination of different data rolling methods and deep learning models proposed in this invention were used. Table 1 shows the prediction results of each model.
[0082] Table 1. Prediction results of representative models
[0083]
[0084] It will be understood that the present invention is described by way of some embodiments, and it will be appreciated by those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are intended to be protected by the present invention.
Claims
1. A quantitative detection method for laser-induced breakdown spectroscopy based on data rolling bidirectional ResNet18, characterized in that: The steps include: Step 1: Obtain spectral data on different samples as training data and prediction data; Step 2: Perform ICP-OES detection on the sample to obtain the label of the training data; Step 3: Convert the acquired one-dimensional spectral data into a two-dimensional data matrix through the data rolling method; Step 4: Put the converted two-dimensional data matrix into the bidirectional ResNet18 model for training; Step 5: Use the new prediction data to obtain highly accurate chemical element prediction results.
2. The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 according to claim 1 is characterized in that: The step 1 comprises the following steps: Multiple spectral data are acquired on the same sample and averaged.
3. The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 according to claim 1 is characterized in that: In step 3, there are three data scrolling methods available, including data scrolling V1, data scrolling V2, and data scrolling V3. You can choose any one of these data scrolling methods. These data scrolling methods use the original one-dimensional spectral data as the first row of the two-dimensional data matrix, move the first data feature of the first row of data to the end as the second row of the two-dimensional data matrix, move the first two data features of the first row of data to the end as the third row of the two-dimensional data matrix, and so on, until all feature data are moved to the end. The algorithm formula is as follows: X i =i-1 Among them, Xi represents the number of features to which the i-th row of data is moved.
4. The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 according to claim 3 is characterized in that: In the data rolling V1 method, the data features that are moved to the end of each row are arranged in a forward direction; In the data scrolling V2 method, the data features that are moved to the end of each row are arranged in reverse order; in the data scrolling V3 method, the data features that are moved to the end of each row are sorted alternately in positive and reverse order.
5. The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 according to claim 1 is characterized in that: The bidirectional ResNet18 model in step 4 uses the optimization algorithm Adam, and its formula is as follows: Among them, θ t+1 represents the parameter value of the next iteration, θ t Represents the parameter value of the current iteration, α represents the learning rate, m_hat represents the first-order moment estimate, v_hat represents the second-order moment estimate, ε is a small positive number for numerical stability, and t represents the current number of iterations.
6. The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 according to claim 1 is characterized in that: The bidirectional ResNet18 model in step 4 uses ResNet as the network core. This structure enables the network to learn the residual, i.e., F(x). Its algorithm formula is: F(x)=x+F(x) Among them, x represents an input feature map received by the residual block. The first convolutional layer applies a convolution operation on the input x, and the second convolutional layer applies the convolution operation again. ResNet uses a skip connection to add the input x to the output of the previous convolutional layer, that is, the output is x+F(x), where F(x) represents the output of the previous convolutional layer.
7. The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 according to claim 1 is characterized in that: The evaluation index correlation coefficient R, loss function mean square error loss function RMSE, mean absolute error MAE and residual prediction deviation RPD of the bidirectional ResNet18 model in step 4 are as follows: Among them, n represents the number of samples, y i represents the true target value, Represents the predicted value of the model.
8. The laser-induced breakdown spectroscopy quantitative detection method based on data rolling bidirectional ResNet18 according to claim 1 is characterized in that: The network structure of the bidirectional ResNet18 model in step 4 includes Layer 0, Layer 1, Layer 2, Layer 3, Layer 4, an adaptive global average pooling layer, a flattening layer, and a fully connected layer; The Layer0 includes a bidirectional convolution block, a batch normalization layer, a RELU function, and a maximum pooling layer with an input channel of 1 and an output channel of 64; The bidirectional convolution block includes a forward convolution layer and a backward convolution layer. When the feature is input, it passes through the forward convolution layer to generate a forward feature. The feature is flipped along the height and width directions and then passes through the backward convolution layer to generate a backward feature. The forward feature and the flipped backward feature are added as the output of the bidirectional convolution block. Layer 1 includes a bidirectional convolution block, a batch normalization layer, and a RELU function, with 64 input and output channels. The Layer2, Layer3, and Layer4 maintain the same structural design as ResNet18; The fully connected layer has an input feature number of 512 and an output feature number of 1 to adapt to quantitative detection tasks.