Tea grading method and system
Through the improved ESA-ResNet50 model, the tea image is identified, and the problems of low accuracy and low efficiency of tea grading in the prior art are solved, and efficient and accurate automated grading of tea is achieved.
Patent Information
- Application Number
- CN202510060814.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-05-13
AI Technical Summary
In the prior art, the tea grading method has low accuracy and low efficiency, resulting in inconsistent grading and time-consuming.
The ESA-ResNet50 model is used to identify tea leaves. By improving the residual module of the ResNet50 model, introducing the spatial attention module, replacing the convolution layer into a separable convolution and introducing the Dropout layer, the accuracy and efficiency of the model recognition are improved.
It realizes automated grading of tea, improves the accuracy and efficiency of grading, and saves labor and time costs.
Smart Images

Figure CN119992536A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of tea production, and in particular relates to a tea grading method and system. Background Art
[0002] At present, many teas are graded manually through observation or manual operation. The grading standards of tea usually include multiple dimensions such as leaf size, color, shape, etc., and most of these standards rely on the subjective judgment of tea reviewers. Different reviewers may have deviations due to different experiences and feelings, resulting in inconsistent and inaccurate grading. In addition, when a large amount of tea needs to be graded, manual grading is not only time-consuming, but also prone to omissions. Especially in large-scale production and demand, the timeliness and efficiency of manual grading are difficult to meet the requirements. Summary of the invention
[0003] The invention provides a tea grading method and system, aiming to solve the problems of low accuracy and low efficiency of the tea grading method in the prior art.
[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0005] In a first aspect, the present invention provides a tea grading method, comprising the following steps:
[0006] S100, receiving a tea leaf image;
[0007] S200, using the ESA-ResNet50 model to identify the tea images one by one, and identify whether the corresponding tea is a famous and high-quality tea;
[0008] The ESA-ResNet50 model is obtained by improving the ResNet50 model, and the improvement method is as follows:
[0009] A spatial attention module is set after the output of each group of residual blocks in the residual module of the ResNet50 model;
[0010] Replace the 3×3 convolution in the residual module of the ResNet50 model with separable convolution;
[0011] A Dropout layer is introduced into the residual module of the ResNet50 model.
[0012] Further solution: The ESA-ResNet50 model includes a convolutional layer, a residual layer, a global average pooling layer, a Dropout layer and a fully connected layer in sequence.
[0013] Based on the above scheme, the convolutional layer and residual layer enable the ESA-ResNet50 model to extract low-level and high-level features of the tea image at multiple levels. The global average pooling reduces parameters and the fully connected layer optimizes classification, making the performance of the ESA-ResNet50 more outstanding. In addition, the Dropout layer, as a regularization technology, prevents overfitting, can enhance the generalization ability of the ESA-ResNet50 model, and improve the robustness of the model.
[0014] A further solution: the convolution layer includes an initial convolution layer and a maximum pooling layer in sequence.
[0015] Based on the above scheme, the initial convolution layer can capture the global features of the tea image; the maximum pooling layer can further downsample and enhance feature robustness, providing optimized feature input for subsequent network layers.
[0016] A further solution: the residual layer includes four groups of residual modules in sequence; wherein the first group of residual modules includes 3 residual blocks in sequence, the second group of residual modules includes 4 residual blocks in sequence, the third group of residual modules includes 6 residual blocks in sequence, and the fourth group of residual modules includes 3 residual blocks in sequence.
[0017] A further solution: for the first group of residual modules, the second group of residual modules, the third group of residual modules and the fourth group of residual modules, each residual block includes 1×1 convolution, separable convolution and 1×1 convolution in sequence, and the output of each of the residual blocks is connected to one of the spatial attention modules.
[0018] Based on the above scheme, the use of separate convolution in the residual module can reduce the number of parameters and compression load to obtain a lighter ESA-ResNet50 model, which improves the performance of the model while reducing the computational complexity of the model. On the one hand, it effectively improves the computational efficiency, and on the other hand, it makes the ESA-ResNet50 model suitable for small mobile devices.
[0019] In addition, the attention module enables the ESA-ResNet50 model to focus more on key areas in the tea image (such as texture, veins and morphology on the tea image) and obtain key features to obtain better classification performance.
[0020] In a second aspect, the present invention provides a tea grading system for executing a tea grading method as described in the first aspect; the grading system comprises:
[0021] A transmission device is used to transmit tea leaves; a collection box for high-quality tea is provided at the tail of the transmission device;
[0022] An image acquisition device is arranged at the rear of the transmission device, and the image acquisition device takes pictures of the tea leaves on the transmission device to obtain one-to-one corresponding images of the tea leaves;
[0023] A control module connected to the image acquisition device; the control module includes a grading unit; the grading unit receives the tea image and identifies the tea image through an ESA-ResNet50 model;
[0024] A wind selection device connected to the control module; the wind selection device includes a fan, and the fan is connected to an air duct; the control module controls the fan to be turned on or off according to the recognition result of the tea image by the ESA-ResNet50 model;
[0025] When the recognition result of the tea image is non-high-quality tea, the control module starts the fan to suck the corresponding tea leaves on the transmission device into the air duct; when the recognition result of the tea image is high-quality tea, the corresponding tea leaves on the transmission device fall into the high-quality tea collection box under the action of the transmission device.
[0026] A further solution: the transmission device includes a parallel PVC conveyor, and the high-quality tea collection box is located below the tail of the PVC conveyor; the PVC conveyor includes a conveyor belt, and the tea leaves are placed on the conveyor belt; the transmission speed of the conveyor belt is 3.5 mm per second.
[0027] Based on the above scheme, the transmission speed of 3.5 mm per second of the conveyor belt allows the tea leaves to move slowly and steadily, which is helpful for subsequent tea leaf image collection and analysis, and ensures that there will be no errors in data collection due to excessive speed.
[0028] A further solution: the image acquisition device comprises a camera, a spectrometer and a linear illuminator, and the camera, the spectrometer and the linear illuminator are all arranged at the tail of the PVC conveyor and directly above the conveyor belt;
[0029] The vertical distance between the camera and the conveyor belt is 28 cm, and the exposure time of the camera is 20 milliseconds.
[0030] Based on the above scheme, the camera and spectrometer can simultaneously perform image acquisition and spectral analysis, which enhances the detection capability. The linear illuminator can provide uniform lighting, reduce shadows and highlights, and make the tea image higher in quality and definition, which is convenient for subsequent analysis and processing of the tea image.
[0031] A further solution: the air duct is arranged behind the image acquisition device and is 10 cm high from the conveyor belt; a check valve is also provided at the suction port of the air duct.
[0032] Based on the above solution, the check valve can prevent the low-quality tea leaves in the air duct from falling out of the air duct when the fan is turned off.
[0033] A further solution: On the transmission device, the range captured by the image acquisition device is divided into a plurality of areas, and each area is provided with a group of the air selection devices.
[0034] Based on the above scheme, by dividing the area where the tea leaves are placed on the transmission device into multiple small areas, independent observation and analysis of the tea leaves in each area can be achieved, thereby improving the precision of tea leaf detection and reducing the loss of high-quality tea.
[0035] The beneficial effects of the present invention are:
[0036] The present invention uses the image acquisition device to take pictures of the tea leaves on the transmission device, uses the ESA-ResNet50 model to analyze and identify the tea leaves image, identifies whether the tea leaves are famous and high-quality tea, and then controls the winnowing system according to the recognition result of the ESA-ResNet50 model through the control module to realize automatic grading of the tea leaves, saves labor and time costs, and greatly improves the efficiency of tea grading.
[0037] In addition, the ESA-ResNet50 model in the present invention is obtained by improving the ResNet50 model. Among them, the attention module added to the ESA-ResNet50 model can make the ESA-ResNet50 model more focused on the key areas in the tea image (such as texture, veins and morphology on the tea image, etc.) and obtain key features. The Dropout layer introduced in the ESA-ResNet50 model can be used as a regularization technology to prevent overfitting, and can enhance the generalization ability of the ESA-ResNet50 model and improve the robustness of the model. The ESA-ResNet50 model in the present invention has better performance, can make a more accurate distinction between famous tea and non-famous tea, improve the accuracy of the tea recognition, and then improve the accuracy of the tea grading.
[0038] The separable convolution in the ESA-ResNet50 model can reduce the number of parameters and compression load, making the computational complexity of the ESA-ResNet50 model lower and lighter, and can be applied to large or small mobile devices, making the tea grading system more applicable and flexible. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is a schematic diagram of the steps of a tea grading method of the present invention;
[0041] Figure 2 It is a schematic diagram of the structure of the ESA-ResNet50 model in the present invention;
[0042] Figure 3 This is a schematic diagram of the structure of each residual block of the residual layer in the ESA-ResNet50 model;
[0043] Figure 4 It is a structural schematic diagram of a tea grading system of the present invention;
[0044] Figure 5 is a schematic diagram of a transmission device in the present invention;
[0045] Figure 6 1 is a front view schematic diagram of the stop check valve of the present invention;
[0046] Figure 7 It is a schematic diagram of the inspection of the stop check valve of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work belong to the protection scope of the present invention.
[0048] Embodiment 1
[0049] like Figure 1 As shown, this embodiment provides a tea grading method, comprising the following steps:
[0050] S100, receiving a tea leaf image;
[0051] S200, using the ESA-ResNet50 model to identify the tea images one by one, and identify whether the corresponding tea is a famous and high-quality tea;
[0052] The famous and high-quality tea refers to high-end tea with excellent quality (e.g., beautiful appearance, uniform color, and strong aroma, etc.). The non-famous and high-quality tea refers to tea that does not meet the standards of famous and high-quality tea, usually bulk tea.
[0053] The ESA-ResNet50 model is obtained by improving the ResNet50 model, and the improvement method is as follows:
[0054] A spatial attention module is set after the output of each group of residual blocks in the residual module of the ResNet50 model;
[0055] Replacing the 3×3 convolution in the residual module of the ResNet50 model with a separable convolution; wherein the separable convolution includes a depth-wise 3×3 convolution and a point-by-point 1×1 convolution;
[0056] A Dropout layer is introduced into the residual module of the ResNet50 model, wherein the Dropout layer is used as a regularization technique to prevent overfitting.
[0057] Next, the ESA-ResNet50 model is further described in combination with the above-mentioned improvement method:
[0058] like Figure 2 As shown, the ESA-ResNet50 model includes a convolutional layer, a residual layer, a global average pooling layer, a Dropout layer and a fully connected layer in sequence.
[0059] The convolutional layer includes an initial convolutional layer and a maximum pooling layer in sequence.
[0060] like Figure 2 and Figure 3 As shown, in the residual layer, the residual layer includes four groups of residual modules in sequence; wherein the first group of residual modules includes 3 residual blocks in sequence, the second group of residual modules includes 4 residual blocks in sequence, the third group of residual modules includes 6 residual blocks in sequence, and the fourth group of residual modules includes 3 residual blocks in sequence. For the first group of residual modules, the second group of residual modules, the third group of residual modules and the fourth group of residual modules, each residual block includes 1×1 convolution, separable convolution (a 3×3 convolution in the depth direction and a point-by-point 1×1 convolution) and 1×1 convolution in sequence, and the output of each of the residual blocks is connected to one of the spatial attention modules.
[0061] It should be noted that: in the residual layer of the ResNet50 model, each residual block includes 1×1 convolution, 3×3 convolution and 1×1 convolution. Since in the ESA-ResNet50 model, the 3×3 convolution in the residual module of the ResNet50 model is replaced with a separable convolution, each residual block in the residual layer of the ESA-ResNet50 model includes 1×1 convolution, separable convolution and 1×1 convolution in sequence.
[0062] Below, taking the identification of whether tea is high-quality tea as an example, the performance of the ResNet50 model and the ESA-ResNet50 model are compared:
[0063] Step 1: Collect images of tea (including premium tea and non-prestige tea), and label the images as premium tea or non-prestige tea to obtain a tea image set. The tea image set is divided into a training set and a validation set.
[0064] In the second step, the ResNet50 model and the ESA-ResNet50 model are trained respectively using the training set; the trained ResNet50 model and the trained ESA-ResNet50 model are obtained.
[0065] Step 3: Use the validation set to verify and evaluate the trained ResNet50 model and the trained ESA-ResNet50 model respectively.
[0066] The following are the evaluation results of the trained ResNet50 model and the trained ESA-ResNet50 model:
[0067] Table 1 Comparison of recognition results of different models
[0068] Model Loss Acc Val-Loss Val-Acc ResNet50 model 0.2811 0.9352 0.2848 0.9424 ESA-ResNet50 model 0.1767 0.9431 0.1455 0.9456
[0069] Among them, the Loss (loss value) represents the error between the model recognition result and the annotation on the tea image. The Acc (accuracy) represents the proportion of correctly recognized tea images to the total tea images. The Val-Loss (verification loss value) represents the error between the model recognition result and the annotation on the tea image when the model is verified using the verification set. The Val-Acc (verification accuracy) represents the proportion of correctly recognized tea images to the total tea images when the model is verified using the verification set.
[0070] As shown in Table 1, first, the loss of the ResNet50 model is 0.2811, Val-Loss is 0.2848; the loss of the ESA-ResNet50 model is 0.1767, Val-Loss is 0.1455. The recognition error of the ResNet50 model is larger and it is easier to make mistakes.
[0071] In addition, the Val-Loss of the ResNet50 model is 0.2848, and the Val-Acc is 0.9424; the Val-Loss of the ESA-ResNet50 model is 0.1455, and the Val-Acc is 0.9456. When the trained ResNet50 model and the trained ESA-ResNet50 model are respectively verified and evaluated using the verification set, the Val-Loss (verification loss) of the ESA-ResNet50 model further decreases, and the Val-Acc (verification accuracy) further increases, and the verification accuracy of the ESA-ResNet50 model is higher than that of the ResNet50 model. This indicates that after the model is verified using the verification set, the tea recognition accuracy of the ESA-ResNet50 model is higher than that of the ResNet50 model.
[0072] In summary, the ESA-ResNet50 model in the present invention has better performance, better effect, and more accurate identification of tea leaves.
[0073] Embodiment 2:
[0074] like Figure 4 As shown, this embodiment provides a tea grading system for executing a tea grading method as described in the first embodiment; the grading system comprises:
[0075] A transmission device is used to transmit tea leaves; a collection box for high-quality tea is provided at the tail of the transmission device;
[0076] An image acquisition device is arranged at the rear of the transmission device, and the image acquisition device takes pictures of the tea leaves on the transmission device to obtain one-to-one corresponding images of the tea leaves;
[0077] A control module connected to the image acquisition device; the control module includes a grading unit; the grading unit receives the tea image and identifies the tea image through an ESA-ResNet50 model;
[0078] A wind selection device connected to the control module; the wind selection device includes a fan, and the fan is connected to an air duct; the control module controls the fan to be turned on or off according to the recognition result of the tea image by the ESA-ResNet50 model;
[0079] When the recognition result of the tea image is non-high-quality tea, the control module starts the fan to suck the corresponding tea leaves on the transmission device into the air duct; when the recognition result of the tea image is high-quality tea, the corresponding tea leaves on the transmission device fall into the high-quality tea collection box under the action of the transmission device.
[0080] Among them, on the transmission device, the range captured by the image acquisition device is divided into several areas, and each area is provided with a group of the wind selection devices.
[0081] A more specific example of the transmission device in the above scheme is: the transmission device includes a parallel PVC conveyor, and the high-quality tea collection box is located below the tail of the PVC conveyor; the PVC conveyor includes a conveyor belt, and the tea leaves are placed on the conveyor belt; the transmission speed of the conveyor belt is 3.5 mm per second.
[0082] In addition, if Figure 5 As shown, the transmission device also includes a feed port, a roller brush lifting device and a blowing device; the lower end of the roller brush lifting device is arranged at the feed port, the blowing device is arranged below the higher end of the brush lifting device, and the higher end of the roller brush lifting device is close to the PVC conveyor, the height of the PVC conveyor is lower than the height of the higher end of the roller brush lifting device, and an arc plate is arranged between the higher end of the roller brush lifting device and the PVC conveyor.
[0083] The roller brush lifting device may be a crawler chain conveyor, and a cam mechanism is installed below the crawler chain conveyor to make the crawler chain conveyor vibrate back and forth, so that the tea leaves are evenly spread during the vibration. The air blowing device may be an adjustable fan (the wind speed can be set to 2-8 m / s), which is used to separate the light yellow leaves, sand and gravel and other non-tea debris, fine particles and tea foam from the tea leaves at the moment when the tea leaves at the high end of the roller brush lifting device fall.
[0084] The collected tea leaves are poured into the feed port, and the tea leaves at the feed port are transported upwards under the action of the crawler chain conveyor, and fall after reaching one end at the upper end of the crawler chain conveyor. The fallen tea leaves slowly fall onto the PVC conveyor along the curved plate, and are transported to the area that can be photographed by the image acquisition device under the action of the transmission belt.
[0085] A more specific example of the image acquisition device in the above scheme is: the image acquisition device includes a camera, a spectrometer and a linear illuminator, and the camera, the spectrometer and the linear illuminator are all arranged at the tail of the PVC conveyor and located directly above the conveyor belt;
[0086] The vertical distance between the camera and the conveyor belt is 28 cm, and the exposure time of the camera is 20 milliseconds.
[0087] On the basis of the above scheme, the image acquisition device further includes a dark box, which is arranged at the tail of the PVC conveyor and directly above the conveyor belt. The camera, spectrometer and linear illuminator are all located in the dark box. The camera can be a color CCD high-definition camera; the linear illuminator can be an LED light source.
[0088] The dark box is also provided with a computing chip, and the ESA-ResNet50 model recognizes the tea image on the computing chip. The control module includes a single-chip microcomputer, and the single-chip microcomputer is connected in series with the computing chip and the circuit of the fan.
[0089] A more specific example of the air selection device in the above scheme is: the air duct is arranged behind the image acquisition device and is 10 cm high from the conveyor belt; a check valve is also arranged at the suction port of the air duct, and the check valve is as follows: Figure 6 and Figure 7 When the fan is turned on, the check valve on the air duct will open due to the negative pressure wind force, so that the non-premium tea can be sucked into the air duct; when the fan is turned off, the check valve will close due to gravity, ensuring that the non-premium tea in the air duct will not flow back out of the air duct.
[0090] In addition, another port on the air duct opposite to the suction port is connected to a non-famous tea collection box to collect the non-famous tea sucked into the air duct.
[0091] The present invention is not limited to the above-mentioned optional implementation modes. Anyone can derive other various forms of products under the inspiration of the present invention. However, no matter what changes are made in the shape or structure, all technical solutions that fall within the scope defined by the claims of the present invention fall within the protection scope of the present invention.
Claims
1. A tea grading method, characterized in that: The following steps are involved: S100, receiving a tea leaf image; S200, using the ESA-ResNet50 model to identify the tea images one by one, and identify whether the corresponding tea is a famous and high-quality tea; The ESA-ResNet50 model is obtained by improving the ResNet50 model, and the improvement method is as follows: A spatial attention module is set after the output of each group of residual blocks in the residual module of the ResNet50 model; Replace the 3×3 convolution in the residual module of the ResNet50 model with separable convolution; A Dropout layer is introduced into the residual module of the ResNet50 model.
2. A tea grading method according to claim 1, characterized in that: The ESA-ResNet50 model includes a convolutional layer, a residual layer, a global average pooling layer, a Dropout layer and a fully connected layer in sequence.
3. A tea grading method according to claim 2, characterized in that: The convolutional layers sequentially include an initial convolutional layer and a maximum pooling layer.
4. A tea grading method according to claim 2, characterized in that: The residual layer includes four groups of residual modules in sequence; wherein the first group of residual modules includes 3 residual blocks in sequence, the second group of residual modules includes 4 residual blocks in sequence, the third group of residual modules includes 6 residual blocks in sequence, and the fourth group of residual modules includes 3 residual blocks in sequence.
5. A tea grading method according to claim 4, characterized in that: For the first group of residual modules, the second group of residual modules, the third group of residual modules and the fourth group of residual modules, each residual block includes 1×1 convolution, separable convolution and 1×1 convolution in sequence, and the output of each of the residual blocks is connected to one of the spatial attention modules.
6. A tea grading system, characterized in that: Used to implement a tea grading method as described in claims 1-5; the grading system comprises: A transmission device is used to transmit tea leaves; a collection box for high-quality tea is provided at the tail of the transmission device; An image acquisition device is arranged at the rear of the transmission device, and the image acquisition device takes pictures of the tea leaves on the transmission device to obtain one-to-one corresponding images of the tea leaves; A control module connected to the image acquisition device; the control module includes a grading unit; the grading unit receives the tea image and identifies the tea image through an ESA-ResNet50 model; A wind selection device connected to the control module; the wind selection device includes a fan, and the fan is connected to an air duct; the control module controls the fan to be turned on or off according to the recognition result of the tea image by the ESA-ResNet50 model; When the recognition result of the tea image is non-high-quality tea, the control module starts the fan to suck the corresponding tea leaves on the transmission device into the air duct; when the recognition result of the tea image is high-quality tea, the corresponding tea leaves on the transmission device fall into the high-quality tea collection box under the action of the transmission device.
7. A tea grading system according to claim 6, characterized in that: The transmission device includes a parallel PVC conveyor, and the high-quality tea collection box is located below the tail of the PVC conveyor; the PVC conveyor includes a conveyor belt, and the tea leaves are placed on the conveyor belt; the transmission speed of the conveyor belt is 3.5 mm per second.
8. A tea grading system according to claim 7, characterized in that: The image acquisition device includes a camera, a spectrometer and a linear illuminator, and the camera, the spectrometer and the linear illuminator are all arranged at the tail of the PVC conveyor and located directly above the conveyor belt; The vertical distance between the camera and the conveyor belt is 28 cm, and the exposure time of the camera is 20 milliseconds.
9. A tea grading system according to claim 7, characterized in that: The air duct is arranged behind the image acquisition device and is 10 cm high from the conveyor belt; a check valve is also arranged at the suction port of the air duct.
10. A tea grading system according to claim 6, characterized in that: On the transmission device, the range captured by the image acquisition device is divided into a plurality of areas, and each area is provided with a group of the wind selection devices.
Citation Information
Patent Citations
Tea disease identification method based on improved ResNet18 model
CN119107633A
Novel tea leaf fixation machine
CN208956878U