A corn seedling stage heat stress identification method and system based on interactive calibration

By combining interactive calibration and multidimensional feature recognition methods with a random forest classifier, the problems of subjectivity and high misjudgment rate in the identification of heat stress during the maize seedling stage were solved, and accurate and convenient heat stress identification and physical quantification were achieved.

CN122289933APending Publication Date: 2026-06-26SUN YAT SEN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUN YAT SEN UNIV
Filing Date
2026-04-11
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies for identifying heat stress in maize seedlings suffer from problems such as high subjectivity, low efficiency, inconsistent judgment criteria, susceptibility to background interference, high misjudgment rate, lack of physical dimensions, and complex interactions.

Method used

An interactive calibration-based method is adopted, which generates a binary mask through the HSV color space, extracts leaf features by combining morphological operations, and uses a random forest classifier to combine multidimensional features (curl, scorch ratio, yellowing index, aspect ratio, gradient direction dispersion, and excess green index) for identification. It also supports scale calibration to output physical length.

Benefits of technology

It enables accurate determination of heat stress in maize seedlings, reduces the misjudgment rate of normal plants, supports physical quantification, is easy to operate, is suitable for ordinary users, and reduces hardware requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289933A_ABST
    Figure CN122289933A_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for identifying heat stress in maize seedlings based on interactive calibration. It includes: preprocessing an image to generate a binary mask and obtain a leaf mask; calibrating the image scale according to user selection, calculating the number of pixels per centimeter to establish a mapping relationship between pixels and physical space; receiving the entire seedling area selected by the user on the image, sorting the outlines within the selected area by area, and selecting large and small leaves; extracting multidimensional features from the large and small leaves respectively, inputting the extracted features into a random forest classifier to obtain the probability that the leaf belongs to heat stress, comparing the probability with a preset threshold to determine whether the leaf is in a heat stress state or a normal state; determining the heat stress state of the entire maize seedling based on the determination results of the large and small leaves, and calculating the confidence level of the determination results; displaying the determination results and confidence levels, and displaying a scale bar on the image. This invention can improve the accuracy of heat stress determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for identifying heat stress in maize seedlings based on interactive calibration, belonging to the field of agricultural technology. Background Technology

[0002] Currently, the identification of heat stress in maize seedlings mainly relies on manual visual judgment, which has significant shortcomings such as strong subjectivity, low efficiency, and inconsistent judgment standards. Some existing studies have attempted to introduce machine vision methods to identify heat stress by extracting color or texture features from leaves; however, these methods also have significant limitations in practical applications. For example, general image segmentation algorithms are easily affected by background interference, and non-target areas such as soil and weeds are often misidentified as leaves, leading to distortion of the extracted features. Simultaneously, existing methods are sensitive to leaf curling, but minor deformations of normally unfolded leaves caused by changes in light intensity or shooting angle are easily misidentified as signs of heat stress, resulting in a high misclassification rate for healthy plants. Furthermore, most current solutions only focus on image classification, lacking support from physical dimensions and failing to provide key growth indicators such as actual leaf length, making it difficult to meet the quantitative monitoring needs of precision agriculture. Additionally, the widely used deep learning models often require massive amounts of labeled data and high-performance computing hardware, with complex interaction processes, making them difficult for ordinary users to deploy conveniently in actual production. Summary of the Invention

[0003] This invention provides a method and system for identifying heat stress in maize seedlings based on interactive calibration, aiming to solve at least one of the technical problems existing in the prior art.

[0004] The technical solution of this invention relates to a method for identifying heat stress in maize seedlings based on interactive calibration. The method according to this invention includes the following steps:

[0005] S100. Preprocess the corn seedling image taken by the user, generate a binary mask using the green threshold range of the HSV color space, and perform morphological closing and opening operations in sequence to obtain the leaf mask.

[0006] S200: According to the user's selection, the image scale is calibrated, the pixel distance between the two ends of the reference object calibrated by the user and the actual length input by the user are recorded, and the number of pixels per centimeter is calculated to establish the mapping relationship between pixels and physical space.

[0007] S300: Receive the entire seedling area selected by the user on the image, sort the outlines within the selected area by area, select the outline with the largest area as the large leaf, and select the outline with the smallest area as the small leaf.

[0008] S400: Extract multidimensional features from large and small leaves respectively;

[0009] S500. Input the extracted multidimensional features into a random forest classifier to obtain the probability that the leaves belong to heat stress. Compare the probability with a preset threshold to determine whether the leaves are in a heat stress state or a normal state. Determine the heat stress state of the whole corn seedling based on the determination results of large leaves and small leaves, and calculate the confidence level of the determination results.

[0010] S600 displays the judgment result and confidence level, and displays the scale on the image based on the scale calibration result.

[0011] Furthermore, in step S400,

[0012] The multidimensional features include curl degree for characterizing the degree of leaf curling, scorch ratio for characterizing the degree of leaf margin scorch, yellowing index for characterizing the degree of leaf yellowing, gradient direction dispersion for characterizing the degree of leaf texture disorder, aspect ratio for characterizing leaf shape, and excess green index for characterizing the degree of leaf greenness.

[0013] Furthermore, in step S100,

[0014] In the image preprocessing step, the original image is converted from the BGR color space to the HSV color space. The green threshold range is between 35 and 85 for hue, between 40 and 255 for saturation, and between 40 and 255 for brightness.

[0015] Furthermore, step S100 includes the following steps:

[0016] S110. Obtain the input original image I, wherein the original image is represented in BGR color space;

[0017] S120. Convert the original image I to the HSV color space to obtain I. hsv ; For HSV color space I hsv Each pixel is thresholded to generate a binary mask M, which is represented as follows:

[0018] The threshold ranges in the formula are set as follows:

[0019] Hue minimum value H min = 35, maximum hue H max = 85;

[0020] Minimum saturation S min = 40, maximum saturation S max = 255;

[0021] Minimum brightness value V min = 40, maximum brightness V max = 255;

[0022] Pixels that meet the set threshold range are set as foreground pixels, and those that do not are set as background pixels, in order to generate a binary mask.

[0023] S130. Perform morphological closing and opening operations sequentially on the binary mask M obtained in S120 to obtain the final blade mask M. leaf .

[0024] Furthermore, in step S200,

[0025] Users can choose whether to use a scale for physical quantification based on their actual needs; when users choose to use a scale, the scale calibration operation is initiated; when users choose not to use a scale, the scale calibration operation is skipped, and the user proceeds directly to the subsequent processing stage.

[0026] Furthermore, in step S200, when the user selects to use a scale, the scale calibration operation includes the following steps:

[0027] S210. Obtain the input original image I; obtain the positions of the two ends of the reference object clicked by the user on the original image, and obtain the actual length input by the user;

[0028] S220. Scale the original image to the display size and record the scaling ratio; where the scaling ratio k disp It equals the display width divided by the original image width;

[0029] S230. Obtain the two endpoints of the reference object clicked by the user on the displayed image, determine the coordinates of the two endpoints on the original image, and record them as (x1, y1) and (x2, y2) respectively.

[0030] Calculate the pixel distance d on the original image based on the coordinates of the two endpoints. px The calculation is as follows:

[0031]

[0032] Let L be the actual length entered by the user. real ;

[0033] The number of pixels per centimeter ρ is calculated as follows:

[0034] ;

[0035] Output the calculated number of pixels per centimeter ρ, and use it for subsequent scale drawing;

[0036] S240. Scale the original image I to the display size to obtain the display image I. disp and scaling factor k disp ;

[0037] S250. If the number of pixels per centimeter ρ exists, the output image will be displayed in image I. disp To draw a scale bar in the lower right corner, follow these steps:

[0038] S251. Calculate the length L of the line segment representing the scale. px It is represented as: Wherein, the length L of the line segment px The unit is pixels;

[0039] S252. Then draw a black horizontal line segment with a line width of one pixel, and add a vertical line at each end of the line segment as a closure.

[0040] S253. Draw text above the black horizontal line segment, where the content of the drawn text can be "Lreal cm", for example, when Lreal is 5, the content of the drawn text is "5 cm".

[0041] Furthermore, in step S300,

[0042] Contour detection is performed on all connected components within the selected area, and the contours are sorted in descending order of area, while noise contours with an area smaller than a preset threshold are automatically excluded.

[0043] Furthermore, in step S400,

[0044] For the curling degree, the degree of leaf curling is quantified by calculating the ratio of the actual area of ​​the leaf to its convex hull area; for the leaf edge scorch ratio, the severity of leaf edge scorch is reflected by calculating the proportion of the bright area in the leaf edge region; for the yellowing index, the yellowing degree of the leaf is reflected by calculating the mean value of the b channel of the leaf region in the Lab color space; for the gradient direction dispersion, the degree of disorder of the leaf texture is reflected by calculating the variance of the gradient direction distribution in the leaf region; for the leaf aspect ratio, the shape characteristics of the leaf are reflected by calculating the ratio of the long side to the short side of the minimum bounding rectangle of the leaf; for the excess green index, the greening degree of the leaf is reflected by calculating the mean of twice the green channel value minus the red channel value minus the blue channel value.

[0045] Furthermore, step S500 includes the following steps:

[0046] S510. Construct the feature vector f of the leaf to be identified, and obtain the judgment threshold denoted as T; wherein the feature vector is composed of multiple feature values ​​arranged in a fixed order;

[0047] S520. Input the feature vector f of the leaf to be identified into the pre-trained random forest classifier F. The random forest classifier F outputs the probability p that the leaf belongs to thermal stress, which is calculated as follows:

[0048] p = F(f);

[0049] S530. The determination of a single blade is expressed as follows:

[0050] ;

[0051] It compares the heat stress probability p output by the random forest classifier with the user-defined judgment threshold T. If p is greater than T, the leaf is judged to be in a heat stress state HT; if p is not greater than T, the leaf is judged to be in a normal state CK.

[0052] Furthermore, in step S500,

[0053] The calculation process of the confidence level of the judgment result includes the following steps: if the judgment result of the whole plant is a heat stress state, then the larger value of the heat stress probability of the large leaf and the small leaf is taken as the confidence level; if the judgment result of the whole plant is a normal state, then the difference between the heat stress probability of the two leaves and 1 is calculated first, and then the smaller value of the two differences is taken as the confidence level.

[0054] The present invention also relates to a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-described method.

[0055] The present invention also relates to a maize seedling heat stress identification system based on interactive calibration, the system including a computer device that includes the aforementioned computer-readable storage medium.

[0056] The beneficial effects of this invention are as follows:

[0057] This invention discloses a method and system for identifying heat stress in maize seedlings based on interactive calibration. It integrates leaf morphology and color features, combines physical quantification with scale, and adopts a human-computer collaborative bounding box selection method. Through multi-dimensional features such as curling degree, leaf margin scorch ratio, yellowing index, aspect ratio, gradient direction consistency, and excessive green index, it uses a random forest classifier to accurately determine heat stress, reducing the misclassification rate of normal plants. At the same time, it supports scale calibration to output physical length, and users only need to make simple bounding box selections to obtain results. Attached Figure Description

[0058] Figure 1 This is a basic flowchart of the identification method according to an embodiment of the present invention. Detailed Implementation

[0059] The following will provide a clear and complete description of the concept, specific structure, and technical effects of the present invention in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, solution, and effects of the present invention.

[0060] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it can be directly fixed or connected to the other feature, or indirectly fixed or connected to the other feature. The singular forms "a," "described," and "the" used herein are also intended to include the plural forms, unless the context clearly indicates otherwise. Furthermore, unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and not for limiting the invention. The term "and / or" as used herein includes any combination of one or more of the associated listed items.

[0061] It should be understood that although the terms first, second, third, etc., may be used to describe various elements in this disclosure, these elements should not be limited to these terms. These terms are used only to distinguish elements of the same type from one another. For example, a first element may also be referred to as a second element without departing from the scope of this disclosure, and similarly, a second element may also be referred to as a first element. Any and all instances or exemplary language (“e.g.,” “such as,” etc.) provided herein are intended only to better illustrate embodiments of the invention and, unless otherwise required, do not impose a limitation on the scope of the invention.

[0062] Reference Figure 1 In some embodiments, according to the calculation scheme of the present invention, a method for identifying heat stress in maize seedlings based on interactive calibration includes at least the following steps:

[0063] S100. Preprocess the corn seedling image taken by the user, generate a binary mask using the green threshold range of the HSV color space, and perform morphological closing and opening operations in sequence to obtain the leaf mask.

[0064] S200: According to the user's selection, the image scale is calibrated, the pixel distance between the two ends of the reference object calibrated by the user and the actual length input by the user are recorded, and the number of pixels per centimeter is calculated to establish the mapping relationship between pixels and physical space.

[0065] S300: Receive the entire seedling area selected by the user on the image, sort the outlines within the selected area by area, select the outline with the largest area as the large leaf, and select the outline with the smallest area as the small leaf.

[0066] S400. Extract multidimensional features from large and small leaves respectively. Further, the multidimensional features include curl degree to characterize the degree of leaf curling, scorch ratio to characterize the degree of leaf margin scorch, yellowing index to characterize the degree of leaf yellowing, gradient direction dispersion to characterize the degree of leaf texture disorder, aspect ratio to characterize leaf shape, and excess green index to characterize the degree of leaf greenness.

[0067] S500: Input the extracted multidimensional features into a random forest classifier to obtain the probability that the leaves belong to heat stress. Compare the probability with a preset threshold to determine whether the leaves are in a heat stress state or a normal state. Determine the heat stress state of the whole corn seedling based on the determination results of large and small leaves, and calculate the confidence level of the determination results.

[0068] S600 displays the judgment result and confidence level, and displays the scale on the image based on the scale calibration result.

[0069] This invention provides a method and system for identifying heat stress in maize seedlings based on interactive calibration. It is an identification method that integrates leaf morphology and color features, combines physical quantification with a scale, and employs human-computer collaborative bounding box selection. By utilizing multi-dimensional features such as leaf curl, leaf margin scorch percentage, yellowing index, aspect ratio, gradient direction consistency, and excessive green index, a random forest classifier is used to accurately determine heat stress, reducing the misclassification rate of normal plants. Simultaneously, it supports scale calibration and output of physical length, allowing users to obtain results simply by selecting a bounding box.

[0070] In some embodiments of this invention, when performing image preprocessing and leaf extraction operations, the invention first loads a user-captured image of a corn seedling into the system. Specifically, to separate the corn leaves from the complex background, this invention utilizes the characteristic of highly concentrated green areas in the HSV color space of corn leaves, setting a green range, for example, setting the hue (H) between 35 and 85, the saturation (S) between 40 and 255, and the brightness (V) between 40 and 255, and then binarizing the image according to the set green range to generate an initial binary mask. Then, this invention further employs morphological closing operations to fill the tiny holes inside the leaf area and uses morphological opening operations to remove isolated noise points, thereby obtaining a highly accurate leaf area. The image preprocessing and leaf extraction operations of this invention can effectively eliminate interference from non-leaf backgrounds such as soil and white paper, significantly improving the accuracy of leaf segmentation.

[0071] In some specific embodiments of the present invention, the green mask generation of the present invention includes the following steps:

[0072] S110. Obtain the input original image I, wherein the original image is represented in BGR color space;

[0073] S120. Convert the original image I to the HSV color space to obtain I. hsv ; For HSV color space I hsv Each pixel is thresholded to generate a binary mask M, which is represented as follows:

[0074] The threshold ranges in the formula are set as follows:

[0075] Hue minimum value H min = 35, maximum hue H max = 85;

[0076] Minimum saturation S min = 40, maximum saturation S max = 255;

[0077] Minimum brightness value V min = 40, maximum brightness V max = 255;

[0078] Pixels that meet the set threshold range are set as foreground pixels, and those that do not are set as background pixels, in order to generate a binary mask.

[0079] S130. Morphological closing and opening operations are sequentially performed on the binary mask M obtained in step S120. Specifically, the small holes that may exist inside the blade are filled through the dilation followed by erosion operation of the closing operation. After completing the closing operation, the system performs a morphological opening operation on the processed binary mask M. Through the erosion followed by dilation operation of the opening operation, isolated background noise points are removed, thereby obtaining a final blade mask with high accuracy, denoted as M. leaf The final obtained blade mask M leaf This serves as input data for all subsequent feature extraction steps.

[0080] In some embodiments of the present invention, after image loading is completed, scale calibration and physical quantization operations are performed, so that the output image contains clear physical size information. Specifically, the user can choose whether to use a scale for physical quantization according to actual needs. When the user chooses to use a scale, the system prompts the user to calibrate a reference object on the image. Further, the reference object can be an object of known length, such as a ruler of known length. The user clicks on the two endpoints of the reference object in sequence, and the system automatically records the pixel distance between these two points in the original image. Subsequently, the user inputs the actual length corresponding to these two endpoints, where the unit of the actual length can be centimeters. The system calculates and stores the number of pixels corresponding to each centimeter based on the received actual length and the recorded pixel distance, thereby establishing a mapping relationship between image pixel coordinates and physical space. Further, when the final output image is displayed, the system automatically draws a scale legend in the lower right corner of the image, so that the recognition result image itself contains clear physical size information, which is convenient for agricultural researchers to perform quantitative analysis and phenotypic parameter measurement. If the user chooses not to use a scale, the system skips this calibration step and directly proceeds to the subsequent processing stage.

[0081] In some specific embodiments of the present invention, the scale calibration process involves the conversion between pixels and physical length, and its operation flow includes:

[0082] S210. Obtain the original input image I;

[0083] Get the positions of the two ends of the reference object that the user clicked on the original image, and get the actual length input by the user;

[0084] S220. Scale the original image to the display size and record the scaling ratio; where the scaling ratio k disp It equals the display width divided by the original image width;

[0085] S230. Obtain the two endpoints of the reference object clicked by the user on the displayed image, determine the coordinates of the two endpoints on the original image, and record them as (x1, y1) and (x2, y2) respectively.

[0086] Calculate the pixel distance d on the original image based on the coordinates of the two endpoints. px The calculation is as follows:

[0087]

[0088] Let L be the actual length entered by the user. real ;

[0089] The number of pixels per centimeter ρ is calculated as follows:

[0090] ;

[0091] Output the calculated number of pixels per centimeter ρ, and use it for subsequent scale drawing;

[0092] S240. Scale the original image I to the display size to obtain the display image I. disp and scaling factor k disp ;

[0093] S250. If the number of pixels per centimeter ρ exists, the output image will be displayed in image I. disp To draw a scale bar in the lower right corner, follow these steps:

[0094] S251. Calculate the length L of the line segment representing the scale. px It is represented as: Wherein, the length L of the line segment px The unit is pixels;

[0095] S252. Then draw a black horizontal line segment with a line width of one pixel, and add a vertical line at each end of the line segment as a closure.

[0096] S253. Draw text above the black horizontal line segment, where the content of the drawn text can be "Lreal cm", for example, when Lreal is 5, the content of the drawn text is "5 cm".

[0097] In some specific embodiments of the present invention, after completing the scale calibration (if the user chooses to use it), the present invention performs an automatic leaf extraction operation. Specifically, the user can select the entire seedling area on the image through an interactive interface. After receiving the selected seedling area, the system automatically performs contour detection and filtering on all connected components within the seedling area. Specifically, the system sorts the detected contours in descending order of their enclosed areas, selecting the contour with the largest area as the "large leaf" and the contour with the smallest area as the "small leaf." During the filtering process, it automatically excludes noise contours with excessively small areas, such as isolated pixels or tiny patches caused by image noise.

[0098] It should be noted that, in terms of the leaf selection strategy, the specific embodiment of the present invention sets that when only a single leaf outline is detected in the selected area, the leaf is treated as both a large leaf and a small leaf, that is, the large leaf and the small leaf are the same object, ensuring that the system can still complete the complete feature extraction and judgment process in the case of a single leaf.

[0099] This invention utilizes a dual-leaf comprehensive judgment mechanism that combines large and small leaves. The system can simultaneously obtain information from the two most representative and sensitive leaves in a single seedling, effectively avoiding misjudgment of a single feature due to accidental mechanical damage, insect bites, or local maldevelopment of a single leaf, and effectively improving the robustness and accuracy of heat stress identification.

[0100] In some embodiments of the present invention, after the automatic extraction of the leaf region is completed, the present invention performs multi-dimensional feature extraction on each leaf. Specifically, in view of the morphological changes unique to leaves under heat stress, the present invention uses six-dimensional features, which respectively characterize the phenotypic features of heat stress from different aspects, such as leaf curling degree, leaf margin scorch ratio, yellowing index, gradient direction dispersion, leaf length-to-width ratio, and excessive green index.

[0101] In some specific embodiments of the present invention, curl is used to quantify the degree of blade curl. It is quantified by calculating the ratio of the actual area of ​​the blade to its convex hull area; the smaller the ratio, the more pronounced the blade curl. Specifically, firstly, based on the input blade mask M... leaf Extract the actual area A enclosed by the leaf mask. leaf And extract the convex hull area A of the leaf mask. hull Then calculate the curl C. curl It is represented as follows:

[0102] ;

[0103] After the calculation is completed, the obtained curvature is used as the first feature input to the random forest classifier.

[0104] It should be noted that, for the curling feature, this specific embodiment of the invention uses the ratio of the actual leaf area to its convex hull area as the original metric, and introduces normalization processing to convert it into a curling score with clear physical meaning. For example, based on statistical analysis of normal corn leaf images, the ratio of the area of ​​a normally unfolded leaf to the convex hull area is usually not less than 0.85. This value comes from the measurement statistics of a large number of normal leaf samples, with a mean of approximately 0.88 and a standard deviation of 0.04. Therefore, selecting 0.85 as the lower limit threshold can cover the variation range of most normal leaves. Furthermore, when the leaf is under heat stress, longitudinal curling leads to a significant reduction in the actual area, and this ratio may drop to between 0.5 and 0.7. To convert this metric into a scoring form that is easy for the classifier to process, this embodiment uses the following normalization formula: subtract the ratio of the original curling degree to 0.85 from 1, and truncate the upper limit of the result. When the initial curl (Curl) is greater than or equal to 0.85, the score is zero; that is, when Curl ≥ 0.85, Curl / 0.85 ≥ 1, CurlScore = 0, indicating that the leaves are fully extended and normal. When the initial curl (Curl) is 0.5, the score is approximately 0.41; that is, when Curl = 0.5, CurlScore = 1 - 0.5 / 0.85 ≈ 0.41, indicating significant curling. It is understandable that the above baseline value of 0.85 can be fine-tuned according to the leaf morphology characteristics of specific maize varieties to accommodate phenotypic differences in materials with different genetic backgrounds.

[0105] In some specific embodiments of the present invention, the leaf edge scorch ratio is used to quantify the degree of scorch at the leaf edge. It reflects the severity of leaf edge scorch by calculating the proportion of bright areas in the leaf edge region. Specifically, firstly, the input leaf mask M is obtained. leaf The original image's grayscale image is used to detect bright, scorched areas, and then morphological operations are used to obtain the leaf edge region N. edge The operation involves dilating the leaf mask, then subtracting the original mask from the dilated mask, and the number of pixels in the resulting region is denoted as N. edge This area is the blade edge region. Then, the number of pixels in the blade edge region with a grayscale value greater than or equal to 200 is further counted and denoted as N. edge∩burn The proportion of leaf margins scorched B bum The calculation is as follows:

[0106] ;

[0107] After the calculation is completed, the obtained leaf edge scorch ratio is used as the second feature input into the random forest classifier.

[0108] It should be noted that, for quantifying the leaf margin scorch ratio, the specific embodiment of this invention also employs a normalization strategy to enhance the model's ability to perceive mild scorch symptoms. The original scorch ratio is defined as the ratio of the number of bright pixels in the leaf edge region to the total number of pixels in the edge region, with a value ranging from 0 to 1. The scorch ratio of normal healthy leaves is usually below 0.02, while this ratio of heat-stressed leaves can reach 0.1 to 0.3. To amplify the differences in the low-value range and enable mild scorch to be effectively identified, this embodiment multiplies the original scorch ratio by a coefficient of 5 and then truncates it at the upper limit to obtain the scorch score. When the original ratio is 0.02, the score is 0.10, that is, when Burn = 0.02, BurnScore = 0.10; when the original ratio reaches 0.20, the score saturates to 1.0, and when Burn = 0.20, BurnScore = 1.0. The coefficient 5 was determined based on empirical optimization, ensuring that the scores of normal leaves are concentrated in the range of 0 to 0.1, while the scores of heat-stressed leaves rise rapidly to above 0.5, thus effectively distinguishing between the two types of samples. This coefficient can be further optimized and adjusted by analyzing the distribution characteristics of the scorched proportion of normal and heat-stressed samples in the training data.

[0109] In some specific embodiments of the present invention, the yellowing index is used to quantify the degree of yellowing of leaves. It reflects the degree of yellowing of leaves by calculating the mean value of the b channel of the leaf region in the Lab color space. The higher the mean value of the b channel, the more obvious the yellowing of the leaves. Specifically, the input leaf mask M is first obtained. leaf The image is converted from the original image to the Lab color space, and then the mean value of the b channel in the Lab color space within the leaf region is extracted. This mean value is denoted as... The yellowing index Y is calculated as follows:

[0110] Y = max(0,min(1,( -50) / 100))

[0111] After the calculation is completed, the obtained yellowing index is used as the third feature input into the random forest classifier.

[0112] It should be noted that the yellowing index is calculated in the Lab color space in this specific embodiment of the invention. The value 50 represents the mean baseline for normal green leaves in the b-channel, derived from statistical measurements of healthy leaf samples; actual observed values ​​are typically between 50 and 60. The value 100 represents the normalized denominator of the dynamic range of the b-channel. Considering that the b-value of heat-stressed leaves can reach over 150, selecting 100 as the denominator ensures that the calculated yellowing index remains stably within the 0-1 range, guaranteeing sensitivity to mild yellowing while avoiding excessive influence from extreme values.

[0113] In some specific embodiments of the present invention, gradient direction dispersion is used to quantify the degree of disorder in the leaf texture. It reflects the degree of disorder in the leaf texture by calculating the variance of the gradient direction distribution within the leaf region, where a larger variance indicates a more disordered leaf texture. Specifically, the input leaf mask M is first obtained. leaf The original image's grayscale value is used, and the Sobel operator is employed to calculate the gradients of the original image's grayscale value in the horizontal and vertical directions, denoted as G, respectively. x and G y Then, for each pixel within the leaf region, according to G... x and G y The gradient direction angle θ is calculated using the following formula:

[0114] ;

[0115] Then, the θ values ​​of all pixels within the leaf region are divided into 36 consecutive intervals, and a normalized gradient direction histogram, denoted as hist(θ), is constructed. The variance of the gradient direction histogram, denoted as Var, is calculated. Its gradient direction dispersion G var The calculation is as follows:

[0116]

[0117] After the calculation is completed, the obtained gradient direction dispersion is used as the fourth feature input to the random forest classifier.

[0118] It should be noted that in calculating the gradient direction dispersion, this specific embodiment of the invention uses information entropy rather than variance to characterize the disorder of the leaf texture. Specifically, the gradient direction angle of each pixel within the leaf region is statistically analyzed, and the directional range from 0 to 180 degrees is divided into 36 equally spaced intervals. The frequency of pixels appearing in each interval is calculated, and the entropy value is calculated accordingly. A larger entropy value indicates a more dispersed gradient direction distribution, corresponding to texture disorder caused by thermal stress; a smaller entropy value indicates a more concentrated direction, corresponding to the regular texture of a normal leaf. The calculation is as follows:

[0119]

[0120] In the formula For the first The pixel frequency in each directional interval. Furthermore, to facilitate use by the classifier, the entropy value is finally normalized by dividing the logarithm of the theoretical maximum value, i.e., 36, so that the result is mapped to the interval between 0 and 1.

[0121] In some specific embodiments of the present invention, the blade aspect ratio is used to reflect the morphological change of the blade tending towards a shorter and wider shape under thermal stress. It is calculated by the ratio of the long side to the short side of the blade's minimum bounding rectangle to reflect the blade's shape characteristics. Under thermal stress, the blade tends towards a shorter and wider shape, and this ratio will decrease accordingly. Specifically, the input blade mask M is first obtained. leaf The minimum bounding rectangle of the blade is calculated to obtain its width and height, denoted as w and h respectively, both in pixels. Its aspect ratio R... asp The calculation is as follows:

[0122]

[0123] After the calculation is completed, the obtained leaf aspect ratio is used as the fifth feature and input into the random forest classifier.

[0124] In some specific embodiments of the present invention, the excess green index is used to quantify the greenness of the leaves. It reflects the greenness of the leaves by calculating the average of twice the green channel value minus the red channel value and then minus the blue channel value; the higher the index, the greener the leaves. Specifically, the input leaf mask M is first obtained. leaf The image contains the R, G, and B channels of the original image. The total number of pixels within the leaf region is then counted and denoted as N. leaf For each pixel within the leaf area, obtain its red channel value R. xy Green channel value G xy and blue channel value B xy The excess green E index is calculated as follows:

[0125]

[0126] After the calculation is completed, the system uses the obtained excess green index as the sixth feature to input the random forest classifier.

[0127] This invention uses the above six features to characterize the phenotypic features of thermal stress from different perspectives.

[0128] In some embodiments of the present invention, after completing the feature extraction of the above six dimensions, the present invention performs a random forest classification operation, which extracts features of the six dimensions from pre-collected normal plant sample images and heat stress sample images to form a training dataset, and trains a random forest classifier accordingly. It should be noted that the random forest classifier of the present invention is lightweight and can run in real time on a regular computer.

[0129] Specifically, in the classification and identification stage, this invention first constructs a feature vector f of the leaf to be identified. This feature vector consists of six feature values ​​arranged in a fixed order, including pre-calculated curl degree, leaf margin scorch ratio, yellowing index, gradient direction dispersion, aspect ratio, and excessive green index. Users can adjust the judgment threshold via command line. The user-set judgment threshold is denoted as T, with a default value of 0.55. Users can adjust this threshold upwards or downwards according to the required false positive rate in the actual application scenario. The operation process of random forest classification and threshold adjustment includes:

[0130] Then, the feature vector f of the leaf to be identified is input into the pre-trained random forest classifier F. The random forest classifier F outputs the probability p that the leaf belongs to thermal stress, which is calculated as follows:

[0131] p = F(f);

[0132] Then, the determination of a single leaf is expressed as follows:

[0133] ;

[0134] It compares the heat stress probability p output by the random forest classifier with the user-defined judgment threshold T. If p is greater than T, the leaf is judged to be in a heat stress state HT; if p is not greater than T, the leaf is judged to be in a normal state CK.

[0135] It should be noted that, since this invention automatically extracts two leaves, the large leaf and the small leaf, in the aforementioned steps, the above-described determination process is performed on the large leaf and the small leaf respectively. For the large leaf, this invention can obtain its heat stress probability p_large and its single leaf determination result; for the small leaf, this invention can obtain its heat stress probability p_small and its single leaf determination result. The state of the entire corn seedling is determined by combining the determination results of the two leaves: if the determination result of either the large leaf or the small leaf is heat stress, the system determines that the entire plant is in a heat stress state; if the determination results of both leaves are in a normal state, the system determines that the entire plant is in a normal state.

[0136] It should be noted that the confidence level in this invention is not a strict posterior probability, but rather an empirical index designed based on the principle that "the worst leaf determines the overall plant condition." It is calculated as follows: when heat stress is identified, the maximum HT probability of the two leaves is taken; when normal, the complementary value of the minimum HT probability of the two leaves is taken. This index is only used to provide users with the relative reliability of the model's judgment, facilitating the selection of samples requiring manual verification, and does not constitute a mathematical estimate of the true probability.

[0137] Furthermore, this invention calculates the confidence level of the overall plant determination result. If the overall plant determination result is a heat stress state, the system takes the larger of the two heat stress probabilities, large leaf and small leaf, as the confidence level c. If the overall plant determination result is a normal state, the system first calculates the difference between the heat stress probability of each leaf and 1, i.e., 1 minus p_large and 1 minus p_small, and then takes the smaller of these two differences as the confidence level c. The system finally outputs the overall plant determination result and the corresponding confidence level c for the user to view in the interactive interface.

[0138] It should be noted that, regarding the setting of the judgment threshold, the specific embodiment of this invention uses an optimization method based on the receiver operating characteristic (ROC) curve to determine the optimal cutoff point. Specifically, an independent validation set is divided from the training data, or a cross-validation strategy is used to ensure that the validation set contains at least 30 normal samples and 30 heat stress samples. The heat stress probability is predicted for the large and small leaves of each image in the validation set, and the average or maximum of the probabilities of the two leaves is taken as the overall probability of the plant, and an ROC curve is plotted. The threshold selection uses maximizing the Youden index as the default criterion, which is defined as the sum of sensitivity and specificity minus 1. When the validation set test shows that the threshold is 0.55, the sensitivity reaches 0.92, the specificity reaches 0.94, and the Youden index is 0.86, which is better than the alternatives of 0.50 and 0.60. If, in practical applications, the cost of misclassifying a normal strain as suffering from heat stress outweighs the cost of omitting it (e.g., leading to unnecessary manual verification costs), the threshold can be appropriately increased to 0.60. In this case, specificity increases to 0.96, while sensitivity decreases to 0.86. Conversely, if the cost of omitting a strain is higher, the threshold can be decreased to 0.50, increasing sensitivity to 0.95. Users can adjust this threshold parameter in the system interface according to specific application needs, achieving flexible risk control.

[0139] In some embodiments of the present invention, users can view the scale bar image separately via button interaction. Specifically, when a user presses the Enter key, the system will display an image containing only the scale bar, without overlaying the original image of the corn seedling. This scale bar image is easy for users to save separately for subsequent literature recording, research reports, or data archiving. Through the above result display and interactive operation, users can intuitively obtain thermal stress identification results, confidence information, and physical size references, while meeting the needs of researchers for data preservation and secondary use.

[0140] To address the shortcomings of existing technologies, such as the subjectivity, low efficiency, and lack of standardized criteria in manual visual judgment, and the significant background interference, high misclassification rate of normal plants, lack of physical dimensions, and complex interaction in machine vision methods, this invention provides a method for identifying heat stress in maize seedlings by integrating leaf morphology and color features, combining physical quantification with a scale, and employing human-machine collaborative bounding box selection. This invention extracts features from six dimensions: curling degree, leaf margin scorch ratio, yellowing index, aspect ratio, gradient direction dispersion, and excessive green index. It then utilizes a random forest classifier to accurately determine the heat stress state, effectively reducing the proportion of normal plants misclassified as suffering from heat stress. Furthermore, this invention supports scale calibration, outputting the actual physical length of the leaves. Users only need to perform a simple bounding box selection of the entire seedling to obtain the recognition result; no professional training is required, making the operation extremely simple.

[0141] This invention also provides clear quantitative indicators, automatically displaying the actual length of leaves through a scale bar and outputting the recognition confidence score, fully meeting the requirements of agricultural researchers for data accuracy and repeatability. In terms of hardware compatibility, the program of this invention is developed based on Python and OpenCV, and can run smoothly on ordinary computers with mainstream operating systems such as Windows, Linux, and Mac, without requiring high-performance graphics processors or dedicated hardware, greatly reducing the user's learning curve. Furthermore, this invention has strong scalability; users can collect and label image data according to their own needs, retrain the random forest classification model, and thus adapt to the heat stress recognition needs of different maize varieties or different growth environments, achieving personalized customization. In summary, this invention has achieved significant beneficial effects in terms of recognition accuracy, ease of operation, hardware compatibility, and model scalability.

[0142] It should be understood that the method steps in the embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can use standard programming techniques. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if necessary, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).

[0143] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.

[0144] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices, etc. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RSM, ROM, etc., such that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to the methods and techniques described in the invention, the invention may also include the computer itself.

[0145] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.

[0146] The above description is merely a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention, as long as they achieve the technical effects of the present invention by the same means, should be included within the scope of protection of the present invention. Within the scope of protection of the present invention, the technical solutions and / or implementation methods can have various modifications and variations.

Claims

1. A method for identifying heat stress in maize seedlings based on interactive calibration, characterized in that, The method includes the following steps: S100. Preprocess the corn seedling image taken by the user, generate a binary mask using the green threshold range of the HSV color space, and perform morphological closing and opening operations in sequence to obtain the leaf mask. S200: According to the user's selection, the image scale is calibrated, the pixel distance between the two ends of the reference object calibrated by the user and the actual length input by the user are recorded, and the number of pixels per centimeter is calculated to establish the mapping relationship between pixels and physical space. S300: Receive the entire seedling area selected by the user on the image, sort the outlines within the selected area by area, select the outline with the largest area as the large leaf, and select the outline with the smallest area as the small leaf. S400: Extract multidimensional features from large and small leaves respectively; S500. Input the extracted multidimensional features into a random forest classifier to obtain the probability that the leaves belong to heat stress. Compare the probability with a preset threshold to determine whether the leaves are in a heat stress state or a normal state. Determine the heat stress state of the whole corn seedling based on the determination results of large leaves and small leaves, and calculate the confidence level of the determination results. S600 displays the judgment result and confidence level, and displays the scale on the image based on the scale calibration result.

2. The identification method according to claim 1, characterized in that, In step S400 The multidimensional features include curl degree for characterizing the degree of leaf curling, scorch ratio for characterizing the degree of leaf margin scorch, yellowing index for characterizing the degree of leaf yellowing, gradient direction dispersion for characterizing the degree of leaf texture disorder, aspect ratio for characterizing leaf shape, and excess green index for characterizing the degree of leaf greenness.

3. The identification method according to claim 2, characterized in that, Step S100 includes the following steps: S110. Obtain the input original image I, wherein the original image is represented in BGR color space; S120, convert the original image I to HSV color space, to obtain I hsv ; the HSV color space I hsv Each pixel is subjected to threshold judgment to generate a binary mask M, which is represented as follows: The threshold ranges in the formula are set as follows: Hue minimum H min = 35, Hue maximum H max = 85; saturation minimum S min = 40, saturation maximum S max = 255; minimum value of lightness V min = 40, maximum value of lightness V max = 255; Pixels that meet the set threshold range are set as foreground, otherwise they are set as background, in order to generate a binary mask; S130, sequentially performing morphological closing operation and opening operation on the binary mask M obtained in S120 to obtain a final leaf mask M leaf .

4. The identification method according to claim 3, characterized in that, In step S200, when the user selects to use a scale, the scale calibration operation includes the following steps: S210. Obtain the input original image I; obtain the positions of the two ends of the reference object clicked by the user on the original image, and obtain the actual length input by the user; S220. Scale the original image to the display size and record the scaling ratio; where the scaling ratio k disp is equal to the display width divided by the original map width; S230. Obtain the two endpoints of the reference object clicked by the user on the displayed image, determine the coordinates of the two endpoints on the original image, and record them as (x1, y1) and (x2, y2) respectively. According to the coordinates of the two end points, the pixel distance d on the original image is calculated px which is calculated as follows: Let the actual length of the user input be L real ; The number of pixels per centimeter ρ is calculated as follows: ; Output the calculated number of pixels per centimeter ρ, and use it for subsequent scale drawing; S240, scaling the original image I to a display size to obtain a display image I disp and the scaling ratio k disp ; S250. If the number of pixels per centimeter ρ exists, the output image will be displayed in image I. disp To draw a scale bar in the lower right corner, follow these steps: S251. Calculate the length L of the line segment representing the scale. px It is represented as: Wherein, the length L of the line segment px The unit is pixels; S252. Then draw a black horizontal line segment with a line width of one pixel, and add a vertical line at each end of the line segment as a closure. S253. Draw text above the black horizontal line segment, where the content of the drawn text can be "Lreal cm", for example, when Lreal is 5, the content of the drawn text is "5 cm".

5. The identification method according to claim 4, characterized in that, In step S300 Contour detection is performed on all connected components within the selected area, and the contours are sorted in descending order of area, while noise contours with an area smaller than a preset threshold are automatically excluded.

6. The identification method according to claim 5, characterized in that, In step S400 For the curling degree, the degree of leaf curling is quantified by calculating the ratio of the actual area of ​​the leaf to its convex hull area; for the leaf edge scorch ratio, the severity of leaf edge scorch is reflected by calculating the proportion of the bright area in the leaf edge region; for the yellowing index, the yellowing degree of the leaf is reflected by calculating the mean value of the b channel of the leaf region in the Lab color space; for the gradient direction dispersion, the degree of disorder of the leaf texture is reflected by calculating the variance of the gradient direction distribution in the leaf region; for the leaf aspect ratio, the shape characteristics of the leaf are reflected by calculating the ratio of the long side to the short side of the minimum bounding rectangle of the leaf; for the excess green index, the greening degree of the leaf is reflected by calculating the mean of twice the green channel value minus the red channel value minus the blue channel value.

7. The identification method according to claim 6, characterized in that, Step S500 includes the following steps: S510. Construct the feature vector f of the leaf to be identified, and obtain the judgment threshold denoted as T; wherein the feature vector is composed of multiple feature values ​​arranged in a fixed order; S520. Input the feature vector f of the leaf to be identified into the pre-trained random forest classifier F. The random forest classifier F outputs the probability p that the leaf belongs to thermal stress, which is calculated as follows: p = F(f); S530. The determination of a single blade is expressed as follows: ; It compares the heat stress probability p output by the random forest classifier with the user-defined judgment threshold T. If p is greater than T, the leaf is judged to be under heat stress HT. If p is not greater than T, then the blade is determined to be in normal condition CK.

8. The identification method according to claim 7, characterized in that, In step S500 The calculation process for the confidence level of the judgment result includes the following steps: If the whole plant is determined to be under heat stress, the larger of the two heat stress probabilities, large leaf and small leaf, is taken as the confidence level. If the whole plant is determined to be under normal conditions, the difference between the heat stress probability of each leaf and 1 is calculated first, and then the smaller of the two differences is taken as the confidence level.

9. A computer-readable storage medium, characterized in that, It stores program instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 8.

10. A maize seedling heat stress identification system based on interactive calibration, characterized in that, include: A computer device, the computer device comprising the computer-readable storage medium according to claim 9.