A classification method based on terahertz spectral data and application

CN117473377BActive Publication Date: 2026-09-18WUYI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311164951.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-08
Publication Date
2026-09-18
Estimated Expiration
2043-09-08

AI Technical Summary

Technical Problem

然而,目前对太赫兹光谱数据的特征选择的研究仍然较少

Benefits of technology

[0011] To adaptively identify important intervals in terahertz spectral data, this method first divides the terahertz spectral data into many small intervals. Then, it uses terahertz spectral data from different intervals to train classifiers, resulting in multiple base classifiers. The interval feature selection problem and the decision-level fusion problem are then transformed into a non-negative sparse optimization problem, namely, finding a set of non-negative weighting coefficients that are as sparse as possible, such that the deviation between the sparse non-negative weighted combination of the classification outputs of the multiple base classifiers for the terahertz spectral data and the one-hot encoding vector of the corresponding class label of the terahertz spectral data is minimized. Finally, the trained base classifiers are non-negatively sparsely combined using these sparse non-negative weighting coefficients to obtain the final strong classifier. Through sparsity constraints, not only can the optimal interval feature selection and optimal decision-level fusion be achieved, but the final strong classifier can also be guaranteed to select only a few important spectral segments, significantly improving classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117473377B_ABST
    Figure CN117473377B_ABST
Patent Text Reader

Abstract

The application discloses a classification method based on terahertz spectrum data and application, the method firstly divides the terahertz spectrum data into many small interval sections, then utilizes the terahertz spectrum data of different interval sections to train a classifier, to obtain multiple base classifiers, then converts interval feature selection problem and decision level fusion problem into a non-negative sparse optimization problem, that is, to obtain a set of non-negative weighting coefficients as sparse as possible, so that the weighted sum of the classification outputs of multiple base classifiers on terahertz spectrum data and the deviation between the one-hot encoding vector of the category label corresponding to the terahertz spectrum data are minimum, then the sparse non-negative weighting coefficients are used to weight and combine the trained base classifiers to obtain the final strong classifier, through sparse constraint, not only the optimal interval feature selection and optimal decision level fusion can be realized, but also the final strong classifier can select only a few important spectral segments, and the classification precision is significantly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terahertz spectral data technology, and in particular to a classification method and application based on terahertz spectral data. Background Technology

[0002] Terahertz waves refer to electromagnetic waves with frequencies between 0.1 terahertz (THz) and 10 terahertz. Due to their penetrating, fingerprint-like, and non-ionizing characteristics, terahertz technology has shown great potential in non-destructive testing, especially in the food, pharmaceutical, environmental, and some industrial fields.

[0003] Terahertz research typically employs data processing methods such as dimensionality reduction, high-level feature extraction, or direct use of low-frequency data. Due to the high sensitivity and high noise levels of terahertz data, usable classification information is often hidden within one or a few feature peaks, which constitute only a small segment of the entire spectrum, with the majority of the data offering little useful information. Using the entire spectrum for dimensionality reduction and feature extraction also negatively impacts classification performance. Feature selection can remove unnecessary features, reduce model complexity, and improve algorithm classification accuracy. However, current research on feature selection for terahertz spectral data remains limited. Summary of the Invention

[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a classification method and application based on terahertz spectral data, which can achieve the selection of optimal interval features and optimal decision-level fusion, significantly improving classification accuracy.

[0005] According to the classification method based on terahertz spectral data according to the first aspect of this application, the method includes the following steps:

[0006] Obtain the terahertz spectral dataset of the items to be classified, and divide the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals;

[0007] Construct an initial classifier, and train the initial classifier on each of the multiple data subsets to obtain the corresponding multiple base classifiers;

[0008] Determine the first data and the second data, and calculate a sparse non-negative vector that minimizes the deviation between the first data and the second data. The first data is the product of the classification output of the multiple base classifiers for the terahertz spectral data of the item to be classified and the sparse non-negative vector. The second data is the one-hot encoded vector of the category label corresponding to the terahertz spectral data.

[0009] A strong classifier is formed by combining the sparse non-negative vector with the multiple base classifiers, so that the items to be classified can be classified based on the terahertz spectral data using the strong classifier.

[0010] The classification method based on terahertz spectral data provided in this application has at least the following beneficial effects:

[0011] To adaptively identify important intervals in terahertz spectral data, this method first divides the terahertz spectral data into many small intervals. Then, it uses terahertz spectral data from different intervals to train classifiers, resulting in multiple base classifiers. The interval feature selection problem and the decision-level fusion problem are then transformed into a non-negative sparse optimization problem, namely, finding a set of non-negative weighting coefficients that are as sparse as possible, such that the deviation between the sparse non-negative weighted combination of the classification outputs of the multiple base classifiers for the terahertz spectral data and the one-hot encoding vector of the corresponding class label of the terahertz spectral data is minimized. Finally, the trained base classifiers are non-negatively sparsely combined using these sparse non-negative weighting coefficients to obtain the final strong classifier. Through sparsity constraints, not only can the optimal interval feature selection and optimal decision-level fusion be achieved, but the final strong classifier can also be guaranteed to select only a few important spectral segments, significantly improving classification accuracy.

[0012] According to some embodiments of this application, sparse nonnegative vectors are calculated in the following manner:

[0013] The mean square error method is used to construct a first objective function for the deviation between the first data and the second data, and the alternating multiplier method is used to solve for minimizing the first objective function, thereby calculating a sparse non-negative vector.

[0014] Alternatively, the cross-entropy method can be used to construct a second objective function for the deviation between the first data and the second data, and the gradient descent method can be used to solve for minimizing the second objective function to obtain a sparse non-negative vector.

[0015] According to some embodiments of this application, the first objective function includes:

[0016]

[0017] Where λ represents a sparse nonnegative vector, and n Trn The number of terahertz spectral data in the terahertz spectral dataset. Y i For n b The classification outputs of the base classifiers for the i-th terahertz spectral data. For the nth b The classification outputs of the base classifiers for the i-th terahertz spectral data, y iLet be the one-heat encoding vector of the category label for the i-th terahertz spectral data, λ be the regularization parameter, and ||α|| l Let α be the l1 norm.

[0018] According to some embodiments of this application, the second objective function includes:

[0019]

[0020] Where α represents a sparse nonnegative vector, n Trn n represents the number of terahertz spectral data in the terahertz spectral dataset. C z represents the total number of categories. i (k) is a vector z i The k-th element, z i =softmax(Y i α), y i Let be the one-heat encoding vector of the category label for the i-th terahertz spectral data, λ be the regularization parameter, and ||α|| l Let α be the l1 norm.

[0021] According to some embodiments of this application, the strong classifier includes:

[0022]

[0023] Where α(j) is the j-th element of the sparse nonnegative vector, and n b f is the number of base classifiers. j Let j be the j-th base classifier.

[0024] According to some embodiments of this application, dividing the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals includes:

[0025] The settings include defining the width and sliding step of a slidable window;

[0026] The terahertz spectral dataset is divided into multiple data subsets corresponding to different terahertz intervals using the sliding window.

[0027] A classification device based on terahertz spectral data according to a second aspect embodiment of this application, the classification device based on terahertz spectral data comprising:

[0028] The data acquisition unit is used to acquire the terahertz spectral dataset of the items to be classified and to divide the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals.

[0029] The base classifier training unit is used to construct an initial classifier and train the initial classifier on the multiple data subsets respectively to obtain the corresponding multiple base classifiers.

[0030] A sparse optimization unit is used to determine the first data and the second data, and to calculate a sparse non-negative vector that minimizes the deviation between the first data and the second data. The first data is the product of the classification outputs of the multiple base classifiers for the terahertz spectral data of the item to be classified and the sparse non-negative vector. The second data is the one-hot encoded vector of the category label corresponding to the terahertz spectral data.

[0031] A strong classifier generation unit is used to form a strong classifier based on the sparse non-negative vector and the multiple base classifiers, so as to classify the item to be classified based on the terahertz spectral data according to the strong classifier.

[0032] An electronic device according to a third aspect of this application includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to perform the above-described classification method based on terahertz spectral data.

[0033] A computer-readable storage medium according to a fourth aspect of this application stores computer-executable instructions for causing a computer to perform the above-described classification method based on terahertz spectral data.

[0034] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. Attached Figure Description

[0035] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0036] Figure 1 This is a flowchart illustrating a classification method based on terahertz spectral data provided in an embodiment of this application;

[0037] Figure 2 This is a schematic diagram of a window sliding according to an embodiment of this application;

[0038] Figure 3 This is a classification accuracy of the method under different window widths and three sliding step sizes on the tangerine peel and bupleurum dataset provided in one embodiment of this application;

[0039] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0041] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations:

[0042] Terahertz waves refer to electromagnetic waves with frequencies between 0.1 THz and 10 THz. Due to their penetrating power, fingerprint-like properties, and non-ionizing characteristics, terahertz technology has shown great potential in non-destructive testing, especially in the food, pharmaceutical, environmental, and some industrial fields. For example, Friska et al. used a fast independent component analysis algorithm to extract valuable information for detecting adulterated rice, and then applied a random forest algorithm for classification. Pan et al. proposed an SVM model based on an improved cuckoo search algorithm to classify ginseng at different growth ages. Zhu et al. proposed that using denoising and reconstruction algorithms can effectively solve the problem of poor spectral signal-to-noise ratio caused by the inclusion of different components, including water, in biological mixtures.

[0043] In summary, the feasibility of terahertz technology has been proven in multiple fields. However, the data processing methods used in these studies, whether dimensionality reduction, high-level feature extraction, or direct use of low-frequency data, often fail to address the high sensitivity and high noise levels of terahertz data. The usable classification information is often hidden within one or a few feature peaks, which constitute only a small segment of the entire spectrum, leaving the majority of the data with limited useful information. Furthermore, using the entire spectrum for dimensionality reduction and feature extraction can negatively impact classification performance.

[0044] First Embodiment

[0045] Reference Figure 1 This application provides a classification method based on terahertz spectral data, which includes the following steps S110 to S140:

[0046] Step S110: Obtain the terahertz spectral dataset of the items to be classified, and divide the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals.

[0047] The items to be classified can be food and medicine, such as dried tangerine peel and Bupleurum chinense; this embodiment is not specifically limited. The terahertz spectral dataset contains multiple terahertz spectral data of the items to be classified. Terahertz spectral data can be acquired using a terahertz spectrometer.

[0048] Because terahertz data is highly sensitive and noisy, the practically usable classification information is often hidden in one or a few feature peaks, which only occupy a small segment of the entire spectrum data, while most of the other data does not contain much useful information. Therefore, in step S110, the terahertz spectrum dataset is divided into multiple data subsets corresponding to different terahertz intervals, and then the terahertz spectrum data of each interval is used to train a base classifier.

[0049] Here, a window width and sliding step size can be given, and by sliding the window across the terahertz spectral data, many small intervals can be obtained.

[0050] Step S120: Construct an initial classifier by training the initial classifier on multiple data subsets to obtain multiple corresponding base classifiers.

[0051] In this step, there are many types of initial classifiers, such as SVM (Support Vector Machine) classifiers or DT (Decision Tree or Classification Tree) classifiers; no specific limitation is made here. This step trains the initial classifiers using different subsets of data, thereby obtaining multiple base classifiers trained on different subsets. For example, training the initial classifier on the first subset yields the first base classifier, the second subset yields the second base classifier, the third subset yields the third base classifier, and so on. After obtaining multiple trained base classifiers, the final strong classifier can be obtained through a non-negative sparse combination of these base classifiers.

[0052] Step S130: Determine the first data and the second data, and calculate a sparse non-negative vector that minimizes the deviation between the first data and the second data. The first data is the product of the classification output of the terahertz spectral data of the items to be classified by multiple base classifiers and the sparse non-negative vector. The second data is the one-hot encoded vector of the category label corresponding to the terahertz spectral data.

[0053] In typical terahertz-based material identification, the identification information is often hidden within one or more small intervals of the terahertz spectral data. Finding these small intervals is key to terahertz spectral data classification and identification. In other words, the crucial question is: how to identify a select few intervals from numerous intervals so that the classifier's decision-level fusion on these intervals is optimal?

[0054] This step transforms the problem into a non-negative sparse optimization problem, seeking a set of non-negative weighting coefficients (i.e., sparse non-negative vectors) that are as sparse as possible, such that the weighted sum of the classification outputs of multiple base classifiers of the terahertz spectral data of the items to be classified is as consistent as possible with the one-hot encoded vector of the category label corresponding to the terahertz spectral data. Steps S130 and subsequent steps S140 will use this sparse non-negative vector to perform optimal sparse combination of multiple base classifiers, achieving the selection of optimal interval features and optimal decision-level fusion of interval classifiers, resulting in the final strong classifier.

[0055] In some embodiments of this application, an objective function can be constructed by constructing the mean squared error (MSE) method or the cross-entropy method (CE) to minimize the deviation between the product of the classification output of the terahertz spectral data of the items to be classified by multiple base classifiers and the sparse non-negative vector and the one-hot encoded vector of the category label corresponding to the terahertz spectral data. Then, the objective function is solved by the alternating multiplier method (ADMM) or the gradient descent method to obtain the sparse non-negative vector.

[0056] Step S140: A strong classifier is formed by combining sparse non-negative vectors with multiple base classifiers, so that the items to be classified can be classified based on terahertz spectral data according to the strong classifier.

[0057] In step S140, the sparse non-negative vectors obtained through the above steps are combined with multiple base classifiers to form a strong classifier, thereby achieving optimal decision-level fusion of interval classifiers. Finally, the classification requirements for items are met based on the combined classifier.

[0058] Feature selection is indispensable in terahertz-based material identification, but most current detection methods empirically extract the low-frequency bands of the terahertz absorption coefficient spectrum for analysis. To adaptively identify important intervals in terahertz spectral data, this method first divides the terahertz spectral data into many small intervals. Then, it uses terahertz spectral data from different intervals to train classifiers, obtaining multiple base classifiers. The interval feature selection problem and decision-level fusion problem are then transformed into a non-negative sparse optimization problem: finding a set of non-negative weighting coefficients that are as sparse as possible, minimizing the deviation between the weighted classification outputs of the multiple base classifiers and the one-hot encoded vectors of the corresponding class labels. These sparse non-negative weighting coefficients are then used to weight and combine the trained base classifiers to obtain the final strong classifier. This embodiment, through sparsity constraints, not only achieves optimal interval feature selection and optimal decision-level fusion but also ensures that the final strong classifier selects only a few important spectral bands, significantly improving classification accuracy.

[0059] Second Embodiment

[0060] Taking dried tangerine peel (chenpi) as an example, this method uses a classification method based on terahertz spectral data to identify the age of the peel. The method includes the following steps:

[0061] Step S210: Obtain training data.

[0062] make For training, terahertz spectral data of dried tangerine peel (training samples) are used, where n Trn y is the total number of training samples. i ∈R C Let x be the one-hot encoded vector of the class label of the i-th training sample, i.e., if x i If it belongs to class c, then y i Except for the c-th element which is 1, all other elements of C-1 are zero, where C is the total number of categories.

[0063] Step S220: Training the base classifier.

[0064] Let f be a given initial base classifier.

[0065] To obtain spectral data for different intervals, the sliding window size and sliding step size need to be set. First, let the sliding window size be w, the sliding step size be h, and the number of windows acquired by the sliding window be n. b By sliding the window across the terahertz spectral data, many small segments can be obtained. Each time the window is slid across, a terahertz frequency range and the terahertz spectral data within that range can be obtained.

[0066] Suppose the base classifier f uses the j-th (j=1,2,...,n) classifier. b The classifier obtained after training on training samples in ) intervals is f j f j For training sample x i (i = 1, ..., n) Trn The output of the j-th interval is Right now For one-hot encoded vectors, that is: if f j x i If classified as class c, then Except for the c-th element which is 1, the other C-1 elements are 0. Let For f in n b For training samples x in each interval i The output.

[0067] Step S230: Construction and solution of sparse problems.

[0068] How to get from n bHow can we find a few intervals from a given set of intervals such that the decision-level fusion of classifier f is optimal across these intervals? This problem is equivalent to: finding a sparse non-negative vector, let α, such that Y i α and y i (i = 1, ..., n) Trn Try to be as consistent as possible.

[0069] This embodiment measures Y using Mean Square Error (MSE). i α and y i The deviation.

[0070] Mean square error method, using ||Y i α-y i ||To measure Y i α and y i To achieve consistency, the following optimization objective function is obtained:

[0071]

[0072] Where λ is the regularization parameter, ||α|| l It is an l1 norm.

[0073] The objective function of the MSE method cannot be directly solved in a closed-form solution. Therefore, the following method utilizes the alternating multiplier method (ADMM) to solve the optimization problem min. α L MSE (α).

[0074] First, we introduce variable v, and transform equation (1) into...

[0075]

[0076] Define the Lagrange function:

[0077]

[0078] Where u is a Lagrange multiplier, u is a non-negative penalty parameter, and l + l(v) is an indicator function, l(v) = 0 when v ≥ 0, otherwise l(v) = +∞.

[0079] Depend on:

[0080]

[0081] have to:

[0082]

[0083] Where I is the identity matrix. The above equation is also:

[0084]

[0085]

[0086] The iterative process obtained from the Alternating Multiplier Method (ADMM) algorithm is as follows:

[0087]

[0088]

[0089] Step S240: Construct a strong classifier.

[0090] Using the α obtained through iterative calculation, the strong classifier F constructed includes:

[0091]

[0092] Where α(j) is the j-th element of α.

[0093] Step S250: Identification of the year of dried tangerine peel data.

[0094] Given tangerine peel data x, input x into the classifier: The final output of the strong classifier F is argmaxF(x).

[0095] The method for identifying the age of dried tangerine peel provided in this embodiment first divides the training samples (terahertz spectral data) of the tangerine peel into many small intervals by sliding a window. Next, a base classifier is trained using the terahertz spectral data of the training samples in each interval. Then, using the l1 norm, an objective function based on Mean Square Error (MSE) is established, and an iterative algorithm based on Alternating Direction Method of Multipliers (ADMM) is constructed to obtain sparse non-negative vectors. Finally, a strong classifier is obtained by combining the sparse non-negative vectors with the non-negative sparse data of the trained base classifier. After generating the strong classifier, the age of the tangerine peel can be identified. This method for classifying the age of tangerine peel has the following beneficial effects:

[0096] 1) Through sparse optimization, the selection of optimal interval features and the fusion of optimal decision-level features are achieved simultaneously;

[0097] 2) The base classifier is flexible in selection and has wide applicability;

[0098] 3) Compared with the base classifier, this method can significantly improve the accuracy of tangerine peel classification by year.

[0099] Third Embodiment

[0100] Unlike the second embodiment, this embodiment measures Y using cross-entropy (CE).i α and y i The deviation.

[0101] The specific steps are as follows:

[0102] Drawing inspiration from the loss function CE in neural networks, Y... i α can be seen as the output of the last layer of the neural network, and the probability of each class is obtained using the softmax function. For λ∈R n The softmax function is defined as follows:

[0103]

[0104] Let z i =softmax(Y i α), the objective function of the CE method is defined as follows:

[0105]

[0106] Where λ is the regularization parameter, z i (k) is a vector z i The k-th element.

[0107] Solving the optimization problem min α L CE (α), the objective function of the cross-entropy (CE) method also cannot be directly solved by finding a closed-form solution. This embodiment uses the gradient descent algorithm to solve it.

[0108] It can be derived that L CE Gradient of (α):

[0109]

[0110] Here, sign(.) is the sign function.

[0111] Using the gradient descent algorithm, initialize the weights α and learning rate τ, and iteratively solve the formula as follows:

[0112]

[0113] The method for identifying the age of dried tangerine peel provided in this embodiment first divides the training samples (terahertz spectral data) of the tangerine peel into many small intervals through a sliding window. Next, a base classifier is trained using the terahertz spectral data of the training samples in each interval. Then, an objective function based on cross-entropy is established using the l1 norm, and an iterative gradient descent algorithm is constructed to obtain sparse non-negative vectors. Finally, a strong classifier is obtained by combining the sparse non-negative vectors with the non-negative sparse data of the trained base classifier. After generating the strong classifier, the age of the tangerine peel can be identified. This method for classifying the age of tangerine peel has the following beneficial effects:

[0114] 1) Through sparse optimization, the selection of optimal interval features and the fusion of optimal decision-level features are achieved simultaneously;

[0115] 2) The base classifier is flexible in selection and has wide applicability;

[0116] 3) Compared with the base classifier, this method can significantly improve the accuracy of tangerine peel classification by year.

[0117] Fourth embodiment

[0118] Taking Bupleurum chinense as an example, the classification method based on terahertz spectral data is used to identify the type of Bupleurum chinense.

[0119] The implementation method is similar to the second and third embodiments described above, and will not be repeated here. This Bupleurum chinense variety identification method first divides the training samples (terahertz spectral data) into many small intervals using a sliding window. Then, it trains a base classifier using the terahertz spectral data of the training samples in each interval. Next, it establishes objective functions based on cross-entropy and mean square error using the L1 norm, and constructs an iterative solution algorithm based on gradient descent or alternating direction multipliers to obtain sparse non-negative vectors. Finally, it obtains the final strong classifier by combining the sparse non-negative vectors with the non-negative sparse combination of the trained base classifier. After generating the strong classifier, Bupleurum chinense variety identification can be performed. This Bupleurum chinense variety classification method has the following beneficial effects:

[0120] 1) Through sparse optimization, the selection of optimal interval features and the fusion of optimal decision-level features are achieved simultaneously;

[0121] 2) The base classifier is flexible in selection and has wide applicability;

[0122] 3) Compared with the base classifier, this method can significantly improve the classification accuracy of Bupleurum chinense varieties.

[0123] Fifth Embodiment

[0124] The following set of experimental results demonstrates the effectiveness of the first embodiment described above:

[0125] First, the original sample was prepared as the sample to be collected. Then, terahertz data of the sample was acquired using a terahertz spectrometer. The raw terahertz data was then cleaned to form the final experimental data. The sample to be collected involved preparing a circular slice approximately 13 mm in diameter and 1 mm thick. First, a specific mass of the sample was weighed using a balanced scale. Then, the original sample was pulverized using a grinder, further ground into powder, and then filtered through a 200-mesh sieve to remove large particles. Finally, the fine, uniform sample powder was pressed into a circular slice using a press. Next, the prepared sample to be collected was placed in the mold of the terahertz spectrometer, and the mold was placed inside the sample chamber of the spectrometer. Nitrogen blowing was continuously applied to the sample chamber to ensure a dry collection environment. Finally, the spectrometer was started to collect data from the sample. The raw data was stored in the engineering unit. After exporting the data, data cleaning was performed to remove outlier samples, ultimately forming the experimental dataset.

[0126] The datasets used in the experiment were Bupleurum chinense and Citrus reticulata peel datasets. The dataset categories, batch numbers, and sample sizes are shown in Table 1. The experiment used absorption coefficient spectral data with frequencies ranging from 0.1 to 1.8 THz.

[0127]

[0128] Table 1

[0129] Window width and stride size are crucial for dividing the data into small intervals, making them the primary hyperparameters to consider. The window width controls the dimensionality of the input data for each base classifier, or the amount of sample information acquired by each classifier. It also indirectly affects the number of base classifiers. The stride size directly controls the number of base classifiers and influences the degree of overlap in information acquired by adjacent classifiers. If the stride size exceeds the window width, the model skips some features.

[0130] On the Bupleurum chinense and Citrus reticulata datasets, this scheme (named ISEMCC in the figure) was tested with sliding step sizes of 20, 50, and 80, using MSE or CE as the loss function and SVM or DT as the base classifier. The classification accuracy under different window widths was measured, and the results are as follows. Figure 3 As shown.

[0131] Figure 3This indicates that the proposed scheme is insensitive to the sliding step size but exhibits a strong correlation with the window width. Overall, as the window width increases, the classification accuracy initially rises significantly, then tends to plateau or decrease. With increasing window width, the classification ability of the base classifiers and the performance of the sparse ensemble also show a significant improvement. However, as the window width further increases, the model's performance on the Bupleurum chinense dataset reaches saturation. On the Citrus reticulata peel dataset, the accuracy of the SVM ensemble peaks and then declines, while the accuracy of the DT ensemble also shows saturation. On both datasets, the accuracy trends for different sliding step sizes are generally consistent, but the differences caused by the base classifiers are more pronounced.

[0132] Based on the experimental results shown in the figure, the settings for the window width and step size of the proposed algorithm are shown in Table 2.

[0133]

[0134] Table 2

[0135] LR 80.00 53.68 SVM (Linear Kernel) 80.77 51.05 SVM (Gaussian kernel) 71.54 51.29 DT(Gini) 66.15 50.76 DT (Entropy) 69.23 47.19 RF 75.38 48.13 AdaBoost 65.38 51.52 GBoost 66.15 49.59 XGBoost 66.15 52.46 ExtraTree 74.62 44.85 This plan (MSE+DT) 86.67 57.84 This solution (CE+DT) 90.00 54.93 This solution (MSE+SVM) 93.33 60.76 This solution (CE+SVM) 93.33 60.76

[0136] Table 3

[0137] The proposed solutions (MSE+SVM), (CE+SVM), (MSE+DT), and (CE+DT) were compared with SVM (Support Vector Machine), DT (Decision Tree or Classification Tree), Random Forest (RF), Logistic Regression (LR), AdaBoost, and XGBoost on the Bupleurum and Tangerine Peel datasets. The results are shown in Table 3. Parameter optimization was performed on all compared algorithms. Table 3 shows that:

[0138] 1) The classification accuracy of this method is significantly improved compared to the base classifier.

[0139] 2) Using SVM as the base classifier is better than using DT as the base classifier.

[0140] 3) There is no significant difference between using MSE and CE.

[0141] 4) The classification accuracy of this method is significantly higher than that of all the comparison algorithms.

[0142] Sixth Embodiment

[0143] Some embodiments of this application provide a classification device based on terahertz spectral data. The terahertz spectral data classification device includes: a data acquisition unit 1100, a base classifier training unit 1200, a sparse optimization unit 1300, and a strong classifier generation unit 1400, as detailed below:

[0144] The data acquisition unit 1100 is used to acquire the terahertz spectral dataset of the items to be classified and divide the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals.

[0145] The base classifier training unit 1200 is used to construct an initial classifier, and trains the initial classifier on multiple data subsets respectively to obtain the corresponding multiple base classifiers.

[0146] The sparse optimization unit 1300 is used to determine the first data and the second data, and to calculate a sparse non-negative vector that minimizes the deviation between the first data and the second data. The first data is the product of the classification output of the terahertz spectral data of the items to be classified by multiple base classifiers and the sparse non-negative vector. The second data is the one-hot encoded vector of the category label corresponding to the terahertz spectral data.

[0147] The strong classifier generation unit 1400 is used to form a strong classifier based on sparse non-negative vectors and multiple base classifiers, so as to classify the items to be classified based on terahertz spectral data according to the strong classifier.

[0148] The apparatus in this embodiment and the method embodiment described above are based on the same inventive concept. Therefore, the relevant content of the method embodiment described above is also applicable to the content of this apparatus, and will not be repeated here.

[0149] Seventh Embodiment

[0150] See Figure 4 This application also provides an electronic device, which includes:

[0151] At least one memory;

[0152] At least one processor;

[0153] At least one program;

[0154] The program is stored in memory, and the processor executes at least one program to implement the classification method based on terahertz spectral data described above in this disclosure.

[0155] This electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.

[0156] The electronic devices according to embodiments of this application will now be described in detail.

[0157] The processor 1600 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this disclosure.

[0158] The memory 1700 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1700 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1700 and called by the processor 1600 to execute the classification method based on terahertz spectral data of the embodiments of this disclosure.

[0159] The input / output interface 1800 is used to implement information input and output.

[0160] The communication interface 1900 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0161] Bus 2000 transmits information between various components of the device (e.g., processor 1600, memory 1700, input / output interface 1800, and communication interface 1900);

[0162] The processor 1600, memory 1700, input / output interface 1800 and communication interface 1900 are connected to each other within the device via bus 2000.

[0163] This disclosure also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above-described classification method based on terahertz spectral data.

[0164] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0165] The embodiments described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided by this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by this disclosure are also applicable to similar technical problems.

[0166] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this disclosure, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0167] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0168] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0169] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0170] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0171] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0172] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0173] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0174] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks. The embodiments of this application have been described in detail above with reference to the accompanying drawings, but this application is not limited to the above embodiments. Various changes can be made within the scope of knowledge possessed by those skilled in the art without departing from the spirit of this application.

Claims

1. A classification method based on terahertz spectral data, characterized in that, The classification method based on terahertz spectral data includes: Obtain the terahertz spectral dataset of the items to be classified, and divide the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals; Construct an initial classifier, and train the initial classifier on each of the multiple data subsets to obtain the corresponding multiple base classifiers; Determine the first data and the second data, and calculate a sparse non-negative vector that minimizes the deviation between the first data and the second data. The first data is the product of the classification output of the multiple base classifiers for the terahertz spectral data of the item to be classified and the sparse non-negative vector. The second data is the one-hot encoded vector of the category label corresponding to the terahertz spectral data. A strong classifier is formed by combining the sparse non-negative vector with the multiple base classifiers, so that the items to be classified can be classified based on the terahertz spectral data using the strong classifier.

2. The classification method based on terahertz spectral data according to claim 1, characterized in that, Sparse nonnegative vectors are computed as follows: The mean square error method is used to construct a first objective function for the deviation between the first data and the second data, and the alternating multiplier method is used to solve for minimizing the first objective function, thereby calculating a sparse non-negative vector. Alternatively, the cross-entropy method can be used to construct a second objective function for the deviation between the first data and the second data, and the gradient descent method can be used to solve for minimizing the second objective function to obtain a sparse non-negative vector.

3. The classification method based on terahertz spectral data according to claim 2, characterized in that, The first objective function includes: in, Represents a sparse nonnegative vector. The number of terahertz spectral data in the terahertz spectral dataset. , for The base classifier for the th base classifier Classification output of terahertz spectral data For the first The base classifier for the th base classifier Classification output of terahertz spectral data For the first One-heat encoded vectors of category labels for terahertz spectral data. For regularization parameters, for of Norm.

4. The classification method based on terahertz spectral data according to claim 2, characterized in that, The second objective function includes: in, Represents a sparse nonnegative vector. The number of terahertz spectral data in the terahertz spectral dataset. The total number of categories, For vectors The Middle One element, , , for The base classifier for the th base classifier Classification output of terahertz spectral data For the first The base classifier for the th base classifier Classification output of terahertz spectral data; For the first One-heat encoded vectors of category labels for terahertz spectral data. For regularization parameters, for of Norm.

5. The classification method based on terahertz spectral data according to claim 3 or 4, characterized in that, The strong classifier includes: in, The sparse nonnegative vector of the th One element, The number of base classifiers, For the first One base classifier.

6. The classification method based on terahertz spectral data according to claim 1, characterized in that, The step of dividing the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals includes: The settings include defining the width and sliding step of a slidable window; The terahertz spectral dataset is divided into multiple data subsets corresponding to different terahertz intervals using the sliding window.

7. An application of a classification method based on terahertz spectral data as described in any one of claims 1 to 6 in the classification by Bupleurum chinense variety or by the year of dried tangerine peel.

8. A classification device based on terahertz spectral data, characterized in that, The classification device based on terahertz spectral data includes: The data acquisition unit is used to acquire the terahertz spectral dataset of the items to be classified and to divide the terahertz spectral dataset into multiple data subsets corresponding to different terahertz intervals. The base classifier training unit is used to construct an initial classifier and train the initial classifier on the multiple data subsets respectively to obtain the corresponding multiple base classifiers. A sparse optimization unit is used to determine the first data and the second data, and to calculate a sparse non-negative vector that minimizes the deviation between the first data and the second data. The first data is the product of the classification outputs of the multiple base classifiers for the terahertz spectral data of the item to be classified and the sparse non-negative vector. The second data is the one-hot encoded vector of the category label corresponding to the terahertz spectral data. A strong classifier generation unit is used to form a strong classifier based on the sparse non-negative vector and the multiple base classifiers, so as to classify the item to be classified based on the terahertz spectral data according to the strong classifier.

9. An electronic device, characterized in that: It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform the classification method based on terahertz spectral data as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions for causing a computer to perform the classification method based on terahertz spectral data as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Terahertz spectrum-based sparse representation classification method for saccharide analysis

    CN113607677A

  • Product recommendation method and device based on multi-model fusion and medium

    CN114741592A