Mixture Raman spectrum qualitative analysis method and system based on triplet network
Through the Raman spectroscopy qualitative analysis method based on triplet network, using data enhancement and differential harmonic quotient exponential loss function, the accuracy and data acquisition difficulties in mixture analysis are solved, efficient component identification is achieved, and cost savings are achieved. cost and improved analytical accuracy.
Patent Information
- Application Number
- CN202410830990.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-03
AI Technical Summary
Existing Raman spectroscopy analysis technology is difficult to accurately analyze mixtures qualitatively, and obtaining large-scale annotated Raman spectroscopy data is difficult and expensive, requiring professional knowledge and expert participation.
A qualitative analysis method of mixture Raman spectra based on triplet network is adopted. By establishing a Raman spectrum database, data enhancement is performed, a triplet network model is constructed, and the differential harmonic quotient index is used as the loss function for training, feature extraction, and identification. The components of the mixture to be tested.
There is no need to label a large amount of Raman spectrum data, which saves labor and material costs. It can accurately identify the components of the mixture to be measured and improve the accuracy of analysis.
Smart Images

Figure CN118583841A
Abstract
Description
Technical Field
[0001] The present invention relates to a material analysis method, and in particular to a mixture Raman spectrum qualitative analysis method and system based on a triplet network. Background Art
[0002] Raman spectroscopy is a non-destructive analytical technique used to study the structure and chemical composition of substances. It is based on the Raman scattering principle. When light interacts with matter, some photons are scattered and the propagation direction and frequency emission change. This frequency change of scattered light can reveal the molecular vibration mode and structural information of the substance.
[0003] However, in many scenarios, the substance that needs to be analyzed is not a single pure substance, but a combination of different pure substances. Factors such as the complex spectrum of the mixture, severe spectral peak overlap, and mutual influence between different components make its qualitative analysis prone to errors.
[0004] On the other hand, obtaining large-scale annotated Raman spectroscopy data can be difficult and expensive. In addition, for the qualitative analysis of mixtures, the components and mixing ratios of each sample need to be accurately annotated, which also requires expertise and the participation of experts. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a method and system for qualitative analysis of mixture Raman spectroscopy based on triplet network, which can accurately analyze the components of the mixture without the need for a large amount of annotated Raman spectroscopy data.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is:
[0007] A Raman spectroscopy qualitative analysis method for a mixture based on a triplet network, comprising:
[0008] Establishing a Raman spectrum database, wherein the Raman spectrum database includes a plurality of pure substances and their corresponding Raman spectrum data;
[0009] Performing data enhancement on the data in the Raman spectrum database to obtain a mixture of multiple known components and proportions and their corresponding Raman spectrum data, and using the spectrum data of the pure substance and the enhanced data as training data;
[0010] Constructing a triplet network model;
[0011] Using the training data to train the triplet network model;
[0012] The trained triplet network model is used to extract the Raman spectral features of the mixture to be tested and the Raman spectral features of the pure substances in the Raman spectral database respectively;
[0013] Calculate the similarity between the Raman spectrum characteristics of the mixture to be tested and the Raman spectrum characteristics of the pure substance in the Raman spectrum database;
[0014] Pure substances with similarity greater than a preset threshold are identified as components of the mixture to be tested.
[0015] Optionally, the input for training the triplet network model is a triplet (a, p, n), and the loss function of the triplet network model is:
[0016] L=max(s_HQI(a,p)-s_HQI(a,n)+margin,0)
[0017] s_HQI(a,p)=1-HQI(a,p)
[0018] s_HQI(a,n)=1-HQI(a,n)
[0019] Where a is a sample in the training data, p is a sample of the same category as a, n is a sample of a different category from a, L is the loss, s_HQI(a,p) is the distance measure between a and p, s_HQI(a,n) is the distance measure between a and n, margin represents the minimum limit of the difference between s_HQI(a,p) and s_HQI(a,n), HQI(a,p) is the differential harmonic quotient index between a and p, and HQI(a,n) is the differential harmonic quotient index between a and n.
[0020] Optionally, the preset threshold value ranges from 0.5 to 0.7.
[0021] Optionally, data enhancement is performed on the data in the Raman spectrum database to obtain a mixture of multiple known components and proportions and their corresponding Raman spectrum data, specifically including:
[0022] The data enhancement method is used to superimpose the Raman spectra of pure substances in the Raman spectrum database, and for each pure substance, several mixtures with known components and proportions and their corresponding Raman spectrum data are generated.
[0023] Optionally, after data enhancement is performed on the data in the Raman spectroscopy database to obtain a mixture of multiple known components and proportions and their corresponding Raman spectroscopy data, uniformly distributed noise with an intensity less than or equal to 0.3% is added to the Raman spectroscopy data of the mixture, and the spectral data of the pure substance and the data after adding noise are used as training data.
[0024] Another technical solution adopted by the present invention is:
[0025] A Raman spectroscopy qualitative analysis system for a mixture based on a triplet network comprises a computer-readable storage medium and a processor; a computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, the steps included in the Raman spectroscopy qualitative analysis method for a mixture based on a triplet network can be implemented.
[0026] The beneficial effects of the present invention are: the use of data enhancement technology effectively solves the problem of limited training data, and there is no need to annotate a large amount of Raman spectral data, which greatly saves manpower and material costs. The triplet network model is used to minimize the distance between samples of the same category and maximize the distance between samples of different categories to learn the similarity metric, so that the components of the mixture to be tested can be accurately identified. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 Shown is a schematic flow chart of a method for qualitative analysis of a mixture by Raman spectroscopy based on a triplet network according to an embodiment of the present invention;
[0028] Figure 2 FIG. 4 shows an example diagram of a Raman spectrum database according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to more clearly understand the technical content, achieved purposes and effects of the present invention, the present invention is described in detail below in conjunction with specific implementation methods and in conjunction with the accompanying drawings. It should be noted that, in the absence of conflict, the implementation methods of the present invention and the features in the implementation methods can be combined with each other. In the following description, many specific details are set forth in order to fully understand the present invention. The described implementation methods are only part of the implementation methods of the present invention, not all implementation methods. Based on the implementation methods in the present invention, all other implementation methods obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0030] Please refer to Figure 1 As shown, the technical solution provided by the present invention is:
[0031] A Raman spectroscopy qualitative analysis method for a mixture based on a triplet network, comprising:
[0032] Establishing a Raman spectrum database, wherein the Raman spectrum database includes a plurality of pure substances and their corresponding Raman spectrum data;
[0033] Performing data enhancement on the data in the Raman spectrum database to obtain a plurality of mixtures with known components and proportions and their corresponding Raman spectrum data, and using the spectrum data of the pure substance and the Raman spectrum data of the mixture as training data;
[0034] Constructing a triplet network model;
[0035] Using the training data to train the triplet network model;
[0036] The trained triplet network model is used to extract the Raman spectral features of the mixture to be tested and the Raman spectral features of the pure substances in the Raman spectral database respectively;
[0037] Calculate the similarity between the Raman spectrum characteristics of the mixture to be tested and the Raman spectrum characteristics of the pure substance in the Raman spectrum database;
[0038] Pure substances with similarity greater than a preset threshold are identified as components of the mixture to be tested.
[0039] From the above description, it can be seen that the Raman spectroscopy qualitative analysis method of the mixture based on the triplet network of the present invention effectively solves the problem of limited training data by using data enhancement technology, and does not require a large amount of Raman spectroscopy data to be labeled, which greatly saves manpower and material costs. The triplet network model combined with Raman spectroscopy material analysis can accurately identify the components of the mixture to be tested when data is limited and labeling is difficult.
[0040] Compared with traditional supervised learning tasks, the training process of the Triplet Network model does not rely on label information: in the Triplet Network, the training data is constructed by constructing triplets (a, p, n) instead of just using a single sample and the corresponding label. These triplets consist of samples in the training data, where a is a sample, p is a sample similar to a, and n is a sample that is not similar to a. By minimizing the triplet loss function, the feature representations of a and p are made as close as possible, while the feature representations of a and m are as far apart as possible.
[0041] Other feature learning methods may have the following problems: when using a data set of random objects, object A may be considered similar to object B, but when only two objects in a group of individuals need to be distinguished, the same object A may be considered dissimilar to object B. Therefore, when selecting features, it is not enough to judge the relationship between the two, especially when facing simple classification problems with less training data, errors may occur. The training goal of the triplet network model is to learn the similarity metric while minimizing the distance between samples of the same category and maximizing the distance between samples of different categories. The present invention uses a triplet network model to extract Raman spectral features, so that the obtained features can be better distinguished, and then used for subsequent similarity calculations, thereby accurately identifying the components of the mixture to be tested.
[0042] Optionally, the input for training the triplet network model is a triplet (a, p, n), and the loss function of the triplet network model is:
[0043] L=max(s_HQI(a,p)-s_HQI(a,n)+margin,0)
[0044] s_HQI(a,p)=1-HQI(a,p)
[0045] s_HQI(a,n)=1-HQI(a,n)
[0046] Where a is a sample in the training data, p is a sample of the same category as a, n is a sample of a different category from a, L is the loss, s_HQI(a,p) is the distance measure between a and p, s_HQI(a,n) is the distance measure between a and n, margin is a preset threshold used to control the difference between p and n, indicating the minimum limit value of the difference between s_HQI(a,p) and s_HQI(a,n), HQI(a,p) is the differential harmonic quotient index between a and p, and HQI(a,n) is the differential harmonic quotient index between a and n.
[0047] The loss function of the existing triplet network model is basically measured by Euclidean distance. The present invention optimizes the loss function and adopts the above function based on the differential harmonic quotient index (HQI). The differential harmonic quotient index (HQI) is an indicator used to measure the similarity between two signals. Since our Raman spectrum curve can be regarded as a Raman signal, compared with the basic Euclidean distance, the use of HQI for distance calculation is more suitable for signal quality assessment. First of all, the Euclidean distance only considers the linear difference between features, while HQI can capture the harmonic characteristics in the signal more sensitively by analyzing the harmonic information. In addition, since the Raman spectrum is obtained by irradiating the sample and measuring the frequency change of the scattered light of the sample, the resonance peak corresponds to the specific vibration mode of the molecules in the sample. The frequencies of these vibration modes are arranged in integer multiples, similar to the harmonics in the audio signal. Therefore, in view of the nonlinear characteristics existing in the Raman spectrum signal, the present invention uses HQI to measure the distance between the Raman spectrum cycles. The value range of HQI is between 0 and 1. When HQI is close to 1, it means that the two signals are very similar. This means that the two signals are very close in amplitude and phase, and their difference is very small. When HQI is close to 0, it means that the two signals are very dissimilar. This means that there are large differences in amplitude and phase between the two signals, and the correlation between them is low. Since HQI, ranges between 0-1, we convert the calculated HQI score into 1-HQI, which satisfies that when the HQI value is close to zero, it means that the two waveforms are very similar and the degree of match is very high. On the contrary, a larger HQI value indicates that the shape and intensity of the two waveforms are more different, and the degree of match is lower. Therefore, the above loss function is proposed.
[0048] Optionally, the preset threshold value ranges from 0.5 to 0.7.
[0049] Optionally, data enhancement is performed on the data in the Raman spectrum database to obtain a mixture of multiple known components and proportions and their corresponding Raman spectrum data, specifically including:
[0050] The data enhancement method is used to superimpose the Raman spectra of pure substances in the Raman spectrum database, and for each pure substance, several mixtures with known components and proportions and their corresponding Raman spectrum data are generated.
[0051] Because the spectrum of a mixture can be obtained by superimposing the spectra of pure substances, the composition and mixing ratio of each mixture sample are known, which provides the data needed for training the triplet network model.
[0052] Optionally, after data enhancement is performed on the data in the Raman spectroscopy database to obtain a mixture of multiple known components and proportions and their corresponding Raman spectroscopy data, uniformly distributed noise with an intensity less than or equal to 0.3% is added to the Raman spectroscopy data of the mixture, and the spectral data of the pure substance and the data after adding noise are used as training data.
[0053] From the above description, it can be seen that by adding uniformly distributed noise with an intensity less than or equal to 0.3%, interference in a real environment is simulated, making the analysis result more accurate.
[0054] Another technical solution adopted by the present invention is:
[0055] A Raman spectroscopy qualitative analysis system for a mixture based on a triplet network comprises a computer-readable storage medium and a processor; a computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, the steps included in the Raman spectroscopy qualitative analysis method for a mixture based on a triplet network can be implemented.
[0056] Please refer to Figure 1-2 , Embodiment 1 of the present invention is:
[0057] A Raman spectroscopy qualitative analysis method for a mixture based on a triplet network, comprising:
[0058] A Raman spectrum database is established, wherein the Raman spectrum database includes a plurality of pure substances and their corresponding Raman spectrum data; specifically, the Raman spectrum database includes the name of the substance, the CAS number of the substance, the main peak position of the Raman spectrum of the substance, and the Raman spectrum scattering intensity of the substance, such as Figure 2 As shown in the figure, CAS represents the CAS number, namecn represents the name of the substance, keyPointJson represents the main peak position of the Raman spectrum of the substance, and data represents the Raman spectrum scattering intensity of the substance.
[0059] The method of data enhancement is adopted to randomly superimpose the Raman spectra of pure substances in the Raman spectrum database, and generate several mixtures with known components and proportions and their corresponding Raman spectrum data for each pure substance; uniformly distributed noise with an intensity of less than or equal to 0.3% is added to the Raman spectrum data of the mixture, and the spectrum data of the pure substance and the Raman spectrum data of the mixture after adding noise are used as training data. The data after adding noise is also stored in the Raman spectrum database.
[0060] Construct a triplet network model.
[0061] The training data is used to train the triplet network model; the input for training the triplet network model is a triplet (a, p, n), and the loss function of the triplet network model is:
[0062] L=max(s_HQI(a,p)-s_HQI(a,n)+margin,0)
[0063] s_HQI(a,p)=1-HQI(a,p)
[0064] s_HQI(a,n)=1-HQI(a,n)
[0065] Where a is a sample in the training data, p is a sample of the same category as a, n is a sample of a different category from a, L is the loss, s_HQI(a,p) is the distance measure between a and p, s_HQI(a,n) is the distance measure between a and n, margin represents the minimum limit of the difference between s_HQI(a,p) and s_HQI(a,n), HQI(a,p) is the differential harmonic quotient index between a and p, and HQI(a,n) is the differential harmonic quotient index between a and n.
[0066] The trained triplet network model is used to extract the Raman spectral features of the mixture to be tested and the Raman spectral features of the pure substances in the Raman spectral database.
[0067] The similarity between the Raman spectrum characteristics of the mixture to be tested and the Raman spectrum characteristics of the pure substances in the Raman spectrum database is calculated; and the similarity value between the mixture and each pure substance in the database is recorded.
[0068] Pure substances with similarity greater than a preset threshold are identified as components of the mixture to be tested, and the preset threshold ranges from 0.5 to 0.7.
[0069] The following is a specific example:
[0070] S1. A Raman spectrum database was established: the database contains the basic information of Raman spectra of 796 pure substances, including the name of the substance, the CAS number of the substance, the main peak position of the Raman spectrum of the substance, and the Raman spectrum scattering intensity of the substance, such as Figure 2 shown.
[0071] S2. Perform data enhancement on the data in the Raman spectroscopy database: For each pure substance in the database, generate 40 enhanced mixture spectra. Taking substance A as an example, 20 of them are mixture spectra similar to A+C, and 20 are mixture spectra similar to B+C. Applied to the triplet input of the triplet network model, substance A is used as the sample, mixture A+C is the positive sample, and mixture B+C is the negative sample. That is to say, the ratio of positive samples to negative samples here is 1:1. B and C of the mixture spectrum are randomly selected, and the ratio is also random. Add uniformly distributed noise with a maximum intensity of 0.3% to mixtures A+C and B+C, and store them in the Raman spectroscopy database, together with the Raman spectroscopy data of pure substances as training data.
[0072] S3. Construct a triplet network model, input the spectral data of substance A, mixture A+C, and mixture B+C into the triplet network respectively, and use the above loss function for training. The characteristic vectors Emb_A, Emb_A+C, and Emb_B+C of substance A, mixture A+C, and mixture B+C are obtained, in which Emb_A and Emb_A+C are as close as possible, and the distance between Emb_A and Emb_B+C is as far as possible.
[0073] S4. Input the Raman spectrum of the mixture to be tested into the trained triplet network model to obtain the Raman spectrum feature vector of the mixture to be tested. Similarly, input the Raman spectrum of the pure substance in the Raman spectrum database into the trained triplet network model to obtain the Raman spectrum feature vector of the pure substance.
[0074] S5. Calculate the similarity between the Raman spectrum characteristics of the mixture to be tested and the Raman spectrum characteristics of the pure substances in the Raman spectrum database; and record the similarity value between the mixture and each pure substance in the database.
[0075] S6. Output the pure substances whose similarity values are greater than the threshold value, and obtain the result of the qualitative analysis of the mixture.
[0076] Embodiment 2 of the present invention is:
[0077] A Raman spectroscopy qualitative analysis system for a mixture based on a triplet network comprises a computer-readable storage medium and a processor; a computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, the steps included in the Raman spectroscopy qualitative analysis method for a mixture based on a triplet network described in Example 1 can be implemented.
[0078] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Therefore, any modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the technical solution of the present invention are still within the scope of the technical solution of the present invention.
Claims
1. A Raman spectroscopy qualitative analysis method for a mixture based on a triplet network, characterized in that: include: Establishing a Raman spectrum database, wherein the Raman spectrum database includes a plurality of pure substances and their corresponding Raman spectrum data; Performing data enhancement on the data in the Raman spectrum database to obtain a mixture of multiple known components and proportions and their corresponding Raman spectrum data, and using the spectrum data of the pure substance and the enhanced data as training data; Constructing a triplet network model; Using the training data to train the triplet network model; The trained triplet network model is used to extract the Raman spectral features of the mixture to be tested and the Raman spectral features of the pure substances in the Raman spectral database respectively; Calculate the similarity between the Raman spectrum characteristics of the mixture to be tested and the Raman spectrum characteristics of the pure substance in the Raman spectrum database; Pure substances with similarity greater than a preset threshold are identified as components of the mixture to be tested.
2. The Raman spectroscopy qualitative analysis method for a mixture based on a triplet network according to claim 1, characterized in that: The input for training the triplet network model is a triplet (a, p, n), and the loss function of the triplet network model is: L=max(s_HQI(a,p)-s_HQI(a,n)+margin,0) s_HQI(a,p)=1-HQI(a,p) s_HQI(a,n)=1-HQI(a,n) Where a is a sample in the training data, p is a sample of the same category as a, n is a sample of a different category from a, L is the loss, s_HQI(a,p) is the distance measure between a and p, s_HQI(a,n) is the distance measure between a and n, margin represents the minimum limit of the difference between s_HQI(a,p) and s_HQI(a,n), HQI(a,p) is the differential harmonic quotient index between a and p, and HQI(a,n) is the differential harmonic quotient index between a and n.
3. The Raman spectroscopy qualitative analysis method for a mixture based on a triplet network according to claim 1, characterized in that: The preset threshold value ranges from 0.5 to 0.
7.
4. The Raman spectroscopy qualitative analysis method of a mixture based on a triplet network according to claim 1, characterized in that: Data enhancement is performed on the data in the Raman spectrum database to obtain mixtures of various known components and proportions and their corresponding Raman spectrum data, including: The data enhancement method is used to superimpose the Raman spectra of pure substances in the Raman spectrum database, and for each pure substance, several mixtures with known components and proportions and their corresponding Raman spectrum data are generated.
5. The Raman spectroscopy qualitative analysis method of a mixture based on a triplet network according to claim 1, characterized in that: The data in the Raman spectrum database are enhanced to obtain a mixture of multiple known components and proportions and their corresponding Raman spectrum data. Then, uniformly distributed noise with an intensity less than or equal to 0.3% is added to the Raman spectrum data of the mixture, and the spectrum data of the pure substance and the data after adding noise are used as training data.
6. A Raman spectroscopy qualitative analysis system for a mixture based on a triplet network, characterized in that: It comprises a computer-readable storage medium and a processor; the computer-readable storage medium stores a computer program, and when the program is executed by the processor, it can implement the steps included in the Raman spectroscopy qualitative analysis method for a mixture based on a triplet network as described in any one of claims 1 to 5.
Citation Information
Cited By
Modeling-free mixture component intelligent identification method and system
CN121185941A
