Strawberry length detection method and system

By improving the YOLO11 model and combining it with a dataset of strawberries and a ruler, and using the ruler as a reference for strawberry length detection, the problems of low efficiency and high hardware cost in strawberry fruit length detection are solved, and efficient and low-cost strawberry length measurement is achieved.

CN122200634APending Publication Date: 2026-06-12SHENYANG AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENYANG AGRI UNIV
Filing Date
2026-03-30
Publication Date
2026-06-12

AI Technical Summary

Technical Problem

Current technologies for detecting the length of strawberry fruit rely on manual measurement, which is inefficient, subjective, and cannot meet the needs of large-scale production. Furthermore, detection methods based on YOLO algorithms lack physical length measurement solutions, resulting in high hardware costs and cumbersome operation.

Method used

We constructed a dataset using strawberries and rulers, and improved the YOLO11 model to detect the length of strawberries. By using the ruler as a reference, we realized the conversion from pixels to physical length, reducing hardware dependence and technical complexity.

Benefits of technology

It achieves efficient detection of strawberry length, reduces hardware costs and operational complexity, improves detection accuracy and model scalability, and adapts to the needs of multiple scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122200634A_ABST
    Figure CN122200634A_ABST
Patent Text Reader

Abstract

The application provides a strawberry length detection method and system, and relates to the technical field of image processing. The method comprises the following steps: constructing a length detection model, and respectively training, verifying and testing the length detection model by using a strawberry image training set, a strawberry image verification set, a strawberry image test set, a ruler image training set, a ruler image verification set and a ruler image test set to obtain a processed length detection model; collecting strawberry image information to be detected and determining corresponding reference scale data; inputting the strawberry image information to be detected and the reference scale data into the processed length detection model for processing to obtain corresponding strawberry recognition results and ruler recognition results; and obtaining a final strawberry length detection result according to the strawberry recognition results and the ruler recognition results. The application realizes efficient detection of the length of strawberries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and more specifically to a method and system for detecting the length of a strawberry. Background Technology

[0002] Currently, strawberry fruit length is a key indicator for measuring its maturity, commercial value, and growth status. Traditional detection methods rely on manual measurement, which suffers from low efficiency, high subjectivity, easy damage to the fruit, and inability to meet the needs of large-scale production. With the development of computer vision technology, automated detection schemes based on target detection algorithms have gradually become a research hotspot.

[0003] However, existing strawberry detection technologies based on YOLO algorithms mainly focus on strawberry fruit identification and maturity classification, lacking a solution for measuring the physical length of the fruit; some length detection methods rely on complex hardware such as RGB-D cameras and LiDAR to obtain depth information, which is costly and cumbersome to operate.

[0004] Therefore, how to provide a strawberry length detection method that can solve the above problems is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a strawberry length detection method and system, which achieves efficient detection of strawberry length by constructing a dataset of strawberries and a ruler and designing a configurable ruler length, reducing hardware dependence and technical implementation costs, and meeting the needs of large-scale agricultural production.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: A method for detecting strawberry length includes the following steps: S1: Collect strawberry image data and ruler image data, and process the strawberry image data and ruler image data respectively to obtain the corresponding strawberry image training set, strawberry image validation set, strawberry image test set, and ruler image training set, ruler image validation set, and ruler image test set. S2: Construct a length detection model, and train, validate, and test the length detection model using strawberry image training set, strawberry image validation set, strawberry image test set, ruler image training set, ruler image validation set, and ruler image test set respectively, to obtain the processed length detection model; S3: Collect image information of the strawberry to be detected, and determine the corresponding reference scale data at the same time; S4: Input the strawberry image information to be detected and the reference scale data into the processed length detection model for processing to obtain the corresponding strawberry recognition result and scale recognition result; S5: Based on the strawberry recognition results and the ruler recognition results, the final strawberry length detection result is obtained.

[0007] Preferably, S1 includes: S11: Collect strawberry image data and ruler image data, and preprocess and classify the strawberry image data and ruler image data respectively to generate corresponding strawberry image annotation file data and ruler image annotation file data; S12: The strawberry image annotation file data and the ruler image annotation file data are used as the strawberry image dataset and the ruler image dataset, respectively. The strawberry image dataset and the ruler image dataset are divided into the corresponding strawberry image training set, strawberry image verification set, strawberry image test set, and ruler image training set, ruler image verification set, and ruler image test set according to a preset ratio.

[0008] Preferably, S2 includes: S21: Construct a length detection model, wherein the length detection model is an improved YOLO11 model; S22: Input the strawberry image training set, strawberry image validation set, ruler image training set, and ruler image validation set into the improved YOLO11 model for training and validation, and input the strawberry image test set and ruler image test set into the improved YOLO11 model for testing, to obtain the final improved YOLO11 model.

[0009] Preferably, S21 includes: The improved YOLO11 model includes a backbone network, a neck network, and a detection network connected in sequence. The backbone network uses a feature point extraction module to replace the original C3k2 module, the neck network uses a feature point fusion module to replace the C3k2 module, and the detection network adds a feature point matching module and a pixel conversion module.

[0010] Preferably, S5 includes: S51: Extract the corresponding ruler boundary information from the ruler recognition result, and obtain the corresponding ruler length and ruler width based on the ruler boundary information; S52: Determine the conversion ratio between the ruler pixel length and the ruler physical length, and use the conversion ratio as the strawberry pixel conversion ratio; S53: Extract strawberry boundary information from the strawberry recognition result, obtain the corresponding strawberry pixel length and strawberry pixel width based on the strawberry boundary information, and obtain the strawberry length and width detection results by combining the strawberry pixel conversion ratio.

[0011] Preferred options also include: S6: Generate the final strawberry recognition image based on the detection results of the strawberry's length and width.

[0012] The present invention also provides a strawberry length detection system, comprising: The dataset generation module is used to collect strawberry image data and measuring tape image data, and process the strawberry image data and measuring tape image data respectively to obtain the corresponding strawberry image training set, strawberry image validation set, strawberry image test set, and measuring tape image training set, measuring tape image validation set, and measuring tape image test set. The model building module is used to build a length detection model, and to train, validate and test the length detection model using strawberry image training set, strawberry image validation set, strawberry image test set, ruler image training set, ruler image validation set and ruler image test set respectively, to obtain a processed length detection model; The acquisition module is used to acquire image information of the strawberry to be detected, and at the same time determine the corresponding reference scale data; The detection module is used to input the strawberry image information to be detected and the reference scale data into the processed length detection model for processing, so as to obtain the corresponding strawberry recognition result and scale recognition result. The calculation module is used to obtain the final strawberry length detection result based on the strawberry recognition result and the ruler recognition result.

[0013] As can be seen from the above technical solution, compared with the prior art, the present invention discloses a method and system for detecting strawberry length, which has the following beneficial effects: (1) The present invention uses a ruler as a reference object, eliminating the need for depth equipment or complex scale recognition. By converting pixels to physical length, the technical complexity and hardware cost are greatly reduced. (2) The separate dataset construction allows the ruler reference to be independently adapted to various specifications, and the strawberry dataset is optimized for detection accuracy, avoiding data coupling and improving the model's scalability and recognition range; (3) It supports flexible configuration of ruler length, preset common specifications and supports custom input, adapts to the needs of multiple scenarios, and is easy to operate. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present 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 only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0015] Figure 1 This invention provides an overall flowchart of a strawberry length detection method. Figure 2 This is a schematic diagram of the training process of the ruler image model provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the strawberry image model training process provided in an embodiment of the present invention; Figure 4 This is a data graph of strawberry length detection results provided in an embodiment of the present invention; Figure 5 A schematic diagram of the measuring scale dataset provided in an embodiment of the present invention; Figure 6 A schematic diagram of a strawberry image to be detected provided in an embodiment of the present invention; Figure 7 A structural principle block diagram of a strawberry length detection system provided by the present invention; Figure 8 This is a block diagram illustrating the structural principle of the length detection model provided in an embodiment of the present invention. Detailed Implementation

[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0017] See Figure 1 As shown in the figure, an embodiment of the present invention discloses a method for detecting the length of a strawberry, including the following steps: S1: Collect strawberry image data and ruler image data, and process the strawberry image data and ruler image data respectively to obtain the corresponding strawberry image training set, strawberry image verification set, strawberry image test set, and ruler image training set, ruler image verification set, and ruler image test set. The ruler image data should cover most types of rulers in real life to ensure that the ruler information can be accurately identified. S2: Construct a length detection model, and train, validate, and test the length detection model using strawberry image training set, strawberry image validation set, strawberry image test set, ruler image training set, ruler image validation set, and ruler image test set respectively, to obtain the processed length detection model; S3: Acquire image information of the strawberry to be detected, where the image of the strawberry to be detected can be found in [reference needed]. Figure 6 As shown, the corresponding reference scale data is determined simultaneously; S4: Input the strawberry image information to be detected and the reference ruler data into the processed length detection model for processing to obtain the corresponding strawberry recognition result and ruler recognition result. The strawberry image information to be detected must ensure that the image contains the reference ruler, and that the strawberry and the ruler are in the same plane, and that the image shooting angle is parallel to the screen where the strawberry is located. S5: Based on the strawberry recognition results and the ruler recognition results, the final strawberry length detection result is obtained.

[0018] In one specific embodiment, S1 includes: S11: Collect strawberry image data and ruler image data, and preprocess and classify the strawberry image data and ruler image data respectively to generate corresponding strawberry image annotation file data and ruler image annotation file data; S12: The strawberry image annotation file data and the ruler image annotation file data are used as the strawberry image dataset and the ruler image dataset, respectively. The ruler image dataset can be found in [reference needed]. Figure 5 As shown, the strawberry image dataset and the ruler image dataset are divided into corresponding strawberry image training set, strawberry image verification set, strawberry image test set, and ruler image training set, ruler image verification set, and ruler image test set according to a preset ratio.

[0019] In one specific embodiment, S2 includes: S21: Construct a length detection model, wherein the length detection model is an improved YOLO11 model; S22: Input the strawberry image training set, strawberry image validation set, ruler image training set, and ruler image validation set into the improved YOLO11 model for training and validation. Input the strawberry image test set and ruler image test set into the improved YOLO11 model for testing to obtain the final improved YOLO11 model. The model training process can be found in [link to relevant documentation]. Figure 2-3 As shown.

[0020] In one specific embodiment, see Figure 8 As shown, S21 includes: The improved YOLO11 model includes a backbone network, a neck network, and a detection network connected in sequence. The backbone network uses a feature point extraction module to replace the original C3k2 module, the neck network uses a feature point fusion module to replace the C3k2 module, and the detection network adds a feature point matching module and a pixel conversion module.

[0021] Specifically, the feature point extraction module can be implemented using the SIFT algorithm, the feature point fusion module can include feature point filtering units (such as filters) and feature point fusion units (such as FPN feature pyramid fusion), the feature point matching module pre-stores feature point data of the ruler and strawberry for matching, and the pixel conversion module can be implemented using depthwise separable convolution. By improving the backbone network of the YOLO11 model, feature points are extracted from the input strawberry / ruler image. Then, the extracted feature points are fed into the neck network. After a series of processing steps, the feature point filtering unit and the feature point fusion unit of the feature point fusion module are used to obtain the final feature points. The feature points are then used in conjunction with the feature point matching module and the pixel conversion module in the detection network to calculate the pixels.

[0022] In one specific embodiment, S5 includes: S51: Extract the corresponding ruler boundary information from the ruler recognition result, and obtain the corresponding ruler length and ruler width based on the ruler boundary information, wherein the relatively larger distance value is taken as the pixel length; S52: Determine the conversion ratio between the ruler pixel length and the ruler physical length. The calculation method is to divide the configured physical length by the pixel length. This conversion ratio is used as the strawberry pixel conversion ratio. S53: Extract strawberry boundary information from the strawberry recognition result, obtain the corresponding strawberry pixel length and strawberry pixel width based on the strawberry boundary information, and obtain the strawberry length and width detection results by combining the strawberry pixel conversion ratio.

[0023] In one specific embodiment, it also includes: S6: Generate the final strawberry recognition image based on the strawberry length and width detection results. See details in [link to documentation]. Figure 4 As shown.

[0024] Specifically, the implementation process of S6 includes: Get the vertex pixel coordinates P1(x1,y1) and P1(x2,y2) of the strawberry border; Calculate the coordinates of the center points of the borders: the center point of the top border is PU((x2+x1) / 2,y1), and the center point of the left border is P(x1,(y1+y2) / 2). Write the width of the strawberry in the center of the top border and the length in the center of the left border to generate a recognition image with physical length and width data.

[0025] See Figure 7 As shown, this embodiment of the invention also provides a system utilizing the strawberry length detection method described in any of the above embodiments, comprising: The dataset generation module is used to collect strawberry image data and measuring tape image data, and process the strawberry image data and measuring tape image data respectively to obtain the corresponding strawberry image training set, strawberry image validation set, strawberry image test set, and measuring tape image training set, measuring tape image validation set, and measuring tape image test set. The model building module is used to build a length detection model, and to train, validate and test the length detection model using strawberry image training set, strawberry image validation set, strawberry image test set, ruler image training set, ruler image validation set and ruler image test set respectively, to obtain a processed length detection model; The acquisition module is used to acquire image information of the strawberry to be detected, and at the same time determine the corresponding reference scale data; The detection module is used to input the strawberry image information to be detected and the reference scale data into the processed length detection model for processing, so as to obtain the corresponding strawberry recognition result and scale recognition result. The calculation module is used to obtain the final strawberry length detection result based on the strawberry recognition result and the ruler recognition result.

[0026] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0027] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting the length of strawberries, characterized in that, Includes the following steps: S1: Collect strawberry image data and ruler image data, and process the strawberry image data and ruler image data respectively to obtain the corresponding strawberry image training set, strawberry image validation set, strawberry image test set, and ruler image training set, ruler image validation set, and ruler image test set. S2: Construct a length detection model, and train, validate, and test the length detection model using strawberry image training set, strawberry image validation set, strawberry image test set, ruler image training set, ruler image validation set, and ruler image test set respectively, to obtain the processed length detection model; S3: Collect image information of the strawberry to be detected, and determine the corresponding reference scale data at the same time; S4: Input the strawberry image information to be detected and the reference scale data into the processed length detection model for processing to obtain the corresponding strawberry recognition result and scale recognition result; S5: Based on the strawberry recognition results and the ruler recognition results, the final strawberry length detection result is obtained.

2. The strawberry length detection method according to claim 1, characterized in that, S1 includes: S11: Collect strawberry image data and ruler image data, and preprocess and classify the strawberry image data and ruler image data respectively to generate corresponding strawberry image annotation file data and ruler image annotation file data; S12: The strawberry image annotation file data and the ruler image annotation file data are used as the strawberry image dataset and the ruler image dataset, respectively. The strawberry image dataset and the ruler image dataset are divided into the corresponding strawberry image training set, strawberry image verification set, strawberry image test set, and ruler image training set, ruler image verification set, and ruler image test set according to a preset ratio.

3. The strawberry length detection method according to claim 1, characterized in that, S2 includes: S21: Construct a length detection model, wherein the length detection model is an improved YOLO11 model; S22: Input the strawberry image training set, strawberry image validation set, ruler image training set, and ruler image validation set into the improved YOLO11 model for training and validation, and input the strawberry image test set and ruler image test set into the improved YOLO11 model for testing, to obtain the final improved YOLO11 model.

4. The strawberry length detection method according to claim 3, characterized in that, S21 includes: The improved YOLO11 model includes a backbone network, a neck network, and a detection network connected in sequence. The backbone network uses a feature point extraction module to replace the original C3k2 module, the neck network uses a feature point fusion module to replace the C3k2 module, and the detection network adds a feature point matching module and a pixel conversion module.

5. The strawberry length detection method according to claim 1, characterized in that, S5 includes: S51: Extract the corresponding ruler boundary information from the ruler recognition result, and obtain the corresponding ruler length and ruler width based on the ruler boundary information; S52: Determine the conversion ratio between the ruler pixel length and the ruler physical length, and use the conversion ratio as the strawberry pixel conversion ratio; S53: Extract strawberry boundary information from the strawberry recognition result, obtain the corresponding strawberry pixel length and strawberry pixel width based on the strawberry boundary information, and obtain the strawberry length and width detection results by combining the strawberry pixel conversion ratio.

6. The strawberry length detection method according to claim 5, characterized in that, Also includes: S6: Generate the final strawberry recognition image based on the detection results of the strawberry's length and width.

7. A system for detecting strawberry length using the method described in any one of claims 1-6, characterized in that, include: The dataset generation module is used to collect strawberry image data and measuring tape image data, and process the strawberry image data and measuring tape image data respectively to obtain the corresponding strawberry image training set, strawberry image validation set, strawberry image test set, and measuring tape image training set, measuring tape image validation set, and measuring tape image test set. The model building module is used to build a length detection model, and to train, validate and test the length detection model using strawberry image training set, strawberry image validation set, strawberry image test set, ruler image training set, ruler image validation set and ruler image test set respectively, to obtain a processed length detection model; The acquisition module is used to acquire image information of the strawberry to be detected, and at the same time determine the corresponding reference scale data; The detection module is used to input the strawberry image information to be detected and the reference scale data into the processed length detection model for processing, so as to obtain the corresponding strawberry recognition result and scale recognition result. The calculation module is used to obtain the final strawberry length detection result based on the strawberry recognition result and the ruler recognition result.