Tea bud density detection method and device
The tea bud density is calculated by combining the Faster R-CNN model with the area ratio of the marked frame, which solves the time-consuming and labor-intensive problems of traditional detection methods and realizes the rapid and accurate detection and real-time management of tea bud density in tea gardens.
Patent Information
- Application Number
- CN202210247897.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2042-03-14
AI Technical Summary
Traditional tea bud density detection methods are time-consuming, labor-intensive and inefficient. Existing image recognition technology is not very practical for tea bud detection under complex backgrounds, and it is difficult to accurately determine the bud density within the tea tree canopy.
The Faster R-CNN detection model is used to obtain tea tree canopy images and combine them with labeled sample images to train the model. The tea bud density is calculated using the area ratio of the marked box. It is suitable for scenes with a long camera distance and complex background.
It realizes the rapid and accurate detection of tea bud density, supports real-time online monitoring, is suitable for the information management of tea gardens under complex backgrounds, and can promptly remind tea buds of their picking timing.
Smart Images

Figure CN114782312B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of crop planting, and in particular to a method and device for detecting tea bud density. Background Art
[0002] Tea picking is a time-sensitive seasonal task, and the picking period directly impacts the quality of the finished tea. Tea bud density is a key indicator of tea growth and development, as well as the picking period. Surveying this indicator is a routine task in tea cultivation and production. During the picking season, tea leaves are picked every 3-5 days on average. Timely monitoring of tea bud density is crucial for controlling tea quality. Traditional agricultural surveys of bud density primarily rely on manual counting, which involves manually counting buds per unit area. This method is time-consuming, labor-intensive, and inefficient.
[0003] The development of image recognition algorithms and computer technology has provided a more convenient method for tea bud density detection. Extensive research in agriculture has been conducted using deep learning techniques for object recognition and detection, such as the apple detection algorithm based on the Faster R-CNN network model and the lychee detection algorithm based on the YOLOv3 network model.
[0004] However, due to the influence of complex backgrounds, tea bud detection is currently limited to a small area with a small number of buds at a close, oblique angle, making it difficult to determine the observation area. Current methods are not very practical for detecting and determining tea bud density in scenes with more complex backgrounds, where the camera is farther away and the number of buds is greater and more diverse. Summary of the Invention
[0005] In view of the problems existing in the prior art, the present invention provides a method and device for detecting tea bud density.
[0006] The present invention provides a tea bud density detection method, comprising: obtaining a tea tree canopy image of a to-be-detected area, wherein the canopy image includes a pre-set marking frame with a known area; inputting the canopy image into a trained Faster R-CNN detection model, and outputting a bud quantity result in the canopy image; and determining the tea bud density of the to-be-detected area based on the bud quantity result, the area of the marking frame, and the area ratio between the marking frame and the canopy image; wherein the Faster R-CNN detection model is obtained by training based on sample canopy images with labeled tea buds.
[0007] According to a tea bud density detection method provided by the present invention, before obtaining the tea tree canopy image of the area to be detected, the method further includes: photographing tea tree canopy images of multiple sample areas at a vertical angle; marking tea buds in the tea tree canopy images of the multiple sample areas to obtain multiple sample canopy images with labeled tea buds; and training an initial Faster R-CNN detection model constructed based on the sample canopy images to obtain the trained Faster R-CNN detection model.
[0008] According to a tea bud density detection method provided by the present invention, the tea tree canopy images of the multiple sample areas include multiple tea canopy images that meet the picking standards and multiple tea canopy images that do not meet the picking standards.
[0009] According to a tea bud density detection method provided by the present invention, the tea bud density of the area to be detected is determined based on the bud quantity result, the area of the marked frame, and the area ratio of the marked frame to the canopy image, including: obtaining the actual area of the canopy in the canopy image based on the area ratio of the marked frame obtained from the canopy image to the canopy image, combined with the area of the marked frame; and obtaining the tea bud density of the area to be detected based on the ratio of the bud quantity result to the actual area of the canopy in the canopy image.
[0010] According to a tea bud density detection method provided by the present invention, the initial Faster R-CNN detection model constructed according to the sample canopy image is trained to obtain the trained Faster R-CNN detection model, including: initializing and training the region proposal network RPN of the initial Faster R-CNN detection model according to the pre-trained VGG16 network; initializing the fast regional convolutional neural network Fast R-CNN of the initial Faster R-CNN detection model according to the pre-trained VGG16, combining the trained RPN to obtain a detection network, and training the detection network using the sample canopy image; fixing the shared convolutional layer of the RPN and Fast R-CNN, and re-initializing and training the RPN and Fast R-CNN networks according to the trained detection network; after the training, obtaining the trained Faster R-CNN detection model.
[0011] According to a tea bud density detection method provided by the present invention, the tea tree canopy image of the sample area includes a standard tea canopy image in which the actual number of buds is equal to the standard number of buds to be picked; accordingly, after training an initial Faster R-CNN detection model constructed based on the sample canopy image to obtain the trained Faster R-CNN detection model, the method further includes: inputting the standard tea canopy image into the trained Faster R-CNN detection model to obtain a standard range value for bud picking; determining a standard tea bud density range based on the standard range value for bud picking, the area of the marked frame, and the ratio of the area of the marked frame to the canopy image; and issuing a picking prompt message if the tea bud density in the area to be detected reaches the standard tea bud density, wherein the picking prompt message is used to indicate that the time for picking has arrived.
[0012] The present invention also provides a tea bud density detection device, comprising: an acquisition module, used to obtain a tea tree canopy image of a to-be-detected area, wherein the canopy image includes a pre-set marking frame with a known area; a processing module, used to input the canopy image into a trained region candidate-based deep convolutional network Faster R-CNN detection model, and output a bud quantity result in the canopy image; an output module, used to determine the tea bud density of the to-be-detected area based on the bud quantity result, the area of the marking frame, and the area ratio of the marking frame to the canopy image; wherein the Faster R-CNN detection model is obtained after training based on sample canopy images with labeled tea buds.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above-described tea bud density detection methods is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements any of the above-mentioned tea bud density detection methods when executed by a processor.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned tea bud density detection methods.
[0016] The tea bud density detection method and device provided by the present invention can obtain the canopy image of the tea tree in the area to be detected by installing a camera in the tea garden or directly taking pictures with a mobile phone. The acquisition method is simple and fast. By inputting the trained Faster R-CNN detection model through the canopy image, the traditional manual tea bud density statistics are replaced, and real-time online monitoring can be achieved, which conforms to the needs of modern tea garden information management. The tea bud density of the area to be detected is determined based on the bud quantity result, the area of the marking frame, and the area ratio of the marking frame to the canopy image. It has strong applicability for the detection of tender buds in scenes with a farther lens, a larger number of buds, a variety of types, and a more complex background. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 1 is a schematic flow chart of the tea bud density detection method provided by the present invention;
[0019] Figure 2 It is a structural schematic diagram of the tea bud density detection device provided by the present invention;
[0020] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0022] The following combination Figure 1-Figure 3 The present invention describes a method and device for detecting tea bud density. Figure 1 Schematic diagram of the tea bud density detection method provided by the present invention, such as Figure 1 As shown, the present invention provides a method for detecting tea bud density, comprising:
[0023] 101. Acquire a canopy image of tea trees in a to-be-detected area, wherein the canopy image includes a pre-set marking frame with a known area.
[0024] In the area where tea density needs to be obtained, that is, the area to be detected, a camera or other tool with a camera is used to obtain a clear image of the tea tree canopy in the afternoon when the weather conditions are stable.
[0025] The acquisition angle is vertical shooting. Try to choose a cloudy environment to reduce the impact of shadows caused by light. Place a marking frame of known size, such as 0.5m*0.5m (or other known fixed size) in the area to be detected, and obtain a clear image of the tea canopy covering the entire marking frame.
[0026] 102. Input the canopy image into a trained Faster R-CNN detection model, and output a bud count result in the canopy image. The Faster R-CNN detection model is trained based on sample canopy images of labeled tea buds.
[0027] The Faster R-CNN detection model is pre-trained using images of tea tree canopies with labeled tea leaves as training samples. The trained detection model is fed with the tea tree canopy image of the area to be detected. The model outputs the number of buds, which is the total number N of buds in the entire canopy image.
[0028] 103. Determine the tea bud density of the area to be detected based on the bud quantity result, the area of the marked frame, and the area ratio of the marked frame to the canopy image.
[0029] Given the actual area of the standard frame, the actual area of the photographed tea canopy can be obtained based on the ratio between the area of the standard frame and the area of the entire tea canopy image in the image, and the tea bud density D can be finally calculated.
[0030] In one embodiment, determining the tea bud density of the area to be detected based on the bud quantity result, the area of the marked frame, and the area ratio of the marked frame to the canopy image includes: obtaining the actual area of the canopy in the canopy image based on the area ratio of the marked frame obtained from the canopy image to the canopy image in combination with the area of the marked frame; and obtaining the tea bud density of the area to be detected based on the ratio of the bud quantity result to the actual area of the canopy in the canopy image.
[0031] Specifically, the density of tea leaves is calculated as follows:
[0032]
[0033]
[0034] Among them, S b / S g is the area ratio of the marking frame obtained from the canopy image to the canopy image, S B is the actual area of the standard box, S Gis the actual area of the tea canopy in the image; the bud count is obtained when N is 102; the unit of D is: pieces / m 2 ;N is in units;S G and S B The unit is square meter (m 2 );S b and S g The unit is square centimeters. Note: When the first step 101 is cutting according to the marked frame, S b =S g .
[0035] In addition, the collected tea canopy images of the area to be detected are input into the detection model for image detection. This process performs operations such as convolution and pooling on the input image to obtain the target (buds to be picked) and precise coordinates, and saves the results, which can be used as a reference for later tea picking path planning.
[0036] The tea bud density detection method provided by the present invention can obtain the canopy image of the tea tree in the area to be detected by installing a camera in the tea garden or directly taking pictures with a mobile phone. The acquisition method is simple and fast. By inputting the trained Faster R-CNN detection model through the canopy image, the traditional manual tea bud density statistics are replaced, and real-time online monitoring can be achieved, which conforms to the needs of modern tea garden information management. The tea bud density of the area to be detected is determined based on the bud quantity result, the area of the marking frame, and the area ratio of the marking frame to the canopy image. It has strong applicability for the detection of tender buds in scenes with a farther lens, a greater number of buds, a variety of types, and a more complex background.
[0037] In addition, the tea bud density monitoring results can be sent directly to the user's mobile phone or computer. The user can understand the growth of tea trees in the tea garden in real time and carry out tea picking and other field management measures in a timely manner.
[0038] In one embodiment, before obtaining the tea tree canopy image of the area to be detected, the method further includes: photographing tea tree canopy images of multiple sample areas at a vertical angle; marking tea buds in the tea tree canopy images of the multiple sample areas respectively to obtain multiple sample canopy images with labeled tea buds; and training an initial Faster R-CNN detection model constructed based on the sample canopy images to obtain the trained Faster R-CNN detection model.
[0039] Specifically, before using the detection model, sample images are collected for training. Images of tea tree canopies from multiple sample areas can be captured at vertical angles. Marker boxes of known areas can also be placed within the canopy images of the sample areas.
[0040] If the image is large, the tea tree canopy image in the sample area can be appropriately cropped and divided into several parts (or directly cropped according to the marked box, retaining only the image within the marked box). Then, use the image target detection and annotation tool LabelImg or other dataset creation tools suitable for image detection tasks to draw square boxes and add labels to the tea buds (i.e., the part of the tea leaves to be picked, usually one bud and one leaf or one bud and two leaves) in the acquired image, and store the annotation information in an XML file.
[0041] Optionally, the tea tree canopy images in the dataset are augmented with data such as rotation, symmetry, brightness changes, and Gaussian blurring to increase the data volume and diversity, thereby improving the accuracy, robustness, and generalization of the model detection. Based on the processed sample canopy images, the constructed initial Faster R-CNN detection model is trained to obtain the trained Faster R-CNN detection model, which is used for detection in step 102.
[0042] In one embodiment, the multiple tea tree canopy images of the sample areas include multiple tea tree canopy images that meet the picking standards and multiple tea tree canopy images that do not meet the picking standards.
[0043] During the collection of sample images, the number of images obtained should meet the model accuracy requirements. The more samples obtained, the better the model accuracy. Data collection consists of two parts. The first part collects as many images as possible using the above method, regardless of whether the tea leaves meet the picking criteria. This includes multiple images of tea canopies that do not meet the picking criteria. The second part collects tea harvest standard images during the tea harvest period (i.e., multiple images of tea canopies that meet the picking criteria): images are collected using the above method in the standard areas manually determined to be suitable for picking.
[0044] The tea bud density detection method provided by the present invention can increase the diversity of training images and thus improve the accuracy of the detection model by using tea tree canopy images, which include multiple tea canopy images that meet the picking standards and multiple tea canopy images that do not meet the picking standards.
[0045] In one embodiment, the sample canopy images include training set samples and test set samples. The initial Faster R-CNN detection model constructed according to the sample canopy images is trained, specifically, the initial Faster R-CNN detection model constructed is trained according to the training set samples. Accordingly, after obtaining the trained Faster R-CNN detection model, the method further includes: testing the trained Faster R-CNN detection model using the test set samples; determining the model evaluation parameters according to the test results. When the model performs poorly (the model evaluation parameters do not meet the preset conditions, such as being less than the preset threshold), the parameters of the trained Faster R-CNN detection model need to be adjusted, and the parameter adjustment process is repeated until the model evaluation parameters reach the preset threshold.
[0046] After obtaining multiple labeled tea bud canopy images, the data was randomly divided into five parts. Four of these parts served as training sets for model construction, and one served as a test set for model testing. The model was trained and tested five times using cross-validation to obtain a more comprehensive evaluation of model performance.
[0047] When testing the test set using the above-trained model, Faster R-CNN will first perform multi-layer convolution and pooling on the images in the test set. The RPN will perform feature traversal on the pooled feature map to detect as many targets as possible, and obtain proposals (Proposals) containing foreground (Positive) or background (Negative) and detection box coordinate offsets. The subsequent region of interest pooling layer (RoI Pooling) will integrate the Proposals with the Feature map. Finally, the classifier will perform classification and obtain accurate coordinates, and output model evaluation parameters including recall and accuracy. When the model performs poorly, the parameters are adjusted and the training steps are repeated until a model that meets the accuracy requirements is obtained, that is, the model evaluation parameters reach the preset threshold.
[0048] The main model evaluation index parameters are Intersection-over-Union (IoU), Accuracy (Precision), Recall (Recall), Average Precision (AP), and the calculation formula is:
[0049]
[0050]
[0051]
[0052]
[0053] Where, P b , G b ——Prediction box, annotation box; IoU——Intersection over Union of prediction box and annotation box; T P 、F P 、F N ——Prediction boxes with IoU greater than 0.5, prediction boxes with IoU less than 0.5, and undetected targets; P, R——precision, recall; N——number of targets in the test set; P k 、R k ——Accuracy when identifying k targets, change in recall rate when the number of identified targets increases from k-1 to k; AP——Average Precision.
[0054] The tea bud density detection method provided by the present invention determines the model evaluation parameters through the test results. When the model performs poorly, the parameters of the trained Faster R-CNN detection model are adjusted until the model evaluation parameters reach a preset threshold, thereby ensuring the accuracy of the detection model.
[0055] In one embodiment, the initial Faster R-CNN detection model constructed according to the sample canopy image is trained to obtain the trained Faster R-CNN detection model, including: initializing and training the region proposal network RPN of the initial Faster R-CNN detection model according to the pre-trained VGG16 network; initializing the fast regional convolutional neural network Fast R-CNN of the initial Faster R-CNN detection model according to the pre-trained VGG16, and combining the trained RPN to obtain a detection network, and using the sample canopy image to train the detection network; fixing the shared convolution layer of RPN and Fast R-CNN, and re-initializing and training the RPN and Fast R-CNN network according to the trained detection network; after the training is completed, obtaining the trained Faster R-CNN detection model
[0056] Set up a deep learning environment, set the model training parameters max_iters (number of experimental training iterations) to 70,000, and batch_size to 128, and train the model. The training process consists of four steps: (i) Initialize and train the Region Proposal Network (RPN) using the pre-trained VGG16 dataset, and then fine-tune it end-to-end; (ii) Initialize Faster R-CNN using the pre-trained VGG16 dataset, and train a separate detection network using the candidate boxes generated by the RPN in the first step; (iii) Initialize and train the RPN again using this detection network, but fix the shared convolutional layers and fine-tune only the RPN-specific layers to achieve shared convolutional layers; (iv) Train Faster R-CNN again, but fix the shared convolutional layers and fine-tune them only. This allows the two networks (RPN and Faster R-CNN) to share the same convolutional layers, ultimately forming a unified trained Faster R-CNN network.
[0057] In one embodiment, the tea tree canopy image of the sample area includes a standard tea canopy image in which the actual number of buds is equal to the standard number of buds to be picked; accordingly, after the constructed initial Faster R-CNN detection model is trained according to the sample canopy image to obtain the trained Faster R-CNN detection model, the method further includes: inputting the standard tea canopy image into the trained Faster R-CNN detection model to obtain a standard range value for bud picking; determining a standard density range of tea buds according to the standard range value for bud picking, the area of the marked frame, and the area ratio of the marked frame to the canopy image; if the tea bud density in the area to be detected reaches the standard density of tea buds, issuing a picking prompt message, wherein the picking prompt message is used to indicate that the time for picking has arrived.
[0058] The model uses images of standard tea canopies to detect tea buds reaching the standard number for picking. The output tea bud density range serves as an indicator of tea bud picking readiness in that area. Image detection only detects the number of tea buds exposed at the canopy level, excluding obscured or vertically invisible buds. The tea bud density output from the canopy image of the inspected area is compared against the standard range. When tea buds meet the standard, a prompt is sent, alerting the user that the time has come to pick the tea.
[0059] The present invention establishes picking standards by inputting standard images, providing reminders for picking timing. This approach of obtaining tea bud density standards by inputting standard images is applicable to any method that uses image recognition technology to obtain tea bud density picking standards. The present invention can establish different tea bud density databases and tea bud standard density databases for different regions and tea varieties, enabling refined tea garden management by category.
[0060] The tea bud density detection device provided by the present invention is described below. The tea bud density detection device described below and the tea bud density detection method described above can be referenced to each other.
[0061] Figure 2 Schematic diagram of the structure of the tea bud density detection device provided by the present invention, as shown in FIG. Figure 2 As shown, the tea bud density detection device includes: an acquisition module 201, a processing module 202, and an output module 203. The acquisition module 201 is used to obtain a canopy image of a tea tree in a to-be-detected area, wherein the canopy image includes a pre-set marking frame with a known area; the processing module 202 is used to input the canopy image into a trained Faster R-CNN detection model and output a bud count result in the canopy image; the output module 203 is used to determine the tea bud density in the to-be-detected area based on the bud count result, the area of the marking frame, and the area ratio between the marking frame and the canopy image; wherein the Faster R-CNN detection model is obtained after training based on sample canopy images with labeled tea buds.
[0062] In one embodiment of the device, a training module is further included, which is used to: obtain tea tree canopy images of multiple sample areas by photographing at a vertical angle; mark tea buds in the tea tree canopy images of the multiple sample areas respectively to obtain multiple sample canopy images with labeled tea buds; and train the constructed initial Faster R-CNN detection model based on the sample canopy images to obtain the trained Faster R-CNN detection model.
[0063] In one device embodiment, the tea tree canopy images in the sample area include a plurality of tea tree canopy images that meet the picking standards and a plurality of tea tree canopy images that do not meet the picking standards.
[0064] In one device embodiment, the output module 203 is specifically used to: obtain the canopy image area based on the area ratio of the marking frame obtained from the canopy image to the canopy image, combined with the area of the marking frame; and obtain the tea bud density of the area to be detected based on the ratio of the bud quantity result and the canopy image area.
[0065] In one embodiment of the device, the training module is specifically used to: initialize and train the regional proposal network RPN of the initial Faster R-CNN detection model based on the pre-trained VGG16 network; initialize the fast regional convolutional neural network Fast R-CNN of the initial Faster R-CNN detection model based on the pre-trained VGG16, and obtain the detection network by combining the trained RPN, and train the detection network using the sample canopy image; fix the shared convolution layer of RPN and Fast R-CNN, and initialize and train the RPN and Fast R-CNN network again based on the trained detection network. After the training is completed, the trained Faster R-CNN detection model is obtained.
[0066] In one device embodiment, the tea tree canopy image of the sample area includes a standard tea canopy image in which the actual number of buds is equal to the standard number of buds to be picked; accordingly, the device also includes a reminder module, which is used to: input the standard tea canopy image into the trained Faster R-CNN detection model to obtain the standard range value of the bud picking amount; determine the standard density range of tea buds based on the standard value of the bud picking amount, the area of the marking box, and the area ratio of the marking box to the canopy image; if the tea bud density in the area to be detected reaches the standard density of tea buds, a picking reminder message is issued, and the picking reminder message is used to prompt that the time for picking has arrived.
[0067] The device embodiments provided in the embodiments of the present invention are intended to implement the above-mentioned method embodiments. For specific processes and detailed contents, please refer to the above-mentioned method embodiments, which will not be repeated here.
[0068] The tea bud density detection device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned tea bud density detection method embodiment. For the sake of brief description, any matters not mentioned in the embodiment of the tea bud density detection device may be referred to the corresponding contents in the aforementioned tea bud density detection method embodiment.
[0069] Figure 3 Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 3As shown, the electronic device may include: a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other via the communication bus 304. The processor 301 may call the logic instructions in the memory 303 to execute a tea bud density detection method, which includes: obtaining a canopy image of a tea tree in a to-be-detected area, wherein the canopy image includes a pre-set marking frame with a known area; inputting the canopy image into a trained Faster R-CNN detection model, and outputting a bud quantity result in the canopy image; determining the tea bud density in the to-be-detected area based on the bud quantity result, the area of the marking frame, and the area ratio of the marking frame to the canopy image; wherein the Faster R-CNN detection model is obtained after training based on a sample canopy image with labeled tea buds.
[0070] In addition, the logic instructions in the above-mentioned memory 303 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0071] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the tea bud density detection method provided by the above methods, the method comprising: obtaining a tea tree canopy image of the area to be detected, the canopy image including a pre-set marking frame with a known area; inputting the canopy image into a trained Faster R-CNN detection model, and outputting a bud quantity result in the canopy image; determining the tea bud density of the area to be detected based on the bud quantity result, the area of the marking frame, and the area ratio of the marking frame to the canopy image; wherein the Faster R-CNN detection model is obtained after training based on a sample canopy image with labeled tea buds.
[0072] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the tea bud density detection method provided by the above-mentioned methods, the method comprising: obtaining a canopy image of a tea tree in an area to be detected, wherein the canopy image includes a pre-set marking frame with a known area; inputting the canopy image into a trained Faster R-CNN detection model, and outputting a bud quantity result in the canopy image; determining the tea bud density in the area to be detected based on the bud quantity result, the area of the marking frame, and the area ratio of the marking frame to the canopy image; wherein the Faster R-CNN detection model is obtained after training based on a sample canopy image with labeled tea buds.
[0073] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0074] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0075] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for detecting tea bud density, characterized in that: include: Acquire a canopy image of a tea tree in a region to be detected, wherein the canopy image includes a pre-set marking frame with a known area; Inputting the canopy image into a trained region candidate-based deep convolutional network Faster R-CNN detection model, and outputting a bud quantity result in the canopy image; Determining the tea bud density of the area to be detected according to the bud quantity result, the area of the marked frame, and the area ratio of the marked frame to the canopy image; The Faster R-CNN detection model is trained based on sample canopy images of labeled tea buds. The method further includes: inputting a standard tea canopy image into the Faster R-CNN detection model to obtain a standard value for bud quantity picking; The method further comprises: Determining a tea bud picking standard density range according to the bud picking standard value, the area of the marked frame, and the area ratio of the marked frame to the canopy image; If the tea bud density in the area to be detected reaches the standard tea bud picking density range, a picking prompt message is issued, wherein the picking prompt message is used to indicate that the time for picking has arrived; The actual number of buds in the standard tea canopy image is equal to the standard number of buds picked.
2. The tea bud density detection method according to claim 1, wherein Before obtaining the tea tree canopy image of the area to be detected, the method further includes: Images of tea tree canopies in multiple sample areas were obtained by shooting at a vertical angle; Marking tea buds on the tea tree canopy images of the plurality of sample areas respectively to obtain a plurality of sample canopy images with marked tea buds; The constructed initial Faster R-CNN detection model is trained according to the sample canopy image to obtain the trained Faster R-CNN detection model.
3. The tea bud density detection method according to claim 2, wherein The tea tree canopy images of the multiple sample areas include multiple tea tree canopy images that meet the picking standards and multiple tea tree canopy images that do not meet the picking standards.
4. The tea bud density detection method according to claim 2, wherein The method of determining the tea bud density of the area to be detected based on the bud quantity result, the area of the marked frame, and the area ratio of the marked frame to the canopy image comprises: Obtaining the actual area of the canopy in the canopy image based on the ratio of the area of the marked frame obtained from the canopy image to the area of the canopy image, combined with the area of the marked frame; The tea bud density of the area to be detected is obtained according to the ratio of the bud quantity result to the actual area of the canopy in the canopy image.
5. The tea bud density detection method according to claim 2, wherein The initial Faster R-CNN detection model constructed according to the sample canopy image is trained to obtain the trained Faster R-CNN detection model, including: Initialize and train the region proposal network (RPN) of the initial Faster R-CNN detection model based on the pre-trained VGG16 network; Initializing the Fast R-CNN of the initial Faster R-CNN detection model based on the pre-trained VGG16, combining the trained RPN to obtain a detection network, and training the detection network using the sample canopy image; The shared convolutional layer of RPN and Fast R-CNN is fixed, and the RPN and Fast R-CNN networks are initialized and trained again according to the trained detection network. After the training is completed, the trained Faster R-CNN detection model is obtained.
6. A tea bud density detection device, characterized in that: include: An acquisition module is used to obtain a canopy image of tea trees in the area to be detected, wherein the canopy image includes a pre-set marking frame with a known area; A processing module is used to input the canopy image into a trained region candidate-based deep convolutional network FasterR-CNN detection model, and output a bud quantity result in the canopy image; an output module, configured to determine the tea bud density of the area to be detected based on the bud quantity result, the area of the marked frame, and the area ratio of the marked frame to the canopy image; The Faster R-CNN detection model is trained based on sample canopy images of labeled tea buds. Input the standard tea canopy image into the Faster R-CNN detection model to obtain the standard value of bud picking; The standard density range for picking tea buds is determined based on the standard value for picking buds, the area of the marking frame, and the area ratio of the marking frame to the canopy image. If the tea bud density in the area to be detected reaches the standard density range for picking tea buds, a picking prompt message is issued, and the picking prompt message is used to indicate that the time for picking has arrived. The actual number of buds in the standard tea canopy image is equal to the standard number for picking.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the tea bud density detection method according to any one of claims 1 to 5 is implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the tea bud density detection method according to any one of claims 1 to 5 is implemented.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the tea bud density detection method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Cloth defect detection method and device based on machine learning
CN107123114A
Deep learning-based automatic detection method and system for multiple growth periods of rice ears
CN112580671A