An intelligent spectral quantitative analysis method based on convolutional neural network visualization
Through the visualization method of convolutional neural networks, a contribution heat map of spectral data is generated, which solves the problem that traditional spectral analysis methods cannot quantify the contribution of characteristic peaks and realizes quantitative evaluation and accurate classification of spectral data.
Patent Information
- Application Number
- CN202211282175.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-19
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-10-19
AI Technical Summary
Traditional deep learning-based spectral intelligent analysis methods lack quantitative evaluation and cannot objectively quantify the contribution of each characteristic peak in spectral data to the distinction between different types of samples.
A visualization method based on convolutional neural networks is adopted. The feature vector of the classification result is obtained through a one-dimensional convolutional neural network. The gradient weighted class mapping method is used to generate a contribution heat map to quantify the contribution of each characteristic peak to the classification result. The contribution weight of the characteristic peak is determined by the half-height width range.
It achieves objective quantitative evaluation of spectral data, quantifies the contribution of each characteristic peak to the classification results, can accurately identify different types of targets, discover key characteristic markers, and improve the accuracy of classification and identification.
Smart Images

Figure CN115586152B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of spectral quantitative analysis, and in particular to an intelligent spectral quantitative analysis method based on convolutional neural network visualization. Background Art
[0002] Spectroscopic analysis is a method of identifying substances and determining their chemical composition and relative content based on their spectra. It is an analytical method based on molecular and atomic spectroscopy. This method has been widely used in many fields such as chemical engineering, medicine, biochemistry, and environmental protection. This method is characterized by simple operation, rapidity, high sensitivity, good precision and accuracy, and a wide effective linear range and a relatively low detection limit.
[0003] Traditional deep learning-based spectral intelligent analysis methods lack quantitative evaluation and can only determine whether spectral peaks are statistically significant in different categories of samples, but cannot provide the quantitative contribution of each Raman peak to the distinction between different types of samples. Summary of the Invention
[0004] The present invention provides an intelligent spectral quantitative analysis method based on convolutional neural network visualization, which solves the problem that current spectral intelligent analysis methods lack objective quantitative evaluation and cannot objectively quantify the contribution of each characteristic peak in spectral data to distinguishing different types of samples.
[0005] An intelligent spectral quantitative analysis method based on convolutional neural network visualization includes the following steps:
[0006] S1: Obtain a contribution heat map. Use a one-dimensional convolutional neural network to obtain the feature vectors of the classification results. Based on the visualization of the gradient weighted class mapping method, the global average of the gradient of each feature vector for the classification result is used as the weight value of the feature vector. The activation intensity distribution of the input spectrum for the classification result is obtained through the backpropagation method to obtain the contribution heat map.
[0007] S2: Calculate the contribution weight. In the spectrum, obtain the half-width of the target characteristic peak and determine the wavenumber range corresponding to the half-width. Find the contribution value corresponding to the wavenumber in the heat map and use it as the numerator. Use the sum of the contribution values within the wavenumber range corresponding to the half-width of all characteristic peaks as the denominator. Divide the numerator by the denominator to obtain the contribution weight of the target characteristic peak to the final classification result of the target object.
[0008] Furthermore, the process of obtaining the feature vector of the classification result using the one-dimensional convolutional neural network includes:
[0009] Step 1: Spectral data processing: All spectral data of the target objects are evenly divided into several parts, one of which is used as a test sample and included in the test set; the remaining parts are divided into training samples and validation samples at a ratio of 3:1. The training samples and validation samples are expanded and included in the training set and validation set respectively; the spectra of the training set, validation set, and test set are preprocessed by the following methods: noise reduction and normalization;
[0010] Step 2: Establish a one-dimensional convolutional neural network structure, setting up the following in sequence: the first convolutional layer, used to extract input spectral features, with a convolution kernel size of 3 and a stride of 2; two residual layers, each of which includes a convolution module and an identity module, and the convolution module includes two convolution layers and a shortcut connection. The identity module contains two convolution layers, and the convolution kernel size of the convolution layer in the residual layer is 3; global average pooling; a fully connected layer and a softmax activation function;
[0011] Step 3: One-dimensional convolutional neural network training and performance evaluation. During model training, the learning rate is set to 0.0001 and the number of training times is 10,000. During the training process, the current best model is automatically saved by comparing the classification accuracy of the model on the validation set.
[0012] Furthermore, the spectrum includes: Raman spectrum and absorption spectrum.
[0013] Furthermore, the method for data expansion in step 1 is: using the Savitzky-Golay smoothing algorithm to remove the original noise from the original spectrum, and then adding Poisson random noise to obtain the forged spectrum required for expansion.
[0014] Furthermore, the activation functions of the first convolutional layer and the convolutional layer in the residual are nonlinear ReLU activation functions.
[0015] Furthermore, the input channel dimension, kernel size and output channel dimension of the first convolutional layer, the convolutional layer in the convolutional module and the convolutional layer in the identity module are respectively: 1, 3, 64; 64, 3, 10; 10, 3, 10; 10, 3, 10; 10, 3, 10; 10, 3, 30; 30, 3, 30; 30, 3, 30.
[0016] Furthermore, the quantitative analysis method quantitatively evaluates the contribution of each characteristic peak and analyzes and searches for potential markers for classification and identification.
[0017] Furthermore, the quantitative analysis method can be used for pathogen genotyping and cancer genotyping.
[0018] Technical effects:
[0019] 1) Based on the differences in the biochemical composition of the targets and the gradient-weighted class activation mapping method, the classification mechanism of 1D-CNN was visualized. A heat map of the contribution of the Raman spectral information of different targets to the final classification decision was obtained. The contribution weight of the main Raman characteristic peaks to the final classification result was quantified. It was found that knocking out different histone deacetylase genes resulted in different characteristic markers that best represent the target class. These differences in biochemical composition may be related to virulence, drug resistance, and metabolic function.
[0020] 2) The visualization results based on Grad-CAM show the characteristic regions found by the 1D-CNN model for determining different categories. For example, in the corresponding contribution heat map, the characteristic regions show a clear "strip-like" distribution, indicating the most important characteristic markers of this type of target. Moreover, these substances do not overlap with the most important characteristic markers of other strains, allowing different types of targets to be correctly identified. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a flow chart for the classification and identification of strains with different genotypes based on the 1D-CNN method;
[0022] Figure 2 is a schematic diagram of the spectral data preprocessing results;
[0023] Figure 3 It is a 1D-CNN network structure;
[0024] Figure 4 It is the parameter setting of 1D-CNN network;
[0025] Figure 5 It is a visualization method for one-dimensional convolutional neural networks based on the gradient-weighted class activation mapping method;
[0026] Figure 6 It is a heat map of the contribution of the normalized average Raman spectra of different genotype strains and different genotype strains to the final classification decision of 1D-CNN. DETAILED DESCRIPTION
[0027] The present invention will be described in detail below through examples and test examples. The examples are provided to better illustrate the content and advantages of the present invention, but should not be construed as limiting the present invention to these examples. Non-essential improvements and adjustments to the embodiments made by those skilled in the art based on the above-mentioned invention are still within the scope of protection of the present invention.
[0028] Example 1: An intelligent spectral quantitative analysis method based on convolutional neural network visualization.
[0029] The spectral data processing and analysis method based on one-dimensional convolutional neural network (1D-CNN) is summarized as follows:
[0030] This example targets the standard Cryptococcus neoformans strain H99 and six different histone deacetylase gene knockout strains, and performs feature extraction and classification identification on the above targets. The specific method is: based on the gradient weighted class activation mapping method, the classification mechanism of the one-dimensional convolutional neural network is visualized to obtain a heat map of the contribution of Raman spectral information of different genotype strains to the final classification decision, and a pathogen genotype classification detection mechanism based on Raman spectroscopy technology is obtained.
[0031] The flow chart of classification and identification of different gene strains based on 1D-CNN method is shown in the attached figure. Figure 1 shown.
[0032] The specific steps include:
[0033] Step 1: Spectral data preprocessing,
[0034] The spectral data of the target object is divided into 5 parts on average, one of which is selected as the test sample, and the remaining four parts are divided into training samples and verification samples at a ratio of 3:1. Then, noise is added to the training samples and verification samples for data expansion, while the test samples are not expanded.
[0035] The data expansion process is as follows: the original noise is removed by using the Savitzky-Golay smoothing algorithm on the original spectrum to be expanded, and then a Poisson noise is added to the smoothed spectrum to obtain the expanded spectrum.
[0036] Specifically, in this embodiment, each target object contains 150 Raman spectra, and there are 1020 Raman spectra for seven targets in total. The 150 spectral data of each target object are divided into 5 parts on average; the original spectrum to be expanded is as follows: Figure 2 As shown in (a), the smoothed spectrum is Figure 2 As shown in (b) in the figure, Poisson noise is as follows Figure 2 As shown in (c) in the figure, the expanded spectrum is as follows Figure 2 As shown in (d), the spectrum after expansion and smoothing is as follows Figure 2 As shown in (e), the smoothed spectrum and the expanded spectrum are as follows Figure 2 As shown in (f) in .
[0037] from Figure 2 (a)-2(d) shows that there is a certain difference between the spectrum after adding noise and the original spectrum; Figure 2 (b) Figure 2 (e) Figure 2 (f) It can be seen that the difference still exists after the spectrum is denoised.
[0038] Finally, the training set containing Raman spectra of seven target objects was expanded to 6,300 spectra, and the validation set was expanded to 2,100 spectra.
[0039] The spectra of the training set, validation set, and test set were subjected to denoising, fluorescence background removal, and normalization before training or testing.
[0040] Step 2: Establishment of 1D-CNN network structure,
[0041] The 1D-CNN network structure used in this embodiment is as follows Figure 3 As shown, one-dimensional spectral data is input. In this embodiment, 2318×1 one-dimensional spectral data is input and enters convolution layer 1, whose convolution kernel is 3 and the step size is 2, which is used to extract features of the input spectrum. The activation function of the convolution layer is a nonlinear ReLU (Rectified Linear Unit, ReLU) activation function, and a maximum pooling layer (Max pooling) of size 3 is used; followed by two residual layers, each residual layer includes a convolution module and an identity module, the convolution module includes two convolution layers and a shortcut connection, the identity module contains two convolution layers, the convolution kernel size is 3, and the activation function of the convolution layer in the residual layer is a nonlinear ReLU activation function; followed by global average pooling; finally, a fully connected layer and a Softmax activation function are used to complete the classification of the spectra of different targets.
[0042] The parameters of the specific network structure are as follows Figure 4 As shown in the figure, the parameters of each convolutional layer represent the input channel dimension, kernel size, and output channel dimension respectively; the solid line connection between the convolutional layers indicates that the number of channels is the same, and the dotted line connection indicates that the number of channels is different, which is exactly the shortcut connection part in ResNet.
[0043] Step 3: 1D-CNN training and performance evaluation,
[0044] This example was conducted in the framework of Tensorflow, using Python 3.7. During model training, the learning rate was set to 0.0001 and the number of training cycles was 10,000. During the training process, the current best model was automatically saved by comparing the classification accuracy of the model on the validation set.
[0045] As described in step 1, the training model uses the five-fold cross-validation method to evaluate the performance of the classifier. After the five-fold cross-validation, the accuracy is obtained according to the confusion matrix as the final discriminant classification result.
[0046] Step 4: Visualization based on Gradient Weighted Class Activation Mapping (Grad-CAM)
[0047] The Gradient Weighted Class Activation Mapping (Grad-CAM) method uses the feature vectors of the classification results obtained by the one-dimensional convolutional neural network and takes the global average of the gradient of each feature vector for the classification result as the weight value of the feature vector. Subsequently, based on the weight value of each feature vector, the activation intensity distribution of the input spectrum for the classification result is obtained through the back propagation method, that is, the contribution heat map of each Raman peak in the Raman spectrum to the final classification decision, as shown in Figure 2. Figure 5 As shown; finally, combined with Raman spectral peak attribution analysis, the contribution of biochemical components in different targets to the final classification decision is obtained.
[0048] Among them, the bright area (red and yellow area) in the contribution heat map represents that the Raman spectral information here contributes more to the final classification decision; the dark area (blue area) represents that the Raman spectral information here contributes less to the final classification decision.
[0049] From the results, we can see that the color distribution of the contribution heat map corresponding to the target Raman spectrum is not the same, but for the same target, the color distribution of the contribution heat map has a certain regularity, such as Figure 6 shown.
[0050] Specifically: In the contribution heat maps corresponding to the Clr61Δ and Clr62Δ mutant strains, the bright area shows an obvious "strip-like" distribution. Among them, in the contribution heat map corresponding to the Clr61Δ mutant strain, this area is mainly distributed between 750 and 950 cm -1 The region that contributed most to the final classification decision of the Clr62Δ mutant strain was mainly distributed between 1200 and 1350 cm -1 within the range.
[0051] The color distribution of the contribution heat map of Hda1Δ and Hos1Δ mutant strains is relatively concentrated. In the contribution heat map corresponding to the Hda1Δ mutant strain, the area with greater contribution is mainly distributed between 400 and 650 cm -1 and 1400~1500cm -1 In the Hos1Δ mutant strain, the region that contributed most to the final classification decision was concentrated between 200 and 300 cm -1 and 500~650cm -1 within the range.
[0052] In the contribution heat maps of Hos2Δ and Hos3Δ mutant strains, the distribution of bright areas is more scattered. The Raman information with greater contribution in the heat map of Hos2Δ mutant strain is mainly distributed in the range of 700-800 cm -1 and 1000~1130cm -1The heat map of the Hos3Δ mutant strain showed that the region with the largest contribution was mainly distributed in the range of 1340-1370 cm -1 and 200~300cm -1 within the range.
[0053] In the contribution heat map of the H99 wild strain, the areas with greater contributions are concentrated in the low wavenumber range of the spectrum, mainly 930-950 cm -1 540~650cm -1 and 200-330cm -1 .
[0054] By combining the Raman spectral peak attribution analysis results with the target object contribution heat map, the contribution weight of the main characteristic peaks of the Raman spectrum of each type of target object to the final classification decision can be quantified, as shown in the following table:
[0055] Table 1 Contribution weights of Raman spectral characteristic peaks of different genotype strains to the final classification results of the 1D-CNN model
[0056]
[0057]
[0058] The contribution heat maps of each type of genotype samples are combined together to form the overall distribution of the contribution heat map corresponding to this genotype. The contribution weight of each characteristic peak in each type of genotype to the final classification result can be further calculated.
[0059] For example, calculate the 541cm -1 The contribution weight of the characteristic peak at 541cm to the final classification result is as follows: First, in the average Raman spectrum of H99, the peak at 541cm -1 The half-height width of the characteristic peak is used to determine the wavenumber range corresponding to the half-height width; then the contribution value corresponding to the wavenumber range in the heat map can be obtained and used as the numerator; the sum of the contribution values of the half-height width of all characteristic peaks in the wavenumber range corresponding to the half-height width is used as the denominator to obtain the 541cm -1 The contribution weight of the characteristic peak to the final classification result.
[0060] Of course, the method of this embodiment can be used not only for Raman spectroscopy, but also for absorption spectroscopy including infrared spectroscopy with similar performance.
[0061] In addition, spectral analysis is also applicable to scenarios where marker identification is required, such as cancer detection, which helps to discover potential diagnostic markers.
Claims
1. An intelligent spectral quantitative analysis method based on convolutional neural network visualization, characterized in that: The following steps are involved: S1: Obtain a contribution heat map. Use a one-dimensional convolutional neural network to obtain the feature vectors of the classification results. Based on the visualization of the gradient weighted class mapping method, the global average of the gradient of each feature vector for the classification result is used as the weight value of the feature vector. The activation intensity distribution of the input spectrum for the classification result is obtained through the backpropagation method to obtain the contribution heat map. S2: Calculate the contribution weight. In the spectrum, obtain the half-height width of the target characteristic peak and determine the wavenumber range corresponding to the half-height width. Find the contribution value corresponding to the wavenumber in the heat map and use it as the numerator. The sum of the contribution values of the half-height width of all characteristic peaks within the corresponding wavenumber range is used as the denominator; The numerator is divided by the denominator to obtain the contribution weight of the target characteristic peak to the final classification result of the target object; The quantitative analysis method quantitatively evaluates the contribution of each characteristic peak and analyzes and searches for potential markers for classification and identification.
2. The intelligent spectral quantitative analysis method based on convolutional neural network visualization according to claim 1, characterized in that: The process of obtaining the feature vector of the classification result using a one-dimensional convolutional neural network includes: Step 1: Spectral data processing: All spectral data of the target objects are evenly divided into several parts, one of which is used as a test sample and included in the test set; the remaining parts are divided into training samples and validation samples at a ratio of 3:
1. The training samples and validation samples are expanded and included in the training set and validation set respectively; the spectra of the training set, validation set, and test set are preprocessed by the following methods: noise reduction and normalization; Step 2: Establish a one-dimensional convolutional neural network structure, setting up the following in sequence: the first convolutional layer, used to extract input spectral features, with a convolution kernel size of 3 and a stride of 2; two residual layers, each of which includes a convolution module and an identity module, and the convolution module includes two convolution layers and a shortcut connection. The identity module contains two convolution layers, and the convolution kernel size of the convolution layer in the residual layer is 3; global average pooling; a fully connected layer and a softmax activation function; Step 3: One-dimensional convolutional neural network training and performance evaluation. During model training, the learning rate is set to 0.0001 and the number of training times is 10,000. During the training process, the current best model is automatically saved by comparing the classification accuracy of the model on the validation set.
3. The intelligent spectral quantitative analysis method based on convolutional neural network visualization according to claim 1 or 2, characterized in that: The spectrum includes: Raman spectrum and absorption spectrum.
4. The intelligent spectral quantitative analysis method based on convolutional neural network visualization according to claim 2, characterized in that: The data expansion method in step 1 is: the original spectrum is smoothed with the Savitzky-Golay algorithm to remove the original noise, and then Poisson random noise is added to obtain the forged spectrum required for expansion.
5. The intelligent spectral quantitative analysis method based on convolutional neural network visualization according to claim 2, characterized in that: The activation functions of the first convolutional layer and the convolutional layer in the residual are nonlinear ReLU activation functions.
6. The intelligent spectral quantitative analysis method based on convolutional neural network visualization according to claim 2, characterized in that: The input channel dimension, kernel size, and output channel dimension of the first convolutional layer, the convolutional layer in the convolutional module, and the convolutional layer in the identity module are: 1, 3, 64; 64, 3, 10; 10, 3, 10; 10, 3, 10; 10, 3, 10; 10, 3, 30; 30, 3, 30; 30, 3, 30.
7. The intelligent spectral quantitative analysis method based on convolutional neural network visualization according to claim 1, characterized in that: The uses of quantitative analysis methods include: pathogen genotyping detection and cancer genotyping detection.