A fruit detection method and system in a complex orchard environment

By using multi-scale feature fusion and pixel-by-pixel reconstruction technology in fruit recognition technology, combined with optimized residual networks and recursive feature pyramids, the accuracy and efficiency problems of fruit detection in complex orchard environments are solved, and efficient fruit recognition is achieved.

CN114494151BActive Publication Date: 2024-10-22SHANDONG NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111652706.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-10-22
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In complex orchard environments, existing fruit recognition technology faces problems such as inconspicuous texture features, branch occlusion, leaf interference and same-color background interference caused by factors such as lighting, angle, and environmental changes, which affects detection accuracy and work efficiency.

Method used

Using multi-scale feature fusion and pixel-by-pixel reconstruction technology, through optimized residual network and recursive feature pyramid, combined with bidirectional convolution and multiple loss functions, the fruit detection model is trained to improve detection accuracy and real-time performance, and reduce dependence on anchor boxes .

Benefits of technology

On the premise of ensuring detection accuracy, it improves real-time performance and model training and detection speed, reduces computing and storage resource requirements, and significantly improves algorithm complexity, detection speed, and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494151B_ABST
    Figure CN114494151B_ABST
Patent Text Reader

Abstract

The present invention discloses a fruit detection method and system in a complex orchard environment, comprising: obtaining fruit images in different interference environments, marking target fruits in the fruit images; extracting image features of the fruit images, and performing multi-scale feature fusion, reconstructing the obtained fusion feature map in a pixel-by-pixel manner to obtain a reconstructed feature map; marking the positive sampling area corresponding to the real frame where the target fruit is located on the reconstructed feature map, determining the training target of each spatial position in the positive sampling area according to the annotation information of the real frame, and training the fruit detection model by the training target; using the trained fruit detection model to obtain the target fruit recognition result for the fruit image to be tested. The problem of the difficulty of model recognition caused by the same color background and other various interferences is solved, the relationship between time and accuracy in fruit detection is balanced, and the real-time performance is improved under the premise of ensuring the detection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fruit recognition, and in particular to a fruit detection method and system in a complex orchard environment. Background Art

[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.

[0003] At present, machine learning algorithms and deep learning algorithms are mostly used in the field of fruit recognition. Among them, the fruit recognition algorithm based on machine learning usually involves operations such as image preprocessing and manual extraction and selection of image features. When the texture features of the fruit are not obvious due to factors such as light intensity, angle or changes in the natural environment; when the shape is missing due to factors such as branches and leaves blocking or overlapping between fruits; when the target fruit is similar to the background of leaves of the same color and there is color interference, the above problems will interfere with the model's detection accuracy of the fruit, thereby affecting the actual operation of the picking robot and affecting work efficiency.

[0004] Models based on deep learning algorithms have made certain progress in accuracy, robustness, and efficiency compared to machine learning algorithms. However, most methods are still based on anchor frames, so the algorithm has a large amount of computation and cannot guarantee the working efficiency of the picking robot. In addition, power consumption and stability issues need to be considered comprehensively when deployed in a real environment. Summary of the invention

[0005] In order to solve the above problems, the present invention proposes a fruit detection method and system in a complex orchard environment, which solves the problem of difficulty in model recognition caused by the same color background and other various interferences, balances the relationship between time and accuracy during fruit detection, and improves real-time performance while ensuring detection accuracy.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] In a first aspect, the present invention provides a method for detecting fruit in a complex orchard environment, comprising:

[0008] Obtain fruit images under different interference environments and mark the target fruits in the fruit images;

[0009] Extracting the image features of the fruit image, and performing multi-scale feature fusion, reconstructing the obtained fused feature map in a pixel-by-pixel manner to obtain a reconstructed feature map;

[0010] Annotate the positive sampling area corresponding to the real frame where the target fruit is located on the reconstructed feature map, determine the training target of each spatial position in the positive sampling area according to the annotation information of the real frame, and train the fruit detection model based on the training target;

[0011] The trained fruit detection model is used on the fruit image to obtain the target fruit recognition result.

[0012] As an optional implementation, the process of extracting image features of fruit images includes: using an optimized residual network to extract image features, the optimized residual network replaces each convolution layer in the residual network with a switchable hole convolution, the switchable hole convolution introduces a dilation rate parameter between convolution layers, and uses the addition of holes to expand the receptive field.

[0013] As an optional implementation, the process of multi-scale feature fusion includes: fusing image features using a recursive feature pyramid in a top-down and lateral connection manner, wherein the recursive feature pyramid is constructed by adding feedback connections to the feature pyramid and aggregating spatial pyramids.

[0014] As an optional implementation, the process of reconstructing the obtained fused feature map in a pixel-by-pixel manner includes: adding a feature map through bidirectional convolution, marking a bounding box for each feature point, obtaining a feature vector corresponding to the bounding box on the feature map according to the coordinates of the bounding box, updating the feature vector using a bilinear interpolation method, and reconstructing the feature map after traversing the feature points.

[0015] As an optional implementation, the training objectives include a classification training objective and a bounding box regression training objective.

[0016] As an optional implementation, the classification training target is a category label corresponding to the real frame, and the frame regression training target is a regularized offset between the corresponding coordinates on the fruit image and the real frame.

[0017] As an optional implementation, multiple loss functions are used in the process of training the fruit detection model, including the loss function between the category confidence generated by the classification branch and the classification target, the loss function between the regularized bounding box offset predicted by the positive sample and the regression target, and the centrality loss function.

[0018] In a second aspect, the present invention provides a fruit detection system in a complex orchard environment, comprising:

[0019] An image acquisition module is configured to acquire fruit images under different interference environments and mark target fruits in the fruit images;

[0020] The feature extraction module is configured to extract image features of the fruit image, perform multi-scale feature fusion, and reconstruct the obtained fused feature map in a pixel-by-pixel manner to obtain a reconstructed feature map;

[0021] The target training module is configured to mark the positive sampling area corresponding to the real frame where the target fruit is located on the reconstructed feature map, determine the training target of each spatial position in the positive sampling area according to the marking information of the real frame, and train the fruit detection model by the training target;

[0022] The fruit recognition module is configured to use the trained fruit detection model to obtain the target fruit recognition result for the fruit image to be detected.

[0023] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is performed.

[0024] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.

[0025] Compared with the prior art, the present invention has the following beneficial effects:

[0026] The present invention proposes a fruit detection method and system in a complex orchard environment, which solves the problem of difficulty in model recognition caused by the same color background and other various interferences, balances the relationship between time and accuracy during fruit detection, and improves real-time performance while ensuring detection accuracy.

[0027] The present invention proposes a fruit detection method and system in a complex orchard environment, which compresses the model capacity, reduces computing and storage resources, speeds up model training and detection, and solves the contradiction between speed and accuracy in previous fruit and vegetable detection methods without losing the detection accuracy based on anchor frames.

[0028] The present invention proposes a fruit detection method and system in a complex orchard environment, which gets rid of the mainstream detection algorithm's dependence on anchor frames, significantly improves the algorithm in terms of complexity, detection speed, storage occupancy, and adaptability, and effectively improves the stability and applicability of the model when it is deployed in various intelligent agricultural applications.

[0029] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0031] Figure 1A schematic flow chart of a method for detecting fruit in a complex orchard environment provided in Example 1 of the present invention;

[0032] Figure 2(a)-2(i) Fruit images under different interference environments provided by Example 1 of the present invention;

[0033] Figure 3 A framework diagram of the optimized ResNet provided in Example 1 of the present invention;

[0034] Figure 4 A structural diagram of the recursive feature pyramid RFP provided in Example 1 of the present invention;

[0035] Figure 5 This is a structural diagram of the refinement module FRM provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0036] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0037] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.

[0038] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0040] Example 1

[0041] like Figure 1 As shown, this embodiment provides a fruit detection method in a complex orchard environment, comprising:

[0042] S1: Obtain fruit images under different interference environments and mark the target fruits in the fruit images;

[0043] S2: extracting image features of the fruit image, performing multi-scale feature fusion, and reconstructing the obtained fused feature map in a pixel-by-pixel manner to obtain a reconstructed feature map;

[0044] S3: Annotate the positive sampling area corresponding to the real frame where the target fruit is located on the reconstructed feature map, determine the training target of each spatial position in the positive sampling area according to the annotation information of the real frame, and train the fruit detection model based on the training target;

[0045] S4: The trained fruit detection model is used to obtain the target fruit recognition result for the fruit image to be tested.

[0046] In step S1, a fruit image containing different interference scenes is obtained under the same color background, and the target fruit in the fruit image is labeled with the minimum circumscribed matrix.

[0047] The data sets collected in this embodiment all contain fruit images taken in various environments such as different time periods, different weather conditions, different lighting angles, and different occlusion conditions. Figure 2(a)-2(i) As shown, some actual pictures in different situations are listed respectively.

[0048] Before labeling, the resolution of the fruit image was reduced to 600×400 pixels, and the labelme software was used to manually label the target fruit in the image. The minimum circumscribed matrix of each fruit in the fruit image was annotated as the true frame, and the corresponding json file was generated and uniformly converted into the MS COCO dataset format.

[0049] In step S2, the image features of the fruit image are extracted, and the process of multi-scale feature fusion includes: extracting image features of the fruit image in batch units using an optimized residual network (Residual Network, ResNet), and gradually enriching the feature expression capabilities contained in the deep feature map through convolution and pooling operations; fusing the feature maps of different sizes output by each residual block in ResNet using feature pyramids (Feature Pyramid Networks, FPN) in a top-down and lateral connection manner, so that the deep feature map and the shallow feature map have the same level of semantic capacity, and improve the segmentation effect of the model for target fruits of different scales, especially small scales; adding feedback connections and atrous spatial pyramid pooling (ASPP) to the feature pyramid to construct a recursive feature pyramid (Recursive Feature Pyramid, RFP), highlighting the effective information of its features while resisting the interference of environmental background factors, reducing the interference caused by unfavorable factors (overlap, occlusion), and focusing on the feature pixels with information.

[0050] In this embodiment, ResNet50 is selected as the basic network to extract image features. In order to alleviate the gradient vanishing and explosion problems caused by the increase of network depth, ResNet is optimized, and each ordinary convolution layer in ResNet is replaced with a switchable atrous convolution (Switchable Atrous Convolution, SAC), which effectively improves the feature information loss problem caused by reducing the image resolution when preprocessing image information.

[0051] Atrous convolution is also known as dilated convolution. In fact, when processing data between convolution layers, in order to better implement convolution calculations, an expansion rate parameter is introduced between convolutions to indicate the spacing between different convolution layers, which is expressed as the number of units between each kernel point in the convolution kernel. By adding holes to expand the receptive field, the original 3×3 convolution kernel can have a larger receptive field with the same number of parameters and calculations without downsampling.

[0052] The SAC architecture used in this embodiment is as follows Figure 3 As shown in the figure, the architecture includes a global upper module, a SAC component and a global lower module. The global upper module and the global lower module are respectively attached before and after the SAC component, thereby realizing soft switching of convolution calculations between different rates, thereby better extracting image label information, better representing image features, and improving the discrimination ability of deeper networks.

[0053] In this embodiment, feedback connection and Atrous Spatial Pyramid Pooling (ASPP) are added to FPN to construct RFP, so as to pay more attention to pixels with information and suppress noise interference caused by unfavorable factors (occlusion, overlap). The formula of FPN after adding feedback connection is as follows:

[0054] n l =N l (n l+1 ,j l ),j l =D l (j l-1 ,K l (n l ))

[0055] Among them, K l It represents the further feature extraction operation before feedback to the backbone, making RFP a recursive operation. When it is expanded into a sequential network, the expanded formula is as follows:

[0056]

[0057] in, is 0, and and It is shared in different steps. In this embodiment, by default is different in each step, and T=2, Figure 4 It is the expansion diagram of RFP at T=2.

[0058] In step S2, the process of reconstructing the obtained fusion feature map pixel by pixel includes: Figure 5 As shown in the figure, the feature refinement module (FRM) is used to refine the fused feature map, and the image feature information of the current predicted border is recoded to the corresponding actual border point, so as to reconstruct the feature map in a pixel-by-pixel manner, realize feature alignment, and improve the detection accuracy of fruits under the same color background.

[0059] Specifically, feature maps are added through bidirectional convolution to obtain new features (large kerner, LK). In the refinement stage, only the bounding box with the highest score for each feature point is retained to improve box filtering (BF) while ensuring that each feature point corresponds to a refined bounding box.

[0060] For each feature point in the feature map, the feature vector corresponding to the bounding box on the feature map is obtained according to the five coordinates of the refined bounding box (one center point and four corner points);

[0061] Add five eigenvectors and replace the current eigenvectors, that is, obtain more accurate eigenvectors through bilinear interpolation;

[0062] After traversing the feature points, the feature map is reconstructed and added to the original feature map.

[0063] In this embodiment, each layer of feature maps in the reconstructed feature map is predicted respectively, and the model prediction value is generated in a fully convolutional manner through two branches of classification and regression, that is, the probability of a category-sensitive semantic map existing as a fruit is predicted, and the mapping relationship between the center point of the original image and the border coordinates of a positive sample corresponding to the original image is predicted;

[0064] Each layer of feature map is connected to three branches: classification, center degree, and regression, which are responsible for predicting the confidence that each spatial position on the feature map belongs to the fruit, the degree of deviation from the center of the fruit, and the distance from the original image coordinates to the four sides of the real frame;

[0065] Among them, the classification and regression branches use two different full convolution channels to decouple predictions, respectively, so that they can focus more on their respective training tasks. The prediction of centrality is relatively simple, so it shares the same part of the full convolution network with the classification. Finally, the centrality and classification outputs are obtained through 1 1×1 convolution kernel and C 1×1 convolution kernels respectively.

[0066] In step S3, according to the area of ​​the target fruit real frame, it is assigned to the corresponding feature map in the feature pyramid for prediction, and the positive sampling area of ​​the real frame on the reconstructed feature map is obtained, and the training target of each spatial position is generated by the annotation information of the corresponding real frame; the training targets include classification training targets and frame regression training targets; specifically include:

[0067] (1) Positive and negative sample determination: Obtain the corresponding area on the feature map of the feature map of the current level that is responsible for predicting the real box, and then shrink it by the shrinkage factor to obtain the positive sampling area. Each spatial position in the positive sampling area is a positive sample, and the others are negative samples;

[0068] For the feature map F i Each position A:(x,y) on the graph is downsampled according to the number of downsamples S at the current level. l It can be obtained that the center left of the corresponding receptive field area on the input image is:

[0069]

[0070] If A' falls within the true annotation box G:(x1,y1,x2,y2), the spatial position A is regarded as a positive sample point in the training phase; otherwise, that is, A' falls outside G, all are regarded as negative sample points.

[0071] (2) Center calculation: The predicted value of the center is multiplied by the predicted value of the corresponding position of the classification branch as the confidence of the final prediction box, thereby effectively suppressing the bounding box predicted by the positive sample point far away from the center of the fruit.

[0072] The centrality is the normalized distance from a specific location (x, y) to the center of the object that is responsible for that location. * ,t * ,r * ,b * , then the centrality target is defined as:

[0073]

[0074] The square root is used in centerness to slow down the attenuation of the center. The value range of centerness is [0,1]. When the mapping coordinate is located in the center of the real frame, the centerness value is 1, and it gradually decays as the mapping coordinate shifts toward the surrounding of the real frame.

[0075] (3) Classification and regression targets: According to the label box information corresponding to the positive sampling point, the classification training target corresponding to the positive sample is the category label of the corresponding real box, and the box regression training target corresponding to the positive sample is the regularized offset between its corresponding coordinates on the input image and the four sides of the real box.

[0076] In this embodiment, during the training of the fruit detection model, the loss between the predicted bounding box obtained through model training and the real box is estimated through iterative training, and the model parameters are updated according to the back propagation gradient of the loss value until the loss is reduced and converges to a value interval, thereby obtaining an optimal loss function for model training. That is, Focal Loss is used to calculate the loss between the category confidence generated by the classification branch and the classification target, IoU Loss is used to calculate the loss between the regularized bounding box offset predicted by the positive sample and the regression target, and BCE Loss is used to calculate the loss generated by the centrality, and the training data is fitted through gradient back propagation and iterative training of the model to obtain the optimal model.

[0077] The loss function of the FRS-Det model is L according to the prediction target, task type, and the proportion of positive and negative samples of each branch of the model. cl , L reg and L cen It consists of three parts, and its loss function is as follows:

[0078] L({cl x,y},{reg x,y},{cen x,y})=L cl +L reg +L cen

[0079]

[0080]

[0081]

[0082] In the formula, cl x,y , reg x,y ,cen x,y are the predicted values ​​of the model at the spatial position (x, y) in the classification branch, regression branch, and centrality branch, respectively. They correspond to the training targets at the spatial positions (x, y) respectively; L class , L regression and L centerness The loss functions corresponding to the classification, regression, and centrality branches are calculated using Focal Loss, IoU Loss, and BCE Loss, respectively, and L regressionand L centerness Only for positive samples; N pos represents the number of positive samples; α and β are the balance coefficients of each loss item.

[0083] Among them, the loss function L of the classification branch class , as shown below:

[0084]

[0085] in:

[0086]

[0087] In the above formula, γ is responsible for balancing the importance between positive and negative samples, and θ is responsible for adjusting the rate at which the weight of simple samples is reduced.

[0088] The loss function L of the regression branch regression , as shown below:

[0089]

[0090] In the above formula, and They are the intersection area and merged area between the predicted box and the true box, respectively.

[0091] The loss function L of the centrality branch centerness , as shown below:

[0092]

[0093] The method of this embodiment is simple and efficient. It can greatly improve the real-time performance of the target fruit detection while ensuring the detection accuracy, thus meeting the requirements of the picking robot for accuracy and robustness.

[0094] Example 2

[0095] This embodiment provides a fruit detection system in a complex orchard environment, including:

[0096] An image acquisition module is configured to acquire fruit images under different interference environments and mark target fruits in the fruit images;

[0097] The feature extraction module is configured to extract image features of the fruit image, perform multi-scale feature fusion, and reconstruct the obtained fused feature map in a pixel-by-pixel manner to obtain a reconstructed feature map;

[0098] The target training module is configured to mark the positive sampling area corresponding to the real frame where the target fruit is located on the reconstructed feature map, determine the training target of each spatial position in the positive sampling area according to the marking information of the real frame, and train the fruit detection model by the training target;

[0099] The fruit recognition module is configured to use the trained fruit detection model to obtain the target fruit recognition result for the fruit image to be detected.

[0100] It should be noted that the above modules correspond to the steps described in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer executable instructions.

[0101] In further embodiments, there is also provided:

[0102] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, it will not be described in detail here.

[0103] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0104] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0105] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is completed.

[0106] The method in Example 1 can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here.

[0107] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0108] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.

Claims

1. A fruit detection method in a complex orchard environment, characterized in that: include: Obtain fruit images under different interference environments and mark the target fruits in the fruit images; Extracting the image features of the fruit image, and performing multi-scale feature fusion, reconstructing the obtained fused feature map in a pixel-by-pixel manner to obtain a reconstructed feature map; Annotate the positive sampling area corresponding to the real frame where the target fruit is located on the reconstructed feature map, determine the training target of each spatial position in the positive sampling area according to the annotation information of the real frame, and train the fruit detection model based on the training target; The trained fruit detection model is used on the fruit image to obtain the target fruit recognition result; Extracting image features of the fruit image includes: extracting image features using an optimized residual network, wherein the optimized residual network is to replace each convolution layer in the residual network with a switchable hole convolution, wherein the switchable hole convolution is to introduce an expansion rate parameter between convolution layers, and to expand the receptive field by adding holes; The obtained fused feature map is reconstructed pixel by pixel, including: adding feature maps through bidirectional convolution, marking bounding boxes for each feature point, obtaining feature vectors corresponding to the bounding boxes on the feature map according to the coordinates of the bounding boxes, updating the feature vectors by bilinear interpolation method, and reconstructing the feature map after traversing the feature points; The positive sampling area corresponding to the real box where the target fruit is marked on the reconstructed feature map includes: obtaining the corresponding area on the feature map of the real box responsible for predicting the feature map of the current level, and then shrinking it with a shrinkage factor to obtain the positive sampling area. Each spatial position in the positive sampling area is a positive sample, and the others are negative samples.

2. The fruit detection method in a complex orchard environment as claimed in claim 1, characterized in that: The process of multi-scale feature fusion includes: fusing image features in a top-down and lateral connection manner using a recursive feature pyramid, wherein the recursive feature pyramid is constructed by adding feedback connections to the feature pyramid and aggregating spatial pyramids.

3. The fruit detection method in a complex orchard environment as claimed in claim 1, characterized in that: The training objectives include a classification training objective and a bounding box regression training objective.

4. The method for detecting fruit in a complex orchard environment as claimed in claim 3, characterized in that: The classification training target is the category label of the corresponding real frame, and the frame regression training target is the regularized offset between the corresponding coordinates on the fruit image and the real frame.

5. The method for detecting fruit in a complex orchard environment as claimed in claim 1, characterized in that: Multiple loss functions are used in the process of training the fruit detection model, including the loss function between the category confidence generated by the classification branch and the classification target, the loss function between the regularized bounding box offset predicted by the positive sample and the regression target, and the centrality loss function.

6. A fruit detection system in a complex orchard environment, characterized in that: include: An image acquisition module is configured to acquire fruit images under different interference environments and mark target fruits in the fruit images; The feature extraction module is configured to extract image features of the fruit image, perform multi-scale feature fusion, and reconstruct the obtained fused feature map in a pixel-by-pixel manner to obtain a reconstructed feature map; The target training module is configured to mark the positive sampling area corresponding to the real frame where the target fruit is located on the reconstructed feature map, determine the training target of each spatial position in the positive sampling area according to the marking information of the real frame, and train the fruit detection model by the training target; A fruit recognition module is configured to use the trained fruit detection model to obtain a target fruit recognition result for the fruit image to be detected; Extracting image features of the fruit image includes: extracting image features using an optimized residual network, wherein the optimized residual network is to replace each convolution layer in the residual network with a switchable hole convolution, wherein the switchable hole convolution is to introduce an expansion rate parameter between convolution layers, and to expand the receptive field by adding holes; The obtained fused feature map is reconstructed pixel by pixel, including: adding feature maps through bidirectional convolution, marking bounding boxes for each feature point, obtaining feature vectors corresponding to the bounding boxes on the feature map according to the coordinates of the bounding boxes, updating the feature vectors by bilinear interpolation method, and reconstructing the feature map after traversing the feature points; The positive sampling area corresponding to the real box where the target fruit is marked on the reconstructed feature map includes: obtaining the corresponding area on the feature map of the real box responsible for predicting the feature map of the current level, and then shrinking it with a shrinkage factor to obtain the positive sampling area. Each spatial position in the positive sampling area is a positive sample, and the others are negative samples.

7. An electronic device, characterized in that: The method comprises a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 5 is completed.

8. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Target fruit detection method and detection system under same-color background

    CN112766361A

  • Method for detecting image target in smart home environment

    WO2021244079A1