Lightweight spectrum qualitative analysis method based on Res-Inception

By combining the DSRINet model with depthwise separable convolution, the Inception module, and nonlinear residual connections, the problems of difficulty in capturing nonlinear features and high computational complexity in traditional spectral analysis methods are solved, achieving high accuracy and versatility, and making it suitable for classification of various spectral datasets.

CN120974338APending Publication Date: 2025-11-18BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510965393.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-14
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Traditional qualitative spectral analysis methods rely on manual feature extraction and shallow machine learning, which makes it difficult to fully capture the nonlinear features in complex spectral data. Furthermore, the large number of model parameters and high computational complexity limit their efficiency and applicability in high-dimensional spectral data.

Method used

We employ a DSRINet model with depthwise separable convolutions, Inception modules, and nonlinear residual connections, combined with PCA dimensionality reduction and FSWA attention mechanisms, to optimize feature extraction and classification processes, thereby reducing computational complexity and the number of parameters.

Benefits of technology

It achieves high-precision and general-purpose spectral classification, significantly reduces computational complexity and the number of model parameters, eliminates the need for complex feature selection, and is applicable to Tablets, meat, and juice datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120974338A_ABST
    Figure CN120974338A_ABST
Patent Text Reader

Abstract

The DSRINet network provided by the invention takes modular design as a core, and features of spectral data are efficiently extracted and classified in a multi-module combination mode. The infrastructure adopts an Inception module, and a multi-scale convolution kernel is utilized to capture multi-level features in spectral data, so that the expression ability of a model to complex data is enhanced, and local and global information is concerned at the same time. In the convolutional layer design, the DSRINet adopts depth separable convolution and is divided into two independent steps of deep convolution and point-by-point convolution. In the deep convolution, convolution is independently carried out on each channel along an input channel, and local features in a sequence segment can be effectively learned, such as key spectral features of a peak value, a trough and the like in a waveform; the output of the deep convolution is combined through the point-by-point convolution to generate final feature representation, so that the global correlation between different sequence segments is modeled, and the overall structure and mode of the spectral data are captured. Through the combination mode, the global mode of the spectral data can be learned while the local features are reserved by the depth separable convolution. In order to deal with the gradient disappearance problem in the deep network, the DSRINet introduces convolution-based residual connection, and compared with classical residual connection, the design not only relieves gradient disappearance, but also further enhances the nonlinear capability of the network. Besides, the invention provides an attention mechanism (FSWA) fusing feature selection and weight distribution, and the mechanism remarkably optimizes the feature extraction process by screening important features and distributing different weights for the features.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application adopts deep learning technology to qualitatively analyze the near-infrared spectrum of a mixture. Specifically, a network model (DSRINet) based on deep separable convolution, Inception module and nonlinear residual connection is proposed to realize accurate estimation of the content of the target substance. BACKGROUND

[0002] Infrared spectrum analysis can comprehensively reflect the composition information of a mixture, including the structural characteristics, content changes and intermolecular interactions of each component, and is very suitable for component analysis of complex mixtures. When the sample is placed in a changing infrared light environment, the molecules absorb radiation at a specific frequency, and by plotting the transmittance-wavelength curve, the infrared spectrum of the sample can be obtained. Infrared spectrum is divided into far infrared, mid-infrared and near-infrared spectrum (NIR) according to frequency. Among them, near-infrared spectrum mainly represents the vibration of hydrogen-containing groups, and can provide rich component and structural information of the mixture, such as peak number, peak position and absorption band intensity, which is suitable for structure identification and chemical group confirmation of unknown mixtures. Infrared spectrum analysis technology has become a kind of efficient non-destructive analysis technology with the advantages of simple operation, environmental friendliness, rapid analysis, low cost and non-destructive detection. Compared with traditional wet chemical analysis methods (such as gas chromatography-mass spectrometry, high performance liquid chromatography, etc.), which are time-consuming and costly, infrared spectrum analysis method shows significant replacement potential in many scenes. In addition, near-infrared spectrum technology has good adaptability to sample size and state, and can be used in combination with other analysis technologies. With the continuous progress of spectroscopy and chemometrics, near-infrared spectrum analysis technology has been widely used in qualitative and quantitative analysis of organic matter. However, the mixture with many components will exacerbate the phenomenon of spectral peak overlap, which increases the difficulty of content analysis and identification of each component of the organic mixture, and usually requires the construction of an analysis model to process the infrared spectrum data. Therefore, for the spectral recognition of mixtures, the construction of a reliable analysis method is of great significance and research value.

[0003] Infrared spectrum analysis method has been widely used in target classification tasks in many fields due to its rapid and non-destructive characteristics. However, traditional spectral qualitative analysis methods usually rely on manual feature extraction and shallow machine learning models, which are difficult to fully capture the nonlinear features in complex spectral data. Although some current deep learning models have achieved remarkable results in target classification tasks, most of the models are designed for a single task and have limited generalization ability. In addition, the large number of model parameters and high computational complexity to some extent limit their direct application in high-dimensional spectral data, affecting the efficiency and universality of actual promotion. SUMMARY

[0004] To address the above challenges, the present application proposes a lightweight spectral classification method DSRINet, which combines depthwise separable convolution, Inception module and nonlinear residual connection, aiming to achieve high precision and generalization while significantly reducing computational complexity and model parameter quantity. Compared with other advanced qualitative analysis models, DSRINet shows excellent classification performance on Tablets, meat and juice datasets. In addition, the model does not need to design a separate feature selection method, which is convenient for rapid deployment and practical application.

[0005] Brief introduction of near-infrared spectral dataset:

[0006] Dataset A: "Tablets dataset", Tablets consists of two parts of spectral data: near-infrared data (NIR data) and Raman data (Ramandata). Both parts of spectral data are stored in the format of Matlab. Among them, the NIR data set contains 4 categories of samples, a total of 310, each containing 404 variables. The Tablets dataset is used to predict the active ingredients (API) of drugs, with the unit of API being percentage (% w / w), which is measured by high-performance liquid chromatography (HPLC). The spectral measurement range and resolution are shown in Table 1.

[0007] Dataset B: "Meat dataset", the meat dataset

[48] is open source on the website, which consists of infrared spectral data measured by sealed and dry trifluoromethanesulfonic acid detector (DTGS). The meat dataset is divided into chicken, pork and turkey meat, containing a total of 120 samples and 448 feature variables. The spectral measurement range and resolution are shown in Table 1.

[0008] Dataset C: "Juice dataset", the juice dataset

[47] is open source on the website, which consists of near-infrared spectral data collected by Spectra-Tech MonitIR FT-IR spectrometer. The juice dataset is divided into strawberry juice and non-strawberry juice, containing 983 samples and 235 feature variables. The spectral measurement range and resolution are shown in Table 1.

[0009] Table 1-Introduction of dataset

[0010]

[0011] In order to achieve the above purpose, the technical scheme adopted by the present application is a lightweight spectral qualitative analysis method based on Res-Inception, including the following steps:

[0012] Step 1, use principal component analysis (PCA) to extract the first k effective components of the data, remove noise and redundant information, and provide more refined and information-rich features for the model;

[0013] The specific steps are as follows.

[0014] Data standardization: Before performing PCA, it is usually necessary to standardize the data.

[0015] x' = (x - μ) / σ (1)

[0016] Where x is the original data, μ is the mean, and σ is the standard deviation.

[0017] Calculate the covariance matrix, which describes the correlation between features. For a data set containing n features, the size of the covariance matrix is n x n, and each element represents the covariance of two features. The formula of the covariance matrix is as follows:

[0018]

[0019] Where X is the standardized data matrix, and m is the number of samples.

[0020] Calculate the eigenvalues and eigenvectors, calculate the eigenvalues and eigenvectors of the covariance matrix. The eigenvectors correspond to the principal component directions in the data set, and the eigenvalues represent the data variance explained by each principal component. Each eigenvector represents a new coordinate axis, i.e. the direction of the principal component, while each eigenvalue represents the variance of the data in the corresponding eigenvector direction. The larger the eigenvalue, the stronger the explanatory ability of the principal component to the data.

[0021] Select principal components, select the first k principal components according to the size of the cumulative contribution rate. These principal components can explain the maximum variance in the data set, and usually the first few principal components can effectively retain the main information of the data.

[0022] The contribution rate of each principal component is the proportion of its corresponding eigenvalue to the sum of all eigenvalues, as shown in formula (3):

[0023]

[0024] Project the original data onto the selected principal components to obtain a reduced dimension data set, as shown in formula (4):

[0025] X new = X · V k (4)

[0026] Where V k is a matrix containing the first k eigenvectors.

[0027] Step 2, construct the DSRNet network;

[0028] The DSRNet network is composed of multiple parts. First, feature extraction is completed in three parallel one-dimensional convolution blocks. The three convolution blocks use the same depth separable convolution architecture to reduce the number of model parameters. Each convolution block is composed of a convolution layer, a BatchNorm layer, and a ReLU activation function layer. The convolution kernel size is 3, 5, and 7, respectively. The multi-scale features extracted in parallel are spliced to enhance the feature expression ability of the model. In order to increase the nonlinearity of the model and alleviate the gradient vanishing problem, the model introduces a convolution-based residual connection with a convolution kernel size of 3. The attention module is placed after the convolution block to dynamically weight the extracted feature map. According to the changes of the features, the important features are flexibly adjusted to optimize the feature extraction process. After the attention mechanism adjustment, the features are input into the global average pooling layer to reduce the dimension of the feature vector to 1, further reducing the number of parameters. Finally, the features are mapped to the class space through the fully connected layer to complete the spectral classification task. The overall model structure is as shown in Figure 1

[0029] In the DSRNet model, a new attention module is introduced. The structure of the attention module is as shown in Figure 2 It is composed of two core parts: (1) feature screening module: the input is first passed through a fully connected layer, and then through a leaky ReLU activation function to alleviate the gradient vanishing problem. Through this module, the model can filter out features with less relevance to the classification target and retain key information; (2) weight allocation module: the filtered features are mapped to the same size as the input through the next fully connected layer, and then through the leaky ReLU layer to filter out irrelevant information. Finally, the allocated weights are multiplied by the original features to achieve weighting of important features. The combination of the two modules not only retains the feature selection strategy, but also gives different weights to important features. Unlike traditional attention mechanisms, this module does not completely exclude information when the feature value is negative, which is more conducive to updating network parameters, allowing the model to better focus on important features.

[0030] Step 3: The DSRNet model constructed in step 3 is optimized and trained using a five-fold cross-validation strategy, and the samples in the test set are classified and predicted.

[0031] The specific steps are as follows:

[0032] (1) Extract principal components from spectral samples in the three datasets of different fields using the method in step one.

[0033] (2) Input the principal component features into the DSRNet network model to extract deep abstract and scale-rich features, and finally obtain the target output through the Softmax layer.

[0034] ​Step 4, four indicators including recall, precision, accuracy and F1-score are established to evaluate the performance of the model. Among them, the calculation formula of recall is shown in formula (5), which reflects the proportion of correctly predicted positive samples in all positive samples, mainly used to measure the full search ability of the model.

[0035]

[0036] The calculation formula of precision is shown in formula (6), which is mainly used to measure the accuracy of the model.

[0037]

[0038] The calculation formula of accuracy is shown in formula (7), which reflects the proportion of correctly predicted data in total data.

[0039]

[0040] F1-score is used to comprehensively measure the results of recall and precision, and the calculation formula is shown in formula (8).

[0041]

[0042] The arithmetic mean of the above indicators is taken as the measurement index of the overall prediction performance, and this process is called macro-average. Then, the macro-average results in five-fold cross-validation are averaged again, and the final comprehensive evaluation results of the model are obtained.

[0043] Compared with the prior art, the present application has the following advantages:

[0044] (1) The method combines deep separable convolution, Inception module and nonlinear residual connection, which significantly reduces the computational complexity and model parameter amount while ensuring high precision and strong generality.

[0045] (2) The FSWA attention mechanism is introduced in the present application, which dynamically filters multi-scale features and allocates weights, significantly enhances the feature expression ability of the model, and at the same time the parameter amount increases limitedly, achieving the balance between performance and lightweight.

[0046] (3) Without complex feature selection process, all features are retained to maximize the utilization of effective information, reducing the complexity of modeling.

[0047] Figure 1 DSRNet network structure diagram

[0048] Figure 2 FSWA attention module DETAILED DESCRIPTION

[0049] Figure 3 Confusion matrix of DSRINet on Tablets task

[0050] Figure 4 Multi-scale feature score of DSRINet-1D on Tablets task

[0051] Figure 5 Confusion matrix of DSRINet-1D (FSWA) on Juice task

[0052] Figure 6 Multi-scale feature score of DSRINet-1D (FSWA) on Juice task

[0053] Figure 7 Confusion matrix of DSRINet-1D (FSWA) on Meat task

[0054] Figure 8 Multi-scale feature score of DSRINet-1D (FSWA) on Meat task

[0055] In order to make the purposes, technical solutions and advantages of the present application clearer, the following will give a detailed description of each detail problem involved in the technical invention scheme:

[0056] The application discloses a lightweight spectral qualitative analysis method based on Res-Inception. To solve the problems that traditional spectral qualitative analysis methods usually rely on manual feature extraction and shallow machine learning models, are difficult to fully capture the nonlinear features in complex spectral data, have limited generalization ability, and have large model parameter quantity and high calculation complexity, which to some extent limit their direct application on high-dimensional spectral data and affect the efficiency and universality of actual promotion, etc., the application provides a lightweight spectral classification method DSRINet, which combines deep separable convolution, Inception module and nonlinear residual connection, aims to realize high precision and general applicability while significantly reducing calculation complexity and model parameter quantity. In order to verify the performance of the DSRINet model, the DSRINet model is compared with various advanced machine learning algorithms and deep learning algorithms, and the recall, precision, accuracy and F1-score on the Tablets, juice and meat data sets are compared. The experimental results show that the DSRINet model achieves excellent classification performance on all data sets. In addition, in order to more intuitively analyze the corresponding relationship between the model prediction result and the actual label, the confusion matrix on each data set is also drawn. The confusion matrix can clearly show the classification performance of the model on different categories, including the specific distribution of correct classification and error classification, which provides strong support for further analyzing the advantages and disadvantages of the model.

[0057] To verify the effectiveness and feasibility of the application, the specific implementation is as follows:

[0058] Step 1, extract the first k effective components of the data by principal component analysis (PCA), remove noise and redundant information, and provide more refined and information-rich features for the model;

[0059] The specific steps are as follows.

[0060] Data standardization: before PCA, the data usually needs to be standardized.

[0061] x'=(x-μ) / σ (1)

[0062] Where x is the original data, μ is the mean, and σ is the standard deviation.

[0063] Calculate the covariance matrix, which describes the correlation between features. For a data set containing n features, the size of the covariance matrix is n*n, and each element represents the covariance of two features. The formula of the covariance matrix is as follows:

[0064]

[0065] Wherein, X is the standardized data matrix, m is the sample number.

[0066] The eigenvalues and eigenvectors are calculated, the eigenvalues and eigenvectors of the covariance matrix are calculated, the eigenvectors correspond to the principal component direction in the data set, the eigenvalues represent the data variance explained by each principal component, each eigenvector represents a new coordinate axis, that is, the direction of the principal component, and each eigenvalue represents the variance of the data in the corresponding eigenvector direction, the larger the eigenvalue, the stronger the explanation ability of the principal component to the data.

[0067] The principal components are selected, and the first k principal components are selected according to the size of the cumulative contribution rate. These principal components can explain the maximum variance in the data set, and usually the first few principal components can effectively retain the main information of the data.

[0068] The contribution rate of each principal component is the proportion of the eigenvalue corresponding to it in the sum of all eigenvalues, as shown in formula (3):

[0069]

[0070] The original data is projected onto the selected principal components, thereby obtaining a reduced dimension data set, as shown in formula (4):

[0071] X new =X·V k (4)

[0072] Wherein, V k is a matrix containing the first k eigenvectors.

[0073] Step 2, construct the DSRNet network;

[0074] The DSRNet network is composed of multiple parts, first, three parallel one-dimensional convolution blocks are used to complete feature extraction, and the same depth separable convolution architecture is used in the three convolution blocks to reduce the model parameter amount. Each convolution block is composed of a convolution layer, a BatchNorm layer and a ReLU activation function layer, and the convolution kernel size is 3, 5 and 7 respectively. The multi-scale features extracted in parallel are spliced to enhance the feature expression ability of the model. In order to increase the nonlinearity of the model and alleviate the gradient disappearance problem, the model introduces a convolution-based residual connection with a convolution kernel size of 3. The attention module is placed after the convolution block, and the extracted feature map is dynamically weighted to flexibly adjust the important features to be focused according to the changes of the features, thereby optimizing the feature extraction process. The features adjusted by the attention mechanism are input into the global average pooling layer, and the dimension of the feature vector is reduced to 1, further reducing the parameter amount. Finally, the features are mapped to the category space through the fully connected layer, completing the spectral classification task, and the overall model structure of the DSRNet is as shown in Figure 1 .

[0075] A new attention module is introduced in the DSRNet model. The structure of this attention module is as follows: Figure 2 As shown, it consists of two core parts: (1) Feature selection module: The input first passes through a fully connected layer, and then through the leaky ReLU activation function to alleviate the gradient vanishing problem. Through this module, the model can filter out features that are less relevant to the classification target and retain key information; (2) Weight allocation module: The filtered features are mapped to the same size as the input through the next fully connected layer, and then irrelevant information is filtered out through the leaky ReLU layer. Finally, the assigned weights are multiplied by the original features to achieve weighting of important features. The combination of the two modules not only retains the feature selection strategy, but also assigns different weights to important features. Unlike the traditional attention mechanism, this module does not completely exclude information when the feature value is negative, which is more conducive to the update of network parameters and enables the model to better focus on important features.

[0076] Step 3: The DSRNet model constructed in Step 3 is optimized and trained using a five-fold cross-validation strategy, and the samples in the test set are classified and predicted.

[0077] The specific steps are as follows:

[0078] (1) The principal components were extracted from the spectral samples in the three datasets from different fields using the method described in step one;

[0079] (2) Input the principal component features into the DSRNet network model to extract deeply abstract and scale-rich features, and finally obtain the target output through the Softmax layer.

[0080] Step 4 establishes four metrics—Recall, Precision, Accuracy, and F1 score—to evaluate model performance. Recall reflects the proportion of correctly predicted positive samples and is primarily used to measure the model's recall capability. To more intuitively analyze the correspondence between the model's predictions and the actual labels, this chapter also plots confusion matrices for each dataset. The confusion matrix clearly shows the model's classification performance across different categories, including the specific distribution of correct and incorrect classifications, providing strong support for further analysis of the model's strengths and weaknesses. Table 2. Experimental comparison of the Tablets task Table 3 Comparison of experiments on the juice task Table 4 Comparison of experiments on the meat task

[0081] As shown in Tables 2, 3, and 4, the experimental results on the three datasets demonstrate that DSRINet and DSRINet(FSWA) proposed in this chapter achieve better overall results compared to traditional machine learning and deep learning models, proving the effectiveness of this study. Specifically, DSRINet(FSWA) achieves the best classification results on all three datasets, and the confusion matrices for each classification result are shown in Tables 2, 3, and 4. Figure 3 , 5 As shown in Figure 7, this performance improvement is mainly attributed to the following three aspects: First, PCA dimensionality reduction improves model performance by compressing the feature space and filtering irrelevant features; second, the batch normalization layer in the depthwise separable convolutional block supports a larger learning rate, accelerating model convergence; finally, the FSWA module can dynamically filter multi-scale features and assign weights, significantly enhancing the model's feature representation ability. The multi-scale feature importance scores for each dataset are shown in Figure 7. Figure 4 , 6 As shown in Figure 8.

Claims

1. A lightweight spectral qualitative analysis method based on Res-Inception, characterized in that: Step 1, the principal component (PCA) is used to extract the first k effective components of the data, remove noise and redundant information, and provide a more refined and information-rich feature for the model. The specific steps are as follows. Data standardization: Before performing PCA, it is usually necessary to standardize the data. x′=(x-μ) / σ (1) Where x is the original data, μ is the mean, and σ is the standard deviation. Calculate the covariance matrix, which describes the correlation between features. For a data set containing n features, the size of the covariance matrix is n x n, and each element represents the covariance of two features. The formula of the covariance matrix is as follows: wherein, X is the standardized data matrix, and m is the sample size. Calculate the eigenvalues and eigenvectors of the covariance matrix. The eigenvectors correspond to the principal component directions in the data set, and the eigenvalues represent the variance explained by each principal component. Each eigenvector represents a new coordinate axis, i.e., the direction of the principal component, while each eigenvalue represents the variance of the data in the corresponding eigenvector direction. The larger the eigenvalue, the stronger the explanatory ability of the principal component to the data. Select the principal components according to the size of the cumulative contribution rate. These principal components can explain the maximum variance in the data set, and usually the first few principal components can effectively retain the main information of the data. The contribution rate of each principal component is the proportion of its corresponding eigenvalue to the sum of all eigenvalues, as shown in formula (3): Project the original data onto the selected principal components to obtain a reduced dimension data set, as shown in formula (4): X new = X · V k (4) wherein V k is a matrix containing the first k eigenvectors. Step 2, construct the DSRNet network: The DSRNet network is composed of multiple parts. First, three parallel one-dimensional convolution blocks are used to complete feature extraction. These three convolution blocks use the same depth separable convolution architecture to reduce the number of model parameters. Each convolution block is composed of a convolution layer, a BatchNorm layer, and a ReLU activation function layer, with convolution kernel sizes of 3, 5, and 7, respectively. The multi-scale features extracted in parallel are spliced to enhance the feature expression ability of the model. In order to increase the nonlinearity of the model and alleviate the problem of gradient disappearance, the model introduces a residual connection based on convolution with a kernel size of 3. The attention module is placed after the convolution block to dynamically weight the extracted feature maps, and the important features are flexibly adjusted according to the changes of the features, thereby optimizing the feature extraction process. The features adjusted by the attention mechanism are input into the global average pooling layer to reduce the dimension of the feature vector to 1, further reducing the number of parameters. Finally, the features are mapped to the class space through the fully connected layer to complete the spectral classification task. The overall model structure is shown in Figure 1. In the DSRNet model, a new attention module is introduced. The structure of this attention module is shown in Figure 2, which consists of two core parts, (1) feature screening module: the input is first passed through a fully connected layer, followed by a leaky ReLU activation function to alleviate the gradient vanishing problem. Through this module, the model can filter out features with less relevance to the classification target and retain key information; (2) weight allocation module: the screened features are mapped to the same size as the input through the next fully connected layer, and then through the leaky ReLU layer to filter out irrelevant information. Finally, the assigned weights are multiplied by the original features to achieve weighting of important features. The combination of the two modules not only retains the feature selection strategy, but also gives different weights to important features. Unlike traditional attention mechanisms, this module does not completely exclude information when the feature value is negative, making it more conducive to updating network parameters and enabling the model to better focus on important features. Step 3, the five-fold cross-validation strategy is used to optimize the training of the DSRNet model constructed in step 3 and classify the samples in the test set. The specific steps are as follows: (1) The principal components of the spectral samples in the three datasets of different fields are extracted using the method in step one; (2) The principal component features are input into the DSRNet network model to extract deep abstract and scale-rich features, and finally the target output is obtained through the Soffmax layer. Step 4, four indicators including recall rate, precision rate, accuracy rate and F1 score are established to evaluate the performance of the model.