Fresh tea leaf sorting method based on frequency domain tree topology network, computer equipment and computer readable medium
By using a frequency domain tree topology network method, combined with wavelet transform, discrete cosine transform and graph neural network, the problems of manual dependence and insufficient recognition accuracy in the sorting of fresh tea leaves are solved, and efficient and stable automated sorting of fresh tea leaves is achieved.
Patent Information
- Application Number
- CN202511413800.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-29
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-09-29
AI Technical Summary
Existing methods for sorting fresh tea leaves rely on human experience, resulting in low efficiency and inconsistent results. They are difficult to meet the needs of automated and precise sorting, and traditional convolutional neural networks are not effective in recognizing the detailed changes and structural dependencies of fresh tea leaves.
A frequency-domain tree-based topology network approach is adopted. Frequency domain features are extracted through wavelet transform and discrete cosine transform. Combined with long-short-range dependency modeling and residual convolution module, a tree-based topology attention path is constructed. Graph neural network is used to aggregate and propagate structural information to achieve fine-grained classification of fresh tea leaves.
It improves the automation level and classification accuracy of fresh tea leaf sorting, enhances the stability and robustness of fresh tea leaf type identification, and adapts to different lighting and shooting conditions.
Smart Images

Figure CN121280779A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tea leaf sorting technology, and in particular to a tea leaf sorting method, computer equipment, and computer-readable medium based on a frequency domain tree topology network. Background Technology
[0002] In current tea production and processing, the tenderness grade of fresh tea leaves is considered a key indicator determining the quality, aroma, and taste of tea, directly impacting subsequent processing techniques and product grading. Traditional fresh leaf sorting methods rely primarily on manual experience and visual judgment, which is not only labor-intensive and inefficient but also suffers from inconsistent and unstable results due to strong human subjectivity, failing to meet the practical needs of modern tea processing for automated, precise, and standardized sorting. In recent years, with the development of agricultural informatization and computer vision technology, image recognition and deep learning have been widely introduced into tea sorting tasks, becoming the main technical path for achieving intelligent tenderness recognition. Some studies have used convolutional neural networks for feature extraction and classification of fresh tea leaf images, while others have introduced lightweight networks to adapt to embedded device deployment scenarios, achieving some progress.
[0003] However, existing methods largely rely on the color and texture features of RGB images in the spatial domain, making it difficult to effectively identify detailed changes in leaf tip contours, edge curvature, and pubescence density in fresh tea leaves. This is especially problematic under less than ideal conditions such as varying natural light or complex backgrounds, leading to inaccurate identification and insufficient robustness. Furthermore, the natural growth state of fresh tea leaves exhibits a hierarchical topological structure, progressing from "single bud," "one bud and one leaf," "one bud and two leaves," to "one bud and multiple leaves." Traditional convolutional neural networks struggle to explicitly model the structural dependencies between buds and leaves, thus affecting the discrimination performance for multi-level, fine-grained categories. Some works have attempted to introduce frequency domain methods such as wavelet transform and Fourier transform to enhance texture representation, or to leverage attention mechanisms to improve semantic feature modeling capabilities. However, most have failed to effectively integrate frequency domain features with structural modeling, remaining at the level of image enhancement or shallow modeling, unable to construct a deep representation model with consistent structure and frequency.
[0004] In summary, current technologies have significant shortcomings in terms of feature extraction dimensions, structural topology modeling capabilities, frequency domain fusion mechanisms, and overall model expressiveness. Therefore, this paper proposes a tea leaf sorting method, computer equipment, and computer-readable medium based on a frequency domain tree topology network to address these issues. Summary of the Invention
[0005] Therefore, the purpose of this invention is to provide a method for sorting fresh tea leaves based on a frequency domain tree topology network, a computer device, and a computer-readable medium, so as to at least solve the above problems.
[0006] The technical solution adopted in the first aspect of this invention is as follows: A method for sorting fresh tea leaves based on a frequency domain tree topology network, the method comprising the following steps: Step S1: Under a standardized acquisition environment, high-resolution imaging equipment is used to acquire images of multiple batches of fresh tea leaves of the same variety and at different picking stages, construct a tea leaf image dataset, and perform image preprocessing, including color normalization, edge enhancement, and noise suppression. Step S2: The frequency domain tree decomposition method based on wavelet transform and discrete cosine transform is used to extract frequency domain features from the preprocessed image to obtain multiple frequency domain sub-images. Wavelet transform is used to extract high-frequency texture features, and discrete cosine transform is used to extract low-frequency structural features. Step S3: Input the frequency domain subgraph into a deep neural network containing a long-short-range dependency modeling module and a residual convolution module to extract high-order semantic features containing structural dependencies. The long-short-range dependency modeling module is used to model long-distance structural dependencies, and the residual convolution module is used to extract local textures and spatial details. Step S4: By constructing a tree-shaped topological attention path that simulates the spatial hierarchy of bud-leaf-vein, a structural association graph is established, and a graph neural network is used to aggregate and propagate structural information; Step S5: Based on the structure map, the tree structure perception classification function module is used to integrate the context information between structure nodes to achieve fine-grained discrimination of single bud, one bud and one leaf, one bud and two leaves, and one bud and multiple leaves.
[0007] Furthermore, the image preprocessing in step S1 specifically includes: Color normalization processing: The image is converted from the RGB color space to the Lab color space of lightness-red-green-yellow-blue. The pixel distribution characteristics of each channel are extracted. With reference to the mean and standard deviation of the standard image in the Lab space, a linear transformation is used to adjust the lightness channel L, red-green component channel a, and yellow-blue component channel b to make the color statistical characteristics of the image consistent with the reference image and eliminate color deviation caused by changes in lighting or device differences. Edge enhancement processing: The Sobel operator is used to calculate the gradient of the image in the horizontal and vertical directions to generate an edge magnitude map. Combined with non-maximum suppression and double thresholding, the contour information of structural regions such as leaf edges and leaf tips is enhanced. Noise suppression processing: The application of medium-medium filtering removes salt-and-pepper noise from the image. By extracting a neighborhood window centered on a pixel and calculating the median to replace the original value, local abrupt changes are suppressed while edge details are preserved. For smooth areas in the image, a bilateral filtering method is introduced, which combines the spatial distance between pixels and the gray-level difference for weighted averaging to reduce high-frequency noise interference while preserving detailed textures.
[0008] Furthermore, the frequency domain tree decomposition method in step S2 specifically includes: A two-dimensional discrete wavelet transform is performed on the input image to decompose the image into a low-frequency part and three high-frequency parts, which correspond to the changes in the image in the horizontal, vertical and diagonal directions, respectively. The high-frequency part contains the texture and edge detail information in the image, which is used to extract the structural features of the high-frequency region of the leaf tip and serrated edge. A two-dimensional discrete cosine transform is further applied to the low-frequency sub-band after wavelet decomposition to extract the low-frequency features of the energy concentration region in the image, which are used to model the overall outline of the blade and the global structural information of the main vein. By combining wavelet transform and discrete cosine transform, a tree-structured frequency domain decomposition representation is formed, in which the high-frequency branch captures edge and texture details, while the low-frequency branch represents the overall morphological structure. The two complement each other in terms of features through the coupling of scale and frequency dimensions.
[0009] Furthermore, the deep neural network in step S3 specifically includes: Long-range and short-range dependency modeling module: Based on the state-space model, it realizes the modeling of dependencies between distant structures in the image by dynamically modeling the state transition process, and captures the dependencies between distant structures in the image; Residual Convolution Module: Employs local convolution operations to extract local detail features of image edges, textures, and contours. Its structure includes standard convolutional layers and a residual connection mechanism, which maintains stable feature transfer and gradient flow through residual connections. Feature fusion module: It combines the global features output by the long-range and short-range dependency modeling module with the local features extracted by the residual convolution module to form a multi-level image representation that has both long-range dependency modeling capability and local structure perception capability.
[0010] Furthermore, the construction of the tree-based topology attention path in step S4 specifically includes: Structural node extraction: Identify and extract key regions of buds, leaves and veins from the image, set the buds as root nodes, the leaves as intermediate nodes, and the veins as terminal nodes to form a structural representation with growth hierarchy; Hierarchical connection relationship construction: Based on the spatial dependence order of leaf veins pointing to leaves and leaves pointing to buds, multi-layered directed connections are established in a bottom-up manner to form a tree-like topology structure that conforms to the natural growth law of plants. Attention path formation: A learnable attention mechanism is introduced into each directed edge. After mapping node features to a unified space through linear transformation, the features are concatenated and attention weights are calculated through a scoring function. This allows feature information to flow along the biological structural path and dynamically adjusts the transmission weights between different nodes.
[0011] Furthermore, the construction of the structural association map in step S4 specifically includes: Node representation: Representative structural units such as buds, leaf edges, and midribs are extracted as graph nodes, and each node is represented by its local image feature vector; Edge connection construction: Based on the spatial layout and physiological relationship between structural parts, construct connecting edges between nodes to form a preliminary graph structure; Attention weight introduction: Learnable attention weights are introduced on each edge to reflect the importance of information transfer between different structures; Feature propagation and aggregation: Graph neural networks are used to perform multiple rounds of feature propagation and aggregation operations, enabling each node to fuse information from its adjacency structure and update it into a global structure-aware representation that includes upstream and downstream semantics.
[0012] Furthermore, the classification step in step S5 specifically includes: Node feature extraction: Extract feature representations of each structural node from the structural association map, including the location features of different levels of buds, leaves, and leaf veins; Clear topological connections: Clearly define the topological connections between nodes and construct the structural path of bud-leaf-vein; Structure-aware attention weighted: For each structural path, a structure-aware attention mechanism is introduced to weight and fuse the node features in the path to generate a global representation with context awareness. Tree structure perception classification function: Based on the hierarchical position information in the structural path, it performs discriminative modeling of different structural combinations, calculates the classification probability, and realizes fine-grained tea leaf category discrimination.
[0013] Furthermore, this includes the model training steps: Use a dataset of fresh tea leaf images with standard labels for single bud, one bud and one leaf, one bud and two leaves, and one bud and multiple leaves; The cross-entropy loss function is used as the objective function to measure the difference between the predicted results and the true labels, and the backpropagation algorithm guides the iterative update of the model parameters. Combine data augmentation strategies, including rotation, scaling, brightness and color saturation adjustment, and noise addition, to improve the model's adaptability to different shooting angles and lighting conditions; Regularization strategies are introduced, including applying L2 regularization terms to the weight parameters and setting a random deactivation mechanism in the network, to suppress overfitting and improve the model's generalization ability and robustness.
[0014] The technical solution adopted in the second aspect of the present invention is as follows: A computer device includes a processor, a memory, and a communication bus. The memory stores a computer program, and the processor executes the program to implement the method mentioned in the first aspect, specifically including: Control the image acquisition device to acquire raw images of fresh tea leaves; The image preprocessing module is invoked to perform color normalization, edge enhancement, and noise suppression operations. The frequency domain decomposition module is invoked to perform wavelet transform and discrete cosine transform to extract structural features of different frequency bands; The deep modeling module is invoked to input image features into a neural network containing a long-short-range dependency modeling module and a residual convolution module, extracting and fusing global dependency and local texture information; The structure graphing module is invoked to construct tree-like topological paths and generate a structure graph. An attention mechanism is introduced to model the information flow between structures. The classification module is invoked, and the tree structure-aware classification function is executed to perform classification operations based on the hierarchical information of the structure graph. During training, the cross-entropy loss function is used to optimize the model, and data augmentation and regularization strategies are combined to improve model performance. Complete model training, package and save the data, and deploy and run it via storage or remote means.
[0015] The technical solution adopted in the third aspect of this invention is as follows: A computer-readable storage medium having a computer program stored thereon, the program, when executed by a processor, implementing the method mentioned in the first aspect, comprising: Image acquisition and preprocessing, frequency domain decomposition, depth modeling, topology construction, classification and judgment, and model packaging and deployment steps; The program can be loaded onto a processor for execution, or stored in a computer-readable storage medium and invoked.
[0016] Compared with the prior art, the beneficial effects of the present invention are: This invention proposes a tea leaf sorting method, computer equipment, and computer-readable medium based on a frequency-domain tree-structured topology network. Addressing the problems of unstable image quality, low structural recognition accuracy, and insufficient automation in traditional sorting methods, it constructs a complete workflow from image acquisition, preprocessing, frequency-domain decomposition, deep modeling, structural mapping, graph classification, to model deployment. Image quality is improved through color normalization and edge enhancement. Multi-level structural features are extracted using frequency-domain tree-structured decomposition combining wavelet and discrete cosine transform. Long- and short-range dependency modeling modules are integrated with residual convolution modules to achieve long- and short-range feature modeling. Semantic understanding is enhanced by utilizing a tree-structured topology attention path and structural graph simulating the "bud-leaf-vein" relationship. Fine-grained classification of different tea leaf types is achieved based on a tree structure-aware classification function module, and structural information propagation is optimized through a graph neural network. During the training phase, a cross-entropy loss function combined with data augmentation and regularization strategies is introduced to improve model robustness. Finally, automated and efficient tea leaf identification and sorting are achieved through deployment on computer equipment and a readable storage medium. The results show that the method exhibits high classification accuracy and stability on image datasets of multiple tea varieties, effectively improving the automation level and practical value of intelligent sorting of fresh tea leaves. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only preferred embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a schematic diagram of the overall process of Embodiment 1 of the present invention.
[0019] Figure 2 This is a schematic diagram of the overall network architecture of Embodiment 1 of the present invention.
[0020] Figure 3 This is a schematic diagram of the frequency domain tree decomposition module according to Embodiment 1 of the present invention.
[0021] Figure 4 This is a schematic diagram of the depth modeling module in Embodiment 1 of the present invention.
[0022] Figure 5 This is a schematic diagram of the tree-type topology attention path module in Embodiment 1 of the present invention.
[0023] Figure 6 This is a schematic diagram of the structural correlation map module of Embodiment 1 of the present invention. Detailed Implementation
[0024] The principles and features of the present invention are described below with reference to the accompanying drawings. The listed embodiments are only used to explain the present invention and are not intended to limit the scope of the present invention.
[0025] Example 1 Reference Figure 1-6 This invention provides a method for sorting fresh tea leaves based on a frequency domain tree topology network, the method comprising the following steps: Step S1: Under a standardized acquisition environment, high-resolution imaging equipment is used to acquire images of multiple batches of fresh tea leaves of the same variety and at different harvesting stages, constructing a tea leaf image dataset, and performing image preprocessing, including color normalization, edge enhancement, and noise suppression; the image preprocessing specifically includes: Color normalization processing: The image is converted from the RGB color space to the Lab color space of lightness-red-green-yellow-blue. The pixel distribution characteristics of each channel are extracted. With reference to the mean and standard deviation of the standard image in the Lab space, a linear transformation is used to adjust the lightness channel L, red-green component channel a, and yellow-blue component channel b to make the color statistical characteristics of the image consistent with the reference image and eliminate color deviation caused by changes in lighting or device differences. Edge enhancement processing: The Sobel operator is used to calculate the gradient of the image in the horizontal and vertical directions to generate an edge magnitude map. Combined with non-maximum suppression and double thresholding, the contour information of structural regions such as leaf edges and leaf tips is enhanced. Noise suppression processing: The application of medium-medium filtering removes salt-and-pepper noise from the image. By extracting a neighborhood window centered on a pixel and calculating the median to replace the original value, local abrupt changes are suppressed while edge details are preserved. For smooth areas in the image, a bilateral filtering method is introduced, which combines the spatial distance between pixels and the gray-level difference for weighted averaging to reduce high-frequency noise interference while preserving detailed textures.
[0026] For example, the acquired raw images of fresh tea leaves are preprocessed to improve the accuracy of subsequent structural analysis and feature extraction. First, the image is converted from the RGB color space to the Lab color space (lightness-red-green-yellow-blue). By extracting the pixel distribution features of each channel and referencing the mean and standard deviation of a standard image in the Lab space, a linear transformation is applied to adjust the lightness channel L, the red-green component channel a, and the yellow-blue component channel b, ensuring that the image's color statistical characteristics are consistent with the reference image, thereby eliminating color deviations caused by differences in lighting or equipment. After color normalization, the Sobel operator is used to calculate the gradient of the image in the horizontal and vertical directions, generating an edge magnitude map. Combined with non-maximum suppression and double thresholding, the contour information of structural regions such as leaf edges and tips is further enhanced. Based on this, medium-sensitivity filtering is applied to remove salt-and-pepper noise from the image. By extracting a neighborhood window centered on a pixel and calculating its median to replace the original value, local abrupt changes are suppressed while preserving edge details. For smooth regions in the image, a bilateral filtering method is introduced, which combines the spatial distance between pixels and the gray-level difference for weighted averaging, further reducing high-frequency noise interference while preserving detailed textures.
[0027] Step S2: The frequency domain tree decomposition method based on wavelet transform and discrete cosine transform is used to extract frequency domain features from the preprocessed image to obtain multiple frequency domain sub-images. Wavelet transform is used to extract high-frequency texture features, and discrete cosine transform is used to extract low-frequency structural features. Frequency domain tree decomposition methods specifically include: A two-dimensional discrete wavelet transform is performed on the input image to decompose the image into a low-frequency part and three high-frequency parts, which correspond to the changes in the image in the horizontal, vertical and diagonal directions, respectively. The high-frequency part contains the texture and edge detail information in the image, which is used to extract the structural features of the high-frequency region of the leaf tip and serrated edge. A two-dimensional discrete cosine transform is further applied to the low-frequency sub-band after wavelet decomposition to extract the low-frequency features of the energy concentration region in the image, which are used to model the overall outline of the blade and the global structural information of the main vein. By combining wavelet transform and discrete cosine transform, a tree-structured frequency domain decomposition representation is formed, in which the high-frequency branch captures edge and texture details, while the low-frequency branch represents the overall morphological structure. The two complement each other in terms of features through the coupling of scale and frequency dimensions.
[0028] For example, firstly, the input image Perform a two-dimensional discrete wavelet transform to decompose the image into a low-frequency component. and three high-frequency components These correspond to changes in the image in the horizontal, vertical, and diagonal directions, respectively: (1) Among them, the high-frequency part It contains detailed information such as texture and edges in the image, which can be used to extract structural features of high-frequency regions such as leaf tips and serrated edges. By analyzing the coefficients of these high-frequency subbands, it is possible to effectively capture areas with significant changes in the image and improve the model's ability to recognize details.
[0029] Subsequently, the low-frequency part The input is fed into a two-dimensional discrete cosine transform to perform frequency modeling of the overall structure. The calculation method is as follows: (2) in, These are frequency domain coefficients. This refers to the image size. Discrete cosine transform extracts low-frequency features from energy-concentrated regions in the image, which are used to model global structural information such as the overall blade outline and main vein.
[0030] Through the combination of wavelet and discrete cosine transform, a tree-structured frequency domain decomposition representation is formed. The high-frequency branch captures edges and textures, while the low-frequency branch represents the overall shape. The two complement each other in terms of structure through the coupling of scale and frequency dimensions.
[0031] Step S3: Input the frequency domain subgraph into a deep neural network containing a long-short-range dependency modeling module and a residual convolution module to extract high-order semantic features containing structural dependencies. The long-short-range dependency modeling module is used to model long-distance structural dependencies, and the residual convolution module is used to extract local textures and spatial details. Deep neural networks specifically include: Long-range and short-range dependency modeling module: Based on the state-space model, it realizes the modeling of dependencies between distant structures in the image by dynamically modeling the state transition process, and captures the dependencies between distant structures in the image; Residual Convolution Module: Employs local convolution operations to extract local detail features of image edges, textures, and contours. Its structure includes standard convolutional layers and a residual connection mechanism, which maintains stable feature transfer and gradient flow through residual connections. Feature fusion module: It combines the global features output by the long-range and short-range dependency modeling module with the local features extracted by the residual convolution module to form a multi-level image representation that has both long-range dependency modeling capability and local structure perception capability.
[0032] For example, the deep modeling module converts the data into an initial feature representation using an encoder. ,in Indicates batch size. Indicates the number of locations in the image. The feature dimension for each location.
[0033] This feature is first input into the long-short-range dependency modeling module, which is based on a state-space model to capture the dependencies between distant structures in an image. Unlike traditional convolution or self-attention, the long-short-range dependency modeling module achieves efficient association modeling of distant features by dynamically modeling the state transition process. Its computation process can be represented as follows: (3) Among them, matrix Indicates the state transition weights. For input bias terms, The operation represents linear recursive propagation over the entire sequence. In this way, the long-range and short-range dependency modeling module can perceive spatially distant but semantically related regions in the image, such as "midrib-leaf tip" or "symmetrical leaf," and achieve the ability to model the global structure.
[0034] Subsequently, the output features of the long-short-range dependency modeling module are... Compared with the original input features The data is then fused and fed into the residual convolution module. This module employs local convolution operations, focusing on extracting local detail features such as edges, textures, and contours from the image. Its structure includes a standard 3×3 convolutional layer and a residual connection mechanism, calculated as follows: (4) in, Indicates the feature Apply convolution operations to extract local features. Adding the residual path directly to the convolution result helps to stably propagate features, accelerates convergence, and prevents gradient vanishing.
[0035] Finally, the global features output by the long-range and short-range dependency modeling module are... Local features extracted with the ResConv module The fusion process can be performed by concatenating the features to obtain the final feature representation. (5) The fused feature F possesses both long-distance dependency modeling capability and local structure perception capability, forming a multi-level image representation with rich semantic expression capabilities.
[0036] Step S4: By constructing a tree-shaped topological attention path that simulates the spatial hierarchy of bud-leaf-vein, a structural association graph is established, and a graph neural network is used to aggregate and propagate structural information; The construction of tree-based topology attention paths specifically includes: Structural node extraction: Identify and extract key regions of buds, leaves and veins from the image, set the buds as root nodes, the leaves as intermediate nodes, and the veins as terminal nodes to form a structural representation with growth hierarchy; Hierarchical connection relationship construction: Based on the spatial dependence order of leaf veins pointing to leaves and leaves pointing to buds, multi-layered directed connections are established in a bottom-up manner to form a tree-like topology structure that conforms to the natural growth law of plants. Attention path formation: A learnable attention mechanism is introduced into each directed edge. After mapping node features to a unified space through linear transformation, the features are concatenated and attention weights are calculated through a scoring function. This allows feature information to flow along the biological structural path and dynamically adjusts the transmission weights between different nodes.
[0037] The construction of the structural association map specifically includes: Node representation: Representative structural units such as buds, leaf edges, and midribs are extracted as graph nodes, and each node is represented by its local image feature vector; Edge connection construction: Based on the spatial layout and physiological relationship between structural parts, construct connecting edges between nodes to form a preliminary graph structure; Attention weight introduction: Learnable attention weights are introduced on each edge to reflect the importance of information transfer between different structures; Feature propagation and aggregation: Graph neural networks are used to perform multiple rounds of feature propagation and aggregation operations, enabling each node to fuse information from its adjacency structure and update it into a global structure-aware representation that includes upstream and downstream semantics.
[0038] For example, the tree-structured topology attention path module first performs structural analysis on the input tea leaf image, identifying key regions such as buds, leaves, and veins, and designating them as root nodes, intermediate nodes, and terminal nodes, representing the upper, middle, and lower layers of the tea leaf structure, respectively. Based on this structural division, following the biological structural logic of "veins connecting leaves, leaves connecting buds," a hierarchical and directional directed graph structure is constructed. This graph structure starts from the most detailed veins, points layer by layer towards the leaves, and finally converges at the bud node, conforming to the natural growth sequence of plants from bottom to top, forming a tree-structured topology.
[0039] In this directed tree graph, a learnable attention mechanism is introduced for each edge to measure the importance of information transfer between nodes with different structures. Specifically, consider two nodes... and These represent the lower and upper layers of the structure, respectively, and their corresponding feature vectors are: and Then through linear transformation After mapping both to a unified space, they are concatenated, and attention weights are calculated using a scoring function. The calculation process can be expressed as follows: (6) in, For learnable weight vectors, Represents all nodes A set of connected lower-level nodes. This allows for the adaptive assignment of different weights to each edge based on the correlation between node features, making the propagation of structural information between nodes more accurate and effective.
[0040] The way information is passed from bottom to top in a structural path can be represented as follows: (7) in, Indicates the first Layer nodes Update features, For learnable linear transformation weights, is the activation function. In the entire attention flow graph structure, information starts from the veins, is weighted and aggregated, and then passed down to the leaves and buds, enabling the model to perceive the overall structural relationships along the topological path and dynamically adjust the semantic contribution of each node in the whole tree.
[0041] The structural association graph module first extracts representative structural units such as buds, leaf edges, and midribs as graph nodes, each represented by a local image feature vector. Each node is represented by a feature vector reflecting the image features of its local region. Based on the spatial location and physiological connections between structural parts, an edge set of the graph is constructed to form the structural graph. Attention weights are introduced on each edge to measure the strength of information transfer between structures. Consider two connected nodes... and The features are represented as and First, the original features are mapped to a uniform dimension through a linear transformation: (8) in, This is the node feature transformation matrix. An attention mechanism is used to ensure that each structural node focuses on its stronger structural relationships with its neighbors during updates. In the feature propagation phase, the graph neural network weights and aggregates the information from neighboring nodes according to attention weights to update the feature representation of the current node. (9) in, The updated node features are then used. Through multiple rounds of propagation and updates, the node features can gradually integrate information from its adjacent structural nodes, enabling the modeling and representation of the complex relationships between the structures of fresh tea leaves.
[0042] Step S5: Based on the structure map, the tree structure perception classification function module is used to integrate the context information between structure nodes to achieve fine-grained discrimination of single bud, one bud and one leaf, one bud and two leaves, and one bud and multiple leaves.
[0043] The classification step in step S5 specifically includes: Node feature extraction: Extract feature representations of each structural node from the structural association map, including the location features of different levels of buds, leaves, and leaf veins; Clear topological connections: Clearly define the topological connections between nodes and construct the structural path of bud-leaf-vein; Structure-aware attention weighted: For each structural path, a structure-aware attention mechanism is introduced to weight and fuse the node features in the path to generate a global representation with context awareness. Tree structure perception classification function: Based on the hierarchical position information in the structural path, it performs discriminative modeling of different structural combinations, calculates the classification probability, and realizes fine-grained tea leaf category discrimination.
[0044] For example, the tree structure-aware classification function module first extracts feature representations of each structural node from step 4, including different levels of parts such as buds, leaves, and veins, and clarifies the topological connections between them. Using these nodes and their connections as input, a "bud-leaf-vein" structural path is constructed to reflect the hierarchical composition of fresh tea leaves. Next, for each structural path, a structure-aware attention mechanism is introduced to perform weighted fusion of the node features in the path. Assume the path contains nodes... The feature of each node is represented as follows: The global representation of all node features is calculated using attention weighting: (10) Among them, weight Weights are dynamically generated based on a node's position and feature importance within the structural path, reflecting its contribution to the overall classification. Weight calculation can be performed using a learnable scoring function, such as: (11) in These are learnable parameter vectors. The fused feature representation. As the final classification input, it is fed into the tree structure-aware classification function module. This module does not classify the entire image uniformly, but rather processes different structural combinations differently based on their hierarchical position within the structural path. The calculation of classification probabilities considers not only a single local feature in the image, but also the information from the entire structural path, making a comprehensive judgment at the semantic level.
[0045] Softmax output is implemented using a structure-aware approach. Let the set of output categories be... Then the score for each category is: (12) in and These are the weights and biases corresponding to this category. The final classification probability is calculated using the standard Softmax function: (13) The classification module maintains sensitivity to structural hierarchy and context throughout the feature fusion and prediction process, enabling the model to accurately distinguish between categories that are similar in appearance but different in structure, such as "single bud", "one bud and one leaf", "one bud and two leaves", and "one bud and multiple leaves".
[0046] Further steps include model training: Use a dataset of fresh tea leaf images with standard labels for single bud, one bud and one leaf, one bud and two leaves, and one bud and multiple leaves; The cross-entropy loss function is used as the objective function to measure the difference between the predicted results and the true labels, and the backpropagation algorithm guides the iterative update of the model parameters. Combine data augmentation strategies, including rotation, scaling, brightness and color saturation adjustment, and noise addition, to improve the model's adaptability to different shooting angles and lighting conditions; Regularization strategies are introduced, including applying L2 regularization terms to the weight parameters and setting a random deactivation mechanism in the network, to suppress overfitting and improve the model's generalization ability and robustness.
[0047] For example, the collected tea leaf image dataset is labeled with standard labels. The labels corresponding to the image samples reflect their true classification in fine-grained categories such as "single bud", "one bud and one leaf", "one bud and two leaves", and "one bud and multiple leaves". The images are input into the model, and after feature extraction and structural modeling modules, the corresponding classification probability output is obtained.
[0048] During training, the cross-entropy loss function is used as the objective function to measure the difference between the model's predictions and the true labels. Let the predicted probability output by the model be... The corresponding category label is The loss function is then defined as: (14) in This represents the total number of categories. This loss value is passed to each module via the backpropagation algorithm to guide the iterative update of the model parameters.
[0049] To enhance the model's ability to recognize samples under different shooting environments, various data augmentation processes were performed on the original images before training. Augmentation methods included rotating by a certain angle, scaling to different sizes, adjusting brightness and color saturation, and adding noise, thereby constructing diverse representations of the image under different viewing angles and lighting conditions, and improving the model's adaptability to real-world environments.
[0050] Regularization strategies are also introduced during model training to suppress overfitting of the model to the training data. Specifically, this includes applying L2 regularization terms to the weight parameters and implementing a random deactivation mechanism in some layers of the network, which randomly discards neuron outputs with a certain probability, allowing the network to maintain its generalization ability during training. The entire training process, through the combined effects of supervisory signals, data perturbation, and regularization constraints, guides the model to achieve a balance between accuracy and stability, enabling it to exhibit good convergence on standard image datasets while also possessing the ability to generalize to new samples.
[0051] Example 2 A computer device includes a processor, a memory, and a communication bus. The memory stores a computer program, and the processor executes the program to implement the method mentioned in Embodiment 1, specifically including: Control the image acquisition device to acquire raw images of fresh tea leaves; The image preprocessing module is invoked to perform color normalization, edge enhancement, and noise suppression operations. The frequency domain decomposition module is invoked to perform wavelet transform and discrete cosine transform to extract structural features of different frequency bands; The deep modeling module is invoked to input image features into a neural network containing a long-short-range dependency modeling module and a residual convolution module, extracting and fusing global dependency and local texture information; The structure graphing module is invoked to construct tree-like topological paths and generate a structure graph. An attention mechanism is introduced to model the information flow between structures. The classification module is invoked, and the tree structure-aware classification function is executed to perform classification operations based on the hierarchical information of the structure graph. During training, the cross-entropy loss function is used to optimize the model, and data augmentation and regularization strategies are combined to improve model performance. Complete model training, package and save the data, and deploy and run it via storage or remote means.
[0052] Example 3 A computer-readable storage medium having a computer program stored thereon, the program, when executed by a processor, implements the method mentioned in Embodiment 1, comprising: Image acquisition and preprocessing, frequency domain decomposition, depth modeling, topology construction, classification and judgment, and model packaging and deployment steps; The program can be loaded onto a processor for execution, or stored in a computer-readable storage medium and invoked.
[0053] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for sorting tea fresh leaves based on a frequency domain tree topology network, characterized in that, The method comprises the following steps: Step S1: Under a standardized acquisition environment, high-resolution imaging equipment is used to collect images of multiple batches, the same variety and different picking stages of tea fresh leaves, an image dataset of tea fresh leaves is constructed, and image preprocessing is performed, the preprocessing including color normalization, edge enhancement and noise suppression; Step S2: A frequency domain tree decomposition method based on wavelet transform and discrete cosine transform is used to extract frequency domain features from the preprocessed image, and a plurality of frequency domain subgraphs are obtained, wherein the wavelet transform is used to extract high-frequency texture features, and the discrete cosine transform is used to extract low-frequency structure features; Step S3: The frequency domain subgraph is input into a deep neural network comprising a long and short range dependency modeling module and a residual convolution module, and high-order semantic features containing structure dependency are extracted, wherein the long and short range dependency modeling module is used to model long-distance structure dependency, and the residual convolution module is used to extract local texture and spatial details; Step S4: A tree topology attention path simulating the spatial subordination relationship of bud-leaf-vein is constructed, a structure correlation graph is established, and a graph neural network is used for aggregation and propagation of structure information; Step S5: Based on the structure graph, a tree structure perception classification function classification module is used to fuse the context information between structure nodes, and fine-grained discrimination of single bud, one bud and one leaf, one bud and two leaves, and one bud and multiple leaves is realized.
2. The method of claim 1, wherein, The image preprocessing in step S1 specifically includes: Color normalization processing: converting the image from the red-green-blue color space RGB to the lightness-red-green-yellow-blue color space Lab, extracting the pixel distribution features of each channel, and referring to the mean and standard deviation of the standard image in the Lab space, adjusting the lightness channel L, the red-green component channel a and the yellow-blue component channel b channel using linear transformation, so that the image color statistical characteristics are consistent with the reference image, and the color deviation caused by light changes or equipment differences is eliminated; Edge enhancement processing: using the Sobel operator to calculate the gradient of the image in the horizontal and vertical directions to generate an edge amplitude graph, and combining non-maximum suppression and double threshold processing to enhance the contour information of the leaf edge and the structure region such as the leaf tip; Noise suppression processing: applying median filtering to remove salt and pepper noise in the image, extracting a neighborhood window centered on a pixel, calculating the median to replace the original value, suppressing local mutations and preserving edge details; for smooth areas in the image, a bilateral filtering method is introduced, and a weighted average is performed based on the spatial distance and gray difference between pixels to reduce high-frequency noise interference while preserving detail textures.
3. The method of claim 1, wherein, The frequency domain tree decomposition method in step S2 specifically includes: Two-dimensional discrete wavelet transform is performed on the input image to decompose the image into a low-frequency part and three high-frequency parts corresponding to the horizontal, vertical and diagonal directions of the image, wherein the high-frequency part contains texture, edge detail information in the image, and is used to extract the structure features of the high-frequency region of the leaf tip and serrated edge; Two-dimensional discrete cosine transform is further applied to the low-frequency subband after wavelet decomposition to extract low-frequency features of the energy concentration region in the image, which is used to model the overall contour of the leaf blade and the global structure information of the main vein; By the combination of wavelet transform and discrete cosine transform, a tree structure frequency domain decomposition representation is formed, in which the high frequency branch captures the edge and texture details, and the low frequency branch represents the overall morphological structure, and the two complement each other through the coupling of scale and frequency dimensions.
4. The method of claim 1, wherein, The deep neural network in the step S3 specifically comprises: A long and short range dependency modeling module: based on a state space model, a dynamic modeling state transition process is used to model the dependency relationship between the long distance structures in the image, and the dependency relationship between the long distance structures in the image is captured; A residual convolution module: a local convolution operation is used to extract the edge, texture, contour local detail features of the image, and the structure comprises a standard convolution layer and a residual connection mechanism, and the residual connection is used to keep the stable transmission and gradient flow of the features; A feature fusion module: the global features output by the long and short range dependency modeling module and the local features extracted by the residual convolution module are spliced and fused to form a multi-level image representation with long distance dependency modeling capability and local structure perception capability.
5. The method of claim 1, wherein, The construction of the tree topology attention path in the step S4 specifically comprises: Structure node extraction: key regions of buds, leaves and leaf veins are identified and extracted from the image, the buds are set as root nodes, the leaves are set as intermediate nodes, and the leaf veins are set as terminal nodes, thereby forming a structure representation with growth levels; Layered connection relationship construction: a bottom-up method is used to establish a multi-layer directed connection according to the spatial dependency order of the leaf vein pointing to the leaf and the leaf pointing to the bud, thereby forming a tree topology structure conforming to the natural growth law of plants; Attention path formation: a learnable attention mechanism is introduced on each directed edge, the node features are mapped to a unified space through linear transformation and spliced, and the attention weight is calculated through a scoring function, so that the feature information can flow along the biological structure path and dynamically adjust the transmission weight between different nodes.
6. The method of claim 1, wherein, The construction of the structure association graph in the step S4 specifically comprises: Node representation: representative structure units of bud heads, leaf edges and main veins are extracted as graph nodes, and each node is represented by a local image feature vector; Edge connection construction: a connection edge between nodes is constructed according to the spatial layout and physiological association between structure parts, thereby forming a preliminary graph structure; Attention weight introduction: a learnable attention weight is introduced on each edge to reflect the importance of information transmission between different structures; Feature propagation and aggregation: a multi-round feature propagation and aggregation operation is performed by using a graph neural network, so that each node can fuse the information of its adjacent structure and update to a global structure perception representation containing upstream and downstream semantics.
7. The method of claim 1, wherein, The classification step in the step S5 specifically comprises: Node feature extraction: the feature representation of each structure node is extracted from the structure association graph, including the part features of buds, leaves and leaf veins at different levels; Topology connection relationship determination: the topology connection relationship between nodes is determined to construct a bud-leaf-leaf vein structure path; Structure perception attention weighting: for each structure path, a structure perception attention mechanism is introduced to weight and fuse the node features in the path, thereby generating a global representation with context perception capability. Tree structure perception classification function classification: based on the hierarchical position information in the structure path, different structure combinations are distinguished and modeled, the classification probability is calculated, and fine-grained tea fresh leaf category discrimination is realized.
8. The method of claim 1, wherein, Further comprising a model training step: Using a tea fresh leaf image dataset with single bud, one bud one leaf, one bud two leaves, and one bud multi-leaf standard labels; Adopting cross-entropy loss function as objective function, measuring the difference between predicted results and true labels, guiding model parameter iterative update through back propagation algorithm; Combined with data enhancement strategy, including rotation, scaling, brightness and color saturation adjustment, adding noise, improving model's adaptability to different shooting angles and lighting conditions; Introducing regularization strategy, including applying L2 regularization term to weight parameters, and setting random inactivation mechanism in network to suppress overfitting, improve model generalization ability and robustness.
9. A computer device comprising a processor, a memory and a communication bus, the memory storing a computer program, characterized in that, The processor executes the program to realize the method of any one of claims 1 to 8, specifically comprising: Controlling the image acquisition device to acquire the original tea fresh leaf image; Calling the image preprocessing module to perform color normalization, edge enhancement and noise suppression operations; Calling the frequency domain decomposition module to perform wavelet transform and discrete cosine transform, extracting structure features in different frequency bands; Calling the deep modeling module, inputting image features into neural network containing long and short range dependence modeling module and residual convolution module, extracting global dependence and local texture information and fusing; Calling the structure mapping module, constructing tree topology structure path and generating structure atlas, introducing attention mechanism to model structure information flow; Calling the classification module, performing tree structure perception classification function classification operation based on hierarchical information of structure atlas; In the training process, cross-entropy loss function is used to optimize the model, and data enhancement and regularization strategy are used to improve the performance of the model; Complete model training and encapsulation, deployment and operation through memory or remote way.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to realize the method of any one of claims 1 to 8, comprising: Image acquisition preprocessing, frequency domain decomposition, deep modeling, topology structure construction, classification judgment and model encapsulation deployment steps; The program can be loaded into the processor for execution, or stored in the computer readable storage medium for calling and implementation.
Citation Information
Patent Citations
Tea garden tea leaf picking planning system and method based on visual identification
CN118941125A
Hyperspectral image open set spectral spatial feature extraction and classification method
CN120163995A
Land change detection method combining matrix decomposition and adaptive propagation, and system
WO2025111921A1
Cited By
Automatic material selection method and system based on tea processing technology
CN121861655A
