Identification method of Chinese herbal medicine based on ID3 decision tree algorithm and fuzzy discrimination

By combining ID3 decision tree algorithm and fuzzy discrimination, terahertz absorption spectrum is used to identify Chinese medicinal materials, the problems of high misidentification rate and complex calculations in the existing technology are solved, and the rapid and accurate classification and recognition of Chinese medicinal materials are achieved.

CN114997243BActive Publication Date: 2025-03-25SOUTHWEAT UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210785521.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-04
Publication Date
2025-03-25
Estimated Expiration
2042-07-04

AI Technical Summary

Technical Problem

The existing terahertz spectrum classification methods for traditional Chinese medicinal materials have problems such as high misidentification rate, inability to describe internal similarities of categories, and complex calculations, making it difficult to effectively identify a variety of traditional Chinese medicinal materials.

Method used

The Chinese medicinal material recognition method based on ID3 decision tree algorithm and fuzzy discrimination is adopted. Fourier transform is performed through terahertz absorption spectrum, absorption coefficient is calculated, and detailed feature point library is constructed. The decision tree model is used for preliminary identification and fuzzy discrimination are confirmed to improve the recognition accuracy.

Benefits of technology

It realizes rapid and accurate classification and identification of a variety of Chinese medicinal materials, reduces the misidentification rate, and improves the reliability of identification results and the accuracy of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114997243B_ABST
    Figure CN114997243B_ABST
Patent Text Reader

Abstract

This invention discloses a method for identifying Chinese medicinal materials based on the ID3 decision tree algorithm and fuzzy discrimination. The method includes: establishing a sample library of terahertz absorption spectra of Chinese medicinal materials and a minutiae feature library using terahertz time-domain spectroscopy; training an ID3 decision tree based on the sample library and predicting the identification of the sample to be identified; further matching the sample to be identified with the predicted sample using the minutiae feature library, and determining the sample category based on the matching result. This invention's identification method can confirm the classification results of the decision tree using fuzzy discrimination, effectively combining the good classification performance of the decision tree model with the good description of intra-category similarity of fuzzy discrimination. By leveraging the advantages of different algorithms, it significantly reduces misidentification of medicinal materials outside the sample library, achieving a better recognition rate and improving the reliability and accuracy of terahertz spectroscopy in identifying Chinese medicinal materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of classification and recognition, and in particular to the technical field of a Chinese medicinal material recognition method based on an ID3 decision tree algorithm and fuzzy discrimination. Background Art

[0002] During the circulation of Chinese medicinal materials, there will be problems such as unscrupulous vendors selling cheap and similar-looking counterfeit drugs as genuine products, which will not only cause economic losses to consumers, but also harm their physical health. Therefore, it is necessary to accurately identify Chinese medicinal materials. However, traditional experience-based Chinese medicine identification methods cannot solve the above problems well.

[0003] Terahertz time-domain spectroscopy technology does not cause harmful ionization and radiation when used for material detection. It can obtain spectral characteristic information such as the sample's absorption coefficient, and has a high signal-to-noise ratio and detection sensitivity. Therefore, it has become one of the research directions for quality control of Chinese herbal medicines. However, most Chinese herbal medicines do not have obvious absorption peaks in the terahertz band, and it is difficult to accurately classify them by the position of the absorption peak. Therefore, the current method of using terahertz spectroscopy to classify and identify Chinese herbal medicines is mostly with the help of pattern recognition tools.

[0004] However, the current research on algorithms for THz spectroscopy of Chinese medicinal materials still has the following two problems: (1) Although algorithms such as decision trees and support vector machines can quickly and accurately identify the types of medicinal materials in the sample library, they cannot describe the similarity within the category, that is, they will also identify medicinal materials outside the library as medicinal materials in the library. (2) Although fuzzy discrimination and similar algorithms can describe the similarity within the category, when the similarity between medicinal materials is high, their recognition rate is low, about 80%; and because it is necessary to calculate the membership between the spectrum to be tested and the spectrum of each Chinese medicinal material in the sample library, especially when there are many samples to be tested or there are many types of medicinal materials in the sample library, the calculation process is also more complicated.

[0005] The misidentification rate will seriously affect the practicality of the Chinese medicinal materials identification model. Therefore, it is necessary to study methods to reduce the misidentification of Chinese medicinal materials. Summary of the invention

[0006] The purpose of the present invention is to provide a Chinese medicinal material identification method using terahertz absorption spectra of Chinese medicinal materials, based on ID3 decision tree algorithm and fuzzy discrimination, which can realize rapid and accurate classification and identification of various Chinese medicinal materials.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] The Chinese medicinal material identification method based on ID3 decision tree algorithm and fuzzy discrimination includes:

[0009] Obtaining terahertz time-domain spectra of a plurality of Chinese medicinal material samples, performing Fourier transform on the terahertz time-domain spectra to obtain frequency domain data, calculating the absorption coefficient at each frequency sampling point based on the obtained frequency domain data, and obtaining the corresponding terahertz absorption spectra of the Chinese medicinal materials, and forming a sample set by the terahertz absorption spectra of each Chinese medicinal material sample;

[0010] Based on the sample set, a decision tree model of the ID3 algorithm is trained to obtain a decision tree recognition model;

[0011] Based on the sample set, obtaining a detailed feature point library of the terahertz absorption spectrum;

[0012] Identify the terahertz absorption spectrum of the Chinese medicinal material to be tested that has sample data in the sample set by using the decision tree recognition model, and obtain a prediction result about the type of the Chinese medicinal material according to the recognition result;

[0013] The detail feature points of the Chinese medicinal materials consistent with the prediction results in the detail feature point library are matched with the detail feature points of the terahertz absorption spectrum of the Chinese medicinal materials to be tested, and the category of the Chinese medicinal materials to be tested is determined according to the matching results.

[0014] The detail feature point library is constructed as follows:

[0015] The absorption spectra of different Chinese medicinal materials samples at different sampling frequency points in their terahertz absorption spectrum diagrams are marked to obtain the mean and variance of the absorption coefficient at each frequency point. The detail feature point library is composed of the frequency point frequency, the mean and variance of the absorption coefficient and the type label of the corresponding Chinese medicinal materials sample.

[0016] According to some specific embodiments of the present invention, the Chinese medicinal material identification method further includes: smoothing the terahertz absorption spectrum to obtain a smoothed absorption spectrum, and performing the decision tree training through the smoothed absorption spectrum.

[0017] According to some specific embodiments of the present invention, obtaining the smoothed absorption spectrum includes:

[0018] The collected terahertz time-domain spectrum is Fourier transformed, and the absorption coefficient of the Chinese medicinal material sample is calculated based on the transformed frequency domain data, as follows:

[0019]

[0020]

[0021] Where n(w) represents the refractive index of the sample, c is the propagation speed of the terahertz wave in a vacuum, w is the angular frequency, and d is the sample thickness. is the phase difference between the reference signal and the sample signal (the reference signal is the terahertz signal measured when no sample is placed, and the sample signal is the terahertz signal when the sample is placed), α(w) is the sample absorption coefficient, and ρ(w) is the amplitude ratio of the reference signal to the sample signal;

[0022] The terahertz absorption spectrum of the Chinese medicinal material sample is formed by the absorption coefficient at each frequency point;

[0023] The SG smoothing algorithm was used to perform three-point second-order smoothing on the absorption spectrum of each sample to obtain the smoothed absorption spectrum.

[0024] According to some specific embodiments of the present invention, the mean and variance of the absorption coefficient of the detail feature point are obtained by the following calculation model:

[0025] A(i)=[m i1 ,…m ij …m iN ] (3),

[0026] C(i)=[c i1 ,…c ij …c iN ] (4),

[0027] in

[0028] Wherein, A(i) represents the mean value of the absorption coefficient, C(i) represents the variance of the absorption coefficient, and m ij represents the mean absorption coefficient of the i-th sample at the j-th frequency point, c ij represents the variance of the absorption coefficient of the i-th sample at the j-th frequency point, p ijk It represents the absorption coefficient of the kth absorption spectrum of the i-th type of medicinal materials at the j-th frequency point, L represents the number of absorption spectra of this type of samples, and N represents the number of frequency points on each absorption spectrum.

[0029] The detailed feature point library includes {A(i), C(i)}, i=1, 2, ...B, where B represents the type label of the Chinese medicinal material sample.

[0030] According to some specific embodiments of the present invention, the matching includes:

[0031] According to the prediction results of the decision tree recognition model, the corresponding Chinese medicinal material type label is found in the detail feature point library, and the mean A(i) and variance C(i) of the absorption coefficient of the detail feature point of the predicted Chinese medicinal material are obtained;

[0032] Based on the obtained absorption coefficient mean and variance, the membership degree of the terahertz absorption spectrum of the tested Chinese medicinal materials and the predicted Chinese medicinal materials is calculated as follows:

[0033]

[0034] where f Qj is the absorption coefficient of the jth frequency sampling point of the Chinese medicinal material to be tested, m j To predict the mean value, c j is the variance of the point;

[0035] The obtained membership value is compared with the set threshold. If the membership values ​​corresponding to all detail feature points are higher than the threshold, the tested Chinese medicinal material and the predicted Chinese medicinal material are of the same type, otherwise they are of different types.

[0036] According to some specific embodiments of the present invention, the threshold is set to the value α in the confidence level 1-α.

[0037] According to some specific embodiments of the present invention, the Chinese medicinal material to be tested is selected from any one of Gastrodia elata, Bletilla striata root, Codonopsis pilosula, Citrus reticulatae and Rhubarb, and the sample set is obtained based on 30 terahertz time-domain spectra of each of the five Chinese medicinal materials.

[0038] According to some specific embodiments of the present invention, the decision tree training includes: using a total of 150 smoothed terahertz absorption spectra of the five Chinese medicinal materials in the 0.2-1.5THZ band as a training sample library, and randomly selecting 70% of the samples in the sample library each time as input to the decision tree for model training.

[0039] The recognition method of the present invention divides the recognition of Chinese medicinal materials into local recognition and overall recognition. The medicinal materials can be classified locally through a decision tree model, and then fuzzy discrimination is used to classify the medicinal materials as a whole through the membership value of the medicinal materials to be tested belonging to a certain category of medicinal materials at each sampling frequency point, thereby improving the reliability of the recognition result and the accuracy of the prediction.

[0040] In the terahertz band, only when a single substance reaches a certain concentration can a more obvious absorption peak appear. However, a Chinese herbal medicine often contains hundreds or thousands of ingredients, and the content of a single ingredient is very small. Experiments have also shown that the terahertz absorption spectrum of most Chinese herbal medicines has no absorption peak. Even if the ingredient has a tiny absorption peak, it may be masked by the superposition of the absorption coefficients of other ingredients at the same frequency point. Therefore, the accuracy of judging the type of Chinese herbal medicine based on the position of the absorption peak is very low. The identification method of the present invention can recognize the same type of medicinal materials through the shape difference of the absorption spectrum of the medicinal materials, which is more accurate and feasible than judging by the position of the absorption peak.

[0041] The current machine learning classification methods such as support vector machine classification, neural network classification, decision tree classification, etc., have the problem of being used for Chinese herbal medicine spectrum analysis: when the herbal medicine to be tested is not a herbal medicine in the sample library, these classification methods often misjudge it as a certain herbal medicine in the sample library. Another problem is that when a large number of herbal medicines need to be identified, fuzzy discrimination needs to calculate the membership of the sample to be tested and each type of herbal medicine in the sample library, which takes a long time to identify. If the similarity between the absorption spectra of the herbal medicines is high, the difference in membership cannot distinguish the type of the herbal medicine to be tested, so the recognition accuracy is low, and the accuracy is about 80% in Chinese herbal medicine identification. The recognition method of the present invention contains a double-layer discrimination of decision tree and fuzzy discrimination. The sample to be tested can use the decision tree to quickly obtain the initial judgment result, reducing the calculation amount of the fuzzy discrimination process. At the same time, when the decision tree makes a misjudgment, especially when the herbal medicine to be tested is not a herbal medicine in the sample library, the initial judgment result is confirmed by the fuzzy discrimination method, thereby improving the judgment speed and recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 The invention implements the described Chinese medicinal material recognition model based on ID3 decision tree algorithm and fuzzy discrimination.

[0043] Figure 2 Schematic diagram of the threshold value and normal distribution described in the embodiment of the present invention.

[0044] Figure 3 A visualization of the prediction results provided by an embodiment of the present invention.

[0045] Figure 4 The pass rate of two libraries to be identified under different thresholds DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] According to the technical solution of the present invention, the identification of Chinese medicinal materials based on the ID3 decision tree algorithm and fuzzy discrimination may include the following processes in specific implementation:

[0048] Establish a sample library, establish a detailed feature point library based on the sample library, and train the ID3 decision tree model based on the sample library;

[0049] The ID3 decision tree model is used to perform identification prediction on the samples to be identified and obtain the prediction results;

[0050] Based on the detail feature point library, the sample to be identified is further matched with the prediction result in detail feature points, and the type of the sample to be identified is determined according to the matching result.

[0051] In some specific implementations, the establishment of the sample library includes:

[0052] Collect terahertz time-domain spectra of Chinese medicinal materials samples.

[0053] The collected terahertz time-domain spectrum is Fourier transformed, and the absorption spectrum of the Chinese medicinal material sample is calculated based on the transformed frequency domain data. The calculation model is as follows:

[0054]

[0055]

[0056] Where n(w) represents the refractive index of the sample; c is the propagation speed of the terahertz wave in a vacuum; w is the angular frequency; d is the sample thickness, mm; is the phase difference between the reference signal and the sample signal; α(w) is the sample absorption coefficient; ρ(w) is the amplitude ratio of the reference signal to the sample signal, wherein the reference signal is the terahertz time domain signal measured when no sample is placed, and the sample signal is the terahertz time domain signal when the sample is placed.

[0057] The SG smoothing algorithm was used to perform three-point second-order smoothing on the absorption spectrum of each sample to obtain the smoothed absorption spectrum.

[0058] The obtained terahertz time-domain spectra and the corresponding smoothed absorption spectra are included in the sample library.

[0059] In some specific implementations, the establishment of the detail feature point library includes:

[0060] Mark the detailed feature points of different Chinese medicinal materials samples in the terahertz absorption spectrum. The detailed feature point is the mean value m of the absorption coefficient at that frequency point. ij and variance c ij Data, (where i represents the sample category and j represents the detail feature point number).

[0061] The detailed feature mean A(i) and variance C(i) of different Chinese medicinal materials samples at each frequency sampling point are obtained as follows:

[0062] A(i)=[m i1 ,…m ij …m iN ] (3),

[0063] C(i)=[c i1 ,…c ij …c iN ] (4),

[0064] in

[0065] Wherein, A(i) represents the mean value of the absorption coefficient of the detail feature point; C(i) represents the variance of the absorption coefficient of the detail feature point; p ijk m represents the absorption coefficient of the kth absorption spectrum of the i-th type of medicinal material at the jth frequency point; ij represents the mean absorption coefficient of the i-th sample at the j-th frequency point, c ij It represents the variance of the absorption coefficient of the i-th sample at the j-th frequency point, L represents the number of absorption spectra of this type of samples, and N represents the number of data points on each absorption spectrum.

[0066] The detail feature library {A(i), C(i)}, i=1, 2, ... B (B represents the label of the type of the Chinese medicinal material sample), is composed of the detail feature mean A(i) and variance C(i) corresponding to the Chinese medicinal material samples.

[0067] In some specific embodiments, the ID3 (Interactive Dichotomizer-3) decision tree model, in order to select the optimal feature attribute, usually uses "impurity" to evaluate the quality of the optimal feature attribute. Generally speaking, the lower the impurity index is, the better the fitting effect of the decision tree on the training set is. The present invention uses information entropy impurity as an indicator for evaluating the decision tree, and its formula is as follows:

[0068]

[0069] Where D is the sample set, p k is the proportion of samples of the kth category in the current sample set D

[0070] The present invention is divided into a preliminary identification part and a feature matching part. For a terahertz absorption spectrum of an unknown medicinal material name, an ID3 decision tree model is first used to obtain a preliminary judgment result, and then the absorption coefficient mean and variance data of the medicinal material name are found in a detail feature library, and detail feature matching is performed. The membership between the medicinal material to be tested and the medicinal material of the name in the detail feature library (the medicinal material name predicted by the decision tree model) is calculated, and the size of the membership is compared with the set threshold. If it is greater than the threshold, it is determined that the prediction result of the decision tree model is correct and the result is output. If it is less than the threshold, the membership of the medicinal material to be tested and all the medicinal materials in the detail feature library is calculated, and the medicinal material name with the largest membership is selected as a new prediction result. Then the size between the membership and the threshold is judged. If it is higher than the set threshold, the prediction result is output, otherwise it is determined that there is no type of the sample to be tested in the detail feature library.

[0071] In some specific implementations, the detail feature point matching includes:

[0072] According to the results predicted by the decision tree, the detail feature mean A(i) (i.e., its average spectrum) and variance C(i) of the corresponding Chinese medicinal materials are found in the detail feature library, and the membership degree of each detail feature point of the sample to be tested and the corresponding medicinal materials in the detail feature library are calculated as follows:

[0073]

[0074] where f Qj is the absorption coefficient of the jth frequency sampling point of the sample to be identified, m j is the data at the jth frequency sampling point on the average spectrum of the corresponding medicinal material in the detail feature library, c j is the variance data of this point;

[0075] The membership values ​​calculated from the sample to be tested and the average spectrum are compared with the set threshold alpha. If the membership values ​​corresponding to all its detail feature points are higher than the set threshold, the sample to be tested and the corresponding medicinal material in the detail feature library are of the same type, otherwise they are different types of Chinese medicinal materials.

[0076] In some specific embodiments, the threshold is set to the α value in the confidence level 1-α, and α can generally be taken as 0.1 to 0.2.

[0077] The threshold is set based on the following principles:

[0078] In the interval estimation theory of probability theory, if the same sample population X is sampled repeatedly, each sample determines a random interval The samples that do not contain the mean in this interval account for approximately 100α% of the population, and the samples that contain the mean account for 100(1-α)% of the population, where 1-α is the confidence level. The corresponding interval is called the confidence interval. By setting α as the threshold, the length of the confidence interval can be controlled by the size of α, thereby improving the accuracy of the prediction.

[0079] Example 1

[0080] Identify Chinese herbal medicines by following these steps:

[0081] Step 1: Use terahertz time-domain spectroscopy to collect terahertz time-domain spectra of five Chinese medicinal materials, namely, Gastrodia elata, White aconite root, Codonopsis pilosula, Tangerine peel, and Rhubarb. Collect 30 spectral data for each Chinese medicinal material. Perform Fourier transform on each collected spectrum, and calculate the absorption spectrum of each sample according to equations (1) and (2):

[0082]

[0083]

[0084] Where n(w) represents the refractive index of the sample; c is the propagation speed of the terahertz wave in a vacuum; w is the angular frequency; d is the sample thickness, mm; is the phase difference between the reference signal and the sample signal; α(w) is the sample absorption coefficient; ρ(w) is the amplitude ratio of the reference signal to the sample signal.

[0085] Step 2: Use the SG smoothing algorithm to perform three-point second-order smoothing on each absorption spectrum to obtain the smoothed absorption spectrum.

[0086] Step 3: A total of 150 smoothed absorption spectra of the five Chinese medicinal materials in the 0.2-1.5THZ band are used as samples, and 70% of the samples in the sample library are randomly selected each time as inputs of the decision tree to perform model training, and the trained decision tree model is saved.

[0087] Step 4: Obtain the detailed feature mean A(i) and variance C(i) of each Chinese medicinal material i at each frequency sampling point:

[0088] A(i)=[m i1 ,…m ij …m iN ] (3),

[0089] C(i)=[c i1 ,…c ij …c iN ] (4), in

[0090] Through the above steps, a sample library and a detailed feature library of B types of medicinal materials {A(i), C(i)}, i=1,2,…B are formed.

[0091] Step 5: Find the detail feature mean and variance data of the corresponding Chinese medicinal materials in the detail feature library according to the results predicted by the decision tree. According to formula (5), calculate the membership degree between each detail feature point of the sample to be tested and the corresponding medicinal materials in the detail feature library.

[0092]

[0093] Among them, f Qj is the absorption coefficient at the jth frequency sampling point on the spectrum of the sample to be tested, m j is the data at the jth frequency sampling point on the average spectrum of the corresponding medicinal material in the detail feature library, c j is the variance data of this point.

[0094] Step 6: Determine the decision tree classification result based on the comparison between the membership value and the threshold. The classification result determination method is as shown in the attached Figure 2As shown, a threshold line alpha is set on the normal membership curve, and each point on the curve is the membership value between the test sample and the average sample. If the membership values ​​calculated for the test sample and the average spectrum are all higher than the set threshold alpha, then the two medicinal materials are judged to be of the same type, otherwise they are of different types.

[0095] In a specific embodiment, referring to the attached Figure 1 As shown in FIG. 1 , the identification process of a certain Chinese medicinal material having sample data in the sample library and the detail feature library is as follows:

[0096] There are 287 sampling points in the terahertz absorption spectrum in the 0.2-1.5THZ band, that is, a terahertz absorption spectrum consists of the absorption coefficients at 287 points.

[0097] include:

[0098] Feature point 1: The 125th absorption coefficient on the spectrum, i.e. 0.768511THz;

[0099] Feature point 2: The 26th absorption coefficient on the spectrum, that is, 0.315638 THz;

[0100] Feature point 3: The first absorption coefficient on the spectrum, i.e. 0.201277THz;

[0101] Feature point 4: The 16th absorption coefficient on the spectrum, i.e. 0.260745 THz;

[0102] Feature point 5: The 17th absorption coefficient in the spectrum, which is 0.269894 THz.

[0103] Initial identification part:

[0104] The preliminary identification part is a constructed decision tree. Taking the root node as an example, the entropy in the root node represents the information entropy of the attribute. The feature point in the root node is less than or equal to 18.715, which represents the first classification index and the attribute with the largest information gain. If the absorption coefficient of the terahertz spectrum of the tested medicinal material at the first feature point is less than or equal to 18.715, it is true, then it may be dried tangerine peel or gastrodia elata. If the absorption coefficient at the second feature point is less than or equal to 4.205, it is true, then it is dried tangerine peel. If the second feature point is false, continue to judge the fourth feature point. If the judgment result of the fourth feature point is true, it is dried tangerine peel, otherwise it is gastrodia elata. If the first feature point is false, it may be white aconite, rhubarb or codonopsis. Continue to judge whether the absorption coefficient at the third feature point is less than or equal to 11.617. If it is false, it is judged to be rhubarb. If it is true, continue to judge whether the absorption coefficient at the fifth feature point is less than 2.744. If it is true, it is judged to be codonopsis pilosula, and if it is false, it is white aconite.

[0105] Detail feature matching part:

[0106] Assuming that the initial judgment result obtained by the decision tree is Gastrodia elata, the membership of the sample to be tested and the Gastrodia elata in the detail feature library is calculated based on the mean and variance vector of Gastrodia elata in the detail feature library. If the minimum value of the membership is greater than the set threshold value, it indicates that the prediction result of the decision tree is correct and the prediction result is output. If it is less than the set threshold value, the membership with the other four medicinal materials in the detail feature library is calculated, and the medicinal material with the largest membership is selected as the prediction result and it is determined whether it meets the set threshold value. If it meets the threshold value, the result is judged to be the type of medicinal material with the largest membership, otherwise it is judged that the medicinal material type is not in the detail feature library.

[0107] Example 2

[0108] The advantages of the Chinese herbal medicine identification method based on ID3 decision tree algorithm and fuzzy discrimination proposed by the present invention are: it can quickly determine whether the sample to be tested belongs to the herbal medicine in the sample library, especially when the herbal medicine to be tested does not belong to the herbal medicine in the sample library, this method will not randomly give a prediction result of a herbal medicine in the library like traditional algorithms such as decision tree and support vector machine, but will clearly prompt that the herbal medicine is not in the sample library, thereby improving the accuracy of identification. This recognition model uses the pass rate (True Positive Rate) as an evaluation index. In the pass rate test, it is divided into two parts of testing: first, 70% of the spectral data from Gastrodia elata, White Aconite Root, Codonopsis pilosula, and Tangerine Peel are randomly selected as the sample library, and a detail point feature library is established based on the sample library, and a four-classification decision tree is constructed using the sample library. First, the remaining 30% of the data of the four medicinal materials were used as Library to be identified 1 to test the passing rate of the medicinal materials when they were in the sample library; second, only the 30 sets of terahertz spectrum data of rhubarb medicinal materials that did not participate in the construction of the decision tree were used as Library to be identified 2 to test the passing rate when the types of Chinese medicinal materials were not in the sample library. Since the data for constructing the sample library were randomly selected, the constructed decision tree was not unique, so the average value of 10 experiments was taken as the final result.

[0109] Table 1 Pass rate based on ID3 decision tree algorithm and fuzzy discriminant model

[0110]

[0111] From Table 1, we can see that based on the ID3 decision tree algorithm and the fuzzy discrimination model, when the type of the tested medicinal material belongs to the type of medicinal material in the sample library, when the threshold is 0.1, the average pass rate is 99.43%; when the threshold is 0.15, the average pass rate is 92.86%; when the threshold is 0.2, the average pass rate is 90%. When the type of the tested medicinal material does not belong to the type of medicinal material in the sample library, when the threshold is greater than 0.1, its pass rate is 0; and from the attached Figure 4 It can be seen that when the threshold is greater than 0.2, the pass rate of the library 1 to be identified that participated in the modeling is lower than 90%, and the pass rate continues to decrease as the threshold increases. Therefore, it is shown that the model can correctly pass the types of tested medicinal materials within the modeling set, and filter out the types of tested medicinal materials outside the modeling set, making the model's prediction results more credible.

[0112] Example 3

[0113] Use the process of Example 1 to identify Chinese medicinal materials:

[0114] The absorption spectrum data of a sample to be tested in the 0.2-1.5THZ band is input into the decision tree recognition model, and the decision tree recognition model predicts that the Chinese herbal medicine is dried tangerine peel D according to the feature points;

[0115] Find the average spectrum and variance data of dried tangerine peel in the detail feature library, and calculate the membership value of the two at each sampling frequency point;

[0116] The spectrum of the sample to be tested, the average spectrum of the tangerine peel in the detail feature library, and the membership value of the sample to be tested at each sampling frequency point are plotted in the same coordinate system, as shown in the attached figure. Figure 3 As shown, the solid line represents the absorption spectrum of the sample to be tested, the dotted line represents the average absorption spectrum of tangerine peel, and the dotted line represents the membership value calculated between the sample to be tested and the average spectrum at each sampling frequency point. According to the figure, the sample to be tested is determined to be tangerine peel D (result out: D).

[0117] Example 4

[0118] 100 unlabeled data were input into the three models of the ID3 decision tree algorithm and fuzzy discrimination model of the present invention, the recognition model based on the ID3 decision tree algorithm in the prior art (such as land use classification in arid areas based on multi-seasonal spectral mixture decomposition and decision tree [J]. Transactions of the Chinese Society of Agricultural Engineering, 2016, 32(19): 1-8. Jiang Wanbei, Sun Qiangqiang, Qu Wei, et al.), and the recognition model based on the fuzzy algorithm in the prior art (such as the application of fuzzy pattern recognition in river classification [J]. Systems Engineering - Theory & Practice, 1998, 18(11): 96-102. Zheng Chengde, Li Zhibin) for testing. Since the decision tree model is not unique, the unlabeled samples are predicted 10 times to ensure the objectivity of the results. Considering that different threshold settings in the fuzzy matching stage will result in different recognition accuracy, the thresholds are set to 0.1, 0.15, and 0.2 for testing respectively. The test results are shown in Table 2.

[0119] Table 2 The accuracy of three recognition models

[0120]

[0121] As can be seen from Table 2, when the threshold is set to 0.1 based on the ID3 decision tree algorithm and the fuzzy discriminant model, the average accuracy is 94.4%, and the recognition rate is the highest.

[0122] Therefore, from Table 1 and Table 2, compared with the decision tree algorithm and fuzzy discrimination, the present invention can determine whether the variety of the medicinal material to be tested is included in the detail feature library and the sample library, that is, it reduces the misidentification of medicinal materials outside the library, and for the varieties of Chinese medicinal materials in the detail feature library and the sample library, the recognition rate is higher and the results are more reliable.

[0123] The above embodiments are only used to help understand the method and core idea of ​​the present invention; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A Chinese herbal medicine identification method based on ID3 decision tree algorithm and fuzzy discrimination, characterized in that: It includes: Obtaining terahertz time-domain spectra of a plurality of Chinese medicinal material samples, performing Fourier transform on the terahertz time-domain spectra to obtain frequency domain data, calculating the absorption coefficient at each frequency sampling point based on the obtained frequency domain data, and obtaining the corresponding terahertz absorption spectra of the Chinese medicinal materials, and forming a sample set by the terahertz absorption spectra of each Chinese medicinal material sample; Based on the sample set, a decision tree model of the ID3 algorithm is trained to obtain a decision tree recognition model; Based on the sample set, obtaining a detailed feature point library of the terahertz absorption spectrum; Identify the terahertz absorption spectrum of the Chinese medicinal material to be tested that has sample data in the sample set by using the decision tree recognition model, and obtain a prediction result on the type of the Chinese medicinal material according to the recognition result; Matching the detail feature points of the Chinese medicinal materials consistent with the prediction results in the detail feature point library with the detail feature points of the terahertz absorption spectrum of the Chinese medicinal materials to be tested, and determining the category of the Chinese medicinal materials to be tested according to the matching results; The detail feature point library is constructed as follows: The absorption spectra of different Chinese medicinal materials samples at different sampling frequency points in their terahertz absorption spectrum diagrams are marked to obtain the mean and variance of the absorption coefficient at each frequency point. The detail feature point library is composed of the frequency point frequency, the mean and variance of the absorption coefficient and the type label of the corresponding Chinese medicinal materials sample.

2. The method for identifying Chinese medicinal materials according to claim 1, characterized in that: The absorption coefficient is obtained by the following calculation model: Where n(w) represents the refractive index of the sample, c is the propagation speed of the terahertz wave in a vacuum, w is the angular frequency, and d is the sample thickness. is the terahertz signal without sample, that is, the phase difference between the reference signal and the sample signal, α(w) is the sample absorption coefficient, and ρ(w) is the amplitude ratio of the reference signal to the sample signal.

3. The method for identifying Chinese medicinal materials according to claim 1, characterized in that: It also includes: smoothing the terahertz absorption spectrum to obtain a smoothed absorption spectrum, and training the decision tree model through the smoothed absorption spectrum.

4. The method for identifying Chinese medicinal materials according to claim 3, characterized in that: The smoothing process is a three-point second-order smoothing using the SG smoothing algorithm.

5. The method for identifying Chinese medicinal materials according to claim 1, characterized in that: The mean and variance of the absorption coefficient at each frequency point are obtained by the following calculation model: A(i)=[m i1 ,…m ij …m iN ] (3), C(i)=[c i1 ,…c ij …c iN ] (4), in Wherein, A(i) represents the mean value of the absorption coefficient, C(i) represents the variance of the absorption coefficient, and m ij represents the mean absorption coefficient of the i-th sample at the j-th frequency point, c ij represents the variance of the absorption coefficient of the i-th sample at the j-th frequency point, p ijk represents the absorption coefficient of the kth absorption spectrum of the i-th type of medicinal material at the jth frequency point, L represents the number of absorption spectra of this type of sample, and N represents the number of frequency points on each absorption spectrum; The detailed feature point library includes {A(i), C(i)}, i=1, 2, ...B, where B represents the type label of the Chinese medicinal material sample.

6. The method for identifying Chinese medicinal materials according to claim 5, characterized in that: The matching includes: According to the prediction results of the decision tree recognition model, the corresponding Chinese medicinal material type label is found in the detail feature point library, and the absorption coefficient mean A(i) and variance C(i) of each frequency point of the predicted Chinese medicinal material, i.e., its detail feature point, are obtained; Based on the obtained absorption coefficient mean and variance, the membership degree of the terahertz absorption spectrum of the tested Chinese medicinal materials and the predicted Chinese medicinal materials is calculated as follows: where f Qj is the absorption coefficient of the jth frequency sampling point of the Chinese medicinal material to be tested, m j To predict the mean value, c j is the variance of the point; The obtained membership value is compared with the set threshold. If the membership values ​​corresponding to all detail feature points are higher than the threshold, the tested Chinese medicinal material and the predicted Chinese medicinal material are of the same type, otherwise they are of different types.

7. The method for identifying Chinese medicinal materials according to claim 6, characterized in that: The threshold is set to the value α in the confidence level 1-α.

8. The method for identifying Chinese medicinal materials according to any one of claims 1 to 7, characterized in that: The Chinese medicinal material to be tested is selected from any one of Gastrodia elata, Bletilla striata root, Codonopsis pilosula, Citrus reticulatae and Rhubarb, and the sample set is obtained based on 30 terahertz time-domain spectra of each of the five Chinese medicinal materials.

9. The method for identifying Chinese medicinal materials according to claim 8, characterized in that: The training of the decision tree model includes: using a total of 150 smoothed terahertz absorption spectra of the five Chinese medicinal materials in the 0.2-1.5THZ band as a training sample library, and randomly selecting 70% of the samples in the sample library as input of the decision tree each time for model training.