Tea form classification and grading method based on deep convolutional network

By applying deep convolutional neural networks and multi-task learning frameworks in tea classification and grading, combined with multi-scale feature fusion technology, the deficiencies of traditional methods in processing the complexity and diversity of tea morphological features are solved, and high-precision, high-performance Efficient and highly automated tea classification and grading effects.

CN119339160AInactive Publication Date: 2025-01-21PINGLI NUWA CUIFENG TEA CO LTD
0 Cites 2 Cited by

Patent Information

Application Number
CN202411785065.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-01-21
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure CN119339160A_ABST
    Figure CN119339160A_ABST
Patent Text Reader

Abstract

The invention discloses a tea form classification and grading method based on a deep convolutional network, and the method comprises the following steps: S1, collecting image data of tea, and carrying out the preprocessing of the image data; s2, segmenting the preprocessed image data into local areas by using an image segmentation technology; s3, inputting the segmented image data into a deep convolutional neural network model to form a bottom layer sharing feature; s4, performing primary screening on the bottom-layer shared features through a preliminary feature selection module; s5, introducing a feature selection module, and carrying out the secondary screening of the bottom-layer shared features after the primary screening based on a sparse adaptive gating mechanism technology; s6, fusing the underlying shared features after secondary screening; s7, adopting a multi-task learning framework which comprises a classification task output layer and a grading task output layer; and S8, outputting a tea classification result and a quality grading result. Through the deep convolutional network and multi-task learning, tea form classification and grading are realized, and the method has the advantages of high precision and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and machine learning, and in particular to a tea morphology classification and grading method based on a deep convolutional network. Background Art

[0002] As one of the most popular beverages in the world, tea has a long history and a wide consumer market. The quality assessment of tea plays an important role in the entire tea production process, directly affecting consumers' purchasing decisions and the brand reputation of manufacturers. At present, the classification and grading of tea mainly rely on experienced tea experts to observe the appearance characteristics of tea by naked eyes. This traditional manual evaluation method has many shortcomings. It is not only time-consuming and labor-intensive, but also limited by the subjective judgment of experts, which easily leads to inconsistency in the evaluation criteria, thus affecting the fairness and accuracy of tea grading.

[0003] In the existing technology, computer vision technology has been gradually introduced into the process of tea quality inspection, and the color, shape, size and other appearance characteristics of tea leaves are automatically analyzed through digital image processing. However, the existing computer vision system mainly focuses on simple image processing and feature extraction, and cannot effectively deal with the complexity and diversity of tea morphological characteristics. Especially when faced with different types of tea leaves and tea leaves at different growth stages, the existing technical means have great limitations in accuracy and robustness.

[0004] Existing tea quality detection systems usually rely on traditional machine learning algorithms, which usually use hand-crafted features for classification and grading, such as color histograms, texture analysis, shape descriptors, etc. However, these hand-crafted features have limited expressive power and cannot fully capture the multi-scale characteristics and complex local details of tea morphology. In addition, traditional machine learning algorithms usually treat tea classification and grading as independent tasks and train different models separately, which not only increases the complexity of the calculation, but also may cause mutual interference between models, thereby reducing the performance of the overall system.

[0005] In order to improve the accuracy of tea classification and grading, deep learning technology, especially deep convolutional neural network (DCNN), has gradually been applied to the field of tea image analysis. Deep convolutional neural network can automatically learn multi-level feature representation from images and has powerful feature extraction capabilities. However, there are still some problems with the existing tea classification and grading methods based on DCNN. First, when processing tea images, the existing methods usually only focus on global features or features of a fixed scale, while ignoring the rich multi-scale information in tea images. Secondly, most existing methods do not fully consider the correlation between tea classification and grading tasks, resulting in low efficiency of feature extraction and model training. In addition, existing deep learning models usually require a large amount of labeled data for training, while in practical applications, the acquisition and labeling costs of tea image data are high, which limits the widespread application of the model.

[0006] Therefore, how to provide a tea morphology classification and grading method based on deep convolutional networks is an urgent problem that technicians in this field need to solve. Summary of the invention

[0007] One purpose of the present invention is to propose a tea morphology classification and grading method based on a deep convolutional network. The present invention adopts a deep convolutional neural network, a multi-task learning framework and a multi-scale feature fusion technology to achieve accurate classification and quality grading of tea morphology. Through innovative feature selection and adaptive gating mechanisms, the feature extraction process is optimized to ensure the efficiency and robustness of the model. This method not only improves the accuracy and consistency of tea classification and grading, but also significantly improves the level of automation, reduces dependence on manual intervention, and has the significant advantages of high precision, high efficiency and strong automation, which helps to promote the intelligent development of tea production and quality inspection.

[0008] A tea morphology classification and grading method based on a deep convolutional network according to an embodiment of the present invention comprises the following steps:

[0009] S1, collecting image data of tea leaves and preprocessing the image data;

[0010] S2, using image segmentation technology to segment the pre-processed image data into local areas, wherein the local areas include leaf areas and stem areas;

[0011] S3, input the segmented image data into a deep convolutional neural network model to extract the global and local morphological features of the tea leaves to form underlying shared features;

[0012] S4, screening the underlying shared features once through the preliminary feature selection module;

[0013] S5. Introduce a feature selection module to perform a secondary screening on the underlying shared features after the primary screening based on the sparse adaptive gating mechanism technology, and dynamically adjust the weight of feature selection;

[0014] S6. Use multi-scale feature extraction and fusion technology to fuse the underlying shared features after secondary screening;

[0015] S7, based on the fused underlying shared features, a multi-task learning framework is adopted, including two output layers: a classification task output layer and a grading task output layer;

[0016] S8. Output tea classification and quality grading results through the deep convolutional neural network model.

[0017] Optionally, the preprocessing specifically includes image cropping, grayscale conversion, denoising and scale normalization.

[0018] Optionally, the S3 specifically includes:

[0019] S31, inputting the image data segmented in S2 into the input layer of the deep convolutional neural network model, wherein the input layer receives the tea image data including the leaf area and the stem area, and performs preliminary feature mapping;

[0020] S32. Feature extraction is performed on the input image data through the convolution layer. Each convolution layer performs a two-dimensional convolution operation. The convolution kernel size is k×k, where k represents the size of the convolution kernel:

[0021]

[0022] in, represents the eigenvalue at position (i, j) after the lth layer of convolution, σ represents the activation function, represents the weight matrix of the l-th layer convolution kernel at position (m,n), represents the pixel value of the input feature value at position (i+m-1,j+n-1) in the previous layer l-1, b (l) represents the bias term of the lth layer;

[0023] S33. After each convolutional layer, a pooling layer is applied to downsample the feature map. The pooling layer adopts the maximum pooling technique, and the pooling kernel size is p×p:

[0024]

[0025] in, represents the feature value at position (i, j) of the lth layer after the pooling operation, p represents the size of the pooling kernel, and max represents the operation of taking the maximum value within the pooling window. Represents the eigenvalue at position (i+m-1,j+n-1) after the lth layer of convolution;

[0026] S34, after stacking operations of multiple convolutional layers and pooling layers, a multidimensional feature map containing global and local morphological features is obtained, wherein the feature map contains multiple channels, and each channel corresponds to a feature map;

[0027] S35, input the obtained multi-dimensional feature map into the fully connected layer of the deep convolutional network, and the fully connected layer integrates the features of all channels and flattens the multi-dimensional feature map into a one-dimensional feature vector F = {f1, f2, ..., f n}, where f i represents the i-th eigenvalue in the eigenvector, and n represents the dimension of the eigenvector;

[0028] S36, through the fully connected layer, the one-dimensional feature vector F is reduced in dimension and features are combined to generate the underlying shared feature S:

[0029] S=φ(W s ·F+b s );

[0030] Among them, φ represents the activation function of the fully connected layer, W s represents the weight matrix of the fully connected layer, b s Represents the bias vector of the fully connected layer.

[0031] Optionally, the S4 specifically includes:

[0032] S41, input the underlying shared features S generated in S36 into the preliminary feature selection module, and select each feature S i Calculate information entropy H i and mutual information entropy I i :

[0033]

[0034] Among them, C represents the total number of categories of classification results, p ij Representation feature S i The probability of contribution to the jth category;

[0035]

[0036] Where N represents the total number of features, p ik Representation feature S i The probability of contribution to the kth category;

[0037] S42. Information entropy H i and mutual information entropy I i Perform joint normalization processing to obtain the information entropy after joint normalization And the normalized mutual information entropy

[0038] S43, combined with normalized information entropy And the normalized mutual information entropy Define the comprehensive contribution of each feature Γ i :

[0039]

[0040] Among them, α and β represent adjustment coefficients;

[0041] S44, based on the comprehensive contribution Γ i Sort all features and select the comprehensive contribution Γ i The features greater than the preset threshold τ are taken as the results of the preliminary screening, and the screened feature set is recorded as Where m represents the number of features after preliminary screening, and m≤n;

[0042] S45. Calculate the overall comprehensive contribution of the feature set Γ total :

[0043]

[0044] S46, if Γ total If the preset standard is reached, the output If the standard is not met, the threshold τ or the adjustment coefficients α and β are adjusted for re-screening.

[0045] Optionally, the S5 specifically includes:

[0046] S51, the underlying shared features S after the first screening of S46 * Input to the feature selection module, for each feature Perform feature complexity evaluation and calculate feature complexity coefficient γ i :

[0047]

[0048] Among them, γ i Representation characteristics The complexity coefficient of M represents the total number of features. Representation characteristics With features The absolute value of the difference between ij Representation characteristics With features The distance measure between them, α1 and β1 represent exponential adjustment parameters, controlling the weights of differences and distances, and ∈ represents a small constant to prevent division by zero errors;

[0049] S52, according to the characteristic complexity coefficient γ i , construct a sparse adaptive gating function g i (S * ), calculate the features The gate weight w i :

[0050]

[0051] Among them, β2 represents the adjustment parameter for controlling sparsity, δ represents the adjustment parameter for controlling the influence of feature similarity, and γ i represents the complexity coefficient of the i-th feature, Representation characteristics The norm of Representation characteristics The norm of Representation characteristics The norm of , m represents the number of features after preliminary screening;

[0052] S53, weight w calculated by sparse adaptive gating function i The features are weighted to obtain the feature S′ after secondary screening i :

[0053]

[0054] Among them, tanh represents the hyperbolic tangent function;

[0055] S54, for all the features after secondary screening S′={S′1,S′2,…,S′ m} is standardized to obtain the standardized feature S′ norm .

[0056] Optionally, the S6 specifically includes:

[0057] S61, S' of the features after secondary screening and standardization in step S54 norm Input to the multi-scale feature extraction module, for each feature S′ i,norm Perform multi-scale transformation to generate feature representations of different scales

[0058]

[0059] Among them, r k represents the number of filters used at the kth scale, α s Representation filter The weight coefficient of Represents the standardized feature S′ i,norm and filter The bivariate nonlinear mapping function is used to generate multi-scale features, λ3 represents the adjustment parameter for controlling the distribution of multi-scale features, and ∈1 represents a small constant;

[0060] S62. For each feature S′ i,norm Feature representations generated at multiple scales Adaptive fusion is performed, and the fused multi-scale feature F is obtained by weighted summation based on information entropy and similarity. i :

[0061]

[0062] Among them, K represents the total number of scales, represents the entropy value of the feature representation at the kth scale, represents the entropy value of feature representation at the lth scale, represents the inner product of the feature representation of the kth scale and the k-1th scale, represents the norm of the k-th scale feature representation, represents the norm of the k-1th scale feature representation, ν k represents the weight coefficient of the kth scale, μ k represents the weighting coefficient based on similarity;

[0063] S63, the fused multi-scale features F i Perform nonlinear transformation and use piecewise adaptive activation function to obtain the activated multi-scale feature A i :

[0064]

[0065] Among them, ξ i represents the tuning parameter that controls the transformation of positive-valued features, represents the adjustment parameter that controls the transformation of negative features;

[0066] S64, after activation, the multi-scale feature A i Perform normalization to obtain the normalized multi-scale feature A i,norm .

[0067] Optionally, the S7 specifically includes:

[0068] S71, the fused and normalized multi-scale feature A i,norm Input into the multi-task learning framework, input into the classification task branch and the grading task branch;

[0069] S72, in the classification task branch, generating a classification feature representation C, and inputting the classification feature representation C into the classification task output layer;

[0070] S73, in the classification task branch, generating a classification feature representation G, and inputting the classification feature representation G into the classification task output layer;

[0071] S74, generate classification result P c :

[0072]

[0073] Among them, α c represents the adjustment parameter, C i The i-th element represents the classification feature, n c Indicates the number of categories of the classification task, C j Represents the jth element of the classification feature, n g Indicates the number of levels of the hierarchical task, ∑ k C k represents the sum of all classification features C, θ c represents a specific threshold for the classification task;

[0074] S75, generate classification result P g :

[0075]

[0076] Among them, β g represents the adjustment parameter, G i represents the i-th element of the hierarchical feature, G j represents the jth element of the hierarchical feature, Σ k G k represents the sum of all hierarchical features G, θ g Indicates specific thresholds for grading tasks;

[0077] S76. According to the classification result P c And the classification result P g Complete the task of tea classification and grading.

[0078] The beneficial effects of the present invention are:

[0079] First, the application of image segmentation technology enables the model to perform a more detailed analysis of the leaf and stem areas of tea leaves, improving the accuracy of feature extraction. Secondly, the deep convolutional neural network model automatically learns and extracts the global and local features of tea images through multi-layer convolution and pooling operations, generating underlying shared features with high expressiveness. These features are secondary screened and optimized through the preliminary feature selection module and sparse adaptive gating mechanism, ensuring that only the most discriminative features are retained, thereby further improving the classification and grading effects of the model. In addition, the introduction of multi-scale feature extraction and fusion technology enables the model to capture both global and detailed information of tea images, effectively dealing with the subtle differences in morphology of different types of tea.

[0080] Finally, the present invention adopts a multi-task learning framework to combine the classification and grading tasks of tea in a unified model for processing. By sharing the underlying features, this framework not only improves the training efficiency of the model, but also enhances the generalization ability of the model, so that the classification and grading tasks can promote each other, further improving the performance of the overall model. This integrated approach not only reduces the dependence on large-scale labeled data, but also effectively improves the consistency and reliability of tea classification and grading results. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0082] Figure 1 A flowchart of a tea morphology classification and grading method based on a deep convolutional network proposed in the present invention;

[0083] Figure 2 A schematic diagram of the underlying shared feature generation structure of a tea morphology classification and grading method based on a deep convolutional network proposed in the present invention;

[0084] Figure 3 Schematic diagram of a multi-task learning framework for a tea morphology classification and grading method based on a deep convolutional network proposed in the present invention. DETAILED DESCRIPTION

[0085] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0086] refer to Figure 1-3 , a tea morphology classification and grading method based on deep convolutional network, comprising the following steps:

[0087] S1, collecting image data of tea leaves and preprocessing the image data;

[0088] S2, using image segmentation technology to segment the pre-processed image data into local areas, wherein the local areas include leaf areas and stem areas;

[0089] S3, input the segmented image data into a deep convolutional neural network model to extract the global and local morphological features of the tea leaves to form underlying shared features;

[0090] S4, screening the underlying shared features once through the preliminary feature selection module;

[0091] S5. Introduce a feature selection module to perform a secondary screening on the underlying shared features after the primary screening based on the sparse adaptive gating mechanism technology, and dynamically adjust the weight of feature selection;

[0092] S6. Use multi-scale feature extraction and fusion technology to fuse the underlying shared features after secondary screening;

[0093] S7, based on the fused underlying shared features, a multi-task learning framework is adopted, including two output layers: a classification task output layer and a grading task output layer;

[0094] S8. Output tea classification and quality grading results through the deep convolutional neural network model.

[0095] In this implementation, the preprocessing specifically includes image cropping, grayscale conversion, denoising and scale normalization.

[0096] In this implementation, S3 specifically includes:

[0097] S31, inputting the image data segmented in S2 into the input layer of the deep convolutional neural network model, wherein the input layer receives the tea image data including the leaf area and the stem area, and performs preliminary feature mapping;

[0098] S32. Feature extraction is performed on the input image data through the convolution layer. Each convolution layer performs a two-dimensional convolution operation. The convolution kernel size is k×k, where k represents the size of the convolution kernel:

[0099]

[0100] in, represents the eigenvalue at position (i, j) after the lth layer of convolution, σ represents the activation function, represents the weight matrix of the l-th layer convolution kernel at position (m,n), represents the pixel value of the input feature value at position (i+m-1,j+n-1) in the previous layer l-1, b(l) represents the bias term of the lth layer;

[0101] S33. After each convolutional layer, a pooling layer is applied to downsample the feature map. The pooling layer adopts the maximum pooling technique, and the pooling kernel size is p×p:

[0102]

[0103] in, represents the feature value at position (i, j) of the lth layer after the pooling operation, p represents the size of the pooling kernel, and max represents the operation of taking the maximum value within the pooling window. Represents the eigenvalue at position (i+m-1,j+n-1) after the lth layer of convolution;

[0104] S34, after stacking operations of multiple convolutional layers and pooling layers, a multidimensional feature map containing global and local morphological features is obtained, wherein the feature map contains multiple channels, and each channel corresponds to a feature map;

[0105] S35, input the obtained multi-dimensional feature map into the fully connected layer of the deep convolutional network, and the fully connected layer integrates the features of all channels and flattens the multi-dimensional feature map into a one-dimensional feature vector F = {f1, f2, ..., f n}, where f i represents the i-th eigenvalue in the eigenvector, and n represents the dimension of the eigenvector;

[0106] S36, through the fully connected layer, the one-dimensional feature vector F is reduced in dimension and features are combined to generate the underlying shared feature S:

[0107] S=φ(W s ·F+b s );

[0108] Among them, φ represents the activation function of the fully connected layer, W s represents the weight matrix of the fully connected layer, b s Represents the bias vector of the fully connected layer.

[0109] In this implementation manner, the S4 specifically includes:

[0110] S41, input the underlying shared features S generated in S36 into the preliminary feature selection module, and select each feature S i Calculate information entropy H i and mutual information entropy I i :

[0111]

[0112] Among them, C represents the total number of categories of classification results, p ijRepresentation feature S i The probability of contribution to the jth category;

[0113]

[0114] Where N represents the total number of features, p ik Representation feature S i The probability of contribution to the kth category;

[0115] S42. Information entropy H i and mutual information entropy I i Perform joint normalization processing to obtain the information entropy after joint normalization And the normalized mutual information entropy

[0116] S43, combined with normalized information entropy And the normalized mutual information entropy Define the comprehensive contribution of each feature Γ i :

[0117]

[0118] Among them, α and β represent adjustment coefficients;

[0119] S44, based on the comprehensive contribution Γ i Sort all features and select the comprehensive contribution Γ i The features greater than the preset threshold τ are taken as the results of the preliminary screening, and the screened feature set is recorded as Where m represents the number of features after preliminary screening, and m≤n;

[0120] S45. Calculate the overall comprehensive contribution of the feature set Γ total :

[0121]

[0122] S46, if Γ total If the preset standard is reached, the output If the standard is not met, the threshold τ or the adjustment coefficients α and β are adjusted for re-screening.

[0123] In this implementation manner, S5 specifically includes:

[0124] S51, the underlying shared features S after the first screening of S46 * Input to the feature selection module, for each feature Perform feature complexity evaluation and calculate feature complexity coefficient γ i :

[0125]

[0126] Among them, γ i Representation characteristics The complexity coefficient of M represents the total number of features. Representation characteristics With features The absolute value of the difference between ij Representation characteristics With features The distance measure between them, α1 and β1 represent exponential adjustment parameters, controlling the weights of differences and distances, and ∈ represents a small constant to prevent division by zero errors;

[0127] S52, according to the characteristic complexity coefficient γ i , construct a sparse adaptive gating function g i (S * ), calculate the features The gate weight w i :

[0128]

[0129] Among them, β2 represents the adjustment parameter for controlling sparsity, δ represents the adjustment parameter for controlling the influence of feature similarity, and γ i represents the complexity coefficient of the i-th feature, Representation characteristics The norm of Representation characteristics The norm of Representation characteristics The norm of , m represents the number of features after preliminary screening;

[0130] S53, weight w calculated by sparse adaptive gating function i The features are weighted to obtain the feature S′ after secondary screening i :

[0131]

[0132] Among them, tanh represents the hyperbolic tangent function;

[0133] S54, for all the features after secondary screening S′={S′1,S′2,…,S′ m} is standardized to obtain the standardized feature S′ norm .

[0134] In this implementation manner, S6 specifically includes:

[0135] S61, S' of the features after secondary screening and standardization in step S54 normInput to the multi-scale feature extraction module, for each feature S′ i,norm Perform multi-scale transformation to generate feature representations of different scales

[0136]

[0137] Among them, r k represents the number of filters used at the kth scale, α s Representation filter The weight coefficient of Represents the standardized feature S ′i,norm and filter The bivariate nonlinear mapping function is used to generate multi-scale features, λ3 represents the adjustment parameter for controlling the distribution of multi-scale features, and ∈1 represents a small constant;

[0138] S62. For each feature S′ i,norm Feature representations generated at multiple scales Adaptive fusion is performed, and the fused multi-scale feature F is obtained by weighted summation based on information entropy and similarity. i :

[0139]

[0140] Among them, K represents the total number of scales, represents the entropy value of the feature representation at the kth scale, represents the entropy value of feature representation at the lth scale, represents the inner product of the feature representation of the kth scale and the k-1th scale, represents the norm of the k-th scale feature representation, represents the norm of the k-1th scale feature representation, ν k represents the weight coefficient of the kth scale, μ k represents the weighting coefficient based on similarity;

[0141] S63, the fused multi-scale feature F i Perform nonlinear transformation and use piecewise adaptive activation function to obtain the activated multi-scale feature A i :

[0142]

[0143] Among them, ξ i represents the tuning parameter that controls the transformation of positive-valued features, represents the adjustment parameter that controls the transformation of negative features;

[0144] S64, after activation, the multi-scale feature A iPerform normalization to obtain the normalized multi-scale feature A i,norm .

[0145] In this implementation manner, the S7 specifically includes:

[0146] S71, the fused and normalized multi-scale feature A i,norm Input into the multi-task learning framework, input into the classification task branch and the grading task branch;

[0147] S72, in the classification task branch, generating a classification feature representation C, and inputting the classification feature representation C into the classification task output layer;

[0148] S73, in the classification task branch, generating a classification feature representation G, and inputting the classification feature representation G into the classification task output layer;

[0149] S74, generate classification result P c :

[0150]

[0151] Among them, α c represents the adjustment parameter, C i The i-th element represents the classification feature, n c Indicates the number of categories of the classification task, C j Represents the jth element of the classification feature, n g Indicates the number of levels of the hierarchical task, ∑ k C k represents the sum of all classification features C, θ c represents a specific threshold for the classification task;

[0152] S75, generate classification result P g :

[0153]

[0154] Among them, β g represents the adjustment parameter, G i represents the i-th element of the hierarchical feature, G j represents the jth element of the hierarchical feature, ∑ k G k represents the sum of all hierarchical features G, θ g Indicates specific thresholds for grading tasks;

[0155] S76. According to the classification result P c And the classification result P g Complete the task of tea classification and grading.

[0156] Embodiment 1:

[0157] In order to verify the feasibility of the present invention in implementation, the present invention is applied to a tea production base, which has a wide variety of teas and extremely strict quality requirements. Every spring, when the new tea picking season arrives, the classification and quality grading of tea become key steps in the tea production process. Traditional tea classification and grading rely on experienced tea identification experts, but this method has the problems of low efficiency, high cost, and large interference from artificial factors. In order to improve production efficiency and grading accuracy, the tea production base decided to introduce the tea morphology classification and grading method based on deep convolutional network proposed in the present invention.

[0158] In actual applications, the tea production base first uses high-resolution cameras to shoot freshly picked tea leaves to obtain large-scale tea image data. The data includes tea samples of different types and different growth stages, and the image data covers different forms from single leaves to piles of tea leaves. In order to ensure the diversity of the data, the collected data comes from different lighting conditions and different shooting angles to ensure that the model can adapt to various complex actual scenarios.

[0159] After the image data is collected, the image is preprocessed. The tea production base uses the image preprocessing technology of the present invention to crop, grayscale, denoise and scale normalize the original image. These steps not only ensure the quality of the image, but also lay the foundation for subsequent image segmentation and feature extraction. After the preprocessing is completed, the image data is segmented into leaf areas and stem areas using image segmentation technology, so that the morphological characteristics of the tea can be captured more carefully.

[0160] The processed image data is input into a deep convolutional neural network for feature extraction. Through multi-layer convolution and pooling operations, the network extracts the global and local morphological features of tea leaves layer by layer, forming underlying shared features with high expressiveness. In order to optimize the effect of feature extraction, the tea production base applies the preliminary feature selection module of the present invention to screen the extracted features. In this step, based on the calculation of information entropy and mutual information entropy, the features that contribute most to the classification and grading of tea leaves are screened.

[0161] Based on the features after the initial screening, the tea production base further uses the sparse adaptive gating mechanism to perform a secondary screening of these features. By evaluating the complexity of the features and dynamically adjusting the gating weights, the system finally screened out the most critical feature set. Based on these key features, the system further extracted the multi-scale information of the tea images by applying multi-scale feature extraction and fusion technology, and adaptively fused this information to generate a feature representation with higher recognition.

[0162] The system then inputs the fused features into the multi-task learning framework. By sharing the underlying features, the system simultaneously classifies the types of tea and grades its quality. The classification and grading tasks promote each other under the same framework, and ultimately output the classification results and quality grading results of the tea. In this process, the classification results can accurately identify the types of tea, while the grading results can accurately determine the quality grade of the tea.

[0163] In order to verify the effectiveness of the invention, a tea production base conducted a one-month actual test. The test data came from three different tea gardens, covering three well-known tea varieties: West Lake Longjing, Huangshan Maofeng and Anji White Tea. The tea picking and shooting time was concentrated in March to April in spring. The total number of tea samples collected was 100,000 pieces, of which 60% was used to train the model and 40% was used to test the performance of the model.

[0164] Table 1 Comparison of experimental test data between the present invention and the traditional method

[0165]

[0166] Table 1 analyzes in detail the differences between the tea morphology classification and grading method based on deep convolutional networks and the traditional manual evaluation method, revealing the significant advantages of the present invention in many aspects.

[0167] First, in terms of classification and grading accuracy, the present invention showed extremely high precision. Specifically, the accuracy of tea classification reached 97.5%, significantly higher than the 92.3% of the traditional manual evaluation method. In terms of tea quality grading, the accuracy of the present invention was 95.8%, which was also significantly better than the 88.6% of the traditional method. This difference shows that the automated method based on deep learning can be more accurate than the manual method when dealing with complex tea morphological characteristics.

[0168] Secondly, in terms of efficiency, the present invention demonstrates outstanding performance advantages. The processing time for each image is only 0.8 seconds, while manual evaluation takes 10 to 15 seconds. This means that when processing a large number of tea samples, the method based on deep convolutional networks can significantly improve the overall processing efficiency. In the test, the processing efficiency of this method is 12 times higher than that of the traditional method, which greatly shortens the time for tea classification and grading, and greatly improves the speed and efficiency of production.

[0169] Furthermore, the present invention shows strong robustness under different lighting conditions. Even in scenes with large changes in lighting, the present invention can still maintain a classification accuracy of more than 95%, while the accuracy of traditional methods drops to about 80% under the same conditions. This shows that the deep learning-based method can better adapt to complex actual production environments and reduce the impact of external conditions on classification and grading results.

[0170] In addition, the present invention greatly reduces the requirement for manual dependence. Traditional methods are highly dependent on the experience of experts, while the present invention reduces the interference of human factors through automation and improves the standardization and consistency of the evaluation process. This not only improves the fairness of classification and grading, but also makes the tea evaluation process more efficient and reliable.

[0171] In terms of range adaptability, the present invention can be widely applied to different types of tea, and can continuously optimize model performance by continuously learning new samples. In contrast, traditional methods rely on the experience of experts, and it is difficult to guarantee accuracy for new types of tea or tea with large morphological changes.

[0172] Finally, in terms of data processing, the present invention trains the model through large-scale tea image data, and uses 60% of the data for training and 40% for testing, thereby ensuring the high accuracy and generalization ability of the model. The traditional manual evaluation method does not need to rely on data, but its evaluation criteria are difficult to unify and are easily affected by subjective factors.

[0173] In general, the tea morphology classification and grading method based on deep convolutional networks has significant advantages in accuracy, efficiency, robustness and automation, which fully proves its application value in tea production and quality inspection. These advantages not only improve the level of intelligence in the tea production process, but also provide solid technical support for the further development of the tea industry.

[0174] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A tea morphology classification and grading method based on deep convolutional network, characterized in that: The steps include: S1, collecting image data of tea leaves and preprocessing the image data; S2, using image segmentation technology to segment the pre-processed image data into local areas, wherein the local areas include leaf areas and stem areas; S3, input the segmented image data into a deep convolutional neural network model to extract the global and local morphological features of the tea leaves to form underlying shared features; S4, screening the underlying shared features once through the preliminary feature selection module; S5. Introduce a feature selection module to perform a secondary screening on the underlying shared features after the primary screening based on the sparse adaptive gating mechanism technology, and dynamically adjust the weight of feature selection; S6. Use multi-scale feature extraction and fusion technology to fuse the underlying shared features after secondary screening; S7, based on the fused underlying shared features, a multi-task learning framework is adopted, including two output layers: a classification task output layer and a grading task output layer; S8. Output tea classification and quality grading results through the deep convolutional neural network model.

2. A tea morphology classification and grading method based on deep convolutional network according to claim 1, characterized in that: The preprocessing specifically includes image cropping, grayscale conversion, denoising and scale normalization.

3. The method for tea morphology classification and grading based on deep convolutional network according to claim 1, characterized in that: The S3 specifically includes: S31, inputting the image data segmented in S2 into the input layer of the deep convolutional neural network model, wherein the input layer receives the tea image data including the leaf area and the stem area, and performs preliminary feature mapping; S32. Feature extraction is performed on the input image data through the convolution layer. Each convolution layer performs a two-dimensional convolution operation. The convolution kernel size is k×k, where k represents the size of the convolution kernel: in, represents the eigenvalue at position (i, j) after the lth layer of convolution, σ represents the activation function, represents the weight matrix of the l-th layer convolution kernel at position (m,n), represents the pixel value of the input feature value at position (i+m-1,j+n-1) in the previous layer l-1, b (l) represents the bias term of the lth layer; S33. After each convolutional layer, a pooling layer is applied to downsample the feature map. The pooling layer adopts the maximum pooling technique, and the pooling kernel size is p×p: in, represents the feature value at position (i, j) of the lth layer after the pooling operation, p represents the size of the pooling kernel, and max represents the operation of taking the maximum value within the pooling window. Represents the eigenvalue at position (i+m-1,j+n-1) after the lth layer of convolution; S34, after stacking operations of multiple convolutional layers and pooling layers, a multidimensional feature map containing global and local morphological features is obtained, wherein the feature map contains multiple channels, and each channel corresponds to a feature map; S35, input the obtained multi-dimensional feature map into the fully connected layer of the deep convolutional network, and the fully connected layer integrates the features of all channels and flattens the multi-dimensional feature map into a one-dimensional feature vector F = {f1, f2, ..., f n }, where f i represents the i-th eigenvalue in the eigenvector, and n represents the dimension of the eigenvector; S36, through the fully connected layer, the one-dimensional feature vector F is reduced in dimension and features are combined to generate the underlying shared feature S: S=φ(W s ·F+b s ); Among them, φ represents the activation function of the fully connected layer, W s represents the weight matrix of the fully connected layer, b s Represents the bias vector of the fully connected layer.

4. The method for tea morphology classification and grading based on deep convolutional network according to claim 1, characterized in that: The S4 specifically includes: S41, input the underlying shared features S generated in S36 into the preliminary feature selection module, and select each feature S i Calculate information entropy H i and mutual information entropy I i : Among them, C represents the total number of categories of classification results, p ij Representation feature S i The probability of contribution to the jth category; Where N represents the total number of features, p ik Representation feature S i The probability of contribution to the kth category; S42. Information entropy H i and mutual information entropy I i Perform joint normalization processing to obtain the information entropy after joint normalization And the normalized mutual information entropy S43, combined with normalized information entropy And the normalized mutual information entropy Define the comprehensive contribution of each feature Γ i : Among them, α and β represent adjustment coefficients; S44, based on the comprehensive contribution Γ i Sort all features and select the comprehensive contribution Γ i The features greater than the preset threshold τ are taken as the results of the preliminary screening, and the screened feature set is recorded as Where m represents the number of features after preliminary screening, and m≤n; S45. Calculate the overall comprehensive contribution of the feature set Γ total : S46, if Γ total If the preset standard is reached, the output If the standard is not met, the threshold τ or the adjustment coefficients α and β are adjusted for re-screening.

5. The method for tea morphology classification and grading based on deep convolutional network according to claim 1, characterized in that: The S5 specifically includes: S51, the underlying shared features S after the first screening of S46 * Input to the feature selection module, for each feature Perform feature complexity evaluation and calculate feature complexity coefficient γ i : Among them, γ i Representation characteristics The complexity coefficient of M represents the total number of features. Representation characteristics With features The absolute value of the difference between ij Representation characteristics With features The distance measure between them, α1 and β1 represent exponential adjustment parameters, controlling the weights of differences and distances, and ∈ represents a tiny constant to prevent division by zero errors; S52, according to the characteristic complexity coefficient γ i , construct a sparse adaptive gating function g i (S * ), calculate the features The gate weight w i : Among them, β2 represents the adjustment parameter for controlling sparsity, δ represents the adjustment parameter for controlling the influence of feature similarity, and γ i represents the complexity coefficient of the i-th feature, Representation characteristics The norm of Representation characteristics The norm of Representation characteristics The norm of , m represents the number of features after preliminary screening; S53, weight w calculated by sparse adaptive gating function i The features are weighted to obtain the feature S′ after secondary screening i : Among them, tanh represents the hyperbolic tangent function; S54, for all the features after secondary screening S′={S′1,S′2,…,S′ m } is standardized to obtain the standardized feature S′ norm .

6. The method for tea morphology classification and grading based on deep convolutional network according to claim 1, characterized in that: The S6 specifically includes: S61, S' of the features after secondary screening and standardization in step S54 norm Input to the multi-scale feature extraction module, for each feature S′ i,norm Perform multi-scale transformation to generate feature representations of different scales Among them, r k represents the number of filters used at the kth scale, α s Representation filter The weight coefficient of Represents the standardized feature S′ i,norm and filter The bivariate nonlinear mapping function is used to generate multi-scale features, λ3 represents the adjustment parameter for controlling the distribution of multi-scale features, and ∈1 represents a small constant; S62. For each feature S′ i,norm Feature representations generated at multiple scales Adaptive fusion is performed, and the fused multi-scale feature F is obtained by weighted summation based on information entropy and similarity. i : Among them, K represents the total number of scales, represents the entropy value of the feature representation at the kth scale, represents the entropy value of feature representation at the lth scale, represents the inner product of the feature representation of the kth scale and the k-1th scale, represents the norm of the k-th scale feature representation, represents the norm of the k-1th scale feature representation, ν k represents the weight coefficient of the kth scale, μ k represents the weighting coefficient based on similarity; S63, the fused multi-scale feature F i Perform nonlinear transformation and use piecewise adaptive activation function to obtain the activated multi-scale feature A i : Among them, ξ i represents the tuning parameter that controls the transformation of positive-valued features, represents the adjustment parameter that controls the transformation of negative features; S64, after activation, the multi-scale feature A i Perform normalization to obtain the normalized multi-scale feature A i,norm .

7. The method for tea morphology classification and grading based on deep convolutional network according to claim 1, characterized in that: The S7 specifically includes: S71, the fused and normalized multi-scale feature A i,norm Input into the multi-task learning framework, input into the classification task branch and the grading task branch; S72, in the classification task branch, generating a classification feature representation C, and inputting the classification feature representation C into the classification task output layer; S73, in the classification task branch, generating a classification feature representation G, and inputting the classification feature representation G into the classification task output layer; S74, generate classification result P c : Among them, α c represents the adjustment parameter, C i The i-th element represents the classification feature, n c Indicates the number of categories of the classification task, C j Represents the jth element of the classification feature, n g represents the number of levels of the hierarchical task, Σ k C k represents the sum of all classification features C, θ c represents a specific threshold for the classification task; S75, generate classification result P g : Among them, β g represents the adjustment parameter, G i represents the i-th element of the hierarchical feature, G j represents the jth element of the hierarchical feature, ∑ k G k represents the sum of all hierarchical features G, θ g Indicates specific thresholds for grading tasks; S76. According to the classification result P c And the classification result P g Complete the task of tea classification and grading.

Citation Information

Cited By

  • Intelligent tea screening method and system

    CN120030332A

  • Big data-based intelligent analysis method for running track of electric bicycle

    CN121786616A