A fruit detection and yield estimation method and system based on machine vision
Through multi-view data collection and feature fusion technology, combined with the DeepSort target tracking model, the problem of insufficient detection accuracy and real-time performance in fruit yield estimation is solved, and efficient detection of tiny fruits and occluded fruits is achieved, significantly improving orchard yield estimation. accuracy and real-time.
Patent Information
- Application Number
- CN202210308755.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-03-28
AI Technical Summary
The existing technology has the problem of low detection accuracy or too long detection time in fruit yield estimation, especially in the detection of tiny fruits and occluded fruits in natural environments, and the traditional yield estimation method only collects single-view images resulting in The loss of fruit information increases the error of the yield estimation model.
Design a fruit detection and yield estimation method based on machine vision, using multi-view data collection and feature fusion technology, jointly collecting three-dimensional structural data through a depth camera and a drone, and building a YOLOv5-FF model of the multi-level feature fusion neck. Combined with the DeepSort target tracking model, fruit target detection and yield estimation are achieved.
It improves the detection accuracy of tiny fruits and occluded fruits, ensures real-time and high efficiency, reduces the loss of fruit information, and significantly improves the accuracy and real-time of orchard yield estimation.
Smart Images

Figure CN114663814B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence target recognition and application technology, and in particular, relates to a fruit detection and yield estimation method and system based on machine vision. Background Art
[0002] China has a long history of producing pears, and the pear production is rich. It is one of the specialty agricultural products of my country. The high yield per mu of pear trees requires a lot of human resources to monitor their growth status. For individual farmers and producer organizations, how to pick the pears in time when they are ripe and how to accurately estimate the yield of the year are the main challenges faced in improving the field management of pears. In order to improve production efficiency and reduce labor consumption, it is crucial to invent an accurate and efficient pear target detection method and yield estimation method for the modern production of the pear industry. The pear detection method can be used in an automated intelligent picking platform to automatically pick mature pears around the clock to improve agricultural production efficiency; the yield estimation method can be applied to standardized orchards to estimate the yield of pear orchards and optimize the industrial layout and macro-adjustment of pear orchards.
[0003] In recent years, with the combination of artificial intelligence and agricultural informatization, the application scenarios based on computer vision technology have been expanded to the research and application of agricultural production. Many scholars have applied deep learning technology in the tasks of fruit target detection and fruit yield estimation. For example, in the study of fruit target detection tasks, Yan Jianwei et al. published a method for identifying prickly pear fruit in a natural environment based on the improved Faster R-CNN in the Journal of the Chinese Society of Agricultural Machinery. The bilinear interpolation method was used to improve the pooling of the region of interest in the convolutional neural network to the regional feature aggregation method of the region of interest calibration, which improved the accuracy of prickly pear target detection. However, due to the use of traditional convolutional neural networks, this method cannot accurately identify the partially occluded tiny prickly pears, and the precision of the precise measurement is insufficient. Jia Weikuan et al. published an efficient detection method for green target fruits based on the optimized Transformer network in the Journal of the Chinese Society of Agricultural Engineering. The convolutional neural network was used to extract image features, which were input into the Transformer encoder-decoder structure to generate prediction boxes, and the detection results were predicted by the feedforward neural network structure, which improved the detection accuracy of green target fruits. However, for images with higher resolution, Transformer has a slow processing speed and takes a long time to detect. It cannot guarantee the real-time detection and is difficult to apply to downstream tasks such as automated picking and yield estimation. In the study of fruit yield estimation, OEApolo-Apoloa et al. published a citrus detection and yield estimation method based on convolutional neural network in the European Journal of Agronomy. They used unmanned aerial vehicles to obtain citrus images, detected the target citrus through the Faster R-CNN target detection model, and trained a yield estimation model based on LSTM. However, only using drones to obtain aerial images above the fruit tree, the citrus located in the middle and bottom of the fruit tree is difficult to be photographed, and the yield estimation model still has large errors, which is not conducive to estimating the yield of densely grown crops. Hamzeh Mirhaji et al. published a multi-view citrus detection and yield estimation method based on YOLO in Computers and Electronics in Agriculture. They collected image data from four sides of a single orange tree, constructed a four-view image dataset on the ground, and trained a YOLOv4 target detection model for yield estimation in orange orchards. However, the four-sided image data collection method is only suitable for orchards with sparse fruit tree planting. For orchards with dense planting, four-sided image data cannot be collected. For fruit trees with high trunk heights, only collecting image data from the ground will result in the omission of fruits on the upper layer, increasing the error of the yield estimation model.
[0004] In summary, the difficulties of the existing technology for fruit yield estimation include: the fruit has complex morphology and uneven distribution. There are a large number of tiny fruits and target fruits obscured by leaves, branches, and other fruits in the natural environment. For these fruits, the existing target detection models have the problem of low detection accuracy or too long detection time, and it is difficult to balance detection accuracy and detection speed. In traditional yield estimation methods, only single-perspective and single-dimensional images of target fruit trees are usually collected. For fruit trees with high yields and dense fruit distribution, there are a large number of unobserved fruits, resulting in serious loss of fruit information, increasing the difficulty of fitting the yield estimation model, and resulting in large errors in model estimation. Therefore, how to design a target detection model with fast and strong detection capabilities for tiny fruits and severely obscured fruits in a natural environment, and how to make full use of orchard images collected from multiple perspectives to make reasonable fruit yield estimates, are problems that technicians in this field urgently need to solve. Summary of the invention
[0005] 1. Problems to be solved
[0006] In view of the problem that fruit yield estimation in the prior art usually only collects target fruit tree images from a single perspective or in a single dimension, which easily causes fruit information loss for densely distributed or high-yield fruits and the fruit yield estimation is not accurate enough, the present invention discloses a fruit detection and yield estimation method and system based on machine vision, constructs a production capacity estimation model, realizes intelligent estimation of orchard yield, and has rich collection dimensions and high accuracy.
[0007] 2. Technical solution
[0008] To achieve the purpose of the present invention, the following technical solution is adopted:
[0009] Designing a high-precision fruit detection model based on multi-view data that can restore the three-dimensional structure of the target under natural environment and constructing an effective fruit yield estimation model are the key to achieving orchard automation and yield estimation.
[0010] In a first aspect, the present invention discloses a method for fruit detection and yield estimation based on machine vision, comprising the following steps:
[0011] Step 1: Collect fruit tree data from at least three angles, and construct a multi-view video stream dataset based on the collected data;
[0012] Step 2: Extract the data features of the data set, integrate the data features and output the fusion feature map;
[0013] Step 3: Improve the feature extraction module and construct a multi-level feature fusion neck to obtain the fruit target detection model;
[0014] Step 4: Train, verify and test the constructed fruit target detection model through the collected data;
[0015] Step 5: Confirm the sample data of the target fruit tree through the fruit target detection model and the fruit target tracking model, wherein the sample data includes the fruit tree count value obtained according to the model and the actual yield of the ridge;
[0016] Step 6: Construct a fruit target yield estimation dataset through multiple sample data and train a fruit yield estimation model;
[0017] Step 7: Estimate fruit yield through the fruit yield estimation model and optimize model parameters.
[0018] Furthermore, when collecting fruit tree data from three angles, step 1 includes the following steps:
[0019] Step 101: Use a depth camera to collect video stream data on both sides of the same tree ridge;
[0020] Step 102: Use a depth camera to collect video stream data above the same tree ridge;
[0021] Step 103: repeatedly collecting three-view video stream data of multiple tree ridges at different distances at different time periods and different lighting conditions, and integrating the video stream data of the same tree ridge to construct a three-view video stream data set;
[0022] Step 104: traverse the color image and depth image collected in the data stream, and remove impurities through the depth image. The formula is:
[0023]
[0024] Where w, h, c represent the width, length and channel of the image. RGB and Depth represent the color image and depth image respectively. RGB(·) and Depth(·) represent a pixel of the color image and depth image respectively. i, j, n represent the width, length and channel number of the image respectively.
[0025] Furthermore, step 2 includes the following steps:
[0026] Step 201: Use a Transformer encoder to replace the BottleNeck feature extraction module in the feature extraction path of the original feature fusion CSP module to extract a feature map Y with a larger receptive field;
[0027] Step 202: using an attention feature fusion module to receive a feature map Y with a larger receptive field output by a feature extraction path in a feature fusion CSP module and a feature map X with a smaller receptive field output by a residual connection path;
[0028] Step 203: In the attention feature fusion module, the small receptive field feature map input X and the large receptive field feature map input Y are integrated, and the weights are extracted through the two paths in the channel attention mechanism module to obtain the fusion weight Redistribute to feature maps X and Y;
[0029] Step 204: Use the Sigmoid activation function to fusion weight The value range is compressed to [0,1], and the small receptive field feature map input X is directly Matrix multiplication, large receptive field feature map input Y and The matrix is multiplied, and then the features of the two are integrated to output the fused feature map. The formula is:
[0030]
[0031] in, represents matrix addition, Represents matrix multiplication.
[0032] Furthermore, step 3 includes constructing a multi-level feature fusion neck to replace the original neck in YOLOv5, and obtaining the fruit object detection model YOLOv5-FF.
[0033] Furthermore, the CSP module of the medium-scale feature map output path is replaced with the CSP module based on feature fusion in step 2, the CSP module of the small-scale feature map output path is replaced with the Transformer encoder, and the CSP module of the large-scale feature map output path is retained to construct a multi-level feature fusion neck.
[0034] Furthermore, step 4 includes the following steps:
[0035] Step 401: pre-processing the collected video stream data into a training set, a validation set and a test set;
[0036] Step 402: Focal EIoU Loss is used as the border loss function of YOLOv5-FF, a training set is input, the YOLOv5-FF network is trained, and a validation set is input to verify the generalization ability of the model, a threshold α is set, and when the validation set loss value is less than α, the training is terminated to obtain a fruit target detection model;
[0037] The calculation formula of Focal EIoU Loss is:
[0038]
[0039]
[0040] L Focal EIoU=IoU γ L EIoU
[0041] Among them, A and B represent the area of the predicted box and the real box respectively, and b and b gt Represent the center points of the predicted box and the real box respectively, ρ 2 (·) represents the Euclidean distance, c represents the diagonal distance between the predicted box and the minimum outer rectangle of the real box, C w ,C h Respectively represent the width and height of the predicted box and the true box closure, w, w gt and h,h gt Represent the width and height of the predicted box and the real box respectively, which are the hyperparameters used to control the curvature of the curve;
[0042] Step 403: Use the average accuracy AP as the evaluation index, input the test set, evaluate the performance of the fruit target detection model, set the threshold β, if the average accuracy of the test set is less than β, optimize the key hyperparameters, re-input the data training, wait for the average accuracy of the test set to be greater than β, and obtain the final fruit yield estimation model. The average accuracy AP calculation formula is:
[0043] AP = ∫0 1 p(r)dr
[0044] Among them, AP represents the average accuracy; p represents the precision; r represents the recall rate.
[0045] Furthermore, step 5 includes extracting the video stream data of a single perspective of a target fruit tree on a ridge from the collected data set, inputting the video stream frame by frame into the fruit target detection model YOLOv5-FF, obtaining the coordinate information of the target pear in the current frame image, and inputting the coordinate information of the target fruit in the current frame image into the target tracking model. The target tracking model predicts the position of the fruit of the previous frame in the current frame by calculating the reference displacement between video frames. Through the cascade matching and IoU matching mechanisms, the fruit that successfully matches inherits the number of the previous frame, and the fruit that fails to match obtains a new number, until all frame images contained in the video stream data are detected, and the number of assigned numbers is counted to achieve fruit counting under a single perspective;
[0046] Repeat the above steps until all the video stream data from the three viewing angles are counted, and the count values Y1, Y2, and Y3 of the target fruit at the three viewing angles are obtained, which are consistent with the actual yield Y of the tree ridge. real Make up a sample.
[0047] Furthermore, step 6 includes obtaining sample data of multiple tree ridges, constructing a fruit yield estimation data set, and dividing it into a fruit yield estimation training set, a fruit yield estimation validation set, and a fruit yield estimation test set;
[0048] The fruit yield estimation training set is input into the fully connected neural network for model training, and the fruit yield estimation validation set is also input. The error on the fruit yield estimation validation set is recorded, and a threshold γ is set. If the error is less than γ, the fruit yield estimation model training is terminated, and the fruit yield estimation test set is input for model testing. If the error of the fruit yield estimation test set is greater than γ, the Dropout strategy is used to ignore some neurons to prevent overfitting, and the key hyperparameters are further optimized through grid search. The data is re-input for training. The training ends when the error of the fruit yield estimation test set is less than γ, and the fruit yield estimation model is obtained.
[0049] Furthermore, step 7 includes estimating the orchard yield based on the constructed fruit yield estimation model by using the known total number of tree ridges in the orchard, comparing it with the actual yield of the orchard that year, evaluating the fruit yield estimation model using the root mean square error, and optimizing the model that does not meet the accuracy requirements.
[0050] The present invention uses the Transformer encoder to extract feature maps with long-range dependencies, and realizes the fusion of feature maps with short-range dependencies extracted by the convolutional neural network through the attention feature fusion structure, constructs a multi-level feature fusion CSP module, and integrates it into the neck of the YOLOv5 fruit target detection model to obtain the multi-level feature fusion YOLOv5-FF fruit target detection model. In view of the problem of different fruit scales and uneven scales of annotation boxes in natural scenes, the Focal EIoULoss border loss function is used to alleviate the problem of decreased positioning accuracy of the prediction box due to the inability to transform the scale of the anchor box.
[0051] The present invention combines the DeepSort target tracking model with the three-view video stream data sets of the tree ridge collected from three angles on both sides and above the tree ridge, inputs the detection results of the fruit target detection model, and tracks and counts the fruits on each side of the data separately. Finally, a fully connected neural network is used to mine the potential relationship between the measured yield and the actual yield of the fruits on both sides and each side above the tree ridge, construct a fruit yield estimation model, and realize intelligent yield estimation of the orchard.
[0052] In a second aspect, the present invention discloses a fruit detection and yield estimation system based on machine vision. Using the fruit detection and yield estimation method based on machine vision, the system includes a data acquisition module, a fruit target detection module and a fruit yield estimation module; the data acquisition module collects fruit data through a multi-view video method, the fruit target detection module is used to perform fruit target detection on the collected data, and the fruit yield estimation module estimates fruit yield according to the data detected by the fruit target detection module through a fruit estimation model.
[0053] The present invention inputs the detection results of the continuous frame images of the fruit video stream by the YOLOv5-FF model into the target tracking model DeepSort, and assigns exclusive numbers to the successfully matched fruits through the cascade matching and IoU matching mechanism, so as to realize the tracking, deduplication and counting of the target fruits, obtain the number of fruits at the three viewing angles on both sides and above the tree ridge, and adopt a fully connected neural network fitting to obtain a yield estimation model based on the fruit count values of the three viewing angles. The present invention uses the YOLOv5-FF model to effectively improve the efficiency of fruit detection, and has the characteristics of convenient deployment, efficient and accurate detection; the proposed yield estimation model can realize high-precision measurement of orchard yield.
[0054] 3. Beneficial effects
[0055] Compared with the prior art, the present invention has the following beneficial effects:
[0056] (1) The present invention designs a fruit target detection model based on the fusion of convolution and Transformer features. Since the convolution-based fruit target detection model has low detection accuracy for target fruits, especially tiny targets and occluded fruit targets, and the Transformer-based fruit target detection model takes a long time to detect and lacks real-time performance, in order to improve the accuracy of the fruit target detection model while ensuring real-time performance, the present invention introduces the Transformer encoder into the convolution-based fruit target detection model, replaces part of the structure in the original model, combines the advantages of the Transformer structure and the convolution structure, and proposes a high-precision real-time detection model for fruit targets, thereby improving the perception of tiny fruits and severely occluded fruits;
[0057] (2) The present invention designs a fruit counting method based on the Deep Sort target tracking model. In the traditional yield estimation model construction method, due to the limitations of the data acquisition method and the model construction method, the fruit yield estimation error is relatively large, among which the re-inspection and missed detection of the fruit are the main reasons. The Deep Sort model is a target tracking model. By inputting the detection results of the fruit target detection model on the video stream data frame image, the Euclidean distance of the target fruit in the previous and next frames is calculated, so that each fruit can inherit or be assigned an exclusive number. After the detection is completed, the number of exclusive numbers is counted to achieve the counting of the target object. Compared with the method of directly counting through the fruit target detection model, the use of the Deep Sort model can reduce the number of target fruits that are re-inspected and missed, and at the same time, the detection speed is high and real-time. The present invention inputs the fruit coordinate information detected by the fruit target detection model into the Deep Sort model, thereby achieving more accurate fruit counting and providing a data basis for the construction of the yield estimation model;
[0058] (3) The present invention designs a CSP module based on feature fusion when extracting features. The CSP module divides the input feature map into two paths, one of which passes through n BottleNeck modules and is connected in parallel with the feature map of the other path, and is restored to the original size before output, thereby enhancing the network learning ability while reducing the model calculation cost. The present invention introduces the Transformer encoder into the original CSP module, replaces the BottleNeck module, and uses the attention feature fusion structure to fuse the feature maps output by the two paths in the CSP, improving the direct parallel method and realizing the coupling between feature maps. The feature map output by the improved CSP is rich in global and local information, and can extract richer feature information, thereby enhancing the feature extraction capability for tiny fruits and obscured fruits;
[0059] (4) The present invention proposes a multi-level feature fusion neck structure. In the YOLOv5 fruit target detection model, the original neck structure contains three feature extraction pathways of different scales, which respectively extract features of input feature maps of different scales. The Transformer encoder will increase the model calculation amount to a certain extent, resulting in increased detection time. In order to improve the real-time performance of fruit target detection, the present invention retains the CSP module of the large-scale feature map output pathway, replaces the CSP module of the medium-scale feature map output pathway with a CSP module based on feature fusion, and replaces the CSP module of the small-scale feature map output pathway with a Transformer encoder, and uses cross-layer connections to prevent deep information redundancy in the network. Compared with the original neck structure, the improved neck of the present invention can extract more feature information and provide more effective visual information for the fruit target detection model. At the same time, the detection time will not increase significantly, and the requirements of real-time detection can still be met;
[0060] (5) The present invention constructs three perspective data sets including both sides and the top of the tree ridge. Since data is only collected from the ground or the air, the data collection angle is limited, a large number of fruits are not observed, and the difficulty of fitting the yield estimation model is increased. The present invention proposes a joint data collection method of a depth camera and an unmanned aerial vehicle. On the ground, a depth camera is used to keep the lens stable, and horizontally move inward from the side close to the road on both sides of the tree ridge to obtain the perspective video stream data of both sides of the tree ridge taken from the ground, including color images and depth images. In the air, a drone is used to keep the lens perpendicular to the ground and stable, and fly in the same direction as the ground data set collection direction directly above the tree ridge to obtain the perspective video stream data of the upper side of the tree ridge taken from the air, and construct three perspective video stream data. This dataset contains different perspectives of the target fruit, reducing the number of fruits that cannot be observed. For the fruit target detection model, it enriches the data diversity and improves the generalization and robustness of the model; for the yield estimation model, it reduces the difficulty of model generalization and reduces the model estimation error;
[0061] (6) The present invention designs a fruit yield estimation model. Combining the three-view video stream dataset constructed by the present invention, the fruit target detection model and the fruit counting model are used to count the video streams of the three viewpoints on both sides and above a tree ridge, and three fruit count values Y1, Y2, and Y3 are obtained as feature variables, which are compared with the true value Y of the ridge. real A sample is formed, repeated multiple times, the count values and true values of multiple tree ridges are obtained, a yield estimation data set is constructed, a fully connected neural network is fitted, and finally a fruit yield estimation model is obtained. The fruit yield estimation model proposed in the present invention maps the predicted yield through a fully connected neural network using three characteristic variables, has rich data dimensions, reduces the difficulty of model fitting, and is conducive to the measurement of fruit yield. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0063] Figure 1 A flow chart is constructed for the fruit target detection model and the fruit yield estimation model of the present invention;
[0064] Figure 2 It is a schematic diagram of a method for acquiring video stream data of fruits from three viewing angles according to the present invention;
[0065] Figure 3 It is a flow chart of the training steps of the fruit target detection model of the present invention;
[0066] Figure 4 Schematic diagram of the improved YOLOv5 model of the present invention;
[0067] Figure 5 Schematic diagram of the feature fusion module designed for the present invention;
[0068] Figure 6 The flowchart of the fruit counting method based on the Deep Sort target tracking model of the present invention;
[0069] Figure 7 It is a structure diagram of a fully connected neural network for yield estimation of the present invention;
[0070] Figure 8 It is a flow chart of the yield estimation model fitting method of the present invention;
[0071] Fig. 9 It is a schematic diagram of the system structure of the present invention;
[0072] The symbols in the figure indicate:
[0073] 1. Data acquisition module; 2. Fruit target detection module; 3. Fruit yield estimation module. DETAILED DESCRIPTION
[0074] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.
[0075] Example
[0076] This embodiment discloses a fruit target detection and fruit yield estimation system based on machine vision. Fig. 9 As shown, the system includes a data acquisition module 1, a fruit target detection module 2 and a fruit yield estimation module 3. The data acquisition module 1 collects data through multi-view video to form a data set. The fruit target detection module 2 performs fruit target detection based on the collected data set. The fruit yield estimation module 3 estimates the yield through a fruit yield estimation model. The system does not require too much human resources and has a fast detection speed.
[0077] like Figure 1 As shown in the figure, the system uses a fruit target detection and fruit yield estimation method based on machine vision. The specific steps are as follows:
[0078] Step 1: Collect fruit tree data from multiple angles and construct a multi-view video stream dataset based on the collected data.
[0079] The depth cameras installed on the ground mobile platform and the drone were used to collect data from both sides and the top of the tree ridge, respectively, to obtain the video stream data of the target fruit from three perspectives of the two sides and the top of the same tree ridge under different lighting conditions. Then, the depth map was used to remove the impurities from the collected data and construct a three-perspective video stream dataset.
[0080] like Figure 2 The schematic diagram of the data acquisition method is shown. In this embodiment, depth cameras installed on a ground mobile platform and a drone are used to collect data from both sides and above of a tree ridge respectively, and video stream data of the target fruit from three perspectives of both sides and above of the same tree ridge under different lighting conditions are obtained. The depth map is used to remove impurities from the collected data and a three-perspective video stream data set is constructed.
[0081] In this embodiment, pears are used as the target fruit. Those skilled in the art should understand that in practical applications, the target fruit here may also refer to apples, peaches, citrus, etc. The difference in target fruits is not intended to limit the present invention.
[0082] The construction of three perspective data sets in this embodiment includes the following steps:
[0083] Step 101: Use a depth camera to collect video stream data on both sides of the same tree ridge.
[0084] At 2-5 meters away from the root of the pear tree, a high-frame-rate depth camera installed on a ground mobile platform was used to collect ground video stream data. The camera's perspective was kept level and the camera angle was adjusted to about 40°. The camera was kept at a low speed and stable. After moving along the front side of the tree ridge from the side close to the road to the end of the tree ridge, it turned to the back side of the tree ridge from the side close to the road in the same direction to collect video data from the other side of the same tree ridge. The collected video data were depth images and color images. The camera repeated the movement multiple times to collect video stream data from multiple perspectives on both sides of the tree ridge to construct a ground data set.
[0085] The depth camera captures the color image and the depth image at the same time. According to the collected depth image, the depth information of the target pear in the real world can be obtained. The formula for calculating the depth of the camera relative to the pear tree is:
[0086]
[0087] The speed of light is c, the round-trip time of the pulse signal from the camera to the target is tp, and the depth detected by the camera is d. From the formula, the closer the object is to the camera, the larger d is; the farther the object is from the camera, the smaller d is, approaching 0. The acquired depth image has the same size as the color image. The depth image only contains the depth channel, and the value of the pixel is the depth d of the point from the camera.
[0088] Step 102: Use a depth camera to collect video stream data above the same tree ridge.
[0089] The drone was deployed 1-2 meters above the pear tree, and the depth camera on the drone was used to fly over the tree ridge. The camera pitch angle was adjusted between 30° and 60°, and the flight speed was set to about 2m / s. The drone flew along the tree ridge above the pear tree, and moved in the same direction as the ground mobile platform to the end of the tree ridge. The video stream data directly above the same tree ridge was constructed, and integrated with the video stream data on both sides obtained from the ground to construct a three-view dataset of the tree ridge.
[0090] Step 103: repeatedly collecting three-view video stream data at different distances from multiple tree ridges at different time periods and different lighting conditions, and integrating the video stream data of the same tree ridge to construct a three-view video stream data set.
[0091] In order to achieve high-precision detection of target fruits, the data used for model training should be diverse. During the data collection process, data with differences should be collected as much as possible. In this example, different time periods, different lighting conditions and different distances are specifically manifested as follows:
[0092] (1) According to the different sunlight intensity at different times, the time periods include 7:00-8:00 a.m., 10:00-11:00 a.m., 2:00-3:00 p.m., and 6:00-7:00 p.m.;
[0093] (2) According to different lighting conditions, lighting conditions include weak light during the day, normal light during the day, strong light during the day and artificial light at night;
[0094] (3) Depending on the specific camera shooting, the distance includes short distance, medium distance and long distance, which are recorded as D1, D2 and D3 respectively. For the camera on the ground mobile platform, the image captured at the distance of D1 can see part of the ground and sky, and there are many pear trees in the background; the image captured at the distance of D2 includes the whole picture of the tree, but almost does not include the ground and sky, and there are some pear trees in the background; the image captured at the distance of D3 includes the pear trees, and the pear trees in the background are almost invisible. For the camera on the drone, the image captured at the distance of D1 includes multiple pear trees and part of the ground can be seen; the image captured at the distance of D2 includes the whole picture of a single tree; the image captured at the distance of D3 includes part of a single pear tree.
[0095] Step 104: traverse the color image and depth image collected in the data stream, and remove impurities through the depth image.
[0096] Traverse the color image and depth image corresponding to each frame in the acquired video stream data, and use the depth image to remove impurities. Since the farther the pixel is from the depth camera, the smaller the pixel value is, the pixel value of the pixel beyond the maximum detection depth of the depth camera is 0. The color image pixels corresponding to the pixel values 0 on the depth image are set to 0 at the same time. The formula is:
[0097]
[0098] Where w, h, c represent the width, length and channel of the image. RGB and Depth represent the color image and depth image respectively. RGB(·) and Depth(·) represent a pixel of the color image and depth image respectively. i, j, n represent the width, length and channel number of the image respectively.
[0099] Step 2: Extract the data features of the data set and integrate the data features to output a fused feature map.
[0100] The Transformer encoder is used to replace the original BottleNeck feature extraction module in the CSP module feature extraction path of YOLOv5, and the feature map with a larger receptive field is extracted. The feature map with a smaller receptive field output by the residual connection path is input into the attention feature fusion module at the same time, and the fused feature map is output after feature integration.
[0101] like Figure 5 As shown, the feature fusion module designed in this embodiment includes a Transformer encoder, a feature fusion CSP module and an attention feature fusion module. The Transformer encoder includes a normalization layer, a multi-head attention layer, a Dropout layer and a fully connected layer; the attention feature fusion module includes a global average pooling layer, a depth-separable convolution layer, a linear rectification activation function and a Sigmoid activation function; the feature fusion CSP module includes a basic convolution layer, a Transformer encoder and an attention feature fusion module.
[0102] Step 2 specifically includes the following steps:
[0103] Step 201: Use a Transformer encoder to replace the BottleNeck feature extraction module in the feature extraction path of the original feature fusion CSP module to extract a feature map Y with a larger receptive field;
[0104] The Transformer encoder contains a normalization layer, a multi-head attention layer, a Dropout layer, and a fully connected layer. The normalization layer and the Dropout layer are used to prevent the network from overfitting and improve the robustness of the model; the multi-head attention layer is used, and the network can extract long- and short-range information in the global range in parallel; the fully connected layer is used, and the feature map is mapped to a specified scale, making the output feature map size controllable. Using the Transformer encoder to replace the original CSP module can establish dependencies between long-range features in the feature map, improve the receptive field of the feature map, and play a role in enriching the semantic information of the feature map.
[0105] Step 202: using an attention feature fusion module to receive a feature map Y with a larger receptive field output by a feature extraction path in a feature fusion CSP module and a feature map X with a smaller receptive field output by a residual connection path;
[0106] like Figure 5 As shown in the figure, the input feature map received by the feature fusion CSP module is integrated into two paths through a 1×1 convolutional layer. One path is the feature extraction path, which outputs a feature map Y with a larger receptive field after extraction by the Transformer encoder; the other path is the residual connection path, which outputs a feature map X with a smaller original receptive field. The feature maps output by the two paths are input into the attention feature fusion module to achieve feature fusion.
[0107] Step 203: In the attention feature fusion module, the small receptive field feature map input X and the large receptive field feature map input Y are integrated, and weights are extracted through the two paths in the channel attention mechanism module to obtain the fusion weight M(X⊕Y), which is redistributed to the feature maps X and Y.
[0108] One of the extraction paths passes through the global average pooling layer, the depthwise separable convolution layer, the linear rectification activation function, and the depthwise separable convolution layer in sequence; the other extraction path passes through the depthwise separable convolution layer, the linear rectification activation function, and the depthwise separable convolution layer in sequence.
[0109] Step 204: Use the Sigmoid activation function to fusion weight The value range is compressed to [0,1], and the small receptive field feature map input X is directly Matrix multiplication, large receptive field feature map input Y and After matrix multiplication, the two features are finally integrated to output the fused feature map. The formula is:
[0110]
[0111] in represents matrix addition, Represents matrix multiplication.
[0112] Step 3: Improve the feature extraction module and construct a multi-level feature fusion neck to obtain the fruit target detection model.
[0113] This embodiment improves the feature extraction module in the original neck of YOLOv5, uses the Transformer encoder and the feature fusion CSP module constructed in step 2 to replace the original CSP modules in the small-scale feature extraction pathway and the medium-scale feature extraction pathway of the neck, constructs a multi-level feature fusion neck, and obtains the fruit target detection model YOLOv5-FF.
[0114] like Figure 4 The improved fruit target detection model YOLOv5 shown in this embodiment includes three parts: a backbone network, a multi-feature fusion neck and a prediction box generation head. The construction of the fruit target detection model YOLOv5 specifically includes the following steps.
[0115] Improve the feature extraction module in the original neck structure of the fruit target detection model YOLOv5, and use the Transformer encoder and the feature fusion CSP module constructed in step 2 to replace part of the original CSP feature extraction modules in the feature extraction path. Replace the CSP module of the medium-scale feature map output path with a CSP module based on feature fusion, replace the CSP module of the small-scale feature map output path with a Transformer encoder, retain the CSP module of the large-scale feature map output path, construct a multi-level feature fusion neck, replace the original neck in YOLOv5, and obtain the fruit target detection model YOLOv5-FF. Use cross-layer connections to prevent deep network information redundancy. Compared with the original neck structure, the improved neck of the present invention can extract more feature information and provide more effective visual information for the fruit target detection model. At the same time, the detection time will not increase significantly, and the requirements of real-time detection can still be met.
[0116] Step 4: Train, verify and test the constructed fruit target model through the collected data.
[0117] Frame images with different lighting conditions are randomly extracted from the three-view video stream datasets for model training, verification and testing. Focal EIoULoss is used as the bounding box loss function to train the YOLOv5-FF network to obtain the fruit target detection model. The key hyperparameters are further optimized according to the evaluation function test results, which includes the following steps.
[0118] Step 401: pre-process the collected video stream data and divide it into a training set, a validation set and a test set.
[0119] Frame images with different lighting conditions are randomly extracted from the three-view video stream dataset, and the target pears in the frame images are annotated. A three-view frame image dataset is constructed and divided into training set, validation set and test set in the ratio of 8:1:1, which are used for model training, validation and testing respectively.
[0120] 1840 frames of images with different perspectives and without illumination were extracted from the three-perspective video stream dataset, and the original three-perspective frame image total dataset was obtained. Due to the high per-acre yield of pear trees, the dense distribution of crisp pears, and the large scale difference, the collected data contains a large number of tiny crisp pears and crisp pears blocked by branches, leaves, and other crisp pears. In order to improve the model detection accuracy, the model should have a good detection ability for these crisp pears. Therefore, the exposed crisp pears, blocked crisp pears, and tiny crisp pears are annotated at the same time to improve the quality of model training data, thereby improving the model detection performance. The total annotated dataset is divided into training set, validation set, and test set in a ratio of 8:1:1.
[0121] Step 402: Figure 3 As shown in the figure, Focal EIoU Loss is used as the border loss function of YOLOv5-FF, the training set is input to train the YOLOv5-FF network, and the validation set is input to verify the generalization ability of the model. The threshold α is set, and the loss value of the validation set is less than α, the training is terminated, and the fruit target detection model is obtained.
[0122] The calculation formula of Focal EIoU Loss is:
[0123]
[0124]
[0125] L Focal EIoU =IoU γ L EIoU
[0126] Among them, A and B represent the area of the predicted box and the real box respectively, and b and b gt Represent the center points of the predicted box and the real box respectively, ρ 2 (·) represents the Euclidean distance, c represents the diagonal distance between the predicted box and the minimum outer rectangle of the real box, C w ,C h Respectively represent the width and height of the predicted box and the true box closure, w, w gt and h,h gt Represent the width and height of the predicted box and the real box respectively, which are the hyperparameters used to control the curvature of the curve.
[0127] In this embodiment, the threshold α is set to 0.1. During the training process, the change in the validation set loss value after each iterative training of the model is recorded:
[0128] If the loss value drops to a lower value and then starts to rise again, it indicates that the model is overfitting, so the training is stopped and the process goes to step 402 .
[0129] If the loss value drops below 0.1 and does not fluctuate significantly, then test the model.
[0130] Step 403: Use the average accuracy (AP) as the evaluation indicator, input the test set, evaluate the performance of the fruit target detection model, set the threshold β, if the average accuracy of the test set is less than β, optimize the key hyperparameters, re-input data training, and wait for the average accuracy of the test set to be greater than β to obtain the final fruit yield estimation model.
[0131] The average accuracy is the area under the PR curve, which is used to measure the judgment criteria between precision and recall, and dynamically considers the relationship between the two. The AP calculation method generally uses the interpolation method, where the AP calculation formula is:
[0132] AP = ∫0 1 p(r)dr
[0133] Among them, AP represents the average accuracy; p represents the precision; r represents the recall rate.
[0134] The key hyperparameters include optimizer selection, which selects the stochastic gradient descent optimization method; the number of model training iterations epochs is set to 200; the number of batches batch_size is set to 8; the initial learning rate learning_rate is set to 0.01; the learning decay rate lr_decay_rate is set to 0.00048; the momentum factor lr_momentum_factor is set to 0.937; the image scaling size image_size training and validation scale are the same 640×384.
[0135] During the test, the average precision AP of the test set is recorded when the intersection over union (IoU) is set to 0.5. In this embodiment, the threshold β is set to 0.9: if the average accuracy of the test set reaches 0.9 when the intersection over union (IoU) is set to 0.5, the accuracy of the pear target detection model meets the requirements, and the fruit target detection model is obtained.
[0136] If the average accuracy of the test set does not reach 0.9 when the intersection over union (IoU) is set to 0.5, the accuracy of the Suli target model does not meet the requirements. In this case, the key hyperparameters including optimizer selection, initial learning rate learning_rate, learning decay rate lr_decay_rate, and momentum factor lr_momentum_factor are reconfigured, and the process goes to step 402 until the average accuracy reaches 0.9 or above when the intersection over union (IoU) is set to 0.5.
[0137] Step 5: Confirm the sample data of the target fruit tree through the fruit target detection model and the fruit target tracking model, and the sample data includes the fruit tree count value obtained according to the model and the actual yield of the ridge.
[0138] like Figure 6 As shown in the figure, according to the constructed fruit target detection model YOLOv5-FF, the three-view video stream data of a ridge of target fruit trees are taken out, and the target tracking model Deep Sort is used to count the fruits in each view video frame respectively, and the crisp pear count values Y1, Y2, and Y3 are obtained, which are consistent with the actual yield Y of the ridge.real A sample is formed, which specifically includes the following steps.
[0139] Step 501, extract the video stream data of a single perspective of a target fruit tree on a ridge from the three-perspective video stream data set, input the video stream frame by frame into the fruit target detection model YOLOv5-FF, and obtain the coordinate information of the target crisp pear in the current frame image.
[0140] Step 502, input the coordinate information of the target fruit in the current frame image into the target tracking model Deep Sort. The Deep Sort model predicts the position of the fruit in the previous frame in the current frame by calculating the reference displacement between video frames. Through the cascade matching and IoU matching mechanism, the successfully matched fruit inherits the number of the previous frame, and the unmatched fruit obtains a new number, until all frame images contained in the video stream data are detected, and the number of assigned numbers is counted to achieve fruit counting under a single perspective.
[0141] Step 503, repeat steps 501 to 502 until all three video stream data are counted, and the pear count values Y1, Y2, and Y3 are obtained, which are consistent with the actual yield Y of the tree ridge. real Make up a sample.
[0142] Step 6: Construct a pear yield estimation dataset through multiple samples and train a fruit yield estimation model.
[0143] Repeat step 5 to count the Y1, Y2, Y3 and Y of multiple tree ridges. real , and obtain multiple samples to construct a pear yield estimation data set. Input the data into Figure 7 The fully connected neural network shown is trained to obtain a fruit yield estimation model, which specifically includes the following steps.
[0144] Step 601: Repeat step 5 until all tree ridges included in the video stream data set are counted, and multiple sample data are obtained, including the count values Y1, Y2, Y3 and the actual yield Y of the three viewing angles. real , construct a fruit yield estimation dataset and divide it into training set, validation set and test set.
[0145] Step 602: Input the training set into the fully connected neural network for model training, and input the validation set at the same time, record the error on the validation set, set the threshold γ, if the error is less than γ, the model training is terminated, input the test set for model testing, if the test set error is greater than γ, use the Dropout strategy to ignore some neurons to prevent overfitting, and further optimize the key hyperparameters through grid search, re-input data training, and terminate the training when the test set error is less than γ, and obtain the fruit yield estimation model.
[0146] In this embodiment, the threshold γ is set to 0.3, and the validation set loss during the training process is recorded.
[0147] If the validation set loss value drops to a lower value and then starts to rise again, it proves that the model is overfitting. Stop training and go to step 6 to optimize some hyperparameters, including but not limited to pruning model neurons, random inactivation, and other operations.
[0148] If the validation set loss value drops below 0.3 and does not fluctuate significantly, the model is then tested.
[0149] Step 7: Estimate the yield through the fruit yield estimation model and optimize the model parameters.
[0150] like Figure 8 As shown in the figure, according to the constructed fruit yield estimation model, the orchard yield was calculated by using the known total number of tree ridges in the orchard, and compared with the actual yield of the orchard that year. The root mean square error (RMSE) was used as an evaluation indicator to evaluate the pear yield estimation model. For models that did not meet the accuracy requirements, the hyperparameters were further optimized.
[0151] If the root mean square error of the test set is less than 5, the accuracy of the yield estimation model of Pears meets the requirements and the yield estimation model is obtained;
[0152] If the root mean square error of the test set is greater than 5 or the loss value of the validation set is greater than 0.3, the accuracy of the pear yield estimation model does not meet the requirements. Go to step 6, optimize some hyperparameters, and retrain.
[0153] This embodiment was applied in a standardized pear orchard in Dangshan County, Suzhou City, Anhui Province. The depth cameras installed on the ground mobile platform and the drone collected data from both sides and the top of the tree ridge respectively. After the color image was cleaned by the depth map, three video stream data sets of the tree ridge were constructed to train the real-time high-precision fruit target detection YOLOv5-FF based on feature fusion. In the yield estimation stage, the Deep Sort model was used to count the three video stream data of a single tree ridge after cleaning, and the yield estimation model of a single tree ridge was constructed by the predicted value and the true value of each side. Finally, the yield of the pear orchard was estimated by the known total number of tree ridges in the orchard. For the training set of crisp pear frame images with different illumination and different perspectives, the average precision AP reached 93.2% under the condition that the intersection and union ratio IoU was set to 0.5. At the same time, the root mean square error of the yield estimation model for the crisp pear yield of the year was 4.8.
[0154] The method of the present invention overcomes the shortcomings of traditional detection methods such as limited real-time performance and low accuracy, and solves the problem of consuming a large amount of human resources in yield estimation. It has strong generalization performance and fast detection speed, and can accurately detect obscured crisp pears and tiny crisp pears, and estimate the yield of pear orchards, providing a feasible solution for target detection and yield estimation of other crops.
[0155] This embodiment also provides an electronic device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the fruit detection and yield estimation method of the above embodiment is implemented.
[0156] The present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed on a computer, the computer executes the fruit detection and yield estimation method provided in the above embodiment. The specific implementation of each of the above operations can be referred to the previous embodiment, which will not be repeated here.
[0157] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. Since the instructions stored in the storage medium can execute the steps of fruit detection and yield estimation provided in the embodiment of the present application, the beneficial effects of fruit detection and yield estimation provided in the embodiment of the present application can be achieved, as detailed in the previous embodiments, which will not be repeated here.
[0158] The above schematically describes the invention and its implementation methods, which is not restrictive. Without departing from the spirit or basic features of the invention, the invention can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention. The actual structure is not limited to this, and any figure mark in the claims should not limit the claims involved. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and an embodiment similar to the technical solution are designed without creativity, which should all fall within the scope of protection of this patent. In addition, the word "including" does not exclude other elements or steps, and the word "one" before the element does not exclude the inclusion of "multiple" elements. The multiple elements stated in the product claim can also be implemented by one element through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.
Claims
1. A fruit detection and yield estimation method based on machine vision, characterized in that: The following steps are involved: Step 1: Collect fruit tree data from at least three angles, and construct a multi-view video stream dataset based on the collected data; When collecting fruit tree data from three angles, the following steps are included: Step 101: Use a depth camera to collect video stream data on both sides of the same tree ridge; Step 102: Use a depth camera to collect video stream data above the same tree ridge; Step 103: repeatedly collecting three-view video stream data of multiple tree ridges at different distances at different time periods and different lighting conditions, and integrating the video stream data of the same tree ridge to construct a three-view video stream data set; Step 104: traverse the color image and depth image collected in the data stream, and remove impurities through the depth image. The formula is: in, w , h , c represents the width, length and channels of the image, RGB , Depth Represent the color image and depth image respectively, RGB ( ), Depth ( ) represent a pixel point of the color image and the depth image respectively, i , j , n Represent the order of image width, length and channels respectively; Step 2: Extract the data features of the data set, integrate the data features and output a fusion feature map; specifically, the following steps are included: Step 201: Use a Transformer encoder to replace the BottleNeck feature extraction module in the feature extraction path of the original feature fusion CSP module to extract a feature map Y with a larger receptive field; Step 202: using an attention feature fusion module to receive a feature map Y with a larger receptive field output by a feature extraction path in a feature fusion CSP module and a feature map X with a smaller receptive field output by a residual connection path; Step 203: In the attention feature fusion module, the small receptive field feature map input X and the large receptive field feature map input Y are integrated, and the weights are extracted through the two paths in the channel attention mechanism module to obtain the fusion weight M(X Y), redistributed to feature maps X and Y; Step 204: Use the Sigmoid activation function to convert the fusion weight M(X Y) is compressed to [0,1], and the small receptive field feature map input X is directly combined with M(X Y) matrix multiplication, large receptive field feature map input Y and 1-M (X Y) matrix multiplication, and then integrate the features of the two to output the fusion feature map. The formula is: in, represents matrix addition, represents matrix multiplication; Step 3: Improve the feature extraction module and construct a multi-level feature fusion neck to obtain a fruit target detection model; specifically, construct a multi-level feature fusion neck to replace the original neck in YOLOv5 to obtain the fruit target detection model YOLOv5-FF; Step 4: Train, verify and test the constructed fruit target detection model through the collected data; Step 5: Confirm the sample data of the target fruit tree through the fruit target detection model and the fruit target tracking model, wherein the sample data includes the fruit tree count value obtained according to the model and the actual yield of the ridge; Step 6: Construct a fruit target yield estimation dataset through multiple sample data and train a fruit yield estimation model; Step 7: Estimate fruit yield through the fruit yield estimation model and optimize model parameters.
2. The method for fruit detection and yield estimation based on machine vision according to claim 1, characterized in that: Replace the CSP module of the medium-scale feature map output path with the CSP module based on feature fusion in step 2, replace the CSP module of the small-scale feature map output path with the Transformer encoder, retain the CSP module of the large-scale feature map output path, and construct a multi-level feature fusion neck.
3. The method for fruit detection and yield estimation based on machine vision according to claim 2, characterized in that: Step 4 includes the following steps: Step 401: pre-processing the collected video stream data into a training set, a validation set and a test set; Step 402: Focal EIoU Loss is used as the border loss function of YOLOv5-FF, a training set is input, the YOLOv5-FF network is trained, and a validation set is input to verify the generalization ability of the model, a threshold α is set, and the loss value of the validation set is less than α, the training is terminated, and a fruit target detection model is obtained; the calculation formula of Focal EIoU Loss is: in, A , B Represent the area of the predicted box and the real box respectively, b , b gt Represent the center points of the predicted box and the real box respectively, ρ 2 ( ) represents the Euclidean distance, c Represents the diagonal distance between the predicted box and the minimum outer rectangle of the real box, C w , C h Respectively represent the width and height of the predicted box and the true box closure, w , w gt and h , h gt Represent the width and height of the predicted box and the real box respectively, γ is the hyperparameter used to control the curvature of the curve; Step 403: Use the average accuracy AP as the evaluation index, input the test set, evaluate the performance of the fruit target detection model, set the threshold β, if the average accuracy of the test set is less than β, optimize the key hyperparameters, re-input the data training, wait for the average accuracy of the test set to be greater than β, and obtain the final fruit yield estimation model. The average accuracy AP calculation formula is: in, AP represents the average accuracy; p Indicates accuracy; r Represents the recall rate.
4. The method for fruit detection and yield estimation based on machine vision according to claim 3, characterized in that: Step 5 includes taking out the video stream data of a single perspective of a target fruit tree on a ridge from the collected data set, inputting the video stream frame by frame into the fruit target detection model YOLOv5-FF, obtaining the coordinate information of the target crisp pear in the current frame image, and inputting the coordinate information of the target fruit in the current frame image into the target tracking model. The target tracking model predicts the position of the fruit of the previous frame in the current frame by calculating the reference displacement between video frames. Through the cascade matching and IoU matching mechanisms, the fruit that successfully matches inherits the number of the previous frame, and the fruit that fails to match obtains a new number until all frame images contained in the video stream data are detected, and the number of assigned numbers is counted to achieve fruit counting under a single perspective; Repeat the above steps until all the video stream data from the three perspectives are counted, and the count values of the target fruit in the three perspectives are obtained. Y 1, Y 2, Y 3. The actual yield of the ridge Y real Make up a sample.
5. The method for fruit detection and yield estimation based on machine vision according to claim 1, characterized in that: Step 6 includes obtaining sample data of multiple tree ridges, constructing a fruit yield estimation data set, and dividing the data into a fruit yield estimation training set, a fruit yield estimation validation set, and a fruit yield estimation test set; The fruit yield estimation training set is input into the fully connected neural network for model training, and the fruit yield estimation validation set is also input. The error on the fruit yield estimation validation set is recorded, and a threshold γ is set. If the error is less than γ, the fruit yield estimation model training is terminated, and the fruit yield estimation test set is input for model testing. If the error of the fruit yield estimation test set is greater than γ, the Dropout strategy is used to ignore some neurons to prevent overfitting, and the key hyperparameters are further optimized through grid search. The data is re-input for training. The training ends when the error of the fruit yield estimation test set is less than γ, and the fruit yield estimation model is obtained.
6. The method for fruit detection and yield estimation based on machine vision according to claim 1, characterized in that: Step 7 includes estimating the orchard yield based on the constructed fruit yield estimation model by using the known total number of tree ridges in the orchard, comparing it with the actual yield of the orchard that year, evaluating the fruit yield estimation model using the root mean square error, and optimizing the model that does not meet the accuracy requirements.
7. A fruit detection and yield estimation system based on machine vision, characterized in that: Using a machine vision-based fruit detection and yield estimation method as described in any one of claims 1 to 6, the system includes a data acquisition module 1, a fruit target detection module 2 and a fruit yield estimation module 3; the data acquisition module 1 collects fruit data through a multi-view video method, the fruit target detection module 2 is used to perform fruit target detection on the collected data, and the fruit yield estimation module 3 estimates fruit yield based on the data detected by the fruit target detection module 2 through a fruit estimation model.
