Tea bud density detection method based on deep learning

Through the deep learning-based tea bud density detection method, the image acquisition and improved yolov8 model, combined with the PSA attention mechanism, the problem of low artificial counting of tea bud density in tea tree breeding is solved, and the rapid and accurate automatic identification of tea buds in tea gardens is achieved. and statistics have improved the efficiency of tea garden production management.

CN119152378APending Publication Date: 2024-12-17TEA RESEARCH INSTITUTE CHINESE ACADEMY OF AGRICULTURAL SCIENCES +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411650275.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

Manual counting of tea bud density in tea tree breeding is time-consuming and labor-intensive, low efficiency and high cost, making it difficult to achieve efficient statistics.

Method used

Using deep learning-based tea bud density detection method, the automatic identification and statistics of tea bud density is realized through image acquisition, preprocessing, model training and visualization system design, and the recognition efficiency is improved by using the yolov8 model and PSA attention mechanism, and a simple operation interface is designed. , realize automatic machine detection.

Benefits of technology

It realizes the rapid and accurate automatic identification and quantity statistics of tea tree buds in natural environments, reduces the intensity of human labor and improves the efficiency of tea garden production management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119152378A_ABST
    Figure CN119152378A_ABST
Patent Text Reader

Abstract

The invention discloses a tea bud density detection method based on deep learning. The method comprises the following steps: performing tea bud density image acquisition on a trimmed tea garden under natural conditions; the collected images are preprocessed, and the images are divided into a training set, a verification set and a test set according to the proportion of 8: 1: 1; establishing a tea bud density identification model based on deep learning, and adjusting corresponding parameters; the network structure of the model is improved to improve the model identification efficiency; designing a tea bud density detection visualization system interface for operation; developing a tea bud density detection system to obtain a tea bud density detection result. The image acquisition mode of the tea buds of the tea tree is simple and fast; after the image is preprocessed, the image is trained and predicted by using the improved yolov8 model, and the result is displayed by developing a tea bud density detection system, so that the purposes of quickly and accurately performing automatic identification and quantity statistics on the tea buds of the tea tree in a natural environment are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical fields of tea bud density counting, target detection and system development, and specifically relates to a tea bud density detection method based on deep learning. Background Art

[0002] The development of the tea industry is inseparable from tea tree breeding, but in tea tree breeding work, the bud density, as a key indicator, is still counted manually. Manual counting of tea buds is not only time-consuming and labor-intensive, but also costly and inefficient.

[0003] With the development of deep learning, the application of deep learning-based object detection in agriculture is becoming more and more extensive. By training machines, machines can replace manual labor to identify and count crops, greatly reducing manual labor and improving efficiency.

[0004] In view of the fact that scientific researchers can only rely on manual counting when conducting tea bud density statistics, which is time-consuming, labor-intensive and costly, the purpose of the present invention is to provide a method and system for tea bud density detection based on deep learning, so as to realize machine replacement of manual detection of tea bud density, thereby saving manpower and improving efficiency. Summary of the invention

[0005] In order to make up for the shortcomings of the prior art, the purpose of the present invention is to provide a tea bud density detection method based on deep learning to achieve accurate detection of tea bud density.

[0006] The technical problem solved by the present invention can be achieved through the following technical solutions: The tea bud density detection method based on deep learning comprises the following steps: S1. Collect tea bud density images in a pruned tea garden under natural conditions; S2. Preprocess the collected images and divide them into training set, validation set and test set in a ratio of 8:1:1; S3. Establish a tea bud density recognition model based on deep learning and adjust the corresponding parameters; S4. Improve the network structure of the model to improve the model recognition efficiency; S5. Design a visual system interface for tea bud density detection for operation; S6. Develop a tea bud density detection system so that operators can get the tea bud density detection results by just clicking a simple button.

[0007] Furthermore, in the step S1, the actual state of scientific researchers counting tea bud density is simulated, and tea bud density images are collected from the pruned tea garden under natural conditions using a mobile phone. The shooting ratio is 1:1, the shooting angle is a direct overhead shot, and the shooting range is a 30×30 cm density frame of tea buds in the budding stage and one bud and one leaf stage. The tea trees of the collected images are flat tea trees that have been pruned flat.

[0008] Furthermore, the preprocessing process in step S2 is: first, the tea buds in the collected image are marked using Labelimg to generate an XML file; then, the image is rotated 180° and flipped to amplify the data; finally, all the images are divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0009] Furthermore, in step S3, the yolov8 model is used to train and verify the tea bud density picture; the training rounds epochs, batch size batch_size and image size image_size are adjusted to reach the optimal value within the configuration.

[0010] Furthermore, in the step S4, the PSA attention mechanism is introduced after the spatial pyramid pooling (SPPF) layer of the network structure of the yolov8 model, and then the same data set is used for training and verification to obtain higher training weights with higher precision (P), recall (R), and mean average precision (mAP).

[0011] Furthermore, in step S5, PYQT6 is used to design a tea bud density detection UI page, which includes a picture selection button box, a display area for pictures to be detected and pictures after detection, and a detection result display area.

[0012] Furthermore, in step S6, PYUIC is used to convert the designed UI page into Python code, connect signals and slots, and call the trained weights to generate a tea bud density detection system. The operator only needs to click the upload button on the page to obtain the detection results.

[0013] Furthermore, the tea bud density detection system comprises a picture selection module, a picture display module, and a detection result display module. The operation flow of the picture selection module is: click "Select Picture", select the picture, and finally confirm the picture; The picture display module includes two parts, one part is the picture to be detected, and the other part is the picture after detection with the buds marked; The detection result display module is used to display the number of detected buds below the image display module.

[0014] Compared with the prior art, the present invention has the following advantages: the present invention overcomes the problems of low efficiency, high labor intensity, and long time consumption in manually counting tea tree bud density in the process of tea garden production management. The present invention can collect images of tea tree buds by installing a camera in the tea garden or directly using a mobile phone to take pictures, and the acquisition method is simple and fast; after image preprocessing, the image is trained and predicted using an improved yolov8 model, and the results are displayed by developing a tea bud density detection system, thereby achieving the purpose of automatically identifying and counting tea tree buds quickly and accurately in a natural environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of the tea bud density detection method of the present invention; Figure 2 The image preprocessing flow chart proposed by the present invention; Figure 3 This is the image enhancement effect diagram proposed by the present invention; Figure 4 This is a network structure diagram based on the improved yolov8 model proposed by the present invention; Figure 5 This is the interface design diagram of the tea bud density detection system proposed by the present invention; Figure 6 This is an operation flow chart of a tea bud density detection method and system based on deep learning proposed by the present invention; Figure 7 This is a rendering of a tea bud density detection method and system based on deep learning proposed by the present invention; Figure 8 This is a fitting curve diagram for tea bud density detection proposed by the present invention. DETAILED DESCRIPTION

[0016] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. 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.

[0017] like Figure 1 As shown, a tea bud density detection method based on deep learning includes the following steps: (1) Collect tea bud density images in a pruned tea garden under natural conditions.

[0018] The specific operation of image acquisition is: simulate the state of scientific researchers actually counting tea bud density, use mobile phones and 30×30cm density frames to collect tea bud density images of pruned tea gardens under natural conditions. Among them, the camera shooting ratio is 1:1, the shooting angle is a direct overhead shot, and the shooting range is the bud stage, one bud and one leaf stage, and one bud and two leaf stage tea buds within the 30cm×30cm density frame. The tea trees for which images are collected are flat tea trees that have been pruned flat.

[0019] (2) Preprocess the collected images and divide them into training set, validation set, and test set in a ratio of 8:1:1.

[0020] like Figure 2 As shown in the figure, the image preprocessing is divided into three steps: the first step is to use Labelimg to mark the tea buds in the image and generate an XML file; the second step is to rotate and flip the image 180° to amplify the data, as shown in the figure. Figure 3 As shown; the third step is to divide all the images into training set, verification set and test set according to the ratio of 8:1:1.

[0021] (3) Establish a tea bud density recognition model based on deep learning and adjust the corresponding parameters.

[0022] In this embodiment, the yolov8 model is used to train and verify the tea bud density data set; by adjusting epochs (training rounds), batch_size (batch size), and image_size (image size), it reaches the optimal value within the configuration.

[0023] (4) Improve the network structure of the model to improve the model recognition efficiency.

[0024] PSA (Positional Self-Attention) is an improved version of the self-attention mechanism, which calculates the correlation weight between each position and other positions based on the information of each position in the input sequence.

[0025] like Figure 4 As shown in the figure, the PSA attention mechanism is introduced after the SPPF (pyramid space pooling) layer of the backbone network in the yolov8 network structure. After the 1×1 convolution, the cross-channel features are evenly divided into two parts, and only one part is input into the NPSA module composed of the multi-head self-attention module (MHSA) and the feedforward network (FFN). Then, the two parts are connected and fused through 1×1 convolution. In addition, the dimensions of the query and key are assigned to half of the median value of the MHSA, and LayerNorm is replaced by BatchNorm for fast reasoning.

[0026] Under the same training and validation set conditions, the training weight precision (P), recall (R), and mean average precision (mAP) increased from 90.8%, 90.8%, and 95.8% to 93.1%, 91.6%, and 96.6%, respectively, to achieve better detection results.

[0027] (5) Design a visual system interface for tea bud density detection for operation.

[0028] like Figure 5 As shown, in this embodiment, PYQT6 is used to design a tea bud density detection UI page, which includes: a picture selection button box, a display area for pictures to be detected and pictures after detection, and a detection result display area.

[0029] like Figure 6 As shown, the operation process of the tea bud density detection system is: when the user opens the system, clicks the "Select Picture" button box, selects the picture to be detected, and after confirming the picture, calls the trained optimal weight file to detect the picture. After the detection is completed, the test result will be displayed in the correct position (that is, displayed in the test result display module).

[0030] (6) Develop a tea bud density detection system so that operators can obtain tea bud density detection results by simply clicking a simple button.

[0031] In this embodiment, PYUIC is used to convert the designed UI page into Python code, connect signals and slots, and call the trained weights to generate a tea bud density detection system, so that the operator only needs to click the upload button on the page to get the detection results.

[0032] like Figure 7 As shown, the tea bud density detection system includes a picture selection module, a picture display module, and a test result display module. The composition of these three modules enables the operator to complete the tea bud density detection simply and clearly. The operation process of the picture selection module is: click "Select Picture", select the picture, and finally confirm the picture; the picture display module includes two parts, one is the picture to be detected, and the other is the picture after detection with the buds marked; the test result display module is used to display the number of detected buds below the picture display module.

[0033] In order to verify the performance of the method proposed in the present invention, the trained model weights were used to detect the images in the test set, and then 35 images that had been detected were randomly selected for manual inspection, and the detection results of the algorithm and the results of manual counting were counted. Figure 8 The results show that the algorithm detection and manual counting results are highly similar (regression coefficient R 2= 0.9306), indicating that this method is feasible in practical applications.

[0034] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A tea bud density detection method based on deep learning, It is characterized in that The following steps are involved: S1. Collect tea bud density images in a pruned tea garden under natural conditions; S2. Preprocess the collected images and divide them into training set, validation set and test set in a ratio of 8:1:1; S3. Establish a tea bud density recognition model based on deep learning and adjust the corresponding parameters; S4. Improve the network structure of the model to improve the model recognition efficiency; S5. Design a visual system interface for tea bud density detection for operation; S6. Develop a tea bud density detection system and obtain tea bud density detection results.

2. A tea bud density detection method based on deep learning according to claim 1, It is characterized in that In the step S1, the state of actually counting tea bud density by scientific researchers is simulated, and tea bud density images are collected from the pruned tea garden under natural conditions using a mobile phone. The shooting ratio is 1:1, the shooting angle is a direct overhead shot, and the shooting range is a 30×30 cm density frame of tea buds in the budding stage and one bud and one leaf stage. The tea trees of the collected images are flat tea trees that have been pruned flat.

3. According to a tea bud density detection method based on deep learning according to claim 1, It is characterized in that The preprocessing process in step S2 is as follows: first, the tea buds in the collected image are marked using Labelimg to generate an XML file; then, the image is rotated 180° and flipped to amplify the data; finally, all the images are divided into a training set, a validation set, and a test set in a ratio of 8:1:

1.

4. According to a tea bud density detection method based on deep learning according to claim 1, It is characterized in that In step S3, the yolov8 model is used to train and verify the tea bud density picture; the training rounds epochs, batch size batch_size and image size image_size are adjusted to reach the optimal value within the configuration.

5. A tea bud density detection method based on deep learning according to claim 4, It is characterized in that In the step S4, the PSA attention mechanism is introduced after the pyramid space pooling layer of the network structure of the yolov8 model, and then the same data set is used for training and verification to obtain a training weight with higher precision, recall rate and average precision value.

6. A tea bud density detection method based on deep learning according to claim 1, It is characterized in that In step S5, PYQT6 is used to design a tea bud density detection UI page, which includes a picture selection button box, a display area for pictures to be detected and pictures after detection, and a detection result display area.

7. A tea bud density detection method based on deep learning according to claim 6, It is characterized in that In step S6, PYUIC is used to convert the designed UI page into Python code, connect signals and slots, and call the trained weights to generate a tea bud density detection system. The operator only needs to click the upload button on the page to obtain the detection results.

8. A tea bud density detection method based on deep learning according to claim 1 or 7, It is characterized in that The tea bud density detection system comprises a picture selection module, a picture display module, and a detection result display module. The operation process of the picture selection module is: click "Select Picture", select the picture, and finally confirm the picture; The picture display module includes two parts, one part is the picture to be detected, and the other part is the picture after detection with the buds marked; The detection result display module is used to display the number of detected buds below the image display module.

Citation Information

Patent Citations

  • Method for identifying and counting tea buds of tea tree based on deep learning

    CN117765454A

  • Tea bud target detection method based on improved YOLOv8 and fusion of multi-attention mechanism

    CN118628711A