Raman spectrum classification method and model construction method

By constructing a Raman spectral classification model that includes pre -processing, data increase, and multi -layer convolutional neural networks, it solves the problem of difficulty in capturing the width of the peak in traditional methods and the loss of the width of the peak Classification of spectral data and lightweight model deployment.

CN119357763APending Publication Date: 2025-01-24SHANGHAI MARITIME UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411137218.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

In traditional Raman spectral classification methods, a single-size convolution kernel is difficult to fully capture information of various peak widths, and the coherence of feature information is easily lost, especially when processing large sample size data.

Method used

The construction method of a Raman spectrum classification model is used, including pre -processing, data increase, neural network training and structural heavy parameters. Specific steps include: pre -processing spectral data, increased the training samples through the data widely, and the preliminary characteristics of the use of a convolutional layer and the maximum pooling layer. The layer is degraded and the final lightweight neural network classification model is obtained through the full connection layer.

Benefits of technology

The local feature information that effectively captures spectral data effectively at lower parameters, and retains the coherentity of feature information. It is suitable for mobile device deployment, and the accuracy of 97.1%is obtained in special biological blood classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357763A_ABST
    Figure CN119357763A_ABST
Patent Text Reader

Abstract

The invention discloses a construction method of a Raman spectrum classification model and a classification method, and relates to a classification model in two technical fields of spectroscopy and deep learning, in particular to a lightweight multi-scale special biological blood Raman spectrum classification method combining deep separable convolution, residual connection and structure re-parameterization. In a network model training process, an Adam optimizer is adopted to adjust parameters of the model, so that the model obtains global optimal parameters. And carrying out structure re-parameterization on the trained model to obtain a simplified model suitable for being deployed on the mobile terminal equipment. According to the method, local feature information of spectral data can be effectively captured while the parameter size is low, the continuity of the corresponding feature information is reserved as much as possible, the method achieves a good effect in classification of special biological blood, meanwhile, the model can also be used for classification of Raman spectrums of other substances, and the method has a good application prospect. And the practical value is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of spectroscopy and deep learning, and specifically relates to a Raman spectrum classification method and a model building method. Background Art

[0002] Blood, as one of the most important biological fluids in living organisms, has the unique characteristic of carrying biomarker information and genetic information that other body fluids do not have. In the fields of biopharmaceuticals, species detection, criminal investigation, etc., blood has been widely used and has achieved remarkable research results. Raman spectroscopy is a method for collecting spectroscopic data, which obtains specific information by recording the spectral lines caused by the vibration of sample molecules under light excitation. Due to the different molecular structures of different substances, Raman spectroscopy presents unique characteristics. It has the advantages of convenience, rapidity, and non-destructiveness, so it is widely used in disciplines such as medicine, chemistry, and biology and is highly praised. It is worth noting that peak information plays a vital role in spectral data, which contains key information on the molecular structure and chemical composition of the sample.

[0003] In the early 1970s, Goheent and other scholars began to study the influence of artificial red blood cell membrane peripheral proteins on Raman spectroscopy and achieved remarkable research results. However, the equipment and detection methods at that time were relatively backward, and the detection process was cumbersome, so it could not be well extended to the actual working environment. Subsequently, researchers gradually deepened their research on Raman spectroscopy in blood. Until the 21st century, Raman spectroscopy has been widely used in blood data analysis. In 2008, researchers such as Saade successfully used a near-infrared Raman spectroscopy scheme combining principal component analysis (PCA) with Mahalanobis distance to identify hepatitis C virus in human serum and effectively classified 24 blood samples. This experiment confirmed the feasibility of machine learning in Raman spectroscopy detection of blood. In 2018, researchers such as Kyle C. Doty successfully used partial least squares discriminant analysis (PLS-DA) to distinguish the blood of 17 different organisms, including human blood, which provided important help for forensic examinations at crime scenes, and also provided an important research direction for distinguishing different biological blood data in the future. Subsequently, Wang and other researchers successfully tested the blood spectral data of four poultry species using the support vector machine (SVM) method and provided a new solution for analyzing whether food additives are contained in the blood. However, traditional machine learning algorithms usually fail to achieve the expected results when processing large sample sizes of data.

[0004] With the continuous advancement of deep learning, deep learning technology has been widely used in various disciplines, including Raman spectroscopy classification. The use of deep learning for Raman spectroscopy classification has achieved remarkable research results. However, due to the significant differences in the peak widths presented by different Raman spectral data, the traditional single-size convolution kernel is difficult to fully capture the information of various peak widths. Therefore, one of the main challenges facing the current spectral classification field is how to achieve the compatibility of convolution kernels with information on peaks of different widths. In addition, as Raman spectroscopy is a remote sensing data with coherent information characteristics, traditional convolution operations will to some extent lead to the loss of coherence of feature information. At the same time, considering that Raman spectroscopy detection is mostly used in portable devices, it is very necessary to make the model as lightweight as possible while ensuring accuracy. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a Raman spectrum classification method and a model building method, which solves the problem in the prior art that the traditional single-size convolution kernel is difficult to fully capture the information of various peak widths and the coherence of feature information is lost.

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

[0007] A method for constructing a Raman spectrum classification model comprises the following steps:

[0008] Step S1, preprocessing the spectrum data according to the existing spectrum quality;

[0009] Step S2, obtaining spectral data samples by data augmentation of the processed spectral data to increase the number of samples for model training;

[0010] Step S3, inputting the spectral data sample into the neural network model for training, and passing through a convolution layer and a maximum pooling layer for preliminary extraction of spectral feature information;

[0011] Step S4, passing the initially extracted feature information through four convolutional layers of different dimensions to capture high-dimensional feature information;

[0012] In step S5, the extracted high-dimensional feature information is passed through an adaptive mean pooling layer to reduce the dimension of the feature information, and the reduced-dimensional features are passed through a fully connected layer to obtain the final lightweight neural network classification model.

[0013] During the network model training process, the Adam optimizer is used to adjust the model parameters so that the model obtains the best global parameters.

[0014] The trained model is structurally reparameterized to obtain a streamlined model suitable for deployment on mobile devices.

[0015] The specific process of the structure reparameterization is as follows:

[0016] Step a, the convolutional layer and the normalization layer on the individual branches of the model are merged in sequence to form a convolutional layer with the same effect;

[0017] In step b, the weights of the convolutional layers of different branches are added together to perform convolutional layer fusion. If the convolution kernels have different sizes, the convolution kernel needs to be expanded with a value of 0 to ensure the consistency of the model size and the consistency of stride and padding.

[0018] The calculation formula of the normalization layer is as follows:

[0019]

[0020] The calculation formula of the convolutional layer is as follows:

[0021] conv=W conv ×x+B conv (2)

[0022] Substituting formula (2) into (1) yields the following new convolution operation formula:

[0023]

[0024] Where W bn , W conv are the weights of the convolution operation and the normalization operation, respectively, and B bn and B conv is the bias of the corresponding operation, μ and σ represent the mean and variance respectively, and eps is the value that ensures that the denominator is not 0.

[0025] The process of preprocessing the spectral data in step S1 is as follows:

[0026] First, the Raman spectrum is baseline corrected and denoised, and the spectral data is guaranteed to be non-negative.

[0027] Then, the Raman spectral data is normalized and downsampled to ensure the uniformity of the spectral data.

[0028] In step S2, data augmentation includes two methods:

[0029] The first method combines the spectral data with the signal-to-noise ratio and adds Gaussian noise with a variance of σ and a mean of 0 to the spectral data;

[0030] The second method is to shift the spectral data left and right to simulate the process of manual data collection and obtain an augmented data set.

[0031] The variance σ is calculated using the following formula:

[0032]

[0033] Among them, P signal To represent the power of the input Raman spectrum data, it can be calculated by its mean square value, that is, Here N represents the total number of data points in the input spectral data, x i represents the corresponding intensity value, and SNR is the signal-to-noise ratio intensity.

[0034] The Raman spectrum classification method comprises the following steps:

[0035] Step 1: Divide the collected real samples and retain a part of the real sample data for testing;

[0036] Step 2: For the divided samples that do not participate in the training, data augmentation is performed by setting the signal-to-noise ratio and translation amplitude;

[0037] Step 3: Divide the augmented data samples into training set and validation set;

[0038] Step 4: Input the training sample set into the Raman spectrum classification model to obtain preliminary classification results;

[0039] Step 5: Select the appropriate training scheme to optimize the model accuracy and narrow the gap between the predicted classification results and the actual results;

[0040] Step 6: Input the validation set data into the model and further adjust the parameters to optimize the model so that it can obtain effective prediction results on the validation set;

[0041] Step 7: Input the real test data blood spectrum set into the model to determine the real prediction effect of the model;

[0042] Step 8: Perform structural reparameterization on the trained final model and save the corresponding model weights.

[0043] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, call all or part of the steps of the method.

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

[0045] 1. This method can effectively capture the local characteristic information of spectral data while having a low parameter size and retain the consistency of the corresponding characteristic information as much as possible. In addition, during the model deployment process, the model also adopts a structural reparameterization method to make the model more suitable for deployment in mobile devices. This method has achieved good results in the classification of special biological blood. At the same time, the model can also be used in the classification of Raman spectra of other substances, and has high practical value.

[0046] 2. The lightweight multi-scale special biological blood Raman spectroscopy classification method proposed in the present invention, which combines deep separable convolution, residual connection and structural reparameterization, can quickly identify blood samples between different special organisms, making an important contribution to combating the smuggling of blood products, and the average classification effect reaches 97.1%.

[0047] 3. Compared with other current classification models, this model has higher accuracy, faster reasoning speed and lower model parameters, making it extremely suitable for customs, market supervision departments and other agencies. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 The network calculation process of the method of the present invention and its corresponding actual network structure diagram.

[0049] Figure 2 The original image of the blood spectrum and the spectral data after preprocessing and data augmentation.

[0050] Figure 3 This is a graph of network training loss and accuracy.

[0051] Figure 4 This is the confusion matrix result diagram of the network after structural reparameterization used in the test set to predict the blood of unknown species.

[0052] Figure 5 This is the ROC curve result of the network after structural reparameterization and used in the test set to predict the blood of unknown species. DETAILED DESCRIPTION

[0053] The structure and working process of the present invention will be further described below in conjunction with the accompanying drawings.

[0054] The present invention provides a lightweight classification model that combines deep separable convolution, residual connection, and multi-scale convolution kernels, which captures local feature information while retaining the coherence of the corresponding feature information as much as possible. In terms of model implementation, we use structural reparameterization technology to further streamline the number of model parameters to ensure that it is applicable to almost all mobile devices.

[0055] A method for constructing a Raman spectrum classification model comprises the following steps:

[0056] Step S1, preprocessing the spectrum data according to the existing spectrum quality;

[0057] Step S2, obtaining spectral data samples by data augmentation of the processed spectral data to increase the number of samples for model training;

[0058] Step S3, inputting the spectral data sample into the neural network model for training, and passing through a convolution layer and a maximum pooling layer for preliminary extraction of spectral feature information;

[0059] Step S4, passing the initially extracted feature information through four convolutional layers of different dimensions to capture high-dimensional feature information;

[0060] In step S5, the extracted high-dimensional feature information is passed through an adaptive mean pooling layer to reduce the dimension of the feature information, and the reduced-dimensional features are passed through a fully connected layer to obtain the final lightweight neural network classification model.

[0061] During the network model training process, the Adam optimizer is used to adjust the model parameters so that the model obtains the best global parameters.

[0062] The trained model is structurally reparameterized to obtain a streamlined model suitable for deployment on mobile devices.

[0063] The specific process of the structure reparameterization is as follows:

[0064] Step a, the convolutional layer and the normalization layer on the individual branches of the model are merged in sequence to form a convolutional layer with the same effect;

[0065]

[0066] conv=W conv ×x+B conv (2)

[0067]

[0068] In the above formula, (1) and (2) are the calculation formulas for the normalization layer and the convolution layer respectively. Substituting formula (2) into (1) can obtain formula (3). Formula (3) is a new convolution operation, and its effect is the same as that of (1) and (2) respectively. bn , W conv are the weights of the convolution operation and the normalization operation, respectively, and B bn and B conv is the bias of the corresponding operation, μ and σ represent the mean and variance respectively, and eps is the value that ensures that the denominator is not 0.

[0069] Step b, add the weights of the convolution layers of different branches after fusion, so as to perform convolution layer fusion. If the convolution kernels are of different sizes, the convolution kernels need to be expanded with a value of 0 to ensure the consistency of the model size. In addition, the stride and padding need to be kept consistent. The convolution and sizes used in this paper are 3*1 and 11*1 respectively, but considering the diversity of feature information of different spectral data, the convolution and sizes can be set according to the specific situation.

[0070] The process of preprocessing the spectral data in step S1 is as follows:

[0071] First, the Raman spectrum is baseline corrected and denoised, and the spectral data is guaranteed to be non-negative.

[0072] Then, the Raman spectral data is normalized and downsampled to ensure the uniformity of the spectral data.

[0073] In step S2, data augmentation includes two methods:

[0074] The first method combines the spectral data with the signal-to-noise ratio and adds Gaussian noise with a variance of σ and a mean of 0 to the spectral data;

[0075] The second method is to shift the spectral data left and right to simulate the process of manual data collection and obtain an augmented data set.

[0076] The variance σ is calculated using the following formula:

[0077]

[0078] Among them, P signal To represent the power of the input Raman spectrum data, it can be calculated by its mean square value, that is, Here N represents the total number of data points in the input spectral data, x i represents the corresponding intensity value, and SNR is the signal-to-noise ratio intensity.

[0079] The Raman spectrum classification method comprises the following steps:

[0080] Step 1: Divide the collected real samples and retain a portion of the real sample data for testing; you can choose to retain 10% of the real sample data for testing;

[0081] Step 2: For the divided samples that do not participate in the training, data augmentation is performed by setting the signal-to-noise ratio and translation amplitude to deal with the imbalance of data samples;

[0082] Step 3: Divide the augmented data samples into training set and validation set to observe the performance of the model during the training process;

[0083] Step 4: Input the training sample set into the Raman spectroscopy classification model to obtain preliminary classification results. It should be noted that the model has not yet learned the internal information of different Raman spectroscopy data, so the prediction results at this time are often far from the actual data category.

[0084] Step 5: Select the appropriate training scheme to optimize the model accuracy, for example, select a better optimizer, select the appropriate loss function, etc., to narrow the gap between the predicted classification results and the actual results;

[0085] Step 6: Input the validation set data into the model and further adjust the parameters to optimize the model so that it can obtain effective prediction results on the validation set;

[0086] Step 7: Input the real test data blood spectrum set into the model to determine the real prediction effect of the model;

[0087] Step 8: Perform structural reparameterization on the trained final model and save the corresponding model weights to make it lighter while retaining its original accuracy.

[0088] Specific embodiments, such as Figures 1 to 5 As shown,

[0089] The dataset used in this example is from the National Key R&D Program for Special Biological Resources Monitoring and Traceability Technology Research (2018YFC1200205). The reflective and transmissive Raman blood spectra of golden monkeys are as follows: Figure 2 As shown in the figure, the data includes 28 types of national rare animals such as kangaroos, chickens, and pandas, as well as common animals in daily life. The reflective Raman blood dataset contains 2696 records, and the transmission Raman blood dataset contains 2620 records. Figure 1 As shown, the implementation steps of the method are as follows:

[0090] Step S1: preprocess the spectral data by baseline correction and spectral denoising according to the existing spectral quality.

[0091] Step S11, considering the influence of external environmental factors and human interference in the Raman spectrum acquisition process, baseline correction and denoising operations are performed on the Raman spectrum, and the spectrum data is guaranteed to be non-negative. In this example, the influence of the acquisition environment is considered, and some spectra have noise, and some data have duplication;

[0092] Step S12, normalize and downsample the Raman spectrum data to ensure the uniformity of the spectrum data and help the model converge faster. In this example, the lengths of different spectrum data are not uniform due to collection reasons. After preprocessing, the dimensions of the reflective Raman spectrum are fixed at (1, 1400), and the lengths of the transmission Raman spectrum are fixed at (1, 960). The preprocessed spectrum data are as follows: Figure 3 As shown;

[0093] Step S2, using the processed high-quality spectral data to increase the number of samples for model training by means of data augmentation, the specific implementation steps are as follows:

[0094] σ=P_signal / 〖10〗^(SNR / 10)

[0095] Step S21, the preprocessed data set is augmented in two ways. One is to add Gaussian noise with a variance of σ and a mean of 0 to the spectral data using the above formula in combination with the signal-to-noise ratio. The other is to shift the spectral data left and right to simulate the process of artificial data collection. The augmented data set is more balanced and can help the model learn more internal feature information. In this example, since some data are too precious and the number of samples is scarce, we use a signal-to-noise ratio of 0.1 and a phase shift of 16 to expand the reflective blood data set from 2696 to 5600 and the transmissive blood data set from 2620 to 5755. The corresponding results are shown in the figure. Figure 3 As shown;

[0096] Step S3, the spectral data is passed through a convolution layer and a maximum pooling layer for preliminary extraction of spectral feature information. The specific implementation steps are as follows:

[0097] Step S31, the processed spectral data X0 is input into the convolution layer (S3-1) with a dimension of 16. The convolution layer (S3-1) uses a convolution kernel of 7*1 and a step size of 2. The obtained characteristic spectral information X1 is simplified and its length is half of that of the input. After the feature extraction, the dimension of the reflective spectral data is (16, 700), and the dimension of the transmission spectral data is (16, 480).

[0098] In step S32, the extracted feature data X1 is input into a maximum pooling layer (S3-2) composed of a filter with a size of 3*1 and a step length of 2, and the feature information is refined by reducing the length of the feature information, and the feature information X2 obtained is half the length of the input feature information. In this embodiment, after the feature data X1 passes through the maximum pooling layer, the dimension of the reflection spectrum becomes (16, 350), and the dimension of the transmission spectrum becomes (16, 240).

[0099] Step S4, the initially extracted feature information is passed through four convolutional layers of different dimensions to capture more detailed local information and coherent information:

[0100] In step S41, the streamlined feature information X2 is passed through a high-dimensional feature extraction layer (S4-1) with multi-scale convolution kernels and residual connections, and the feature information extracted in each layer is used as the input feature of the next layer, passing through four stages of feature information extraction in different dimensions.

[0101] Step S411, each feature extraction layer is formed by two convolution kernels of different scales, 3*1 and 7*1. The model extracts local spectral information through deep convolution, adds the outputs of the two convolution kernels with residual connection, and then fuses the local information with the global coherent information through point-by-point convolution. The characteristic information is deeply acquired through four layers of feature information extraction stages with different dimensions (16, 32, 64, 128). Each dimension is extracted 2, 2, 4, and 1 times, and finally the characteristic information X3 is obtained. In the example, the output dimension of the reflectance spectrum data is (128, 350), and the output dimension of the transmission spectrum data is (128, 240);

[0102] Step S5: The extracted high-dimensional feature information is passed through an adaptive mean pooling layer to reduce the dimension of the feature information, and the reduced-dimensional features are passed through a fully connected layer to obtain the final classification effect:

[0103] Step S41, the extracted feature information X3 is subjected to dimensionality reduction processing through the adaptive average pooling layer (S5-1), so that it can better pass through the subsequent fully connected layer (S5-2), and finally obtains the feature data X4. In this example, after the feature data passes through the adaptive average pooling layer, the dimensions of the spectral data are respectively changed to the reflection Raman spectrum (128, 1) and the transmission Raman spectrum (128, 1), and then the feature data is flattened and connected to the fully connected layer to output the probabilities of 28 categories respectively, where the maximum probability is the model prediction classification;

[0104] In step S6, during the network training process, the Adam optimizer is used to help the model adjust parameters so that the model can obtain the best global parameters and achieve the best classification effect:

[0105] Step S61, the network training loss function selects the cross entropy loss function to evaluate the gap between the model prediction result and the actual result, and combines Adam optimization to help the model adjust the optimal parameters, so that the model can achieve the best classification effect; in this example, the model is trained using 80 epochs, in which the difference between 28 species is used to predict species, such as Figure 4As shown in the figure, the loss and accuracy of the model decrease and increase steadily during the training process until the model achieves the best classification effect.

[0106] Step S7: The trained model is further simplified through structural reparameterization technology to ensure the accuracy of the classification model, making it more suitable for deployment on portable devices such as mobile terminals. The specific implementation steps are as follows:

[0107] Step S71, the variance, scaling factor and offset of the convolution layer in the feature extraction layer and its respective normalization layer are merged, and the 3*1 convolution kernel is expanded to the left and right using the value 0 to turn it into an 11*1 convolution kernel. By fusing the parameters of the convolution kernel, the multiple convolution kernels of the feature extraction layer are transformed into a single convolution kernel with a simple structure, so that the parameters are reduced and the inference speed is increased without affecting the accuracy of the model.

[0108] Conv(x)=W(x)+b

[0109] BN(x)=γ(x-μ) / σ+β

[0110] BN(Conv(x))=γ / σW(x)+γ(b-μ) / σ+β

[0111] Conv'(x)=W'(x)+b'

[0112] In this example, the parameter size of the model dropped from 0.3M before the merger to 0.24M, and the inference speed dropped from 0.07G (transmission) and 0.1G (reflection) to 0.06G and 0.08G respectively, which ensured that the accuracy and other performance of the model did not decrease.

[0113] Step S8, after the network model training is completed, it can be used in the actual spectral detection classification task. In this embodiment, the test set data is put into the model after structural reparameterization, and the classification result is output. The total amount of reflectance and transmission blood spectrum data in the test set is 519 and 535 respectively. The confusion matrix and ROC curve of the classification effect are shown in Figure 2. Figure 5 shown.

[0114] The present invention is based on Raman spectral data and combines modules and steps such as data preprocessing, data augmentation, deep separable convolution, residual connection, multi-scale convolution kernel and structural reparameterization to complete Raman spectral classification. It can quickly and accurately classify the Raman spectra of special biological blood, and can be applied to customs, market supervision bureau and other agencies to effectively combat illegal activities such as smuggling of blood products.

[0115] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0116] 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 the present solution and are not described in detail here.

[0117] It should be understood that the present solution is not limited to the above-mentioned specific implementation methods, and the devices and structures not described in detail should be understood to be implemented in a common manner in the art; any technician familiar with the art can use the above-disclosed methods and technical contents to make many possible changes and modifications to the technical solution of the present solution without departing from the scope of the technical solution of the present solution, or modify it into an equivalent embodiment with equivalent changes, which does not affect the essential content of the present solution. Therefore, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present solution without departing from the content of the technical solution of the present solution still falls within the scope of protection of the technical solution of the present solution.

Claims

1. A method for constructing a Raman spectroscopy classification model, characterized in that: The steps include: Step S1, preprocessing the spectrum data according to the existing spectrum quality; Step S2, obtaining spectral data samples by data augmentation of the processed spectral data to increase the number of samples for model training; Step S3, inputting the spectral data sample into the neural network model for training, and passing through a convolution layer and a maximum pooling layer for preliminary extraction of spectral feature information; Step S4, passing the initially extracted feature information through four convolutional layers of different dimensions to capture high-dimensional feature information; In step S5, the extracted high-dimensional feature information is passed through an adaptive mean pooling layer to reduce the dimension of the feature information, and the reduced-dimensional features are passed through a fully connected layer to obtain the final lightweight neural network classification model.

2. The method for constructing a Raman spectroscopy classification model according to claim 1, characterized in that: During the network model training process, the Adam optimizer is used to adjust the model parameters so that the model obtains the best global parameters.

3. The method for constructing a Raman spectroscopy classification model according to claim 2, characterized in that: The trained model is structurally reparameterized to obtain a streamlined model suitable for deployment on mobile devices.

4. The method for constructing a Raman spectroscopy classification model according to claim 3, characterized in that: The specific process of the structure reparameterization is as follows: Step a, the convolutional layer and the normalization layer on the individual branches of the model are merged in sequence to form a convolutional layer with the same effect; In step b, the weights of the convolutional layers of different branches are added together to perform convolutional layer fusion. If the convolution kernels have different sizes, the convolution kernel needs to be expanded with a value of 0 to ensure the consistency of the model size and the consistency of stride and padding.

5. The method for constructing a Raman spectrum classification model according to claim 4, characterized in that: The calculation formula of the normalization layer is as follows: The calculation formula of the convolutional layer is as follows: conv=W conv ×x+B conv (2) Substituting formula (2) into (1) yields the following new convolution operation formula: Where W bn , W conv are the weights of the convolution operation and the normalization operation, respectively, and B bn and B conv is the bias of the corresponding operation, μ and σ represent the mean and variance respectively, and eps is the value that ensures that the denominator is not 0.

6. The method for constructing a Raman spectroscopy classification model according to claim 1, characterized in that: The process of preprocessing the spectral data in step S1 is as follows: First, the Raman spectrum is baseline corrected and denoised, and the spectral data is guaranteed to be non-negative. Then, the Raman spectral data is normalized and downsampled to ensure the uniformity of the spectral data.

7. The method for constructing a Raman spectrum classification model according to claim 1, characterized in that: In step S2, data augmentation includes two methods: The first method combines the spectral data with the signal-to-noise ratio and adds Gaussian noise with a variance of σ and a mean of 0 to the spectral data; The second method is to shift the spectral data left and right to simulate the process of manual data collection and obtain an augmented data set.

8. The method for constructing a Raman spectrum classification model according to claim 7, characterized in that: The variance σ is calculated using the following formula: Among them, P signal To represent the power of the input Raman spectrum data, it can be calculated by its mean square value, that is, Here N represents the total number of data points in the input spectral data, x i represents the corresponding intensity value, and SNR is the signal-to-noise ratio intensity.

9. A Raman spectrum classification method based on the model described in any one of claims 1 to 8, characterized in that: The steps include: Step 1: Divide the collected real samples and retain a part of the real sample data for testing; Step 2: For the divided samples that do not participate in the training, data augmentation is performed by setting the signal-to-noise ratio and translation amplitude; Step 3: Divide the augmented data samples into training set and validation set; Step 4: Input the training sample set into the Raman spectrum classification model to obtain preliminary classification results; Step 5: Select the appropriate training scheme to optimize the model accuracy and narrow the gap between the predicted classification results and the actual results; Step 6: Input the validation set data into the model and further adjust the parameters to optimize the model so that it can obtain effective prediction results on the validation set; Step 7: Input the real test data blood spectrum set into the model to determine the real prediction effect of the model; Step 8: Perform structural reparameterization on the trained final model and save the corresponding model weights.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, all or part of the steps of the method described in any one of claims 1 to 9 are called.

Citation Information

Cited By

  • Mixed solution Raman spectrum generation method and device, medium and equipment

    CN120673886A