Corn ear shape quantitative analysis method, device, equipment and storage medium

By acquiring RGB images of corn ears, performing image preprocessing and semantic segmentation, calculating feature parameters, and constructing a machine learning model, the problems of low efficiency and insufficient accuracy in corn ear shape testing are solved, realizing the digitalization and intelligentization of DUS testing and supporting the protection of seed industry intellectual property rights.

CN121837282BActive Publication Date: 2026-05-01INST OF QUALITY STANDARD & DETECTION TECH YUNNAN ACAD OF AGRI SCI
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INST OF QUALITY STANDARD & DETECTION TECH YUNNAN ACAD OF AGRI SCI
Filing Date
2026-03-13
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing corn cob shape DUS testing relies on experience-based judgment, which is inefficient, subjective, and lacks accuracy, making it difficult to meet the needs of large-scale testing. Furthermore, the data has a low degree of digitization and cannot form structured data for traceability and analysis.

Method used

By acquiring RGB images of corn ears, filtering and extracting pure regions, performing geometric division and measurement, calculating feature width and height parameters, combining trigonometric functions to calculate ear edge angles, constructing a machine learning grading model, and outputting quantitative grading results.

Benefits of technology

It has enabled an objective, accurate, and efficient transformation in corn ear shape testing, moving from experience-based judgment to digital testing. It supports the digitalization and intelligentization of DUS testing, improving testing efficiency and accuracy, and meeting the needs of seed industry intellectual property protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121837282B_ABST
    Figure CN121837282B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of quantitative analysis of corn ear shape, and discloses a corn ear shape quantitative analysis method, device, equipment and storage medium. The method comprises the following steps: acquiring a plurality of target corn ear RGB images, screening training sample images and extracting pure ear regions, performing geometric division and measurement on the segmented ear regions, acquiring characteristic width and height parameters, calculating a characteristic ear rim angle through trigonometric function operation, taking the size parameters formed by the characteristic width and height parameters and the calculated ear rim angle as input features, combining artificial grading labels to construct and train a machine learning grading model, analyzing the feature parameters of the corn ear image to be graded by using the trained machine learning classification model, and outputting a quantitative grading result. The method establishes an objective, accurate and efficient corn ear shape testing method, realizes the transition of DUS testing from experience judgment to digital testing, and has important theoretical value and practical significance for seed industry intellectual property protection.
Need to check novelty before this filing date? Find Prior Art

Description

Methods, apparatus, equipment and storage media for quantitative analysis of maize ear shape Technical Field

[0001] This invention relates to the field of quantitative analysis technology of corn ear shape, and in particular to a method, apparatus, equipment and storage medium for quantitative analysis of corn ear shape. Background Technology

[0002] The seed industry is a fundamental and core industry of the nation, and plant variety rights are an important component of seed industry intellectual property rights. The Distinctiveness, Uniformity, and Stability (DUS) test for new plant varieties is a crucial basis for obtaining authorization and protection, and a prerequisite for variety approval and registration. In the DUS test for maize varieties, ear shape is an important trait and one of the traits most closely watched by breeders.

[0003] Providing accurate, objective, and efficient test results is crucial for protecting the intellectual property rights of new maize varieties and safeguarding the legitimate rights and interests of breeders. Currently, maize ear shape DUS testing is mainly conducted according to the "Guideline for Testing Plant Variety Distinctiveness, Uniformity and Stability (MDS) - Maize" (GB / T 19557.24-2018). This testing relies heavily on the experience and judgment of professional testers, making it an experience-based test with problems such as low efficiency, strong subjectivity, and insufficient accuracy. Furthermore, the process of manually selecting images, segmenting ear regions, and measuring characteristic parameters is cumbersome and inefficient, making it difficult to meet the needs of large-scale new variety testing. In addition, traditional testing methods have low data digitization levels, with test results mostly being qualitative descriptions, unable to form structured data for traceability and analysis. This hinders the transformation of DUS testing from experience-driven to data-driven, and from manual operation to intelligent detection, making it difficult to meet the needs of precision management and digital development in the seed industry.

[0004] Therefore, establishing an objective, accurate, and efficient method for testing the shape of maize ears, and realizing the transformation of DUS testing from experience-based judgment to digital testing, has important theoretical value and practical significance for the protection of intellectual property rights in the seed industry. Summary of the Invention

[0005] This invention provides a method, apparatus, equipment, and storage medium for quantitative analysis of corn ear shape, aiming to solve at least one of the above-mentioned technical problems.

[0006] To achieve the above objectives, the present invention provides a method for quantitative analysis of maize ear shape, comprising the following steps:

[0007] Acquire several RGB images of the target corn ears, and select valid images with complete outlines, no occlusion, and meeting the resolution requirements as training sample images;

[0008] Each valid image in the training sample images is preprocessed using an image analysis algorithm, and then a semantic segmentation technique is used to extract the pure ear region.

[0009] Geometric division and measurement of the segmented ear region were performed to obtain characteristic width and height parameters;

[0010] Based on the extracted feature width and height parameters, the feature ear edge angle is calculated using trigonometric function operations;

[0011] Using the size parameters composed of feature width and height parameters, and the calculated spikelet edge angle as input features, a machine learning grading model is constructed and trained by combining manual grading labels;

[0012] Upon receiving an image of a corn ear to be graded, the trained model is invoked to analyze the feature parameters of the image and output quantitative grading results.

[0013] Optionally, the step of acquiring several RGB images of the target corn ears and selecting valid images with complete outlines, no occlusion, and meeting resolution requirements as training sample images includes:

[0014] Acquire several RGB images of the target corn ear in RGB image format output by the image acquisition device;

[0015] The edge detection algorithm is used to identify the integrity of the ear outline in each target corn ear RGB image, and images with an occlusion area exceeding a first preset value are removed.

[0016] Unqualified images were removed by analyzing grayscale histograms to eliminate those with shadow ratios exceeding the second preset value and those with overexposed strong light areas exceeding the third preset value.

[0017] The RGB images of corn ears after two rounds of removal were used as valid images to determine the training sample images.

[0018] Optionally, the process involves preprocessing each valid image in the training sample images using an image analysis algorithm, followed by extracting the pure ear region using semantic segmentation technology. This process specifically includes:

[0019] Image noise was removed by Gaussian filtering algorithm, and the contrast between the ears of fruit and the background was enhanced by adaptive histogram equalization algorithm.

[0020] A semantic segmentation algorithm is used to identify and segment the ear region based on pre-trained weights, generating a binarized mask image of the ear.

[0021] Morphological closing operations are performed on the binarized mask image of the ear of fruit to fill in the holes inside the ear of fruit region. Then, the edges are optimized by a contour smoothing algorithm to obtain a pure ear of fruit region image without redundant background.

[0022] Optionally, the steps of geometrically dividing and measuring the segmented ear region to obtain characteristic width and height parameters specifically include:

[0023] The longitudinal central axis of the ear is obtained by the skeleton extraction algorithm. The ear area is then divided into 9 equal parts along the longitudinal direction based on the central axis, generating 9 dividing lines perpendicular to the central axis. The 9 dividing lines are numbered 1 to 9 and are ordered sequentially from the base to the top of the ear.

[0024] Calculate the distances between the intersection points of lines 2, 3, 4, and 8 and the edge of the ear, and use these distances as the characteristic width parameter;

[0025] Calculate the vertical distances from line 2 to line 8, line 3 to line 8, and line 4 to line 8 respectively, and use these distances as the characteristic height parameter;

[0026] All dimensional parameters are stored as structured data in the format {Image ID: W2, W3, W4, W8, L1, L2, L3}; where W2 is the distance between the intersection of line 2 and the edge of the ear, W3 is the distance between the intersection of line 3 and the edge of the ear, W4 is the distance between the intersection of line 4 and the edge of the ear, W8 is the distance between the intersection of line 8 and the edge of the ear, L1 is the vertical distance from line 2 to line 8, L2 is the vertical distance from line 3 to line 8, and L3 is the vertical distance from line 4 to line 8.

[0027] Optionally, based on the extracted feature width and height parameters, the feature ear edge angle is calculated using trigonometric function operations, specifically including:

[0028] The lengths of the right-angled legs corresponding to the three ear-edge angles are calculated using the following expression:

[0029] ;

[0030] ;

[0031] ;

[0032] In the formula, H1, H2, and H3 are the lengths of the opposite sides of angles 1, 2, and 3, respectively;

[0033] The tangent values ​​of the three ear margin angles are calculated using the following expression:

[0034] ;

[0035] ;

[0036] ;

[0037] In the formula, θ1 is angle 1, θ2 is angle 2, and θ3 is angle 3;

[0038] The tangent value is converted to radians and then to degrees using the arctangent function. The expression is as follows:

[0039] ;

[0040] ;

[0041] ;

[0042] In the formula, ATAN is the arctangent function, and DEGREES is the radian-to-angle function.

[0043] Optionally, the steps of constructing and training a machine learning grading model using the size parameters composed of feature width and height parameters and the calculated ear margin angle as input features, combined with manually assigned grading labels, specifically include:

[0044] Import the size parameters W2, W3, W4, W8, L1, L2, L3 and ear edge angles θ1, θ2, θ3 of all effective ear images in the training sample images, and simultaneously import the corresponding manual grading labels; wherein, the manual grading labels are divided into Level 1: conical, Level 2: conical to cylindrical, and Level 3: cylindrical.

[0045] The input features are standardized to eliminate the influence of dimensions, and a feature matrix X=[W2, W3, W4, W8, L1, L2, L3, θ1, θ2, θ3] and a label vector Y=[hierarchical label] are constructed.

[0046] A hierarchical model was constructed using the random forest algorithm, with 500 decision trees. The training and test sets were divided in a 7:3 ratio, and the model hyperparameters were optimized using grid search.

[0047] The model's accuracy, precision, and recall are calculated based on the test set to ensure that the model's test accuracy is ≥95%. If the accuracy is not met, the training sample size is automatically increased or the algorithm parameters are adjusted until the accuracy requirements are met.

[0048] Extract feature thresholds from the trained model and define the classification rules: Level 1 corresponds to θ1≥4° and θ2≥3° or θ2∈[2.8°,3.0°) and θ3≥2.2°; Level 2 corresponds to θ1∈[2°,4°) or θ1≥4° and θ2<2.8° or θ2∈[2.8°,3.0°) and θ3<2.2°; Level 3 corresponds to θ1<2°.

[0049] Optionally, upon receiving an image of a corn ear to be graded, the trained model is invoked to analyze the feature parameters of the image and output quantitative grading results. This process includes:

[0050] Upon receiving the image of the corn ear to be graded, the image is imported. After preprocessing, segmentation, parameter extraction and ear edge angle calculation are completed, the feature matrix to be tested is generated.

[0051] Call the trained grading model, input the feature matrix to be tested into the model, automatically match the grading threshold, and output the ear shape grade and the corresponding judgment criteria including the comparison results of key feature parameters and thresholds.

[0052] Generate an analysis report containing structured information such as image ID, feature parameters, ear edge angle value, grading results, judgment criteria, and analysis time, and export it for integration with the maize DUS test database.

[0053] Furthermore, to achieve the above objectives, the present invention also provides a quantitative analysis device for the shape of corn ears, comprising:

[0054] The acquisition module is used to acquire several RGB images of the target corn ears and filter out valid images with complete outlines, no occlusion, and meeting the resolution requirements as training sample images.

[0055] The preprocessing module is used to preprocess each valid image in the training sample images using image analysis algorithms, and then use semantic segmentation technology to extract the pure ear region;

[0056] The segmentation module is used to geometrically divide and measure the segmented ear regions to obtain feature width and height parameters.

[0057] The calculation module is used to calculate the feature ear edge angle based on the extracted feature width and height parameters through trigonometric function operations;

[0058] The training module is used to construct and train a machine learning grading model by taking the size parameters composed of feature width and height parameters and the calculated ear edge angle as input features, combined with manual grading labels.

[0059] The analysis module is used to call the trained model when it receives an image of corn ears to be graded, analyze the feature parameters of the image, and output quantitative grading results.

[0060] In addition, to achieve the above objectives, the present invention also provides a quantitative analysis device for corn ear shape, the corn ear shape quantitative analysis device comprising: a memory, a processor, and a corn ear shape quantitative analysis program stored in the memory and executable on the processor, wherein the corn ear shape quantitative analysis program, when executed by the processor, implements the steps of the corn ear shape quantitative analysis method as described above.

[0061] In addition, to achieve the above objectives, the present invention also provides a storage medium storing a quantitative analysis program for the shape of corn ears, wherein the quantitative analysis program for the shape of corn ears is executed by a processor to implement the steps of the quantitative analysis method for the shape of corn ears described above.

[0062] The beneficial effects of this invention are as follows: It proposes a method, apparatus, equipment, and storage medium for quantitative analysis of maize ear shape. By acquiring several RGB images of target maize ears, training sample images are selected and pure ear regions are extracted. The segmented ear regions are geometrically divided and measured to obtain feature width and height parameters. The feature ear edge angle is calculated using trigonometric functions. Using the size parameters composed of feature width and height parameters and the calculated ear edge angle as input features, a machine learning grading model is constructed and trained in conjunction with manual grading labels. The trained machine learning classification model is used to analyze the feature parameters of the maize ear images to be graded, outputting quantitative grading results. This establishes an objective, accurate, and efficient method for testing maize ear shape, realizing the transformation of DUS testing from experience-based judgment to digital testing, which has significant theoretical and practical value for the protection of intellectual property rights in the seed industry. Attached Figure Description

[0063] Figure 1 is a schematic diagram of the hardware operating environment device structure involved in the embodiment of the present invention;

[0064] Figure 2 is a flowchart illustrating an embodiment of the quantitative analysis method for maize ear shape according to the present invention.

[0065] Figure 3 is a schematic diagram of the feature width and height parameters;

[0066] Figure 4 is a structural block diagram of an embodiment of the quantitative analysis device for corn ear shape of the present invention. Detailed Implementation

[0067] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0068] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0069] As shown in Figure 1, Figure 1 is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0070] As shown in Figure 1, the device may include: a processor 1001, such as a CPU; a communication bus 1002; a user interface 1003; a network interface 1004; and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0071] Those skilled in the art will understand that the structure of the device shown in FIG1 does not constitute a limitation on the device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0072] As shown in Figure 1, the memory 1005, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a quantitative analysis program for the shape of corn ears.

[0073] In the terminal shown in Figure 1, the network interface 1004 is mainly used to connect to the backend server and communicate data with it; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with it; while the processor 1001 can be used to call the corn ear shape quantitative analysis program stored in the memory 1005 and perform the following operations:

[0074] Acquire several RGB images of the target corn ears, and select valid images with complete outlines, no occlusion, and meeting the resolution requirements as training sample images;

[0075] Each valid image in the training sample images is preprocessed using an image analysis algorithm, and then a semantic segmentation technique is used to extract the pure ear region.

[0076] Geometric division and measurement of the segmented ear region were performed to obtain characteristic width and height parameters;

[0077] Based on the extracted feature width and height parameters, the feature ear edge angle is calculated using trigonometric function operations;

[0078] Using the size parameters composed of feature width and height parameters, and the calculated spikelet edge angle as input features, a machine learning grading model is constructed and trained by combining manual grading labels;

[0079] Upon receiving an image of a corn ear to be graded, the trained model is invoked to analyze the feature parameters of the image and output quantitative grading results.

[0080] The specific embodiments of the present invention applied to the device are basically the same as the embodiments of the quantitative analysis method for the shape of corn ears described below, and will not be repeated here.

[0081] This invention provides a method for quantitative analysis of corn ear shape. Referring to Figure 2, which is a flowchart of an embodiment of the method for quantitative analysis of corn ear shape of this invention.

[0082] In this embodiment, a method for quantitative analysis of corn ear shape includes the following steps:

[0083] S100: Acquire several RGB images of the target corn ears, and select valid images with complete outlines, no occlusion, and meeting the resolution requirements as training sample images.

[0084] S200: Each valid image in the training sample images is preprocessed using an image analysis algorithm, and then a semantic segmentation technique is used to extract the pure ear region;

[0085] S300: Performs geometric division and measurement on the segmented ear region to obtain characteristic width and height parameters;

[0086] S400: Based on the extracted feature width and height parameters, the feature ear edge angle is calculated using trigonometric function operations;

[0087] S500: Using size parameters composed of feature width and height parameters and calculated spikelet edge angle as input features, a machine learning grading model is constructed and trained by combining manual grading labels;

[0088] S600: Upon receiving an image of corn ears to be graded, the trained model is invoked to analyze the feature parameters of the corn ear image and output quantitative grading results.

[0089] It should be noted that currently, the DUS test for corn ear shape is mainly conducted according to the "Guideline for Testing Plant Variety Specificity, Uniformity and Stability (Corn)" (GB / T 19557.24-2018). This test relies heavily on the experience and judgment of professional testers, making it an experience-based test with problems such as low efficiency, strong subjectivity, and insufficient accuracy. Furthermore, the process of manually selecting images, segmenting ear regions, and measuring characteristic parameters is cumbersome and inefficient, making it difficult to meet the needs of large-scale testing of new varieties. In addition, traditional testing methods have low data digitization levels, with test results mostly being qualitative descriptions, unable to form structured data for traceability and analysis. This hinders the transformation of DUS testing from experience-driven to data-driven, and from manual operation to intelligent detection, making it difficult to meet the needs of precision management and digital development in the seed industry.

[0090] To address the aforementioned issues, this embodiment acquires several RGB images of target maize ears, selects training sample images, extracts clean ear regions, and performs geometric division and measurement on the segmented ear regions to obtain feature width and height parameters. The feature ear edge angle is calculated using trigonometric functions. Using the size parameters constituted by the feature width and height parameters, along with the calculated ear edge angle, as input features, a machine learning grading model is constructed and trained in conjunction with manually assigned grading labels. The trained machine learning classification model is then used to analyze the feature parameters of the maize ear images to be graded, outputting quantitative grading results. This establishes an objective, accurate, and efficient method for testing maize ear shape, transforming DUS testing from experience-based judgment to digital testing, which has significant theoretical and practical value for the protection of seed industry intellectual property rights.

[0091] In a preferred embodiment, the step of acquiring several RGB images of the target corn ears and selecting valid images with complete outlines, no occlusion, and meeting resolution requirements as training sample images specifically includes:

[0092] S110: Acquire several RGB images of the target corn ear in RGB image format output by the image acquisition device;

[0093] S120: The edge detection algorithm is used to identify the ear outline integrity of each target corn ear RGB image and remove images whose occlusion area exceeds the first preset value;

[0094] S130: Remove unqualified images by analyzing grayscale histograms, where the proportion of shadows exceeds the second preset value and the proportion of overexposed areas of strong light exceeds the third preset value.

[0095] S140: The RGB images of corn ears after two rounds of removal are used as valid images to determine the training sample images.

[0096] In this embodiment, based on automatic image processing technology, effective image identification is completed autonomously through preset screening rules. Combined with semantic segmentation algorithm, pure ear region is accurately extracted, replacing manual screening and manual segmentation operations. This not only avoids individual errors caused by manual intervention, but also greatly improves the accuracy and consistency of ear region extraction, providing a reliable data foundation for subsequent feature parameter measurement.

[0097] In a preferred embodiment, the steps of preprocessing each valid image in the training sample images using an image analysis algorithm, and then extracting the pure ear region using semantic segmentation technology, specifically include:

[0098] S210: Image noise is removed by Gaussian filtering algorithm, and the contrast between the ears of fruit and the background is enhanced by adaptive histogram equalization algorithm.

[0099] S220: Employs a semantic segmentation algorithm to identify and segment the ear region based on pre-trained weights, generating a binarized mask image of the ear.

[0100] S230: Perform morphological closing operation on the binarized mask image of the ear of fruit to fill in the holes inside the ear of fruit region, and then optimize the edges through a contour smoothing algorithm to obtain a pure ear of fruit region image without redundant background.

[0101] In this embodiment, the computer autonomously performs geometric division, size parameter extraction, and ear edge angle calculation. A standardized algorithm process is used to realize the automated acquisition and calculation of feature data, completely eliminating the tedious operation and subjective bias of manual measurement, ensuring the accuracy and uniformity of feature parameters and ear edge angle values, and significantly improving the credibility and comparability of analysis results.

[0102] As shown in Figure 3, in a preferred embodiment, the steps of geometrically dividing and measuring the segmented ear region to obtain characteristic width and height parameters specifically include:

[0103] S310: Obtain the longitudinal central axis of the ear of fruit through the skeleton extraction algorithm. Using the central axis as a reference, divide the ear of fruit region into 9 equal parts along the longitudinal direction, generating 9 dividing lines perpendicular to the central axis. The 9 dividing lines are numbered 1 to 9 and are ordered sequentially from the base to the top of the ear of fruit.

[0104] S320: Calculate the distances between the intersection points of lines 2, 3, 4, and 8 and the edge of the ear, and use these distances as the characteristic width parameter;

[0105] S330: Calculate the vertical distances from line 2 to line 8, line 3 to line 8, and line 4 to line 8 respectively, and use these distances as the feature height parameter;

[0106] S340: Store all size parameters as structured data in the format {Image ID: W2, W3, W4, W8, L1, L2, L3}; where W2 is the distance between the intersection of line 2 and the edge of the ear, W3 is the distance between the intersection of line 3 and the edge of the ear, W4 is the distance between the intersection of line 4 and the edge of the ear, W8 is the distance between the intersection of line 8 and the edge of the ear, L1 is the vertical distance from line 2 to line 8, L2 is the vertical distance from line 3 to line 8, and L3 is the vertical distance from line 4 to line 8.

[0107] It should be noted that, considering that ear shape is one of the important traits in the DUS (Digital Usage and Weighting) test for maize varieties, current methods mainly rely on visual inspection by professional testers, which is highly subjective. In reality, visual inspection primarily grades the ear based on the angle between the ear's edge and the central axis, but without a specific fixed value. This angle is defined as the ear edge angle. The applicant compared various division methods, including dividing the ear into 5, 7, and 9 equal parts, calculating the ear edge angle to classify the ear shape, and then compared the results with those obtained from professional testers' manual grading. The results showed that the 9-part division method best matched the professional testers' grading results. Therefore, this application, based on the 9-part division method and the application of characteristic width and characteristic height parameters, accurately characterizes the ear edge angle, thereby achieving objective, accurate, and efficient quantitative analysis of maize ear shape.

[0108] Based on this, the feature edge angle is calculated using trigonometric function operations based on the extracted feature width and height parameters, specifically including:

[0109] S410: Calculate the lengths of the right-angled sides corresponding to the three ear-edge angles, using the following expression:

[0110] ;

[0111] ;

[0112] ;

[0113] In the formula, H1, H2, and H3 are the lengths of the opposite sides of angles 1, 2, and 3, respectively;

[0114] S420: Calculate the tangent values ​​of the three ear margin angles, expressed as:

[0115] ;

[0116] ;

[0117] ;

[0118] In the formula, θ1 is angle 1 (i.e., the ear edge angle formed by the 2nd line to the 8th line), θ2 is angle 2 (i.e., the ear edge angle formed by the 3rd line to the 8th line), and θ3 is angle 3 (i.e., the ear edge angle formed by the 4th line to the 8th line).

[0119] S430: Convert the tangent value to radians and then to degrees using the arctangent function. The expression is:

[0120] ;

[0121] ;

[0122] ;

[0123] In the formula, ATAN is the arctangent function, and DEGREES is the radian-to-angle function.

[0124] For example, taking angle 1 as an example, the calculation process for its ear edge angle is as follows:

[0125] (1) Calculate the length (H1) of the side opposite the ear margin angle (right-angled side) (Note: the length of the green arrow in Figure 1):

[0126] H1=(ABS(W8-W2)) / 2

[0127] It should be noted that the length (H1) of the side opposite the edge of the ear (right angle) = the width of the 8th line (W8) minus the width of the 2nd line (W2), then take the absolute value (ABS), and then divide by 2;

[0128] (2) Calculate the tangent value:

[0129] Tangent value = H1 / L1;

[0130] It should be noted that the tangent value is calculated by dividing the length of the opposite side (right-angled side) of the ear margin angle (H1) by the height of the second to eighth lines (L1).

[0131] (3) Calculate the radians:

[0132] Radius = ATAN (tangent);

[0133] (4) Convert radians to degrees:

[0134] Angle 1 = DEGREES (radians).

[0135] In this embodiment, a machine learning grading model is constructed by integrating feature parameters and ear edge angle information. The algorithm learns the core logic of the manual grading standard autonomously to realize the automated grading judgment of ear shape without the need for manual intervention in the judgment process. This reduces the dependence on the experience of professional testers and greatly improves the testing efficiency, effectively adapting to the needs of large-scale and batch DUS testing.

[0136] In a preferred embodiment, the steps of constructing and training a machine learning grading model using the size parameter composed of the feature width and height parameters, and the calculated ear margin angle as input features, combined with manually assigned grading labels, specifically include:

[0137] S510: Import the size parameters W2, W3, W4, W8, L1, L2, L3 and ear edge angles θ1, θ2, θ3 of all effective ear images in the training sample images, and simultaneously import the corresponding manual grading labels; wherein, the manual grading labels are divided into Level 1: conical, Level 2: conical to cylindrical, and Level 3: cylindrical.

[0138] S520: Standardize the input features to eliminate the influence of dimensions, and construct the feature matrix X=[W2, W3, W4, W8, L1, L2, L3, θ1, θ2, θ3], and the label vector Y=[hierarchical label];

[0139] S530: A hierarchical model is constructed using the random forest algorithm, with 500 decision trees. The training and test sets are divided in a 7:3 ratio, and the model hyperparameters are optimized through grid search.

[0140] S540: Calculates model accuracy, precision, and recall based on the test set to ensure that the model test accuracy is ≥95%; if it does not meet the standard, it automatically increases the training sample size or adjusts the algorithm parameters until the accuracy requirements are met.

[0141] S550: Extract feature thresholds from the trained model and define the classification rules: Level 1 corresponds to θ1≥4° and θ2≥3° or θ2∈[2.8°,3.0°) and θ3≥2.2°; Level 2 corresponds to θ1∈[2°,4°) or θ1≥4° and θ2<2.8° or θ2∈[2.8°,3.0°) and θ3<2.2°; Level 3 corresponds to θ1<2°.

[0142] Specifically, in this embodiment of the invention, feature thresholds are extracted from the trained model to determine the classification criteria, which are shown in Table 1.

[0143] Table 1: Quantitative Grading Standards for Corn Ear Shape

[0144] Classification Condition 1 (Angle 1) Condition 2 (Angle 2) Condition 3 (Angle 3) Remarks Level 1: ≥4 degrees ≥3 degrees ≥2.2 degrees Must satisfy Condition 1 and Condition 2; If the degree of Condition 2 is between 2.8 and 3.0, it is necessary to determine if the degree of Condition 3 is greater than 2.2 degrees. If it is greater than 2.2 degrees, it is Level 1. Level 2: ≥2 degrees <2.8 degrees <2.2 degrees If the degree of Condition 1 is between 2 and 4 degrees, it is Level 2; If the degree of Condition 1 is greater than or equal to 4 degrees, it is necessary to determine if the degree of Condition 2 is less than 2.8 degrees. If it is less than 2.8 degrees, it is Level 2. If the degree of Condition 2 is between 2.8 and 3.0 degrees, it is necessary to determine if the degree of Condition 3 is greater than 2.2 degrees. If it is less than 2.2 degrees, it is Level 2. Level 3: <2 degrees -- Must satisfy Condition 1. surface

[0145] As shown in Table 1, the grading in the table is based on the grading standard for maize ear shape in the "Guideline for Testing the Distinctiveness, Uniformity and Stability of Plant Varieties - Maize" (GB / T 19557.24-2018). Grade 1 is conical, Grade 2 is conical to cylindrical, and Grade 3 is cylindrical. The determination process is as follows:

[0146] (1) First, determine the degree range of condition 1 and angle 1:

[0147] If angle 1 is less than 2 degrees, it is level 3; if angle 2 is between 2 and 4 degrees (angle 1 is greater than or equal to 2 degrees and less than 4 degrees), it is level 2; if angle 1 is greater than or equal to 4 degrees, then condition 2 needs to be added to determine the degree range of angle 2.

[0148] (2) Add condition 2 to determine the range of angle 2 in degrees:

[0149] If angle 2 is greater than or equal to 3 degrees, it is level 1; if angle 2 is less than 2.8 degrees, it is level 2; if angle 2 is in the range of 2.8 to 3 degrees (angle 2 is greater than or equal to 2.8 degrees and less than 3 degrees), then condition 3 needs to be added to determine the degree range of angle 3.

[0150] (3) Add condition 3 to determine the range of angle 3 degrees:

[0151] If angle 3 is greater than or equal to 2.2 degrees, it is level 1; if angle 3 is less than 2.2 degrees, it is level 2.

[0152] In this embodiment, the model training process conforms to the grading logic in the national standard and supports incremental training and parameter updates based on new samples. This ensures a high degree of consistency between the grading results and the national standard for DUS testing, while also flexibly adapting to the differences in the shape characteristics of corn ears under different varieties and growing environments, thus enhancing the applicability and long-term stability of the technical solution.

[0153] In a preferred embodiment, upon receiving an image of a corn ear to be graded, the trained model is invoked to analyze the feature parameters of the image and output quantitative grading results. This step specifically includes:

[0154] S610: Upon receiving the image of the corn ear to be graded, import the image of the corn ear to be graded, and after completing preprocessing, segmentation, parameter extraction and ear edge angle calculation, generate the feature matrix to be tested.

[0155] S620: Call the trained grading model, input the feature matrix to be tested into the model, automatically match the grading threshold, and output the ear shape grade and the corresponding judgment criteria including the comparison results of key feature parameters and thresholds.

[0156] S630: Generates an analysis report containing structured information such as image ID, feature parameters, ear edge angle value, grading results, judgment criteria, and analysis time, and exports it for integration with the corn DUS test database.

[0157] In this embodiment, the entire process from image acquisition to grading result output is digitally processed, automatically generating a structured report containing information such as feature parameters, grading criteria, and analysis time. This report can be directly connected to the DUS test database, providing support for the digital archiving, traceability, and sharing of test results. This promotes the transformation of DUS testing from experience-based to digital and intelligent, and helps improve the precision management and intellectual property protection system of the seed industry.

[0158] Therefore, this invention acquires several RGB images of target maize ears, selects training sample images, extracts pure ear regions, geometrically divides and measures the segmented ear regions, obtains feature width and height parameters, calculates feature ear edge angles using trigonometric functions, and uses the size parameters composed of feature width and height parameters and the calculated ear edge angles as input features. A machine learning grading model is constructed and trained using manually assigned grading labels. The trained machine learning classification model is then used to analyze the feature parameters of the maize ear images to be graded, outputting quantitative grading results. This establishes an objective, accurate, and efficient method for testing maize ear shape, realizing the transformation of DUS testing from experience-based judgment to digital testing, which has significant theoretical and practical value for the protection of seed industry intellectual property rights.

[0159] Referring to Figure 4, which is a structural block diagram of an embodiment of the quantitative analysis device for corn ear shape of the present invention.

[0160] As shown in Figure 4, the quantitative analysis device for corn ear shape proposed in this embodiment of the invention includes:

[0161] The acquisition module 10 is used to acquire several RGB images of the target corn ears and filter out valid images with complete outlines, no occlusion, and meeting the resolution requirements as training sample images.

[0162] The preprocessing module 20 is used to preprocess each valid image in the training sample images using image analysis algorithms, and then use semantic segmentation technology to extract the pure ear region;

[0163] The segmentation module 30 is used to perform geometric segmentation and measurement on the segmented ear region to obtain characteristic width and height parameters;

[0164] Calculation module 40 is used to calculate the feature edge angle based on the extracted feature width and height parameters through trigonometric function operations;

[0165] Training module 50 is used to construct and train a machine learning grading model by taking the size parameters composed of feature width and height parameters and the calculated ear edge angle as input features, combined with manual grading labels.

[0166] The analysis module 60 is used to call the trained model when it receives the corn ear image to be graded, analyze the feature parameters of the corn ear image to be graded, and output the quantitative grading result.

[0167] Other embodiments or specific implementations of the quantitative analysis device for corn ear shape of the present invention can be referred to the above-described method embodiments, and will not be repeated here.

[0168] Furthermore, the present invention also proposes a quantitative analysis device for corn ear shape, the corn ear shape quantitative analysis device comprising: a memory, a processor, and a corn ear shape quantitative analysis program stored in the memory and executable on the processor, wherein the corn ear shape quantitative analysis program, when executed by the processor, implements the steps of the corn ear shape quantitative analysis method as described above.

[0169] The specific implementation of the quantitative analysis device for corn ear shape in this application is basically the same as the embodiments of the quantitative analysis method for corn ear shape described above, and will not be repeated here.

[0170] Furthermore, this invention also proposes a readable storage medium, which includes a computer-readable storage medium storing a quantitative analysis program for corn ear shape. The readable storage medium can be the memory 1005 in the terminal of Figure 1, or at least one of ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, and optical disk. The readable storage medium includes several instructions to cause a corn ear shape quantitative analysis device with a processor to execute the corn ear shape quantitative analysis method described in various embodiments of this invention.

[0171] The specific implementation in the readable storage medium of this application is basically the same as the embodiments of the above-described quantitative analysis method for corn ear shape, and will not be repeated here.

[0172] It is understood that in the description of this specification, references to terms such as "one embodiment," "another embodiment," "other embodiments," or "first embodiment to Nth embodiment," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0173] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0174] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0175] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0176] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for quantitative analysis of maize ear shape, characterized in that, Includes the following steps: Acquire several RGB images of the target corn ears, and select valid images with complete outlines, no occlusion, and meeting the resolution requirements as training sample images; Each valid image in the training sample images is preprocessed using an image analysis algorithm, and then a semantic segmentation technique is used to extract the pure ear region. The segmented ear region is geometrically divided and measured to obtain feature width and height parameters. Specifically, this includes: obtaining the longitudinal central axis of the ear using a skeleton extraction algorithm; dividing the ear region longitudinally into nine equal parts based on the central axis, generating nine dividing lines perpendicular to the central axis; these nine dividing lines are numbered 1-9, sequentially from the base to the top of the ear; calculating the distances between the intersections of lines 2, 3, 4, and 8 and the ear edge, and using these distances as feature width parameters; calculating the perpendicular distances from lines 2 to 8, 3 to 8, and 4 to 8, and using these distances as feature height parameters; and then... All dimensional parameters are stored as structured data in the format {Image ID: W2, W3, W4, W8, L1, L2, L3}; where W2 is the distance between the intersection of line 2 and the ear edge, W3 is the distance between the intersection of line 3 and the ear edge, W4 is the distance between the intersection of line 4 and the ear edge, W8 is the distance between the intersection of line 8 and the ear edge, L1 is the perpendicular distance from line 2 to line 8, L2 is the perpendicular distance from line 3 to line 8, and L3 is the perpendicular distance from line 4 to line 8. Based on the extracted feature width and height parameters, the feature ear edge angles are calculated using trigonometric functions; specifically, this includes calculating the lengths of the right-angled sides corresponding to the three ear edge angles, expressed as: ; ; In the formula, H1, H2, and H3 are the lengths of the opposite sides of angles 1, 2, and 3, respectively; the tangent values ​​of the three ear margin angles are calculated using the following expression: ; ; In the formula, θ1 is angle 1, θ2 is angle 2, and θ3 is angle 3; the tangent value is converted to radians and then to angles using the arctangent function, and the expression is: ; ; In the formula, ATAN is the arctangent function and DEGREES is the radian-to-angle function. The size parameters composed of feature width and height parameters and the calculated ear edge angle are used as input features. The machine learning grading model is constructed and trained by combining manual grading labels. When the corn ear image to be graded is received, the trained model is called to analyze the feature parameters of the corn ear image to be graded and output the quantitative grading results.

2. The method for quantitative analysis of maize ear shape as described in claim 1, characterized in that, The steps of acquiring several RGB images of target corn ears and selecting valid images with complete outlines, no occlusion, and meeting resolution requirements as training sample images include: acquiring several RGB images of target corn ears in RGB image format output by an image acquisition device; identifying the ear outline integrity of each target corn ear RGB image using an edge detection algorithm and removing images whose occlusion area ratio exceeds a first preset value; removing unqualified images whose shadow ratio exceeds a second preset value and whose strong light overexposure area ratio exceeds a third preset value through grayscale histogram analysis; and using the corn ear RGB images after two rounds of removal as valid images to determine the training sample images.

3. The method for quantitative analysis of maize ear shape as described in claim 1, characterized in that, The image analysis algorithm is used to preprocess each valid image in the training sample images, and then semantic segmentation technology is used to extract the pure ear region. Specifically, this includes: removing image noise using a Gaussian filtering algorithm and enhancing the contrast between the ear and the background using an adaptive histogram equalization algorithm; using a semantic segmentation algorithm to identify and segment the ear region based on pre-trained weights to generate a binary mask image of the ear; performing morphological closing operations on the binary mask image of the ear to fill in the holes inside the ear region, and then optimizing the edges using a contour smoothing algorithm to obtain a pure ear region image without redundant background.

4. The method for quantitative analysis of maize ear shape as described in claim 1, characterized in that, The steps for constructing and training a machine learning grading model, using size parameters composed of feature width and height parameters and calculated ear margin angles as input features, combined with manually assigned grading labels, specifically include: importing the size parameters W2, W3, W4, W8, L1, L2, L3 and ear margin angles θ1, θ2, θ3 of all effective ear images from the training sample images, and simultaneously importing the corresponding manually assigned grading labels for the images; wherein, the manually assigned grading labels are divided into Level 1: conical, Level 2: conical to cylindrical, and Level 3: cylindrical; standardizing the input features to eliminate the influence of dimensions, constructing a feature matrix X=[W2, W3, W4, W8, L1, L2, L3, θ1, θ2, θ3], and a label vector Y=[grading label]; and using a random forest algorithm to construct the grading model, setting the number of decision trees. The training and test sets consist of 500 trees, divided in a 7:3 ratio. Model hyperparameters are optimized using grid search. Accuracy, precision, and recall are calculated based on the test set to ensure a test accuracy ≥ 95%. If this is not achieved, the training sample size is automatically increased or algorithm parameters are adjusted until the accuracy requirement is met. Feature thresholds are extracted from the trained model, and grading rules are defined: Level 1 corresponds to two cases: θ1 ≥ 4° and θ2 ≥ 3°, or θ1 ≥ 4° and θ2 ∈ [2.8°, 3.0°) and θ3 ≥ 2.2°; Level 2 corresponds to three cases: θ1 ∈ [2°, 4°), or θ1 ≥ 4° and θ2 < 2.8°, or θ1 ≥ 4° and θ2 ∈ [2.8°, 3.0°) and θ3 < 2.2°; Level 3 corresponds to one case: θ1 < 2°.

5. The method for quantitative analysis of maize ear shape as described in claim 4, characterized in that, Upon receiving an image of a corn ear to be graded, the trained model is invoked to analyze the feature parameters of the image and output quantitative grading results. Specifically, this process includes: importing the image, performing preprocessing, segmentation, parameter extraction, and ear edge angle calculation to generate a test feature matrix; invoking the trained grading model, inputting the test feature matrix into the model, automatically matching the grading threshold, and outputting the ear shape grade and corresponding judgment criteria including the comparison results of key feature parameters and the threshold; generating an analysis report containing structured information such as image ID, feature parameters, ear edge angle values, grading results, judgment criteria, and analysis time, and exporting it for integration with the corn DUS test database.

6. A quantitative analysis device for corn ear shape, characterized in that, include: The acquisition module is used to acquire several RGB images of the target corn ears and filter out valid images with complete outlines, no occlusion, and meeting the resolution requirements as training sample images. The preprocessing module is used to preprocess each valid image in the training sample images using image analysis algorithms, and then use semantic segmentation technology to extract the pure ear region; The segmentation module is used to geometrically divide and measure the segmented ear region to obtain feature width and height parameters. Specifically, it includes: obtaining the longitudinal central axis of the ear using a skeleton extraction algorithm; dividing the ear region longitudinally into nine equal parts based on the central axis, generating nine dividing lines perpendicular to the central axis; these nine dividing lines are numbered 1-9, ordered sequentially from the base to the top of the ear; calculating the distances between the intersection points of lines 2, 3, 4, and 8 and the ear edge, and using these distances as feature width parameters; calculating the perpendicular distances from lines 2 to 8, 3 to 8, and 4 to 8, and using these distances as feature height parameters; and then... All size parameters are stored as structured data in the format {Image ID: W2, W3, W4, W8, L1, L2, L3}; where W2 is the distance between the intersection of line 2 and the ear edge, W3 is the distance between the intersection of line 3 and the ear edge, W4 is the distance between the intersection of line 4 and the ear edge, W8 is the distance between the intersection of line 8 and the ear edge, L1 is the perpendicular distance from line 2 to line 8, L2 is the perpendicular distance from line 3 to line 8, and L3 is the perpendicular distance from line 4 to line 8. The calculation module is used to calculate the feature ear edge angles based on the extracted feature width and height parameters using trigonometric functions; specifically, it includes calculating the lengths of the right-angled sides corresponding to the three ear edge angles, expressed as: ; ; In the formula, H1, H2, and H3 are the lengths of the opposite sides of angles 1, 2, and 3, respectively; the tangent values ​​of the three ear margin angles are calculated using the following expression: ; ; In the formula, θ1 is angle 1, θ2 is angle 2, and θ3 is angle 3; the tangent value is converted to radians and then to angles using the arctangent function, and the expression is: ; ; In the formula, ATAN is the arctangent function, and DEGREES is the radian-to-angle function; the training module is used to construct and train a machine learning grading model by taking the size parameters composed of feature width and height parameters and the calculated ear edge angle as input features, combined with manual grading labels; the analysis module is used to call the trained model when receiving the corn ear image to be graded, to analyze the feature parameters of the corn ear image to be graded, and output quantitative grading results.

7. A quantitative analysis device for corn ear shape, characterized in that, The corn ear shape quantitative analysis device includes: a memory, a processor, and a corn ear shape quantitative analysis program stored in the memory and capable of running on the processor. When the corn ear shape quantitative analysis program is executed by the processor, it implements the steps of the corn ear shape quantitative analysis method as described in any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium stores a quantitative analysis program for the shape of corn ears, which, when executed by a processor, implements the steps of the quantitative analysis method for the shape of corn ears as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image analysis method and device applied to outer surface of corn ear, computer equipment and storage medium

    CN117197479A

  • Corn ear DUS character discrimination method, apparatus and device, and storage medium

    CN119068068A