Model training method, raman spectrum generation method and device
By constructing Raman spectroscopy generation and discrimination network models and utilizing CGAN generative adversarial network technology, the problem of difficult Raman spectroscopy data acquisition was solved, achieving efficient model training and accurate classification and recognition, while reducing costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG JINGHANG INFORMATION TECH CO LTD
- Filing Date
- 2023-02-20
- Publication Date
- 2026-06-23
Smart Images

Figure CN116402120B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Raman spectroscopy detection technology, and in particular to model training methods, Raman spectrum generation methods and apparatus. Background Technology
[0002] Raman spectroscopy, as an important detection method, has been widely used in petrochemical industry, biomedicine, archaeological and artistic research, and forensic identification.
[0003] Currently, due to the high similarity of features in acquired Raman spectra, they are generally difficult to distinguish with the naked eye. Therefore, many traditional machine learning and deep learning methods have been proposed to analyze and identify Raman spectra. Because of the advantages of spectral technology, such as speed and accuracy, combined with the application of machine learning, it will play an increasingly important role in the field of classification and recognition. In the process of using Raman spectroscopy for identification and classification, the training of machine learning and deep learning models requires a large amount of spectral data. Moreover, Raman spectral measurements are affected by the instrument itself and external factors such as fluorescence, resulting in a certain degree of randomness in the spectra. Therefore, training with a small amount of Raman spectral data is inappropriate due to its high randomness. Thus, it is necessary to collect a large amount of Raman spectral data to cover the intra-class randomness and improve the accuracy of the trained model.
[0004] However, in the process of implementing the inventive technical solutions in the embodiments of this application, the inventors of this application discovered that the above-mentioned technical solutions have at least the following technical problems:
[0005] Due to practical constraints, obtaining sufficient Raman spectral data is difficult in terms of personnel, funding, resources, and time. For example, when acquiring Raman spectra of traditional Chinese medicinal materials, some samples are hard to obtain or the acquisition cost is too high, making it difficult to support the demand for large-scale Raman spectral acquisition. Furthermore, the Raman spectral acquisition process often requires a long integration time to obtain Raman spectral data with good backsight, which also increases manpower and time costs. All these factors limit the effectiveness of Raman spectroscopy in deep learning training, posing challenges to the accuracy and stability of classification and recognition. Therefore, there is an urgent need to find a method to expand limited Raman spectral data for effective modeling and training to achieve Raman spectral classification. Summary of the Invention
[0006] This invention aims to expand a small amount of real Raman spectral data through simulation, thereby enabling effective model training for Raman spectral classification. It addresses the technical problem of difficulty in obtaining and training network models due to the scarcity of Raman spectral data, reducing the human and time costs associated with acquiring large amounts of data and improving classification accuracy.
[0007] The above-mentioned objectives are mainly achieved through the following technical solutions:
[0008] The first aspect is the model training method used to train the Raman spectroscopy generation network model, including:
[0009] Step 1: Collect raw Raman spectral data, and pre-construct Raman spectral generation network model and Raman spectral discrimination network model;
[0010] Step 2: Input the raw Raman spectral data into the Raman spectral generation network model to generate Raman spectral data; the Raman spectral discrimination network model distinguishes between the raw Raman spectral data and the generated Raman spectral data to obtain training parameters;
[0011] Step 3: Train the Raman spectroscopy generation network model based on the training parameters. Repeat steps 2 and 3 to optimize the training parameters until the Raman spectroscopy generation network model converges, and obtain the final trained Raman spectroscopy generation network model.
[0012] Secondly, a model training device, used for training the Raman spectroscopy generation network model, includes:
[0013] The Raman spectroscopy acquisition module is used to acquire raw Raman spectral data.
[0014] The model building module is used to build Raman spectroscopy generation network models and Raman spectroscopy discrimination network models.
[0015] A Raman spectroscopy generation network model is used to generate Raman spectral data from raw Raman spectral data.
[0016] A Raman spectroscopy discrimination network model is used to distinguish between raw Raman spectral data and generated Raman spectral data to obtain training parameters;
[0017] The model training module is used to train the Raman spectroscopy generation network model based on the training parameters, optimize the training parameters, and then the Raman spectroscopy generation network model converges to obtain the final trained Raman spectroscopy generation network model.
[0018] Thirdly, Raman spectroscopy generation methods include:
[0019] Collect the Raman spectrum data of the analyte and input it into the Raman spectrum generation network model to generate Raman spectrum data of the same dimension as the Raman spectrum data to be measured.
[0020] The Raman spectroscopy generation network model was trained using the model training method described above.
[0021] Fourthly, the Raman spectroscopy generating device includes:
[0022] Raman spectroscopy acquisition module, which acquires the Raman spectral data of the analyte;
[0023] The input module is used to input the Raman spectral data to be measured into the Raman spectral generation network model;
[0024] The Raman spectroscopy generation network model is used to generate Raman spectral data of the same dimension as the Raman spectral data to be measured. The Raman spectroscopy generation network model is trained according to the model training method described above.
[0025] Fifthly, an electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the model training method or the Raman spectrum generation method described above.
[0026] Sixthly, a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the model training method or the Raman spectrum generation method described above.
[0027] Compared to existing technologies, this invention offers several advantages: It pre-constructs a Raman spectroscopy generation network model and a Raman spectroscopy discrimination network model. The collected raw Raman spectral data is input into the Raman spectroscopy generation network model to generate Raman spectral data. The Raman spectroscopy discrimination network model performs discrimination analysis on the raw and generated Raman spectral data to obtain training parameters. These parameters are then used to train and optimize the Raman spectroscopy generation network model until it converges, resulting in a final trained Raman spectroscopy generation network model. This model is then used to simulate and expand real Raman spectral data to be measured. The generated samples achieved ideal signal fidelity and key feature matching, overcame overfitting in classification tasks, and improved classification accuracy. They provide high-fidelity simulated samples for Raman spectroscopy algorithm analysis or other discrimination tasks. The system solves the problems of difficult Raman spectroscopy data acquisition and limited data volume, avoiding the inability to meet the large data requirements for deep learning training under special constraints. This enables effective modeling and training for Raman spectroscopy classification, reducing the human and time costs associated with acquiring large amounts of Raman spectroscopy data and improving classification accuracy. Attached Figure Description
[0028] Figure 1 This is a schematic flowchart of the Raman spectrum generation method provided in an embodiment of the present invention;
[0029] Figure 2A schematic flowchart of the model training method provided in an embodiment of the present invention;
[0030] Figure 3 Four sets of original average Raman spectra of Astragalus membranaceus from different regions are provided for embodiments of the present invention;
[0031] Figure 4 The average Raman spectra of Astragalus membranaceus from different regions provided in this embodiment of the invention;
[0032] Figure 5 This illustrates the classification accuracy of the original Raman spectral data under a one-dimensional convolutional neural network model in an embodiment of the present invention;
[0033] Figure 6 This illustrates the classification accuracy of the generated Raman spectral data under a one-dimensional convolutional neural network model in an embodiment of the present invention;
[0034] Figure 7 This is a schematic diagram of the structure of the model training device provided in an embodiment of the present invention;
[0035] Figure 8 This is a schematic diagram of the Raman spectroscopy generation device provided in an embodiment of the present invention;
[0036] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0037] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0038] The model training method of this invention is used to train a Raman spectroscopy generation network model, which is used to generate Raman spectra in order to achieve Raman spectroscopy classification.
[0039] Raman spectroscopy generation methods, such as Figure 1 As shown, it includes the following steps:
[0040] Step 1: Collect the Raman spectrum data of the sample to be tested.
[0041] Set up a Raman spectroscopy acquisition device, adjust the relevant parameters, and acquire Raman spectral data of the sample to be tested.
[0042] The following explanation uses the simulated generation of the Raman spectrum of Astragalus membranaceus as an example:
[0043] The origins of Astragalus membranaceus from Shanxi, Sichuan, Inner Mongolia, and Gansu were identified. To simplify the analysis, the origins are numbered as follows: Shanxi Astragalus membranaceus 1, Sichuan Astragalus membranaceus 2, Inner Mongolia Astragalus membranaceus 3, and Gansu Astragalus membranaceus 4. Considering that sample dryness and grinding uniformity can affect spectral data, pretreatment was performed before Raman spectroscopy. First, all samples were dried in a drying oven at 40°C for 3 hours, and then pulverized into powder at 25,000 rpm in a grinder.
[0044] Raman spectroscopy was performed on Astragalus membranaceus from four different origins. Three grams of Astragalus membranaceus powder from each sample were placed in 30 ml of ethanol solution, mixed thoroughly, and then refluxed with cooling water at 100°C for 2 hours with stirring. The mixture was then allowed to cool naturally, filtered, and the filtrate was collected. Raman spectral signals were acquired based on these samples.
[0045] Step 2: Input the Raman spectrum data to be measured into the Raman spectrum generation network model to generate Raman spectrum data of the same dimension as the Raman spectrum data to be measured.
[0046] Compared to existing technologies, the advantages of this invention are as follows: By pre-constructing and training a Raman spectroscopy generation network model, this invention uses the model to simulate and expand real Raman spectral data to be measured, thus solving the problems of difficulty in obtaining Raman spectral data and the limited amount of Raman spectral data. It avoids the situation where the amount of Raman spectral data is too small and difficult to obtain under special constraints, which would prevent the need for a large amount of data during deep learning training. This allows for effective modeling and training to achieve Raman spectral classification, which helps reduce the manpower and time costs of obtaining a large amount of Raman spectral data, and also helps improve classification accuracy.
[0047] The training method for the Raman spectroscopy generation network model of the present invention is as follows:
[0048] Model training methods are used to train Raman spectroscopy generation network models, such as... Figure 2 As shown, it includes the following steps:
[0049] Step 01: Pre-construct Raman spectroscopy generation network model and Raman spectroscopy discrimination network model.
[0050] More preferably, the Raman spectroscopy generation network model and the Raman spectroscopy discriminator network model are constructed based on CGAN (Conditional Generative Adversarial Nets). CGAN is an extension of Generative Adversarial Nets (GAN) that can synthesize continuous and discrete data in tabular data. Since Raman spectroscopy is continuous data, Raman spectroscopy data can be generated using CGAN. CGAN is an extension of GAN in which additional information y is added as a condition to both the generator and discriminator. y can be any information, such as category information or data from other modalities. This additional information y is input into the generation model as part of the input layer, thus realizing conditional GAN. In the generation model, prior input noise... The conditional information y, together with the conditional information y, forms the joint hidden layer representation. The adversarial training framework is quite flexible in terms of the composition of the hidden layer representation. The objective function of the conditional generative adversarial network is a two-player minimax game with conditional probabilities.
[0051] ;
[0052] in, Real data It was identified as a positive sample. The generated data and the used condition y information constitute a data pair It was identified as a negative sample. The probability distribution of the original Raman spectrum dataset, The output of the simulated spectral dataset generated by the Raman spectroscopy discrimination network model. The probability distribution of the first Raman spectrum dataset generated, It is a random vector. This indicates that the discriminant network can distinguish between real spectra and generated spectra data. This indicates that the generator network can generate spectral data that the discriminator network cannot distinguish. A Raman spectroscopy discriminator model is constructed with 3 layers. The number of nodes in the first layer is the same as the dimension of the original Raman spectral data, which is 2090. The number of nodes in the middle layer is 128, and the last layer is the output layer with 1 node.
[0053] Step 02: Collect raw Raman spectral data.
[0054] Referring to the implementation method in step 1 above, 40 sets of spectra were collected from each of the above-mentioned production areas of Astragalus membranaceus, totaling 160 sets of spectra from the four production areas, which were used as raw Raman spectral data. The spectral data underwent baseline correction and standardization. The average Raman spectra of Astragalus membranaceus from four different regions (i.e., the raw Raman spectra) are shown below. Figure 3 As shown.
[0055] Step 03: Normalize the original Raman spectral data using a Gaussian mixture model.
[0056] The Raman spectral data were processed using a variational Gaussian Mixture Model (GMM) to fit the complex distribution of each feature for each continuous column. We use a variational Gaussian mixture model to learn the GMM distribution:
[0057] ;
[0058] in, For the number of models, , and They are the first k The weights, mean, and standard deviation of each pattern.
[0059] For columns Each value in Calculate the probability density for each model:
[0060] ;
[0061] In the model Find the highest And normalize it. For example, if in three modes , , The highest probability density in is Then the value Can be converted to a single-hot code and scalar Normalization .
[0062] Step 04: Input the raw Raman spectral data into the Raman spectral generation network model to generate Raman spectral data. After normalizing the raw Raman spectral data in Step 03, input it into the pre-constructed Raman spectral generation network model to generate Raman spectral data. Based on the acquired Raman spectrum (2090 dimensions), generate 110 sets of random number sequences of the same dimension, and simultaneously input the raw Raman data... (Specific wave) is used as a conditional variable and input into the generated random number sequence to generate Raman spectral data.
[0063] Step 05: The Raman spectroscopy discrimination network model discriminates between the original and generated Raman spectral data to obtain training parameters. A discrimination network model is constructed based on the generated and original Raman spectral data. Then, the Raman spectroscopy discrimination model is used to perform discrimination analysis on the original and generated Raman spectra to obtain training parameters. The first loss function is set as follows when training the Raman spectroscopy discrimination model:
[0064] ;
[0065] in, This represents a maximum game between the Raman spectroscopy generation network model and the Raman spectroscopy discrimination network model. This represents the Raman spectroscopy discrimination network model. This represents the Raman spectroscopy generation network model. Pair the original Raman spectral data It was identified as a positive sample. The data pair is constructed by combining the first Raman spectral data with the conditional information y used. It was identified as a negative sample. The probability distribution of the original Raman spectrum dataset, The output of the simulated spectral dataset generated by the Raman spectroscopy discrimination network model. The probability distribution of the first Raman spectrum dataset generated, For random vectors, This indicates that the Raman spectroscopy discrimination network model can distinguish between raw Raman spectral data and generated Raman spectral data. This indicates that the Raman spectroscopy generation network model can generate Raman spectral data that the Raman spectroscopy discrimination network model cannot distinguish; the training parameters are the parameters when the first loss function reaches model convergence.
[0066] Step 06: Train the Raman spectroscopy generation network model based on the training parameters. The Raman spectroscopy generation network model is trained based on the training parameters, and a second loss function is set to help the Raman spectroscopy generation network model converge. The second loss function is as follows:
[0067] ;
[0068] in, This represents a minimum game between the Raman spectroscopy generation network model and the Raman spectroscopy discrimination network model. This represents the Raman spectroscopy discrimination network model. This represents the Raman spectroscopy generation network model. The data pair is constructed by combining the first Raman spectral data with the conditional information y used. It was identified as a negative sample. The probability distribution of the first Raman spectrum dataset generated, For random vectors, This indicates that the Raman spectroscopy generation network model can generate Raman spectral data that the Raman spectroscopy discrimination network model cannot distinguish.
[0069] Step 07: Repeat steps 04-06 to optimize the training parameters until the Raman spectroscopy generation network model converges, resulting in the final trained Raman spectroscopy generation network model. After training, a new Raman spectroscopy generation network model is obtained, generating new Raman spectral data. Steps 04-06 are then repeated to optimize the training parameters until the Raman spectroscopy generation network model converges (including reaching the maximum number of training iterations, e.g., 100 times), resulting in the final trained Raman spectroscopy generation network model. This model is then applied to the CGAN-based Raman spectroscopy generation method described above to generate Raman spectral data, such as... Figure 4 As shown, this makes the generated Raman spectrum approximate the true spectrum (i.e., the original Raman spectrum). The generated Raman spectrum data and the original Raman spectrum data are used together as the sample set for the neural network model to achieve Raman spectrum classification, for example, the identification of the origin of Astragalus membranaceus in this invention. 160 sets of Astragalus membranaceus Raman spectrum data from four origins are used as the original data, generating 400 new Raman spectra for each origin, totaling 1600 sets, which are used as the input layer variables of the one-dimensional convolutional neural network. The one-dimensional convolutional neural network uses tanh as the activation function for the convolutional layers, softmax as the activation function for the dense layers, and 50 epochs. 80% of the input data is used as the training set, and 20% as the test set. To test the performance of the convolutional neural network, the results are compared with those of a convolutional neural network with a dataset augmented using random offsets and the results of traditional machine learning PCA-SCR. This process is performed using Python, and the validation method uses 5-point cross-validation. The results are shown in Table 1.
[0070]
[0071] Table 1
[0072] As shown in Table 1, the application of generative adversarial networks (GANs) and convolutional neural networks (CNNs) can accurately determine the origin of Astragalus membranaceus. The accuracy rate for identifying Sichuan Astragalus membranaceus reached 100%, with high accuracy rates also observed for Shanxi and Gansu Astragalus membranaceus. Therefore, the combination of GANs and CNNs is effective for identifying the origin of Astragalus membranaceus.
[0073] The following will take the Raman spectroscopy generation model trained by the above-mentioned model training method of the present invention as an example and apply it to the identification of the origin of Astragalus membranaceus in the above four origins for detailed explanation.
[0074] First, it should be noted that the quality of the Raman spectral data generated using the above Raman spectral generation model is evaluated from three dimensions: signal fidelity, key feature matching degree, and model training effect.
[0075] (1) Signal fidelity quality:
[0076] The study mainly focuses on two metrics: structural similarity index (SSIM index) and signal-to-noise ratio (PSNR).
[0077] Structural similarity metrics can be used to measure the degree of similarity between two digital images.
[0078] ;
[0079] and This represents the mean of the graphs x and g. and It is the variance of the images x and g. and It is a constant; the range of SSIM values is... The larger the value, the less image distortion.
[0080] PSNR is a common and widely used objective image quality evaluation metric. It is based on the error between corresponding pixels, i.e., it is an error-sensitive image quality evaluation.
[0081] ;
[0082] The maximum possible pixel value in the image. This represents the mean squared error. A higher peak signal-to-noise ratio (PSNR) is better.
[0083] (2) Key feature matching degree:
[0084] The primary focus is on the chemical interpretation of the spectrum, determining whether peaks appear at the same wavenumber. For example, in Raman spectroscopy, a Raman spectrum typically consists of a number of Raman peaks, each representing a corresponding Raman shift and intensity. Each peak corresponds to a specific molecular bond vibration, including single chemical bonds such as C=C, C=C, NO, CH, etc., as well as vibrations of groups composed of multiple chemical bonds, such as the breathing vibrations of the benzene ring, vibrations of long polymer chains, and lattice vibrations. This provides detailed information about the sample's chemical structure, phase and morphology, crystallinity, and molecular interactions. Raman spectra are essentially additive signals from basic chemicals, following a linear model; therefore, an Elastic Net is chosen for feature selection in Raman spectroscopy. The top 30 features are ranked, and the key feature matching degree between the original Raman spectrum and the generated Raman spectrum is compared.
[0085] ;
[0086] in, The number of features selected from the original Raman spectral data using an elastic network is the same as the number of features selected from the generated Raman spectral data using the same elastic network. The number of the top n features selected from Raman spectral data using an elastic network.
[0087] (3) Model training results:
[0088] Compare the accuracy of the original Raman data and the original Raman data plus generated Raman data input into a one-dimensional convolutional neural network model on the training and test sets. As shown above, if... Figures 3-4 As shown, the generated Raman spectrum and the original Raman spectrum are visually similar in peak distribution. Furthermore, the evaluation results of the original and generated Raman spectra of Astragalus membranaceus in terms of signal fidelity, key feature matching degree, and model training effect in this embodiment are shown in Table 2 below:
[0089]
[0090] Table 2
[0091] Table 1 shows that the structural similarity (SSIM) in the signal fidelity evaluation is 0.981, close to 1, indicating a high similarity between the original and generated images. The peak signal-to-noise ratio (PSNR) is 24.156 dB, between 20 dB and 30 dB, which is within the range where the human eye can perceive the difference between the images. For the generated Raman spectral data, good signal fidelity results were achieved in both dimensions of the signal fidelity evaluation. In the evaluation of key feature matching, an elastic network was used to select the top 30 features from both the original and generated Raman spectral data. Twelve of these features coexisted, resulting in a matching degree of 12 / 30. The top three features of the original Raman spectral data are 1264. 344 904 All were within the 30 features extracted from the generated Raman spectra. A key feature matching score of 12 / 30 was achieved, and the top three key features all appeared in the generated Raman spectra.
[0092] Model training performance evaluation: The generated Raman spectral data, along with the original Raman spectral data, were input into a one-dimensional convolutional neural network model. The accuracy of the original Raman spectral data in the one-dimensional convolutional neural network is as follows: Figure 5 As shown; the accuracy of combining raw Raman spectral data with generated Raman spectral data in a one-dimensional convolutional neural network is as follows: Figure 6 As shown, the model exhibited overfitting when inputting the original Raman data. However, after expanding the model with a certain amount of generated Raman spectra, the overfitting disappeared, and the accuracy on both the training and test sets reached 100%.
[0093] Compared to the benefits of existing technologies:
[0094] This invention pre-constructs Raman spectroscopy generation and discrimination network models. Raw Raman spectral data is input into the generation network model to generate Raman spectra. The discrimination network model performs discrimination analysis on the raw and generated Raman spectral data to obtain training parameters. The generation network model is then trained and optimized based on these parameters until convergence, resulting in a final trained model. This model is then used to simulate and expand real Raman spectral data. Interactive training with shared parameters between the generation and discrimination network models enables the generation network to produce realistic Raman spectra. The generated samples achieved ideal signal fidelity and key feature matching, and overcame overfitting in classification tasks. The original Raman spectral data was used as a conditional variable and input into the generative model along with the generated random number sequence, improving the quality of the generated spectra and thus increasing classification accuracy. High-fidelity simulated samples were provided for Raman spectral algorithm analysis or other discrimination tasks. The difficulties in acquiring Raman spectral data and the limited amount of Raman spectral data were resolved, avoiding the problem of insufficient Raman spectral data under special constraints, which could prevent meeting the large data requirements for deep learning training. This enabled effective modeling and training for Raman spectral classification, reducing the human and time costs associated with acquiring large amounts of Raman spectral data.
[0095] Model training devices, such as Figure 7 As shown, it includes:
[0096] The Raman spectroscopy acquisition module is used to acquire raw Raman spectral data.
[0097] The model building module is used to build Raman spectroscopy generation network models and Raman spectroscopy discrimination network models.
[0098] A Raman spectroscopy generation network model is used to generate Raman spectral data from raw Raman spectral data.
[0099] A Raman spectroscopy discrimination network model is used to distinguish between raw Raman spectral data and generated Raman spectral data to obtain training parameters;
[0100] The model training module is used to train the Raman spectroscopy generation network model based on the training parameters, optimize the training parameters, and then the Raman spectroscopy generation network model converges to obtain the final trained Raman spectroscopy generation network model.
[0101] In a preferred embodiment, the Raman spectroscopy generation network model is specifically used for:
[0102] Generate a random number sequence with the same dimensions as the original Raman spectral data;
[0103] A specific wave from the original Raman spectral data is used as a conditional variable, and the generated random number sequence is input into the Raman spectral generation network model to generate Raman spectral data.
[0104] In a preferred embodiment, the Raman spectroscopy discrimination network model is specifically used for:
[0105] The original Raman spectral data and the generated Raman spectral data are discriminated using a first loss function to obtain training parameters. The first loss function is:
[0106] ;
[0107] in, Pair the original Raman spectral data It was identified as a positive sample. The data pair is constructed by combining the first Raman spectral data with the conditional information y used. It was identified as a negative sample. The probability distribution of the original Raman spectrum dataset, The output of the simulated spectral dataset generated by the Raman spectroscopy discrimination network model. The probability distribution of the first Raman spectrum dataset generated, For random vectors, This indicates that the Raman spectroscopy discrimination network model can distinguish between raw Raman spectral data and generated Raman spectral data. This indicates that the Raman spectroscopy generation network model can generate Raman spectral data that the Raman spectroscopy discrimination network model cannot distinguish; the training parameters are the parameters when the first loss function reaches model convergence.
[0108] In a preferred embodiment, the Raman spectroscopy generation network model is specifically used for:
[0109] Model convergence is achieved using a second loss function, which is:
[0110] ;
[0111] in, The data pair is constructed by combining the first Raman spectral data with the conditional information y used. It was identified as a negative sample. The probability distribution of the first Raman spectrum dataset generated, For random vectors, This indicates that the Raman spectroscopy generation network model can generate Raman spectral data that the Raman spectroscopy discrimination network model cannot distinguish.
[0112] In a preferred embodiment, the Raman spectroscopy generation network model is specifically used for:
[0113] The model converges when the preset number of training iterations is reached.
[0114] In a preferred embodiment, the Raman spectroscopy generation network model and the Raman spectroscopy discrimination network model are constructed based on CGAN.
[0115] In a preferred embodiment, it further includes:
[0116] The normalization module is used to normalize the original Raman spectral data using a Gaussian mixture model.
[0117] The model training apparatus of this invention corresponds to the model training method described in the above embodiments and implements the corresponding functions. Since the process steps and implementation methods of the model training method have been described in detail in the above embodiments, they will not be repeated here.
[0118] Raman spectroscopy generating devices, such as Figure 8 As shown, it includes:
[0119] Raman spectroscopy acquisition module, which acquires the Raman spectral data of the analyte;
[0120] The input module is used to input the Raman spectral data to be measured into the Raman spectral generation network model;
[0121] The Raman spectroscopy generation network model is used to generate Raman spectral data of the same dimension as the Raman spectral data to be measured. The Raman spectroscopy generation network model is trained according to the model training method described above.
[0122] An electronic device, such as Figure 9 As shown, the device 9 includes a memory 91, a processor 92, and a computer program 93 stored in the memory and executable on the processor. When the processor executes the computer program, it implements some or all of the steps of the model training method or Raman spectrum generation method described above.
[0123] A computer-readable storage medium storing a computer program that, when executed by a processor, implements some or all of the steps of the model training method or Raman spectroscopy generation method described above.
[0124] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A model training method characterized by, The training for the Raman spectroscopy generation network model includes: Step 1: Collect raw Raman spectral data, and pre-construct a Raman spectral generation network model and a Raman spectral discrimination network model. The Raman spectral generation network model and the Raman spectral discrimination network model are constructed based on CGAN. In the Raman spectral generation network model, the prior input noise and the conditional information y jointly form a joint hidden layer representation. The conditional information y is a specific wave of the raw Raman spectral data. Step 2: Normalize the original Raman spectral data using a Gaussian mixture model to generate a random number sequence with the same dimension as the original Raman spectral data; input the specific wave of the original Raman spectral data as a conditional variable and the generated random number sequence into the Raman spectral generation network model to generate Raman spectral data; the Raman spectral discrimination network model uses a first loss function to discriminate between the original Raman spectral data and the generated Raman spectral data to obtain training parameters, which are the parameters when the first loss function reaches model convergence; Step 3: Train the Raman spectroscopy generation network model based on the training parameters. Repeat steps 2 and 3 to optimize the training parameters until the Raman spectroscopy generation network model converges, thus obtaining the final trained Raman spectroscopy generation network model. The first loss function is: ; wherein, denotes a maximum game of the Raman spectrum generation network model and the Raman spectrum discrimination network model, denotes the Raman spectrum discrimination network model, denotes the Raman spectrum generation network model, pairs of original Raman spectrum data are discriminated as positive samples, pairs of the first Raman spectrum data and the condition information y used are discriminated as negative samples; is a probability distribution of the original Raman spectrum data set, is an output of the simulated spectrum data set generated by the Raman spectrum discrimination network model, is a probability distribution of the generated first Raman spectrum data set, is a random vector, denotes that the Raman spectrum discrimination network model can distinguish the original Raman spectrum data and the generated Raman spectrum data, denotes that the Raman spectrum generation network model can generate Raman spectrum data that cannot be distinguished by the Raman spectrum discrimination network model. 2.The model training method of claim 1, wherein, The Raman spectroscopy generation network model was converged using a second loss function, which is: ; wherein, represents a minimum game of the Raman spectrum generation network model and the Raman spectrum discrimination network model, represents the Raman spectrum discrimination network model, represents the Raman spectrum generation network model, the data pair of the first Raman spectrum data and the condition information y used is discriminated as a negative sample, is a generated first Raman spectrum data set probability distribution, is a random vector, represents that the Raman spectrum generation network model can generate Raman spectrum data that cannot be distinguished by the Raman spectrum discrimination network model.
3. The model training method as described in claim 1, characterized in that, The Raman spectroscopy generation network model converges when the number of training iterations reaches the preset number.
4. A model training apparatus for implementing the model training method according to any one of claims 1-3, characterized in that, The training for the Raman spectroscopy generation network model includes: Raman spectroscopy acquisition module, used to acquire raw Raman spectral data; The model building module is used to build Raman spectroscopy generation network models and Raman spectroscopy discrimination network models. A Raman spectroscopy generation network model is used to generate Raman spectral data from raw Raman spectral data. A Raman spectroscopy discrimination network model is used to distinguish between raw Raman spectral data and generated Raman spectral data to obtain training parameters; The model training module is used to train the Raman spectroscopy generation network model based on the training parameters, optimize the training parameters, and then the Raman spectroscopy generation network model converges to obtain the final trained Raman spectroscopy generation network model.
5. A method for generating Raman spectra, characterized in that, include: Collect the Raman spectrum data of the analyte and input it into the Raman spectrum generation network model to generate Raman spectrum data of the same dimension as the Raman spectrum data to be measured. The Raman spectroscopy generation network model is trained according to the model training method described in any one of claims 1 to 3.
6. A Raman spectroscopy generation apparatus for implementing the model training method according to any one of claims 1-3, characterized in that, include: Raman spectroscopy acquisition module, which acquires the Raman spectral data of the analyte; The input module is used to input the Raman spectral data to be measured into the Raman spectral generation network model; A Raman spectroscopy generation network model is used to generate Raman spectral data of the same dimension as the Raman spectral data to be measured. The Raman spectroscopy generation network model is trained according to the model training method described in any one of claims 1 to 3.
7. An electronic device, the device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the model training method as described in any one of claims 1 to 3 or the Raman spectrum generation method as described in claim 5.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the model training method as described in any one of claims 1 to 3 or the Raman spectrum generation method as described in claim 5.