A method for classifying tea varieties using fuzzy linear machine learning

Through the fuzzy linear machine learning method, the fuzzy clustering algorithm using singular value decomposition and p-normal distance measurement, combined with multivariate scattering correction and linear discriminant analysis, the problem of noise-sensitive use of inferior and fuzzy C-mean clustering algorithms in the tea market is solved, and the rapid and accurate classification of tea varieties is achieved.

CN112801174BActive Publication Date: 2025-08-01QIANSHAN COUNTY JINMA ECOLOGICAL AGRI DEV CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110098792.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-25
Publication Date
2025-08-01
Estimated Expiration
2041-01-25

AI Technical Summary

Technical Problem

In the prior art, the tea market has serious phenomena such as inferior as good and false as real, and the fuzzy C-mean clustering algorithm is sensitive to noise data, affecting the clustering accuracy.

Method used

The fuzzy linear machine learning method is used to calculate the transformation matrix through singular value decomposition, and the identification information of the near-infrared spectrum of tea is extracted, and the fuzzy clustering algorithm based on the p-norm distance measurement is used to eliminate the influence of noise data, and the classification is combined with multivariate scattering correction and linear discriminant analysis.

Benefits of technology

It improves the accuracy of tea variety classification, solves the problem of small samples, reduces the impact of noise data on classification, and achieves rapid and accurate classification of tea varieties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112801174B_ABST
    Figure CN112801174B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for classifying tea varieties by fuzzy linear machine learning, which includes collecting near-infrared spectral data of tea samples to be classified; performing correction processing on the collected near-infrared spectral data by multiplicative scatter correction; extracting fuzzy discrimination information of tea near-infrared spectra from the processed near-infrared spectral data; establishing a fuzzy clustering objective function and constraints, and using a fuzzy clustering method based on p-norm distance measure to iteratively update the fuzzy membership values of tea, and classifying the tea according to the obtained fuzzy membership values. The classification method proposed by the present invention can solve the small sample problem of traditional fuzzy linear discriminant analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of fuzzy linear machine learning and artificial intelligence, and particularly to a method for classifying tea varieties by fuzzy linear machine learning. Background Art

[0002] China has a long history of tea culture. Chemical components such as tea polyphenols, caffeine, and soluble solids contained in tea are beneficial to physical health. At present, the tea market in China is relatively chaotic, especially in the market of famous and high-quality teas. The phenomena of passing off inferior goods as good ones and passing off fake ones as genuine ones are relatively serious, which not only damages the interests of consumers but also is not conducive to the protection of Chinese tea brands. Near-infrared spectroscopy detection technology has the characteristics of being fast and non-destructive. Therefore, it is necessary to use near-infrared spectroscopy technology to classify tea quickly and accurately. Based on the advantage that linear machine learning can classify and sort a large amount of spectral information and simplify the information, near-infrared spectroscopy detection technology is used to classify tea on the basis of linear machine learning. At the same time, this technology can also be applied to other crops, which has great research significance and value.

[0003] Near-infrared spectroscopy is an electromagnetic wave between visible light and mid-infrared light, and the spectral region has a wavelength between 750 and 2500 nm. Near-infrared spectroscopy is the overtone and combination spectral band of molecular vibration spectroscopy, mainly referring to the absorption of hydrogen-containing groups, which contains rich information on the composition and molecular structure of the vast majority of organic substances. At the same time, it has the advantages of being non-destructive, low-cost, and fast in detection speed. Therefore, it is widely used as a detection technology in the field of agricultural and sideline product detection. According to the fact that different varieties of tea have different near-infrared spectra, it provides the possibility for tea classification.

[0004] Fuzzy linear discriminant analysis (FLDA) projects high-dimensional space samples onto a low-dimensional space on the basis of fuzzy sets, so that the samples are classified according to the rule of the minimum within-class distance and the maximum between-class distance, and can effectively extract the discriminant information of the samples.

[0005] Clustering algorithms are divided into two categories. The first category of algorithms is hard clustering algorithms such as the k-means clustering algorithm, etc., which divide a data set into different classes, and each sample belongs to only one class. The second category is fuzzy clustering algorithms, which allow a sample to belong to multiple classes, and use fuzzy membership degrees to measure the degree to which a sample belongs to a certain class. The fuzzy C-means clustering algorithm (FCM) is a fuzzy clustering algorithm based on the minimum square error criterion, which makes the sum of the fuzzy membership degrees of a certain sample in all classes equal to 1, effectively avoiding the solution with all membership degrees being 0. However, since FCM is sensitive to noise data, inaccurate membership degrees will affect the position of the clustering center and thus affect the value of the fuzzy membership degree, reducing the clustering accuracy. Summary of the Invention

[0006] In order to address the shortcomings of the existing technology, the present invention proposes a tea variety classification method based on fuzzy linear machine learning. The transformation matrix is calculated by singular value decomposition and other calculation methods to extract the identification information of the tea near-infrared spectrum. Then, a fuzzy clustering algorithm based on the p-norm distance measure is used to cluster noise data so that the noise data has a very small membership value to eliminate the influence of noise data on clustering.

[0007] The technical solutions adopted in the present invention are as follows:

[0008] A tea variety classification method based on fuzzy linear machine learning comprises the following steps:

[0009] S1, collects near-infrared spectral data of tea samples to be classified;

[0010] S2, using multivariate scatter correction (MSC) to correct the collected near-infrared spectral data;

[0011] S3, extracting tea near-infrared spectrum fuzzy identification information from the near-infrared spectrum data processed by S2;

[0012] S4, establishing the fuzzy clustering objective function and constraint conditions, adopting the fuzzy clustering method based on the p-norm distance measure to iteratively update the fuzzy membership value of the tea leaves, and classifying the tea leaves according to the obtained fuzzy membership values.

[0013] Furthermore, the method for extracting the fuzzy identification information of tea near-infrared spectrum is as follows:

[0014] S3.1, initialization parameters: the number of training samples is n1, the number of test samples is n2, the weight index is m, and the number of categories is c;

[0015] S3.2, calculate the fuzzy membership μ of the kth training sample belonging to the i-th category ik ;

[0016] S3.3, a fuzzy membership μ ik Calculate the fuzzy inter-class dispersion matrix S fB and the fuzzy intra-class discreteness matrix S fW ; The fuzzy inter-class discreteness matrix S fB and the fuzzy intra-class discreteness matrix S fW The sum is subjected to singular value decomposition to obtain the characteristic matrix U;

[0017] S3.4, based on the characteristic matrix U, calculate the optimized transformation matrix G;

[0018] S3.5, use the transformation matrix G to analyze the t-th test sample And the k-th training sample is transformed to obtain and y k ;

[0019] S3.6. Use linear discriminant analysis to transform the test sample and the test sample y k into the test sample and z k .

[0020] Furthermore, the between-class scatter matrix S fB and the within-class scatter matrix S fW are expressed as:

[0021]

[0022]

[0023] where is the fuzzy membership degree that the k-th training sample with a weight index of m belongs to the i-th class; is the mean of the near-infrared spectral data collected from all training samples, x k is the near-infrared spectral data collected from the k-th training sample; v i refers to the mean of the near-infrared spectral data of the i-th class of tea leaves in the training samples, i = 1, 2,..., c.

[0024] Furthermore, the optimized transformation matrix G is expressed as:

[0025] G = UQM

[0026] where Q represents the matrix obtained by performing eigen-decomposition on the matrix , which is composed of the eigenvectors corresponding to the non-zero eigenvalues; M represents the matrix composed of the eigenvectors corresponding to the non-zero eigenvalues obtained by performing eigen-decomposition on ; and

[0027] Furthermore, in S3.5 and y k are respectively expressed as: y k = x k G, where is the sample data to be classified after transformation based on the matrix G; y k is the training sample data after transformation based on the matrix G.

[0028] Furthermore, the fuzzy clustering objective function is expressed as:

[0029]

[0030] where J(μ it , vi ) is the objective function, at the weight exponent m f the t-th test sample z t under the fuzzy membership degree belonging to the i-th (1 ≤ i ≤ c) class; η i is the parameter value of the i-th class, μ it is the t-th test sample the fuzzy membership degree belonging to the i-th class, γ i is the class center of the i-th class, the weight exponent m f .

[0031] Furthermore, the constraint condition is expressed as: the exponent p > 1.

[0032] Furthermore, set the number of iterations, and calculate the fuzzy membership degree value μ it and the class center γ i respectively according to the fuzzy clustering objective function and the constraint condition; among them, the fuzzy membership degree is expressed as:

[0033]

[0034] The class center is expressed as:

[0035]

[0036] The parameter value η of the i-th class i is calculated as follows:

[0037]

[0038] Among them, the fuzzy membership degree value of the t-th test sample belonging to the i-th class obtained after running the fuzzy C-means clustering (FCM) at the weight exponent m i,FCM and v is the class center obtained after running the FCM.

[0039] Furthermore, use a Fourier near-infrared spectrometer to detect the tea samples and obtain the near-infrared diffuse reflection spectral data of the tea samples.

[0040] Furthermore, each sample is sampled 3 times, and the average value of the 3 times is used as the data of the subsequent experimental samples.

[0041] The beneficial effects of the present invention:

[0042] The classification method designed by the present invention can solve the small sample problem of traditional fuzzy linear discriminant analysis. By designing a fuzzy linear machine learning-based tea variety classification method, a transformation matrix is calculated through calculation methods such as singular value decomposition to extract the discrimination information of the near-infrared spectrum of tea. Then, a fuzzy clustering algorithm based on the p-norm distance measure is adopted to cluster and contain noisy data, making the noisy data have a very small membership value to eliminate the influence of noisy data on clustering.

[0043] In addition, the method of the present invention extracts the discrimination information of the near-infrared spectrum of tea through a fuzzy discrimination information extraction method, and at the same time transforms the data space. Brief Description of the Drawings

[0044] Figure 1 is the flowchart of the present invention;

[0045] Figure 2 is the near-infrared spectrum diagram of tea;

[0046] Figure 3 is the near-infrared spectrum diagram of tea after multivariate scatter correction;

[0047] Figure 4 is the initial fuzzy membership diagram;

[0048] Figure 5 is the fuzzy membership diagram after iterative convergence;

[0049] Figure 6 is the distribution diagram of test samples with class centers. Detailed Embodiment

[0050] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0051] As Figure 1 shown, a tea variety classification method based on fuzzy linear machine learning includes the following steps:

[0052] S1, collecting near-infrared spectrum data of tea samples to be classified: using a Fourier near-infrared spectrometer to detect tea samples, obtaining near-infrared diffuse reflection spectrum data of tea samples, and storing the spectrum data in a computer.

[0053] Collect three kinds of tea leaves, namely Yuexi Cuilan, Lu'an Guapian, and Shiji Maofeng. 65 samples are extracted from each kind of tea leaf, and a total of 195 samples are collected. After all the tea leaves are ground and crushed, they are filtered through a 40-mesh sieve. In each variety of tea leaves, 5 g is randomly weighed as a sample, and the temperature and relative humidity in the laboratory are kept constant. The Antaris II type FT-NIR spectrometer is turned on and preheated for 1 hour. The near-infrared spectra of the tea leaves are collected in the reflectance integrating sphere mode, and each tea leaf sample is scanned 32 times. The spectral wavelength range is 4000~10000 cm -1 , and the scanned spectral wave number interval is 3.587 cm -1 . The dimensionality of the collected tea leaf spectral data is 1557 dimensions. Each sample is sampled 3 times, and the average value of the 3 times is used as the data of the subsequent experimental sample. The FT-NIR diagrams of the 3 kinds of tea leaf samples collected at the sampling site are as shown in Figure 2 .

[0054] S2. Use multiplicative scatter correction (MSC) to correct the collected near-infrared spectral data; the FT-NIR diagram of the corrected tea leaf sample is as shown in Figure 3 .

[0055] Divide the corrected near-infrared spectral data into two parts. The near-infrared spectral data of 43 samples extracted from each kind of tea leaf form the tea leaf sample training set, and the total number of near-infrared spectral data in the tea leaf sample training set is n1 = 3 * 43 = 129; the near-infrared spectral data of the remaining 22 samples extracted from each kind of tea leaf form the tea leaf sample test set, and the total number of near-infrared spectral data in the tea leaf sample test set is n2 = 3 * 22 = 66.

[0056] S3. Extract the fuzzy discrimination information of the tea leaf near-infrared spectrum. The specific steps are as follows:

[0057] S3.1. Initialization: The number of training samples is n1, the number of test samples is n2, the weight index is m, and the number of categories is c; in this embodiment, m = 2 and c = 3.

[0058] S3.2. Calculate the fuzzy membership degree μ of the kth training sample belonging to the ith (1 ≤ i ≤ c) class ik :

[0059]

[0060] Among them, v i refers to the mean value of the near-infrared spectral data of the ith class of tea leaves in the training samples, i = 1, 2,..., c; v j is the mean value of the near-infrared spectral data of the jth class of tea leaves in the training samples, j = 1, 2,..., c; x k is the near-infrared spectral data of the kth tea leaf in the training samples, k = 1, 2,..., n1. Based on the above formula, the initial fuzzy membership degree is as shown inFigure 4 as shown

[0061] S3.3. Calculate the fuzzy between-class scatter matrix S fB and the fuzzy within-class scatter matrix S fW :

[0062]

[0063]

[0064] where is the fuzzy membership degree that the k-th training sample with weight exponent m belongs to the i-th (1 ≤ i ≤ c) class; is the mean of the near-infrared spectral data collected from all training samples, x k is the near-infrared spectral data collected from the k-th training sample;

[0065] Based on the fuzzy between-class scatter matrix S fB and the fuzzy within-class scatter matrix S fW calculate respectively

[0066]

[0067]

[0068] where is the newly transformed matrix; U is the eigenmatrix composed of the eigenvectors corresponding to the non-zero eigenvalues obtained by performing singular value decomposition on the sum of the fuzzy between-class scatter matrix and the fuzzy within-class scatter matrix.

[0069] S3.4. Based on the U obtained in S3.3, calculate the optimized transformation matrix G:

[0070] G = UQM

[0071] where Q represents the matrix obtained by performing eigen decomposition on the matrix and is composed of the eigenvectors corresponding to the non-zero eigenvalues. M represents the matrix composed of the eigenvectors corresponding to the non-zero eigenvalues obtained by performing eigen decomposition on

[0072] S3.5. Respectively perform the following transformations on the t-th (t = 1, 2,..., n2) test sample and the k-th training sample to obtain and y k :

[0073]

[0074] y k ​= x k G

[0075] wherein, is the sample data to be classified after transformation based on matrix G; y k is the training sample data after transformation based on matrix G;

[0076] S3.6. Use linear discriminant analysis (LDA) to separately transform the test sample and the test sample y k into the test sample and z k .

[0077] S4. Adopt a fuzzy clustering method based on the p-norm distance measure to classify the test sample z in S3.6 t as follows:

[0078] S4.1. Establish a fuzzy clustering objective function:

[0079]

[0080] wherein, J(μ it , v i ) is the objective function, is the fuzzy membership degree of the t-th test sample z f belonging to the i-th class (1 ≤ i ≤ c) under the weight exponent m t ; η i is the parameter value of the i-th class, μ it is the fuzzy membership degree of the t-th test sample belonging to the i-th class, and γ i is the class center of the i-th class. The weight exponent m f , here m f = 1.6.

[0081] Constraint condition: The exponent p > 1.

[0082] wherein, μ it is the fuzzy membership degree value of the t-th test sample belonging to the i-th class.

[0083] The parameter value η i of the i-th class is calculated as follows:

[0084]

[0085] wherein, is the fuzzy membership degree value of the t-th test sample belonging to the i-th class and v obtained after running fuzzy C-means clustering (FCM) under the weight exponent mi,FCM It is the class center obtained after running FCM. The number of iterations is 100 times.

[0086] S4.2. Calculate the fuzzy membership values μ it and the class center γ i .

[0087] Fuzzy membership:

[0088]

[0089] Class center:

[0090]

[0091] When the number of iterations is 100 times, classify the near-infrared spectra of tea leaves according to the calculated fuzzy membership values. The class centers of the samples of the three types of tea are Figure 6 the positions of the three larger labels in

[0092] The fuzzy membership values based on the p-norm distance measure are Figure 5 , and the classification of the test sample data is as Figure 6 .

[0093] The above embodiments are only used to illustrate the design concept and characteristics of the present invention, and the purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made according to the principles and design concepts disclosed by the present invention are within the protection scope of the present invention.

[0094] The above embodiments are only used to illustrate the design concept and characteristics of the present invention, and the purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made according to the principles and design concepts disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A method for classifying tea varieties by fuzzy linear machine learning, characterized in that, Including the following steps: S1. Collect the near-infrared spectral data of the tea samples to be classified; S2. Perform correction processing on the collected near-infrared spectral data using multiplicative scatter correction; S3. Extract the fuzzy discrimination information of the tea near-infrared spectrum from the near-infrared spectral data processed in S2. The method for extracting the fuzzy discrimination information of the tea near-infrared spectrum is as follows: S3.

1. Initialize the parameters: the number of training samples is n1, the number of test samples is n2, the weight exponent is m, and the number of categories is c; S3.2, calculate the fuzzy membership degree μ of the k-th training sample belonging to the i-th class ik ; S3.3, based on the fuzzy membership degree μ ik Calculate the fuzzy between-class scatter matrix S fB and the fuzzy within-class scatter matrix S fW ; Perform singular value decomposition on the sum of the fuzzy between-class scatter matrix S fB and the fuzzy within-class scatter matrix S fW to obtain the eigenmatrix U; S3.

4. Calculate the optimized transformation matrix G based on the feature matrix U; S3.5, use the transformation matrix G to transform the t-th test sample and the k-th training sample respectively to obtain and y k ; S3.6, Use linear discriminant analysis to separately transform the test samples and the training samples y k into the test samples and z k ; S4. Establish the fuzzy clustering objective function and constraint conditions. The fuzzy clustering objective function is expressed as: Among them, J(μ it , v i ) is the objective function, is the fuzzy membership degree of the t-th test sample z f belonging to the i-th class under the weight exponent m t , where 1 ≤ i ≤ c; η i is the parameter value of the i-th class, μ it is the fuzzy membership degree of the t-th test sample belonging to the i-th class, γ i is the class center of the i-th class, and the weight exponent m f ; The constraint condition is expressed as: 0 ≤ μ it ≤ 1, 1 < c < n2, and the exponent p > 1; Calculate the fuzzy membership value μ and the class center γ respectively according to the fuzzy clustering objective function and constraints; among them, the fuzzy membership is expressed as: it and the class center γ i ; where the fuzzy membership is expressed as: The class center is represented as: Adopt a fuzzy clustering method based on the p-norm distance measure to iteratively update the fuzzy membership values of the tea, and classify the tea according to the obtained fuzzy membership values.

2. The tea variety classification method of fuzzy linear machine learning according to claim 1, characterized in that The fuzzy between-class scatter matrix S fB and the fuzzy within-class scatter matrix S fW are expressed as: wherein, is the fuzzy membership degree that the k-th training sample with a weight index of m belongs to the i-th class; is the mean value of the near-infrared spectral data collected from all training samples, x k is the near-infrared spectral data collected from the k-th training sample; v i refers to the mean value of the near-infrared spectral data of the i-th type of tea in the training samples, where i = 1, 2,..., c.

3. The method for classifying tea varieties by fuzzy linear machine learning according to claim 2, characterized in that The optimized transformation matrix G is expressed as: G = UQM where Q represents the matrix obtained by performing eigen - decomposition on the matrix , which is composed of the eigen - vectors corresponding to non - zero eigenvalues; M represents the matrix composed of the eigen - vectors corresponding to the non - zero eigenvalues obtained by performing eigen - decomposition on ; and 4. A method for classifying tea varieties by fuzzy linear machine learning according to claim 3, characterized in that, In S3.5 and y k are respectively expressed as: y k = x k G, where is the sample data to be classified after transformation based on matrix G; y k is the training sample data after transformation based on matrix G.

5. A method for classifying tea varieties by fuzzy linear machine learning according to any one of claims 1-4, characterized in that, Use a Fourier near-infrared spectrometer to detect the tea samples and obtain the near-infrared diffuse reflection spectral data of the tea samples.

6. The tea variety classification method of fuzzy linear machine learning according to claim 5, characterized in that, Each sample is sampled 3 times, and the average value of the 3 times is used as the data of the subsequent experimental samples.

Citation Information

Patent Citations

  • Tea near-infrared spectrum classification method for fuzzy identification information extraction

    CN110378374A