Method for calculating leaf phenotypic parameters based on soybean leaf flattening image generation model
Through the non-contact calculation method based on the soybean leaf tiling image generation model, the problem of plant damage and low efficiency caused by traditional calculation methods on soybean leaves is solved, and efficient and low-damage soybean leaf aspect ratio calculation is achieved.
Patent Information
- Application Number
- CN202411279367.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-06-17
- Estimated Expiration
- 2044-09-12
AI Technical Summary
The traditional method of measuring the aspect ratio of soybean leaves requires contact with soybean leaves, resulting in plant damage and low calculation efficiency.
Using a contactless calculation method based on the soybean leaf tiling image generation model, the soybean leaf tiling image is generated and its leaf phenotype parameters are calculated by taking the natural state image of the soybean leaf and inputting the pre-trained model.
The efficiency of calculating the aspect ratio of soybean leaves is improved and the risk of damage to soybean plants is reduced.
Smart Images

Figure CN118967785B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of calculating soybean leaf phenotypic parameters, and specifically provides a method for calculating leaf phenotypic parameters based on a soybean leaf flattening image generation model. Background Art
[0002] To improve the efficiency of soybean breeding and enhance the self-sufficiency ability of soybeans, the support of crop phenotyping technology for soybean breeding work is indispensable. The phenotypic parameters of crops are important data supports for accelerating the breeding speed of crops and increasing their yields. Among them, the leaf area index (LAI), which is one of the important factors affecting the photosynthesis efficiency of crops, is closely related to the leaf shape phenotypic parameters such as the length-width ratio of soybean leaves (i.e., the length-width ratio of soybean leaves), because different length-width ratios of soybean leaves will affect the mutual occlusion state between soybean leaves, and thus affect the light-receiving ability of soybean leaves.
[0003] Therefore, the measurement of the length-width ratio of soybean leaves is very important for soybean breeding work. Since soybean leaves in the natural growth state will have different degrees of natural curvature, traditional methods for measuring the length-width ratio of soybean leaves generally need to contact the soybean leaves to flatten them before measurement. Therefore, before each contact measurement, it is necessary to manually flatten the soybean leaves before measurement. This contact measurement method, because it needs to contact the soybean leaves, inevitably increases the possibility of damaging the soybean leaves of the soybean plant, and at the same time, more manpower and time costs are required for the measurement of the length-width ratio of soybean leaf shapes, resulting in low measurement efficiency. Summary of the Invention
[0004] (1) Technical Problems to be Solved
[0005] In view of the deficiencies of the prior art, the present invention provides a method for calculating leaf phenotypic parameters based on a soybean leaf flattening image generation model, which can solve the above technical problems.
[0006] (2) Technical Solutions
[0007] To solve the above technical problems, the present invention provides the following technical solutions: A method for calculating leaf phenotypic parameters based on a soybean leaf flattening image generation model, comprising the following steps:
[0008] S1. Photograph the soybean leaves in the natural bending state in a non-contact manner to obtain the natural state image of the soybean leaves;
[0009] S2. Input the natural state image of the soybean leaves into a pre-trained soybean leaf flattening image generation model to obtain the flattened image of the soybean leaves;
[0010] S3. Calculate the leaf shape phenotype parameters of the soybean leaf using the flattened soybean leaf image, where the leaf shape phenotype parameters include the length-width ratio of the soybean leaf shape.
[0011] Preferably, the flattened soybean leaf image generation model is an improved SwimIR model.
[0012] Preferably, the improved SwimIR model includes a data preprocessing module, a shallow feature extraction module, a deep feature optimization module, an auxiliary style preservation module, and a high-quality image reconstruction module.
[0013] Preferably, step S2 includes sub-step S21: The data preprocessing module rotates the natural state image of the soybean leaf so that the line connecting the leaf tip and the leaf stalk of the natural state image of the soybean leaf is horizontally centered, with the leaf tip to the right and the leaf stalk to the left.
[0014] Preferably, step S2 further includes sub-step S22: Input the rotated natural state image of the soybean leaf into the shallow feature extraction module to initially extract the shallow feature information of the natural state image of the soybean leaf.
[0015] Preferably, step S2 further includes sub-step S23: Input the output of the shallow feature extraction module into the deep feature optimization module to perform deep optimization processing on the shallow feature information of the natural state image of the soybean leaf.
[0016] Preferably, step S2 further includes sub-step S24: Input the outputs of both the shallow feature extraction module and the deep feature optimization module into the auxiliary style preservation module for adaptive instance normalization processing.
[0017] Preferably, step S2 further includes sub-step S25: Input the output of the auxiliary style preservation module into the high-quality image reconstruction module for image reconstruction to output the flattened soybean leaf image.
[0018] Preferably, step S3 includes: Input the flattened soybean leaf image into the image segmentation model SAM to obtain the mask image of the flattened soybean leaf image; further, traverse and calculate in the mask image horizontally and vertically to obtain the relative leaf length and relative leaf width of the soybean leaf; finally, calculate the length-width ratio of the soybean leaf shape using the relative leaf length and relative leaf width.
[0019] Preferably, the leaf shape phenotype parameters further include the leaf area of the soybean leaf shape; step S3 further includes: Calculate the leaf area of the soybean leaf shape using the flattened soybean leaf image.
[0020] (III) Beneficial effects
[0021] Compared with the prior art, the present invention provides a method for calculating leaf phenotypic parameters based on a soybean leaf flattening image generation model, which has the following beneficial effects: The present invention takes pictures of soybean leaves in a naturally curved state in a non-contact manner to obtain natural state images of soybean leaves, further inputs the natural state images of soybean leaves into a pre-trained soybean leaf flattening image generation model to obtain soybean leaf flattening images, and finally calculates the length-width ratio of the soybean leaf shape using the soybean leaf flattening images; compared with the traditional method of directly measuring the length-width ratio of soybean leaves manually, the present invention can greatly improve the measurement efficiency of the length-width ratio of the soybean leaf shape through the intervention of the deep learning technology for generating soybean leaf flattening images, and at the same time reduce the risk of damaging soybean plants. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flowchart of the method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model of the present invention;
[0023] Figure 2 It is a flowchart of step S2 of the present invention;
[0024] Figure 3 It is a flowchart of steps S1 - S2 of the present invention;
[0025] Figure 4 It is a flowchart of step S3 of the present invention;
[0026] Figure 5 It is a comparison diagram of the photographed image, scanned image, and flattened image output by the model of soybean leaves. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0028] The present invention provides a method for calculating leaf phenotypic parameters based on a soybean leaf flattening image generation model, including the following steps:
[0029] S1. Take pictures of soybean leaves in a naturally curved state in a non-contact manner to obtain natural state images of soybean leaves.
[0030] It can be understood that soybean leaves in a natural growth state will have different degrees of natural curvature. In this step S1, a camera or other device is used to take pictures of soybean leaves in a naturally curved state in a non-contact manner.
[0031] S2. Input the natural state image of the soybean leaf into the pre-trained soybean leaf flattening image generation model to obtain the flattened soybean leaf image.
[0032] Preferably, the above-mentioned soybean leaf flattening image generation model is an improved SwimIR (Swim-IR) model; the improved SwimIR model of the present invention includes a data preprocessing module, a shallow feature extraction module, a deep feature optimization module, an auxiliary style preservation module, and a high-quality image reconstruction module; in the data preprocessing module, the horizontal orientations of the leaf tip and the leaf stalk of the captured image of the soybean leaf in the natural state are unified; in the subsequent four modules, the soybean leaf image with the unified horizontal orientation will be flattened and the color style of the captured image (the natural state image of the soybean leaf) will be retained.
[0033] Specifically, step S2 includes the following sub-steps:
[0034] Sub-step S21: The data preprocessing module rotates the natural state image of the soybean leaf so that the line connecting the leaf tip and the leaf stalk of the natural state image of the soybean leaf is horizontally centered, with the leaf tip to the right and the leaf stalk to the left.
[0035] The data preprocessing module is a module that rotates the image of the soybean leaf in the natural state obtained by non-contact shooting (i.e., the natural state image of the soybean leaf) so that the line connecting the leaf tip and the leaf stalk of the soybean leaf image is horizontally centered and the leaf tip is to the right while the leaf stalk is to the left. The data preprocessing module first performs key point detection processing on the natural state image of the soybean leaf through the pre-trained YOLOv8 model, the purpose of which is to detect the coordinate information of the points where the leaf tip (top) and the leaf stalk (stalk) of the soybean leaf are located respectively, and the two coordinate points of the leaf tip and the leaf stalk are denoted as (x top , y top ), (x stalk , y stalk ); further, the slope k of the line connecting the leaf tip and the leaf stalk is calculated by the following formula (1).
[0036]
[0037] After obtaining the above slope k, the data preprocessing module further judges the relative positions of the leaf tip and the leaf stalk points on the horizontal axis by the following formula (2) to determine whether the rotation angle of the natural state image of the soybean leaf needs to be increased by 180° or 0°, and the final rotation angle a of the natural state image of the soybean leaf is obtained by the following formula (3).
[0038]
[0039]
[0040] The data preprocessing module rotates the above rotation anglea As a key input of "getRotationMatrix2D" in the OpenCV library, the rotation matrix R (Rotate Matrix) of the natural state image of the soybean leaf is obtained. Then, this rotation matrix R is used as a key input of "warpAffine" in the OpenCV library to preprocess the natural state image of the captured soybean leaf to a unified orientation, facilitating the subsequent calculation of leaf phenotype parameters.
[0041] Sub-step S22: Input the rotation-processed natural state image of the soybean leaf into the shallow feature extraction module to initially extract the shallow feature information of the natural state image of the soybean leaf, which is then used for the generation of the flattened image of the soybean leaf.
[0042] The shallow feature extraction module, whose input is the natural state image of the soybean leaf preprocessed by the above data preprocessing module, consists of a convolution layer. The input channel number of this convolution layer is 3, the output channel number is 96, and the sizes of its convolution kernel and stride are 4×4 and 2 respectively. The purpose of the shallow feature extraction module is to initially extract the shallow feature information of the input image and use its own output as the input of the next module (deep feature optimization module).
[0043] Sub-step S23: Further input the output of the shallow feature extraction module into the deep feature optimization module to perform deep optimization processing on the shallow feature information of the natural state image of the soybean leaf, thus better ensuring the quality of the subsequent generated flattened image of the soybean leaf.
[0044] The deep feature optimization module, that is, the deep feature extraction module, whose input is the output of the previous module (shallow feature extraction module), is used to continue the optimization processing at the deep feature level of the image. The deep feature optimization module is composed of 7 sub-modules connected in series: namely, 6 RSTB (Residual Swim Transformer Block) blocks and a convolution layer. Among them, the RSTB is composed of 6 STL (Swim Transformer Layer) and a convolution layer connected in series in turn. For all the convolution layers in the deep feature optimization module here, the input and output channel numbers are 96, and the sizes of the convolution kernel and stride are 3×3 and 1 respectively.
[0045] Sub-step S24: Further input the outputs of both the shallow feature extraction module and the deep feature optimization module into the auxiliary style preservation module for adaptive instance normalization processing.
[0046] An auxiliary style preservation module, which is essentially Adaptive Instance Normalization (AdaIN). This module takes the outputs of the above-mentioned shallow feature extraction module and deep feature optimization module as its inputs. The two inputs of the auxiliary style preservation module are denoted as x1 and x2 in sequence. The calculation corresponding to the auxiliary style preservation module is as shown in the following formula (4), where σ(·) is the standard deviation and μ(·) is the mean. The calculation of formula (4) is beneficial for maintaining the color style of the input natural state image of soybean leaves, thereby helping to reduce the influence of the color difference between the scanned image and the photographed image of soybean leaves.
[0047]
[0048] Sub-step S25: Further input the output of the auxiliary style preservation module into the high-quality image reconstruction module for image reconstruction to output a flattened image of soybean leaves.
[0049] The high-quality image reconstruction module is used to reconstruct the output of the above module (auxiliary style preservation module) into a 3-channel RGB image to obtain a flattened image of soybean leaves. The high-quality image reconstruction module can specifically be composed of a convolutional layer with 96 channels as input, 3 channels as output, a convolutional kernel size of 4×4, and a stride of 2.
[0050] In addition, the dataset used during the training of the improved SwimlR model of the present invention is 16,841 photographed images of soybean leaves in the natural state (i.e., natural state images of soybean leaves) and their corresponding flattened scanned images (the flattened scanned images are images obtained by using a scanner to flatten the unfolded soybean leaves), as well as the binary mask images after the photographed images and scanned images are segmented by SAM (i.e., the following image segmentation model). As Figure 5 shown, the photographed image is denoted as I input as the input of the model, and its corresponding mask image is denoted as I I-mask ; the scanned image is denoted as T GT as the ground truth during model training, and its corresponding mask image is denoted as I G_mask ; the output of the improved SwimlR model is denoted as I output . The loss functions used during the training of the improved SwimlR model can be adversarial loss, perceptual loss, leaf area color loss, and normalized L1 loss, which consist of a total of 4 loss terms.
[0051] The generative adversarial loss, also known as the GAN (Generative Adversarial Networks) loss, needs to be used in conjunction with a discriminator. The discriminator is constructed by referring to the network structure of the U-Net model in the field of semantic segmentation. Its input is a three-channel RGB image, and its output is a one-dimensional vector. The discriminator receives I GT and I output The closer the two vectors output when used as inputs are, in other words, the binary cross-entropy loss between them is calculated. The definition of the binary cross-entropy loss is shown in the following formula (5). Calculating the generative adversarial loss is beneficial to improving the quality of the flattened soybean leaf images generated by the improved SwimlR model.
[0052]
[0053] In the above formula (5), N represents the total number of samples. The category to which the i-th sample belongs is y i , generally speaking, the value of y i is 1 or 0, representing the real category and the false category respectively, and the predicted value of the i-th sample is denoted as g(x i ) and it is generally a probability value.
[0054] Perceptual loss, convolutional neural networks have a powerful ability to extract image features from digital images. Each layer of a convolutional neural network can be regarded as a feature extractor, and each layer can extract features at different levels of abstraction from the input image. Generally speaking, it is easier to extract information at the global level of the image the farther away from the input layer, and vice versa, it is easier to extract information at the detailed level of the image. The definition of the perceptual loss function is shown in the following formula (6).
[0055]
[0056] In the above formula (6), Φ q represents the q-th layer among M feature extraction layers, and γ q refers to the weight coefficient of the q-th feature extraction layer. The weight coefficient is defined as 0.8 or 1.2.
[0057] Leaf surface area color loss. Since the dataset collected for training the improved SwimlR model includes soybean leaf images taken in a naturally curved state (Figure I input ) and their corresponding scanned images after flattening (Scan Figure I GT ), Figure I input and Scan Figure I GTDue to the differences in the light source, light angle, and image acquisition device between the two, there is inevitably a color difference between the captured images of soybean leaves in their natural state and their corresponding scanned images in the training dataset. Therefore, only I output and I GT Establishing a loss function will cause the model to fail to learn I input The color style of soybean leaves instead tends more towards I GT The color style of soybean leaves. To this end, the present invention utilizes I input 、I I_mask and I output 、I G_mask Establishing a color loss for the leaf surface area can more effectively solve the above color difference problem. The color loss function for the leaf surface area is defined as shown in the following formula (11).
[0058]
[0059]
[0060]
[0061]
[0062]
[0063] Among them, as shown in the above formulas (7)-(10), μ input 、μ output 、σ input 、σ output are respectively the mean and standard deviation of the pixel points in the leaf surface area of the input image I input 、output image I output of soybean leaves. N I_mask 、N G_mask are respectively the total number of pixel points in the leaf surface area of I input 、I output . m is the total number of pixel points in the image. In the above formula (11), n is the number of channels of the image, that is, the three color channels of R, G, and B. In addition, the values of the pixel points of I I_mask 、I G_mask in the leaf surface area of soybean leaves are 1, and the values of the pixel points in the remaining areas are 0.
[0064] Normalized L1 loss. Due to the color difference between I input and I GT , directly establishing an L1 loss with I GT and I output will run counter to the goal of the present invention to make the color style of the output image I output of the model approach I input . Therefore, it is necessary to use IGT and I output are re-projected in three channels respectively as shown in the following formula (12), and then the re-projected I′ GT and I′ output are used to establish the L1 loss as shown in the following formula (13).
[0065]
[0066] L norm_L1 = ||I′ GT - I′ output ||1 (13)
[0067] In the above formula (12), i represents the three channels of the R, G, and B images respectively, m represents the total number of image pixels and j is an integer, and 1×10 -6 is to prevent the situation of division by zero.
[0068] The sum of the above four loss functions together constitutes the overall loss function during model training as shown in the following formula (14).
[0069] L TOTAL = β1L GAN + β2L perceptual + β3L leaf_color + β4L norm_L1 (14)
[0070] In the above formula (14), β is the weight coefficient of each loss term, and they are defined as 0.01, 1.5, 20, and 25 respectively.
[0071] S3. Calculate the leaf shape phenotypic parameters of the soybean leaf using the flattened soybean leaf image.
[0072] Among them, the leaf shape phenotypic parameters include the length-width ratio of the soybean leaf shape. The length-width ratio of the soybean leaf shape is an important influencing index for the photosynthesis efficiency of the soybean leaf plant and is closely related to the yield of the soybean plant.
[0073] Although the straight-line distance between the camera and the soybean leaf is not fixed when manually taking images of the soybean leaf, which results in the inability to directly measure the absolutely true data of the length and width of the soybean leaf through the image, the calculation of the length-width ratio parameter does not require absolutely true length and width data. Because the length-width ratio data obtained by dividing the relative data directly measured from the leaf length and width of the flattened soybean leaf image is logically consistent with the length-width ratio data obtained by dividing the absolutely true leaf length and width data, the acquisition of the length-width ratio parameter does not require other reference values for auxiliary calculation.
[0074] Preferably, step S3 includes: inputting the flattened soybean leaf image into the image segmentation model SAM (Segment Anything Model) to obtain the mask image I of the flattened soybean leaf image output_mask , it can be understood that the pixel values of the leaf surface area of this mask image are not the same as those of other areas: the pixel value of the leaf surface area is 1, and the pixel value of other areas is 0. Further, by traversing and calculating horizontally and vertically in the mask image to obtain the relative leaf length and relative leaf width of the soybean leaf, that is, by traversing horizontally and vertically in I output_mask in the X-axis and Y-axis directions of the mask image to calculate the number of pixel points with a pixel value of 1 to obtain the relative leaf length and relative leaf width data of the soybean leaf, denoted as L unreal , H unreal , the relative leaf length corresponds to the longest leaf length obtained by traversing the mask image, and the relative leaf width corresponds to the longest leaf width obtained by traversing the mask image. Finally, the aspect ratio R of the true leaf shape of the soybean leaf is calculated using the relative leaf length and relative leaf width as shown in the following formula (15).
[0075]
[0076] In summary, it can be understood that in the present invention, the data preprocessing module uses the pre-trained YOL0v8 model to detect key points of the leaf tip and leaf stalk points in the soybean leaf image, calculates the slope of the line connecting the coordinates of the leaf tip point and the leaf stalk point, and unifies the soybean leaf image in the direction with the leaf tip facing right and the leaf stalk facing left through the calculated slope. The standardized soybean leaf image with the leaf orientation is input into the improved SwimlR model, and successively passes through the "shallow feature extraction module", "deep feature optimization module", "auxiliary style preservation module", and "high-quality image reconstruction module" in the trained model to finally obtain the flattened image of the input soybean leaf image, and the color style of the output flattened soybean leaf image is aligned with the color style of the input soybean leaf image. Further, the output flattened soybean leaf image passes through the SAM model to obtain its mask image (mask), and then the lengths and widths (counting the number of pixel points) in the horizontal and vertical directions of the area where the soybean leaf is located in the mask image are calculated respectively, and the ratio between the two is calculated to obtain the aspect ratio parameter of the flattened soybean leaf phenotype.
[0077] In addition, the leaf shape phenotype parameter may also include the leaf area of the soybean leaf shape. The leaf area is also an important influencing index for the photosynthesis efficiency of the soybean leaf plant and is closely related to the yield of the soybean plant. Correspondingly, step S3 further includes: calculating the leaf area of the soybean leaf shape using the flattened soybean leaf image. For the measurement of the actual leaf area of the soybean leaf shape, first, it can be very convenient to count the number of pixel points in the leaf surface area in the above I output_mask , define each pixel point as 1, and regard the total number of pixel points in the leaf surface area as the non-real relative image leaf area, denoted as S unreai, assume that the length of the target soybean leaf shape has been obtained through actual measurement and is denoted as L real , the true leaf area is S real . Approximate the soybean leaf shape as an ellipse, and denote the length of the major axis, the length of the minor axis, and the area of the ellipse obtained by actual measurement as a real , b real , Then, denote the non-true relative length of the major axis, the length of the minor axis, and the area of the ellipse measured in the image as a unreal , b unreal , Then, there are the following formulas (16) to (18), where formula (18) is an approximate calculation formula for the true leaf area (the leaf area of the soybean leaf shape).
[0078]
[0079]
[0080]
[0081] Compared with the prior art, the present invention provides a method for calculating leaf phenotypic parameters based on a soybean leaf flattening image generation model, which has the following beneficial effects: (1) The present invention takes pictures of soybean leaves in a natural bending state in a non-contact manner to obtain natural state images of soybean leaves, further inputs the natural state images of soybean leaves into a pre-trained soybean leaf flattening image generation model to obtain soybean leaf flattening images, and finally calculates the length-width ratio of the soybean leaf shape using the soybean leaf flattening images; compared with the traditional method of directly measuring the length-width ratio of soybean leaves manually, the present invention can greatly improve the measurement efficiency of the length-width ratio of the soybean leaf shape through the intervention of the deep learning technology for generating soybean leaf flattening images, and at the same time reduce the risk of damaging soybean plants; (2) At the dataset level, there is inevitably a color difference between the captured images of soybean leaves in the natural state and their corresponding scanned images, and the color of the soybean leaf blade can to a certain extent reflect the content of photosynthesis-related plant pigments (such as chlorophyll, carotenoids) contained in the soybean leaf. Therefore, solving the color difference problem between data pairs in the dataset is also a problem solved by the present invention. The present invention can more effectively solve the above color difference problem by establishing a color loss of the leaf surface area during the training process of the model. In addition, an auxiliary style preservation module is used to help reduce the influence of the color difference between the scanned image and the captured image of the soybean leaf. The present invention is improved on the basis of the SwimIR model, not only realizing the flattening process of soybean leaf images in the natural bending state, but also enabling the model to maintain the same color style between the output soybean leaf flattening image and the input captured image in the case of a color style difference between the captured image and the scanned image in the model training dataset; (3) In addition, compared with the commonly used Convolutional Neural Network (CNN), the deep feature optimization module in the SwimIR model largely uses the SwimTransformer Layer sub-module, which has a stronger global perception ability for digital images and the ability to connect with each other between image blocks, and the model also uses the Residual Connection method, enabling the model to achieve better training results under a deeper network structure; (4) By calculating the non-real relative leaf length and leaf area data of soybean leaves using the soybean leaf flattening images, and only by measuring the real leaf length data, the leaf area parameters of the soybean leaf shape can be calculated and obtained. Compared with the method of directly measuring the leaf area manually, it can reduce the contact measurement of soybean leaves, thereby improving the measurement efficiency of the leaf area and reducing the damage to soybean leaves.
[0082] It should be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or apparatus. Without further limitation, an element defined by the phrase "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or apparatus comprising said element.
[0083] Although the embodiments of the present invention have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention. The scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A method for calculating leaf phenotypic parameters based on a soybean leaf tiled image generation model, characterized in that: The following steps are involved: S1. photographing soybean leaves in a natural bending state in a non-contact manner to obtain a natural state image of the soybean leaves; S2, inputting the soybean leaf natural state image into a pre-trained soybean leaf tiled image generation model to obtain a soybean leaf tiled image; S3. Calculating leaf phenotypic parameters of soybean leaves using the soybean leaf tiled image, wherein the leaf phenotypic parameters include the length-to-width ratio of the soybean leaf; The soybean leaf flattened image generation model is an improved SwimIR model; the improved SwimIR model includes a data preprocessing module, a shallow feature extraction module, a deep feature optimization module, an auxiliary style preservation module and a high-quality image reconstruction module; The captured image is used as the input of the model and is denoted as I input , and its corresponding mask image is denoted as I I_mask ; The scanned image is used as the ground truth during model training and is denoted as I GT , and its corresponding mask image is denoted as I G_mask ; The output of the improved SwimIR model is denoted as I output ; The loss functions used in training the improved SwimIR model are generative adversarial loss, perceptual loss, leaf area color loss, and normalized L1 loss, which consists of a total of 4 loss terms; Generate adversarial loss and use it with the discriminator, which calculates I GT with I output The binary cross entropy loss between the two is defined as follows: In the above formula (5), N represents the total number of samples, and the category to which the i-th sample belongs is y i , and the predicted value of the i-th sample is recorded as g(x i ); The definition of the perceptual loss function is shown in equation (6): In the above formula (6), Φ q represents the qth layer among the M feature extraction layers, and γ q Refers to the weight coefficient of the qth feature extraction layer, and the weight coefficient is defined as 0.8 or 1.2; Color loss in leaf area, using I input ,I I_mask with I output ,I G_mask The leaf area color loss is established, and the leaf area color loss function is defined as shown in the following formula (11); Where, as shown in the above formulas (7)-(10), μ input , μ output , σ input , σ output The input image I input , output image I output The mean and standard deviation of the pixels in the soybean leaf surface area, N I_mask 、N G_mask I input ,I output The total number of pixels in the leaf area, m is the total number of pixels in the image; in the above formula (11), n is the number of channels of the image, namely: three color channels of R, G, and B; in addition, I I_mask ,I G_mask The value of the pixel points in the soybean leaf surface area is 1, and the value of the pixel points in the rest of the area is 0; Normalize the L1 loss and convert I GT ,I output Reprojection is performed in three channels respectively as shown in the following formula (12), and then the I obtained after reprojection is used G ' T ,I ou ' tput Establish L1 loss as shown in equation (13); L norm_L1 =||I′ GT -I o ′ utput ||1 (13) In the above formula (12), i represents the three channels of the image R, G, and B, m represents the total number of image pixels, j is an integer, and 1×10-6 is to prevent the divisor from being 0; The above four loss functions are added together to form the overall loss function during model training as shown in the following formula (14); L TOTAL =β1L GAN +β2L perceptual +β3L leaf_color +β4L norm_L1 (14) In the above formula (14), β is the weight coefficient of each loss term.
2. The method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model according to claim 1, characterized in that: The step S2 includes a sub-step S21: the data preprocessing module rotates the soybean leaf natural state image so that the line between the leaf tip and the leaf stalk of the soybean leaf natural state image remains horizontally centered with the leaf tip facing right and the leaf stalk facing left.
3. The method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model according to claim 2, characterized in that: The step S2 further includes a sub-step S22: inputting the rotated soybean leaf natural state image into the shallow feature extraction module to preliminarily extract shallow feature information of the soybean leaf natural state image.
4. The method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model according to claim 3, characterized in that: The step S2 further includes a sub-step S23: further inputting the output of the shallow feature extraction module into the deep feature optimization module to perform deep optimization processing on the shallow feature information of the natural state image of the soybean leaf.
5. The method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model according to claim 4, characterized in that: The step S2 further includes a sub-step S24: inputting the outputs of the shallow feature extraction module and the deep feature optimization module into the auxiliary style preservation module for adaptive instance normalization processing.
6. The method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model according to claim 5, characterized in that: The step S2 further includes a sub-step S25: inputting the output of the auxiliary style preserving module into the high-quality image reconstruction module for image reconstruction to output the soybean leaf tiled image.
7. The method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model according to claim 1, characterized in that: The step S3 comprises: inputting the soybean leaf tiled image into an image segmentation model SAM to obtain a mask image of the soybean leaf tiled image; further, obtaining the relative leaf length and relative leaf width of the soybean leaf by traversing and calculating the mask image horizontally and vertically; and finally calculating the aspect ratio of the soybean leaf shape using the relative leaf length and the relative leaf width.
8. The method for calculating leaf phenotypic parameters based on the soybean leaf flattening image generation model according to claim 1, characterized in that: The leaf phenotypic parameters also include the leaf area of the soybean leaf type; the step S3 also includes: calculating the leaf area of the soybean leaf type using the soybean leaf tiled image.
Citation Information
Patent Citations
Image style migration method and system based on deep learning
CN114581341A
Soybean leaf area measuring and calculating method and system, computer equipment and storage medium
CN115861409A
Plant leaf form identification method
CN117576195A