Raman spectrum recognition method, device and equipment based on two-dimensional multimodal representation learning
By converting one-dimensional Raman spectrum signals into multi-modal matrices and using multi-stream feature extractors and attention mechanisms for feature fusion, the problem of insufficient Raman spectrum recognition accuracy in the existing technology is solved and high accuracy is achieved spectral identification.
Patent Information
- Application Number
- CN202410917689.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-07-10
AI Technical Summary
Existing deep learning methods based on convolutional neural networks have limited accuracy in Raman spectrum identification, making it difficult to achieve high-accuracy identification.
The one-dimensional Raman spectrum signal is converted into a time-frequency representation matrix, a correlation representation matrix and a spatial representation matrix, a multi-stream feature extractor is used to extract multi-modal features, and the attention mechanism is used for feature fusion processing to predict spectral categories.
Through the multi-modal representation learning method, the different modal information of the Raman spectrum is fully extracted and the accuracy of spectral identification is improved.
Smart Images

Figure CN118536001B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Raman spectrum recognition, and in particular to a Raman spectrum recognition method, device and equipment for two-dimensional multimodal characterization learning. Background Art
[0002] Raman spectroscopy can identify substances in various samples (for example, identifying the type of gas) in a rapid, non-destructive and label-free manner. Since it can be used to analyze the molecular structure and chemical composition of substances, this technology has made significant progress in the classification of components of complex mixtures. Different biological phenotypes have unique spectral fingerprints on the corresponding Raman spectra due to their unique molecular composition characteristics.
[0003] Raman spectra can be automatically and efficiently analyzed through various machine learning techniques. For example, principal component analysis is used to reduce the impact of redundant information or background noise; linear discriminant analysis, support vector machine (SVM) and k-nearest neighbor are used for material classification. These machine learning methods have been successful in simple tasks, but in complex tasks such as Raman spectral recognition, these methods cannot achieve accurate recognition due to the inter-class similarities and intra-class variations of Raman spectra of different types of substances.
[0004] The combination of Raman spectroscopy and deep learning technology provides an automatic, fast and accurate solution for online diagnosis. However, due to the difficulty of extracting semantic information directly from spectral signals, the accuracy of existing deep learning methods based on convolutional neural networks is still limited. Therefore, how to achieve high-accuracy Raman spectroscopy recognition is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above problems, the embodiments of the present application provide a Raman spectrum recognition method, device and equipment for two-dimensional multimodal characterization learning to overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect of an embodiment of the present application, a Raman spectrum recognition method for two-dimensional multimodal representation learning is disclosed, the method comprising:
[0007] Converting a one-dimensional Raman spectrum signal into two-dimensional matrices of different modes, wherein the two-dimensional matrices of different modes include: a time-frequency representation matrix, a correlation representation matrix, and a space representation matrix;
[0008] Using a multi-stream feature extractor to extract features from the two-dimensional matrices of different modes respectively to obtain multi-modal features;
[0009] The multimodal features are fused based on an attention mechanism to obtain fused features, and spectral categories are predicted based on the fused features.
[0010] Optionally, the two-dimensional matrix of different modes includes a time-frequency representation matrix, and converting the one-dimensional Raman spectrum signal into the time-frequency representation matrix includes:
[0011] The one-dimensional Raman spectrum signal is converted into a two-dimensional time-frequency signal by continuous wavelet transform to obtain a time-frequency representation matrix.
[0012] Optionally, the two-dimensional matrix of different modes includes a correlation representation matrix, and converting the one-dimensional Raman spectrum signal into the correlation representation matrix includes:
[0013] Performing normalization processing on the one-dimensional Raman spectrum signal to obtain a normalized Raman spectrum signal;
[0014] The normalized Raman spectrum signal is mapped as an angle and the wavelength is mapped as a radius, and the normalized Raman spectrum signal is mapped into a polar coordinate system to obtain a Raman spectrum signal represented by polar coordinates;
[0015] According to the angular relationship between each wavelength, cosine calculation is performed on the Raman spectrum signal represented by the polar coordinates to obtain a correlation representation matrix.
[0016] Optionally, the two-dimensional matrix of different modes includes a spatial representation matrix, and converting the one-dimensional Raman spectrum signal into the spatial representation matrix includes:
[0017] Determining the maximum and minimum values of the one-dimensional Raman spectroscopy signal;
[0018] Processing the one-dimensional Raman spectrum signal into a Raman spectrum sequence consisting of a plurality of signal segments, wherein the number of the signal segments is determined according to the size of the spatial representation matrix;
[0019] According to the maximum value and the minimum value, each signal segment in the Raman spectrum sequence is calculated in turn to obtain a signal value of each pixel point;
[0020] A spatial representation matrix is obtained according to the signal values of the respective pixel points.
[0021] Optionally, the multi-stream feature extractor includes: a time-frequency feature extractor, a correlation feature extractor and a spatial feature extractor, and the multi-modal features include: time-frequency features, correlation features, and spatial features;
[0022] The multi-stream feature extractor is used to extract features from the two-dimensional matrices of different modes respectively to obtain multi-modal features, including:
[0023] Using the time-frequency feature extractor to extract time-frequency features from the time-frequency representation matrix to obtain time-frequency features;
[0024] Using the correlation feature extractor to extract correlation features from the correlation representation matrix to obtain correlation features;
[0025] The spatial feature extractor is used to extract spatial features from the spatial representation matrix to obtain spatial features.
[0026] Optionally, the multimodal features are fused based on an attention mechanism to obtain fused features, including:
[0027] Performing cascade operation processing on the time-frequency feature, the correlation feature and the spatial feature to obtain a cascade feature;
[0028] Attention interaction processing is performed on each modality feature in the cascade feature to obtain a fusion feature, where the fusion feature is an enhanced feature that takes the importance of different modalities into consideration.
[0029] Optionally, the Raman spectrum recognition method of the two-dimensional multimodal representation learning is implemented by a category prediction network, and the category prediction network includes: a multi-stream feature extractor, a feature fusion module, and a classification head; the category prediction network is trained by the following steps:
[0030] Convert the sample one-dimensional Raman spectrum signal into a sample two-dimensional matrix of different modes;
[0031] Using the multi-stream feature extractor to extract features from the two-dimensional matrices of samples of different modalities respectively, to obtain multi-modal sample features;
[0032] Using the feature fusion module to fuse the multimodal sample features to obtain sample fusion features, and using the classification head to predict the spectral category of the sample fusion features to obtain a sample prediction result;
[0033] The cross entropy loss between the sample prediction result and the true label is calculated, and the parameters of the multi-stream feature extractor, the feature fusion module, and the classification head are updated according to the cross entropy loss.
[0034] According to a second aspect of the embodiments of the present application, a Raman spectrum recognition device for two-dimensional multimodal characterization learning is disclosed, the device comprising:
[0035] A conversion module, used for converting a one-dimensional Raman spectrum signal into two-dimensional matrices of different modes, wherein the two-dimensional matrices of different modes include: a time-frequency representation matrix, a correlation representation matrix, and a space representation matrix;
[0036] An extraction module, used for performing feature extraction on the two-dimensional matrices of different modes respectively using a multi-stream feature extractor to obtain multi-modal features;
[0037] The prediction module is used to fuse the multimodal features based on the attention mechanism to obtain fused features, and predict the spectral category according to the fused features.
[0038] A third aspect of an embodiment of the present application discloses an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the Raman spectrum recognition method for two-dimensional multimodal representation learning described in the first aspect of the embodiment of the present application are implemented.
[0039] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is disclosed, on which a computer program is stored. When the computer program is executed by a processor, the steps of the Raman spectrum recognition method for two-dimensional multimodal characterization learning described in the first aspect of the embodiment of the present application are implemented.
[0040] The embodiments of the present application include the following advantages:
[0041] In an embodiment of the present application, a one-dimensional Raman spectral signal is converted into two-dimensional matrices of different modalities, and the two-dimensional matrices of different modalities include: a time-frequency representation matrix, a correlation representation matrix, and a space representation matrix; a multi-stream feature extractor is used to perform feature extraction on the two-dimensional matrices of different modalities to obtain multi-modal features; the multi-modal features are fused based on an attention mechanism to obtain fused features, and spectral category prediction is performed based on the fused features.
[0042] Since the one-dimensional Raman spectrum signal is converted into a multi-modal two-dimensional matrix, the deep neural network (such as the multi-stream feature extractor) can better extract features based on the two-dimensional matrix of different modes; and the multi-modal features are fused based on the attention mechanism, taking into account the importance of different modes, further ensuring the accuracy of Raman spectrum recognition. In this way, by fully extracting the different modal information of the Raman spectrum, high-accuracy Raman spectrum recognition is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0044] Figure 1 It is a flowchart of the steps of a Raman spectrum recognition method for two-dimensional multimodal characterization learning provided in an embodiment of the present application;
[0045] Figure 2This is an overall architecture diagram of a Raman spectrum recognition method for two-dimensional multimodal characterization learning provided in an embodiment of the present application;
[0046] Figure 3 It is a structural schematic diagram of a Raman spectrum recognition device for two-dimensional multimodal characterization learning provided in an embodiment of the present application;
[0047] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] Reference Figure 1 As shown, Figure 1 1 is a flowchart of the steps of a two-dimensional multimodal characterization learning Raman spectrum recognition method provided in an embodiment of the present application. Figure 1 As shown, a Raman spectrum recognition method for two-dimensional multimodal characterization learning provided in an embodiment of the present application may include steps S110 to S130:
[0050] Step S110: converting the one-dimensional Raman spectrum signal into two-dimensional matrices of different modes, wherein the two-dimensional matrices of different modes include: a time-frequency representation matrix, a correlation representation matrix, and a space representation matrix.
[0051] In the embodiment of the present application, the one-dimensional Raman spectrum signal is the Raman spectrum signal of different samples collected by the sensor. For example, the one-dimensional Raman spectrum signal can be the Raman spectrum signal of gas or the Raman spectrum signal of chemical substances.
[0052] Considering that directly extracting one-dimensional Raman spectral signals cannot fully explore the potential semantic pattern information (such as time-frequency information) in the spectrum, understanding spectral signals from different modalities helps to understand their semantic information. Therefore, an embodiment of the present application proposes to convert the one-dimensional Raman spectral signal into a two-dimensional matrix of different modalities to highlight the various information in the Raman spectral signal.
[0053] Among them, the time-frequency characterization matrix is the continuous wavelet transform of the one-dimensional Raman spectral signal, which is used to characterize the time-frequency information in the one-dimensional Raman spectral signal; the correlation characterization matrix is the Gram matrix of the one-dimensional Raman spectral signal, which is used to characterize the correlation characteristics between different wavelengths; the spatial characterization matrix is the two-dimensional conversion image of the one-dimensional Raman spectral signal, which is used to characterize the spatial information between different wavelengths.
[0054] In this way, by converting the one-dimensional Raman spectral signal into a two-dimensional matrix of different modes, the potential semantics of the Raman spectral signal can be represented from multiple modes. Since deep neural networks are better at processing two-dimensional information, two-dimensional matrices of different modes can better extract features and ensure the accuracy of Raman spectral recognition.
[0055] The following is a detailed description of the methods for converting one-dimensional Raman spectral signals into two-dimensional matrices of different modes.
[0056] In an optional embodiment, the two-dimensional matrix of different modes includes a time-frequency characterization matrix, and converting the one-dimensional Raman spectrum signal into the time-frequency characterization matrix includes: converting the one-dimensional Raman spectrum signal into a two-dimensional time-frequency signal by continuous wavelet transform to obtain the time-frequency characterization matrix.
[0057] For example, the conversion of a one-dimensional Raman spectral signal into a two-dimensional time-frequency signal can be expressed as:
[0058] ,
[0059] in, represents continuous wavelet transform, represents a two-dimensional time-frequency signal, represents the one-dimensional Raman spectrum signal, represents the wavelength of the Raman spectrum, represents the wavelet generating function, represents the time shift coefficient used to determine the time center of the one-dimensional Raman spectrum signal. Indicates expansion and contraction The proportionality coefficient, represents the wavelet basis function (RBF), represents the inner product, and the continuous wavelet transform can be regarded as the inner product of the one-dimensional Raman spectral signal and a set of wavelet basis functions.
[0060] In the embodiment of the present application, for extracting time-frequency information from a one-dimensional Raman spectrum signal, as a time-frequency domain conversion method, continuous wavelet transform (CWT) can effectively convert a one-dimensional signal into a two-dimensional time-frequency spectrum. Therefore, continuous wavelet transform is used to extract a two-dimensional time representation so that subsequent deep neural networks (such as multi-stream feature extractors) can better extract time-frequency features.
[0061] In an optional embodiment, the two-dimensional matrix of different modes includes a correlation characterization matrix, and converting the one-dimensional Raman spectrum signal into the correlation characterization matrix includes steps A1 to A3:
[0062] Step A1: performing normalization processing on the one-dimensional Raman spectrum signal to obtain a normalized Raman spectrum signal.
[0063] For example, the normalization processing of the one-dimensional Raman spectrum signal can be expressed as:
[0064] ,
[0065] in, represents the maximum value operation of one-dimensional Raman spectrum signal, represents the minimum operation of a one-dimensional Raman spectrum signal. represents the normalized Raman spectrum signal, Represents a one-dimensional Raman spectral signal.
[0066] Step A2: mapping the normalized Raman spectrum signal to an angle and the wavelength to a radius, mapping the normalized Raman spectrum signal to a polar coordinate system, and obtaining a Raman spectrum signal represented by polar coordinates.
[0067] For example, the Raman spectrum signal expressed in polar coordinates is expressed as:
[0068] ,
[0069] in, represents the angle of the Raman spectrum signal expressed in polar coordinates, represents the radius of the Raman spectrum signal expressed in polar coordinates, represents the adjustment factor, express The sequence number corresponding to the moment, Represents the normalized Raman spectral signal.
[0070] Step A3: According to the angular relationship between each wavelength, a cosine calculation is performed on the Raman spectrum signal represented by the polar coordinates to obtain a correlation representation matrix.
[0071] Specifically, the angles at different times are added together, and the cosine value is calculated as an element value in the correlation representation matrix. The correlation representation matrix can be expressed as:
[0072] ,
[0073] in, represents the association representation matrix, represents the angle at the first moment, represents the angle at the second moment, represents the angle at the nth moment, represents the row unit vector, Represents the normalized Raman spectrum signal The transpose of .
[0074] In the embodiment of the present application, considering that the correlation characteristics between different wavelengths are also an important model of the spectral pattern, which is helpful for the analysis of the spectrum, the one-dimensional Raman spectral signal is converted into a correlation representation matrix so that the subsequent deep neural network can better extract the correlation characteristics.
[0075] In an optional embodiment, the two-dimensional matrix of different modes includes a spatial representation matrix, and converting the one-dimensional Raman spectrum signal into the spatial representation matrix includes:
[0076] Determine the maximum value and the minimum value of the one-dimensional Raman spectrum signal; process the one-dimensional Raman spectrum signal into a Raman spectrum sequence composed of a plurality of signal segments, wherein the number of the signal segments is determined according to the size of the spatial representation matrix; calculate each signal segment in the Raman spectrum sequence in turn according to the maximum value and the minimum value to obtain the signal value of each pixel point; and obtain the spatial representation matrix according to the signal value of each pixel point.
[0077] For example, the one-dimensional Raman spectral signal is converted into a spatial representation matrix as:
[0078] ,
[0079] in, Represents the size of the spatial representation matrix, that is, the size of the two-dimensional image; Indicated in pixels The signal value of A signal segment representing a Raman spectral sequence; represents the maximum value operation of one-dimensional Raman spectrum signal, Represents the minimum operation of a one-dimensional Raman spectrum signal Represents a one-dimensional Raman spectral signal.
[0080] In the embodiment of the present application, although the one-dimensional Raman spectrum signal can reflect the spatial information between different wavelengths, the two-dimensional image signal is more easily accepted by human visual perception. Therefore, the embodiment of the present application converts the one-dimensional Raman spectrum signal into a spatial representation matrix to reflect the spatial information, so that the subsequent deep neural network can better extract the spatial features.
[0081] Step S120: using a multi-stream feature extractor to perform feature extraction on the two-dimensional matrices of different modalities respectively to obtain multi-modal features.
[0082] In the embodiment of the present application, the two-dimensional matrix of each mode corresponds to the features of one mode, for example, the time-frequency representation matrix is feature extracted to obtain the time-frequency features. The two-dimensional matrix of each mode is feature extracted by a multi-stream feature extractor to obtain multi-modal features, that is, features corresponding to each mode.
[0083] Among them, the multi-stream feature extractor can be a pre-trained deep neural network with feature extraction function, which is independent of the category prediction network for Raman spectroscopy recognition for realizing two-dimensional multimodal representation learning in the embodiment of the present application; the multi-stream feature extractor can also be a category prediction network for Raman spectroscopy recognition for realizing two-dimensional multimodal representation learning integrated in the embodiment of the present application. As a subnetwork of the category prediction network, its network parameters are updated with the training of the category prediction network until the category prediction network is trained (the training process of the category prediction network will be explained below), and a feature extraction subnetwork suitable for the category prediction network in the embodiment of the present application can be obtained, and then the feature extraction subnetwork is used to extract features from two-dimensional matrices of different modes to obtain multimodal features.
[0084] In an optional embodiment, the multi-stream feature extractor includes: a time-frequency feature extractor, a correlation feature extractor and a spatial feature extractor, and the multi-modal features include: time-frequency features, correlation features, and spatial features.
[0085] Specifically, a multi-stream feature extractor is used to perform feature extraction on the two-dimensional matrices of different modes respectively to obtain multi-modal features, including: using the time-frequency feature extractor to extract time-frequency features on the time-frequency representation matrix to obtain time-frequency features; using the association feature extractor to extract association features on the association representation matrix to obtain association features; using the spatial feature extractor to extract spatial features on the spatial representation matrix to obtain spatial features.
[0086] For example, feature extraction of two-dimensional matrices of different modes is expressed as:
[0087] ,
[0088] in, A two-dimensional matrix representing different modes ( is the time-frequency feature, is the associated feature, is the spatial feature), Represents the extracted spectrum Features, Indicates that the parameter is feature extractor.
[0089] In an embodiment of the present application, a multi-stream feature extractor is used to perform feature extraction on two-dimensional matrices of different modalities, and the two-dimensional matrices of different modalities are converted into deep feature representations (i.e., time-frequency features, correlation features, and spatial features) so that accurate category prediction can be performed based on these deep feature representations.
[0090] Step S130: fusing the multimodal features based on the attention mechanism to obtain fused features, and predicting the spectral category based on the fused features.
[0091] In the embodiment of the present application, in order to highlight the importance of different modal features for the recognition results, a feature fusion method based on the attention mechanism is used to fuse the multimodal features, thereby obtaining enhanced features (i.e., fused features) that take into account the importance of different modalities. Finally, the fused features are processed by a classification head (such as a fully connected layer) to obtain a spectral category prediction result (prediction probability).
[0092] Specifically, the multimodal features are fused based on the attention mechanism to obtain fused features, including steps B1 to B2:
[0093] Step B2: performing a cascade operation on the time-frequency feature, the correlation feature and the spatial feature to obtain a cascade feature.
[0094] In the embodiment of the present application, the features of three different modalities are statistically stratified and merged to serve as input features for processing based on the attention mechanism.
[0095] For example, the cascade feature is represented as:
[0096] ,
[0097] in, represents the cascade feature, Indicates cascade operation, represents the time-frequency characteristics, Represents the associated features, Represents spatial features.
[0098] Step B2: Perform attention interaction processing on each modality feature in the cascade feature to obtain a fusion feature, where the fusion feature is an enhanced feature that takes into account the importance of different modalities.
[0099] In the embodiment of the present application, by introducing the self-attention mechanism to perform fusion based on the importance of different modalities, the attention interaction processing of each modal feature in the cascade feature is expressed as:
[0100] ,
[0101] in, Indicates The intermediate representation of the layer, Indicates The output features of the layer, Representation layer normalization operation, Indicates The output features of the layer, represents the self-attention operation, which is expressed as:
[0102] ,
[0103] in, Represents the query linear mapping layer, Represents the key linear mapping layer, Represents the value linear mapping layer, Indicates the soft-max operation. Features obtained after attention interaction processing It is an enhanced feature (i.e., fusion feature) that takes into account the importance of different modalities.
[0104] Finally, the present embodiment uses the classification header The fused features are processed to obtain the spectral category prediction result. For example, the spectral category prediction result is expressed as:
[0105] ,
[0106] in, represents the predicted probability of spectral category, Represents the classification head, Represents fusion features.
[0107] In the embodiment of the present application, since the one-dimensional Raman spectrum signal is converted into a multi-modal two-dimensional matrix, a multi-stream feature extractor is used to better extract features based on two-dimensional matrices of different modes; and, based on the attention mechanism, the multi-modal features are fused and processed, taking into account the importance of different modes, and further ensuring the accuracy of Raman spectrum recognition. In this way, by fully extracting the different modal information of the Raman spectrum, high-accuracy Raman spectrum recognition is achieved.
[0108] In the embodiment of the present application, the Raman spectrum recognition method of the two-dimensional multimodal representation learning is implemented by a category prediction network, and the category prediction network includes: a multi-stream feature extractor, a feature fusion module, and a classification head. The category prediction network is trained by the following steps C1 to C4:
[0109] Step C1: Convert the sample one-dimensional Raman spectrum signal into a sample two-dimensional matrix of different modes.
[0110] Among them, the sample two-dimensional matrices of different modes include: sample time-frequency representation matrix, sample correlation representation matrix, and sample space representation matrix. The sample time-frequency representation matrix is the continuous wavelet transform of the sample one-dimensional Raman spectrum signal, which is used to represent the time-frequency information in the sample one-dimensional Raman spectrum signal; the sample correlation representation matrix is the Gram matrix of the sample one-dimensional Raman spectrum signal, which is used to represent the correlation characteristics between different wavelengths; the sample space representation matrix is the two-dimensional conversion image of the sample one-dimensional Raman spectrum signal, which is used to represent the spatial information between different wavelengths.
[0111] Step C2: using the multi-stream feature extractor to perform feature extraction on the two-dimensional matrices of samples of different modalities respectively, to obtain multi-modal sample features.
[0112] Specifically, the multi-stream feature extractor includes: time-frequency feature extractor, correlation feature extractor and space feature extractor; multi-modal sample features include: sample time-frequency features, sample correlation features and sample space features. The time-frequency feature extractor is used to extract time-frequency features from the sample time-frequency representation matrix to obtain sample time-frequency features; the correlation feature extractor is used to extract correlation features from the sample correlation representation matrix to obtain sample correlation features; the space feature extractor is used to extract space features from the sample space representation matrix to obtain sample space features.
[0113] Step C3: using the feature fusion module to fuse the multimodal sample features to obtain sample fusion features, and using the classification head to predict the spectral category of the sample fusion features to obtain a sample prediction result.
[0114] Step C4: Calculate the cross entropy loss between the sample prediction result and the true label, and update the parameters of the multi-stream feature extractor, the feature fusion module, and the classification head according to the cross entropy loss.
[0115] Specifically, the cross entropy loss is expressed as:
[0116] ,
[0117] in, represents the cross entropy loss, Indicates The predicted type of the Raman spectral signal of a sample, Indicates The true label of the one-dimensional Raman spectral signal of each sample, Represents the total number of one-dimensional Raman spectrum signals of the sample.
[0118] In an embodiment of the present application, the parameters of the multi-stream feature extractor, the feature fusion module, and the classification head are updated according to the cross entropy loss, and when the training end conditions are met (for example, the number of training times reaches a preset number of training times, or the accuracy of the category prediction network reaches the target prediction accuracy), a trained category prediction network is obtained.
[0119] For example, Figure 2 It is an overall architecture diagram of a Raman spectrum recognition method for two-dimensional multimodal representation learning provided by an embodiment of the present application, and the method includes a multimodal two-dimensional representation stage and a multimodal fusion stage. In the multimodal two-dimensional representation stage, for each input one-dimensional Raman spectrum signal, the one-dimensional Raman spectrum signal is converted into a two-dimensional matrix of different modes, that is, a time-frequency representation matrix, a correlation representation matrix, and a spatial representation matrix. Then, a time-frequency feature extractor is used to extract time-frequency features from the time-frequency representation matrix to obtain time-frequency features; an association feature extractor is used to extract association features from the association representation matrix to obtain association features; and a spatial feature extractor is used to extract spatial features from the spatial representation matrix to obtain spatial features. In the multimodal fusion stage, a cascade operation is performed on the time-frequency features, the association features, and the spatial features to obtain cascade features; and attention interaction processing is performed on each modal feature in the cascade features to obtain fusion features, and the fusion features are predicted according to the fully connected layer (classification head) to predict the spectrum category to obtain the category prediction probability of the spectrum.
[0120] In the embodiment of the present application, since the one-dimensional Raman spectrum signal is converted into a multi-modal two-dimensional matrix, the deep neural network (such as a multi-stream feature extractor) can better extract features based on the two-dimensional matrix of different modes; and the multi-modal features are fused based on the attention mechanism, the importance of different modes is taken into account, and the accuracy of Raman spectrum recognition is further guaranteed. In this way, by fully extracting the different modal information of the Raman spectrum, high-accuracy Raman spectrum recognition is achieved.
[0121] The present application also provides a two-dimensional multimodal characterization learning Raman spectrum recognition device, referring to Figure 3 As shown, Figure 3 : is a schematic diagram of the structure of a Raman spectrum recognition device for two-dimensional multimodal characterization learning provided in an embodiment of the present application, the device comprising:
[0122] The conversion module 310 is used to convert the one-dimensional Raman spectrum signal into two-dimensional matrices of different modes, wherein the two-dimensional matrices of different modes include: a time-frequency representation matrix, a correlation representation matrix, and a space representation matrix;
[0123] An extraction module 320 is used to use a multi-stream feature extractor to perform feature extraction on the two-dimensional matrices of different modes respectively to obtain multi-modal features;
[0124] The prediction module 330 is used to fuse the multimodal features based on the attention mechanism to obtain fused features, and perform spectral category prediction based on the fused features.
[0125] In the Raman spectrum recognition device of two-dimensional multimodal representation learning provided in the embodiment of the present application, since the one-dimensional Raman spectrum signal is converted into a multimodal two-dimensional matrix, the deep neural network (such as a multi-stream feature extractor) can better perform feature extraction based on the two-dimensional matrix of different modes; and, based on the attention mechanism, the multimodal features are fused and processed, taking into account the importance of different modes, further ensuring the accuracy of Raman spectrum recognition. In this way, by fully extracting the different modal information of the Raman spectrum, high-accuracy Raman spectrum recognition is achieved.
[0126] In an optional embodiment, the conversion module includes:
[0127] The time-frequency representation conversion module is used to convert the one-dimensional Raman spectrum signal into a two-dimensional time-frequency signal through continuous wavelet transform to obtain a time-frequency representation matrix.
[0128] In an optional embodiment, the conversion module includes a correlation representation conversion module, and the correlation representation conversion module includes:
[0129] A normalization processing module, used for performing normalization processing on the one-dimensional Raman spectrum signal to obtain a normalized Raman spectrum signal;
[0130] A signal mapping module, used to map the normalized Raman spectrum signal to a polar coordinate system by mapping the normalized Raman spectrum signal as an angle and the wavelength as a radius, so as to obtain a Raman spectrum signal represented by polar coordinates;
[0131] The cosine calculation module is used to perform cosine calculation on the Raman spectrum signal represented by the polar coordinates according to the angular relationship between each wavelength to obtain a correlation representation matrix.
[0132] In an optional embodiment, the conversion module includes a space representation conversion module, and the space representation conversion module includes:
[0133] A determination module, used to determine the maximum and minimum values of the one-dimensional Raman spectrum signal;
[0134] A sequence module, used for processing the one-dimensional Raman spectrum signal into a Raman spectrum sequence consisting of a plurality of signal segments, wherein the number of the signal segments is determined according to the size of the spatial representation matrix;
[0135] A calculation module, used to calculate each signal segment in the Raman spectrum sequence in turn according to the maximum value and the minimum value to obtain a signal value of each pixel point;
[0136] The matrix module is used to obtain a spatial representation matrix according to the signal values of each pixel point.
[0137] In an optional embodiment, the multi-stream feature extractor includes: a time-frequency feature extractor, a correlation feature extractor and a spatial feature extractor, and the multimodal features include: time-frequency features, correlation features, and spatial features; the extraction module includes:
[0138] A first extraction submodule, configured to extract time-frequency features from the time-frequency representation matrix using the time-frequency feature extractor to obtain time-frequency features;
[0139] A second extraction submodule is used to extract correlation features from the correlation representation matrix using the correlation feature extractor to obtain correlation features;
[0140] The third extraction submodule is used to use the spatial feature extractor to extract spatial features from the spatial representation matrix to obtain spatial features.
[0141] In an optional embodiment, the prediction module includes:
[0142] A cascade operation module, used for performing cascade operation processing on the time-frequency feature, the correlation feature and the spatial feature to obtain a cascade feature;
[0143] The interaction module is used to perform attention interaction processing on each modality feature in the cascade feature to obtain a fusion feature, where the fusion feature is an enhanced feature that takes into account the importance of different modalities.
[0144] In an optional embodiment, the Raman spectrum recognition device for two-dimensional multimodal representation learning is implemented by a category prediction network, and the category prediction network includes: a multi-stream feature extractor, a feature fusion module, and a classification head. The device includes a training module for training the category prediction network, and the training module includes:
[0145] A sample conversion module, used for converting a sample one-dimensional Raman spectrum signal into a sample two-dimensional matrix of different modes;
[0146] A sample extraction module, used to use the multi-stream feature extractor to perform feature extraction on the sample two-dimensional matrices of different modalities respectively to obtain multi-modal sample features;
[0147] A sample prediction module, used to use the feature fusion module to perform fusion processing on the multimodal sample features to obtain sample fusion features, and use the classification head to perform spectral category prediction on the sample fusion features to obtain sample prediction results;
[0148] A parameter updating module is used to calculate the cross entropy loss between the sample prediction result and the true label, and update the parameters of the multi-stream feature extractor, the feature fusion module, and the classification head according to the cross entropy loss.
[0149] The present application also provides an electronic device, referring to Figure 4 , Figure 4 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 400 includes: a memory 410 and a processor 420. The memory 410 and the processor 420 are connected via a bus communication. A computer program is stored in the memory 410. The computer program can be run on the processor 420 to implement the steps of the Raman spectrum recognition method for two-dimensional multimodal representation learning described in the embodiment of the present application.
[0150] The embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the Raman spectrum recognition method for two-dimensional multimodal representation learning described in the embodiment of the present application are implemented.
[0151] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0152] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, and devices according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0155] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0156] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0157] The above is a detailed introduction to the Raman spectroscopy recognition method, device and equipment for two-dimensional multimodal characterization learning provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A Raman spectrum recognition method based on two-dimensional multimodal representation learning, characterized in that: The method comprises: Converting a one-dimensional Raman spectrum signal into two-dimensional matrices of different modes, wherein the two-dimensional matrices of different modes include: a time-frequency representation matrix, a correlation representation matrix, and a space representation matrix; the correlation representation matrix is used to represent the correlation characteristics between different wavelengths, and the space representation matrix is used to represent the spatial information between different wavelengths; Using a multi-stream feature extractor to extract features from the two-dimensional matrices of different modes respectively, to obtain multi-modal features; the multi-modal features include: time-frequency features, correlation features, and spatial features; The multimodal features are fused based on an attention mechanism to obtain fused features, and spectral category prediction is performed based on the fused features; The two-dimensional matrix of different modes includes a correlation characterization matrix, and converting the one-dimensional Raman spectrum signal into the correlation characterization matrix includes: normalizing the one-dimensional Raman spectrum signal to obtain a normalized Raman spectrum signal; mapping the normalized Raman spectrum signal to an angle and the wavelength to a radius, mapping the normalized Raman spectrum signal to a polar coordinate system to obtain a Raman spectrum signal represented by polar coordinates; performing cosine calculation on the Raman spectrum signal represented by polar coordinates according to the angular relationship between each wavelength to obtain a correlation characterization matrix; The two-dimensional matrix of different modes includes a spatial characterization matrix, and converting a one-dimensional Raman spectrum signal into the spatial characterization matrix includes: determining the maximum value and the minimum value of the one-dimensional Raman spectrum signal; processing the one-dimensional Raman spectrum signal into a Raman spectrum sequence composed of a plurality of signal segments, wherein the number of the signal segments is determined according to the size of the spatial characterization matrix; calculating each signal segment in the Raman spectrum sequence in turn according to the maximum value and the minimum value to obtain the signal value of each pixel point; and obtaining the spatial characterization matrix according to the signal value of each pixel point.
2. The Raman spectrum recognition method of two-dimensional multimodal characterization learning according to claim 1 is characterized in that: The two-dimensional matrix of different modes includes a time-frequency representation matrix, and converting the one-dimensional Raman spectrum signal into the time-frequency representation matrix includes: The one-dimensional Raman spectrum signal is converted into a two-dimensional time-frequency signal by continuous wavelet transform to obtain a time-frequency representation matrix.
3. The Raman spectrum recognition method of two-dimensional multimodal characterization learning according to claim 1 is characterized in that: The multi-stream feature extractor includes: a time-frequency feature extractor, a correlation feature extractor and a spatial feature extractor; The multi-stream feature extractor is used to extract features from the two-dimensional matrices of different modes respectively to obtain multi-modal features, including: Using the time-frequency feature extractor to extract time-frequency features from the time-frequency representation matrix to obtain time-frequency features; Using the correlation feature extractor to extract correlation features from the correlation representation matrix to obtain correlation features; The spatial feature extractor is used to extract spatial features from the spatial representation matrix to obtain spatial features.
4. The Raman spectrum recognition method of two-dimensional multimodal characterization learning according to claim 3 is characterized in that: The multi-modal features are fused based on the attention mechanism to obtain fused features, including: Performing cascade operation processing on the time-frequency feature, the correlation feature and the spatial feature to obtain a cascade feature; Attention interaction processing is performed on each modality feature in the cascade feature to obtain a fusion feature, where the fusion feature is an enhanced feature that takes the importance of different modalities into consideration.
5. A Raman spectrum recognition method for two-dimensional multimodal characterization learning according to any one of claims 1 to 4, characterized in that: The Raman spectrum recognition method of two-dimensional multimodal representation learning is implemented through a category prediction network, which includes: a multi-stream feature extractor, a feature fusion module, and a classification head; the category prediction network is trained by the following steps: Convert the sample one-dimensional Raman spectrum signal into a sample two-dimensional matrix of different modes; Using the multi-stream feature extractor to extract features from the two-dimensional matrices of samples of different modalities respectively, to obtain multi-modal sample features; Using the feature fusion module to fuse the multimodal sample features to obtain sample fusion features, and using the classification head to predict the spectral category of the sample fusion features to obtain a sample prediction result; The cross entropy loss between the sample prediction result and the true label is calculated, and the parameters of the multi-stream feature extractor, the feature fusion module, and the classification head are updated according to the cross entropy loss.
6. A Raman spectrum recognition device for two-dimensional multimodal characterization learning, characterized in that: The device comprises: A conversion module, used to convert a one-dimensional Raman spectrum signal into a two-dimensional matrix of different modes, wherein the two-dimensional matrix of different modes includes: a time-frequency representation matrix, a correlation representation matrix, and a space representation matrix; the correlation representation matrix is used to represent the correlation characteristics between different wavelengths, and the space representation matrix is used to represent the spatial information between different wavelengths; An extraction module, used to use a multi-stream feature extractor to perform feature extraction on the two-dimensional matrices of different modes respectively to obtain multi-modal features; the multi-modal features include: time-frequency features, correlation features, and spatial features; A prediction module, used for fusing the multimodal features based on an attention mechanism to obtain fused features, and predicting spectral categories based on the fused features; Wherein, the conversion module includes an associated characterization conversion module, and the associated characterization conversion module includes: a normalization processing module, which is used to perform normalization processing on the one-dimensional Raman spectrum signal to obtain a normalized Raman spectrum signal; a signal mapping module, which is used to map the normalized Raman spectrum signal to a polar coordinate system by mapping the normalized Raman spectrum signal as an angle and the wavelength as a radius to obtain a Raman spectrum signal represented by polar coordinates; a cosine calculation module, which is used to perform cosine calculation on the Raman spectrum signal represented by polar coordinates according to the angular relationship between each wavelength to obtain an associated characterization matrix; The conversion module also includes a spatial representation conversion module, which includes: a determination module, used to determine the maximum value and the minimum value of the one-dimensional Raman spectrum signal; a sequence module, used to process the one-dimensional Raman spectrum signal into a Raman spectrum sequence composed of a plurality of signal segments, and the number of the signal segments is determined according to the size of the spatial representation matrix; a calculation module, used to calculate each signal segment in the Raman spectrum sequence in turn according to the maximum value and the minimum value to obtain the signal value of each pixel point; and a matrix module, used to obtain the spatial representation matrix according to the signal value of each pixel point.
7. 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 computer program, the steps of the Raman spectrum recognition method for two-dimensional multimodal characterization learning described in any one of claims 1-5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the Raman spectrum recognition method for two-dimensional multimodal characterization learning described in any one of claims 1 to 5 are implemented.
