Young cherry fruit detection method and system, electronic equipment and storage medium
By integrating CSConv, EMA, and MultiSEAM modules into the YOLO11n architecture for cherry fruit detection, the problems of high false negative rate and poor robustness in cherry fruit detection are solved, achieving high accuracy and high real-time detection results, which are suitable for edge devices.
Patent Information
- Application Number
- CN202511817602.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies for detecting young cherry fruits suffer from high false negative rates and poor robustness, especially in complex shading environments where it is difficult to achieve high-precision and real-time detection.
The YOLO11n architecture is used as the base model. The CSConv module is integrated for Lab color space conversion and sparse convolution. The EMA module is combined for channel and spatial attention enhancement. The MultiSEAM module is used for multi-scale spatial attention and decoupling task design, and the feature extraction and detection head are optimized.
It significantly reduces the false detection rate due to color confusion, improves the recall rate in occluded environments, and maintains high accuracy (88.3% mAP@50) while having only 2.62M parameters, a detection speed of 95 FPS, and compatibility with edge devices.
Smart Images

Figure CN121617084A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method and system for detecting young cherry fruits, an electronic device, and a storage medium. Background Technology
[0002] As a high-value fruit, the intelligent development of the cherry industry is crucial for improving production efficiency and reducing labor costs. According to relevant standards, the deformity rate of cherries is a key factor determining their economic value, and early fruit detection is a fundamental prerequisite for realizing orchard management technologies such as intelligent fruit thinning, yield prediction, and automated harvesting. However, traditional manual detection methods are labor-intensive, easily affected by subjective factors, and often have an error rate exceeding 15%.
[0003] Currently, deep learning-based object detection technology offers a feasible solution for the automatic detection of young cherry fruits. Mainstream methods fall into two-stage (e.g., Faster R-CNN) and single-stage (e.g., YOLO series) detection frameworks. However, in complex real-world orchard environments, young cherry fruit detection still faces three core challenges: First, the small size of young fruits (typically only 4-8 mm in diameter) results in weak feature information, making it a typical challenge for small object detection; second, the high color similarity between young fruits and leaves leads to severe color confusion; and third, dense occlusion by branches and leaves significantly reduces the visible features of the target, resulting in a significantly higher false negative rate. While existing technologies have made progress in general object detection, they still fall short in addressing the specific challenges of young cherry fruit detection, particularly in robustness under severe occlusion, effective differentiation of color similarity, and lightweight model design. These shortcomings fail to meet the dual requirements of high accuracy and real-time performance for real-world orchard deployments. Therefore, a high-precision, lightweight detection method is urgently needed. Summary of the Invention
[0004] This invention provides a method and system for detecting young cherry fruits, an electronic device, and a storage medium to address the shortcomings of high false negative rates and poor robustness in related technologies. The solution of this application can achieve accurate and real-time detection of young cherry fruits under complex shading environments.
[0005] This invention provides a method for detecting young cherry fruits, comprising: Acquire a target image including young cherry fruits; The target image is input into a pre-built detection model to obtain the output of the detection model; Based on the output results, determine the young cherry fruits in the target image; The detection model is obtained by integrating the CSConv module in the backbone network and the EMA module in the neck network on the basis of the basic model, and applying the MultiSEAM module as the detection head. The basic model is the YOLO11n architecture.
[0006] According to the cherry fruit detection method provided by the present invention, the basic model includes a backbone network, a neck network, and a head network; The backbone network of the basic model includes a C3k2 module to improve feature extraction efficiency; The neck network of the base model includes an SPPF module and a C2fPSA module for optimizing multi-scale feature fusion; The head network of the basic model is a multi-head detection system.
[0007] According to the cherry fruit detection method provided by the present invention, the CSConv module is used for: The target image is converted from RGB space to Lab space and then separated into channels. Apply contrast-limited adaptive histogram equalization to enhance channel contrast; Background interference is suppressed through gating separation and cross-reconstruction; Enhanced inter-channel interactions and targeted optimizations through non-uniform segmentation, differential transformation, and adaptive fusion processes.
[0008] According to the cherry fruit detection method provided by the present invention, the EMA module is used for: The input feature maps are grouped along the channel dimension, and the first and second branches are input respectively. The first sub-feature map is generated after attention weighting of the feature map in the first branch. The second branch compares the feature map obtained after the Softmax operation with the feature map obtained after the Softmax operation. The sub-feature maps processed by the convolution kernel are multiplied element-wise to generate the first attention weight map; Multiply the first sub-feature map by the first attention weight map to obtain the second attention weight map; The first attention weight map and the second attention weight map are added together, and then multiplied with the original input feature map in a weighted manner before output.
[0009] According to the cherry fruit detection method provided by the present invention, the MultiSEAM module is used for: Multi-scale attention enhancement is applied to the input feature map; Parallel branching is applied to output the detection results of the detection model.
[0010] The cherry fruit detection method provided by the present invention, wherein the suppression of background interference through gating separation and cross-reconstruction includes: Gated separation and cross-reconstruction are performed using the following formula to suppress background interference: in, This represents the input feature tensor, which contains the original feature data of Lab feature maps from different channels; This represents the mean of the features within each group; This represents the mean of the features within each group; It is a very small positive number to prevent the denominator from being zero; This represents the trainable scaling factor; It is a trainable offset factor, and it is a trainable parameter; An adaptive binary mask for guided feature selection is generated using the following formula: in, This represents the Sigmoid function. Indicates an indicator function, For threshold; Use formula Representing information-rich areas, using formulas Representing areas with sparse information, and Divide the width dimension into two equal parts to obtain... and The spatially refined features are obtained by performing feature interaction and concatenation interactions using the following formula: in, These are the features after spatial refinement.
[0011] According to the cherry fruit detection method provided by the present invention, the enhancement of inter-channel interaction and targeted optimization through non-uniform segmentation, differential transformation and adaptive fusion processes include: Apply the following formula for non-uniform segmentation: Where C is the total number of channels. To obtain information-dense segments, The information obtained from the segmentation is sparse; For information-dense segments, the following formula is used for convolution: in, For features output in information-dense segments, GWC is group convolution and PWC is pointwise convolution. For sparse segments of information, the following formula is used for convolution: in, Features output for sparse information segments; The following formula is used for weighted fusion: in, and This is the weight value.
[0012] The present invention also provides a cherry young fruit detection system, applied to the above-mentioned cherry young fruit detection method, comprising: The image acquisition module is used to acquire target images including young cherry fruits; The model detection module is used to input the target image into a pre-built detection model and obtain the output result of the detection model; The result determination module is used to determine the young cherry fruit in the target image based on the output result; The detection model is obtained by integrating the CSConv module in the backbone network and the EMA module in the neck network on the basis of the basic model, and applying the MultiSEAM module as the detection head. The basic model is the YOLO11n architecture.
[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the cherry fruit detection methods described above.
[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the cherry fruit detection methods described above.
[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the cherry fruit detection methods described above.
[0016] The solution of the present invention has the following advantages compared with the prior art: Existing CNN-based detection methods are poorly adapted to scenarios such as the similarity of green young fruit and leaves in color and severe occlusion. However, this invention effectively separates and enhances red-green contrast features through Lab color space conversion and sparse convolution of the CSConv module, significantly reducing false detections caused by color confusion. Existing models have a high false negative rate in densely clustered environments, while this invention significantly improves the recall rate of small targets in occluded environments through the multi-scale spatial attention and decoupled task design of the MultiSEAM detection head. Existing models have high computational complexity and are difficult to deploy in real time. In contrast, this invention maintains high accuracy (88.3% mAP@50) while having only 2.62M parameters, a detection speed of 95 FPS, and compatibility with edge devices. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 This is a schematic flowchart of the cherry fruit detection method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the CSConv module provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the MultiSEAM module provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the EMA module provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the detection model provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of the C3k2_CSC module provided in an embodiment of the present invention; Figure 7 This is a schematic diagram of the detection head provided in an embodiment of the present invention; Figure 8 This is one of the schematic diagrams illustrating the performance comparison provided in the embodiments of the present invention; Figure 9 This is the second schematic diagram illustrating the performance comparison provided in the embodiments of the present invention; Figure 10 This is a schematic diagram of the cherry fruit detection system provided in an embodiment of the present invention; Figure 11 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0020] Figure 1 This is a flowchart illustrating the cherry fruit detection method provided in this embodiment of the invention.
[0021] like Figure 1 As shown, this embodiment provides a method for detecting young cherry fruits, including: Step 101: Obtain a target image including young cherry fruits; Step 102: Input the target image into the pre-built detection model to obtain the output result of the detection model; Step 103: Determine the young cherry fruit in the target image based on the output result; The detection model is obtained by integrating the CSConv module in the backbone network and the EMA module in the neck network on the basis of the basic model, and applying the MultiSEAM module as the detection head. The basic model is the YOLO11n architecture.
[0022] In practical applications, the CSConv module is integrated into the backbone network to alleviate color similarity confusion and reduce channel space redundancy through Lab color space conversion and sparse convolution techniques. The EMA module is integrated into the neck network to enhance cross-scale feature refinement through channel and spatial attention mechanisms; The MultiSEAM module replaces the standard detection head for occlusion perception prediction through multi-scale spatial attention and decoupled task learning.
[0023] In practical applications, the backbone network of the basic model includes a C3k2 module to improve feature extraction efficiency; The neck network of the base model includes an SPPF module and a C2fPSA module for optimizing multi-scale feature fusion; The head network of the basic model is a multi-head detection system that supports accurate prediction of targets ranging from extremely small to large.
[0024] Furthermore, to accommodate cherry fruit detection, the model input size can be set to 640×640×3. The output of the basic model includes the target category, bounding box coordinates, and occlusion probability.
[0025] The structure of the CSConv module provided in this application is as follows: Figure 2 As shown, the CSConv module can be used to solve color similarity and spatial redundancy problems. Specifically, it can be used for: 1. Lab Color Space Conversion: Converts the input image from RGB space to Lab space, separating luminance (L) and chromaticity (a, b) information. The a channel contains red-green contrast, with fruit areas showing positive values and leaf areas showing negative values.
[0026] 2. a-channel enhancement: Contrast-limited adaptive histogram equalization (CLAHE) is applied to enhance the contrast of the a-channel, and learnable scalar weights are used to further enhance the contrast. Its contribution is dynamically adjusted. The formula is as follows: (1) (2) in For the original a channel input, For the enhanced output; These are learnable scalar weights, initialized to 1.0 and optimized during training via gradient descent. These weights are used to... Perform channel scaling operation; This is the final scaling feature.
[0027] 3. Spatial Reconstruction Unit (SRU): Utilizes the scaling factor of Group Normalization (GN). Feature saliency is evaluated, and background interference is suppressed through gating separation and cross-reconstruction. The formula is as follows: (3) in, This represents the input feature tensor, specifically the original feature data of the Lab feature map containing L, a, and b channels; This represents the mean of the features within each group; This represents the mean of the features within each group; It is a very small positive number, and its purpose is to prevent the denominator from being zero; It represents a trainable scaling factor that is strongly positively correlated with the information density of the feature map: regions rich in detail (if solid edges). Higher values; redundant areas (such as uniform blade surfaces). The value is lower; It is a trainable offset factor, and They are also trainable parameters, which will be optimized through gradient descent during model training.
[0028] Subsequently, an adaptive binary mask for guided feature selection is generated using formula (4). : (4) in, This represents the Sigmoid function. Indicates an indicator function, The threshold value is used.
[0029] This process occurs, Corresponding information-rich areas (encapsulating key areas such as the fruit's edges and outline), and This represents a sparse information region (mainly composed of a uniform blade surface and redundant regions such as the background). This allows for the selective retention of high-information regions while suppressing redundant background.
[0030] Next, and Divide the width dimension into two equal parts to obtain... and Then, feature interaction is performed using formula (5), and the interaction results are concatenated using formula (6) to obtain the spatially refined features: (5) (6) Through the aforementioned synergistic effect, the features of information-dense and sparse areas complement each other, suppressing background interference while preserving key details such as edges and contours, thereby enhancing the purity of spatial features.
[0031] 4. Channel Redundancy Reduction (CRU): The Channel Redundancy Reduction Unit is used to optimize the interaction between channels, prioritizing the enhancement of channel a. Addressing the uneven information density among the three Lab channels (with the enhanced channel a being the most information-rich, while L and b channels are relatively less so), CRU employs non-uniform segmentation, differential transformation, and adaptive fusion processes for targeted optimization.
[0032] First, a non-uniform segmentation strategy is adopted to allocate more channel resources to the part carrying enhanced a-channel features (rich in red-green contrast information). Let the total number of channels in the input feature map be C, and the segmentation is performed at an approximately 2:1 ratio, as shown in formulas (7) and (8): (7) (8) in, It primarily carries enhanced α-channel features, requiring more complex feature extraction; It carries the features of the L and b channels, has low information density, and requires only lightweight processing.
[0033] Subsequently, convolution operations with different complexity are applied to the two segments: For information-dense segments, a combination of group convolution (GWC) and pointwise convolution (PWC) is used, as shown in formula (9). This method utilizes the local feature extraction capability of group convolution to reduce computational complexity, while synthesizing cross-group information through pointwise convolution to generate rich features.
[0034] (9) For sparse information segments, only lightweight pointwise convolution (PWC) is used for processing to avoid redundant computation, as shown in formula (10): (10) Finally, an adaptive channel attention module is introduced, which combines a "selective kernel" mechanism similar to SKNet to automatically learn features derived from channel group a. ) and features derived from channel group L / b ( The importance weights of the components are determined, and a weighted fusion is performed. The fusion process is controlled by formula (11): (11) The weight calculation process involves compressing the spatial dimension through global average pooling, followed by weight learning through a fully connected layer. Combined with formula (11), this mechanism enables the model to prioritize enhancing the contribution of the a channel while effectively utilizing auxiliary information from the L and b channels (such as the supplementary role of brightness information in defining the fruit outline) to generate the final output features.
[0035] The structure of the MultiSEAM module provided in this application is as follows: Figure 3 As shown, the MultiSEAM module is used to improve detection performance in scenarios with small targets and occlusion. Specifically, it can be used for: 1. Multi-scale attention enhancement: Feeding feature maps from the neck (in (representing different resolution scales) Convolution unifies the channel, followed by a hierarchical grid attention mechanism (such as...) The network uses a grid-like structure to extract local feature vectors through adaptive average pooling, and then generates channel attention weights via fully connected layers to finally output enhanced features. This process, through multi-level aggregation, strengthens the network's response to the subtle textures of young fruits while effectively suppressing interference from complex leaf backgrounds.
[0036] 2. Decoupled Task Prediction: To fundamentally avoid the conflict between the feature requirements of classification and regression tasks, this invention utilizes three functionally separated parallel branches, which output the target category, bounding box coordinates, and occlusion probability, respectively. Classification branches: by It consists of convolutional layers, global average pooling (GAP), and fully connected layers, focusing on capturing the reflective properties of the fruit surface and outputting class probabilities; Regression branch: via Convolution followed by Convolutional processing of features focuses on predicting bounding box coordinates, optimizing boundary localization errors in leaf occlusion scenarios; Branch blocking: utilizing A large convolutional kernel (whose receptive field can cover a typical pixel leaf region) combined with a sigmoid activation function outputs the quantized probability of leaf projection occlusion.
[0037] 3. Occlusion Awareness Optimization: The RepGT loss function is introduced to improve positioning accuracy through repulsive force constraints. The formula is as follows: (12) in Indicates the predicted bounding box. The predicted bounding boxes represent the true bounding boxes of adjacent objects. This mechanism establishes a repulsive constraint by penalizing high IoU values between the two, forcing the predicted boxes away from the incorrect targets. This works in conjunction with attraction loss to improve localization accuracy in occluded scenes.
[0038] The structure of the EMA module provided in this application is as follows: Figure 4 As shown, the EMA module can be used for: 1. Feature Grouping and Sub-Network Input: Input feature maps extracted from the backbone network. Divide the data into G groups along the channel dimension to obtain G group sub-feature maps: Each group of sub-feature maps These grouped sub-feature maps are then input into two parallel sub-networks (1×1 convolutional branches and 3×3 convolutional branches).
[0039] 2. Spatial Dimension Attention Extraction: The branch contains two parallel paths, each performing one-dimensional global average pooling along the horizontal and vertical directions respectively, to capture long-range dependencies. Its computation is described by equations (13) and (14): (13) (14) The generated feature representation and splicing along the channel dimension, then through Convolution establishes the association between channels and spatial information, and the Sigmoid activation function generates horizontal and vertical attention weight maps. These weight maps are then multiplied with the input sub-feature map to update the features.
[0040] The intermediate feature maps after the above attention weighting are then subjected to group normalization, average pooling, and softmax operations in sequence. Average pooling is used to fuse global spatial information and channel statistics, and its process is described by formula (15): (15) Ultimately, a dimension is generated. The feature map.
[0041] 3. Branch processing: Branch execution and Similar to branching operations. The feature map obtained after the Softmax operation is compared with the feature map obtained after... The sub-feature maps processed by the convolution kernel are multiplied element-wise to generate a matrix of size [size missing]. The initial spatial attention weight map.
[0042] Will Normalized feature map of the group generated by the branch and The outputs of the branches are multiplied to obtain another attention weight map (with the same dimension) that enhances cross-space information exchange. ).
[0043] The two attention weight maps are summed and normalized using the Sigmoid function to generate the final attention map. This final map is then compared with the original input feature map. Weighted multiplication is performed to generate an enhanced output feature map that can significantly highlight prominent areas such as young cherry fruits.
[0044] The structure of the monitoring model provided by this invention is as follows: Figures 5 to 7 As shown, where Figure 5 This is a complete structural diagram of the detection model provided in this application. Figure 6 This is a structural diagram of the C3k2_CSC module, which shows that it integrates the CSConv module. Figure 7 This is a schematic diagram of the detection head of the detection model, which shows that it integrates a MultiSEAM module.
[0045] This invention also includes a performance comparison experiment on the cherry fruit detection method provided in this application. In the data preprocessing stage, image enhancement technology is used to improve the model's generalization ability. Methods such as random rotation, saturation adjustment, and random cropping / occlusion are applied to generate diverse training samples. The enhanced images are uniformly sized to 640×640 pixels, and the batch size is set to 8. Training uses the AdamW optimizer with an initial learning rate of 0.005 and momentum parameters of (0.937, 0.999) to ensure rapid model convergence.
[0046] During implementation, the model's performance was verified through ablation experiments and comparative experiments. The ablation experiment results are as follows: Figure 8 As shown, after adding the CSConv, MultiSEAM, and EMA modules, mAP@50 improved from the baseline of 86.6% to 88.3%, with the CSConv module alone contributing a 1.4% improvement, highlighting its color discrimination capability. In the comparative experiments, Figure 9The mAP@50 comparison of the OCC-YOLO provided in this application with models such as YOLOv5m and YOLOv8n is shown. The OCC-YOLO provided in this application leads with an accuracy of 88.3%, and has only 2.62M parameters and an inference speed of 95 FPS, which is better than other models.
[0047] The cherry young fruit detection system provided by the present invention is described below. The cherry young fruit detection system described below can be referred to in correspondence with the cherry young fruit detection method described above.
[0048] Figure 10 This is a schematic diagram of the cherry fruit detection system provided in an embodiment of the present invention.
[0049] like Figure 10 As shown, the cherry young fruit detection system provided in this embodiment includes: Image acquisition module 1001 is used to acquire target images including young cherry fruits; The model detection module 1002 is used to input the target image into a pre-built detection model and obtain the output result of the detection model; Result determination module 1003 is used to determine the cherry fruit in the target image based on the output result; The detection model is obtained by integrating the CSConv module in the backbone network and the EMA module in the neck network on the basis of the basic model, and applying the MultiSEAM module as the detection head. The basic model is the YOLO11n architecture.
[0050] The specific implementation method of the cherry young fruit detection system provided in this embodiment can be implemented with reference to the above embodiment, and will not be repeated here.
[0051] Figure 11 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 11 As shown, the electronic device may include: a processor 1110, a communications interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communications interface 1120, and the memory 1130 communicate with each other via the communication bus 1140. The processor 1110 can call logical instructions in the memory 1130 to execute a cherry fruit detection method, which includes: Acquire a target image including young cherry fruits; The target image is input into a pre-built detection model to obtain the output of the detection model; Based on the output results, determine the young cherry fruits in the target image; The detection model is obtained by integrating the CSConv module in the backbone network and the EMA module in the neck network on the basis of the basic model, and applying the MultiSEAM module as the detection head. The basic model is the YOLO11n architecture.
[0052] Furthermore, the logical instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0053] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to perform the cherry fruit detection method provided by the above methods, the method comprising: Acquire a target image including young cherry fruits; The target image is input into a pre-built detection model to obtain the output of the detection model; Based on the output results, determine the young cherry fruits in the target image; The detection model is obtained by integrating the CSConv module in the backbone network and the EMA module in the neck network on the basis of the basic model, and applying the MultiSEAM module as the detection head. The basic model is the YOLO11n architecture.
[0054] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the cherry fruit detection method provided by the methods described above, the method comprising: Acquire a target image including young cherry fruits; The target image is input into a pre-built detection model to obtain the output of the detection model; Based on the output results, determine the young cherry fruits in the target image; The detection model is obtained by integrating the CSConv module in the backbone network and the EMA module in the neck network on the basis of the basic model, and applying the MultiSEAM module as the detection head. The basic model is the YOLO11n architecture.
[0055] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0056] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method of cherry young fruit detection, characterized in that, The method comprises the following steps: acquiring a target image including cherry young fruits; inputting the target image into a pre-constructed detection model to obtain an output result of the detection model; determining the cherry young fruits in the target image based on the output result; wherein the detection model is obtained by integrating a CSConv module in a backbone network, integrating an EMA module in a neck network, and applying a MultiSEAM module as a detection head on the basis of a basic model, and the basic model is a YOLO11n architecture.
2. The method of cherry fruit detection according to claim 1, characterized in that, The basic model comprises a backbone network, a neck network, and a head network. The backbone network of the basic model comprises a C3k2 module for improving feature extraction efficiency. The neck network of the basic model comprises an SPPF module and a C2fPSA module for optimizing multi-scale feature fusion. The head network of the basic model is a multi-head detection system.
3. The method of claim 1, wherein The CSConv module is used for: converting the target image from an RGB space to a Lab space and performing channel separation; applying contrast-limited adaptive histogram equalization to enhance channel contrast; suppressing background interference through gated separation and cross reconstruction; enhancing channel interaction and performing targeted optimization through a non-uniform segmentation, differential transformation, and adaptive fusion process.
4. The method of claim 1, wherein The EMA module is used for: grouping input feature maps along the channel dimension and inputting them into a first branch and a second branch respectively; generating a first sub-feature map after attention weighting of the feature maps in the first branch; In the second branch, the feature map obtained after the Softmax operation is multiplied element by element with the sub-feature map processed by the convolution kernel to generate a first attention weight map. In the second branch, the feature map obtained after the Softmax operation is multiplied element by element with the sub-feature map processed by the convolution kernel to generate a first attention weight map. multiplying the first sub-feature map and the first attention weight map to obtain a second attention weight map; adding the first attention weight map and the second attention weight map, and then outputting after weighted multiplication with the original input feature map.
5. The method of claim 1, wherein The MultiSEAM module is used for: performing multi-scale attention enhancement on the input feature map; applying parallel branches to output the detection result of the detection model.
6. The method of claim 3, wherein The background interference suppression through gated separation and cross reconstruction comprises: suppressing background interference through gated separation and cross reconstruction by the following formula: wherein, represents the input feature tensor, containing raw feature data of Lab feature maps of different channels; represents the mean of the features within each group; represents the mean of the features within each group; is a very small positive number to prevent the denominator from being zero; represents a trainable scaling factor; is a trainable offset factor, is a trainable parameter; generating an adaptive binary mask for guided feature selection by the following formula: wherein, denotes a Sigmoid function, denotes an indicator function, is a threshold value; Use the formula Represent the information-rich area, use the formula Represent the information sparse area, will And Along the width dimension, get And The feature interaction and splicing interaction results are obtained by the following formula: wherein, is the spatially refined feature.
7. The method of cherry fruit detection according to claim 6, characterized in that, The enhancement of channel interaction and the targeted optimization through a non-uniform segmentation, differential transformation, and adaptive fusion process comprise: applying the following formula for non-uniform segmentation: Wherein, C is total channel number, is the information-intensive segment obtained by the segmentation, is the information-sparse segment obtained by the segmentation; for information-intensive segments, applying the following formula for convolution operation: wherein, GWC is group-wise convolution and PWC is point-wise convolution. for information-sparse segments, applying the following formula for convolution operation: wherein, features output for information sparse segments; applying the following formula for weighted fusion: wherein and are weight values.
8. A cherry young fruit detection system for use in the cherry young fruit detection method according to any one of claims 1 to 7, characterized in that The method comprises the following steps: an image acquisition module for acquiring a target image including cherry young fruits; a model detection module for inputting the target image into a pre-constructed detection model to obtain an output result of the detection model; a result determination module for determining the cherry young fruits in the target image based on the output result; wherein the detection model is obtained by integrating a CSConv module in a backbone network, integrating an EMA module in a neck network, and applying a MultiSEAM module as a detection head on the basis of a basic model, and the basic model is a YOLO11n architecture.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the cherry young fruit detection method according to any one of claims 1-7 when executing the program.
10. A non-transitory computer-readable storage medium storing a computer program, characterized in that, The computer program implements the cherry young fruit detection method according to any one of claims 1-7 when executed by the processor.