Pathogenic bacteria typing method based on Raman spectrum weight analysis

By pre-processing and weighting the Raman spectral data of the pathogenic bacteria, the Raman spectral differences between pathogens are enhanced by using gradient weighted activation mapping algorithms, the problem of poor typing effect of pathogens in the prior art is solved, and a higher typing accuracy is achieved.

CN119760474AActive Publication Date: 2025-04-04HARBIN INST OF TECH

Patent Information

Application Number
CN202411842263.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-04
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

In the prior art, the Raman characteristic peak has no significant effect in pathogen classification, resulting in poor pathogen classification effect, especially the processing effect of low signal-to-noise ratio and low differential data.

Method used

The pathogenic bacteria typing method based on Raman spectral weight analysis was adopted, and the pathogenic Raman spectral data were preprocessed and weighted, and the gradient weighted activation mapping algorithm was used to calculate the importance of different Raman spectral segments, enhance the Raman spectral differences between pathogens, and optimize the training pathogenic bacteria typing model.

Benefits of technology

It improves the accuracy of pathogenic bacterial typing, especially when processing low signal-to-noise ratio and low differential data, and enhances the role of Raman characteristic peaks in classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760474A_ABST
    Figure CN119760474A_ABST
Patent Text Reader

Abstract

The invention discloses a pathogenic bacteria typing method based on Raman spectrum weight analysis, and belongs to the technical field of pathogenic bacteria Raman spectrum data typing. According to the method, the problem that the pathogenic bacteria typing effect is poor due to the fact that the Raman characteristic peak is not significant in the pathogenic bacteria classification and the low signal-to-noise ratio and the low difference of Raman data is solved. The method comprises the following steps of: pre-training a pathogenic bacteria typing model by utilizing preprocessed Raman spectrum data of the pathogenic bacteria, calculating the importance degrees of different Raman spectrum sections in the Raman spectrum data to pathogenic bacteria typing through gradient weighted class activation mapping, and weighting the Raman spectrum data of the pathogenic bacteria according to the importance degrees. According to the method, a Raman spectrum segment with small contribution degree to pathogenic bacteria classification is weakened, Raman spectrum data differences among pathogenic bacteria are amplified, and a pathogenic bacteria typing model is optimized and trained by using the weighted Raman spectrum data, so that the pathogenic bacteria typing effect is improved. The method can be applied to pathogenic bacteria typing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of pathogen Raman spectroscopy data typing, and in particular relates to a pathogen typing method based on Raman spectroscopy weight analysis. Background Art

[0002] Raman spectroscopy is a spectral analysis technology developed based on the principle of Raman scattering. It detects the structure and composition of biological macromolecules such as nucleic acids, proteins, and lipids in biological samples to achieve the detection of biological samples. Raman spectroscopy has the characteristics of simplicity, speed, high real-time performance, non-destructive detection, high sensitivity, and rich spectral information. It has been widely used in the fields of bacterial infection, pathogen typing, and bacterial resistance analysis. With the increasing demand for rapid analysis of Raman spectroscopy technology in actual scenarios, it has further promoted the development of Raman spectroscopy data processing, Raman spectroscopy data feature extraction, and Raman spectroscopy data analysis.

[0003] Raman detection technology has made certain research progress in the typing of clinical pathogens, but the current research focus is mainly on clinical sample processing and the design of pathogen Raman detection strategies. Pathogen typing methods are mainly based on traditional machine learning and Raman spectroscopy typing models based on CNN network structure. Although the typing of pathogen Raman data can be achieved, due to insufficient analysis of the collected pathogen Raman spectroscopy data, the typing effect of pathogens with low signal-to-noise ratio Raman data and low difference data has been poor.

[0004] Raman characteristic peaks are the core of distinguishing different types of pathogens from each other, but there are no obvious differences in characteristic peaks between different subtypes of pathogens or low signal-to-noise ratio Raman data actually collected. At this stage, the main method is to import the entire Raman spectrum data into machine learning or convolutional neural network models to achieve pathogen typing. Although importing the entire collected Raman data into the classification model to achieve pathogen typing can ensure that Raman data information is not lost, there are problems such as the Raman characteristic peaks not playing a significant role in pathogen classification, and the presence of spectral segments that contribute little to classification will weaken the data differences between different types of pathogens, affecting the classification effect of the model. Summary of the invention

[0005] The purpose of the present invention is to solve the problem that the effect of pathogen typing is not significant due to the insignificant effect of Raman characteristic peaks in pathogen classification and the low signal-to-noise ratio and low difference of Raman data, and propose a pathogen typing method based on Raman spectral weight analysis.

[0006] The technical solution adopted by the present invention to solve the above technical problems is: a pathogen typing method based on Raman spectroscopy weight analysis, the method specifically comprising the following steps:

[0007] Step 1: respectively collecting spectral data of various pathogens in the Raman shift range of λ to λ0, and preprocessing the collected Raman spectral data to obtain preprocessed Raman spectral data;

[0008] Step 2: pre-training the pathogen typing model using the pre-processed Raman spectroscopy data to obtain a pre-trained pathogen typing model;

[0009] The input of the pre-training process is the pre-processed Raman spectral data of various pathogens, the output of the pre-training process is the predicted categories of various pathogens, and the labels of the pre-training process are the true categories of various pathogens;

[0010] Step 3: weighting the pre-processed Raman spectral data of various pathogens based on the pre-trained pathogen typing model to obtain a weighted Raman spectral data set;

[0011] Step 4: Use the weighted Raman spectroscopy data set to train the pre-trained pathogen typing model to obtain a trained pathogen typing model;

[0012] The input of the training process is the weighted Raman spectral dataset, the output of the training process is the predicted categories of various pathogens, and the labels of the training process are the true categories of various pathogens;

[0013] Step 5: After preprocessing the Raman spectrum data of the pathogen to be typed, the preprocessed Raman spectrum data is weighted, and the weighted Raman spectrum data is input into the trained pathogen typing model to obtain the typing result of the pathogen to be typed.

[0014] Furthermore, the value of λ is 400 cm -1 , the value of λ0 is 1800cm -1 .

[0015] Furthermore, the pretreatment process in step 1 is:

[0016] Step 11: De-noising the collected Raman spectrum data of pathogens to obtain de-noised Raman spectrum data;

[0017] Step 12: performing baseline processing on the denoised Raman spectrum data to obtain baseline processed Raman spectrum data;

[0018] Step 13: normalize the data intensity at each Raman shift in the baseline-processed Raman spectrum data to obtain normalized Raman spectrum data, that is, obtain pre-processed Raman spectrum data.

[0019] Furthermore, in the step 11, the denoising process is implemented by using a polynomial smoothing method.

[0020] Furthermore, in steps one and two, the baseline processing is implemented by using an adaptive iterative reweighted penalized least squares method.

[0021] Furthermore, the pathogen typing model includes the first convolution module to the nth convolution module, a flattening layer and a fully connected layer in sequence, and each convolution module includes a convolution layer, a batch normalization layer and a ReLU activation function layer.

[0022] Furthermore, the specific process of step three is:

[0023] Step 31. For any kind of pre-processed Raman spectral data of a pathogen, when the pre-processed Raman spectral data of the pathogen is used as the input of the pre-trained pathogen typing model, the feature map output by the convolution layer in the nth convolution module of the pre-trained pathogen typing model is denoted as A, the true category of the pathogen is denoted as c, and the prediction score of the pre-trained pathogen typing model for the true category c is denoted as y c , record the data at coordinate (i, j) in the kth channel of feature map A as Then relative to the true category c, the weight of the feature map A in the kth channel is for:

[0024]

[0025] Among them, M is the width of the feature map, and N is the height of the feature map;

[0026] according to And the k-th channel feature map output by the convolution layer in the n-th convolution module, calculate the gradient weighted class activation map heat map intensity value of the preprocessed Raman spectral data of the pathogen at each Raman shift:

[0027]

[0028] Where K is the number of channels and ReLU(·) is the activation function;

[0029] Arrange the intensity values ​​of the gradient weighted class activation mapping heat map of the pathogen at each Raman shift in descending order, select the Raman shift corresponding to the intensity values ​​in the first L positions, and determine the Raman spectrum segment with a weight of w1 corresponding to the pathogen according to the selected Raman shift;

[0030] Step 32: using the method of step 31 to process the pre-processed Raman spectrum data of each pathogen, respectively, to obtain Raman spectrum segments with a weight of w1 corresponding to each pathogen, and then taking the union of the Raman spectrum segments with a weight of w1 corresponding to each pathogen, to obtain all Raman spectrum segments with a weight of w1;

[0031] Step 33: In the Raman shift range from λ to λ0, obtain other Raman spectral segments except the Raman spectral segment with weight w1, and set the weights of the other Raman spectral segments to w2, and w1>w2;

[0032] Step 34: Use weight w1 and weight w2 to perform weighted processing on the pre-processed Raman spectrum data of each pathogen to obtain the weighted Raman spectrum data of each pathogen.

[0033] Furthermore, the Raman spectrum segment with a weight of w1 corresponding to the pathogen is determined according to the selected Raman shift, specifically:

[0034] The selected lth Raman shift is denoted as λ l , l=1,2,…,L;

[0035] If m l 100+50<λ l ≤(m l +1)·100,m l If the value of is a positive integer, the Raman shift is m l 100+50 to (m l +1)·100, the weight of the Raman spectrum is recorded as w1;

[0036] If m l 100<λ l ≤(m l +1)·100-50,m l If the value of is a positive integer, the Raman shift is m l 100 to m l ·1)·The weight of the Raman spectrum band from 100 to 50 is denoted as w1.

[0037] Furthermore, the specific process of steps three and four is as follows:

[0038] Pre-treated Raman spectral data of any pathogen

[0039] The weight w1 is multiplied by the spectral value of the Raman spectrum obtained in step 32, and the weight w2 is multiplied by the spectral value of the Raman spectrum obtained in step 33 to obtain the weighted Raman spectrum data of the pathogen.

[0040] Furthermore, the specific process of step five is as follows:

[0041] Step 51: pre-processing the Raman spectrum data of the pathogen to be typed;

[0042] Step 52: according to the Raman spectrum segment with weight w1 obtained in step 32, the weight of the corresponding Raman spectrum segment in the Raman spectrum data preprocessed in step 51 is set to w1, and the weights of other Raman spectrum segments are set to w2;

[0043] Performing weighted processing on the Raman spectrum data preprocessed in step 51 according to the weights set for each Raman spectrum segment to obtain weighted Raman spectrum data;

[0044] Step 53: Input the weighted Raman spectrum data in step 52 into the trained pathogen typing model to obtain the typing result of the pathogen to be typed.

[0045] The beneficial effects of the present invention are:

[0046] The present invention proposes a pathogen typing method based on Raman spectrum weight analysis. After preprocessing the pathogen Raman spectrum data, the preprocessed Raman spectrum data is input into the pathogen typing model for pre-training, and then the importance of different Raman spectrum segments in the Raman spectrum data to the pathogen typing is calculated by gradient weighted class activation mapping. The pathogen Raman spectrum data is weighted according to the gradient weighted class activation mapping heat map result, thereby weakening the Raman spectrum segments with small contribution to the pathogen classification, amplifying the Raman spectrum data differences between pathogens, and enhancing the role of Raman characteristic peaks in pathogen classification. The weighted Raman spectrum data is imported into the pathogen typing model for optimization training, thereby improving the effect of pathogen typing, and the method of the present invention can also obtain good typing effect for Raman data with low signal-to-noise ratio and low difference. The method of the present invention can not only be used for Raman spectrum typing of pathogens, but also can be extended to Raman spectrum data classification applications in other fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 It is a flow chart of a pathogen typing method based on Raman spectrum weight analysis of the present invention;

[0048] Figure 2 It is a network structure diagram of the pathogen typing model constructed by the present invention;

[0049] Figure 3a This is the Raman spectrum weight analysis result of Enterococcus faecalis 1 type pathogen calculated by the method of the present invention:

[0050] Figure 3b This is the Raman spectrum weight analysis result of Enterococcus faecalis 2 type pathogen calculated by the method of the present invention:

[0051] Figure 3cThis is the Raman spectrum weight analysis result of Enterococcus faecium type pathogens calculated by the method of the present invention:

[0052] Figure 3d This is the Raman spectrum weight analysis result of Klebsiella aerogenes type pathogen calculated by the method of the present invention:

[0053] Figure 3e This is the Raman spectrum weight analysis result of Enterobacter cloacae type pathogens calculated by the method of the present invention:

[0054] Figure 3f This is the Raman spectrum weight analysis result of Staphylococcus aureus (MSSA 3) type pathogen calculated by the method of the present invention:

[0055] Figure 3g This is the Raman spectrum weight analysis result of Staphylococcus aureus (MRSA 1, isogenic) type pathogen calculated by the method of the present invention:

[0056] Figure 3h This is the Raman spectrum weight analysis result of Streptococcus pyogenes (Group A) type pathogen calculated by the method of the present invention:

[0057] Figure 3i The Raman spectrum weight analysis result of Streptococcus dysgalactiae (Group C) type pathogen calculated by the method of the present invention is:

[0058] Figure 3j The Raman spectrum weight analysis result of Streptococcus dysgalactiae (Group G) type pathogen calculated by the method of the present invention is:

[0059] Figure 4a is the confusion matrix of the original Raman spectra for pathogen typing;

[0060] Figure 4b It is the confusion matrix of Raman spectra for pathogen typing after weighted processing. DETAILED DESCRIPTION

[0061] Specific implementation method 1: Combination Figure 1 The present embodiment is described as follows. The pathogen typing method based on Raman spectroscopy weight analysis described in the present embodiment specifically comprises the following steps:

[0062] Step 1: respectively collecting spectral data of various pathogens in the Raman shift range of λ to λ0, and preprocessing the collected Raman spectral data to obtain preprocessed Raman spectral data;

[0063] Step 2: pre-training the pathogen typing model using the pre-processed Raman spectroscopy data to obtain a pre-trained pathogen typing model;

[0064] The input of the pre-training process is the pre-processed Raman spectral data of various pathogens, the output of the pre-training process is the predicted categories of various pathogens, and the labels of the pre-training process are the true categories of various pathogens;

[0065] Step 3: weighting the pre-processed Raman spectral data of various pathogens based on the pre-trained pathogen typing model to obtain a weighted Raman spectral data set;

[0066] Step 4: Use the weighted Raman spectroscopy data set to train the pre-trained pathogen typing model to obtain a trained pathogen typing model;

[0067] The input of the training process is the weighted Raman spectral dataset, the output of the training process is the predicted categories of various pathogens, and the labels of the training process are the true categories of various pathogens;

[0068] Step 5: After preprocessing the Raman spectrum data of the pathogen to be typed, the preprocessed Raman spectrum data is weighted, and the weighted Raman spectrum data is input into the trained pathogen typing model to obtain the typing result of the pathogen to be typed.

[0069] The present invention solves the problem that the Raman characteristic peaks in the existing pathogen Raman spectral data typing algorithm have no significant effect in the pathogen typing model and the Raman spectrum segments irrelevant to pathogen typing are not eliminated, which weakens the data differences between different types of pathogens. The present invention first pre-processes the pathogen Raman spectral data, builds and pre-trains the pathogen typing model; secondly, the gradient weighted class activation mapping algorithm is used to calculate the importance of different spectral segments in the Raman spectral data to the pathogen typing, and the Raman spectral data set is weighted according to the calculation results to construct a new pathogen typing data set; finally, the newly constructed pathogen typing data set is used to optimize the training and constructed pathogen typing model, and finally the accurate typing of pathogens is achieved. Compared with the prior art, the present invention enhances the Raman spectral differences between different types of pathogens by weighted processing of the Raman spectral data of the pathogen to be typed, which can effectively improve the typing accuracy of pathogens, and is conducive to promoting the application of pathogen typing methods based on Raman spectroscopy technology in food safety, clinical diagnosis and treatment and other fields.

[0070] Specific implementation method 2: This implementation method is different from the specific implementation method 1 in that the value of λ is 400cm -1 , the value of λ0 is 1800cm -1 .

[0071] The other steps and parameters are the same as those in the first embodiment.

[0072] Specific implementation method three: This implementation method is different from specific implementation methods one or two in that the pretreatment process in step one is:

[0073] Step 11: De-noising the collected Raman spectrum data of pathogens to obtain de-noised Raman spectrum data;

[0074] Step 12: performing baseline processing on the denoised Raman spectrum data to obtain baseline processed Raman spectrum data;

[0075] Step 13: normalize the data intensity at each Raman shift in the baseline-processed Raman spectrum data to obtain normalized Raman spectrum data, that is, obtain pre-processed Raman spectrum data.

[0076] The other steps and parameters are the same as those in the first or second embodiment.

[0077] In this implementation, the normalization processing method adopted is the minimum-maximum normalization algorithm, and the calculation formula is: x*=(x-min) / (max-min).

[0078] Specific implementation method 4: This implementation method is different from specific implementation methods 1 to 3 in that in step 1, the denoising process is implemented by using a polynomial smoothing method (SG).

[0079] The other steps and parameters are the same as those in Specific Embodiments 1 to 3.

[0080] In this implementation, the window length of the polynomial smoothing method is set to 3-21, and the polynomial smoothing order is set to 1-11.

[0081] Specific implementation method five: This implementation method is different from any one of specific implementation methods one to four in that in step one and two, the baseline processing is implemented by using an adaptive iterative reweighted penalized least squares method (airPLS).

[0082] The other steps and parameters are the same as those in Specific Embodiments 1 to 4.

[0083] In this implementation, the regularization parameter of the adaptive iterative reweighted penalty least squares method is set to 11-151, the penalty factor is set to 1-11, and the number of iterations is set to 11-91.

[0084] Specific implementation method six: The difference between this implementation method and any one of specific implementation methods one to five is that the pathogen typing model includes the first convolution module to the nth convolution module, a flattening layer and a fully connected layer in sequence, and each convolution module includes a convolution layer, a batch normalization layer and a ReLU activation function layer.

[0085] The other steps and parameters are the same as those in Specific Implementation Methods 1 to 5.

[0086] In the present invention, the input of the pathogen typing model is first used as the input of the first convolution module. In the first convolution module, the input passes through the convolution layer, batch normalization layer and ReLU activation function layer in sequence, and the output of the ReLU activation function layer is used as the output of the first convolution module, and then the output of the first convolution module is used as the input of the second convolution module. By analogy, the output of the nth convolution module is used as the input of the flattening layer, and then the output of the flattening layer is used as the input of the fully connected layer, and the output of the fully connected layer is used as the output of the pathogen typing model. The value of n is 2 to 8, the number of convolution kernels is 2 to 8, the convolution step is 1 to 3, and the number of padding layers is 1 to 3; other parameters are set to default values. The pathogen typing model is implemented based on the python programming language, pytorch is used as a neural network framework and combined with related function libraries to train a one-dimensional convolutional neural network model, the network model is based on GPU for hardware acceleration training, and the SGD algorithm is used to optimize the model parameters; the pathogen typing model is pre-trained using the pathogen Raman data pre-processed in step one.

[0087] Specific implementation method 7: This implementation method is different from the specific implementation methods 1 to 6 in that the specific process of step 3 is as follows:

[0088] Step 31. For any kind of pre-processed Raman spectral data of a pathogen, when the pre-processed Raman spectral data of the pathogen is used as the input of the pre-trained pathogen typing model, the feature map output by the convolution layer in the nth convolution module of the pre-trained pathogen typing model is denoted as A, the true category of the pathogen is denoted as c, and the prediction score of the pre-trained pathogen typing model for the true category c is denoted as y c , record the data at coordinate (i, j) in the kth channel of feature map A as Then relative to the true category c, the weight of the feature map A in the kth channel is for:

[0089]

[0090] Among them, M is the width of the feature map, and N is the height of the feature map;

[0091] according to And the k-th channel feature map output by the convolution layer in the n-th convolution module, calculate the gradient weighted class activation map heat map intensity value of the preprocessed Raman spectral data of the pathogen at each Raman shift:

[0092]

[0093] Where K is the number of channels and ReLU(·) is the activation function;

[0094] And draw the gradient weighted class activation mapping heat map of the Raman spectrum data of the pathogen, as shown in Figure 3;

[0095] Arrange the intensity values ​​of the gradient weighted class activation mapping heat map of the pathogen at each Raman shift in descending order, select the Raman shift corresponding to the intensity values ​​in the first L positions, and determine the Raman spectrum segment with a weight of w1 corresponding to the pathogen according to the selected Raman shift;

[0096] Step 32: using the method of step 31 to process the pre-processed Raman spectrum data of each pathogen, respectively, to obtain Raman spectrum segments with a weight of w1 corresponding to each pathogen, and then taking the union of the Raman spectrum segments with a weight of w1 corresponding to each pathogen, to obtain all Raman spectrum segments with a weight of w1;

[0097] Step 33: In the Raman shift range from λ to λ0, obtain other Raman spectral segments except the Raman spectral segment with weight w1, and set the weights of the other Raman spectral segments to w2, and w1>w2;

[0098] Step 34: Use weight w1 and weight w2 to perform weighted processing on the pre-processed Raman spectrum data of each pathogen to obtain the weighted Raman spectrum data of each pathogen.

[0099] The other steps and parameters are the same as those in Specific Embodiments 1 to 6.

[0100] For each type of pathogen, after calculating its gradient weighted class activation map heat map intensity value, 2 to 10 Raman spectral segments with high weights are selected in descending order of intensity value, and then the Raman spectral segments with high weights of all pathogens are taken as the union to obtain all Raman spectral segments with high weights. In the entire spectral shift range, the remaining Raman spectral segments except the Raman spectral segments with high weights are used as Raman spectral segments with low weights, and the weight value range of the Raman spectral segments with high weights is set to 0.5 to 1, and the weight value range of the Raman spectral segments with low weights is set to 0 to 0.5. Then, according to the set weights of each Raman spectral segment, the pre-processed Raman spectral data of each type of pathogen is weighted.

[0101] In actual process, it is only necessary to satisfy that the weight value of the Raman spectrum segment with high weight is greater than the weight value of the Raman spectrum segment with low weight. The weight values ​​of the Raman spectrum segment with high weight may not be equal, and the weight values ​​of the Raman spectrum segment with low weight may not be equal.

[0102] Specific implementation eight: This implementation differs from any one of specific implementations one to seven in that the Raman spectrum segment with a weight of w1 corresponding to the pathogen is determined based on the selected Raman shift, specifically:

[0103] The selected lth Raman shift is denoted as λ l , l=1,2,…,L;

[0104] If m l 100+50<λ l ≤(m l +1)·100,m l If the value of is a positive integer, the Raman shift is m l 100+50 to (m l +1)·100, the weight of the Raman spectrum is recorded as w1;

[0105] If m l 100<λ l ≤(m l +1)·100-50,m l If the value of is a positive integer, the Raman shift is m l 100 to (m l ·1)·The weight of the Raman spectrum band from 100 to 50 is denoted as w1.

[0106] The other steps and parameters are the same as those in Specific Embodiments 1 to 7.

[0107] In the present invention, the Raman shift range of the Raman spectroscopy data is 400 cm -1 ~1800cm -1 , the length of the Raman spectrum data is 1000, that is, at 400 cm -1 ~1800cm -1 1000 data collection points are evenly set within the Raman shift range, and the obtained gradient-weighted class activation mapping heat map intensity value is the gradient-weighted class activation mapping heat map intensity value at the Raman shift corresponding to each data collection point.

[0108] Specific implementation method 9: This implementation method is different from specific implementation methods 1 to 8 in that the specific process of steps 3 and 4 is as follows:

[0109] Pre-treated Raman spectral data of any pathogen

[0110] The weight w1 is multiplied by the spectral value of the Raman spectrum obtained in step 32, and the weight w2 is multiplied by the spectral value of the Raman spectrum obtained in step 33 to obtain the weighted Raman spectrum data of the pathogen.

[0111] The other steps and parameters are the same as those in Specific Embodiments 1 to 8.

[0112] Specific implementation method 10: This implementation method is different from specific implementation methods 1 to 9 in that the specific process of step 5 is as follows:

[0113] Step 51: pre-process the Raman spectrum data of the pathogen to be typed, and the pre-processing method is the same as that of the specific implementation method 3;

[0114] Step 52: according to the Raman spectrum segment with weight w1 obtained in step 32, the weight of the corresponding Raman spectrum segment in the Raman spectrum data preprocessed in step 51 is set to w1 (that is, the weight of the Raman spectrum segment in the Raman spectrum data preprocessed in step 51 that is the same as the Raman spectrum segment with weight w1 in step 32 is also set to w1), and the weights of other Raman spectrum segments are set to w2;

[0115] Performing weighted processing on the Raman spectrum data preprocessed in step 51 according to the weights set for each Raman spectrum segment to obtain weighted Raman spectrum data;

[0116] Step 53: Input the weighted Raman spectrum data in step 52 into the trained pathogen typing model to obtain the typing result of the pathogen to be typed.

[0117] The other steps and parameters are the same as those in Specific Embodiments 1 to 9.

[0118] like Figure 1 As shown, a pathogen typing method based on Raman spectroscopy weight analysis of the present invention has the following process for typing pathogen Raman spectroscopy data:

[0119] Firstly, the Raman spectrum data of the pathogen to be typed were preprocessed by spectral smoothing, baseline removal, and intensity normalization in sequence;

[0120] Then, a model for pathogen typing was built, and the typing model was trained using the preprocessed Raman data;

[0121] Secondly, the importance of different spectral segments of the pathogen Raman spectrum for pathogen typing is calculated based on the gradient weighted class activation mapping method. The pathogen Raman spectrum data is weighted according to the calculation results to amplify the Raman spectrum differences between different types of pathogens.

[0122] Finally, the pathogen Raman spectroscopy dataset constructed after weighted processing was used to optimize the training model, ultimately achieving high-accuracy typing of pathogen Raman spectroscopy data.

[0123] This example is based on 20,000 Raman spectral data of 10 clinically isolated pathogens (different types, different subtypes, and different drug resistances) collected by Ho et al. from Stanford University to verify the effectiveness of a pathogen typing method based on Raman spectral weight analysis of the present invention.

[0124] The following examples are used to verify the beneficial effects of the present invention:

[0125] Test Example 1:

[0126] The preprocessing of pathogen Raman spectroscopy data was completed in the following steps: first, the polynomial smoothing (SG) algorithm was used to process the spectral noise of 10 types of pathogens. The window length of the SG algorithm was set to 13 and the smoothing order was set to 3. Then, the adaptive iterative reweighted penalized least squares (airPLS) algorithm was used to remove the baseline interference of 10 types of pathogens. The regularization parameter of the airPLS algorithm was set to 91, the penalty factor parameter was set to 3, and the number of iterations was set to 15. Finally, the minimum and maximum normalization was used to normalize the pathogen Raman spectral signals.

[0127] The training of the pathogen typing model is completed in the following steps:

[0128] The pathogen typing model is mainly divided into three parts: data input, data feature extraction, and pathogen typing. It consists of 1 input layer, 3 convolutional layers, 3 batch normalization layers, 1 flattening layer, and 1 fully connected layer; the activation function is the ReLU function; the convolution kernel parameter is set to 5, the convolution step is set to 1, and the number of padding layers is set to 2; other parameters are set to the default values.

[0129] The pathogen typing model was implemented based on Python language programming. Pytorch was used as the neural network framework and combined with related function libraries to train the one-dimensional convolutional neural network model. The network model was trained with hardware acceleration based on GPU, and the SGD algorithm was used to optimize the model parameters. The model was trained using preprocessed Raman data of 10 pathogens, and the data ratio of training set, validation set, and test set was 6:2:2.

[0130] The key spectral analysis of pathogen typing and weighted processing of Raman spectral data sets are carried out according to the following steps:

[0131] The gradient weighted class activation mapping method was used to analyze the importance of different Raman spectral bands for typing of 10 pathogens when the above pathogen typing model was used. The calculation results are shown in the figure. Figures 3a to 3jAs shown in the figure, the Raman spectra of 10 pathogens were weighted according to the calculation results, and the Raman shift of pathogens was set to 600 cm -1 ~1200cm -1 、1400cm -1 ~1600cm -1 The Raman signal weight value within the range is 1, and the Raman weight value of the remaining spectral segments is 0, and the pathogen Raman data set is reconstructed.

[0132] The optimization training of the pathogen typing model is completed in the following steps:

[0133] The weighted pathogen Raman spectral dataset was used to optimize and train the pathogen typing model mentioned above, and finally the accurate typing of 10 pathogens based on Raman spectral weight analysis was achieved.

[0134] Figure 2 It is a network structure diagram of the pathogen typing model constructed by the present invention.

[0135] from Figure 2 As can be seen from the network structure diagram, the 10 pathogen typing models are mainly composed of three convolutional layers, one flattening layer, and one fully connected layer. The convolutional layer sets the convolution kernel to 5, the convolution step to 1, and the number of layers with data filled with 0 is 2;

[0136] Figures 3a to 3j is the Raman spectrum weight analysis result of 10 clinically isolated pathogens calculated by the method of the present invention: Figure 3a Enterococcus faecalis 1; Figure 3b Enterococcus faecalis 2; Figure 3c for Enterococcusfaecium; Figure 3d for Klebsiella aerogenes; Figure 3e Enterobacter cloacae; Figure 3f It is Staphylococcus aureus (MSSA 3); Figure 3g It is Staphylococcus aureus (MRSA 1, isogenic); Figure 3h for Streptococcus pyogenes (Group A); Figure 3i for Streptococcusdysgalactiae (Group C); Figure 3j for Streptococcus dysgalactiae (Group G);

[0137] from Figures 3a to 3jThe weighted analysis results of Raman spectra of 10 clinically isolated pathogens show that the important spectral segments related to the typing of the 10 pathogens are mainly concentrated in the Raman shift of 600 cm -1 ~650cm -1 、750cm -1 ~850cm -1 , 1000cm -1 ~1200cm -1 、1400cm -1 ~1600cm -1 The Raman signal weight value in the important spectral range is 1, and the Raman signal weight value in the remaining spectral range is 0.

[0138] Figure 4a and Figure 4b is the confusion matrix of 10 pathogen typing, where: Figure 4a The effect of original Raman spectroscopy on pathogen typing; Figure 4b The effect of weighted Raman spectroscopy on pathogen typing;

[0139] from Figure 4a It can be seen that the typing accuracy of the 10 pathogen test set data is 80.98%. The typing effect between different types of pathogens is good, but the typing effect between different subtypes of the same bacteria and bacteria with different drug resistance is poor. Figure 4b The typing accuracy of the 10 pathogen test set data reached 89.45%, and good typing accuracy was achieved between different types of bacteria, different subtypes of the same bacteria, and different drug resistance of the same bacteria.

[0140] It can be seen from the results of the above test examples that the pathogen typing method based on Raman spectroscopy weight analysis of the present invention can amplify the Raman spectral differences between different bacteria by calculating the contribution of Raman spectra of different types of pathogens to the pathogen typing model, and weighted processing of the pathogen Raman spectroscopy data. The newly constructed pathogen Raman spectroscopy data set is used to optimize the training of the pathogen typing model, which can improve the typing accuracy of the pathogen typing model for different subtypes and different drug resistance of the same type of pathogens, thereby improving the pathogen typing accuracy based on Raman spectroscopy technology.

[0141] The pathogen typing method based on Raman spectroscopy weight analysis of the present invention is not only suitable for clinical pathogen typing, but also for typing detection of pathogens in the field of food safety, typing detection of bacterial subtypes and bacterial resistance, cancer screening and other typing scenarios based on Raman spectroscopy technology.

[0142] The above calculation examples of the present invention are only used to explain the calculation model and calculation process of the present invention in detail, and are not intended to limit the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the scope of protection of the present invention.

Claims

1. A pathogen typing method based on Raman spectroscopy weight analysis, characterized in that: The method specifically comprises the following steps: Step 1: respectively collecting spectral data of various pathogens in the Raman shift range of λ to λ0, and preprocessing the collected Raman spectral data to obtain preprocessed Raman spectral data; Step 2: pre-training the pathogen typing model using the pre-processed Raman spectroscopy data to obtain a pre-trained pathogen typing model; The input of the pre-training process is the pre-processed Raman spectral data of various pathogens, the output of the pre-training process is the predicted categories of various pathogens, and the labels of the pre-training process are the true categories of various pathogens; Step 3: weighting the pre-processed Raman spectral data of various pathogens based on the pre-trained pathogen typing model to obtain a weighted Raman spectral data set; Step 4: Use the weighted Raman spectroscopy data set to train the pre-trained pathogen typing model to obtain a trained pathogen typing model; The input of the training process is the weighted Raman spectral dataset, the output of the training process is the predicted categories of various pathogens, and the labels of the training process are the true categories of various pathogens; Step 5: After preprocessing the Raman spectrum data of the pathogen to be typed, the preprocessed Raman spectrum data is weighted, and the weighted Raman spectrum data is input into the trained pathogen typing model to obtain the typing result of the pathogen to be typed.

2. The pathogen typing method based on Raman spectroscopy weight analysis according to claim 1, characterized in that: The value of λ is 400cm -1 , the value of λ0 is 1800cm -1 .

3. The pathogen typing method based on Raman spectroscopy weight analysis according to claim 2, characterized in that: The pretreatment process in step 1 is: Step 11: De-noising the collected Raman spectrum data of pathogens to obtain de-noised Raman spectrum data; Step 12: performing baseline processing on the denoised Raman spectrum data to obtain baseline processed Raman spectrum data; Step 13: normalize the data intensity at each Raman shift in the baseline-processed Raman spectrum data to obtain normalized Raman spectrum data, that is, obtain pre-processed Raman spectrum data.

4. The method for pathogen typing based on Raman spectroscopy weight analysis according to claim 3, characterized in that: In the step 1, the denoising process is implemented by using a polynomial smoothing method.

5. The method for pathogen typing based on Raman spectroscopy weight analysis according to claim 4, characterized in that: In the steps 1 and 2, the baseline processing is implemented by using the adaptive iterative reweighted penalty least squares method.

6. The method for pathogen typing based on Raman spectroscopy weight analysis according to claim 5, characterized in that: The pathogen typing model includes the first convolution module to the nth convolution module, a flattening layer and a fully connected layer in sequence, and each convolution module includes a convolution layer, a batch normalization layer and a ReLU activation function layer.

7. The method for pathogen typing based on Raman spectroscopy weight analysis according to claim 6, characterized in that: The specific process of step three is: Step 31. For any kind of pre-processed Raman spectral data of a pathogen, when the pre-processed Raman spectral data of the pathogen is used as the input of the pre-trained pathogen typing model, the feature map output by the convolution layer in the nth convolution module of the pre-trained pathogen typing model is denoted as A, the true category of the pathogen is denoted as c, and the prediction score of the pre-trained pathogen typing model for the true category c is denoted as y c , record the data at coordinate (i, j) in the kth channel of feature map A as Then relative to the true category c, the weight of the feature map A in the kth channel is for: Among them, M is the width of the feature map, and N is the height of the feature map; according to And the k-th channel feature map output by the convolution layer in the n-th convolution module, calculate the gradient weighted class activation map heat map intensity value of the preprocessed Raman spectral data of the pathogen at each Raman shift: Where K is the number of channels and ReLU(·) is the activation function; Arrange the intensity values ​​of the gradient weighted class activation mapping heat map of the pathogen at each Raman shift in descending order, select the Raman shift corresponding to the intensity values ​​in the first L positions, and determine the Raman spectrum segment with a weight of w1 corresponding to the pathogen according to the selected Raman shift; Step 32: using the method of step 31 to process the pre-processed Raman spectrum data of each pathogen, respectively, to obtain Raman spectrum segments with a weight of w1 corresponding to each pathogen, and then taking the union of the Raman spectrum segments with a weight of w1 corresponding to each pathogen, to obtain all Raman spectrum segments with a weight of w1; Step 33: In the Raman shift range from λ to λ0, obtain other Raman spectral segments except the Raman spectral segment with weight w1, and set the weights of the other Raman spectral segments to w2, and w1>w2; Step 34: Use weight w1 and weight w2 to perform weighted processing on the pre-processed Raman spectrum data of each pathogen to obtain the weighted Raman spectrum data of each pathogen.

8. The method for pathogen typing based on Raman spectroscopy weight analysis according to claim 7, characterized in that: The Raman spectrum segment with a weight of w1 corresponding to the pathogen is determined according to the selected Raman shift, specifically: The selected lth Raman shift is denoted as λ l , l = 1, 2, ..., L; If m l 100+50<λ t ≤(ml+1)·100,m l If the value of is a positive integer, the Raman shift is m l 100+50 to (m l +1)·100, the weight of the Raman spectrum is recorded as w1; If m l 100<λ t ≤(m l +1)·100-50,m l If the value of is a positive integer, the Raman shift is m l 100 to (m l ·1)·The weight of the Raman spectrum band from 100 to 50 is denoted as w1.

9. The method for pathogen typing based on Raman spectroscopy weight analysis according to claim 8, characterized in that: The specific process of steps three and four is as follows: Pre-treated Raman spectral data of any pathogen The weight w1 is multiplied by the spectral value of the Raman spectrum obtained in step 32, and the weight w2 is multiplied by the spectral value of the Raman spectrum obtained in step 33 to obtain the weighted Raman spectrum data of the pathogen.

10. The method for pathogen typing based on Raman spectroscopy weight analysis according to claim 9, characterized in that: The specific process of step five is as follows: Step 51: pre-processing the Raman spectrum data of the pathogen to be typed; Step 52: according to the Raman spectrum segment with weight w1 obtained in step 32, the weight of the corresponding Raman spectrum segment in the Raman spectrum data preprocessed in step 51 is set to w1, and the weights of other Raman spectrum segments are set to w2; Performing weighted processing on the Raman spectrum data preprocessed in step 51 according to the weights set for each Raman spectrum segment to obtain weighted Raman spectrum data; Step 53: Input the weighted Raman spectrum data in step 52 into the trained pathogen typing model to obtain the typing result of the pathogen to be typed.

Citation Information

Patent Citations

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

    CN109543763A

  • Intelligent Raman spectrum classification method based on convolutional neural network

    CN114544592A

  • Method for rapidly identifying multi-infection pathogenic bacteria by using Raman spectrum and carrying out drug sensitivity experiment

    CN114594086A

  • Bombyx mori pebrine nondestructive testing method and system based on deep learning

    CN116364275A

  • Rice bacterial leaf blight and rice bacterial leaf streak pathogen detection method based on Raman spectrum

    CN117007575A

Cited By

  • Stomach helicobacter pylori infection detection method based on Raman spectrum

    CN121687303A