A method and system for intelligently determining the size grade of a whole bunch of grapes
By using multimodal data processing and consistency factor adjustment, the accuracy and robustness issues caused by occlusion in whole bunch grape sorting have been resolved, achieving high-precision grape size grading and supporting automated sorting of different varieties and tightly packed bunches, thus promoting industrial upgrading.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN ACADEMY OF AGRICULTURAL MACHINERY SCIENCES
- Filing Date
- 2026-06-24
- Publication Date
- 2026-07-21
Smart Images

Figure CN122432888A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-destructive testing of agricultural products and computer vision technology, specifically to an intelligent method and system for determining the size grade of whole bunches of grapes. Background Technology
[0002] In the post-harvest processing and grading of grapes, sorting by berry size is a crucial step in enhancing the product's commercial value. Traditional manual sorting methods are inefficient, labor-intensive, and highly subjective, hindering the industry's large-scale and standardized development. Therefore, automated sorting technology based on computer vision has become an important research direction.
[0003] However, a long-standing core technical challenge in visual analysis of whole bunches of grapes is the severe occlusion between the berries. Grape bunches grow in clusters, with berries densely packed together; in images acquired from any single viewpoint, a large number of berries are partially or completely obscured by others. This renders traditional visual methods—which attempt to segment the complete outline of each berry from a two-dimensional image to directly measure its diameter—essentially ineffective in practical applications because it is impossible to obtain complete geometric information about the occluded berries.
[0004] To address the occlusion problem, one existing solution is the "partial inference of the whole" method, which attempts to infer the size of the occluded portion of a fruit based on the features of a locally visible area (such as a curved edge) of a single fruit, thereby estimating the diameter of the complete fruit. However, this method has a fundamental technical flaw: there is a "many-to-one" mapping ambiguity between the locally visible shape and the complete size. For example, a large fruit that is severely occluded, revealing only a quarter of its curved outline, may have a local edge that is extremely similar to that of a small fruit that happens to reveal a similar curvature. Relying solely on local image features, the algorithm struggles to distinguish between these two cases, easily making incorrect inferences and assigning excessively high confidence to these erroneous predictions.
[0005] The aforementioned technical deficiencies directly lead to severe challenges in the practical industrial application of grape sorting equipment based on traditional computer vision: First, insufficient sorting accuracy and robustness. When the berry occlusion rate is high, the diameter prediction error increases significantly, resulting in a high misjudgment rate. Grape bunches after grading often contain berries of other grades, forcing fruit merchants to perform secondary manual sorting, thus negating the core value of automated equipment. Second, poor variety adaptability. For grape varieties such as Kyoho and Summer Black, with their tightly packed berries, the occlusion problem is particularly prominent, rendering traditional vision methods almost completely ineffective, greatly limiting the market application scope of the equipment and increasing investment risk. For these reasons, most fresh grape producing areas in China still mainly rely on manual sorting by size, hindering the process of industrial automation upgrades.
[0006] Therefore, there is an urgent need for an intelligent method for determining the size grade of whole bunches of grapes that can overcome local visual ambiguity and achieve high precision and robustness. Summary of the Invention
[0007] This invention addresses the shortcomings of existing technologies by providing an intelligent method and system for determining the size grade of an entire bunch of grapes.
[0008] To achieve the above-mentioned objectives, the technical solution adopted by the present invention is as follows:
[0009] A method for intelligently determining the size grade of a whole bunch of grapes includes the following steps:
[0010] Step S1: Synchronous acquisition of multimodal data, acquiring RGB image, depth image and quality value of the target grape bunch;
[0011] Step S2: Process the RGB image and depth image to calculate the volume V of the target grape bunch, and combine it with the mass value W to calculate the apparent density of the target grape bunch. ;
[0012] Step S3: Process the RGB image, identify and segment each visible fruit grain region, extract the geometric features of each visible fruit grain region, and estimate the full diameter of the visible fruit grain based on the geometric features. and its observation error variance Simultaneously, the initial confidence weight is calculated based on the visible area of the visible fruit grain region. ;
[0013] Step S4: Based on a pre-established empirical mapping table corresponding to grape varieties, according to the apparent density... The mass value The volume and the number of visible fruit particles identified. The expected average diameter of the target grape bunch was obtained by querying. and its standard deviation ;
[0014] Step S5: Based on the desired average diameter The standard deviation Estimated total diameter of each visible fruit berry and its observation error variance Initial confidence weights Calculate the consistency factor The initial confidence weight of each visible fruit grain is dynamically adjusted using the consistency factor γ to obtain the final confidence weight of each visible fruit grain. ;
[0015] Step S6: Estimated total diameter of each visible fruit berry and its final confidence weight Calculate the weighted average diameter of the target grape bunch. And diameter uniformity index, combined with the apparent density. The volume The quality value W and the number of visible fruit pieces The comprehensive feature vector is constructed and input into the trained grading model to output the size grading of the target grape bunch.
[0016] Further, the calculation of the volume V of the target grape bunch in step S2 specifically includes:
[0017] Semantic segmentation is performed on the RGB image to obtain the mask region of the entire bunch of grapes;
[0018] Align the depth image to the coordinate system of the RGB image;
[0019] A 3D point cloud is calculated based on the pixel coordinates within the mask area and their corresponding depth values in the depth image.
[0020] Calculate the convex hull volume of the three-dimensional point cloud and use this convex hull volume as the volume V of the target grape bunch.
[0021] Furthermore, the geometric features extracted for each visible fruit grain region in step S3 include: visible area. Perimeter Arc curvature and convex hull ratio .
[0022] Further, in step S5, the consistency factor γ is calculated in the following manner:
[0023] First, calculate the consistency statistic. :
[0024] ;
[0025] in, This represents the chi-square statistic; This represents the inferred diameter of the i-th local region; This represents the expected average diameter based on macroscopic constraints. Indicates the variance of observation error; This represents the standard deviation of the expected diameter;
[0026] Then, based on the aforementioned consistency statistic Calculate the consistency factor :
[0027] .
[0028] Furthermore, the process of dynamically adjusting the confidence weights in step S5 includes overall adjustment and individual adjustment:
[0029] Overall adjustments: ;
[0030] Individual adjustment: For any visible fruit grain Calculate its deviation ,like Then, its final confidence weight is further attenuated: .
[0031] Furthermore, the diameter uniformity index in step S6 is the diameter standard deviation. The calculation formula is as follows:
[0032] .
[0033] This invention also discloses an intelligent system for determining the size grade of whole bunches of grapes to implement the above method, comprising:
[0034] The data acquisition module includes a stereo vision unit for acquiring RGB and depth images, and a dynamic weighing unit for acquiring quality values.
[0035] The volume calculation module is used to calculate the volume of the target grape bunch based on the RGB image and the depth image. ;
[0036] The fruit diameter estimation module includes an instance segmentation submodule and a diameter regression submodule, which are used to identify visible fruit grains from the RGB image and estimate their full diameter, observation error variance, and initial confidence weight.
[0037] The macro-constraint module is used to store experience mapping tables corresponding to different grape varieties, and based on the volume... quality value Apparent density and the number of visible fruit berries The query yields the expected average diameter. and standard deviation ;
[0038] The multimodal fusion inference module is used to calculate the consistency factor. And based on the consistency factor The initial confidence weights output by the fruit diameter estimation module are dynamically adjusted to obtain the final confidence weights.
[0039] The ranking decision module is used to calculate the weighted average diameter based on the adjusted diameter estimate and confidence weights. and diameter uniformity index and in combination with the apparent density The volume The mass value and the number of visible fruit grains The resulting feature vector is used to determine the final grade through a classification model.
[0040] Furthermore, in the data acquisition module, the stereo vision unit includes an RGB camera and a depth camera, which are arranged orthogonally; the dynamic weighing unit is an industrial-grade dynamic weighing sensor.
[0041] The present invention also discloses a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned intelligent method for determining the size grade of a whole bunch of grapes.
[0042] The present invention also discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-mentioned intelligent method for determining the size grade of a whole bunch of grapes.
[0043] Compared with the prior art, the advantages of the present invention are as follows:
[0044] 1. This invention fundamentally solves the inherent ambiguity problem of local visual inference, greatly improving sorting accuracy. Traditional "partial inference of the whole" methods suffer from severe occlusion, leading to a "many-to-one" mapping ambiguity between local shapes and overall dimensions, which is the main source of sorting errors. This invention creatively introduces the mass and volume of the entire bunch of grapes as global, stable, and high-precision macroscopic physical constraints, transforming them into statistical expectations of the average grape size through "apparent density" and an "empirical mapping table." By designing a "consistency check" mechanism, the system can automatically identify and reduce the confidence weight of local inference results that significantly contradict macroscopic constraints, achieving dynamic and adaptive correction of microscopic inferences by macroscopic information. This effectively suppresses misjudgments caused by occlusion, ensuring that the grading accuracy meets commercial sorting requirements and reducing the need for subsequent manual re-inspection.
[0045] 2. Significantly enhanced robustness and adaptability of the system to different grape varieties and bunch types. The measurement of macroscopic constraints (quality, volume) is almost unaffected by the density of berry arrangement or shading rate, providing a stable reference benchmark for sorting tightly packed bunches (such as Kyoho and Summer Black). A dynamic weight adjustment mechanism (including a global consistency factor) is implemented. Adjustment and individual abnormalities The penalty mechanism can automatically reduce reliance on severely occluded fruit bunches, low reliability of inferences, or individual abnormal fruits, ensuring stable system performance in diverse real-world production scenarios. This breaks the limitations of traditional vision methods on a few loosely packed varieties, broadening the market applicability of automated sorting equipment.
[0046] 3. Improved the feasibility and economic benefits of the overall solution, facilitating industrial automation upgrades. This invention integrates inexpensive and technologically mature sensors (weighing sensors, depth cameras) with advanced visual algorithms to construct a multimodal information complementary solution. It effectively addresses the long-standing industry pain point that "machine sorting accuracy is inferior to manual sorting," making the large-scale application of automated visual sorting equipment in the fresh grape industry possible. It can replace inefficient, costly, and subjective manual sorting, driving the industry towards standardization, automation, and intelligence. Attached Figure Description
[0047] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart of the intelligent method for determining the size grade of a whole bunch of grapes in an embodiment of the present invention. Detailed Implementation
[0049] 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, not all, of the embodiments of the present invention. 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.
[0050] like Figure 1 As shown in the figure, this embodiment of the invention provides a method for intelligently determining the size grade of a whole bunch of grapes, specifically including the following steps:
[0051] Step 1: Synchronous Acquisition of Multimodal Data
[0052] When the target bunch of grapes on the conveyor belt reaches the inspection station, a synchronization signal is triggered by a photoelectric sensor. An RGB camera captures a color image with a resolution of 1920×1080. The depth camera acquires a 1280×720 resolution depth image aligned with the RGB image coordinate system. Meanwhile, the weighing sensor acquires the weight waveform at a frequency of 100Hz, and after filtering and extraction of the stable range, obtains the stable mass value of the bunch of grapes. (Unit: grams, g).
[0053] Step 2: Calculate the volume V and apparent density of the entire bunch of grapes.
[0054] First, a pre-trained semantic segmentation model is used to segment RGB images. The process is performed to obtain a pixel-level binary mask of the entire bunch of grapes. Next, using pre-calibrated camera parameters (rotation matrix) Translation vector ,focal length Main point , ), depth image Align to RGB image coordinate system:
[0055]
[0056] in:
[0057] : Depth value at pixel (u,v) in the depth map, in millimeters (mm). This value is directly output by the depth camera and represents the distance from the object's surface to the camera's focal plane.
[0058] : Focal length of the RGB camera, in pixels. This parameter is obtained through camera calibration and is typically 1200~1400 pixels, depending on the specific camera model.
[0059] : Principal point coordinates of the RGB camera, in pixels. This parameter represents the intersection of the camera's optical axis and the imaging plane, typically located near the image center.
[0060] Traversing the mask Each pixel within According to its depth value Calculate the corresponding three-dimensional spatial coordinates Generate a 3D point cloud of grape bunches Finally, the point cloud is calculated. The volume of the convex hull is calculated, and its units are converted from cubic millimeters to cubic centimeters to obtain the volume of the entire bunch of grapes. (Unit: cm) 3 According to the formula Calculate apparent density.
[0061] Step 3: Estimate the diameter of locally visible fruit berries and assign initial weights.
[0062] Use a pre-trained instance segmentation model (such as Mask R-CNN) to segment RGB images. Process the data and output a set of masks for all visible fruit grains. , This represents the total number of visible fruit berries. A mask is applied to each visible fruit berry. Extract its geometric features: visible area Perimeter Arc curvature Compared to convex hull These features are constructed into a vector and input into a pre-trained diameter regression neural network model, which outputs a predicted total diameter of the fruit. (Unit: mm) and its observation error variance Simultaneously, the initial confidence weight is calculated based on the visible area of the fruit. This represents the maximum area of all visible grapes in this bunch. This is the preset impact factor (usually set to 2).
[0063] Step 4: Obtain the desired diameter based on macroscopic constraints
[0064] Beforehand, a large number of samples were measured for different grape varieties (such as Shine Muscat and Kyoho) to establish a system based on apparent density. ,quality ,volume and the number of visible fruit berries The input is an empirical mapping table with the average diameter of the fruit berries as the output (this can be achieved through a statistical regression model). In this step, the values measured in steps two and three will be used as input. , , , Input the mapping table to retrieve the expected average diameter for the current grape bunch. (Unit: mm) and its empirical standard deviation for each variety .
[0065] Step 5: Macro- and Micro-information Fusion and Dynamic Weight Adjustment
[0066] First, calculate the consistency statistic between local speculation and macroeconomic constraints. and consistency factor :
[0067]
[0068]
[0069] in:
[0070] Chi-square statistic, dimensionless. The larger this value, the greater the inconsistency between local projections and macroscopic constraints.
[0071] : The estimated diameter of the i-th local region, in millimeters.
[0072] : Expected average diameter based on macroscopic constraints, in millimeters.
[0073] Observation error variance
[0074] Standard deviation of expected diameter, in millimeters.
[0075] Consistency factor, dimensionless, with a value range of (0,1). The closer it is to 1, the more consistent the local speculation is with the macroscopic constraints; The smaller the value, the more serious the contradiction between the two.
[0076] Divide by 2 Normalize the degrees of freedom of the statistics to avoid the influence of the number of fruits on the results.
[0077] Exponential function: maps a statistic to the interval (0,1] so that it can be used as a weight multiplier.
[0078] Next, the weights are adjusted:
[0079] 1. Overall Adjustment:
[0080] in:
[0081] : The final adjusted weights, dimensionless.
[0082] : Initial weights calculated based on visible area, dimensionless.
[0083] 2. Individual anomaly adjustment: For each fruit, calculate its standardized deviation:
[0084] like Then the weight of that fruit grain will be further attenuated: .
[0085] Step Six: Calculate the comprehensive characteristics and determine the level
[0086] Use the adjusted final weights Calculate the weighted average diameter of the entire bunch of grapes. and diameter standard deviation :
[0087]
[0088]
[0089] in:
[0090] Weighted average diameter, in millimeters (mm), reflects the average size of the fruit;
[0091] Standard deviation of diameter, in millimeters;
[0092] Apparent density, in grams per cubic centimeter (g / cm³) 3 This reflects the plumpness of the fruit berries;
[0093] Volume, in cubic centimeters (cm) 3 This reflects the overall size of the grape bunch;
[0094] Mass of the entire string, in grams (g);
[0095] The number of visible fruit grains is dimensionless.
[0096] Will , , , , , Constructing a comprehensive feature vector The vector is input into a pre-trained multi-classification model (such as a gradient boosting tree or neural network), which outputs the final size and grade label based on the grading criteria of the target variety.
[0097] Taking the "Sunshine Rose" variety as an example, its size grade can be divided according to characteristics such as weighted average diameter, diameter uniformity, and apparent density. The specific standards are as follows:
[0098] 1. Extra Large Fruit (Grade 0): Requires weighted average diameter Furthermore, the fruit size is uniform, and the ratio of its standard deviation in diameter to its weighted average diameter is... At the same time, the apparent density must meet the following requirements. This indicates that the fruit bunches are firm and plump.
[0099] 2. Premium Fruit (Grade 1): Requires weighted average diameter And the uniformity requirement is .
[0100] 3. Grade 1 fruit (Grade 2): The main requirement is the weighted average diameter. If the weighted average diameter reaches the range of premium fruit, but the uniformity is poor (i.e., ( ), will also be judged as a first-class fruit.
[0101] 4. Second-grade fruit (Grade 3): When the weighted average diameter If image analysis reveals that there are obviously shriveled, diseased, or pest-damaged fruits in the string, then the fruit is classified as grade two.
[0102] Take a bunch of "Sunshine Rose" grapes as an example. The system measures its mass. ,volume Then apparent density The vision module detected N=30 visible fruit particles and made a preliminary estimate of the diameter of each particle. (between 26.5mm and 31.8mm) and initial weights Query the "Sunshine Rose" experience mapping table to obtain the expected average diameter. , After consistency testing and calculation, we obtain... Consistency factor This indicates that local speculation is highly consistent with macroeconomic constraints, and the weights do not need to be significantly reduced. Calculate the weighted average diameter. =29.78mm, diameter standard deviation Uniformity After the comprehensive feature vector F is input into the classifier, because its weighted average diameter falls in the range of 28-30.5mm, its uniformity is much better than 20%, and its apparent density shows that the fruit bunch is full, it is judged as "premium fruit" (grade 1).
[0103] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0104] In another embodiment, an intelligent system for determining the size grade of whole bunches of grapes is provided, which corresponds one-to-one with the intelligent method for determining the size grade of whole bunches of grapes in the above embodiments. Detailed descriptions of each functional module are as follows:
[0105] The data acquisition module includes a stereo vision unit for acquiring RGB and depth images, and a dynamic weighing unit for acquiring quality values.
[0106] The volume calculation module is used to calculate the volume of the target grape bunch based on the RGB image and the depth image. ;
[0107] The fruit diameter estimation module includes an instance segmentation submodule and a diameter regression submodule, which are used to identify visible fruit grains from the RGB image and estimate their full diameter, observation error variance, and initial confidence weight.
[0108] The macro-constraint module is used to store experience mapping tables corresponding to different grape varieties, and based on the volume... quality value Apparent density and the number of visible fruit berries The query yields the expected average diameter. and standard deviation ;
[0109] The multimodal fusion inference module is used to calculate the consistency factor. And based on the consistency factor The initial confidence weights output by the fruit diameter estimation module are dynamically adjusted to obtain the final confidence weights.
[0110] The grading decision module is used to calculate the weighted average diameter and uniformity index based on the adjusted diameter estimate and confidence weight, and to determine the final grade by combining macroscopic characteristics through a classification model.
[0111] The hardware of the system mainly includes: an RGB camera, a depth camera, an industrial-grade dynamic weighing sensor, and an industrial computer. The RGB camera and depth camera are orthogonally arranged at the inspection station above the conveyor belt to simultaneously acquire color and depth images of the grape bunches. The dynamic weighing sensor is installed below the conveyor belt to collect real-time weight data of the grape bunches as they pass by. The industrial computer is responsible for running the software algorithms, coordinating the work of each module, and performing data fusion and inference.
[0112] In another embodiment, a terminal device is provided, comprising a processor and a memory. The memory stores a computer program, which includes program instructions. The processor executes the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing and control core of the terminal, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve a corresponding method flow or function. The processor described in this embodiment can be used for the operation of an intelligent method for determining the size grade of entire bunches of grapes.
[0113] In another embodiment, a storage medium is provided, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device used to store programs and data. It is understood that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and extended storage media supported by the terminal device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor; these instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device.
[0114] One or more instructions stored in a computer-readable storage medium can be loaded and executed by a processor to implement the corresponding steps of the intelligent determination method for the size grade of the whole bunch of grapes in the above embodiments; one or more instructions in the computer-readable storage medium are loaded and executed by the processor.
[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0116] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0117] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. 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. Such 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, and should all be included within the protection scope of the present invention.
Claims
1. A method for intelligently determining the size grade of a whole bunch of grapes, characterized in that, Includes the following steps: Step S1: Synchronous acquisition of multimodal data, acquiring RGB image, depth image and quality value of the target grape bunch; Step S2: Process the RGB image and depth image to calculate the volume V of the target grape bunch, and combine it with the mass value W to calculate the apparent density of the target grape bunch. ; Step S3: Process the RGB image, identify and segment each visible fruit grain region, extract the geometric features of each visible fruit grain region, and estimate the full diameter of the visible fruit grain based on the geometric features. and its observation error variance Simultaneously, the initial confidence weight is calculated based on the visible area of the visible fruit grain region. ; Step S4: Based on a pre-established empirical mapping table corresponding to grape varieties, according to the apparent density... The mass value The volume and the number of visible fruit particles identified. The expected average diameter of the target grape bunch was obtained by querying. and its standard deviation ; Step S5: Based on the desired average diameter The standard deviation Estimated total diameter of each visible fruit berry and its observation error variance Initial confidence weights Calculate the consistency factor The initial confidence weight of each visible fruit grain is dynamically adjusted using the consistency factor γ to obtain the final confidence weight of each visible fruit grain. ; Step S6: Estimated total diameter of each visible fruit berry and its final confidence weight Calculate the weighted average diameter of the target grape bunch. And diameter uniformity index, combined with the apparent density. The volume The quality value W and the number of visible fruit pieces The comprehensive feature vector is constructed and input into the trained grading model to output the size grading of the target grape bunch.
2. The intelligent method for determining the size grade of a whole bunch of grapes according to claim 1, characterized in that, The calculation of the volume V of the target grape bunch in step S2 specifically includes: Semantic segmentation is performed on the RGB image to obtain the mask region of the entire bunch of grapes; Align the depth image to the coordinate system of the RGB image; A 3D point cloud is calculated based on the pixel coordinates within the mask area and their corresponding depth values in the depth image. Calculate the convex hull volume of the three-dimensional point cloud and use this convex hull volume as the volume V of the target grape bunch.
3. The intelligent method for determining the size grade of a whole bunch of grapes according to claim 1, characterized in that, The geometric features extracted for each visible fruit grain region in step S3 include: visible area. Perimeter Arc curvature and convex hull ratio .
4. The intelligent method for determining the size grade of a whole bunch of grapes according to claim 1, characterized in that, In step S5, the consistency factor γ is calculated in the following way: First, calculate the consistency statistic. : ; in, This represents the chi-square statistic; This represents the inferred diameter of the i-th local region; This represents the expected average diameter based on macroscopic constraints. Indicates the variance of observation error; This represents the standard deviation of the expected diameter; Then, based on the aforementioned consistency statistic Calculate the consistency factor : 。 5. The intelligent method for determining the size grade of a whole bunch of grapes according to claim 4, characterized in that, The process of dynamically adjusting the confidence weights in step S5 includes overall adjustment and individual adjustment: Overall adjustments: ; Individual adjustment: For any visible fruit grain Calculate its deviation ,like Then, its final confidence weight is further attenuated: .
6. The intelligent method for determining the size grade of a whole bunch of grapes according to claim 5, characterized in that, The diameter uniformity index in step S6 is the diameter standard deviation. The calculation formula is as follows: 。 7. A smart system for determining the size grade of whole bunches of grapes to implement the method as described in any one of claims 1 to 6, characterized in that, include: The data acquisition module includes a stereo vision unit for acquiring RGB and depth images, and a dynamic weighing unit for acquiring quality values. The volume calculation module is used to calculate the volume of the target grape bunch based on the RGB image and the depth image. ; The fruit diameter estimation module includes an instance segmentation submodule and a diameter regression submodule, which are used to identify visible fruit grains from the RGB image and estimate their full diameter, observation error variance, and initial confidence weight. The macro-constraint module is used to store experience mapping tables corresponding to different grape varieties, and based on the volume... quality value Apparent density and the number of visible fruit berries The query yields the expected average diameter. and standard deviation ; The multimodal fusion inference module is used to calculate the consistency factor. And based on the consistency factor The initial confidence weights output by the fruit diameter estimation module are dynamically adjusted to obtain the final confidence weights. The ranking decision module is used to calculate the weighted average diameter based on the adjusted diameter estimate and confidence weights. and diameter uniformity index and in combination with the apparent density The volume The mass value and the number of visible fruit grains The resulting feature vector is used to determine the final grade through a classification model.
8. The intelligent system for determining the size grade of whole bunches of grapes according to claim 7, characterized in that, In the data acquisition module, the stereo vision unit includes an RGB camera and a depth camera, which are arranged orthogonally; the dynamic weighing unit is an industrial-grade dynamic weighing sensor.
9. A computer device, characterized in that: It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 6.