A univariate classification spectroscopy analysis method and system based on an interpretable deep model
By employing data augmentation methods such as random Gaussian peak generation and first-order derivative calculation, combined with deep forest model training and visualization, an interpretable deep model is constructed. This addresses the issues of large data volume and insufficient interpretability in Raman spectroscopy analysis using deep learning, achieving highly sensitive and selective substance identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2026-03-17
AI Technical Summary
Existing deep learning methods in Raman spectroscopy analysis suffer from large data requirements and insufficient interpretability, especially when dealing with unknown samples, making it difficult to meet practical detection needs.
A random Gaussian peak generation data augmentation method is adopted. By generating a large number of positive and negative samples and performing first derivative operations, combined with deep forest model training and visualization, an interpretable deep model is constructed for the identification of target objects and unknown substances.
It achieves highly sensitive and selective substance identification, accurately distinguishes target substances from unknown non-target substances, and captures weak signals in mixtures or complex matrices. The model visualization results have a high degree of matching with the spectral peaks of the target substances.
Smart Images

Figure CN115876743B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectroscopic analysis, and in particular to a single-sample classification spectroscopic analysis method and system based on an interpretable depth model. Background Technology
[0002] Raman spectroscopy (including surface-enhanced Raman spectroscopy), as a highly sensitive detection technique capable of providing material fingerprint information, plays a vital role not only in basic scientific research, such as surface science, analytical science, and life sciences, but also in practical applications, such as food safety, forensic medicine, and industrial production activities, where it serves as a powerful detection tool. The extremely high sensitivity and rich information content of Raman spectroscopy make spectral interpretation challenging. Extracting the necessary information from the spectra of complex mixtures is crucial for achieving qualitative and quantitative analysis using Raman spectroscopy. Typically, spectral interpretation utilizes statistical methods from chemometrics, such as peak matching algorithms. These algorithms construct single-classification recognition models by analyzing and identifying standard spectra for the identification of unknown samples. However, due to their simple algorithmic structure, their effectiveness is often unsatisfactory when dealing with complex spectra. In recent years, with the explosive development of computer science, deep learning-based qualitative analysis methods for Raman spectroscopy have also rapidly evolved. While deep learning has greatly improved the accuracy of qualitative analysis, compared to traditional analytical chemistry methods, it requires a massive amount of data and lacks interpretability in analytical chemistry. More importantly, deep learning models typically show a significant drop in performance when faced with unknown samples, failing to meet the practical needs for detecting unknown samples. Summary of the Invention
[0003] The main objective of this invention is to overcome the aforementioned deficiencies in the prior art and propose a single-sample classification spectroscopic analysis method based on an interpretable deep model. Utilizing the unique data augmentation method of random Gaussian peak generation, a large number of positive and negative sample sets can be generated solely from the standard spectrum of the target object. After processing with the first derivative, the sample sets are output to the deep learning model for training. Finally, the model's performance is evaluated by combining the model's visualization. This model can accurately distinguish between target objects and unknown non-target objects, and can also capture weak target object signals in mixtures or complex matrices, achieving highly sensitive and selective substance identification.
[0004] The present invention adopts the following technical solution:
[0005] A single-sample classification spectral analysis method based on an interpretable deep model includes:
[0006] Several negative samples are randomly generated, each containing several Gaussian spectral peaks with random positions, full width at half maximum (FWHM), and relative peak intensities; the standard spectrum of the target object is summed with the generated negative samples to form several positive samples;
[0007] Perform first-order derivative operations on each positive and negative sample to obtain the differentiated sample;
[0008] The differentiated sample is input into the deep forest model for model training to obtain a trained deep forest model, which includes a feature extraction module and a classification module.
[0009] The trained deep forest model is visualized by statistically summing the importance of each level of representation features to obtain a vector of representation feature importance of the trained deep forest model. Using the standard spectrum of the target object as the outline, the vector of representation feature importance is mapped to the color map and filled in to visualize the trained deep forest model.
[0010] The visualized deep forest model is used to identify whether a target object exists in an unknown substance.
[0011] Specifically, the differentiated samples are input into the deep forest model for training, resulting in a trained deep forest model. The deep forest model includes a feature extraction module and a classification module; specifically:
[0012] The feature extraction module includes a multi-layered cascaded forest, which includes a random forest for feature extraction.
[0013] The classification module includes: a random forest for classification;
[0014] In a single-layer cascaded forest, the input data will have its features extracted by the cascaded forest. The extracted features will be concatenated with the original features and then input into the next layer of the cascaded forest. Finally, the final output of the cascaded forest will be concatenated with the original features and input into the classification module for final category determination.
[0015] Specifically, the trained deep forest model is visualized, and the importance of each level of representation feature is statistically summed to obtain a vector of representation feature importance of the trained deep forest model, as follows:
[0016] The importance of the representational features used by each node in the decision tree of the random forest is statistically summed.
[0017] The importance of the representational features used in each random forest in the model is statistically summed;
[0018] The importance of the representation features used in each random forest in the cascaded forest is statistically summed.
[0019] The importance of the representation features used in each level of the deep forest are statistically summed to form a vector of the importance of the representation features in the deep forest model.
[0020] Specifically, the importance of the characterization feature is the Gini coefficient.
[0021] Another embodiment of the present invention discloses a single-sample classification spectral analysis system based on an interpretable deep model, comprising:
[0022] Sample generation unit: randomly generates several negative samples, each containing several Gaussian spectral peaks with random positions, full width at half maximum (FWHM), and relative peak intensities; the standard spectrum of the target object is summed with the generated negative samples to form several positive samples;
[0023] Sample differentiation unit: Perform first-order derivative operations on each positive and negative sample to obtain differentiated samples;
[0024] Model training unit: The differentiated samples are input into the deep forest model for model training to obtain a trained deep forest model, which includes a feature extraction module and a classification module;
[0025] Model Visualization Unit: Visualizes the trained deep forest model, statistically sums the importance of each level of representation features to obtain the vector of representation feature importance of the trained deep forest model, and maps the vector of representation feature importance to the color map with the standard spectrum of the target object as the outline and fills it to realize the visualization of the trained deep forest model, thus obtaining the visualized deep forest model.
[0026] Identification Unit: Uses a visualized deep forest model to identify whether a target object exists in an unknown substance.
[0027] One aspect of this invention provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it can implement the above-described method steps for single-classification spectral analysis based on an interpretable depth model.
[0028] In another aspect, this invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method steps for a single-classification spectral analysis based on an interpretable depth model.
[0029] As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following beneficial effects:
[0030] (1) This invention provides a single-sample classification spectral analysis method based on an interpretable deep model, comprising: randomly generating several negative samples, each negative sample containing several Gaussian spectral peaks with random positions, half-widths, and relative peak intensities; summing the standard spectrum of the target object with the generated negative samples to form several positive samples; performing first-order derivative operations on the positive and negative samples one by one to obtain differentiated samples; inputting the differentiated samples into a deep forest model for model training to obtain a trained deep forest model, wherein the deep forest model includes a feature extraction module and a classification module; visualizing the trained deep forest model and statistically summing the importance of each level of representation features to obtain the trained deep forest model. The vector representing the importance of features is mapped to a color map using the standard spectrum of the target object as the outline, and then filled to visualize the trained deep forest model, resulting in a visualized deep forest model. The visualized deep forest model is then used to identify whether the target object exists in an unknown substance. The method provided by this invention has shown good recognition performance in Raman spectroscopy, standard spectrum recognition of surface-enhanced Raman spectroscopy, mixture recognition, and substance recognition in complex matrices (actual samples). It can not only accurately distinguish between target objects and unknown non-target objects, but also capture weak target object signals in mixtures or complex matrices, achieving highly sensitive and selective substance recognition.
[0031] (2) Compared with other deep learning algorithms, the present invention only requires a single spectrum to construct a deep learning model, and the visualization results of the model have a very high degree of matching with the peak of the target spectral material, which is far superior to other deep learning algorithms in terms of interpretability. Attached Figure Description
[0032] Figure 1 A flowchart of a single-classification spectroscopic analysis method based on an interpretable depth model is provided in an embodiment of the present invention;
[0033] Figure 2 This invention provides an architecture diagram of a single-classification spectral analysis system based on an interpretable deep model.
[0034] Figure 3 The material spectra provided in the embodiments of the present invention are shown in Figure (a), which shows the pure material spectra of six polycyclic aromatic hydrocarbons, and Figure (b) shows the material identification results of Ant.
[0035] Figure 4 The following are SERS spectra of different concentrations of gelseminin in soy milk (A) and different concentrations of gelseminin in soy sauce (B) provided for embodiments of the present invention; and SERS spectra of different concentrations of gelseminin in soy milk matrix (C) and different concentrations of gelseminin in soy sauce matrix (D).
[0036] Figure 5A schematic diagram of an electronic device provided in an embodiment of the present invention;
[0037] Figure 6 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this invention. Detailed Implementation
[0038] The present invention provides a single-sample classification spectroscopic analysis method based on an interpretable depth model, which has shown good recognition performance in Raman spectroscopy, standard spectrum identification of surface-enhanced Raman spectroscopy, mixture identification, and substance identification in complex matrices (actual samples). It can not only accurately distinguish between target objects and unknown non-target objects, but also capture weak target object signals in mixtures or complex matrices, achieving highly sensitive and selective substance identification.
[0039] like Figure 1 A flowchart of a single-sample classification spectral analysis method based on an interpretable deep model, provided for embodiments of the present invention, specifically includes:
[0040] S101: Randomly generate several negative samples, each containing several Gaussian spectral peaks with random positions, full width at half maximum (FWHM), and relative peak intensities; sum the standard spectrum of the target object with the generated negative samples to form several positive samples;
[0041] This invention utilizes a special data augmentation method called random Gaussian peak generation, which can generate a large number of positive and negative sample sets using only the standard spectrum of the target object, without requiring a huge amount of data.
[0042] S102: Perform first-order derivative operations on each positive and negative sample to obtain the differentiated sample;
[0043] By performing first-order derivative operations on positive and negative samples and using them as input data for the model, interference from background signals and the influence of overlapping spectral peaks can be eliminated.
[0044] S103: Input the differentiated sample into the deep forest model for model training to obtain a trained deep forest model, which includes a feature extraction module and a classification module.
[0045] The differentiated samples are input into the deep forest model for training, resulting in a trained deep forest model. The deep forest model includes a feature extraction module and a classification module; specifically:
[0046] The feature extraction module includes a multi-layered cascaded forest, which includes a random forest for feature extraction.
[0047] The classification module includes: a random forest for classification;
[0048] In a single-layer cascaded forest, the input data will have its features extracted by the cascaded forest. The extracted features will be concatenated with the original features and then input into the next layer of the cascaded forest. Finally, the final output of the cascaded forest will be concatenated with the original features and input into the classification module for final category determination.
[0049] S104: Visualize the trained deep forest model, statistically sum the importance of each level of representation features to obtain the vector of representation feature importance of the trained deep forest model, and map the vector of representation feature importance to the color map with the standard spectrum of the target object as the outline, and fill it to realize the visualization of the trained deep forest model and obtain the visualized deep forest model.
[0050] The trained deep forest model is visualized, and the importance of each level of representation feature is statistically summed to obtain a vector of representation feature importance of the trained deep forest model, specifically:
[0051] The importance of the representational features used by each node in the decision tree of the random forest is statistically summed.
[0052] The importance of the representational features used in each random forest in the model is statistically summed;
[0053] The importance of the representation features used in each random forest in the cascaded forest is statistically summed.
[0054] The importance of the representation features used in each level of the deep forest are statistically summed to form a vector of the importance of the representation features in the deep forest model.
[0055] The importance of the characterization feature is the Gini coefficient.
[0056] In this embodiment of the invention, the trained deep forest model is visualized, and the accuracy of the trained deep forest model is evaluated by comparing whether the feature peaks in the contour of the standard spectrum of the target object correspond to those in the visualized model.
[0057] S105: Use the visualized deep forest model to identify whether there is a target object in the unknown substance.
[0058] like Figure 2 This invention provides a single-classification spectral analysis system based on an interpretable deep model, comprising:
[0059] Sample generation unit 201: randomly generates several negative samples, each negative sample containing several Gaussian spectral peaks with random positions, full width at half maximum (FWHM), and relative peak intensities; the standard spectrum of the target object is summed with the generated negative samples to form several positive samples;
[0060] Sample differentiation unit 202: Performs first-order derivative operations on each positive and negative sample to obtain differentiated samples;
[0061] Model training unit 203: Input the differentiated samples into the deep forest model for model training to obtain a trained deep forest model, wherein the deep forest model includes a feature extraction module and a classification module;
[0062] Model visualization unit 204: Visualizes the trained deep forest model, statistically sums the importance of each level of representation features to obtain the vector of representation feature importance of the trained deep forest model, and maps the vector of representation feature importance to the color map with the standard spectrum of the target object as the outline and fills it to realize the visualization of the trained deep forest model and obtain the visualized deep forest model.
[0063] Identification Unit 205: Uses a visualized deep forest model to identify whether a target object exists in an unknown substance.
[0064] The advantages of this solution are illustrated below through specific examples.
[0065] like Figure 3 As shown in (a), this invention is used for qualitative analysis of SERS results of six structurally similar polycyclic aromatic hydrocarbons (PAHs). The standard spectra of the PAHs to be identified are input into this method to generate a substance identification model, which is then used to identify the remaining five PAHs. The results show that this method, using any PAH SERS spectrum as a model, can distinguish it from other PAH SERS spectra not input into the model, and the visualization results are also clear. Figure 3 As can be seen in (b), the features captured by the model are all the main characteristic peaks in the standard spectrum. The above results show that the method has good selectivity when used to distinguish between substances.
[0066] like Figure 4 As shown, this method can be used for substance identification in complex matrices. Using soy milk (… Figure 4 (c)), soy sauce Figure 4 (d) SERS detection of gelseminin in two complex matrices (standard SERS spectra are shown in Figure 1) Figure 4 (a) Taking this as an example, the results show that by establishing a substance identification model using the SERS standard spectrum of gelsemium, the target substance can be detected not only when the target substance signal is extremely weak, i.e., the target substance concentration in soy milk is 10 ppb and the target substance concentration in soy sauce is 100 ppb, but also based on the visualization results ( Figure 4 (b) It can be observed that the model accurately captures the main characteristic peaks of Gelsemium elegans, such as those located at 1000 cm⁻¹. -1The spectral peaks on the left and right are clearly marked in the visualization results. In summary, this demonstrates that the method has high sensitivity and good interpretability.
[0067] Figure 5 As shown, this embodiment of the invention provides an electronic device 500, including a memory 510, a processor 520, and a computer program 511 stored in the memory 520 and executable on the processor 520. When the processor 520 executes the computer program 511, it implements a single-classification spectral analysis method based on an interpretable depth model provided by this embodiment of the invention.
[0068] Since the electronic device described in this embodiment is the device used to implement the embodiments of the present invention, those skilled in the art can understand the specific implementation methods and various variations of the electronic device in this embodiment based on the methods described in the embodiments of the present invention. Therefore, how the electronic device implements the methods in the embodiments of the present invention will not be described in detail here. Any device used by those skilled in the art to implement the methods in the embodiments of the present invention is within the scope of protection of the present invention.
[0069] Please see Figure 6 , Figure 6 This is a schematic diagram of an embodiment of a computer-readable storage medium provided in this invention.
[0070] like Figure 6 As shown, this embodiment provides a computer-readable storage medium 600, on which a computer program 611 is stored. When the computer program 611 is executed by a processor, it implements a single-classification spectral analysis method based on an interpretable depth model provided in this embodiment of the invention.
[0071] It should be noted that the descriptions of each embodiment in the above embodiments have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0072] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0073] This invention provides a single-sample classification spectral analysis method based on an interpretable deep model, comprising: randomly generating several negative samples, each negative sample containing several Gaussian spectral peaks with random positions, full width at half maximum (FWHM), and relative peak intensities; summing the standard spectrum of the target object with the generated negative samples to form several positive samples; performing first-order derivative operations on each of the positive and negative samples to obtain differentiated samples; inputting the differentiated samples into a deep forest model for model training to obtain a trained deep forest model, wherein the deep forest model includes a feature extraction module and a classification module; visualizing the trained deep forest model and statistically summing the importance of each level of representation features to obtain the table of the trained deep forest model. The vector representing the importance of features is mapped to a color map using the standard spectrum of the target object as the outline, and then filled to visualize the trained deep forest model, resulting in a visualized deep forest model. The visualized deep forest model is then used to identify whether the target object exists in an unknown substance. The method provided by this invention has shown good recognition performance in Raman spectroscopy, standard spectrum recognition of surface-enhanced Raman spectroscopy, mixture recognition, and substance recognition in complex matrices (actual samples). It can not only accurately distinguish between target objects and unknown non-target objects, but also capture weak target object signals in mixtures or complex matrices, achieving highly sensitive and selective substance recognition.
[0074] Compared to other deep learning algorithms, this invention only requires a single spectrum to construct a deep learning model, and the visualization results of the model have a very high degree of matching with the spectral peaks of the target object, making it far superior to other deep learning algorithms in terms of interpretability.
[0075] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. The above descriptions are merely specific embodiments of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
[0076] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.
Claims
1. A single-spectrum classification spectroscopic analysis method based on an interpretable deep model, characterized in that, The method comprises the following steps: a plurality of negative samples are randomly generated, each of which contains a plurality of random Gaussian spectral peaks in position, full width at half maximum and relative peak intensity; a standard spectrum of a target object is added to the generated negative samples to form a plurality of positive samples; first derivative operation is performed on the positive samples and the negative samples one by one to obtain samples after derivation; the samples after derivation are input into a deep forest model for model training to obtain a trained deep forest model, wherein the deep forest model comprises a feature extraction module and a classification module; the trained deep forest model is visualized, the importance of the feature representation at each level is statistically added, the vector of the importance of the feature representation of the trained deep forest model is obtained, the vector of the importance of the feature representation is mapped to a color map, and filling is performed to realize visualization of the trained deep forest model, and a visualized deep forest model is obtained; whether the target object exists in an unknown substance is identified by using the visualized deep forest model; the deep forest model is trained by inputting the samples after derivation into the deep forest model, and the trained deep forest model comprises the feature extraction module and the classification module; specifically, the feature extraction module comprises a plurality of cascaded forests, and the cascaded forest comprises a random forest for feature extraction; the classification module comprises a random forest for classification; 2. The single spectrum classification spectroscopic analysis method based on an interpretable deep model according to claim 1, characterized in that, in a single-layer cascaded forest, the input data is extracted by the cascaded forest, the extracted features are spliced with the original features, and then input into the next layer of cascaded forest; finally, the final output of the cascaded forest is spliced with the original features and input into the classification module for final classification. The trained deep forest model is visualized, the importance of the feature representation at each level is statistically added, and the vector of the importance of the feature representation of the trained deep forest model is obtained, specifically: the importance of the feature representation used by each node in the random forest is statistically added; the importance of the feature representation used by each random forest in the model is statistically added; the importance of the feature representation used by each random forest in the cascaded forest is statistically added; 3. The single spectrum classification spectroscopic analysis method based on an interpretable deep model according to claim 2, characterized in that, the importance of the feature representation used by each cascaded forest in the deep forest is statistically added to form the vector of the importance of the feature representation of the deep forest model.
4. A univariate classification spectroscopy analysis system based on an interpretable deep model, characterized in that, The importance of the feature representation is the Gini coefficient. The method comprises the following steps: a sample generation unit: a plurality of negative samples are randomly generated, each of which contains a plurality of random Gaussian spectral peaks in position, full width at half maximum and relative peak intensity; a standard spectrum of a target object is added to the generated negative samples to form a plurality of positive samples; a sample preprocessing unit: first derivative operation is performed on the positive samples and the negative samples one by one to obtain samples after derivation; a model training unit: the samples after derivation are input into a deep forest model for model training to obtain a trained deep forest model, wherein the deep forest model comprises a feature extraction module and a classification module; The model visualization unit visualizes the trained deep forest model, statistically adds the feature importance of each level, obtains a vector of the feature importance of the trained deep forest model, maps the vector of the feature importance to a color map, fills the color map, visualizes the trained deep forest model, and obtains a visualized deep forest model. The recognition unit uses the visualized deep forest model to identify whether the target object exists in the unknown substance. The derivative sample is input into the deep forest model for model training to obtain a trained deep forest model, and the deep forest model includes a feature extraction module and a classification module. The feature extraction module includes a plurality of cascaded forests, and the cascaded forest includes a random forest for feature extraction. The classification module includes a random forest for classification. In the single-layer cascaded forest, the input data is extracted by the cascaded forest, the extracted features are spliced with the original features, and then input into the next layer of cascaded forest.
5. An electronic device, comprising: Finally, the final output of the cascaded forest is spliced with the original features and input into the classification module for final classification. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps of any one of claims 1-3.
6. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps of any one of claims 1-3.
Citation Information
Patent Citations
Raman spectrum analysis method for identifying target object in complex environment by using deep forest
CN109858477A
Power transmission and transformation suspicious data screening method and device based on random forest model
CN110110757A