Raman spectrum classification method, species blood and semen classification method, and species classification method

By combining one-dimensional convolution and multi-head self-attention mechanism neural networks, the problem that convolutional neural networks cannot capture the relationship between local and global feature information of the Raman spectrum is solved, and higher classification accuracy is achieved, especially in large-scale data sets, performance is significantly improved.

WO2025050613A1PCT designated stage expired Publication Date: 2025-03-13SHANGHAI MARITIME UNIVERSITY

Patent Information

Application Number
PCT/CN2024/082557
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-07
Filing Date
2024-03-20
Publication Date
2025-03-13

AI Technical Summary

Technical Problem

In the prior art, convolutional neural networks cannot capture the relationship between local and global feature information in Raman spectral data, resulting in poor classification results.

Method used

A neural network model combining one-dimensional convolution and multi-head self-attention mechanism is adopted to extract local spectral features through a one-dimensional convolution layer. The multi-head self-attention layer fuses local and global feature information, and enhances feature representation through a multi-scale feature fusion module.

Benefits of technology

Effectively combining the local characteristic peaks and global peak correlations of the Raman spectrum improves the classification accuracy, especially in large-scale data sets, with a significant improvement in classification accuracy of 99.2%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024082557_13032025_PF_FP_ABST
    Figure CN2024082557_13032025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a Raman spectrum classification method, a species blood and semen classification method, and a species classification method. The Raman spectrum classification method comprises: first, acquiring a plurality of pieces of Raman spectrum data, and taking same as a training set and a test set; second, on the basis of existing spectral quality, performing a series of preprocessing on the Raman spectrum data, so as to acquire Raman spectrum data having obvious peak information; then, inputting the Raman spectrum data having obvious peak information into a neural network model in which one-dimensional convolution and a multi-head self-attention mechanism are combined, and training a classification model; and finally, inputting Raman spectrum test set data into the trained classification model, so as to obtain a final classification result. Local peak feature information can be obtained by means of performing convolution computation on a spectrum, global peak correlation information can be obtained by means of performing multi-head self-attention computation on the spectrum, and a multi-scale feature fusion effect is achieved; and local feature peaks of a Raman spectrum can be effectively combined with global peak correlations, so that a more accurate classification representation is achieved, thereby improving the classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Raman spectroscopy classification method, species blood and semen, and species classification method Technical Field

[0001] The present invention belongs to the field of spectral analysis, and in particular relates to a Raman spectroscopy classification method, species blood and semen, and a species classification method. Background Art

[0002] Raman spectroscopy, generated by the scattering of light from molecules after being illuminated by a light source, is widely used to analyze the structural information of substances. The resulting spectral data varies depending on the chemical structure and functional groups within the illuminated substance, leading to its use as a substance's "chemical fingerprint." Raman spectroscopy allows for both qualitative and quantitative analysis of substances, determining the substance's content based on the intensity of spectral peaks. Raman spectroscopy offers advantages such as high efficiency, high sensitivity, and simple sampling without the need for contact with the sample. It effectively protects test personnel from infectious samples and is non-destructive to the sample. Consequently, Raman spectroscopy is now being applied in fields such as food safety, medical testing, and petrochemicals.

[0003] Raman spectroscopy has been applied to species identification in blood. Raman scattering occurs when laser photons interact with molecules in blood samples, generating vibrational modes. This scattering information provides information about the vibrations of hemoglobin, proteins, lipids, and sugars in the blood. This information can be used to determine the concentration and composition of molecules in the blood, enabling analysis and identification of species. With the development of machine learning, Raman spectroscopy has achieved promising identification results in machine learning algorithms. Partial least squares regression analysis (PLS-DA) and principal component analysis (PCA) are widely used in blood spectral analysis. However, while classic machine learning methods are effective for small data sets, they still have limitations when applied to large data sets.

[0004] With the continuous advancement of deep learning, convolutional neural networks have achieved superior results in Raman spectroscopy classification compared to classical machine learning methods. However, convolutional neural networks still have shortcomings in Raman spectroscopy classification. Convolutional neural networks can only extract local peak features of the spectrum and cannot capture the relationship between local and global features, resulting in suboptimal classification results. Technical issues

[0005] The technical problem to be solved by the present invention is to provide a Raman spectrum classification method, which solves the problem in the prior art that convolutional neural networks cannot capture the relationship between local and global spectral feature information. Technical Solutions

[0006] The present invention adopts the following technical solutions to solve the above technical problems:

[0007] A Raman spectrum classification method, first, obtains a number of Raman spectrum data as a training set and a test set;

[0008] Secondly, after a series of pre-processing of the Raman spectrum data according to the existing spectrum quality, Raman spectrum data with obvious peak information is obtained;

[0009] Then, the Raman spectral data with obvious peak information is input into a neural network model that combines one-dimensional convolution and multi-head self-attention mechanism to train the classification model;

[0010] Finally, the Raman spectroscopy test set data is input into the trained classification model to obtain the final classification result.

[0011] The specific steps for preprocessing spectral data are as follows:

[0012] Step 1: Determine whether there is baseline drift in the Raman spectrum data. If there is baseline drift, perform baseline correction.

[0013] Step 2: Determine whether there is instrument noise during the Raman spectrum data acquisition process. If there is noise, perform denoising on the Raman spectrum data.

[0014] Step 3: Replace the spectrum points with negative spectrum intensity with 0;

[0015] Step 4: Normalize the Raman spectrum obtained in step 3 to obtain Raman spectrum data with obvious peak information. .

[0016] The specific steps for training a classification model are as follows:

[0017] Step a: Input the Raman spectrum data with obvious peak information into a convolutional layer and a maximum pooling layer to perform spectral data dimension reduction;

[0018] Step b: Input the reduced spectrum into two convolutional layers to extract multi-scale local spectral feature data. ;

[0019] Step c: Input the extracted multi-scale local spectral feature data into two convolutional layers and one multi-head self-attention layer to perform information fusion of the correlation between local spectral features and global spectral features;

[0020] Step d: Input the information fused features into the adaptive mean pooling layer to perform feature dimensionality reduction; and input the reduced dimensionality features into the fully connected layer to obtain the final category probability output;

[0021] Step e: According to the loss function, adjust the network model parameters to obtain the classification model with the final network global optimal solution parameters.

[0022] In step a, the Raman spectrum data with obvious peak information is first input into the convolution layer to obtain the first feature data with half the spectral dimension. Then, the first feature data is input into the maximum pooling layer and the maximum pooling operation is performed to obtain the second feature data with the spectral dimension reduced by half. .

[0023] The specific process of step c is as follows:

[0024] Step c_1: Two convolutional layers with residual connections and one multi-head self-attention layer form a feature fusion module;

[0025] Step c_2: The output of the previous feature fusion module is used as the input of the next feature fusion module in turn to construct three multi-scale feature fusion modules. In each module, the number of one-dimensional convolution kernels used in the two convolution layers is doubled, and the multi-head self-attention layer in each module has different settings for feature data segmentation size and number of attention heads;

[0026] Step c_3: convert the multi-scale local spectral feature data Input the convolution layer in a single module to obtain multi-scale feature data with spectral dimension halved and the number of multi-scale features doubled. ;

[0027] Step c_4: Multi-scale feature data Input the multi-head self-attention layer in a single module to obtain multi-scale feature fusion data .

[0028] Obtain multi-scale feature fusion data The specific formula is as follows:

[0029]

[0030]

[0031]

[0032]

[0033] in, , Represents the number of one-dimensional convolution kernels in the convolution layer, Represents multi-scale feature data Divide into n-th small feature blocks of size p, Represents the location information of each small feature block; , h represents the number of heads of the multi-head self-attention mechanism, Represents the number of one-dimensional convolution kernels contained in each multi-head self-attention mechanism head, and z represents the multi-scale feature data After all blocks are encoded, Represents the z initialization weight information, and the vector dot multiplication operation is performed on the two to obtain the weight of each small feature block. ; Represents the self-attention weight of each small feature block, Represents the final multi-head self-attention weight of each small feature block.

[0034] The specific process of step d is as follows:

[0035] Fusing multi-scale features into data Input the adaptive mean pooling layer to obtain the feature data of the set feature dimension size , feature data Input a fully connected layer to obtain the final category probability output, where the number of output neurons in the fully connected layer is set to the number of categories of the target classification task.

[0036] In order to further solve the problem of low efficiency and poor effect of species classification, the present invention also provides a species blood semen and species classification method. The specific technical solution is as follows:

[0037] The method for species classification of blood and semen based on Raman spectroscopy includes the following steps:

[0038] Step 1: Obtain blood and semen Raman spectral data samples of several species as training sets and test sets;

[0039] Step 2: Apply the Raman spectroscopy classification method to train a classification model based on the data obtained in step 1, and use a test set to verify and optimize the classification model;

[0040] Step 3: Input the real-time Raman spectral data of blood and semen of various species into the optimized classification model to obtain the final classification results.

[0041] The species classification method based on Raman spectroscopy includes the following steps:

[0042] Step 1: Obtain Raman spectral data samples of arbitrary attributes of several species as training sets and test sets;

[0043] Step 2: Apply the Raman spectroscopy classification method to train a species classification model based on the data obtained in step 1, and use a test set to verify and optimize the species classification model;

[0044] Step 3: Input the real-time Raman spectral data of various species into the optimized species classification model to obtain the final species classification results.

[0045] A computer storage medium stores computer instructions, which are used to execute all or part of the steps of the method when called. Beneficial effects

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] 1. A Raman spectroscopy classification method based on a convolutional neural network and a multi-head self-attention mechanism. The spectrum can obtain local peak feature information through convolution calculation, and global peak correlation information through multi-head self-attention calculation, which has the effect of multi-scale feature fusion. The effective combination of the two network structures can achieve a complementary effect. Compared with existing Raman spectroscopy classification methods, it can effectively combine the local characteristic peaks of the Raman spectrum with the global peak correlation, obtain more accurate classification performance, and thus improve the classification accuracy.

[0048] 2. Accurately and rapidly predict rare species in blood and semen, thereby reducing the illegal smuggling of rare animals and effectively protecting national biological resources. Compared to traditional machine learning methods, this method achieves superior classification performance in large-scale Raman spectroscopy datasets. In a reflectance Raman spectroscopy dataset of blood and semen from 40 species, the classification accuracy reaches 99.2%, providing a new approach for species classification in blood and semen.

[0049] 3. This method can not only be used for species blood and semen classification, but also can be used in other biological classification and identification fields, and has high practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] FIG1 is a diagram of the network calculation process of the method of the present invention and its corresponding actual network structure.

[0051] FIG2 is a single original spectrum of the blood reflectance Raman spectrum of a horse of the present invention.

[0052] FIG3 is a single-photograph of the blood of a horse species after preprocessing of the reflectance Raman spectrum according to the present invention.

[0053] FIG4 is a graph showing the network training loss and accuracy of the present invention.

[0054] FIG5 is a diagram showing the confusion matrix of the network used in the test set to predict blood and semen of unknown species after training of the present invention is completed. Best Mode for Carrying Out the Invention

[0055] The structure and working process of the present invention will be further described below with reference to the accompanying drawings.

[0056] The present invention provides a Raman spectroscopy classification method based on a combination of a convolutional neural network and a multi-head self-attention mechanism. Convolution calculations on the spectrum yield local peak feature information, while multi-head self-attention calculations yield global peak correlation information, with the added benefit of multi-scale feature fusion. The effective combination of the two network structures complements each other, thereby improving classification accuracy. This method can quickly and easily accurately classify blood and semen from various species, thereby reducing the illegal smuggling of rare animals and effectively protecting national biological resources. Furthermore, this method is applicable not only to species blood and semen classification but also to other biological classification and identification fields.

[0057] A Raman spectrum classification method, first, obtains a number of Raman spectrum data as a training set and a test set;

[0058] Secondly, after a series of pre-processing of the Raman spectrum data according to the existing spectrum quality, Raman spectrum data with obvious peak information is obtained;

[0059] Then, the Raman spectral data with obvious peak information is input into a neural network model that combines one-dimensional convolution and multi-head self-attention mechanism to train the classification model;

[0060] Finally, the Raman spectroscopy test set data is input into the trained classification model to obtain the final classification result.

[0061] The method for species classification of blood and semen based on Raman spectroscopy includes the following steps:

[0062] Step 1: Obtain blood and semen Raman spectral data samples of several species as training sets and test sets;

[0063] Step 2: Apply the Raman spectroscopy classification method to train a classification model based on the data obtained in step 1, and use a test set to verify and optimize the classification model;

[0064] Step 3: Input the real-time Raman spectral data of blood and semen of various species into the optimized classification model to obtain the final classification results.

[0065] The species classification method based on Raman spectroscopy includes the following steps:

[0066] Step 1: Obtain Raman spectral data samples of arbitrary attributes of several species as training sets and test sets;

[0067] Step 2: Apply the Raman spectroscopy classification method to train a species classification model based on the data obtained in step 1, and use a test set to verify and optimize the species classification model;

[0068] Step 3: Input the real-time Raman spectral data of various species into the optimized species classification model to obtain the final species classification results. Modes for Carrying Out the Invention

[0069] Specific embodiments, as shown in Figures 1 to 5, the data set used in this embodiment is from the National Key R&D Program for Special Biological Resources Monitoring and Traceability Technology Research (2018YFC1200205). The blood reflectance Raman spectrum of a single species of horse is visualized as shown in Figure 2. The data includes 40 types of national rare animals and common animals in daily life, such as kangaroos, red-crowned cranes, golden monkeys, and horses, totaling 5229 reflectance Raman spectrum data, of which 9.8% (515 data) are used as a test set.

[0070] As shown in Figure 1, the implementation steps of the method are as follows:

[0071] Step S1: pre-process the spectral data according to the existing spectral quality. The specific implementation steps are as follows:

[0072] Step S11: Determine whether to perform baseline correction on the Raman spectrum based on whether there is baseline drift in the Raman spectrum data. In this embodiment, baseline drift exists in the Raman spectrum and baseline correction is required.

[0073] Step S12: Determine whether to perform denoising on the Raman spectrum based on whether there is instrument noise during the Raman spectrum acquisition process, resulting in drastic fluctuations in the spectrum lines and unclear peaks. In this embodiment, the Raman spectrum has noise and needs to be denoised.

[0074] Step S13: discard the spectrum points with negative spectrum intensities and replace them with 0. In this embodiment, a small number of spectrum points have negative values, and they are replaced with 0.

[0075] In step S14, the Raman spectrum is normalized to accelerate the convergence of network training. In this embodiment, the Raman spectrum intensity is normalized to [0, 1], and the Raman spectrum dimension is (1, 1400). The single blood spectrum of the horse species after preprocessing is shown in Figure 3.

[0076] In step S2, the spectral data is input into a convolutional layer and a maximum pooling layer for spectral data dimension reduction. The specific implementation steps are as follows:

[0077] Step S21: pre-process the spectrum to obtain spectrum data , input convolution layer (101), wherein the convolution layer (101) uses 16 one-dimensional convolution kernels with a feature size of 7*1, a convolution step of 2, and a spectrum filling of 6 to perform convolution operation on the input data to obtain 16 feature data with half the spectral dimension reduced In this embodiment, the pre-processed spectral data X is input into the convolution layer (101) to obtain feature data with a dimension of (16,700) ;

[0078] Step S22: The feature data Input the maximum pooling layer (102), wherein the maximum pooling layer (102) uses a one-dimensional filter with a feature size of 3*1, a pooling step size of 2, and a spectrum filling of 2 to perform a maximum pooling operation on the input data to obtain 16 spectral dimensions and then reduce the feature data by half In this embodiment, the feature data Input the maximum pooling layer (102) to obtain feature data with a dimension of (16,350) .

[0079] In step S3, the spectrum after dimension reduction is input into two convolutional layers to extract multi-scale local spectral features. The specific implementation steps are as follows:

[0080] Step S31: Reduce the spectral data Input two convolution layers (201, 202) with residual connections, wherein both convolution layers (201, 202) use 32 one-dimensional convolution kernels with feature sizes of 3*1, a convolution step of 1, and a spectrum padding of 2 to perform convolution operations on the input data to obtain 32 multi-scale feature data with unchanged spectral dimensions. In this embodiment, the feature data after dimensionality reduction is Input two convolutional layers (201, 202) to obtain multi-scale feature data with a dimension of (32, 350) .

[0081] In step S4, the extracted features are input into two convolutional layers and one multi-head self-attention layer to fuse the information of the correlation between local spectral features and global spectral features. The specific implementation steps are as follows:

[0082] Step S41, two convolutional layers (301, 302) with residual connections and one multi-head self-attention layer (303) are combined into a multi-scale feature fusion module, and the output of the previous module is used as the input of the next module, and repeated three times. In this embodiment, three multi-scale feature fusion modules are constructed, and the multi-scale feature data Input into three multi-scale feature fusion modules. The specific steps are as follows:

[0083] Step S411, constructing three multi-scale feature fusion modules, wherein the number of one-dimensional convolution kernels used in the two convolution layers (301, 302) in each module is doubled, and the multi-scale feature data is Input a single module to obtain feature data with spectral dimension halved and the number of multi-scale features doubled. In this embodiment, three multi-scale feature fusion modules are constructed, wherein two convolution layers (301, 302) respectively use 64, 128, and 256 one-dimensional convolution kernels with feature sizes of 3*1, and in each of the two convolution layers (301, 302), the convolution step sizes are 2 and 1, and the spectral padding is 2;

[0084] Step S412: construct three multi-scale feature fusion modules, wherein the multi-head self-attention layer (MSA, 303) in each module has different settings for feature data segmentation size and number of attention heads, and the multi-scale feature data is fused. Input the multi-head self-attention layer in a single module to obtain multi-scale feature fusion data ;

[0085]

[0086]

[0087]

[0088]

[0089] in, , Represents the number of one-dimensional convolution kernels in the convolution layer, Represents multi-scale feature data Divide into n-th small feature blocks of size p, Represents the location information of each small feature block; , h represents the number of heads of the multi-head self-attention mechanism, Represents the number of one-dimensional convolution kernels contained in each multi-head self-attention mechanism head, and z represents the multi-scale feature data After all blocks are encoded, Represents the z initialization weight information, and the vector dot multiplication operation is performed on the two to obtain the weight of each small feature block. ; Represents the self-attention weight of each small feature block, Represents the final multi-head self-attention weight of each small feature block.

[0090] In this embodiment, the multi-head self-attention layer (303) divides the feature data into small feature blocks of 35, 44, and 22 sizes, and the number of attention heads is set to 1, 2, and 4 respectively. Finally, the multi-scale feature data Input the three modules to obtain multi-scale feature fusion data with feature dimensions of (64,175), (128,88), and (256,44). .

[0091] In step S5, the features after information fusion are input into the adaptive mean pooling layer for feature dimensionality reduction. The features after dimensionality reduction are input into the fully connected layer to obtain the final class probability output. The specific implementation steps are as follows:

[0092] Step S51: fusion of the multi-scale feature data Input adaptive mean pooling layer (401), where the adaptive mean pooling output size is set to 7 pairs of the input feature data Perform adaptive mean pooling calculation to obtain feature data with a feature dimension size of 7 In this embodiment, the multi-scale feature fusion data with the final data dimension of (256,44) is Input the adaptive mean pooling layer to obtain feature data with a data dimension of (256,7) ;

[0093] Step S52: the feature data Input a fully connected layer (402), wherein the fully connected layer sets the number of output neurons to be the number of categories of the target classification task, and obtains the final category probability output. In this embodiment, the number of categories of the target classification task is 40, and the feature data Input the fully connected layer and get 40 categories of probability output, where the maximum probability is the model prediction classification.

[0094] Step S6: During the network training process, the network model parameters are adjusted using the AdamW optimization algorithm according to the loss function to obtain the final global optimal solution parameters of the network. The specific implementation steps are as follows:

[0095] Step S61: select a cross entropy loss function as the network training loss function to evaluate the gap between the model prediction result and the actual result. In this embodiment, a 40-class cross entropy loss function is used.

[0096] In step S62, the derivative of the class distance is calculated based on the loss function, and the AdamW optimization algorithm is used to iteratively update the network training parameters to obtain the globally optimal fitting parameters. In this embodiment, the network reached optimal convergence after 80 epochs of training, and the model loss was minimized. The specific training loss and accuracy curves are shown in Figure 4.

[0097] Step S7: After the network model is trained, it can be used in actual spectral detection and classification tasks. In this embodiment, the test set data is input into the trained network model, and the classification results are output. The test set contains 515 sample data, and the confusion matrix results of the model's various predictions are shown in Figure 5.

[0098] Those skilled in the art should understand that they can implement variations by combining the prior art and the above embodiments. Such variations do not affect the essence of this solution and are not described in detail here.

[0099] It should be understood that this solution is not limited to the specific implementation methods described above. Devices and structures not described in detail should be understood to be implemented in a common manner in the art. Any person skilled in the art can, without departing from the scope of this solution, use the methods and technical content disclosed above to make many possible changes and modifications to this solution, or modify it into equivalent embodiments with equivalent changes, without affecting the essence of this solution. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of this solution without departing from the content of this solution are still within the scope of protection of this solution. Industrial Applicability

[0100] The present invention is based on Raman spectral data and completes Raman spectral classification through data preprocessing, spectral data dimensionality reduction, multi-scale local feature extraction, multi-scale information fusion and fully connected layer mapping. It can simply and quickly accurately classify the blood and semen of various species, thereby reducing the illegal smuggling of rare animals and effectively protecting national biological resources.

Claims

1. A Raman spectrum classification method, characterized in that: First, obtain some Raman spectral data as training sets and test sets; Secondly, after a series of preprocessing of the Raman spectrum data according to the existing spectrum quality, the Raman spectrum data with obvious peak information is obtained; Then, the Raman spectral data with obvious peak information is input into a neural network model that combines one-dimensional convolution and multi-head self-attention mechanism to train the classification model; Finally, the Raman spectroscopy test set data is input into the trained classification model to obtain the final classification result.

2. The Raman spectrum classification method according to claim 1, characterized in that: The specific steps for preprocessing spectral data are as follows: Step 1: determine whether there is a baseline drift phenomenon in the Raman spectrum data. If there is a baseline drift phenomenon, perform baseline correction processing; Step 2: determine whether there is instrument noise in the process of Raman spectral data acquisition, and if there is noise, perform denoising on the Raman spectral data; Step 3, replace the spectrum points with negative spectrum intensity with 0; Step 4: normalize the Raman spectrum obtained in step 3 to obtain Raman spectrum data X with obvious peak information.

3. The Raman spectrum classification method according to claim 2, characterized in that: The specific steps for training a classification model are as follows: Step a, inputting the Raman spectrum data with obvious peak information into a convolution layer and a maximum pooling layer to reduce the dimension of the spectrum data; Step b: Input the reduced-dimensional spectrum into two convolutional layers to extract multi-scale local spectral feature data. ; Step c: input the extracted multi-scale local spectral feature data into two convolutional layers and one multi-head self-attention layer to perform information fusion of the correlation between local spectral features and global spectral features; Step d: Input the information fused features into the adaptive mean pooling layer to reduce the feature dimension; and input the reduced feature into the fully connected layer to obtain the final category probability output; Step e: According to the loss function, adjust the network model parameters to obtain the classification model with the final network global optimal solution parameters.

4. The Raman spectrum classification method according to claim 3, characterized in that: In step a, the Raman spectrum data with obvious peak information is first input into the convolution layer to obtain the first feature data with half the spectral dimension. Then, the first feature data is input into the maximum pooling layer, and the maximum pooling operation is performed to obtain the second feature data with the spectral dimension reduced by half. .

5. The Raman spectrum classification method according to claim 4, characterized in that: The specific process of step c is as follows: Step c_1, two convolutional layers with residual connections and one multi-head self-attention layer form a feature fusion module; Step c_2: The output of the previous feature fusion module is used as the input of the next feature fusion module in turn to construct three multi-scale feature fusion modules, wherein the number of one-dimensional convolution kernels used in the two convolution layers in each module is doubled, and the multi-head self-attention layer in each module has different settings for the feature data segmentation size and the number of attention heads; Step c_3: convert the multi-scale local spectral feature data Input the convolutional layer in a single module to obtain multi-scale feature data with spectral dimension halved and the number of multi-scale features doubled. ; Step c_4: Multi-scale feature data Input multiple self-attention layers in a single module to obtain multi-scale feature fusion data 。 6. The Raman spectrum classification method according to claim 5, characterized in that: Obtain multi-scale feature fusion data The specific formula is as follows: ; ; ; ;in, , Represents the number of one-dimensional convolution kernels in the convolution layer, Represents multi-scale feature data Divide into n-th small feature blocks of size p, Represents the location information of each small feature block; , h represents the number of heads of the multi-head self-attention mechanism, represents the number of one-dimensional convolution kernels contained in each multi-head self-attention mechanism head, and z represents the multi-scale feature data After all blocks are coded, Represents the z initialization weight information. After the vector dot multiplication operation is performed on the two, the weight of each small feature block is obtained. ; Represents the self-attention weight of each small feature block, Represents the final multi-head self-attention weight of each small feature block.

7. The Raman spectrum classification method according to claim 3, characterized in that: The specific process of step d is as follows: Fusion of multi-scale features Input the adaptive mean pooling layer to obtain feature data of the set feature dimension size , feature data Input a fully connected layer to obtain the final category probability output, where the number of output neurons in the fully connected layer is set to the number of categories of the target classification task.

8. A method for classifying species blood and semen based on Raman spectroscopy, characterized in that: The steps include: Step 1: Obtain blood and semen Raman spectral data samples of several species as training sets and test sets; Step 2, applying the Raman spectroscopy classification method according to any one of claims 1 to 7, training a classification model based on the data obtained in step 1, and verifying and optimizing the classification model using a test set; Step 3: Input the real-time Raman spectral data of blood and semen of various species into the optimized classification model to obtain the final classification results.

9. A species classification method based on Raman spectroscopy, characterized in that: The steps include: Step 1: Obtain Raman spectral data samples of arbitrary attributes of several species as training sets and test sets; Step 2, applying the Raman spectroscopy classification method according to any one of claims 1 to 7, training a species classification model based on the data obtained in step 1, and verifying and optimizing the species classification model using a test set; Step 3: Input the real-time Raman spectral data of various species into the optimized species classification model to obtain the final species classification results.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, which are used to execute all or part of the steps of the method described in any one of claims 1 to 7 when called.

Citation Information

Patent Citations

  • A Raman spectroscopic analysis method based on a convolution neural network

    CN109543763A

  • Raman spectrum classification method based on self-attention mechanism

    CN115130566A

  • Raman spectrum classification method, species blood semen and species classification method

    CN117349741A

  • Chair with cool and hot air supply

    KR1020240057119A

  • Gender and race identification from body fluid traces using spectroscopic analysis

    US20190285611A1

Cited By

  • AI-based chemical material detection information library retrieval and standard spectrum comparison system

    CN120108578A

  • Apple water core grade nondestructive testing method based on Vis / NIR and 1DQCNN

    CN121431389A

  • Rapid bacillus plant type identification method based on Raman spectrum and deep learning

    CN121453744A