A method, medium, and equipment for grading raw tea

By integrating multi-source information and using a cascaded decision-making model, the problem of evaluating the multi-dimensional characteristics of raw tea has been solved, enabling efficient and intelligent sorting of tea leaves, improving sorting accuracy and efficiency, and ensuring the stability of tea quality and market value.

CN120765950BActive Publication Date: 2025-11-14WUYISHAN YEJIAYAN TEA CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511267015.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-05
Publication Date
2025-11-14
Estimated Expiration
2045-09-05

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently integrate and accurately assess the multi-dimensional characteristics of raw tea, resulting in insufficient precision in automated sorting during tea processing, which impacts market value and quality stability.

Method used

A multi-source information fusion method is adopted, which collects visible light images, near-infrared spectral information and three-dimensional morphological information of raw tea, performs illumination compensation, geometric correction and multi-source information registration, and combines cascaded decision model to determine the grade and control the sorting device to perform corresponding sorting actions.

Benefits of technology

It enables precise analysis and intelligent grading of multi-dimensional characteristics of raw tea, improving sorting accuracy and efficiency, and ensuring the stability of tea quality and market value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120765950B_ABST
    Figure CN120765950B_ABST
Patent Text Reader

Abstract

This invention discloses a method, medium, and equipment for grading raw tea. The method includes: acquiring raw tea information containing a first visible light image, first near-infrared spectral information, and first three-dimensional morphological information at a preset sampling frequency; performing illumination compensation, geometric correction, and multi-source registration processing on the raw tea information to obtain standard tea information; extracting static quality parameters such as leaf curl from the registered second visible light image, analyzing and obtaining physicochemical quality parameters from the second near-infrared spectral information, and extracting structural features such as leaf compactness from the second three-dimensional morphological information; finally, determining the grade through a cascaded decision model and controlling the sorting device to perform corresponding sorting actions. This invention achieves the fusion analysis and intelligent grading of multi-dimensional characteristics of raw tea, effectively improving sorting accuracy and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tea processing technology, and in particular to a method, medium, and equipment for grading raw tea. Background Technology

[0002] Sorting and grading raw tea is a crucial step in tea processing, directly impacting its market value and quality stability. Traditional grading relies primarily on manual experience, selecting tea leaves based on their shape, color, and stem content—a process that is inefficient and inconsistent. In recent years, automated detection technologies such as machine vision and spectral analysis have been gradually applied to tea sorting. However, due to the complex morphology and variable composition of raw tea, current technologies still struggle to efficiently integrate and accurately assess multi-dimensional characteristics, resulting in insufficient precision in automated sorting and hindering the standardization and intelligent development of tea processing. Summary of the Invention

[0003] In view of this, the purpose of this invention is to propose a method, medium and equipment for screening raw tea grades, so as to solve the problem of difficulty in accurately integrating multi-dimensional features to achieve efficient grading.

[0004] To achieve the aforementioned technical objectives, in a first aspect, this application provides a method for grading raw tea leaves, comprising:

[0005] Raw tea information is collected according to a preset sampling frequency. The raw tea information includes a first visible light image, a first near-infrared spectral information, and a first three-dimensional morphological information.

[0006] The raw tea information is preprocessed to obtain standard raw tea information. The preprocessing includes illumination compensation, geometric correction and multi-source information registration. The standard raw tea information includes the registered second visible light image, second near-infrared spectral information and second three-dimensional morphological information.

[0007] Multi-scale feature segmentation is performed on the second visible light image to extract static quality parameters, including strand curl, stem content and yellow patch distribution characteristics. Additionally, physicochemical quality parameters are obtained by performing feature band analysis on the second near-infrared spectral information.

[0008] Spatial distribution analysis is performed on the second and third-dimensional morphological information to extract the strip structure features, which include strip compactness and surface texture features.

[0009] Based on static quality parameters, physicochemical quality parameters, and strip structure characteristics, a cascaded decision model is used to determine the grade. The cascaded decision model is configured as a primary screening module based on an improved visual Transformer and a comprehensive scoring module based on a random forest.

[0010] Based on the grade determination results, the control sorting device executes a combination of sorting actions that match each grade.

[0011] In some embodiments, performing multi-scale feature segmentation on the second visible light image and extracting static quality parameters includes:

[0012] The second visible light image is input into the strip segmentation network, which adopts the U-Net architecture with fused edge awareness mechanism. By embedding learnable morphological convolution kernels in the encoder-decoder skip connections, the strip region segmentation results are output.

[0013] The results of the strip region segmentation are input into the 3D reconstruction module. The 3D point cloud data of the strip surface is obtained through structured light projection measurement technology. The curvature field distribution characteristics are calculated based on the differential geometry method, and the curling quantification parameters are output.

[0014] The second visible light image and the strip region segmentation results are input into the tea stem detection module. A multi-branch feature pyramid network is used to extract gradient features at the original resolution, 1 / 2 downsampling and 1 / 4 downsampling scale spaces, respectively. The multi-scale detection results are fused by the non-maximum suppression algorithm to output a heat map of tea stem distribution.

[0015] The second visible light image is input into the porn recognition module. Through HSV color space conversion and adaptive brightness compensation, a depth-separable convolutional network is used to extract multispectral texture features and output a porn probability distribution map.

[0016] Based on the quantification parameters of curvature, the heat map of tea stem distribution, and the probability distribution map of yellow leaves, static quality parameters including strip morphology characteristics, stem content, and yellow leaf distribution characteristics are generated.

[0017] In some embodiments, obtaining physicochemical quality parameters by performing characteristic band analysis on the second near-infrared spectral information includes:

[0018] The second near-infrared spectral information is filtered within a preset wavelength range using a continuous projection algorithm to obtain a combination of characteristic wavelengths. The preset wavelength range includes a first preset band reflecting the moisture content of tea leaves and a second preset band reflecting the polyphenol content of tea leaves. The combination of characteristic wavelengths includes preset wavelength spectral information.

[0019] The preset wavelength spectral information is input into a one-dimensional convolutional neural network based on an attention mechanism to establish a nonlinear mapping relationship between spectral features and physicochemical parameters, and output prediction information, including predicted moisture content and predicted tea polyphenol content.

[0020] The predicted information is weighted and integrated according to the preset tea quality standards to generate comprehensive physicochemical quality parameters.

[0021] In some embodiments, spatial distribution analysis of the second three-dimensional morphological information is performed to extract the features of the strand structure, including:

[0022] The second three-dimensional morphological information is input into the surface reconstruction algorithm model of the region growing to obtain the three-dimensional model of the strip surface. The surface reconstruction algorithm model is configured to perform neighborhood point aggregation under the normal vector consistency constraint.

[0023] The surface convexity and concaveness features of the three-dimensional model of the strip surface are calculated through principal curvature analysis, and the strip compactness parameters are output. The strip compactness parameters include Gaussian curvature distribution information and average curvature value.

[0024] The three-dimensional model of the strip surface is projected from multiple perspectives, and the texture features of the projected image are analyzed using the gray-level co-occurrence matrix to output the surface texture uniformity parameters.

[0025] Based on the bar compactness parameter and the surface texture uniformity parameter, bar structure features are generated.

[0026] In some embodiments, the grade determination based on static quality parameters, physicochemical quality parameters, and strip structure characteristics, using a cascaded decision model, includes:

[0027] Static quality parameters, physicochemical quality parameters, and strip structure features are tensor-concatenated through a feature fusion layer to generate a multidimensional feature matrix.

[0028] The multidimensional feature matrix is ​​input into the primary filtering module for filtering, and preliminary filtering results are obtained, including:

[0029] In the query-key value attention weight calculation, a strip morphology constraint term is introduced to obtain morphological gradient features. The strip morphology constraint term is implemented by the dot product operation of the strip midline curvature and the attention weight.

[0030] By fusing morphological gradient features with Transformer deep features, enhanced stripe features are obtained;

[0031] The strengthening strip features are filtered according to a preset quality threshold, and the preliminary filtering results are output. The strengthening strip features in the preliminary filtering results are recorded as primary filtering features.

[0032] The initial screening features are input into the comprehensive scoring module to obtain the grade probability distribution, including:

[0033] The weight allocation of the primary screening features is dynamically adjusted by the Gini coefficient, and a decision tree of no less than a preset number is configured to perform bagging ensemble prediction to obtain the original prediction probability.

[0034] The Platt scaling method is used to calibrate the distribution of the original predicted probabilities, and the level probability distribution is output.

[0035] The probability distribution of the levels is divided according to the preset level division threshold to generate the final level determination result.

[0036] In some embodiments, illumination compensation includes the following steps:

[0037] The first visible light image is subjected to global illumination correction using a brightness equalization algorithm, and the first preliminary corrected image is output.

[0038] The first preliminary corrected image is input into the local illumination compensation model, which is configured to be constructed based on Retinex theory, to obtain the reflection component and the illumination component.

[0039] The reflection component is enhanced with adaptive gamma correction to produce a second preliminary corrected image with uniform illumination.

[0040] Geometric correction includes the following steps:

[0041] Detect stripe edge feature points in the second preliminary corrected image;

[0042] Calculate lens distortion parameters and projection transformation matrix to perform geometric correction, and obtain the third preliminary corrected image;

[0043] Multi-source information registration includes the following steps:

[0044] The third preliminary corrected image is spatially aligned with the second three-dimensional morphological information to output the registered second visible light image, including:

[0045] Extract the SIFT feature point set from the third preliminary corrected image, and match the SIFT feature point set with the three-dimensional feature points in the second three-dimensional morphological information to obtain the matching result;

[0046] Calculate the optimal spatial transformation parameters based on the matching results and perform registration.

[0047] In some embodiments, preprocessing further includes:

[0048] The first near-infrared spectral information is processed by a sliding window. Within each window, a quadratic polynomial is used to fit the spectral curve. The smoothed spectral intensity value is calculated using the coefficients of the fitted polynomial, and the first preprocessed spectral information is output.

[0049] Calculate the average absorbance of the first preprocessed spectral information at all wavelengths, calculate the standard deviation of the absorbance at each wavelength, perform a normalization transformation, and output the second preprocessed spectral information.

[0050] Principal component analysis was performed on the second preprocessed spectral information to obtain the second near-infrared spectral information.

[0051] In some embodiments, preprocessing further includes:

[0052] The first three-dimensional morphological information is filtered for noise using a point cloud denoising algorithm, including:

[0053] The first three-dimensional morphological information is converted into a first point cloud model, and the neighborhood spatial distribution characteristics of each point in the first point cloud model are calculated.

[0054] Outliers are removed based on the spatial distribution characteristics of the neighborhood to obtain a preliminary denoised point cloud;

[0055] The initial denoised point cloud is simplified using a voxel grid downsampling algorithm, including:

[0056] A three-dimensional voxel space partitioning structure is established, which includes multiple voxel units.

[0057] Retain representative point cloud data within each voxel unit and output the downsampled point cloud;

[0058] The downsampled point cloud is corrected using a surface optimization algorithm, including:

[0059] Analyze the local surface geometric features of the downsampled point cloud, correct outliers that do not conform to the preset topological rules, and output the second three-dimensional morphological information.

[0060] In a second aspect, the present invention also provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the method described in the first aspect.

[0061] In a third aspect, the present invention also provides an electronic device including a memory and a processor, the memory being used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method described in the first aspect.

[0062] Unlike existing technologies, the above technical solution has the following beneficial effects: This invention provides a method, medium, and equipment for grading raw tea. The method includes: acquiring raw tea information containing a first visible light image, first near-infrared spectral information, and first three-dimensional morphological information at a preset sampling frequency; performing illumination compensation, geometric correction, and multi-source registration processing on the raw tea information to obtain standard raw tea information; extracting static quality parameters such as leaf curl from the registered second visible light image, analyzing and obtaining physicochemical quality parameters from the second near-infrared spectral information, and extracting structural features such as leaf compactness from the second three-dimensional morphological information; finally, determining the grade through a cascaded decision model and controlling the sorting device to perform corresponding sorting actions. The above technical solution realizes the fusion analysis and intelligent grading of multi-dimensional characteristics of raw tea, effectively improving sorting accuracy and efficiency. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0064] Figure 1 This is a flowchart illustrating steps S101 to S106 of the method described in the specific implementation embodiment;

[0065] Figure 2 This is a flowchart illustrating steps S201 to S205 of the method described in the specific implementation embodiment;

[0066] Figure 3 This is a schematic diagram of the structure of the electronic device described in the specific embodiment.

[0067] The reference numerals used in the above figures are explained as follows:

[0068] 1. Electronic equipment;

[0069] 11. Memory;

[0070] 12. Processor. Detailed Implementation

[0071] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be particularly noted that the following embodiments are for illustrative purposes only and do not limit the scope of the invention. Similarly, the following embodiments are only some, not all, embodiments of the present invention, and all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0072] Please see Figure 1 This embodiment provides a method for sieving the grade of raw tea, including:

[0073] S101. Collect raw tea information according to a preset sampling frequency. The raw tea information includes a first visible light image, a first near-infrared spectral information, and a first three-dimensional morphological information.

[0074] S102. Preprocess the raw tea information to obtain standard raw tea information. The preprocessing includes illumination compensation, geometric correction and multi-source information registration. The standard raw tea information includes the registered second visible light image, second near-infrared spectral information and second three-dimensional morphological information.

[0075] S103. Perform multi-scale feature segmentation on the second visible light image and extract static quality parameters, including the curvature of the strands, the percentage of stems, and the distribution characteristics of the yellow patches. Also, perform feature band analysis on the second near-infrared spectral information to obtain physicochemical quality parameters.

[0076] S104. Perform spatial distribution analysis on the second three-dimensional morphological information and extract the strip structure features, which include strip compactness and surface texture features.

[0077] S105. Based on static quality parameters, physicochemical quality parameters and strip structure characteristics, the grade is determined by a cascaded decision model. The cascaded decision model is configured as a primary screening module based on an improved visual Transformer and a comprehensive scoring module based on a random forest.

[0078] S106. Based on the grade determination results, control the sorting device to execute a combination of sorting actions that match each grade.

[0079] In step S101, the collected raw tea information serves as the foundational data source for grading and screening. Specifically, the first visible light image can be acquired using an industrial camera under standard light conditions to record the appearance and morphological characteristics of the raw tea; the first near-infrared spectral information can be obtained using a spectrometer, reflecting the molecular vibrational characteristics of the internal chemical components of the raw tea; and the first three-dimensional morphological information can be acquired using a structured light scanning system, characterizing the spatial distribution characteristics of the tea strands. Preferably, this information is synchronized using a triggering device to ensure spatiotemporal consistency, providing multi-dimensional data support for subsequent analysis.

[0080] In step S102, the preprocessing transforms the raw data into a standard analysis format. Illumination compensation preferably uses the Retinex algorithm to decompose the illumination and reflection components, eliminating color differences caused by uneven illumination. Geometric correction calculates distortion parameters by detecting feature points at the edges of the linear structures, ensuring image dimensional accuracy. Preferably, multi-source information registration employs the SIFT feature point matching method to achieve spatial alignment between the two-dimensional image and the three-dimensional point cloud. The preprocessed second visible light image, second near-infrared spectral information, and second three-dimensional morphological information have a unified coordinate system and standard format.

[0081] In step S103, preferably, the multi-scale feature segmentation adopts a U-Net architecture with a fused edge-aware mechanism, accurately segmenting the stripe region by embedding learnable morphological convolutional kernels in the encoder-decoder skip connections. Preferably, the stripe curvature is calculated using the curvature field distribution of the 3D point cloud; the striation rate is detected by fusing gradient features extracted at different scales using a multi-branch feature pyramid network; and the yellow patch distribution is analyzed using a deep separable convolutional network to analyze the multispectral texture features of the HSV color space. Preferably, after filtering feature wavelengths using a continuous projection algorithm, a one-dimensional convolutional neural network based on an attention mechanism is used to establish the mapping relationship between the spectrum and the quality parameters for the physicochemical quality parameters.

[0082] In step S104, the spatial distribution analysis preferably employs a region-growing surface reconstruction algorithm to construct a three-dimensional model of the strip surface under the constraint of normal vector consistency. Preferably, the strip compactness is obtained by calculating the Gaussian curvature distribution through principal curvature analysis; the surface texture features are analyzed for uniformity parameters using a gray-level co-occurrence matrix after multi-view projection. These structural features, together with static quality parameters, constitute a complete quality evaluation system for raw tea.

[0083] In step S105, the cascaded decision model concatenates multidimensional parameters into a unified matrix through a feature fusion layer. Preferably, the primary screening module introduces a strip morphology constraint term in the visual Transformer to enhance the attention weight of morphological features. The comprehensive scoring module dynamically adjusts the weight allocation of the random forest through the Gini coefficient and uses Platt scaling to calibrate the probability distribution, and finally outputs the grade determination result.

[0084] In step S106, the sorting action combination is dynamically configured according to the grade determination result, and the physical separation of raw tea of ​​different grades is achieved by controlling the airflow valve, mechanical sorting arm and other actuators.

[0085] This embodiment transforms traditional sensory evaluation into a quantifiable intelligent sorting process through multi-source information fusion and cascaded decision-making. For example, when the tightness of the strips and the distribution characteristics of the yellow film are both below the threshold, the system will automatically classify the batch as secondary and trigger the corresponding sorting procedure.

[0086] This embodiment transforms the first visible light image, first near-infrared spectral information, and first three-dimensional morphological information into standard raw tea information through multi-source information acquisition and fusion processing, achieving multi-dimensional and accurate characterization of raw tea quality. The curvature of the tea strands, stem content, and yellow leaf distribution features extracted by multi-scale feature segmentation are used to complement and verify the physicochemical quality parameters obtained from feature band analysis. Combined with spatial distribution analysis results such as strand tightness and surface texture features, the cascaded decision model's grade determination considers both the correlation between appearance and internal quality while avoiding the limitations of a single evaluation index. By improving the cascaded decision-making of the visual Transformer's primary screening module and the random forest-based comprehensive scoring module, the generation of sorting action combinations retains the experiential dimensions of traditional tea evaluation while achieving the advantages of intelligent and precise sorting, effectively improving the accuracy and efficiency of raw tea grading.

[0087] Please see Figure 2 In some embodiments, multi-scale feature segmentation is performed on the second visible light image to extract static quality parameters, including:

[0088] S201. Input the second visible light image into the strip segmentation network. The strip segmentation network adopts a U-Net architecture with an edge-aware mechanism. By embedding learnable morphological convolutional kernels in the encoder-decoder skip connections, it outputs strip region segmentation results, including:

[0089] The standardized second visible light image is input into the encoder module of the improved U-Net architecture, and features are extracted using standard-sized square convolutional kernels;

[0090] Learnable morphological convolution kernels are embedded during each upsampling stage of the decoder module;

[0091] Output the strip region segmentation results;

[0092] S202. Input the strip region segmentation results into the 3D reconstruction module, acquire 3D point cloud data of the strip surface using structured light projection measurement technology, calculate the curvature field distribution characteristics based on differential geometry methods, and output curl quantification parameters, including:

[0093] Based on the strip region segmentation results, the region of interest is located in the 3D reconstruction system, a four-step phase-shift sinusoidal stripe pattern is projected, and deformed stripe images are acquired.

[0094] The absolute phase map of the strip surface is reconstructed using a phase unwrapping algorithm, and then converted into three-dimensional point cloud data by combining the system calibration parameters.

[0095] After reconstructing the 3D point cloud data using Poisson surfaces, the Gaussian curvature and mean curvature at each vertex are calculated to generate a curvature field distribution map.

[0096] The standard deviation and kurtosis coefficient of curvature values ​​in the curvature field distribution map are statistically analyzed, and the curvature quantification parameters are output after normalization.

[0097] S203. The second visible light image and the strip region segmentation results are input into the tea stem detection module. A multi-branch feature pyramid network is used to extract gradient features at the original resolution, 1 / 2 downsampling, and 1 / 4 downsampling scales, respectively. The multi-scale detection results are fused using a non-maximum suppression algorithm to output a tea stem distribution heatmap, including:

[0098] The strip region segmentation results are used as a mask to extract the Region of Interest (ROI) from the second visible light image;

[0099] The Sobel operator is used to extract horizontal and vertical gradient features in the original resolution branch, the HOG features are calculated in the 1 / 2 downsampling branch, and the LBP texture features are extracted in the 1 / 4 downsampling branch.

[0100] Multi-scale features are integrated through a three-level feature fusion layer of the feature pyramid network, and a preliminary detection response map is generated using a 3×3 convolutional kernel.

[0101] The non-maximum suppression algorithm is applied to eliminate overlapping detection boxes, and the final output is a heatmap of tea stem distribution that is spatially aligned with the input image. The pixel value represents the probability that a tea stem exists at that location.

[0102] S204. Input the second visible light image into the porn recognition module. Through HSV color space conversion combined with adaptive brightness compensation, a depthwise separable convolutional network is used to extract multispectral texture features, and output a porn probability distribution map, including:

[0103] The second visible light image is converted to the HSV color space, and adaptive brightness compensation based on histogram matching is performed on the V channel.

[0104] Construct a deep separable convolutional network to extract joint color-texture features;

[0105] At the end of the network, a spatial pyramid pooling layer is used to integrate multi-scale contextual information, and the probability of each pixel belonging to the porn category is output through the Softmax function;

[0106] Morphological post-processing is performed on the probability map to eliminate noise areas and generate the final pornographic probability distribution map;

[0107] S205. Based on the quantification parameters of curling, the heat map of tea stem distribution, and the probability distribution map of yellow leaves, generate static quality parameters that include strip morphology characteristics, stem content, and yellow leaf distribution characteristics, including:

[0108] The heatmap of tea stem distribution is binarized by setting a probability threshold, and the percentage of tea stem pixels is calculated as the stem content parameter.

[0109] The proportion of connected regions with probability values ​​greater than a preset probability threshold in the probability distribution map of pornographic films is statistically analyzed to generate pornographic film distribution density features.

[0110] The curl quantification parameter, the stem content parameter, and the yellow film distribution density feature are linearly combined according to a preset proportional weight;

[0111] Output standardized static quality parameters. The larger the value of the static quality parameter, the better the appearance quality.

[0112] In step S201, the second visible light image is input into the improved U-Net architecture. This architecture, based on the traditional encoder-decoder structure, effectively enhances the extraction capability of stripe edge features by embedding learnable morphological convolutional kernels at skip connections. The encoder module uses standard-sized square convolutional kernels for multi-level feature extraction, while the decoder gradually recovers spatial details through upsampling and feature fusion, ultimately outputting accurate stripe region segmentation results.

[0113] In step S202, the segmentation results of the tea strip regions guide the 3D reconstruction process. Preferably, a specific pattern is projected onto the tea surface using a structured light projection system. After acquiring deformed stripe images, a phase unwrapping algorithm is used to reconstruct high-precision 3D point cloud data. Based on differential geometry theory, the curvature field of the reconstructed surface is calculated. By statistically analyzing the standard deviation and kurtosis characteristics of the curvature distribution, it is finally converted into numerical parameters that can quantify the degree of strip curling, namely, the curling quantification parameters. The curling quantification parameters objectively reflect the tightness and morphological characteristics of the tea strips.

[0114] In step S203, combining the second visible light image and the strip region segmentation results, a multi-scale feature fusion strategy is used to detect tea stems. Gradient features (Sobel), histogram of oriented gradients (HOG), and local binary pattern (LBP) features are extracted at three different resolution scales, respectively. Cross-scale feature fusion is achieved through a feature pyramid network. The resulting distribution heatmap, after non-maximum suppression processing, can intuitively display the spatial distribution of tea stems, providing a data foundation for subsequent stem content calculation.

[0115] In step S204, for pornographic image recognition, the second visible light image is first enhanced with color features in the HSV color space, and illumination interference is eliminated through adaptive brightness compensation. A depthwise separable convolutional network combines pointwise convolution with spatial convolution to efficiently extract multispectral texture features. The spatial pyramid pooling layer at the end of the network integrates contextual information from different receptive fields, and the final output probability distribution map accurately reflects the likelihood of each pixel belonging to the pornographic category.

[0116] In step S205, the quantitative parameters of tea curling, the heat map of tea stem distribution, and the probability distribution map of yellow leaves are linearly fused using a preset weighting ratio. The stem content directly reflects the impurity content, the distribution characteristics of yellow leaves characterize the color uniformity, and the morphological characteristics of the tea leaves reflect the appearance quality. The final static quality parameters are standardized to form an intuitive score in the range of 0-100, providing an objective and quantitative basis for evaluating the appearance quality of tea.

[0117] This embodiment utilizes a U-Net architecture incorporating edge-aware mechanisms to segment the second visible light image, achieving multi-level and accurate extraction of tea appearance features. Learnable morphological convolution kernels enhance the extraction capability of strip edge features, ensuring that the segmentation results retain complete morphological features while significantly improving the accuracy of edge detail recognition. By combining structured light projection measurement technology with differential geometry methods, curvature field distribution features are calculated from 3D point cloud data, enabling the curvature quantification parameters to objectively reflect the tightness and morphological characteristics of the strips. A multi-branch feature pyramid network is employed to simultaneously extract gradient and texture features across multiple scales, combined with nonmaximum features. The value suppression algorithm maintains high detection sensitivity in the tea stem distribution heatmap while effectively reducing the false detection rate. The HSV color space analysis method based on a deep separable convolutional network, combined with adaptive brightness compensation processing, accurately identifies areas of abnormal color in the yellow leaf probability distribution map while eliminating the influence of lighting conditions. Finally, standardized static quality parameters are generated through weighted fusion of multiple feature parameters. This ensures that the evaluation results comprehensively cover key quality elements such as leaf morphology, stem content, and yellow leaf distribution, while achieving objective consistency in quantitative scoring. It effectively integrates the advantages of traditional tea evaluation experience with modern computer vision technology, significantly improving the accuracy and reliability of tea appearance quality evaluation.

[0118] In some embodiments, obtaining physicochemical quality parameters by performing characteristic band analysis on the second near-infrared spectral information includes:

[0119] The second near-infrared spectral information is filtered within a preset wavelength range using a continuous projection algorithm to obtain a combination of characteristic wavelengths. The preset wavelength range includes a first preset band reflecting the moisture content of tea leaves and a second preset band reflecting the polyphenol content of tea leaves. The combination of characteristic wavelengths includes preset wavelength spectral information.

[0120] The preset wavelength spectral information is input into a one-dimensional convolutional neural network based on an attention mechanism to establish a nonlinear mapping relationship between spectral features and physicochemical parameters, and output prediction information, including predicted moisture content and predicted tea polyphenol content.

[0121] The predicted information is weighted and integrated according to the preset tea quality standards to generate comprehensive physicochemical quality parameters.

[0122] In this embodiment, the second near-infrared spectral information is filtered within a preset wavelength range using a continuous projection algorithm to obtain a combination of characteristic wavelengths, including:

[0123] Preprocessing of the second near-infrared spectral information includes:

[0124] The Savitzky-Golay convolutional smoothing algorithm is used to eliminate spectral noise;

[0125] Perform standard normal variable transformation (SNV) correction to eliminate scattering effects;

[0126] Multivariate scattering correction (MSC) is performed to compensate for optical path differences;

[0127] Within a first preset wavelength band, a continuous projection algorithm is applied to filter characteristic wavelengths of moisture, including:

[0128] Initialize the projection vector as the first column vector of the original spectral matrix;

[0129] The projection weights of each wavelength variable are calculated iteratively through the Gram-Schmidt orthogonalization process.

[0130] Wavelength points with projection weights greater than a preset threshold are retained to form a subset of moisture characteristic wavelengths;

[0131] The characteristic wavelengths of tea polyphenols are screened by repeated continuous projection algorithm within the second preset band, including:

[0132] Reinitialize the projection vector to the spectral intensity value corresponding to the starting wavelength of the current band;

[0133] Calculate the projection residuals of each wavelength variable onto the orthogonal complement space;

[0134] Select the wavelength combination that minimizes the sum of squared predicted residuals to form a subset of characteristic wavelengths for tea polyphenols;

[0135] The characteristic wavelength subsets of moisture and tea polyphenols are combined to generate the final characteristic wavelength combination, including:

[0136] Remove duplicate wavelength points from two subsets;

[0137] Verify the collinearity problem of characteristic wavelength combinations;

[0138] The output contains a feature wavelength combination matrix containing preset wavelength spectral information.

[0139] The preset wavelength spectral information is input into a one-dimensional convolutional neural network based on an attention mechanism to establish a nonlinear mapping relationship between spectral features and physicochemical parameters, and output prediction information, including:

[0140] The input spectral information matrix is ​​subjected to three layers of one-dimensional convolution operations in sequence. The first layer uses a 5×1 convolution kernel to extract wideband features, and the second and third layers use 3×1 convolution kernels to refine local features. After each convolution, the ReLU activation function and batch normalization are applied, and finally, the channel feature vector is obtained by global average pooling.

[0141] The SE attention mechanism is embedded in the channel feature vector. The spatial dimension is compressed by global average pooling to generate channel statistics. The nonlinear relationship between channels is learned through two fully connected layers and the weight coefficients of each channel are output. The weight coefficients are multiplied with the original feature vector channel by channel to achieve feature recalibration.

[0142] The attention-weighted feature vectors are input into two parallel fully connected network branches. The first branch maps the moisture content feature through three fully connected layers and uses the Sigmoid function to constrain the output to the range of 0-1. The second branch uses the same network structure to predict the tea polyphenol content.

[0143] The mean squared error is used as the loss function, and the model parameters are dynamically adjusted by the Adam optimizer. During the training process, the change of the validation set loss is monitored and an early stopping mechanism is used to prevent overfitting. Finally, the predicted values ​​of moisture content and tea polyphenol content are output after inverse normalization.

[0144] In this embodiment, the second near-infrared spectral information is tea spectral data acquired in real time by an online detection device, which includes characteristic absorption peaks reflecting the internal components of the tea. The characteristic wavelength combination is a set of key spectral variables selected from a preset wavelength range, including a first wavelength subset reflecting moisture characteristics and a second wavelength subset reflecting tea polyphenol characteristics, which together constitute the preset wavelength spectral information. The predicted moisture content and predicted tea polyphenol content are standardized parameters output by a neural network model, representing the moisture content and phenolic abundance of the tea, respectively.

[0145] Preferably, when using the continuous projection algorithm for feature wavelength selection, the initialization parameter is set to the first column vector of the spectral matrix. The wavelength projection weights are calculated iteratively using Gram-Schmidt orthogonalization, and wavelengths with weight values ​​greater than 0.85 are retained to form a feature subset. For moisture characteristic bands, absorption peaks in the 1380-1450 nm range are preferentially selected; for tea polyphenol characteristic bands, the characteristic spectral lines in the 1600-1700 nm range are analyzed in detail.

[0146] The attention-based one-dimensional convolutional neural network comprises a feature extraction module and two prediction branches. The feature extraction module uses a three-layer convolutional structure: the first layer uses a 5×1 kernel to extract broad-band features, and the latter two layers use 3×1 kernels to refine local features. The output of each layer is activated by ReLU and batch normalized. The SE attention module generates channel statistics through global average pooling, and then learns the channel weights through a fully connected layer to achieve feature recalibration. The moisture prediction branch and the tea polyphenol prediction branch share attention-weighted feature vectors and output standardized prediction values ​​through three fully connected layers, respectively.

[0147] The implementation principle of this embodiment lies in establishing a precise mapping relationship between spectral features and physicochemical parameters. Specifically, when the absorption intensity of the first preset band increases, the Sigmoid output value of the moisture prediction branch increases accordingly; when the features of the second preset band change, the tea polyphenol prediction branch can automatically adjust the weight distribution of the fully connected layer. Through the dynamic learning of the Adam optimizer, the model can continuously optimize the convolution kernel parameters and attention weights, reducing prediction errors. The final generated prediction information can be directly used in the weighted fusion module of the quality evaluation system to achieve online detection of the physicochemical quality of tea.

[0148] In some embodiments, spatial distribution analysis of the second three-dimensional morphological information is performed to extract the features of the strand structure, including:

[0149] The second three-dimensional morphological information is input into the surface reconstruction algorithm model of the region growing to obtain the three-dimensional model of the strip surface. The surface reconstruction algorithm model is configured to perform neighborhood point aggregation under the normal vector consistency constraint.

[0150] The surface convexity and concaveness features of the three-dimensional model of the strip surface are calculated through principal curvature analysis, and the strip compactness parameters are output. The strip compactness parameters include Gaussian curvature distribution information and average curvature value.

[0151] The three-dimensional model of the strip surface is projected from multiple perspectives, and the texture features of the projected image are analyzed using the gray-level co-occurrence matrix to output the surface texture uniformity parameters.

[0152] Based on the bar compactness parameter and the surface texture uniformity parameter, bar structure features are generated.

[0153] In this embodiment, the second three-dimensional morphological information is input into the surface reconstruction algorithm model of region growing to obtain a three-dimensional model of the strip surface, including:

[0154] Preprocessing of the second three-dimensional morphological information includes:

[0155] Statistical outlier filtering is used to remove noise points;

[0156] Point cloud downsampling is performed using voxel grid filtering;

[0157] Calculate point cloud normal vectors and construct a KD-Tree to accelerate neighborhood search;

[0158] Neighborhood point aggregation under normal vector consistency constraints includes:

[0159] Initialize the seed point as the point with the minimum curvature;

[0160] Set the threshold for the included angle of the normal vectors to not exceed 15 degrees;

[0161] The maximum growth step size is set to 1 mm;

[0162] Output a 3D model of the striped surface with topological consistency.

[0163] The surface unevenness of the cable surface is calculated using principal curvature analysis based on the 3D model of the cable surface, and the cable compactness parameters are output, including:

[0164] The local surface was fitted using the moving least squares method;

[0165] Calculate the principal curvature of each triangular facet;

[0166] Calculate the Gaussian curvature and mean curvature based on the principal curvature;

[0167] Statistical analysis of Gaussian curvature distribution and mean curvature;

[0168] The output includes information on the Gaussian curvature distribution and the average curvature value, which are parameters related to the density of the strips.

[0169] The 3D model of the striped surface is projected from multiple perspectives, and the texture features of the projected images are analyzed using the gray-level co-occurrence matrix, including:

[0170] Six orthogonal viewpoints are set along the main axis of the cable;

[0171] Generate parallel projection grayscale images from various viewpoints;

[0172] Calculate the gray-level co-occurrence matrix for each image;

[0173] Extract four texture features: contrast, energy, homogeneity, and entropy.

[0174] Calculate the mean of texture features from each viewpoint;

[0175] Output surface texture uniformity parameters.

[0176] Based on the bar compactness parameter and surface texture uniformity parameter, bar structure features are generated, including:

[0177] Normalize the Gaussian curvature distribution information;

[0178] The average curvature value is weighted and fused with the mean of texture features;

[0179] Output structural feature vectors that characterize the integrity of the strand morphology.

[0180] In this embodiment, the second three-dimensional morphological information is the point cloud data of tea strips obtained through three-dimensional scanning, which includes coordinate information and normal vector information reflecting the surface geometric features. The three-dimensional model of the strip surface is a surface model reconstructed by a region growing algorithm, including curvature parameters reflecting surface compactness and projection features reflecting texture uniformity, which together constitute the strip structure features. The strip compactness parameter and the surface texture uniformity parameter are standardized parameters output through multi-stage analysis, respectively characterizing the physical compactness and texture distribution characteristics of the strips.

[0181] Preferably, when using a region-growing surface reconstruction algorithm for 3D modeling, the initialization parameters are set to the point with the minimum curvature. Neighborhood aggregation is performed through normal vector consistency constraints, the threshold for the included angle of the normal vectors is set to not exceed 15 degrees, and the maximum growth step size is limited to 1 mm to ensure the topological consistency of the reconstructed model. For curvature analysis, the moving least squares method is preferentially used to fit the local surface, and the Gaussian curvature and average curvature of the triangular facets are calculated. For texture analysis, six orthogonal viewpoints are set along the principal axis of the stripes, and four features—contrast, energy, homogeneity, and entropy—are extracted through the gray-level co-occurrence matrix.

[0182] The generation process of the ribbed structure features includes three modules: 3D reconstruction, curvature analysis, and texture analysis. The 3D reconstruction module uses statistical outlier filtering and voxel mesh filtering for point cloud preprocessing and constructs a KD-Tree to accelerate neighborhood search. The curvature analysis module calculates the principal curvature and outputs the Gaussian curvature distribution and mean curvature. The texture analysis module uses multi-view projection images to statistically analyze the mean texture features of the gray-level co-occurrence matrix. Finally, the compactness parameter and texture uniformity parameter are normalized and weighted to generate a structural feature vector representing the integrity of the ribbed morphology.

[0183] The implementation principle of this embodiment lies in establishing a precise mapping relationship between three-dimensional morphological features and tea strip quality. When the Gaussian curvature distribution exhibits high discreteness, the tea strip compactness parameter decreases accordingly; when the contrast and energy values ​​of the texture features fluctuate significantly, the surface texture uniformity parameter is automatically adjusted. Through dual control of normal vector constraints and curvature optimization, the algorithm can effectively suppress noise interference and reduce reconstruction errors. The final generated structural features can be directly used in the morphological analysis module of the tea quality evaluation system to achieve automated detection of the physical properties of the tea strips.

[0184] In some embodiments, the grade determination based on static quality parameters, physicochemical quality parameters, and strip structure characteristics, using a cascaded decision model, includes:

[0185] Static quality parameters, physicochemical quality parameters, and strip structure features are tensor-concatenated through a feature fusion layer to generate a multidimensional feature matrix.

[0186] The multidimensional feature matrix is ​​input into the primary filtering module for filtering, and preliminary filtering results are obtained, including:

[0187] In the query-key value attention weight calculation, a strip morphology constraint term is introduced to obtain morphological gradient features. The strip morphology constraint term is implemented by the dot product operation of the strip midline curvature and the attention weight.

[0188] By fusing morphological gradient features with Transformer deep features, enhanced stripe features are obtained;

[0189] The strengthening strip features are filtered according to a preset quality threshold, and the preliminary filtering results are output. The strengthening strip features in the preliminary filtering results are recorded as primary filtering features.

[0190] The initial screening features are input into the comprehensive scoring module to obtain the grade probability distribution, including:

[0191] The weight allocation of the primary screening features is dynamically adjusted by the Gini coefficient, and a decision tree of no less than a preset number is configured to perform bagging ensemble prediction to obtain the original prediction probability.

[0192] The Platt scaling method is used to calibrate the distribution of the original predicted probabilities, and the level probability distribution is output.

[0193] The probability distribution of the levels is divided according to the preset level division threshold to generate the final level determination result.

[0194] In this embodiment, the primary screening module is configured as a network architecture based on an improved visual Transformer, including:

[0195] The multi-head attention calculation layer introduces a bar shape constraint term in the query-key value attention weight calculation. The constraint term is implemented by the dot product operation of the bar midline curvature and the attention weight.

[0196] The feature enhancement layer performs channel-level fusion of morphological gradient features and Transformer deep features;

[0197] The screening decision-making level outputs preliminary screening results based on preset hard quality thresholds;

[0198] The feature matrix of the preliminary screening results is input into the comprehensive scoring module, which is configured as an ensemble learning architecture based on random forest, including:

[0199] The feature importance weighting layer dynamically adjusts the weight allocation of each input feature using the Gini coefficient;

[0200] A multi-tree parallel prediction layer is configured with no fewer than 50 decision trees for bagging ensemble prediction.

[0201] The probability calibration layer uses the Platt scaling method to calibrate the distribution of the original predicted probabilities and outputs the level probability distribution;

[0202] The probability distribution of the grades is transformed by the decision rule conversion module, and the final grade determination result is generated according to the preset grade division threshold.

[0203] In this embodiment, static quality parameters, physicochemical quality parameters, and strip structure features are tensor-concatenated through a feature fusion layer to generate a multi-dimensional feature matrix containing multi-source feature information. This multi-dimensional feature matrix integrates key indicators reflecting the appearance, composition, and morphology of tea leaves, providing a unified feature representation for subsequent grading.

[0204] The initial screening features are a subset of bar features enhanced by the attention mechanism, obtained through morphological constraint filtering, and used for subsequent level determination. Preferably, the initial screening module uses an improved visual Transformer architecture, the core of which lies in introducing bar morphological constraint terms into the query-key-value attention calculation. The bar morphological constraint term is implemented through the dot product of the bar midline curvature and the attention weights, allowing the model to consider the physical morphological characteristics of the bars when calculating feature relevance. Morphological gradient features and Transformer deep features are fused at the channel level through a feature enhancement layer to form enhanced bar features. The screening decision layer filters the enhanced features based on a preset quality threshold, outputting preliminary screening results.

[0205] The comprehensive scoring module uses a random forest ensemble architecture to determine the final ranking. A feature importance weighting layer dynamically adjusts the weights of each input feature using the Gini coefficient, ensuring that key features dominate the decision-making process. A multi-tree parallel prediction layer configures a preset number of decision trees for bagging ensemble prediction, generating the original predicted probabilities through a majority voting mechanism. A probability calibration layer uses the Platt scaling method to calibrate the distribution of the original probabilities, ensuring that the output probabilities are consistent with the true ranking distribution.

[0206] This embodiment introduces a strip morphology constraint term, enabling the model to consider the physical morphological characteristics of tea leaves during the feature extraction stage; it employs a dynamic weighting mechanism based on the Gini coefficient to ensure reasonable weight allocation for different quality characteristics; and it combines Platt probability calibration to improve the reliability of grading. The final output grading probability distribution is converted into specific grading results through a preset threshold, providing a decision-making basis for automated tea grading.

[0207] In some embodiments, illumination compensation includes the following steps:

[0208] The first visible light image is subjected to global illumination correction using a brightness equalization algorithm, and the first preliminary corrected image is output.

[0209] The first preliminary corrected image is input into the local illumination compensation model, which is configured to be constructed based on Retinex theory, to obtain the reflection component and the illumination component.

[0210] The reflection component is enhanced with adaptive gamma correction to produce a second preliminary corrected image with uniform illumination.

[0211] Geometric correction includes the following steps:

[0212] Detect stripe edge feature points in the second preliminary corrected image;

[0213] Calculate lens distortion parameters and projection transformation matrix to perform geometric correction, and obtain the third preliminary corrected image;

[0214] Multi-source information registration includes the following steps:

[0215] The third preliminary corrected image is spatially aligned with the second three-dimensional morphological information to output the registered second visible light image, including:

[0216] Extract the SIFT feature point set from the third preliminary corrected image, and match the SIFT feature point set with the three-dimensional feature points in the second three-dimensional morphological information to obtain the matching result;

[0217] Calculate the optimal spatial transformation parameters based on the matching results and perform registration.

[0218] In this embodiment, the first visible light image is subjected to global illumination correction using a brightness equalization algorithm, including:

[0219] Calculate the histogram distribution of the luminance components of the first visible light image, and establish a reference histogram model under standard illumination conditions;

[0220] The histogram distribution of the luminance components is mapped to the reference histogram model using a histogram specification algorithm to obtain the first preliminary correction map;

[0221] The first preliminary corrected image is input into the local illumination compensation model, which is configured to be constructed based on Retinex theory, to obtain the reflection component and the illumination component, including:

[0222] Gaussian pyramid decomposition was used to obtain illumination components at different scales;

[0223] Separate the reflection component and the illumination component within the scale space;

[0224] An adaptive smoothing filter is applied to the illumination component to obtain the reflection component and the corrected illumination component.

[0225] The reflection component is enhanced with adaptive gamma correction to produce a second, pre-corrected image with uniform illumination, including:

[0226] Calculate the contrast index of a local area and dynamically adjust the gamma value based on the contrast index.

[0227] Nonlinear enhancement is applied to low-contrast regions;

[0228] Output a processed visible light image with uniform illumination.

[0229] In this embodiment, the illumination compensation process employs a multi-level correction strategy to optimize image quality. First, a brightness equalization algorithm is applied to the first visible light image for global illumination correction. This process establishes a reference histogram model under standard illumination conditions and uses a histogram specification algorithm to map the brightness component distribution of the original image to the reference model space, generating a first preliminary corrected image with standard illumination characteristics. Subsequently, a local illumination compensation model based on Retinex theory performs depth processing on the image. Gaussian pyramid decomposition separates the reflection and illumination components in multi-scale space, and adaptive smoothing filtering is applied to the illumination component, ultimately obtaining the reflection component and corrected illumination component that reflect the essential characteristics of the object. To enhance detail, adaptive gamma correction is applied to the separated reflection component. This process dynamically adjusts the gamma parameter by analyzing the contrast index of local areas and performs nonlinear enhancement processing on low-contrast areas, outputting a second preliminary corrected image with uniform illumination performance.

[0230] Geometric correction processing compensates for physical distortions in the imaging system. The process begins by detecting the edge feature points of the tea leaves in the second preliminary corrected image as reference markers. Then, by calculating lens distortion parameters and the projection transformation matrix, mathematical modeling and inverse compensation are performed on geometric distortions such as barrel and pincushion distortion, generating a geometrically accurate third preliminary corrected image. This stage specifically preserves the curvature characteristics and relative positional relationships of the tea leaves to ensure that subsequent processing accurately reflects the actual physical form of the tea.

[0231] Multi-source information registration achieves spatial alignment between visible light images and 3D morphological data. During processing, the SIFT feature point set of the third preliminary corrected image is extracted and matched with the 3D feature points in the second 3D morphological information. Optimal transformation parameters, including rotation matrices and translation vectors, are calculated based on the spatial distribution of the feature points. The registration process employs an iterative nearest-point algorithm to optimize spatial transformation accuracy, ultimately outputting a second visible light image with strictly corresponding spatial positions, establishing an accurate spatial reference for subsequent multimodal feature fusion.

[0232] This embodiment uses a three-level correction processing chain to systematically solve key problems such as uneven illumination, geometric distortion, and misalignment of multi-source data during the imaging process, providing a reliable image data foundation for quality analysis.

[0233] This embodiment transforms the original visible light image into a second visible light image with uniform illumination and accurate geometric shape through multi-level illumination compensation and geometric correction, solving the feature distortion problem caused by uneven illumination and lens distortion during tea imaging. It utilizes a local illumination compensation model based on Retinex theory to separate the reflection and illumination components, combined with adaptive gamma correction to enhance details in low-contrast areas. This significantly improves local contrast while preserving the essential characteristics of the tea strands, providing a high-fidelity visual data foundation for subsequent morphological analysis and quality assessment. Multi-source information registration achieves spatial alignment between the visible light image and three-dimensional morphological information, ensuring precise correspondence between the two-dimensional texture features and three-dimensional geometric features of the tea strands. This ensures spatial consistency in multimodal feature fusion and avoids feature misalignment caused by registration errors. The three-level correction chain of illumination-geometric-spatial constructed in this embodiment provides a stable and reliable image preprocessing scheme for automated tea sorting systems, effectively improving the accuracy and robustness of subsequent quality analysis modules.

[0234] In some embodiments, preprocessing further includes:

[0235] The first near-infrared spectral information is processed by a sliding window. Within each window, a quadratic polynomial is used to fit the spectral curve. The smoothed spectral intensity value is calculated using the coefficients of the fitted polynomial, and the first preprocessed spectral information is output.

[0236] Calculate the average absorbance of the first preprocessed spectral information at all wavelengths, calculate the standard deviation of the absorbance at each wavelength, perform a normalization transformation, and output the second preprocessed spectral information.

[0237] Principal component analysis was performed on the second preprocessed spectral information to obtain the second near-infrared spectral information.

[0238] In this embodiment, near-infrared spectral preprocessing employs a three-level optimization strategy to achieve noise reduction and feature enhancement of spectral data. First, a sliding window process is applied to the original first near-infrared spectral information. An approximate mathematical model of the spectral curve is established within a local window using a quadratic polynomial fitting algorithm. The fitted polynomial coefficients are then used to reconstruct a smooth spectrum, effectively suppressing high-frequency noise interference and outputting first-processed spectral information with improved signal-to-noise ratio. Subsequently, the spectral data is standardized using statistical methods. A benchmark reference is established by calculating the average absorbance across the entire wavelength range. The standard deviation is normalized by considering the dispersion of absorbance at each wavelength point, eliminating systematic errors introduced by instrument fluctuations and differences in the measurement environment, and generating second-processed spectral information with a unified dimensional standard.

[0239] In the feature extraction stage, principal component analysis (PCA) is used to reduce the dimensionality of the standardized spectra. By calculating the covariance characteristics of the spectral matrix, key principal component vectors reflecting the differences in the intrinsic components of tea are determined. The high-dimensional spectral data is projected into a low-dimensional feature space, which can effectively extract the combination of characteristic bands related to the physicochemical quality of tea while preserving the original spectral information, and output second near-infrared spectral information with clear physical meaning.

[0240] This embodiment employs a sliding window smoothing process and a polynomial fitting algorithm to suppress noise in the original near-infrared spectrum, effectively eliminating high-frequency random interference during spectral acquisition and significantly improving the signal-to-noise ratio of the first preprocessed spectral information. Utilizing a statistically based standardization transformation method, the second preprocessed spectral information is normalized by calculating the average absorbance and standard deviation across all wavelengths, ensuring a unified dimensional standard. This overcomes systematic biases between different measurement batches while preserving the essential spectral characteristics of the tea samples. Principal component analysis is used to extract features and reduce the dimensionality of the high-dimensional spectral data, transforming the second near-infrared spectral information into a low-dimensional feature vector reflecting the key physicochemical properties of tea. This solves the problem of dimensional redundancy in spectral data and highlights characteristic bands relevant to quality evaluation. The "smoothing-standardization-dimensionality reduction" three-level spectral preprocessing system constructed in this embodiment provides high-precision, low-noise feature inputs for subsequent tea physicochemical parameter inversion, effectively ensuring the accuracy and stability of the quality analysis model.

[0241] In some embodiments, preprocessing further includes:

[0242] The first three-dimensional morphological information is filtered for noise using a point cloud denoising algorithm, including:

[0243] The first three-dimensional morphological information is converted into a first point cloud model, and the neighborhood spatial distribution characteristics of each point in the first point cloud model are calculated.

[0244] Outliers are removed based on the spatial distribution characteristics of the neighborhood to obtain a preliminary denoised point cloud;

[0245] The initial denoised point cloud is simplified using a voxel grid downsampling algorithm, including:

[0246] A three-dimensional voxel space partitioning structure is established, which includes multiple voxel units.

[0247] Retain representative point cloud data within each voxel unit and output the downsampled point cloud;

[0248] The downsampled point cloud is corrected using a surface optimization algorithm, including:

[0249] Analyze the local surface geometric features of the downsampled point cloud, correct outliers that do not conform to the preset topological rules, and output the second three-dimensional morphological information.

[0250] In this embodiment, a three-level optimization processing chain is constructed for the processing of three-dimensional morphological information. First, point cloud denoising processing is performed on the original first three-dimensional morphological information: by converting the three-dimensional data into a first point cloud model, the neighborhood spatial distribution characteristics of each sampling point (including parameters such as neighborhood density and normal vector consistency) are calculated. Based on the spatial distribution characteristics, outliers that do not conform to the distribution pattern are identified and removed, and a preliminary denoised point cloud that retains the original geometric features is generated.

[0251] In the data simplification stage, voxel mesh downsampling technology is adopted: a three-dimensional voxel space partitioning structure covering the point cloud space is established, and the most geometrically representative point cloud data is retained in each voxel unit through the centroid coordinate algorithm. While reducing the amount of data, the integrity of key morphological features is ensured, and high-fidelity downsampled point cloud is output.

[0252] Preferably, the surface optimization stage employs a surface reconstruction algorithm based on MLS (Moving Least Squares): it analyzes the local curvature characteristics and normal vector continuity of the downsampled point cloud, performs smooth interpolation processing on regions with geometrical abrupt changes, corrects topological anomalies caused by sampling errors, and finally outputs second 3D morphological information with complete surface characteristics. This processing chain system solves the common problems of noise interference, data redundancy, and surface damage in 3D scanning data.

[0253] This embodiment employs a point cloud denoising algorithm to filter noise from the first 3D morphological information. Based on neighborhood spatial distribution characteristics, it effectively identifies and removes outliers, significantly improving the geometric fidelity of the 3D point cloud data. A voxel mesh downsampling algorithm simplifies the initially denoised point cloud data. Through 3D voxel space partitioning and a representative point cloud retention mechanism, it achieves efficient data compression while ensuring the integrity of key morphological features. An MLS-based surface optimization algorithm is used to geometrically correct the downsampled point cloud. Through local curvature feature analysis and normal vector continuity detection, it accurately corrects topological anomalies caused by sampling errors. The preprocessing method constructed in this embodiment not only solves the common noise interference problem of raw 3D scan data but also optimizes data storage and processing efficiency, while ensuring the geometric accuracy and topological integrity of the output point cloud model. This provides a high-precision 3D data foundation for subsequent tea morphological feature extraction and quality analysis.

[0254] In a second aspect, this embodiment also provides a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the method described in the first aspect.

[0255] The computer program involved in this embodiment can be stored in a computer device readable storage medium, which includes, but is not limited to, disks, magnetic tapes, magnetic cards, floppy disks, flash memory, optical disks, optical cards, read-only memory (ROM), random access memory (RAM), erasable programmable ROM (EPROM), and electrically erasable programmable ROM (EEPROM), etc. It also includes other biological, physical, or chemical structures capable of performing similar or equivalent functions to the storage media listed above, such as DNA, RNA, proteins, and other units with information storage capabilities. In specific embodiments, the storage medium involved can be one of the above-mentioned media types or a combination of the above media types. In different embodiments, the computer program involved in the embodiment can be centrally stored in a single medium or distributed across multiple media. The memory containing the computer device readable storage medium can be non-volatile memory or random access memory. These computer device readable storage media can be built into the device or connected to the device involved in the embodiment as an external device or part of an external device. In some embodiments, the memory having a computer device readable storage medium is deployed locally; in other embodiments, the memory may be deployed remotely from the processor, for example, as a network-attached memory accessed via RF circuitry or an external port and a communication network, wherein the communication network may be the Internet, one or more intranets, a local area network (LAN), a wide area network (WLAN), a storage area network (SAN), or a suitable combination thereof, as long as computer device access to the memory is enabled. Furthermore, the computer program involved in the embodiments may be stored in plaintext / ciphertext form, or it may be designed as training data, integrated and recombined through model training and implicitly stored in the parameter states of a deep neural network or other machine learning model.

[0256] Please see Figure 3 In a third aspect, this embodiment also provides an electronic device 1, including a memory 11 and a processor 12, wherein the memory 11 is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor 12 to implement the method described in the first aspect.

[0257] The processor described in this embodiment can be implemented by hardware, firmware, software, or a combination thereof. It can be a circuit, one or more of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field-programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, or a microprocessor. It also includes other physical, biological, or chemical structures that can implement the same or equivalent functions as the processors listed above, such as biological neurons, quantum computing units, DNA computing units, etc., so that the processor can execute some or all of the steps in the computer program or method involved in the various embodiments of this application, or any combination of the steps mentioned therein.

[0258] Unlike existing technologies, the above technical solution has the following advantages: By acquiring and fusing multi-source information, visible light images, near-infrared spectral information, and three-dimensional morphological information are transformed into standard raw tea information, achieving multi-dimensional and accurate characterization of raw tea quality. The characteristics of leaf curl, stem content, and yellow leaf distribution extracted using multi-scale feature segmentation are complemented and validated by physicochemical quality parameters obtained from feature band analysis. Combined with spatial distribution analysis results such as leaf compactness and surface texture features, the cascaded decision model's grading considers both the correlation between appearance and internal quality while avoiding the limitations of a single evaluation index. By improving the cascaded decision-making of the visual Transformer's primary screening module and the random forest-based comprehensive scoring module, the generation of sorting action combinations retains the experiential dimensions of traditional tea evaluation while achieving the advantages of intelligent and precise sorting.

[0259] The aforementioned technical solution constructs a complete data processing chain, ensuring image data quality through multi-level illumination compensation and geometric correction; optimizing spectral data using sliding window smoothing and principal component analysis; and enhancing the accuracy of 3D morphological information through point cloud denoising, voxel downsampling, and surface optimization. These preprocessing steps provide a reliable data foundation for subsequent feature extraction. The fusion analysis of multimodal features and the innovative design of the cascaded decision model effectively improve the accuracy, stability, and sorting efficiency of raw tea grading.

[0260] The above description is only a part of the embodiments of the present invention and does not limit the scope of protection of the present invention. Any equivalent device or equivalent process transformation made based on the content of the present invention specification and drawings, or direct or indirect application in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for grading raw tea, characterized in that, include: Raw tea information is collected according to a preset sampling frequency. The raw tea information includes a first visible light image, a first near-infrared spectral information, and a first three-dimensional morphological information. The original raw tea information is preprocessed to obtain standard raw tea information. The preprocessing includes illumination compensation, geometric correction and multi-source information registration. The standard raw tea information includes the registered second visible light image, second near-infrared spectral information and second three-dimensional morphological information. Multi-scale feature segmentation is performed on the second visible light image to extract static quality parameters, including stripe curl, stem content, and yellow patch distribution characteristics, including: The second visible light image is input into the strip segmentation network, which adopts a U-Net architecture with a fused edge-aware mechanism. By embedding learnable morphological convolutional kernels in the encoder-decoder skip connections, the strip region segmentation result is output. The segmentation results of the strip region are input into the three-dimensional reconstruction module. The three-dimensional point cloud data of the strip surface is obtained by structured light projection measurement technology. The curvature field distribution characteristics are calculated based on the differential geometry method, and the curling quantification parameters are output. The second visible light image and the strip region segmentation result are input into the tea stem detection module. A multi-branch feature pyramid network is used to extract gradient features at the original resolution, 1 / 2 downsampling and 1 / 4 downsampling scale spaces, respectively. The multi-scale detection results are fused by the non-maximum suppression algorithm to output a heat map of tea stem distribution. The second visible light image is input into the porn recognition module. Through HSV color space conversion and adaptive brightness compensation, a depth-separable convolutional network is used to extract multispectral texture features and output a porn probability distribution map. Based on the curling quantification parameters, the tea stem distribution heatmap, and the yellow leaf probability distribution map, static quality parameters including strip morphology characteristics, stem content, and yellow leaf distribution characteristics are generated. Furthermore, characteristic band analysis is performed on the second near-infrared spectral information to obtain physicochemical quality parameters; Spatial distribution analysis is performed on the second three-dimensional morphological information to extract the strip structure features, which include strip compactness and surface texture features. Based on the static quality parameters, physicochemical quality parameters, and strip structure characteristics, a cascaded decision model is used to determine the grade. The cascaded decision model is configured as a primary screening module based on an improved visual Transformer and a comprehensive scoring module based on a random forest. Based on the grade determination results, the control sorting device executes a combination of sorting actions that match each grade.

2. The method for grading raw tea according to claim 1, characterized in that, The physicochemical quality parameters obtained by performing characteristic band analysis on the second near-infrared spectral information include: The second near-infrared spectral information is filtered within a preset wavelength range using a continuous projection algorithm to obtain a combination of characteristic wavelengths. The preset wavelength range includes a first preset band reflecting the moisture content of tea leaves and a second preset band reflecting the polyphenol content of tea leaves. The combination of characteristic wavelengths includes preset wavelength spectral information. The preset wavelength spectral information is input into a one-dimensional convolutional neural network based on an attention mechanism to establish a nonlinear mapping relationship between spectral features and physicochemical parameters, and output prediction information, including predicted moisture content and predicted tea polyphenol content. The predicted information is weighted and fused according to preset tea quality standards to generate comprehensive physicochemical quality parameters.

3. The method for grading raw tea according to claim 1, characterized in that, Spatial distribution analysis of the second three-dimensional morphological information was performed to extract the features of the strand structure, including: The second three-dimensional morphological information is input into the surface reconstruction algorithm model of the region growing to obtain the three-dimensional model of the strip surface. The surface reconstruction algorithm model is configured to perform neighborhood point aggregation under the normal vector consistency constraint. The surface convexity and concaveness features of the three-dimensional model of the strip surface are calculated through principal curvature analysis, and the strip compactness parameters are output. The strip compactness parameters include Gaussian curvature distribution information and average curvature value. The three-dimensional model of the strip surface is projected from multiple perspectives, and the texture features of the projected image are analyzed using the gray-level co-occurrence matrix to output the surface texture uniformity parameters. The strip structure features are generated based on the strip compactness parameter and the surface texture uniformity parameter.

4. The method for grading raw tea according to claim 1, characterized in that, Based on the aforementioned static quality parameters, physicochemical quality parameters, and strip structure characteristics, the grade determination is performed using a cascaded decision model, including: The static quality parameters, physicochemical quality parameters, and strip structure features are tensor-concatenated through a feature fusion layer to generate a multidimensional feature matrix. The multidimensional feature matrix is ​​input into the primary filtering module for filtering to obtain preliminary filtering results, including: In the query-key value attention weight calculation, a strip morphology constraint term is introduced to obtain morphological gradient features. The strip morphology constraint term is implemented by the dot product operation of the strip midline curvature and the attention weight. By fusing morphological gradient features with Transformer deep features, enhanced stripe features are obtained; The strengthening strip features are filtered according to a preset quality threshold, and the preliminary filtering results are output. The strengthening strip features in the preliminary filtering results are recorded as primary filtering features. The initial screening features are input into the comprehensive scoring module to obtain the grade probability distribution, including: The weight allocation of the primary screening features is dynamically adjusted by the Gini coefficient, and no less than a preset number of decision trees are configured to perform bagging ensemble prediction to obtain the original prediction probability. The Platt scaling method is used to calibrate the distribution of the original predicted probabilities, and the level probability distribution is output. The probability distribution of the levels is divided according to a preset level division threshold to generate the final level determination result.

5. The method for grading raw tea according to claim 1, characterized in that, The illumination compensation includes the following steps: The first visible light image is subjected to global illumination correction using a brightness equalization algorithm to output a first preliminary corrected image. The first preliminary corrected image is input into the local illumination compensation model, which is configured to be constructed based on Retinex theory to obtain the reflection component and the illumination component. The reflection component is enhanced with adaptive gamma correction to produce a second preliminary corrected image with uniform illumination. The geometric correction includes the following steps: Detect stripe edge feature points in the second preliminary corrected image; Calculate lens distortion parameters and projection transformation matrix to perform geometric correction, and obtain the third preliminary corrected image; The multi-source information registration includes the following steps: Spatially align the third preliminary corrected image with the second three-dimensional morphological information to output the registered second visible light image, including: Extract the SIFT feature point set from the third preliminary corrected image, and match the SIFT feature point set with the three-dimensional feature points in the second three-dimensional morphological information to obtain the matching result; Calculate the optimal spatial transformation parameters based on the matching results and perform registration.

6. The method for grading raw tea according to claim 1, characterized in that, The preprocessing also includes: The first near-infrared spectral information is processed by a sliding window. Within each window, a quadratic polynomial is used to fit the spectral curve. The smoothed spectral intensity value is calculated using the coefficients of the fitted polynomial, and the first preprocessed spectral information is output. Calculate the average absorbance of the first preprocessed spectral information at all wavelengths, calculate the standard deviation of the absorbance at each wavelength, perform a normalization transformation, and output the second preprocessed spectral information; Principal component analysis was performed on the second preprocessed spectral information to obtain the second near-infrared spectral information.

7. The method for grading raw tea according to claim 1, characterized in that, The preprocessing also includes: The first three-dimensional morphological information is subjected to noise filtering using a point cloud denoising algorithm, including: The first three-dimensional morphological information is converted into a first point cloud model, and the neighborhood spatial distribution characteristics of each point in the first point cloud model are calculated. Outliers are removed based on the neighborhood spatial distribution characteristics to obtain a preliminary denoised point cloud; The preliminary denoised point cloud is simplified using a voxel grid downsampling algorithm, including: A three-dimensional voxel space partitioning structure is established, wherein the three-dimensional voxel space partitioning structure includes multiple voxel units; Retain representative point cloud data within each voxel unit and output the downsampled point cloud; The downsampled point cloud is corrected using a surface optimization algorithm, including: Analyze the local surface geometric features of the downsampled point cloud, correct outliers that do not conform to the preset topological rules, and output the second three-dimensional morphological information.

8. A computer-readable storage medium storing computer program instructions thereon, characterized in that, The computer program instructions, when executed by a processor, implement the method as described in any one of claims 1 to 7.

9. An electronic device comprising a memory and a processor, characterized in that, The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Tea quality grade detection method and system based on NIRS and CV

    CN117054372A

  • Tea leaf processing auxiliary method and system based on intelligent decision

    CN120198028A