Method for identifying aging years of dark tea
By combining three-dimensional fluorescence spectroscopy and convolutional neural networks, a multi-task learning model was constructed, which solved the problem of identifying the age of dark tea and achieved rapid and reliable identification of the aging age of dark tea, thus improving the efficiency and accuracy of identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CENT SOUTH UNIV
- Filing Date
- 2023-08-08
- Publication Date
- 2026-07-21
Smart Images

Figure CN117030668B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of tea analysis and testing, and relates to a method for identifying the aging years of dark tea. Background Technology
[0002] Dark tea is a unique tea category in my country with a long history of production and a continuously expanding consumer market. As a post-fermented tea, the components of dark tea evolve during aging due to microbial metabolism and oxidation, enhancing its flavor and health benefits. Generally, the market price of dark tea increases with aging years, and older dark teas even possess certain collectible value. Therefore, illegal activities such as passing off new tea as aged tea occur frequently. The market urgently needs a reliable and convenient method for determining the aging age of dark tea to protect the rights and interests of consumers and collectors, and to boost confidence in trading older dark teas.
[0003] Current research on techniques for identifying the aging age of dark tea is limited. While instrumental analysis methods such as gas chromatography-mass spectrometry (GC-MS) and liquid chromatography-mass spectrometry (LC-MS) are widely used to identify flavor compounds and functional components in tea, related work lacks exploration of the molecular-level effects of aging time on tea components. Electronic nose and electronic tongue sensing technologies combined with machine learning have been applied to the rapid analysis of tea quality, establishing methods for judging tea sample attributes such as variety, processing, and origin, but rarely addressing the crucial attribute of aging in post-fermented tea. Currently, expert evaluation remains the only method used in practical identification of dark tea aging. However, the scarcity of experts and other factors contribute to the difficulty in identifying the aging of dark tea, severely impacting consumer confidence in purchasing high-aged dark tea due to information asymmetry.
[0004] Three-dimensional fluorescence spectroscopy is characterized by its rich information content, fast analysis speed, and high sensitivity, making it suitable for the rapid analysis of key components or properties in food and environmental media. Existing research indicates that the three-dimensional fluorescence signal of dark tea mainly originates from inclusions such as theaflavins, chlorophyll, tryptophan-like proteins, tyrosine-like proteins, fulvic acid, and humic acid. These inclusions undergo transformation during aging, thus offering the potential for using mathematical methods to extract age identification techniques from the three-dimensional fluorescence spectra of dark tea aged at different years.
[0005] In summary, there is an urgent market demand for dark tea vintage identification technology, and its application value is high; developing dark tea vintage identification technology based on three-dimensional fluorescence spectroscopy and mathematical statistical methods is feasible. Summary of the Invention
[0006] In order to solve the above-mentioned technical problems in the background art, the present invention proposes a method for identifying the aging years of dark tea that is relatively low in cost, easy to operate, and has a fast analysis speed.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] A method for identifying the aging year of dark tea, comprising the following steps:
[0009] 1) Prepare a sample of dark tea infusion;
[0010] 2) Images of dark tea liquor samples were acquired using a three-dimensional fluorescence spectrometer and preprocessed to obtain preprocessed images;
[0011] 3) The preprocessed images are then standardized, partitioned, and augmented sequentially to obtain the black tea dataset;
[0012] 4) Construct a multi-task learning model for black tea brands and aging years. Use the black tea dataset obtained in step 3) for training to obtain a classification model for black tea brands and aging years.
[0013] 5) Based on the classification model of dark tea brands and aging years constructed in step 4), the aging years of dark tea are identified.
[0014] Preferably, step 1) is implemented as follows: weigh the black tea sample with a balance, put it into ultrapure water at 80°C, heat it in an 80°C water bath, cool it at room temperature, take out a portion of the tea soup, filter it with a nylon filter membrane to obtain the filtered soup, and dilute the filtered soup with ultrapure water to obtain the black tea soup sample.
[0015] Preferably, in step 1), the mass-to-volume ratio of the black tea sample to ultrapure water is 1:50 to 1:200; the heating time is 5 min to 15 min; the nylon filter membrane is a 0.22 μm nylon filter membrane; and the dilution factor is 5 to 20 times.
[0016] Preferably, step 2) is implemented as follows:
[0017] 2.1) The three-dimensional fluorescence spectrum of the dark tea infusion sample was measured to obtain the three-dimensional fluorescence spectrum image of the dark tea infusion sample;
[0018] 2.2) The three-dimensional fluorescence spectrum image of each black tea soup sample obtained in step 2.1) is subtracted for second-order Rayleigh scattering and internal filtering effect to obtain a preprocessed image, which is a two-dimensional matrix.
[0019] Preferably, in step 2), when measuring the three-dimensional fluorescence spectrum of the black tea liquor sample, the excitation wavelength range is 230–530 nm with a step size of 5 nm; the emission wavelength range is 244.73–827.81 nm with a step size of 2.33 nm; and the integration time is 0.5 s.
[0020] Preferably, the specific implementation of standardizing the preprocessed image in step 3) is to perform min-max normalization and Z-score normalization sequentially;
[0021] The minimum-maximum normalization is based on the formula... conduct;
[0022] in:
[0023] i and j are the row index and column index of the expanded two-dimensional matrix, respectively;
[0024] The x ij,old It is the value at index positions i and j before the normalization was performed;
[0025] The x ij,new It is the value at index i, j after this normalization;
[0026] The Z-score normalization is based on the formula... conduct;
[0027] in:
[0028] The values i and i' are the row index and column index of the expanded two-dimensional matrix, respectively.
[0029] The μ j and δ j 2 Let represent the mean and variance of variable j, respectively.
[0030] In step 3), the dataset is divided into a training set and a test set according to a 7:3 ratio after normalization.
[0031] In step 3), the data augmentation process involves increasing the size of the training set by 5 times by adding Gaussian noise.
[0032] The expression for the Gaussian noise is:
[0033] x noise = x + norm (μ = 0, σ = 0.02)
[0034] in:
[0035] x represents the standardized data value of the preprocessed image;
[0036] The norm function generates random numbers that follow a normal distribution, with an expected value μ of 0 and a standard deviation σ of 0.02.
[0037] Preferably, step 4) is implemented as follows:
[0038] 4.1) Construct a ResNet convolutional neural network model using PyTorch modules;
[0039] 4.2) Replace the last layer of the ResNet convolutional neural network model with two classifiers adapted for multi-task classification; the two classifiers correspond to the classification of black tea brands and the classification of black tea years, respectively;
[0040] 4.3) Treat each sample data in the black tea dataset obtained in step 3) as a single-channel two-dimensional matrix and import it into the ResNet convolutional neural network model for training;
[0041] 4.4) Observe the training set loss and accuracy during the training process until the loss of the ResNet convolutional neural network model stabilizes, then stop training, save the parameters of the ResNet convolutional neural network model, and obtain the classification model of black tea brand and aging year.
[0042] Preferably, in step 4.3), the batch size of the ResNet convolutional neural network model is set to 32 and the learning rate is set to 0.0001 during training.
[0043] Preferably, step 4.4) is implemented as follows: observe the training set loss and accuracy during training, optimize the ResNet convolutional neural network model using stochastic gradient descent, calculate the loss of the two classification tasks using a loss function, and then sum these losses until the loss of the ResNet convolutional neural network model stabilizes and training is stopped. Save the parameters of the ResNet convolutional neural network model to obtain the classification model of black tea brand and aging year; the loss function is the cross-entropy loss function.
[0044] Preferably, step 4.4) further includes:
[0045] 4.5) Evaluate the constructed classification model of dark tea brands and aging years; the evaluation method is to evaluate the classification effect of the model based on the confusion matrix of the test set using classification accuracy, sensitivity, specificity, precision, and F-score.
[0046] The advantages of this invention are:
[0047] This invention provides a method for identifying the aging years of dark tea. It fully utilizes the advantages of convolutional neural networks in image processing, leveraging shared feature information to construct a multi-task learning model. This method effectively distinguishes the aging years of dark tea, providing a reliable classification method for grade identification. The method is simple to operate, relatively low-cost, and highly efficient. Furthermore, the established classification model is applicable to the ever-growing dark tea dataset, providing application scenarios for tea quality control and identification. This invention uses three-dimensional fluorescence technology to obtain the fluorescence spectrum of dark tea infusion and establishes a deep learning classification model, which can obtain satisfactory prediction results for the aging years of dark tea and is applicable to the continuously expanding dark tea dataset. Attached Figure Description
[0048] Figure 1 This is a flowchart illustrating the method for identifying the aging years of dark tea according to the present invention.
[0049] Figure 2 This is a schematic diagram of the three-dimensional fluorescence spectrum of aged dark tea according to the present invention;
[0050] Figure 3 This is a schematic diagram of the Resnet network structure of the present invention;
[0051] Figure 4 This is a schematic diagram of the test set loss during the training process of this invention;
[0052] Figure 5a This is a schematic diagram illustrating the brand classification accuracy of the test set during the training process of this invention;
[0053] Figure 5b This is a schematic diagram illustrating the classification accuracy of the test set aging years during the training process of this invention;
[0054] Figure 6a This is the normalized confusion matrix for black tea brand classification in this invention;
[0055] Figure 6b This is the normalized confusion matrix for classifying the aging years of black tea according to the present invention. Detailed Implementation
[0056] Example
[0057] This invention constructs a database of dark tea containing different brands and aging years, including 32 different types of dark tea from 10 brands and 10 aging years, as detailed in Table 1.
[0058] Table 1: Information on the brands and aging years of dark tea in the dataset
[0059]
[0060]
[0061] like Figure 1 As shown, the method for identifying the aging years of dark tea based on three-dimensional fluorescence spectroscopy and convolutional neural networks specifically includes:
[0062] Step 1, Preparation of Dark Tea Infusion Samples: Ten parallel samples were weighed for each type of dark tea, totaling 320 samples. For each sample, 1.0g of dark tea was weighed using a balance and crushed into small pieces. The sample was placed in a conical flask containing 100mL of 80℃ ultrapure water and heated in an 80℃ water bath for 5 minutes. After cooling at room temperature for 5 minutes, a portion of the tea infusion was taken out and filtered through a 0.22μm nylon filter membrane. The filtered infusion was then placed in a centrifuge tube for later use. The total sample volume was 4ml. 400μL of tea infusion and 3600μL of ultrapure water were added separately using a pipette to dilute the tea infusion 10 times to reduce the internal filtration effect. After shaking well, the infusion was stored in a centrifuge tube for analysis.
[0063] Step two involves acquiring and preprocessing images of the dark tea infusion using a three-dimensional fluorescence spectrometer. Specifically, an Aqualog synchronous absorption three-dimensional fluorescence scanning spectrometer is used to measure the three-dimensional fluorescence of the sample. Before each measurement of the tea infusion sample, ultrapure water is analyzed, and a blank is subtracted during sample measurement to eliminate interference from Raman scattering. 3 mL of the sample is placed in a cuvette, and its three-dimensional fluorescence spectrum is measured. The excitation wavelength range is 230–530 nm, with a step size of 5 nm (i.e., starting from the excitation wavelength of 230 nm, with 5 nm intervals up to the excitation wavelength of 530 nm, a total of 61 excitation wavelengths); the emission wavelength range is 244.73–827.81 nm, with a step size of 2.33 nm (i.e., starting from the emission wavelength of 244.73 nm, with 2.33 nm intervals up to the emission wavelength of 827.81 nm, a total of 250 emission wavelengths). The integration time is 0.5 s. For each 3D fluorescence spectrum image, first- and second-order Rayleigh scattering and internal filtering effects are subtracted. The 3D fluorescence spectrum images obtained from black tea are shown below. Figure 2 As shown, dark tea exhibits relatively rich fluorescence information, with differences in the fluorescence region observed between different qualities of dark tea. Each sample's matrix is 61×250, resulting in a final matrix of 320×61×250 (number of samples × λ). ex ×λ em ) matrix data.
[0064] Step 3 involves standardizing, partitioning the dataset, and augmenting the preprocessed images. Specifically, the obtained data undergoes two normalization methods: min-max normalization and Z-score normalization, based on the formulas... and Let's proceed with this. Here, i and j represent the row index and column index, respectively, and μ... j and δ j 2Let represent the mean and variance of variable j, respectively. Min-max normalization maps data to the range of 0-1 for a single sample, balancing potential differences between samples due to concentration. Z-score normalization brings all index values to the same order of magnitude, allowing for comprehensive evaluation and balancing the contributions of different features. During dataset partitioning, each class is randomly divided into training and test sets in a 7:3 ratio, resulting in 224 training samples and 96 test samples. Data augmentation is performed in the PyTorch framework by adding Gaussian noise to the samples in the training set, expanding the dataset size to five times its original size to prevent overfitting. The formula for adding noise is x. noise = x + norm (μ = 0, σ = 0.02), where x represents the normalized data value, the norm function generates random numbers following a normal distribution, with an expected value μ of 0 and a standard deviation σ of 0.02. For each sample in the training set, 4 noisy samples are randomly generated, resulting in a total of 1120 samples in the training set and 96 samples in the test set.
[0065] Step four involves adjusting the convolutional neural network structure parameters to construct a multi-task learning model for black tea brands and aging years. This model is trained using a black tea dataset to obtain classification models for black tea brands and aging years. Specifically, this is achieved by constructing a model using PyTorch modules, as shown below. Figure 3The ResNet convolutional neural network model shown is modified by replacing the last layer with two classifiers adapted for multi-task classification, each outputting 10 categories. Each sample data point is treated as a single-channel two-dimensional matrix and imported into the model for 30 training epochs. The batch size is set to 32, the Adam optimizer is used, the learning rate is set to 0.0001, and the cross-entropy loss function is employed. The losses for the two classification tasks are calculated separately using the cross-entropy loss function, and then these losses are summed as the evaluation metric for the model. During training, the training set loss and accuracy are observed until the model loss no longer decreases, reaching a convergence state. The model parameters with the minimum loss are saved, resulting in the black tea classification model. Subsequently, the constructed classification models for black tea brands and aging years are evaluated. The evaluation method is based on the confusion matrix of the test set, using classification accuracy, sensitivity, specificity, precision, and F-score to assess the model's classification performance. The confusion matrix is a commonly used concept in machine learning and statistics for evaluating the performance of classification models. It is a matrix that shows the correspondence between the predicted results of the classification model and the actual labels. The rows represent the actual labeled categories, and the columns represent the categories predicted by the model. Classification performance is generally evaluated using classification accuracy, sensitivity, specificity, precision, and F-score. The four elements in the confusion matrix represent: true positives (TP), false positives (FP), true negatives (TN), and false negatives (FN). In multi-class cases, the class to be calculated is set as the positive class, and the others are set as the negative class. The calculation formula is as follows: Classification Accuracy Sensitivity Specificity Accuracy
[0066] The loss on the test set and the classification accuracy during training are as follows: Figure 4 , Figure 5a and Figure 5b As shown. The normalized confusion matrix for brand classification on the test set is as follows. Figure 6a As shown. The normalized confusion matrix for year classification on the test set is as follows. Figure 6bAs shown in the figure, the developed multi-task model achieved satisfactory prediction results for identifying the brand and aging year of each dark tea sample. On this dataset, the classification accuracy for brand identification reached 96.9%, and the classification accuracy for aging year identification reached 86.5%. Multi-task learning enhances the model's generalization performance by utilizing shared low-level features and capturing mutual information between different tasks, while optimizing the loss function for multiple tasks, thus improving the model's training efficiency and stability. This method helps alleviate problems such as overfitting and underfitting, better utilizes shared features, improves training efficiency, and ultimately achieves satisfactory performance in brand and year identification tasks.
Claims
1. A method for identifying the aging period of dark tea, characterized in that: The method for identifying the aging period of dark tea includes the following steps: 1) Prepare a sample of dark tea infusion; 2) Images of dark tea liquor samples were acquired using a three-dimensional fluorescence spectrometer and preprocessed to obtain preprocessed images; 3) The preprocessed images are then standardized, partitioned, and augmented sequentially to obtain the black tea dataset; 4) Construct a multi-task learning model for black tea brands and aging years. Use the black tea dataset obtained in step 3) for training to obtain a classification model for black tea brands and aging years. 5) Based on the classification model of dark tea brands and aging years constructed in step 4), the aging years of dark tea are identified; Step 1) includes 32 different types of dark tea from 10 brands and 10 aging years. The preparation of the dark tea infusion samples in Step 1) is as follows: 10 parallel samples of each type of dark tea were weighed, for a total of 320 samples. For each sample, 1.0 g of dark tea sample was weighed using a balance and crushed into small pieces. The samples were placed in a conical flask containing 100 mL of 80℃ ultrapure water and heated in an 80℃ water bath for 5 min. After cooling at room temperature for 5 min, a portion of the tea infusion was taken out, filtered through a 0.22 μm nylon filter membrane, and placed in a centrifuge tube for later use. The total sample volume was 4 ml. 400 µL of tea infusion and 3600 µL of ultrapure water were added separately using a pipette to dilute the tea infusion by 10 times to reduce the internal filtration effect. After shaking well, the samples were stored in centrifuge tubes for testing. In step 2), an image of the dark tea infusion was acquired using a three-dimensional fluorescence spectrometer and preprocessed. Specifically, an Aqualog synchronous absorption three-dimensional fluorescence scanning spectrometer was used to measure the three-dimensional fluorescence of the sample. Before each measurement of the tea infusion sample, ultrapure water was analyzed and a blank was subtracted during sample measurement to eliminate interference from Raman scattering. 3 mL of the sample was placed in a cuvette, and its three-dimensional fluorescence spectrum was measured. The excitation wavelength range was 230–530 nm, with a step size of 5 nm. That is, starting from the excitation wavelength of 230 nm, the step size was 5 nm, up to the excitation wavelength of 530 nm, for a total of 61 excitation wavelengths. The emission wavelength range was 244.73–827.81 nm, with a step size of 2.33 nm. That is, starting from the emission wavelength of 244.73 nm, the step size was 2.33 nm, up to the emission wavelength of 827.81 nm, for a total of 250 emission wavelengths. The integration time was 0.5 seconds. Each sample is a 61×250 matrix, resulting in a 320×61×250 matrix of data. Step 3) involves standardizing, partitioning the dataset, and augmenting the preprocessed images sequentially. Specifically, the obtained data undergoes two normalization methods: min-max normalization and Z-score normalization, respectively, according to the formulas... and Let i and j represent the row index and column index, respectively. and Let represent the mean and variance of variable j, respectively. Minimum-maximum normalization maps the data to the range of 0-1 for a single sample, balancing potential differences between samples due to concentration. Z-score normalization brings all index values to the same order of magnitude for comprehensive evaluation and analysis, balancing the contributions of each feature. During dataset partitioning, each class is randomly divided into training and test sets in a 7:3 ratio, resulting in 224 training samples and 96 test samples. Data augmentation is performed in the training set using Gaussian noise within the PyTorch framework, expanding the dataset size to five times its original size to prevent overfitting. The formula for adding noise is... , where x represents the normalized data value, the norm function generates random numbers that follow a normal distribution, the expected value μ is 0, the standard deviation σ is 0.02, and 4 noise samples are randomly generated for each training set sample. Finally, there are 1120 samples in the training set and 96 samples in the test set. Step 4) Adjust the structural parameters of the convolutional neural network to construct a multi-task learning model for black tea brands and aging years. Train the model using a black tea dataset to obtain a classification model for black tea brands and aging years. Specifically, construct a ResNet convolutional neural network model using the PyTorch module, and replace the last layer of the ResNet model with two classifiers adapted for multi-task classification. Each classifier outputs 10 categories. Treat each sample data as a single-channel two-dimensional matrix and import it into the model for 30 rounds of training. Set the batch size to 32 during model training and use Adam. The optimizer was set with a learning rate of 0.0001 and a cross-entropy loss function. The cross-entropy loss function was used to calculate the loss for each of the two classification tasks, and then these losses were summed together as an evaluation metric for the model. During training, the loss and accuracy on the training set were observed until the model loss stopped decreasing, reaching a convergence state. The model parameters with the minimum loss were saved to obtain the black tea classification model. Subsequently, the constructed classification models for black tea brands and aging years were evaluated. The evaluation method was to assess the classification performance of the model based on the confusion matrix of the test set using classification accuracy, sensitivity, specificity, precision, and F-score.