A method for extracting phenotypes from rice ears in natural form

Through deep learning and image processing technology based on mobile terminals, combined with Skeletonize and Astar algorithms, the problem of low efficiency and insufficient accuracy in rice ear phenotype extraction in the existing technology is solved, and efficient and accurate phenotyping of natural rice ears is achieved. extract.

CN117935250BActive Publication Date: 2024-10-11HUAZHONG AGRI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410121299.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2024-10-11
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

The existing technology relies on manual counting when measuring rice panicle traits, which is inefficient and error-prone, and cannot efficiently and accurately extract rice panicle phenotypes in natural forms.

Method used

A method based on mobile terminal image collection is adopted, and a deep learning model is used to preprocess and identify the rice ear images. The Skeletonize algorithm and the Astar path planning algorithm are combined to calculate the ear length. The ear type index is used to compensate for the counting error caused by occlusion, and extraction without occlusion is performed. and slightly occluded images of grains to calculate grain length and width.

Benefits of technology

It improves the counting accuracy of rice ear grain number and ear length, reduces manual intervention, is suitable for rice ears that are severely obscured in natural growth conditions, and significantly improves the efficiency and accuracy of phenotype extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117935250B_ABST
    Figure CN117935250B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for phenotypic extraction of rice ears in natural form. A black background plate is placed behind a rice plant, and a mobile terminal is used to collect an image of a rice ear. The image is preprocessed by a deep learning model to obtain a main image of the rice ear. Through a grain detection network model with two sets of parameters, the counting results of all grains in the rice ear and the position information of unobstructed and slightly obstructed grains are respectively obtained. The ear length is calculated by combining the Skeletonize algorithm, the Astar algorithm and the endpoint selection strategy suitable for ear length extraction. Further, the ear index PMI is obtained by identifying the main image of the rice ear, and the grain counting result is compensated by the PMI to obtain the final number of grains in the rice ear. According to the position information of the grains, the images of unobstructed and slightly obstructed grains are obtained by cropping, the grain length and grain width are extracted, and the mean thereof is calculated as the grain length and grain width of the rice ear. The technical solution accurately extracts the phenotypic characteristics of the rice ear, providing strong support for rice yield prediction and breeding research.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of agricultural bioinformatics, agricultural artificial intelligence, computer vision and crop seedling breeding, and in particular to a method for extracting phenotypes of rice ears in natural form. Background Art

[0002] Rice is an important food crop, and breeding high-yield rice has always been an important research field. In the research of rice breeding and cultivation, it is necessary to measure the yield of a large number of candidate samples under different environments to provide a scientific basis for breeding high-yield, high-quality and stress-resistant rice varieties. The rice panicle is the organ where rice grains grow, and the panicle traits are directly related to rice yield. The rice panicle also plays a very important role in rice disease and pest detection, nutritional diagnosis and growth period detection. The counting of rice grains per panicle, the measurement of grain length and width, and the measurement of panicle length are all of great significance for rice yield prediction. However, unlike the rapidly developing genomic tools, the traditional method of measuring the number of grains per panicle, grain length and panicle length relies on manual measurement. This measurement method requires the rice panicle to be threshed first, has a long measurement cycle, consumes manpower and material resources, and is prone to errors, which limits the accuracy and efficiency of rice panicle trait extraction.

[0003] Nanjing Agricultural University proposed a new method combining image analysis and a 5-point calibration model to count the number of grains per panicle. This method spreads out all the small branches of the rice panicle for counting, and the number of panicle samples with a counting error of less than 10% is greater than 90%. Huazhong Agricultural University proposed a method combining visible light imaging and soft x-ray imaging to calculate the number of grains per panicle. This method counts the grains of rice panicles after threshing, and the root mean square error (RMSE) of the number of grains per panicle calculated by this method is 0.42. The Jiangsu Provincial Key Laboratory of Crop Genetics and Physiology, College of Agriculture, Yangzhou University, has established a method based on the combination of image analysis and deep learning to quickly quantify the number of grains per panicle of rice. This method counts the grains of rice panicles in natural morphology, and the accuracy of the grain count is 75%. Society urgently needs a method for extracting rice panicle phenotypes with high accuracy and without threshing and artificial shaping. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a method for phenotypic extraction of rice ears in natural form.

[0006] (II) Technical solution

[0007] In order to solve the above problems, the present invention provides the following technical solutions, and proposes a method for extracting rice ear phenotype based on images collected by a mobile terminal, which is specifically as follows.

[0008] A method for extracting phenotypes from rice ears in natural form, comprising the following steps:

[0009] Step 1, after placing a black background plate on a rice plant in a naturally growing state, using a mobile terminal to collect a rice ear image, uploading the rice ear image to a server, and using a deep learning model to pre-process the rice ear image to obtain a rice ear main body image;

[0010] Step 2, using a grain detection network model to identify the main image of the rice ear, using two sets of parameters for identification respectively; using the first set of parameters for identification to obtain the counting result of all grains in the rice ear; using the second set of parameters for identification to obtain the position information of unobstructed grains and slightly obstructed grains;

[0011] Step 3, processing the main image of the rice ear by combining the Skeletonize algorithm, the Astar path planning algorithm and the endpoint selection strategy suitable for ear length extraction to calculate the ear length;

[0012] Step 4, identifying the main image of the rice ear, and obtaining the ear type index, i.e., the PMI value, used to characterize the proportion and degree of mutual occlusion between the rice ears and grains. <PMI<1;

[0013] Step 5, using the PMI value to compensate the rice ear grain counting result to obtain the final number of rice ear grains;

[0014] Step 6, cropping the original image according to the position information of the unobstructed and slightly obstructed grains to obtain unobstructed and slightly obstructed grain images;

[0015] Step 7, extracting the grain length and grain width of the unobstructed and slightly obstructed grain images, and recording the average of the grain length and grain width as the grain length and grain width of the rice ear.

[0016] Preferably, in step 2, the two sets of parameters are specifically: when the grain detection network model identifies the main image of the rice ear, the first set of parameters sets the confidence threshold to 0.25 and the intersection-and-union ratio threshold to 0.45; the second set of parameters sets the confidence threshold to 0.7 and the intersection-and-union ratio threshold to 0.8.

[0017] Preferably, in step 2, the position information of the unobstructed and slightly obstructed seeds specifically includes: the center point coordinate information and height and width information of the seed detection frame.

[0018] Preferably, in step 3, extracting the spike length comprises the following steps:

[0019] Image preprocessing: Perform color space conversion, threshold segmentation and morphological operations on the main image of rice ears, use color threshold to extract the region of interest, convert it to HSV space, then extract the S component map, and use Otsu's threshold segmentation and morphological operations to process the image;

[0020] Hole filling: Fill holes in the image after threshold segmentation, and remove holes with smaller areas by judging the threshold of the hole area;

[0021] Image skeleton extraction: Use the skeletonization algorithm Skeletonize to extract the skeleton of the image and obtain the refined shape of the rice ear;

[0022] Endpoint detection: Find the endpoints in the skeleton for path search. By traversing the points in the skeleton, detect the number of adjacent points of each point. If the number is 1, it is considered an endpoint.

[0023] Endpoint selection strategy and A* path search: The bottom endpoint is defined as the starting point, and the top 6 endpoints are defined as the end point set. Since the main path end points of naturally growing rice ears are mostly concentrated in the upper half, the top 6 endpoints are selected as the end point set; the pixels in each image of the rice ear are regarded as a node, and the connection between them represents the path. White pixels represent paths, and black pixels represent non-paths. Considering the cost and heuristic function of the path, the node with the smallest total cost in the open list is selected for expansion, and its neighbor nodes are added to the open list, and the cost information is updated. Once the target node is found, the shortest path from the start node to the target node is obtained by backtracking the closed list, that is, the shortest path from the start point to the end point; A* path search is performed on each end point to obtain the shortest path from the start point to all end points;

[0024] Path screening: Screen all the shortest paths and select the path with the largest number of pixels as the final path, which is the main path of the rice ear;

[0025] Ear length calculation: Calculate the number of pixels in the final path, convert it through the actual size corresponding to the pixels, and get the actual ear length of the rice ear.

[0026] Preferably, in step 4, the main image of the rice ear is identified using a panicle index regression network model, and the structure of the panicle index regression network model is as follows:

[0027] The spike index regression network includes a feature extraction module and a regression module;

[0028] The feature extraction module is composed of a DenseNet network and a global average pooling layer. After the image is input, it passes through the feature extraction module to obtain a one-dimensional feature vector;

[0029] The regression module is composed of a fully connected layer. The feature vector is input into the fully connected layer and finally mapped to the final output space through a Sigmoid activation function to output the spike index.

[0030] Preferably, the construction process of the spike type index regression network model in step 4 comprises the following steps:

[0031] Data preparation: using the grain detection network model to identify the main image of the rice ear, obtaining the result of the rice ear grain counting, and by comparing with the true value, obtaining the data of the ear type index of each rice ear image, and forming the ear type index and the main image of the rice ear into a paired data set;

[0032] Data enhancement: randomly flipping the main image of the rice ear horizontally or vertically to expand the data set;

[0033] Deep learning training: the training set is input into the spike index regression network model for training, and the parameters in the neural network are updated until the specified number of iterations or the specified accuracy is reached, and then the training is stopped.

[0034] Preferably, in the data preparation stage, the spike index is obtained by calculating the PMI value modeling formula, and the PMI value modeling formula is specifically:

[0035]

[0036] in, and They represent the counting result of the grain detection network model and the true value of the number of grains in the rice ear during the construction of the panicle index regression network model. and The kernel detection network model will misdetect a small number of backgrounds as kernels. Exceed Therefore, the absolute value is used in the formula to represent the error caused by false detection.

[0037] Preferably, in step 5, the number of rice ears is calculated using a formula for calculating the number of rice ears. The formula for calculating the number of rice ears is specifically:

[0038]

[0039] in, Indicates the final number of rice grains. It represents the result of the grain detection model recognizing the main image of the rice ear, and PMI represents the ear type index.

[0040] Preferably, in step 7, extracting the grain length and width comprises the following steps:

[0041] Grain image cropping and screening: according to the position information of the unobstructed and slightly obstructed grains, Python is used to crop the unobstructed and slightly obstructed grains from the original image;

[0042] Image processing: For each unobstructed and slightly obstructed kernel image, the following steps are performed: the kernel image is loaded and converted to RGB color space, threshold segmentation is performed according to the predefined color range, the kernel part is retained, the largest target, i.e., the outline of the kernel, is found for the segmented image, the minimum enclosing rectangle of the outline is calculated, and the outline is drawn on the original image;

[0043] Grain length and width screening: Calculate the width and height of the minimum circumscribed rectangle of the grain, compare it with the grain width and length range of the test parameter, exclude those that exceed the test parameter range, and the screened grain image is saved in the specified folder;

[0044] Data statistics: For each grain selected from the main image of the rice ear, the average value of its grain length and grain width is calculated, and the average value is used to represent the grain length and grain width of the rice ear.

[0045] (III) Beneficial effects

[0046] Compared with the prior art, the wheat ear detection method based on a custom rotating frame provided by the present invention has significant positive technical effects, which are specifically manifested in the following aspects.

[0047] (1) In the prior art, the number of rice grains in a naturally growing state is measured by direct calculation using target detection, which results in poor results due to the mutual occlusion between the rice grains. The present invention proposes a PMI (Panicle Index) that can characterize the proportion and degree of mutual occlusion between the rice grains. The PMI is used to compensate for the counting error caused by the occlusion of the rice grains, thereby improving the counting accuracy.

[0048] (2) The prior art uses multiple deep learning methods to extract phenotypes from naturally growing rice ears, that is, a generative adversarial network is used to repair the occluded part of the grain, and then the phenotype of all the repaired grain images is extracted. This method requires repairing and extracting the phenotype of each grain, and the phenotype extraction process is very time-consuming; and for rice ears with severe grain occlusion, this method cannot extract the phenotype of completely occluded grains, and is not universal. In the present invention, the ear index is used to compensate for the error caused by grain occlusion, and a high degree of accuracy can be achieved even in the case of severely occluded rice ears; in addition, the present invention only extracts the phenotype of unobstructed and slightly obstructed grains, and uses this phenotype to represent the phenotype of all grains in the rice ear, which greatly improves the efficiency of phenotype extraction.

[0049] (3) In the existing technology, the research on the length of rice ears mostly uses solutions such as fitting the center line of the rice ears and extracting the skeleton of the rice ears to find the main path of the rice ears. Fitting the center line is simple and efficient, but it is not effective for the drooping rice ears; extracting the skeleton of the rice ears to find the main path of the rice ears has high universality, but the existing method searches for the path of all the endpoints of the rice ears. The drooping rice ears and the clarity of the collected images will cause more burrs in the skeleton, and the burrs will produce redundant endpoints. Therefore, this method is inefficient. The present invention uses the Skeletonize function to extract the skeleton and fills the holes of the binary image before extracting the skeleton, thereby reducing the burrs in the skeleton; the Astar path search algorithm is used to consider the cost of the path and the heuristic function to find the shortest distance between the starting point and the end point. At the same time, according to the morphological characteristics of the rice ears in the natural growth state, an endpoint extraction strategy suitable for the extraction of the ear length is proposed, which improves the calculation speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a flow chart of the method of this application.

[0051] Figure 2 Collect image scene graphs for the field.

[0052] Figure 3 This is the structure and identification flow chart of the spike type index regression network model.

[0053] Figure 4 This is the network structure diagram of Dense Block.

[0054] Figure 5 This is the extraction flow chart of particle length and particle width.

[0055] Figure 6 A comparison chart of the traditional method and the endpoint extraction strategy of the present invention. DETAILED DESCRIPTION

[0056] The present invention is further described below in conjunction with the accompanying drawings and implementation examples.

[0057] like Figure 1 As shown, a preferred embodiment of the present invention is a method for extracting phenotypes from rice ears in natural form, comprising the following steps.

[0058] S1, collecting and preprocessing images of rice ears in a natural growth state, includes the following sub-steps.

[0059] S11 Rice ear image acquisition: After placing a black background board on a rice plant in a natural growth state, use a mobile terminal to capture rice ear images. The imaging time for a single rice ear is about 3 seconds. The image acquisition scene is as follows: Figure 2 shown.

[0060] The construction of the S12 preprocessing process includes the following sub-steps.

[0061] S121 data set preparation: Based on the rice ear images obtained in S11, all rice ear bodies are labeled using the bounding box annotation method through labelimg software. After each rice ear is labeled, the upper left corner coordinates, lower right corner coordinates, bounding box area and target type in the box are recorded. After the annotation is completed, it is stored in txt format.

[0062] S122 uses the open source deep learning framework Ultralytics to perform target detection training on the data set annotated in S121, and obtains a deep learning network model that can identify the rice ear body in the rice ear image.

[0063] S123 writes a script based on the deep learning network model trained in S122: The function of the script is explained as the following logic: load the rice ear image, call the deep learning network model to recognize the rice ear image, obtain the position information of the rice ear body, crop the rice ear body image according to the position information, and fill the rice ear body image with 0 pixels to make its aspect ratio equal to 4:3.

[0064] S13 rice ear image preprocessing: uploading the rice ear image to the server, and preprocessing the rice ear image using the preprocessing process constructed in S123 to obtain a rice ear main body image with an aspect ratio of 4:3.

[0065] S2, using a grain detection network model to identify the main image of the rice ear, includes the following sub-steps.

[0066] The construction of the S21 seed detection network model includes the following sub-steps.

[0067] S211 data set preparation: Based on the rice ear images obtained in S11, all rice ear grains are labeled using the bounding box annotation method through labelimg software. After each grain is labeled, the upper left corner coordinates, lower right corner coordinates, bounding box area and target type in the box are recorded. After the annotation is completed, it is stored in txt format.

[0068] S212 uses the open source deep learning framework Ultralytics to perform target detection training on the dataset annotated in S211, and obtains a deep learning network model that can identify grains in rice ear images.

[0069] S22 uses two sets of parameters for recognition respectively; the main image of the rice ear is input into the trained grain detection network model, and the first set of parameters (confidence threshold is 0.25, intersection ratio threshold is 0.45) is used for recognition to obtain the grain counting results of all rice ears; the second set of parameters (confidence threshold is 0.7, intersection ratio threshold is 0.8) is used for recognition to obtain the position information of unobstructed and slightly obstructed grains.

[0070] S3, processing the main image of the rice ear to calculate the ear length, the specific steps are as follows.

[0071] S31 image preprocessing: perform color space conversion, threshold segmentation and morphological operations on the main image of rice ears, use color threshold to extract the region of interest, convert it into HSV space, then extract the S component map, and use Otsu's threshold segmentation and morphological operations for image processing.

[0072] S32 Hole filling: Fill holes in the image after threshold segmentation. By judging the threshold of the hole area, holes with smaller areas are removed. At the same time, the binary image of rice ears is smoother, which is convenient for subsequent skeleton extraction.

[0073] S33 Image skeleton extraction: The binary image is processed using the skeletonization algorithm Skeletonize, and the refined shape of the rice ear is obtained through corrosion, inversion, corrosion again, skeleton merging and logical or operation.

[0074] S34 endpoint detection: Find the endpoints in the skeleton for path search. By traversing the points in the skeleton, detect the number of adjacent points of each point. If the number is 1, it is considered to be an endpoint.

[0075] S35 endpoint selection strategy and A* path search: define the bottom endpoint as the starting point, and define the top 6 endpoints as the end point set. Each pixel in the image is regarded as a node, and the connection between them represents the path. White pixels represent paths, and black pixels represent non-paths. Considering the cost and heuristic function of the path, select the node with the smallest total cost in the open list for expansion, add its neighbor nodes to the open list, and update the cost information. Once the target node is found, the shortest path from the starting node to the target node is obtained by backtracking the closed list, that is, the shortest path from the starting point to the end point; perform A* path search for each end point separately to obtain the shortest path from the starting point to all end points; Figure 3 (a) and (b) respectively represent the rice ear skeleton and its endpoint distribution extracted by the present method and the traditional method. The present method has fewer skeleton burrs and fewer endpoints, which is beneficial for path search. Figure 3(c) and (d) represent the endpoints and main paths extracted by the present method and the traditional method, respectively. The traditional method calculates all the endpoints in the rice ear skeleton and obtains the main path of the rice ear. Since the main path endpoints of naturally growing rice ears are mostly concentrated in the upper half and the number of endpoints extracted by the present method is significantly less than that of the traditional method, the present method only calculates the top 6 endpoints of the rice ear, thereby greatly reducing the amount of calculation and obtaining the same main path of the rice ear.

[0076] S36 Path screening: All the shortest paths are screened and the path with the largest number of pixels is selected as the final path, which is the main path of the rice ears.

[0077] S37 Ear length calculation: Calculate the number of pixels of the final path, convert it through the actual size corresponding to the pixels, and obtain the actual ear length of the rice ear.

[0078] S4, using the ear type index regression network model to identify the main image of the rice ear, includes the following sub-steps.

[0079] The structure of the S41 spike index network model is as follows: Figure 4 As shown in FIG. 1 , the spike index regression network includes a feature extraction module and a regression module; the feature extraction module is composed of a DenseNet network and a global average pooling layer, and the structure of the DenseNet core module Densenet Block is as follows Figure 5 As shown, after the image is input, it passes through the feature extraction module to obtain a one-dimensional feature vector; the regression module is composed of a fully connected layer, and the feature vector is input into the fully connected layer and finally mapped to the final output space through the Sigmoid activation function to output the result.

[0080] S42 Dataset preparation: Use the grain detection network model to identify the main image of the rice ear, obtain the rice ear grain counting result, and compare it with the true value to obtain the ear type index data of each rice ear image, and form the ear type index and the main image of the rice ear into a paired data set; the ear type index is obtained by calculating the PMI value modeling formula, and the PMI value modeling formula is specifically:

[0081]

[0082] in, and They respectively represent the counting results of the grain detection network model during the construction stage of the panicle index regression network model and the true value of the number of grains in the rice panicle.

[0083] S43 data enhancement: randomly flipping the main image of the rice ear horizontally or vertically to expand the data set.

[0084] S44 deep learning training: input the training set into the spike index regression network model for training, update the parameters in the neural network, and stop training until a specified number of iterations or a specified accuracy is reached.

[0085] S45 Model recognition: inputting the main image of the rice ear into the trained ear type index network model to obtain the PMI value of each rice ear.

[0086] S5, using the PMI value to compensate the rice ear grain counting result, substituting the PMI and the rice ear grain counting result into the rice ear grain number calculation formula to obtain the final rice ear grain number, the rice ear grain number calculation formula is specifically:

[0087]

[0088] in, Indicates the final number of rice grains. It represents the result of the grain detection model recognizing the main image of the rice ear, and PMI represents the ear type index.

[0089] S6, cropping the original image according to the position information of the unobstructed and slightly obstructed grains to obtain images of the unobstructed and slightly obstructed grains.

[0090] S7, extracting grain length and grain width from the unobstructed and slightly obstructed grain images, such as Figure 6 As shown, the specific steps are as follows.

[0091] S71 Image processing: For each unobstructed and slightly obstructed grain image, the following steps are performed: load the grain image and convert it to RGB color space, perform threshold segmentation based on the predefined color range, retain the grain part, find the largest target, that is, the outline of the grain, calculate the minimum enclosing rectangle of the outline, and draw it on the original image.

[0092] S72 Grain length and width screening: Calculate the width and height of the minimum circumscribed rectangle of the grain, compare it with the grain width and length range of the test parameter, exclude those that exceed the test parameter range, and the screened grain image is saved in the specified folder.

[0093] S73 Data statistics: For each grain screened out from the main image of the rice ear, the average value of its grain length and grain width is calculated, and the average value is used to represent the grain length and grain width of the rice ear.

[0094] The specific examples described in the application are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific examples described in the present invention, or replace them in a similar manner, but they will not deviate from the spirit of the present invention or exceed the scope defined by the attached claims.

Claims

1. A method for extracting phenotypes from natural rice ears, characterized in that: The following steps are involved: Step 1, after placing a black background plate on a rice plant in a naturally growing state, using a mobile terminal to collect a rice ear image, uploading the rice ear image to a server, and using a deep learning model to pre-process the rice ear image to obtain a rice ear main body image; Step 2, using a grain detection network model to identify the main image of the rice ear, using two sets of parameters for identification respectively; The first set of parameters is used for identification to obtain the grain counting results of all rice ears; The second set of parameters is used for identification to obtain the position information of the grains without occlusion and the grains with slight occlusion; Step 3, processing the main image of the rice ear by combining the Skeletonize algorithm, the Astar path planning algorithm and the endpoint selection strategy suitable for ear length extraction to calculate the ear length; Step 4, identifying the main image of the rice ear, and obtaining the ear type index, i.e., the PMI value, used to characterize the proportion and degree of mutual occlusion between the rice ears and grains. <PMI<1; Step 5, using the PMI value to compensate the rice ear grain counting result to obtain the final number of rice ear grains; Step 6, cropping the original image according to the position information of the unobstructed and slightly obstructed grains to obtain unobstructed and slightly obstructed grain images; Step 7, extracting the grain length and grain width of the unobstructed and slightly obstructed grain images, and recording the average of the grain length and grain width as the grain length and grain width of the rice ear.

2. The method for extracting phenotypes of rice ears in natural form according to claim 1, characterized in that: In step 2, the two groups of parameters are specifically: when the grain detection network model recognizes the main image of the rice ear, the first group of parameters sets the confidence threshold to 0.25 and the intersection-over-union ratio threshold to 0.45; The second set of parameters sets the confidence threshold to 0.7 and the intersection-over-union threshold to 0.

8.

3. The method for extracting phenotypes of rice ears in natural form according to claim 1, characterized in that: In step 2, the position information of the unobstructed and slightly obstructed seeds specifically includes: the center point coordinate information and height and width information of the seed detection frame.

4. The method for extracting phenotypes of rice ears in natural form according to claim 1, characterized in that: In step 3, extracting the spike length comprises the following steps: Image preprocessing: Perform color space conversion, threshold segmentation and morphological operations on the main image of rice ears, use color threshold to extract the region of interest, convert it to HSV space, then extract the S component map, and use Otsu's threshold segmentation and morphological operations to process the image; Hole filling: Fill holes in the image after threshold segmentation, and remove holes with smaller areas by judging the threshold of the hole area; Image skeleton extraction: Use the skeletonization algorithm Skeletonize to extract the skeleton of the image and obtain the refined shape of the rice ear; Endpoint detection: Find the endpoints in the skeleton for path search. By traversing the points in the skeleton, detect the number of adjacent points of each point. If the number is 1, it is considered an endpoint. Endpoint selection strategy and Astar path search: The bottom endpoint is defined as the starting point, and the top 6 endpoints are defined as the end point set. Each pixel in the image is regarded as a node, and the connection between them represents the path. White pixels represent paths, and black pixels represent non-paths. Considering the cost and heuristic function of the path, the node with the smallest total cost in the open list is selected for expansion, and its neighbor nodes are added to the open list, and the cost information is updated. Once the target node is found, the shortest path from the start node to the target node is obtained by backtracking the closed list, that is, the shortest path from the start point to the end point. Perform Astar path search for each end point to obtain the shortest path from the starting point to all end points; Path screening: Screen all the shortest paths and select the path with the largest number of pixels as the final path, which is the main path of the rice ear; Ear length calculation: Calculate the number of pixels in the final path, convert it through the actual size corresponding to the pixels, and get the actual ear length of the rice ear.

5. The method for extracting phenotypes of rice ears in natural form according to claim 1, characterized in that: In step 4, the main image of the rice ear is identified using a spike index regression network model, and the structure of the spike index regression network model is as follows: The spike index regression network includes a feature extraction module and a regression module; The feature extraction module is composed of a DenseNet network and a global average pooling layer. After the image is input, it passes through the feature extraction module to obtain a one-dimensional feature vector; The regression module is composed of a fully connected layer. The feature vector is input into the fully connected layer and finally mapped to the final output space through a Sigmoid activation function to output the spike index.

6. A method for extracting phenotypes from natural rice ears according to claim 5, characterized in that: The construction process of the spike index regression network model in step 4 includes the following steps: Data preparation: using the grain detection network model to identify the main image of the rice ear, obtaining the result of the rice ear grain counting, and by comparing with the true value, obtaining the data of the ear type index of each rice ear image, and forming the ear type index and the main image of the rice ear into a paired data set; Data enhancement: randomly flipping the main image of the rice ear horizontally or vertically to expand the data set; Deep learning training: The training set is input into the spike index regression network model for training, and the parameters in the neural network are updated until the specified number of iterations or the specified accuracy is reached, and then the training is stopped.

7. The method for extracting phenotypes from natural rice ears according to claim 6, characterized in that: In the data preparation stage, the spike index is obtained by calculating the PMI value modeling formula, and the PMI value modeling formula is specifically: in, and They respectively represent the counting results of the grain detection network model during the construction stage of the panicle index regression network model and the true value of the number of grains in the rice panicle.

8. The method for extracting phenotypes from natural rice ears according to claim 7, characterized in that: In step 5, the number of rice ears is calculated using a formula for calculating the number of rice ears. The formula for calculating the number of rice ears is specifically: in, Indicates the final number of rice grains. It represents the result of the grain detection model recognizing the main image of the rice ear, and PMI represents the ear type index.

9. The method for extracting phenotypes from natural rice ears according to claim 1, characterized in that: In step 7, extracting the grain length and width comprises the following steps: Grain image cropping and screening: according to the position information of the unobstructed and slightly obstructed grains, Python is used to crop the unobstructed and slightly obstructed grains from the original image; Image processing: For each unobstructed and slightly obstructed kernel image, the following steps are performed: the kernel image is loaded and converted to RGB color space, threshold segmentation is performed according to the predefined color range, the kernel part is retained, the largest target, i.e., the outline of the kernel, is found for the segmented image, the minimum enclosing rectangle of the outline is calculated, and the outline is drawn on the original image; Grain length and width screening: Calculate the width and height of the minimum circumscribed rectangle of the grain, compare it with the grain width and length range of the test parameter, exclude those that exceed the test parameter range, and the screened grain image is saved in the specified folder; Data statistics: For each grain selected from the main image of the rice ear, the average value of its grain length and grain width is calculated, and the average value is used to represent the grain length and grain width of the rice ear.

Citation Information

Patent Citations

  • Rice ear recognition method, system and device based on deep learning and medium

    CN110796011A

  • Automatic regulation and control system and method for stubble height of ratooning rice and harvester

    CN115868316A

  • Method for providing monitoring data for detecting a movable object, method for detecting a movable object, method for producing at least one predefined point-symmetric region, and vehicle

    WO2022100988A1