Vibration spectrum analysis method based on convolutional neural network feature extraction
By automatically extracting and visualizing the nonlinear features of vibrational spectra using convolutional neural networks and Grad-CAM technology, the problems of strong subjectivity and low physical readability in traditional methods are solved, achieving high-precision and interpretable spectral analysis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE NAT CENT FOR NANOSCI & TECH NCNST OF CHINA
- Filing Date
- 2026-02-04
- Publication Date
- 2026-05-15
AI Technical Summary
Traditional vibrational spectral analysis methods rely on manual comparison, which is highly subjective and difficult to handle subtle differences and complex peak shapes. Furthermore, traditional chemometric models can only model linear features and cannot describe nonlinear coupling and resonance effects, resulting in poor reproducibility and low physical readability of the analysis results.
We employ a feature extraction method based on convolutional neural networks (CNN) and combine it with gradient-weighted class activation mapping (Grad-CAM) to achieve feature visualization, automatically locate key peaks, and reveal the nonlinear characteristics and global relationships of the spectrum.
It achieves high-precision spectral analysis while providing clear discrimination criteria and physical interpretations, reducing the subjectivity of manual spectral interpretation, improving the model's fitting accuracy and generalization ability, and is applicable to various spectral types and application fields.
Smart Images

Figure CN122045891A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of spectral analysis technology, and more specifically to a vibrational spectral analysis method based on feature extraction from a convolutional neural network. Background Technology
[0002] Spectroscopic analysis, as an important technique for revealing the structure and composition of substances, is widely used in fields such as chemistry, biology, materials science, and the environment. The vibrations, rotations, or electronic transitions of different molecular bonds produce characteristic peaks in the spectrum; their shape, intensity, and position reflect the chemical composition and physical state of the system. Traditional spectroscopic analysis mainly relies on manual comparison of differences in characteristic peaks to identify substances. When spectral differences are subtle or characteristic peaks overlap, they are difficult to distinguish effectively with the naked eye, leading to highly subjective analytical results and poor reproducibility.
[0003] To improve the accuracy and objectivity of spectral analysis, chemometric methods are widely used. These methods reveal sample differences in low-dimensional space through mathematical modeling, such as principal component analysis (PCA), partial least squares regression (PLS), and support vector machines (SVM). They can identify bands that contribute significantly to the model using load plots or coefficient vectors. However, these methods are usually based on linear assumptions and struggle to describe the complex nonlinear coupling and resonance effects between spectral bands. When signal noise is high, peak shapes are complex, or inter-sample differences are weak, the model's predictive power and physical interpretability decrease significantly.
[0004] To overcome the aforementioned limitations, intelligent spectral analysis methods have gained increasing attention. The introduction of deep learning has provided new insights into spectral data modeling. Models based on convolutional neural networks (CNNs) or attention mechanisms can automatically extract potential nonlinear features and global dependencies in the spectrum, achieving high-precision substance identification, polymer classification, and quantitative component analysis. However, most current work still prioritizes predictive performance, tending to employ multi-model fusion or complex network structures. While these methods can significantly improve accuracy, they also further deepen the "black box" nature of the model, significantly reducing the physical readability and interpretability of the results. For spectral analysis, opening this "black box" not only helps improve the model's credibility and generalization ability but also makes it an important tool for revealing the intrinsic relationship between spectrum, structure, and properties.
[0005] Based on this, this invention proposes a feature visualization convolutional neural network framework for interpretable vibrational spectrum analysis. The method first obtains the measured vibrational spectrum, and then constructs a convolutional neural network (CNN) based on the spectrum to complete specific classification or quantitative tasks. While maintaining high accuracy, the features captured by the CNN are extracted and combined with gradient-weighted class activation mapping (Grad-CAM) to visualize the model's regions of interest, thereby revealing key spectral segments and their physical meaning while ensuring high-precision prediction.
[0006] Therefore, proposing a vibrational spectrum analysis method based on convolutional neural network feature extraction to solve the difficulties of existing technologies is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0007] In view of this, the present invention provides a vibrational spectrum analysis method based on feature extraction from convolutional neural networks. The present invention aims to use deep learning networks to extract the nonlinear features and global correlations contained in spectral data, and combine them with feature visualization mechanisms to achieve automatic localization of key peaks in the spectrum, thereby solving the problems of strong subjectivity in manual spectral interpretation and the fact that traditional chemometric models can only perform linear feature modeling.
[0008] To achieve the above objectives, the present invention provides the following technical solution: A vibrational spectrum analysis method based on feature extraction from a convolutional neural network includes the following steps: S1: Acquire and preprocess the vibrational spectral data to obtain standardized and enhanced vibrational spectral data; S2: Based on the standardized and enhanced vibrational spectral data, a convolutional neural network is designed and trained to obtain a model for spectral feature extraction; S3: Based on the trained model, calculate the gradient-weighted class activation map heatmap to visualize the features; S4: The interpolated heatmap is matched with the original spectral size to perform contribution analysis on the spectral characteristic peaks and locate the key peaks of the original spectrum.
[0009] Optionally, the specific content of acquiring vibration spectral data in S1 is as follows: based on the fingerprint region characteristics and physicochemical properties of the object to be detected, vibration spectral technology is selected to acquire vibration spectral data.
[0010] Optionally, the specific preprocessing steps for the vibrational spectral data in S1 are as follows: The collected vibration spectrum data were standardized by sequentially aligning, interpolating, and normalizing; and Gaussian noise was added to process the vibration spectrum data through a data augmentation strategy to obtain standardized and enhanced vibration spectrum data.
[0011] Optionally, the specific details of designing the convolutional neural network in S2 are as follows: Construct a network structure that includes an input layer, several convolutional layers, pooling layers, fully connected layers, and an output layer; Multi-scale feature extraction is performed on the standardized and enhanced vibrational spectral data using local convolution and nonlinear activation functions.
[0012] Optionally, the specific content of training the convolutional neural network in S2 is as follows: Define the output layer and its corresponding loss function based on the task type; The convolutional neural network is trained and its performance is evaluated using training, validation, and test sets.
[0013] Optionally, the specific content of calculating the gradient-weighted class activation map heatmap in S3 is as follows: Based on the final classification results, calculate the gradient of each channel in the last convolutional layer of the model; Using the channel gradient as the weight, the feature maps of the last convolutional layer are weighted and summed to obtain a gradient-weighted class activation map; The activation map is interpolated to the same size as the input vibrational spectral data to generate a heatmap.
[0014] Optionally, the specific content of the contribution analysis of spectral characteristic peaks in S4 is as follows: The pixel intensities of the heatmap are summed in both the row and column directions. By summing the results in the row and column directions, the comprehensive contribution value of the corresponding wavenumber is obtained, thus realizing the location of the key peak in the original spectrum.
[0015] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a vibration spectrum analysis method based on convolutional neural network feature extraction, the beneficial effects of which are: 1) Automatic feature extraction and visualization: This invention utilizes CNN and Grad-CAM technology to achieve high-precision spectral analysis and prediction while intuitively displaying the key spectral bands that the model focuses on, providing researchers with clear discrimination criteria and physical explanations; 2) Solving problems such as difficulty and strong subjectivity in manual spectral interpretation: This invention can automatically identify spectral differences and key absorption peaks, significantly reducing the uncertainty caused by manual comparison and subjective judgment, and realizing an efficient, objective and standardized spectral analysis process; 3) Significantly improved nonlinear feature extraction capability: This invention models spectral data based on deep learning, and can automatically extract complex nonlinear relationships and global dependency features between spectral bands. Compared with traditional linearized stoichiometry methods, it significantly improves the model's fitting accuracy and generalization ability. 4) Strong applicability and scalability: The method of this invention has good versatility in spectral analysis, and is compatible with various spectral types such as infrared, Raman, and mass spectrometry. It can also be extended to multiple fields such as material identification, chemical composition quantification, and biomolecular detection, and has broad engineering application prospects and promotional value. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0017] Figure 1 A flowchart of a vibration spectrum analysis method based on feature extraction from a convolutional neural network, provided as an embodiment of the present invention; Figure 2 Infrared spectral curves of virgin PET and recycled PET provided for embodiments of the present invention; Figure 3 This is a structural diagram of a 2D-CNN model for classifying original / recycled PET cells, provided in an embodiment of the present invention. Figure 4 This is a diagram showing the loss variation and classification results of 2D-CNN during the training and validation phases in an embodiment of the present invention. Figure 5 A graph of the one-dimensional contribution spectrum obtained by Grad-CAM conversion for an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.
[0019] See Figure 1 As shown, this invention discloses a vibrational spectrum analysis method based on convolutional neural network feature extraction, comprising the following steps: S1: Acquire and preprocess the vibrational spectral data to obtain standardized and enhanced vibrational spectral data; S2: Based on the standardized and enhanced vibrational spectral data, a convolutional neural network is designed and trained to obtain a model for spectral feature extraction; S3: Based on the trained model, calculate the gradient-weighted class activation map heatmap to visualize the features; S4: The interpolated heatmap is matched with the original spectral size to perform contribution analysis on the spectral characteristic peaks and locate the key peaks of the original spectrum.
[0020] Furthermore, the specific content of collecting vibration spectral data in S1 is as follows: based on the fingerprint region characteristics and physicochemical properties of the analyte, vibration spectral technology is selected to collect vibration spectral data.
[0021] Furthermore, the specific preprocessing steps for the vibrational spectral data in S1 are as follows: The collected vibration spectrum data were standardized by sequentially aligning, interpolating, and normalizing; and Gaussian noise was added to process the vibration spectrum data through a data augmentation strategy to obtain standardized and enhanced vibration spectrum data.
[0022] Specifically, the collected vibrational spectral data undergoes standardization processes such as alignment, interpolation, and normalization to eliminate instrument differences and noise effects. Simultaneously, data augmentation strategies such as adding Gaussian noise and Gram angular domain difference field transformation can be employed to enhance data diversity and model robustness.
[0023] Furthermore, the specific details of designing the convolutional neural network in S2 are as follows: Construct a network structure that includes an input layer, several convolutional layers, pooling layers, fully connected layers, and an output layer; Multi-scale feature extraction is performed on the standardized and enhanced vibrational spectral data using local convolution and nonlinear activation functions.
[0024] Furthermore, the specific details of training the convolutional neural network in S2 are as follows: Define the output layer and its corresponding loss function based on the task type; The convolutional neural network is trained and its performance is evaluated using training, validation, and test sets.
[0025] Specifically, the model used for spectral feature extraction achieves high accuracy and generalization.
[0026] Furthermore, the specific details of calculating the gradient-weighted class activation map heatmap in S3 are as follows: Based on the final classification results, calculate the gradient of each channel in the last convolutional layer of the model; Using the channel gradient as the weight, the feature maps of the last convolutional layer are weighted and summed to obtain a gradient-weighted class activation map; The activation map is interpolated to the same size as the input vibrational spectral data to generate a heatmap.
[0027] Specifically, it is used to characterize the spectral regions that the model is most concerned with during the discrimination process.
[0028] Furthermore, the specific content of the contribution analysis of spectral characteristic peaks in S4 is as follows: The pixel intensities of the heatmap are summed in both the row and column directions. By summing the results in the row and column directions, the comprehensive contribution value of the corresponding wavenumber is obtained, thus realizing the location of the key peak in the original spectrum.
[0029] In a specific embodiment: To verify the effectiveness of the method proposed in this invention in interpretable vibrational spectral analysis, this embodiment uses the mid-infrared spectra of virgin and recycled polyethylene terephthalate (PET) as examples for analysis. Figure 2 The typical infrared spectra of two types of PET are shown, with highly similar peak shapes, making them difficult to distinguish directly with the naked eye.
[0030] Because the monomeric structures of virgin PET and re-PET are identical, their overall peak positions and shapes remain highly similar, making direct differentiation difficult. Furthermore, reliable spectral discrimination relies not only on the shape, position, and intensity of individual absorption peaks but also on simultaneously analyzing the coupling relationships and relative contributions between multiple peaks (such as peak area ratios and resonance correlations). One-dimensional spectra are insufficient to directly characterize these cross-peak correlation patterns. Therefore, spectral data preprocessing was performed, introducing Gram angular difference field (GADF) to map the one-dimensional infrared spectrum into a two-dimensional image that encodes band relationships. This allows the CNN to learn the coupling relationships and relative contributions between peaks while learning individual peak intensity variations, thus more effectively distinguishing the subtle differences between the two types of PET. Specifically, the spectral sequence is represented in polar coordinates, and trigonometric functions are used to construct the relationship between any two wavenumber points.
[0031] like Figure 3 As shown, after converting to GADF images, a 2D-CNN classification model is constructed. The model consists of three convolutional layers with progressively increasing kernel numbers to extract low- to high-order spectral association features layer by layer. To reduce computational cost and avoid excessively large parameters in the fully connected layers, a 4×4 adaptive average pooling layer is connected after the convolutional layers, followed by a fully connected layer that outputs two neurons, corresponding to the classification results of the original PET and the regenerated PET, respectively. The dashed box below shows the feature maps extracted from the third convolutional layer after model training. Each feature map represents different types of peak-to-peak association patterns extracted by the 2D-CNN from the GADF image.
[0032] Subsequently, the gradient response (a) of each channel is calculated according to the target category. i Then, group all feature maps according to a. i Weighted integration yields a Grad-CAM heatmap that reflects the model's areas of interest. It should be noted that the prediction task type, model structure, and data preprocessing methods are dynamically adjustable; the above technical details represent only the content of this embodiment.
[0033] like Figure 4As shown in the confusion matrix, the model achieves an accuracy of 96.6% on the test set. Furthermore, the losses on both the training and validation sets have converged with a small difference, indicating that it has sufficiently learned the key features distinguishing the two classes of PET. Subsequently, we aggregate the Grad-CAM heatmap along the row and column directions, reconstructing the two-dimensional heatmap into a one-dimensional contribution spectrum corresponding to the original spectral coordinates. (See [link to relevant documentation]). Figure 5 As shown, a significant difference is evident when comparing the two contribution spectra. Compared to re-primary PET, the overall contribution of re-PET to peaks A and B is significantly reduced, while peaks F and G are almost no longer used by the model. Meanwhile, the contributions near peaks C and D are enhanced, while peaks B and E, which are almost ignored in primary PET, become prominent high-contribution regions in re-PET.
[0034] These changes indicate that the ester-related vibrations (D, E, H) have undergone a systematic alteration relative to the more stable C–H bending vibrations (A, B, C) of the benzene ring, suggesting that changes in the local chemical environment of the ester group are a key spectral feature for distinguishing rPET.
[0035] The method of this invention possesses excellent scalability and application potential. By replacing the task with other substances or vibrational spectral types, it can even be further extended to the structural analysis of more complex molecules such as proteins. Furthermore, by using features extracted by a deep learning model as the core, it can be naturally extended to any deep learning model with feature extraction capabilities, including Transform. This invention provides a novel approach to the fields of spectroscopy and chemometrics, and is expected to drive a new stage in spectral analysis, transforming it from experience-driven to data-driven.
[0036] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0037] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. 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 the invention. Therefore, the invention 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 disclosed herein.
Claims
1. A vibrational spectrum analysis method based on feature extraction from a convolutional neural network, characterized in that, Includes the following steps: S1: Acquire and preprocess the vibrational spectral data to obtain standardized and enhanced vibrational spectral data; S2: Based on the standardized and enhanced vibrational spectral data, a convolutional neural network is designed and trained to obtain a model for spectral feature extraction; S3: Based on the trained model, calculate the gradient-weighted class activation map heatmap to visualize the features; S4: The interpolated heatmap is matched with the original spectral size to perform contribution analysis on the spectral characteristic peaks and locate the key peaks of the original spectrum.
2. The vibrational spectrum analysis method based on convolutional neural network feature extraction according to claim 1, characterized in that, The specific content of collecting vibration spectral data in S1 is as follows: Based on the fingerprint region characteristics and physicochemical properties of the analyte, vibration spectral technology is selected to collect vibration spectral data.
3. The vibrational spectrum analysis method based on convolutional neural network feature extraction according to claim 1, characterized in that, The specific steps for preprocessing vibrational spectral data in S1 are as follows: The collected vibration spectrum data were standardized by sequentially aligning, interpolating, and normalizing; and Gaussian noise was added to process the vibration spectrum data through a data augmentation strategy to obtain standardized and enhanced vibration spectrum data.
4. The vibrational spectrum analysis method based on convolutional neural network feature extraction according to claim 1, characterized in that, The specific details of designing the convolutional neural network in S2 are as follows: Construct a network structure that includes an input layer, several convolutional layers, pooling layers, fully connected layers, and an output layer; Multi-scale feature extraction is performed on the standardized and enhanced vibrational spectral data using local convolution and nonlinear activation functions.
5. The vibrational spectrum analysis method based on convolutional neural network feature extraction according to claim 4, characterized in that, The specific steps for training the convolutional neural network in S2 are as follows: Define the output layer and its corresponding loss function based on the task type; The convolutional neural network is trained and its performance is evaluated using training, validation, and test sets.
6. The vibrational spectrum analysis method based on convolutional neural network feature extraction according to claim 1, characterized in that, The specific steps for calculating the gradient-weighted class activation map heatmap in S3 are as follows: Based on the final classification results, calculate the gradient of each channel in the last convolutional layer of the model; Using the channel gradient as the weight, the feature maps of the last convolutional layer are weighted and summed to obtain a gradient-weighted class activation map; The activation map is interpolated to the same size as the input vibrational spectral data to generate a heatmap.
7. The vibrational spectrum analysis method based on convolutional neural network feature extraction according to claim 1, characterized in that, The specific content of the contribution analysis of spectral characteristic peaks in S4 is as follows: The pixel intensities of the heatmap are summed in both the row and column directions. By summing the results in the row and column directions, the comprehensive contribution value of the corresponding wavenumber is obtained, thus realizing the location of the key peak in the original spectrum.