LIBS element quantitative analysis method based on double-branch feature fusion and electronic equipment

The LIBS elemental quantitative analysis method, which combines CNN and MLP branches to extract local and global features and uses the WMA-MLP model for feature fusion, solves the problem that a single network model cannot take into account both local and global spectral features, thus improving the accuracy and robustness of the model. In particular, the automatic parameter tuning through the whale migration optimization algorithm improves the stability and efficiency of the model.

CN121577609AActive Publication Date: 2026-02-27SHANGHAI OCEANHOOD OPTO ELECTRONICS TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202511684707.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-17
Publication Date
2026-02-27
Estimated Expiration
2045-11-17

AI Technical Summary

Technical Problem

In existing LIBS elemental quantitative analysis methods, single-structure network models cannot simultaneously take into account both local and global spectral features, resulting in insufficient information utilization and affecting the accuracy and robustness of the model.

Method used

A dual-branch feature fusion approach is adopted, which extracts local features through the CNN branch and global features through the MLP branch. Adaptive weighted fusion is performed through a gated fusion module, and the global dependency relationship between features is modeled by the WMA-MLP model, outputting the final elemental quantitative analysis results.

Benefits of technology

It achieves collaborative and multi-view modeling of LIBS spectral information, improves the accuracy and robustness of spectral analysis models, solves the gradient decay and performance degradation problems in deep network training, and improves the performance stability and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121577609A_ABST
    Figure CN121577609A_ABST
Patent Text Reader

Abstract

The invention discloses an LIBS (laser-induced breakdown spectroscopy) element quantitative analysis method based on double-branch feature fusion and electronic equipment, and the method comprises the following steps: preprocessing an acquired LIBS spectral signal, including baseline correction and spectrum resampling; inputting the preprocessed spectral signal data into a double-branch feature extraction network, extracting local features through a CNN branch, and extracting global features in parallel through an MLP branch; performing adaptive weighted fusion on the local features and the global features through a gating fusion module to obtain fusion features; the fusion features are input into a WMA-MLP model, and the WMA-MLP model is based on MLP, integrates a multi-head self-attention mechanism and a residual module and is used for modeling a global dependency relationship between the features and outputting a final element quantitative analysis result. Through CNN and MLP branch feature extraction structures which are arranged in parallel, more comprehensive spectral feature representation can be obtained, and the accuracy and robustness of a spectral analysis model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of spectral detection, and particularly relates to a LIBS element quantitative analysis method based on double-branch feature fusion and an electronic device. BACKGROUND

[0002] Laser-Induced Breakdown Spectroscopy (LIBS) technology has been widely used in the quantitative analysis of components in the fields of industry, environment, geology and the like due to its advantages of rapidness, slight damage and no need for complex sample pretreatment. With the development of data science, algorithms based on machine learning, especially deep learning, have become the mainstream technical means for processing LIBS spectral data and establishing high-precision quantitative analysis models.

[0003] In the Chinese patent document with the application publication number CN112051256A, a LIBS measurement method and system for the content of a to-be-measured element based on a CNN model are disclosed, wherein the method comprises: training a pre-set CNN spectral model according to the LIBS spectrum of a liquid sample of an analog solution collected in a configuration, to determine a trained CNN spectral model for quantitative analysis; acquiring a liquid sample of an actual solution as a to-be-measured sample, collecting the LIBS spectrum of the to-be-measured sample, and using the trained CNN spectral model to predict the content of the to-be-measured element in the to-be-measured sample, and outputting the prediction result of the content of the element as a measurement result; the LIBS spectrum of each liquid sample is collected based on two or more spectral feature peaks of the to-be-measured element. The CNN model-based nonlinear regression fitting analysis capability combined with multi-feature peak collection and input can simply and efficiently realize element detection for complex solution field exploration and exploitation. However, the single CNN model uses one-dimensional CNN to process spectral data, and the input is a one-dimensional array obtained by splicing two or more spectral feature peaks of the to-be-measured element, which has the problem of single information extraction perspective, cannot simultaneously consider local and global features of the spectrum, leads to insufficient utilization of spectral information, and further affects the accuracy and robustness of the model.

[0004] In the Chinese patent document with the application publication number CN117235512A, a LIBS-oriented residual learning lightweight convolutional neural network quantification method is disclosed, which includes: collecting laser-induced breakdown spectroscopy original spectrum data of training samples; performing spectrum selection on each original spectrum and taking the mean value of the selected spectrum; establishing and training a residual learning lightweight convolutional neural network model using the selected original spectrum; and using the trained residual learning lightweight convolutional neural network model to perform quantitative analysis on test samples. It improves the signal-to-noise ratio and retains the details of the spectral signal through the residual module for spectral preprocessing. Through the lightweight convolution module for LIBS quantitative analysis, the data preprocessing and quantitative analysis are organically combined together, and the whole is still a single path forward propagation, which is a single CNN perspective. Although the Inception multi-scale convolution is introduced, it still belongs to local feature extraction and cannot take into account the global features, resulting in insufficient utilization of spectral information and affecting the accuracy and robustness of the model.

[0005] From the above disclosed technical solutions, it can be seen that the existing LIBS element quantitative analysis method usually uses a single structure network model. The CNN (convolutional neural network) can effectively extract the local features such as the local shape and width of the spectral peak in the spectrum, and its local perception is not sensitive to the long-range dependence relationship and global correlation between different spectral segments. The single structure network model has the problem of single information extraction perspective, and cannot take into account the local and global features of the spectrum at the same time, resulting in insufficient utilization of spectral information and affecting the accuracy and robustness of the model. SUMMARY

[0006] The purpose of the present application is to provide a LIBS element quantitative analysis method based on double-branch feature fusion and an electronic device, which obtains more comprehensive spectral feature representation and improves the accuracy and robustness of the spectral analysis model.

[0007] To solve the above technical problems, an embodiment of the present application provides a technical solution as follows: a LIBS element quantitative analysis method based on double-branch feature fusion, comprising the following steps: S1: preprocessing the collected LIBS spectral signal, including baseline correction and spectral resampling; S2: inputting the preprocessed spectral signal data into a double-branch feature extraction network, extracting local features through a CNN branch, and extracting global features in parallel through an MLP branch; S3: adaptively weighting and fusing the local features and the global features through a gating fusion module to obtain fused features; and S4: inputting the fused features into a WMA-MLP model, which is based on MLP and integrates a multi-head self-attention mechanism and a residual module, for modeling the global dependence relationship between features, and outputting the final element quantitative analysis result.

[0008] Further, the baseline correction in step S1 employs an adaptive iteratively reweighted penalized least squares method, whose objective function is: ; where y is the original spectral signal, z is the baseline function, D is the difference operator, λ is the smoothing factor, and W is the adaptive weight matrix.

[0009] Further, the spectral resampling in step S1 employs a cubic spline interpolation method, whose interpolation function is: ; where S(x) is the fitting function, a, b, c, d are the fitting coefficients, and x is the coordinate variable.

[0010] Further, the CNN branch in step S2 processes the input spectrum through two parallel convolution paths, with kernel sizes of k=5 and k=11 respectively. Each path sequentially performs convolution, ReLU activation, and adaptive max-pooling operations, and the pooled results of the two paths are concatenated and passed through a fully connected layer to generate the local feature representation f cnn .

[0011] Further, the MLP branch in step S2 contains three fully connected modules with channel dimensions of 512, 256, and 128 respectively. Each module sequentially performs linear transformation, batch normalization, GELU activation function, Dropout regularization, and residual connection, and finally outputs the global feature representation f mlp .

[0012] Further, the gating fusion module in step S3 is implemented by the following method: the gating factor α is generated by a small fully connected network, and the calculation formula is: ; where is the Sigmoid function, and W1, b1, W2, and b2 are learnable parameters; The fused feature is calculated by: where represents the feature vector concatenation operation.

[0013] Further, the WMA-MLP model processes the features through three cascaded fully connected layer-residual module processing units. The features are first non-linearly transformed by the fully connected layer, and then further mapped by the residual module. After the output of the third residual module, an eight-head self-attention mechanism is introduced to dynamically model the global dependency between features, and to perform deep feature extraction and information compression.

[0014] Further, after concatenation and linear mapping of the outputs of each head, the refined feature representation is obtained as Elemental quantitative analysis results The output of a linear regression layer is: ; Where w and b are the weight vector and bias term of the regression layer respectively; the model is trained in the training stage using Huber loss function combined with EarlyStopping, learning rate scheduling and weight decay strategy, and the Huber loss function is defined as: ; Where, is the threshold parameter.

[0015] Further, the key hyperparameters of the WMA-MLP model training are automatically searched globally by the whale migration algorithm, and the hyperparameters include: the number of hidden layer neurons, the Dropout dropout rate, the initial learning rate, the optimizer type, the L2 regularization coefficient, the learning rate decay coefficient, the batch size and the activation function type.

[0016] To solve the above technical problems, the application further provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the LIBS elemental quantitative analysis method based on double-branch feature fusion according to any one of the above embodiments when executing the program.

[0017] The LIBS element quantitative analysis method and electronic equipment based on double-branch feature fusion provided by the application realize collaborative, multi-view modeling of LIBS spectrum information, and compared with the prior art, through the double-branch feature fusion structure of parallel processing, the CNN branch focuses on capturing local features such as local morphology, width and intensity of the spectral peak, and the MLP branch is responsible for modeling the long-distance dependence relationship between spectral segments and the global feature of the global trend, this structure design is more suitable for the physical characteristics of the coexistence of local and global information of LIBS spectrum data, and through feature fusion, a more comprehensive and more discriminative spectrum representation is obtained than a single view, so that the accuracy and robustness of the spectrum analysis model are improved; in order to cope with the challenges of high-dimensional redundant characteristics of spectrum data and unstable training of deep network, the WMA-MLP model integrates a multi-head attention mechanism and a residual module, which are used for deep feature modeling of LIBS quantitative analysis, the multi-head attention mechanism is adaptively focused on the key spectral segment, which effectively relieves the interference of redundant features and improves the model interpretability, the residual module is introduced to ensure the stable training of the deep network, so that the model can more efficiently learn the complex nonlinear mapping relationship, and effectively solve the problems of gradient attenuation and performance degradation of the deep MLP in the training process. Especially, in order to overcome the drawbacks of inefficient and subjective manual parameter adjustment in the traditional method, the WMA (whale migration algorithm) is used to realize automatic global optimization of the model hyperparameters, reduce the dependence on manual operation, and more effectively avoid falling into a local optimal solution through the global intelligent search strategy, so that a performance-optimized and robust quantitative analysis model can be systematically and repeatedly obtained, the modeling efficiency is improved, and the performance stability of the model is improved. BRIEF DESCRIPTION OF DRAWINGS

[0018] One or more embodiments are illustrated by way of example in the accompanying drawings that are not intended to be limiting of the embodiments, in which like references numbers refer to like elements, unless otherwise specified, the drawings are not necessarily to scale, and the illustrations are for purposes of clarity, not intended to limit the scope of the embodiments.

[0019] Figure 1 A flowchart of the LIBS element quantitative analysis method based on double-branch feature fusion in the embodiments of the application is shown. Figure 2 A schematic diagram of the architecture of the LIBS element quantitative analysis method based on double-branch feature fusion in the embodiments of the application is shown. Figure 3 A schematic diagram of the CNN branch structure in the embodiments of the application is shown. Figure 4 A schematic diagram of the MLP branch structure in the embodiments of the application is shown. DETAILED DESCRIPTION

[0020] For the purposes of the present application, the technical solutions and advantages will be more apparent in the following detailed description of the embodiments of the present application. However, those skilled in the art can understand that in the embodiments of the present application, many technical details are presented in order to enable the reader to better understand the present application. However, even without these technical details and based on various changes and modifications of the following embodiments, the technical solutions claimed in the claims of the present application can be implemented.

[0021] In the following detailed description, many specific details are set forth in order to provide a more thorough understanding of the present application. However, it will be apparent to those skilled in the art that well-known algorithms do not show detailed procedures in order to avoid obscuring the main idea of the present application; and the technical terms involved in the following embodiments, such as Huber loss function, EarlyStopping early stopping, learning rate scheduling, weight decay, fish migration algorithm WMA, regularization strength, L2 regularization, ReLU activation, batch normalization, residual connection, etc. are existing technologies that can be retrieved.

[0022] As shown in Figures 1-2 An embodiment of the present application relates to a LIBS element quantitative analysis method based on double-branch feature fusion, comprising the following steps: S1: Preprocessing the collected LIBS spectral signal, including baseline correction and spectral resampling. Among them, the spectral signal is corrected by the adaptive iterative reweighted penalized least squares (airPLS) method, which effectively removes background drift and interference. This method avoids over-smoothing of spectral peaks by dynamically adjusting the weight, thereby retaining the true peak characteristics; and using cubic spline interpolation to resample and fit the spectrum, it weakens high-frequency noise while enhancing the stability of spectral peak position and shape, ensuring the continuity and consistency of the input data.

[0023] S2: Input the preprocessed spectral signal data into a double-branch feature extraction network, extract local features through the CNN branch, and extract global features through the MLP branch in parallel; first, a double-branch feature extraction network structure composed of convolutional neural network CNN and multilayer perceptron MLP is constructed, wherein the CNN branch focuses on local spectral peak pattern recognition, and the MLP branch models global nonlinear interaction, and the two complement each other to improve the feature expression ability.

[0024] S3: The local features and the global features are adaptively weighted and fused through a gating fusion module to obtain fused features; this gating mechanism can assign weights according to feature importance, suppress redundant information and improve discrimination performance.

[0025] S4: input the fusion features into the WMA-MLP model, which is based on MLP, integrates multi-head self-attention mechanism and residual module, is used for modeling global dependency between features, and outputs final element quantitative analysis results. The fusion features are input into the WMA-MLP model, the multi-head self-attention mechanism is embedded in the multi-layer residual structure, so that the gradient can be stably propagated, the global dependency modeling of the key spectral band is enhanced, and the accuracy of regression prediction is improved.

[0026] Through the parallel double-branch feature extraction mechanism, the LIBS spectral data are processed synchronously, one CNN branch focuses on capturing sequence dependency, and the MLP branch emphasizes context correlation, and then the outputs of the two are fused. The parallel architecture design makes the feature extraction process more efficient, can simultaneously mine the potential patterns in the data from multiple dimensions, avoids the time sequence dependency problem of serial processing, thereby improves the robustness and convergence speed of the model to complex spectral signals, and ensures that more comprehensive semantic representation is obtained in element quantitative analysis; the gating mechanism is introduced in the feature fusion stage, the local features extracted by the CNN branch are dynamically selected and weighted, noise interference can be effectively suppressed, and key information can be retained, the fusion strategy enhances the noise resistance of the model, improves the purity and accuracy of the feature representation, and is especially suitable for the background interference scene commonly seen in LIBS data, so that the final quantitative analysis result is more reliable and has stronger generalization performance.

[0027] In the training process of the WMA-MLP model, the Huber loss function can be used to enhance the robustness to noise; the mean square error MSE, the smooth L1 or other arbitrary robust loss function can also be selected, and the present application does not limit this. The convergence stability and generalization ability of the model are further improved by combining EarlyStopping, learning rate scheduling and weight decay strategies. Finally, the whale migration algorithm WMA is used to globally search the key hyperparameters such as network capacity, regularization strength, optimizer and learning rate, so as to obtain the optimal configuration and further improve the prediction performance.

[0028] In one embodiment, the present application relates to a LIBS element quantitative analysis method based on double-branch feature fusion. In order to eliminate or reduce the influence of baseline drift and background interference on feature extraction and modeling accuracy in laser-induced breakdown spectroscopy LIBS signal, the adaptive iteratively reweighted penalized least squares airPLS algorithm is used for baseline correction on the collected spectral signal. The method dynamically adjusts the weight of residual points in each calculation process through iterative optimization, so that the spectral peak region is not over-smoothed, and finally a smooth baseline that can accurately fit the background change is obtained. The objective function can be expressed as: ; where y represents the original spectral signal, z represents the baseline function, D is the difference operator, is the smoothing factor, and W is the adaptive weight matrix. After processing by this method, the baseline and background interference in the spectrum can be effectively removed or reduced, and the spectral peak information closer to the true signal is retained.

[0029] After completing the baseline correction, the spectral signal may still be unstable in spectral peak shape due to uneven distribution of sampling points or instrument noise. To further enhance data quality, the present application uses cubic spline interpolation technology to resample the spectrum. This method constructs a continuous cubic polynomial function within the segmented interval: ; where S is the fitting function, a, b, c, d are the fitting coefficients, and x is the coordinate variable. Ensuring the continuity of the function value and its first and second derivatives at each node, the original spectrum is smoothly fitted and interpolated. This process not only improves the stability of the spectral peak position and shape, but also to some extent weakens the influence of high-frequency noise, making the processed spectrum smoother and more consistent.

[0030] Through the joint preprocessing of airPLS baseline correction and cubic spline interpolation resampling, the spectral peak stability can be enhanced while effectively removing the background interference of the spectral signal, providing high-quality and reliable data input for subsequent deep modeling and feature extraction.

[0031] In one embodiment, a LIBS element quantitative analysis method based on dual-branch feature fusion is involved. In order to fully capture the multi-scale feature information in the spectral data, a dual-branch parallel feature extraction network structure containing convolutional neural network (CNN) and multilayer perceptron (MLP) is used for feature extraction of the preprocessed spectral data. The CNN branch is used for spatial pattern recognition of local spectral peaks, and the MLP branch is used for global nonlinear interaction between spectral segments. Both branches are parallel to feature encoding to improve the expression ability and generalization performance of the model for complex spectral signals.

[0032] As shown in Figure 3 , the CNN branch can focus on modeling the local spatial patterns of element information in the spectrum. These patterns usually exist in the form of sharp peaks and have significant proximity. Through CNN, the modeling ability of spectral peak shape can be enhanced. The CNN branch processes the input spectrum through two parallel convolution paths, with convolution kernel sizes of k=5 and k=11 respectively. Each path performs convolution, ReLU activation and adaptive max-pooling operations in turn, and the pooled results of the two paths are spliced and then passed through a fully connected layer to generate a local feature representation f cnn . Its feature extraction path is as follows: Input spectrum After dimension expansion, they enter two parallel convolution paths, respectively, and feature extraction is performed using convolution kernel sizes k = 5 and k = 11: ; wherein and are the convolution kernel parameters, is the convolution operation, and ReLU is the activation function.

[0033] Adaptive max-pooling is performed on the output of each path: ; wherein t is the wavelength dimension index of the feature map, the max operation selects the maximum value along the dimension, is the feature scalar obtained after pooling, and the pooling results of the two paths are spliced: ; wherein is the vector splicing operation, and P is the local feature vector fused with the multi-scale information of the double-path.

[0034] The local feature representation is generated through a fully connected layer: ; wherein V and c are the weights and biases of the fully connected layer, and GELU is the activation function. is the generated 128-dimensional local feature representation, which is the output of the CNN branch.

[0035] As shown in Figure 4 , the MLP branch models the nonlinear interaction relationship between the global spectral bands in the spectrum by stacking multiple layers of nonlinear transformation structures. The MLP branch structure includes three fully connected modules with channel dimensions of 512, 256, and 128, respectively. Each module is composed of linear transformation, batch normalization, GELU activation function, Dropout regularization, and residual connection, and finally outputs the global feature representation f mlp . Its global feature extraction path is as follows: The input feature is linearly transformed: ; wherein and are the weight matrix and bias vector of the layer, respectively. The transformed result is batch normalized: ; wherein BN represents the batch normalization operation. The normalized feature is activated by GELU and subjected to Dropout: ; Residual connection generates the input of the next layer: ; Input As initial features , global feature representation is output after three-layer mapping .

[0036] The MLP branch has stable gradient propagation ability and efficient nonlinear expression ability, which enhances the model generalization performance while maintaining feature integrity, providing global feature support for the WMA-MLP model.

[0037] In one embodiment, a LIBS element quantitative analysis method based on double-branch feature fusion is involved. In order to fuse the local features extracted by CNN and the global features extracted by MLP branch, a gating fusion module is introduced to realize adaptive weighted fusion control, so as to obtain fusion features . Its fusion control path is as follows: Gating factor Generated by a small fully connected network: ; Where is a Sigmoid function, W1, b1, W2 and b2 are learnable parameters. Control the contribution of local features in fusion.

[0038] The final fusion feature expression is: ; Where represents the vector splicing operation. is the fused feature vector, which has a dimension of 256. This gating mechanism can suppress redundant information according to feature importance, and improve the discriminability of the fused feature and the modeling effect.

[0039] In one embodiment, a LIBS element quantitative analysis method based on double-branch feature fusion is involved. It includes a double-branch feature extraction structure of convolutional neural network and multilayer perceptron arranged in parallel. Both of them encode features from two aspects of local spectral peak spatial pattern recognition and global nonlinear interaction between spectral bands, in order to improve the expression ability and generalization performance of the model to complex spectral signals. Among them, the CNN branch is used to extract local features, and the MLP branch is used to extract global features. Through the gating mechanism of the gating fusion module, adaptive weighted fusion of local features and global features is realized, and 256-dimensional fusion features are obtained. The 256-dimensional fusion feature vector As the input of the intermediate representation, the WMA-MLP model is processed by three cascaded "fully connected layer-residual module" processing units, which gradually complete the deep refinement and information compression of features, and perform the final element content regression prediction task. The dimension of the fully connected layer and the type of the activation function in each processing unit are the key optimization parameters of the WMA algorithm. In view of the high-dimensional nonlinear characteristics of spectral data and the risk of gradient degradation in deep network training, the WMA-MLP model is based on the multi-layer perception MLP, integrates the residual module and the multi-head self-attention mechanism, and improves the feature extraction efficiency and the key spectral response capability.

[0040] The introduction of residual connection not only effectively alleviates the gradient vanishing problem in deep network, but also greatly accelerates the model convergence process due to its allowing to build more concise and efficient data path, and simultaneously improves the network lightweight and training efficiency from the structural level.

[0041] In one example, the forward propagation process of the i-th processing unit is as follows: First, the feature completes nonlinear transformation through the fully connected layer: ; wherein, is the output of the fully connected layer of the i-th processing unit, i and b i are the weight and bias parameters of the layer, is the activation function, is the output feature of the previous unit.

[0042] Subsequently, the feature enters the residual module for further mapping: ; wherein, is the final output of the residual module, and are the weights and biases of the residual module, BN represents the batch normalization operation, and Dropout is the random dropout regularization.

[0043] After the output of the third residual module, the network introduces an 8-head self-attention mechanism to dynamically model the global dependency relationship between features. The mechanism first linearly transforms the input feature into query, key and value vectors: ; wherein, Q, k, v are query, key and value matrices, W Q , W K , W V are the corresponding learnable projection matrices.

[0044] The attention weight matrix is calculated by scaled dot-product to enhance the model's perception of key spectral intervals: ; where A is the attention weight matrix, is the dimension of the key vector, is the scaling factor.

[0045] After splicing and linear mapping of each head output, the refined feature representation is obtained as , and finally, the element content prediction result is output by a linear regression layer: ; where w and b are the weight vector and bias term of the regression layer, respectively. The Huber loss function is used in the model training stage, which is defined as follows: ; where is the threshold parameter. This loss function combines the smoothness of mean square error and the robustness of absolute error, and is suitable for noisy spectral data.

[0046] The model performs dimension compression and deep feature extraction on the fused features through multiple nonlinear mappings. Each layer contains linear transformation, batch normalization and residual connection, aiming to improve the model's expression ability and alleviate the gradient vanishing problem. The activation function can be ReLU, GELU, Tanh or other nonlinear functions, which are not limited by the present application. The specific type of activation function is automatically selected and optimized by the whale migration optimization algorithm in a pre-set candidate set during the subsequent training process, to adapt to different spectral features and model structures.

[0047] Various strategies are used in the training process to improve the model's stability and generalization ability. Regularization is mainly achieved through L2 weight decay to suppress model overfitting. Through the EarlyStopping mechanism, it is dynamically determined whether to terminate training early according to the validation set indicators, to avoid invalid iterations. The learning rate scheduler automatically adjusts the learning rate based on the validation performance, balancing training speed and convergence quality. The training process supports multiple optimizers such as Adam, SGD, RMSprop and activation functions such as ReLU, GELU, Tanh as hyperparameters for selection, to adapt to different features and model structures. The training key hyperparameters and strategy configurations are all treated as optimization variables, and are searched jointly by the whale migration algorithm WMA, to achieve the optimal balance between performance and efficiency.

[0048] In one embodiment, a LIBS element-wise quantitative analysis method based on bi-branch feature fusion is involved, which uses the Whale Migration Algorithm (WMA) to automatically and globally optimize key hyperparameters of the WMA-MLP model. This algorithm possesses good global search capabilities and adaptability to complex parameter spaces, effectively improving model performance and parameter tuning efficiency. WMA jointly optimizes eight categories of key hyperparameters, covering network structure, regularization, optimization strategies, and training configuration. The optimization names and search ranges of each parameter are shown in Table 1, which outlines the hyperparameter optimization space and value ranges.

[0049] Table 1. Hyperparameter optimization space and value range

[0050] WMA simulates the collaborative optimization behavior of humpback whale groups during migration, achieving an effective balance between exploration and exploitation by distinguishing between leader and subordinate individuals. Within a defined search space, a randomized size of [size missing] is generated. The population. During the fitness evaluation phase, the prediction error of the model on the validation set is used as the objective function. A smaller value indicates a better solution quality. Subordinate individuals learn the average position of the group. Compared with the best historical individual The difference in position is used to update its own position, and its typical update model can be expressed as: ; in, Indicates that the i-th individual is in The position of the generation, For Hadamard product, Let be a D-dimensional random perturbation vector. This mechanism enables the algorithm to possess excellent global optimization capabilities and convergence stability in high-dimensional mixed parameter spaces, thereby providing an optimal combination for model structure configuration and training strategies, and effectively improving the model's adaptability under different data distributions.

[0051] To verify the effectiveness of the LIBS elemental quantitative analysis method based on dual-branch feature fusion provided in this invention, an example was conducted to predict the carbon content in coal samples using LIBS spectra as the input spectral signal. This example employed five-fold cross-validation for performance evaluation on an experimental dataset. Evaluation metrics included the coefficient of determination (R²), root mean square error (RMSE), mean square error (MSE), and mean absolute error (MAE). The experimental results are shown in Table 2, representing the five-fold cross-validation results.

[0052] Table 2 Results of Five-Fold Cross-Validation

[0053] The embodiment results show that the R² of all folds is above 0.99, indicating that the model can stably capture the nonlinear relationship between the spectrum and the carbon content, the prediction result is highly consistent with the true value, and the fitting accuracy is high; the error level is low: the RMSE is always less than 0.15, and the MAE is less than 0.12, indicating that the model prediction error is small, and it has application feasibility; the stability is strong: the R² difference in the five-fold cross-validation results is small, and the maximum difference between R² is less than 0.006, indicating that the model can maintain excellent performance under different data division and has good generalization ability; in the fourth fold, the RMSE reaches 0.1494, and the coefficient of determination R² still remains 0.9915, which reflects the stability of the model when facing data noise and sample difference, and the robustness performance is excellent.

[0054] In one embodiment, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the LIBS element quantitative analysis method based on double-branch feature fusion according to any one of the preceding embodiments when executing the program.

[0055] The LIBS element quantitative analysis method based on double-branch feature fusion provided in the embodiment of the application realizes collaborative and multi-view modeling of LIBS spectral information. Compared with the LIBS element quantitative analysis method using a single network structure such as a simple CNN or MLP modeling, through the parallel processing of the double-branch feature fusion structure, the CNN branch focuses on capturing local features such as the local morphology, width, and intensity of the spectral peak, and the MLP branch is responsible for modeling the long-distance dependence relationship between the spectral segments and the global features of the global trend. This structure design is more in line with the physical characteristics of the coexistence of local and global information of the LIBS spectral data. Through feature fusion, a more comprehensive and more discriminative spectral representation is obtained than a single view, which improves the accuracy and robustness of the spectral analysis model. In order to cope with the challenges of high-dimensional redundant characteristics of spectral data and unstable training of deep networks, the WMA-MLP model integrates a multi-head attention mechanism and a residual module for deep feature modeling of LIBS quantitative analysis. Through the multi-head attention mechanism, the key spectral segments are adaptively focused, effectively reducing the interference of redundant features and improving the model interpretability. By introducing the residual module, the stable training of the deep network is ensured, so that the model can more efficiently learn the complex nonlinear mapping relationship, effectively solving the problems of gradient attenuation and performance degradation of the deep MLP in the training process. In particular, in order to overcome the drawbacks of inefficient and subjective manual parameter tuning in traditional methods, the whale migration optimization algorithm WMA is used to realize the automatic global optimization of the model hyperparameters, reducing the dependence on manual work. Moreover, through the global intelligent search strategy, the model can effectively avoid falling into a local optimal solution, so that a performance-optimized and robust quantitative analysis model can be systematically and repeatedly obtained, improving the modeling efficiency and the performance stability of the model.

[0056] While the application has been described by way of example with reference to preferred embodiments, it is to be understood that this application is not limited to the embodiments described above, but intent and purview of the application and modifications as are obvious within this purview are to be included.

Claims

1. A LIBS elemental quantitative analysis method based on dual-branch feature fusion, characterized in that, Includes the following steps: S1: Preprocess the acquired LIBS spectral signal, including baseline correction and spectral resampling; S2: Input the preprocessed spectral signal data into a dual-branch feature extraction network, extract local features through the CNN branch, and extract global features in parallel through the MLP branch; S3: The local features and the global features are adaptively weighted and fused using a gated fusion module to obtain fused features; S4: Input the fused features into the WMA-MLP model. The WMA-MLP model is based on MLP and integrates a multi-head self-attention mechanism and a residual module to model the global dependencies between features and output the final elemental quantitative analysis results.

2. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 1, characterized in that, The baseline correction in step S1 employs an adaptive iterative reweighted penalized least squares method, with the objective function being: ; Where y is the original spectral signal, z is the baseline function, D is the difference operator, λ is the smoothing factor, and W is the adaptive weight matrix.

3. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 1, characterized in that, The spectral resampling in step S1 employs cubic spline interpolation, and its interpolation function is: ; Among them, S Let x be the fitting function, a, b, c, and d be the fitting coefficients, and x be the coordinate variable.

4. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 1, characterized in that, In step S2, the CNN branch processes the input spectrum through two parallel convolutional paths with kernel sizes of k=5 and k=11. Each path sequentially performs convolution, ReLU activation, and adaptive max pooling operations. The pooling results from the two paths are then concatenated and passed through a fully connected layer to generate a local feature representation f. cnn .

5. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 4, characterized in that, The MLP branch in step S2 contains three fully connected layers with channel dimensions of 512, 256, and 128 respectively. Each layer sequentially performs linear transformation, batch normalization, GELU activation function, Dropout regularization, and residual connection, ultimately outputting the global feature representation f. mlp .

6. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 5, characterized in that, The gated fusion module in step S3 is implemented as follows: the gate factor α is generated by a small fully connected network, and the calculation formula is: ; in, For the Sigmoid function, , , and These are learnable parameters; Fusion features Calculated using the following formula: ,in This indicates the feature vector concatenation operation.

7. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 1, characterized in that, The WMA-MLP model uses three cascaded fully connected layers and residual module processing units. Features undergo nonlinear transformation through the fully connected layers, and then the features are further mapped in the residual module. After the output of the third residual module, an eight-head self-attention mechanism is introduced to dynamically model the global dependencies between features, and to perform in-depth feature extraction and information compression.

8. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 7, characterized in that, After concatenation and linear mapping of the outputs from each head, the refined feature representation is obtained as follows: Elemental quantitative analysis results Output through a linear regression layer: ; in, and These are the weight vector and bias term of the regression layer, respectively; The model employs the Huber loss function during the training phase, combined with EarlyStopping, learning rate scheduling, and weight decay strategies. The Huber loss function is defined as follows: ; in, This is the threshold parameter.

9. The LIBS elemental quantitative analysis method based on dual-branch feature fusion according to claim 8, characterized in that, The key hyperparameters for training the WMA-MLP model are automatically searched globally using the whale migration algorithm. These hyperparameters include: number of hidden layer neurons, Dropout rate, initial learning rate, optimizer type, L2 regularization coefficient, learning rate decay coefficient, batch size, and activation function type.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the LIBS element quantitative analysis method based on dual-branch feature fusion as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • To-be-measured element content LIBS measurement method and system based on CNN model

    CN112051256A

  • LIBS-oriented residual learning lightweight convolutional neural network quantification method

    CN117235512A

  • Multi-element quantitative analysis method and system based on laser-induced breakdown spectroscopy

    CN119691407A

  • Microscopic hyperspectral image segmentation method based on multi-scale attention fusion

    CN119810116A

  • Spectral element quantitative analysis method based on multivariate feature dynamic extraction

    CN119884646A