Pu'er tea year identification method based on support vector machine and spectrum fusion technology
Through the support vector machine algorithm and spectral fusion technology, combined with terahertz and Raman spectrum data, and using the zebra optimization algorithm to find model parameters, the rapid and accurate identification of Pu'er tea years is achieved, solving the identification difficulties and complex operations in the existing technology. problem, improving the recognition accuracy.
Patent Information
- Application Number
- CN202410789479.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-10
AI Technical Summary
The existing technology is difficult to quickly, accurately and conveniently identify the age of Pu'er tea, and the detection effect of a single spectrum is not good, and there are complex operations and environmental protection issues.
Using support vector machine algorithm and spectral fusion technology, combined with terahertz and Raman spectral data, the zebra optimization algorithm is used to find model parameters, and an intermediate fusion strategy is performed to enhance spectral feature information and realize the identification of Pu'er tea vintage.
It achieves rapid and accurate identification of the age of Pu'er tea, reduces detection errors, simplifies the operation process, improves the identification accuracy, and solves the problem that a single spectral feature is not obvious enough.
Smart Images

Figure CN118624558A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of terahertz and Raman spectrum detection, and specifically relates to a Pu'er tea year identification method based on a support vector machine algorithm and spectrum fusion technology. Background Art
[0002] Tea is one of the most popular beverages in the world and has a very wide audience. Pu'er tea is a unique microbial fermented tea made from sun-dried green tea produced from Yunnan Camellia. There are two main types of Pu'er tea, raw Pu'er tea and cooked Pu'er tea. The fermentation process of raw Pu'er tea is natural aging fermentation, while cooked Pu'er tea uses modern technology to accelerate fermentation. Pu'er tea is widely used in the treatment of metabolic diseases as a medicinal beverage and has attracted much attention for its cholesterol-lowering and blood lipid-lowering effects. The key indicator for evaluating Pu'er tea is aroma, and the most important factor affecting aroma is the storage year. The longer the storage year, the better the aroma quality of Pu'er tea. Due to the large difference in value between new and old Pu'er tea, there is often a phenomenon of impersonating old tea, so the detection and identification of Pu'er tea years is particularly important.
[0003] At present, the commonly used methods for analyzing tea quality are sensory evaluation or high performance liquid chromatography analysis methods, wherein the sensory evaluation method is too subjective and the results are not stable enough, while the conventional liquid chromatography method has cumbersome operation steps, consumes a large amount of chemical reagents, takes a long time to detect, and has environmental protection and other problems. Therefore, the terahertz spectroscopy technology with higher safety and sensitivity has received more and more attention. However, the tea substance information contained in a single spectrum is limited, and the spectra of some substances are not within the terahertz frequency band, resulting in poor recognition effect. Therefore, the present invention proposes an intermediate fusion strategy to fuse the two complementary spectra of terahertz spectrum and Raman spectrum, thereby enriching the spectral feature information of the substance to be tested, and by introducing the zebra optimization algorithm (Zebra Optimization Algorithm, ZOA) to optimize the parameters of the support vector machine model, find the optimal parameter combination of the model. In recent years, the data fusion strategy combined with the chemometric method has been applied to food quality analysis and achieved good results, laying a foundation for the application of this technology in tea detection and analysis.
[0004] Therefore, it is urgent to design a method for identifying the age of Pu'er tea based on support vector machine algorithm and spectral fusion technology to solve the above technical problems. Summary of the invention
[0005] The present invention aims to provide a method for identifying the age of Pu'er tea based on a support vector machine algorithm and spectral fusion technology. The present invention can accurately and quickly identify aged Pu'er tea from new Pu'er tea, solving the problem of new Pu'er tea impersonating aged Pu'er tea; the detection steps are simple and convenient, and the identification and analysis of the age of Pu'er tea can be performed without complicated operations.
[0006] The technical problem to be solved by the present invention is to quickly, accurately and conveniently identify the year of Pu'er tea. To solve the above technical problem, the present invention is implemented by the following technical solutions.
[0007] A method for identifying Pu'er tea of different years based on support vector machine and spectral fusion technology, comprising the following steps:
[0008] S1: Pu'er tea of different years is crushed, sieved and pressed to obtain round Pu'er tea samples with smooth surface. The size and thickness of each sample are controlled to reduce the detection error;
[0009] S2: Use the terahertz time-domain spectroscopy system and the Raman spectroscopy system to detect Pu'er tea samples of different years, and obtain the terahertz time-domain spectroscopy data and Raman spectroscopy data of Pu'er tea of each year respectively;
[0010] S3: The terahertz time-domain spectrum obtained in S2 is transformed into a frequency-domain signal by fast Fourier transform (FFT), and then the frequency-domain signal is calculated to obtain an absorption spectrum;
[0011] S4: Use support vector machine (SVM) to build a qualitative identification model for Pu'er tea of different years;
[0012] S5: The Zebra Optimization Algorithm (ZOA) is used to improve the support vector machine model and obtain the optimal parameter combination of the support vector machine;
[0013] S6: The terahertz absorption spectrum and Raman spectrum data are fused through the intermediate fusion strategy, and the feature data of the two spectra are spliced end to end through the feature extraction method to obtain a data set with more obvious features;
[0014] S7: Input the fused spectral data set of Pu'er tea of different years to be identified into the optimized qualitative identification model, and output the identification result.
[0015] Optionally, in the process of making the sample, the thickness of the sample is controlled by a weight method, the mass of each sample is weighed as 200 mg, and the same mold is used for tableting.
[0016] Optionally, the improvement of the support vector machine is to search for optimal values of the regularization parameter c of the support vector machine and the parameter g of the Gaussian radial basis kernel function through the zebra optimization algorithm (ZOA), and finally obtain the combination of parameters c and g that best suits the model.
[0017] Optionally, the intermediate fusion strategy first performs feature extraction on the original spectral data, extracts feature data using principal component analysis (PCA), and then fuses the feature data to obtain fused spectral data.
[0018] Optionally, the input data set is divided into a training set and a test set in a ratio of 3:2, the training set is used for model learning, and the test set is used for model judgment and identification.
[0019] Optionally, the output result of the qualitative identification model uses accuracy as an evaluation indicator of model performance.
[0020] The present invention discloses a method for identifying the age of Pu'er tea based on support vector machine and spectrum fusion technology. The method utilizes terahertz time-domain spectroscopy technology and Raman spectroscopy technology combined with data fusion strategy to qualitatively analyze the aged Pu'er tea with a relatively high price and the new Pu'er tea with a relatively large price difference, thereby identifying the Pu'er tea samples of different years. The spectral features of Pu'er tea in the terahertz band are limited. The fusion of the complementary Raman spectral data features effectively enhances the characteristic information of Pu'er tea, solving the problem that the single spectral features are not obvious enough and the model recognition accuracy is not high. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein
[0022] Figure 1 The present invention is a schematic diagram of the process of a method for identifying the age of Pu'er tea based on support vector machine and spectrum fusion technology.
[0023] Figure 2 It is the original absorption spectrum of the Pu'er tea samples of different years in the characteristic band of 0.2-1.6THz described in the present invention.
[0024] Figure 3 It is the original Raman spectrum of the Pu'er tea samples of different years in the wave number range of 0-1000 described in the present invention.
[0025] Figure 4 This is the ZOA optimization SVM parameter process when the input is terahertz spectral data described in the present invention.
[0026] Figure 5 This is the process of optimizing SVM parameters by ZOA when the input is Raman spectroscopy data as described in the present invention.
[0027] Figure 6 This is the specific process of data fusion using the intermediate fusion strategy described in the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose and advantages of the present invention more clearly understood, the specific implementation of the present invention is further described in detail below with reference to the accompanying drawings.
[0029] The implementation flow chart of the present invention is as follows: Figure 1 As shown, the specific implementation steps are as follows:
[0030] S1: Select Pu'er tea samples from different years and make experimental samples;
[0031] S2: Use the terahertz time-domain spectroscopy system and the Raman spectroscopy system to detect Pu'er tea samples of different years and obtain two types of spectral data;
[0032] S3: Calculate the terahertz time-domain spectrum obtained in S2 to obtain a terahertz absorption spectrum, and then pre-process the terahertz absorption spectrum and the Raman spectrum;
[0033] S4: Use support vector machine (SVM) to build a qualitative identification model for Pu'er tea of different years;
[0034] S5: Use the zebra optimization algorithm (ZOA) to optimize the parameters of the support vector machine model and obtain the optimal parameters;
[0035] S6: Fuse the two spectra through the intermediate fusion strategy to obtain a fused spectrum dataset;
[0036] S7: Input the fused spectral data set of Pu'er tea of different years to be identified into the optimized qualitative identification model, and output the identification result.
[0037] Specifically, in the step (1), samples are prepared by drying, crushing, sieving, grinding, weighing, and tableting Pu'er tea leaves of different years to obtain dry, smooth experimental samples with small thickness error.
[0038] Specifically, in the step (2), the sample spectrum is collected, and the terahertz time-domain spectrum is collected using a spectrum collection system consisting of a Huaxun Ark CCT-1800 terahertz spectrometer (Huaxun Ark Technology, China) and a control computer. The detection range is 0.1-4THz, the resolution reaches 20GHz, and the signal-to-noise ratio in the low frequency band can reach 75dB. The experimental environment is at room temperature, the sample chamber is filled with nitrogen, and the reference signal is obtained after the real-time spectrum signal is stable. The sample is then placed on the rack, and the sample terahertz spectrum signal is obtained after the signal is stable. The Raman spectrum is collected using a TR-785 Raman spectrometer (Huaxun Ark Technology, China). The laser excitation center wavelength of the instrument is 785±0.5nm, and the spectral resolution can reach 872.596cm -1, the output power can reach 89.6mw, and the signal-to-noise ratio is greater than or equal to 500:1. The laser needs to be preheated before detection, and then the integration time is set to 5000ms, and the output power is fixed to 80mw. After the parameter setting is completed, Raman spectrum data collection begins, and the spectrum after three averages is selected for acquisition. The sample data set is divided into training set and test set in a ratio of 3:2. For each year, 24 sets of data are used as training sets and 16 sets of data are used as test sets. The total training set is 144 sets of data and the test set is 96 sets.
[0039] Specifically, in step (3), the terahertz absorption spectrum and preprocessing method are calculated, the terahertz time domain spectrum is obtained by fast Fourier transform (FFT) to obtain the terahertz frequency domain spectrum, and the absorbance A is calculated using the absorbance formula. sam The calculation formula is as follows:
[0040]
[0041] In the formula, E sam (ω) is the spectral signal of the sample, E ref (ω) is the reference signal.
[0042] The Gaussian smoothing method was used to preprocess the terahertz absorption spectrum, and the Savitzky-Golay preprocessing method was used to preprocess the Raman spectrum. The preprocessed spectrum eliminated interference noise, greatly reducing the impact on the sample analysis results and making the data information more effective.
[0043] Specifically, in the step (4), a support vector machine model is established. The support vector machine (SVM) is a supervised classifier based on statistical learning theory, which can map the input data to a higher dimensional space, making the data linearly separable in the space, and avoiding the complex multi-dimensional calculation of the feature space by introducing the kernel function. At the same time, regularization processing is adopted to reduce the risk of overfitting of the model and make it have a strong generalization ability. In practical applications, the regularization constant c and the kernel function parameter g are important parameters that affect the performance of the model, so it is necessary to select the best combination parameters of c and g. The present invention adopts the Gaussian radial basis kernel function k(x i ,x j ) is used as the kernel function of the model, and its mathematical expression is
[0044]
[0045] where σ rate is the arrival rate of the Gaussian radial basis kernel function. The smaller the value, the narrower the kernel function.
[0046] Specifically, in step (5), the zebra optimization algorithm (ZOA) is used to optimize parameters, and the required parameters are continuously updated and searched through a two-stage strategy. The first stage is the foraging stage, which imitates the foraging behavior of zebras to search for the optimal individual, and the update formula is as follows:
[0047]
[0048] In the formula is the latest individual, x i,j is the current individual, Z P j is the optimal individual, r and I are different update coefficients, X i is the optimal individual for update.
[0049] The second stage is the defense stage, in which the new stage is updated through the zebra's defense mechanism. The formula is as follows:
[0050]
[0051] Where t is the iteration contour, T is the maximum number of iterations, R is a constant with a value of 0.01, and P s is the random selection probability, Z A j It is the state of a zebra being attacked.
[0052] Specifically, the fusion strategy in step (6) uses an intermediate fusion strategy to fuse the two spectral data. First, the terahertz absorption spectrum and the Raman spectrum are subjected to principal component analysis (PCA) dimensionality reduction to obtain the main characteristic spectral data, and then the terahertz absorption spectrum characteristic data and the Raman spectrum characteristic data are concatenated end to end to finally obtain the fusion data of the two spectra.
[0053] Specifically, the evaluation index of the model output result in step (7) uses the ratio of overall accuracy to evaluate the performance of the classification model. The higher the accuracy rate obtained, the better the corresponding model classification effect.
[0054] See also Figures 2 to 6 , the present invention provides a specific embodiment:
[0055] (1) Selection of research subjects and preparation of test samples
[0056] Pu'er tea of different years is the specific implementation object of the present invention. The production years are 2010, 2013, 2019, 2021, 2022 and 2023, all purchased from Pu'er Lancang Ancient Tea Co., Ltd. All samples are well preserved and have not been opened. The samples are dried and crushed to obtain clean and dry Pu'er tea powder. Finally, 200 mg of powder is pressed into sheets under a pressure of 12 MPa, with a sample diameter of 13 mm and a thickness of 1 mm. 40 sheets of samples of each year are prepared, and a total of 240 samples are prepared. 24 samples are taken from the training set of each year, and 16 samples are taken from the test set.
[0057] (2) Terahertz and Raman spectroscopy acquisition
[0058] All samples were collected using a terahertz time-domain spectroscopy system and a Raman spectroscopy system. The terahertz time-domain spectrum needs to be converted into a frequency-domain spectrum by fast Fourier transform (FFT) first, and then the frequency-domain spectrum is calculated into an absorption spectrum using the absorbance formula. See the spectra for the spectra. Figure 2 . Raman spectroscopy uses the original spectrum, see Figure 3 .
[0059] (3) Spectral preprocessing
[0060] The obtained terahertz absorption spectrum and Raman spectrum were both preprocessed. The interference signal was removed from the preprocessed spectrum data, and the obtained spectrum appeared smooth without spike noise peaks.
[0061] (4) Constructing the SVM model improved by ZOA
[0062] The Zebra Optimization Algorithm (ZOA) is used to search for parameters of the support vector machine. The two spectral data are respectively input as different data sets to obtain the results of the Zebra Optimization Algorithm for the optimization process of the support vector machine parameters when different inputs are obtained. Figure 4 and Figure 5 When the data set is terahertz spectral data, during the iteration process, ZOA-SVM obtains the best fitness of 98.61%, and reaches the best fitness value in the later stage of iteration. When the data set is Raman spectral data, ZOA-SVM obtains the best fitness of 96.52%, and can also reach the best fitness in the later stage of iteration.
[0063] (5) Intermediate fusion strategy to fuse spectral data
[0064] The data of the intermediate fusion layer is first reduced by PCA to obtain the characteristic information of the two spectra, and then the extracted characteristic data is fused to obtain the data set of the intermediate fusion layer. The fused spectral data is used as the final data set input. The specific steps of the intermediate fusion strategy can be found in Figure 6 .
[0065] (6) Evaluation and analysis of qualitative identification model
[0066] Table 2 shows that the classification accuracy of the training set of the primary data fusion model is 100%, while the recognition accuracy of the test set is only 94.79%. Compared with the primary data fusion strategy, the effect of the intermediate data fusion strategy is much better. The recognition accuracy of the training set of the intermediate fusion strategy is also 100%, while the recognition effect of the test set can reach 98.95%. The experimental results show that compared with the primary fusion strategy of simple splicing, the classification effect of the intermediate fusion strategy after feature extraction is better. The obtained Mid-Fusion-ZOA-SVM qualitative identification model is the most effective for the identification of Pu'er tea years. The data fusion strategy is an effective method to enhance data features.
[0067] Table 2 Comparison of the performance of the two fusion strategies for Pu'er tea year identification model
[0068]
[0069] The above is only a representative embodiment of the present invention, and this example cannot be limited to the scope of rights of the present invention. Ordinary technicians in this field should be aware that only modifications or equivalent replacements of the technical solution of the present invention do not deviate from the purpose and scope of the technical solution of the present invention and still fall within the scope covered by the present invention.
Claims
1. A method for identifying the age of Pu'er tea based on terahertz and Raman spectroscopy. It is characterized in that The following steps are involved: S1: crushing, sieving and tableting Pu'er tea leaves of different years to obtain round Pu'er tea samples with smooth surfaces; S2: Use the terahertz time-domain spectroscopy system and the Raman spectroscopy system to detect Pu'er tea samples of different years, and obtain the terahertz time-domain spectrum and Raman spectrum data sets of Pu'er tea of different years; S3: The terahertz time-domain spectrum obtained in S2 is transformed into a frequency-domain signal by fast Fourier transform (FFT), and then the frequency-domain signal is calculated to obtain the absorption spectrum; S4: Use support vector machine (SVM) to build a qualitative identification model for Pu'er tea of different years; S5: The Zebra Optimization Algorithm (ZOA) is used to improve the support vector machine model and obtain the optimal parameter combination of the support vector machine; S6: Fusing the terahertz absorption spectrum and Raman spectrum data through the intermediate fusion strategy, and obtaining the fused characteristic data of the two spectra as the data set input; S7: Input the two spectral fusion data sets of Pu'er tea of different years to be identified into the optimized qualitative identification model, and output the identification result.
2. According to claim 1, a method for identifying the age of Pu'er tea based on terahertz and Raman spectroscopy technology, It is characterized in that The circular sample obtained by pressing is detected by a terahertz time-domain spectroscopy system. After obtaining the terahertz time-domain spectroscopy data, a Raman spectrometer is used to perform spectral detection on the sample to obtain Raman spectroscopy data.
3. The improved support vector machine model according to claim 1, It is characterized in that The zebra optimization algorithm is used to optimize the regularization coefficient c and kernel function parameter g of the support vector machine to accelerate the convergence speed and establish the ZOA-SVM classification model.
4. The method of fusing two complementary spectral data according to claim 1, It is characterized in that The principal component analysis is used to extract the features of the spectral data through the intermediate fusion strategy. The characteristic data of the terahertz absorption spectrum and Raman spectrum are spliced end to end to obtain spectral data with richer information.
5. The method for identifying the age of Pu'er tea based on terahertz and Raman spectroscopy according to claim 1, It is characterized in that After fusing the terahertz absorption spectrum and Raman spectrum data through the mid-level fusion strategy, an enhanced support vector machine classification model is constructed in combination with the ZOA-SVM model, which is called Mid-Fusion-ZOA-SVM.
Citation Information
Cited By
Fluid detection system
TWI937585B
