Method and device for determining average phenotypic data of seeds and storage medium

Processing wheat seed images through cropping and classification models solves the problem of inability to accurately obtain wheat seed phenotypic data in the existing technology, achieves accurate average seed phenotypic data calculation, and promotes wheat germplasm improvement.

CN118552948APending Publication Date: 2024-08-27INST OF GENETICS & DEVELOPMENTAL BIOLOGY CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410674997.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing technology cannot accurately obtain wheat seed phenotypic data. Traditional methods are time-consuming and labor-intensive with high error rates, and CT imaging costs are high.

Method used

By obtaining the original seed image, cropping it into multiple seed cropped images, and outputting them to the pre-trained classification model, the posture classification and splicing are performed to determine the actual size and average phenotype data of the seeds.

Benefits of technology

It achieves accurate calculation of average phenotypic data of wheat seeds, improves the accuracy of seed image classification, and facilitates subsequent wheat germplasm improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118552948A
    Figure CN118552948A
Patent Text Reader

Abstract

The invention discloses a method and a device for determining average phenotypic data of seeds and a storage medium. The method comprises the following steps: acquiring an original seed image, and cutting the original seed image according to a preset size and a preset pixel overlapping degree to obtain a plurality of seed cut images; for each seed cutting image, outputting the seed cutting image to a pre-trained classification model to obtain a posture classification image, and marking a sub-region occupied by each seed and a seed posture type corresponding to each sub-region in the posture classification image, the seed posture category comprises at least one of a creeping posture, a lateral posture and other postures; splicing the plurality of attitude classification images based on a preset pixel overlapping degree to obtain a target seed image, determining an actual size corresponding to each seed in the target seed image, determining average phenotype data corresponding to the seeds based on the attitude categories and the actual sizes of the seeds, and accurately calculating the wheat average phenotype. And subsequent improvement of wheat germplasm is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image recognition technology, and in particular to a method, device and storage medium for determining average phenotypic data of seeds. Background Art

[0002] Seed phenotype, as one of the important traits in wheat breeding, has received extensive attention and research. In agricultural production, seed phenotype is also an important consideration in variety selection.

[0003] Different varieties of wheat seeds have different phenotypes. Selecting varieties with appropriate seed phenotypes can better adapt to local soil and climate conditions, thereby increasing yields and ensuring healthy crop growth. Currently, wheat seed phenotypes are usually measured using traditional manual methods, which are time-consuming and labor-intensive, with low repeatability and high error rates; or using CT (Computed Tomography) imaging, which is more expensive. Summary of the invention

[0004] The present invention provides a method, device and storage medium for determining average phenotypic data of seeds, so as to solve the problem that the phenotypic data of wheat seeds cannot be accurately obtained.

[0005] According to one aspect of the present invention, a method for determining average phenotypic data of seeds is provided, the method comprising:

[0006] Acquire an original seed image, and crop the original seed image according to a preset size and a preset pixel overlap to obtain a plurality of cropped seed images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on a maximum seed diameter;

[0007] For each seed cropped image, the seed cropped image is output to a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is marked with a sub-region occupied by each seed and a seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture, and other postures;

[0008] Based on the preset pixel overlap, multiple posture classification images are spliced ​​to obtain a target seed image corresponding to the original seed image, the actual size corresponding to each seed in the target seed image is determined, and the average phenotypic data corresponding to the seed is determined based on the seed posture category and the actual size.

[0009] According to another aspect of the present invention, there is provided a device for determining average phenotypic data of seeds, the device comprising:

[0010] An image acquisition module, used for acquiring an original seed image, and cropping the original seed image according to a preset size and a preset pixel overlap to obtain a plurality of cropped seed images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on a maximum seed diameter;

[0011] An image classification module is used for outputting each seed cropped image to a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is marked with a sub-region occupied by each seed and a seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture, and other postures;

[0012] A phenotype determination module is used to splice multiple posture classification images based on the preset pixel overlap to obtain a target seed image corresponding to the original seed image, determine the actual size corresponding to each seed in the target seed image, and determine the average phenotype data corresponding to the seed based on the seed posture category and the actual size.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for determining average phenotypic data of seeds described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining average phenotypic data of seeds described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention is to obtain an original seed image, and then crop the original seed image according to a preset size and a preset pixel overlap to obtain multiple seed cropped images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on the maximum diameter of the seeds; the large-sized original seed image can be cropped and processed to improve the accuracy of subsequent image classification. Then, for each seed cropped image, the seed cropped image is output to a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is annotated with the sub-region occupied by each seed and the seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a creeping posture, a lateral posture, and other postures; the sub-region occupied by each seed in the seed cropped image and the seed posture category corresponding to the sub-region occupied by each seed are accurately annotated. Finally, based on the preset pixel overlap, multiple posture classification images are spliced ​​to obtain a target seed image corresponding to the original seed image, the actual size corresponding to each seed in the target seed image is determined, and the average phenotypic data corresponding to the seed is determined based on the seed posture category and the actual size. The problem of being unable to accurately obtain wheat seed phenotypic data is solved, and the average phenotypic data of wheat is accurately calculated, which is beneficial for subsequent improvement of wheat germplasm.

[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a method for determining average phenotypic data of seeds provided in Embodiment 1 of the present invention;

[0022] Figure 2a is a flow chart of a method for determining average phenotypic data of seeds provided in Embodiment 2 of the present invention;

[0023] Figure 2b is a sample schematic diagram of an original seed image according to an optional example of a method for determining average phenotypic data of seeds provided in Embodiment 2 of the present invention;

[0024] Figure 2c is a sample schematic diagram of seed posture categories according to an optional example of a method for determining average phenotypic data of seeds provided in Embodiment 2 of the present invention;

[0025] Figure 2d is a sample schematic diagram of a posture classification image of an optional example of a method for determining average phenotypic data of a seed provided in Embodiment 2 of the present invention;

[0026] Figure 2e is a sample schematic diagram of an image overlap region according to an optional example of a method for determining average phenotypic data of a seed provided in Embodiment 2 of the present invention;

[0027] Figure 2f is a sample schematic diagram of removing overlapping areas of images according to an optional example of a method for determining average phenotypic data of seeds provided in Embodiment 2 of the present invention;

[0028] Figure 3 is a schematic diagram of the structure of a device for determining average phenotypic data of seeds provided in Embodiment 3 of the present invention;

[0029] Figure 4 4 is a schematic diagram of the structure of an electronic device for implementing the method for determining average phenotypic data according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Embodiment 1

[0033] Figure 1 A flowchart of a method for determining average phenotypic data of seeds is provided for the first embodiment of the present invention. This embodiment is applicable to image recognition. The method can be performed by a device for determining average phenotypic data of seeds. The device for determining average phenotypic data of seeds can be implemented in the form of hardware and / or software. The device for determining average phenotypic data of seeds can be configured in an electronic device. Figure 1 As shown, the method includes:

[0034] S110, obtaining an original seed image, and cropping the original seed image according to a preset size and a preset pixel overlap to obtain a plurality of cropped seed images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on a maximum seed diameter.

[0035] The original seed image can be understood as the seed image to be classified, and the preset pixel overlap can be understood as the overlap ratio between the two cropped images.

[0036] A high-resolution original seed image is captured by a multimedia device, wherein the seeds in the original seed image are randomly scattered in the image, and the original seed image is cropped according to the image overlap rate to obtain a plurality of seed cropped images.

[0037] In the embodiment of the present invention, by cropping a relatively large original seed image, the accuracy of subsequent seed image classification can be improved, thereby avoiding the accuracy of image classification being affected by the relatively large image size.

[0038] S120. For each seed cropped image, the seed cropped image is input into a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is marked with a sub-region occupied by each seed and a seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture, and other postures.

[0039] Specifically, the seeds are input into a pre-trained classification model, and the seeds are segmented by the model to obtain the sub-regions occupied by each seed. The sub-regions occupied by each seed are subjected to posture classification, the seed posture category of each seed is determined, and the seed posture category corresponding to the sub-region occupied by each seed is labeled using a preset labeling method to obtain a posture classification image. The preset labeling method may include: character labeling and color labeling, etc.

[0040] In an embodiment of the present invention, the sub-regions occupied by seeds and the seed posture categories corresponding to the sub-regions occupied by each seed are labeled through a classification model, so that the seed posture corresponding to each seed region can be accurately determined, which facilitates the subsequent accurate determination of the seed phenotypic data based on the different seed postures.

[0041] S130. Based on the preset pixel overlap, multiple posture classification images are spliced ​​to obtain a target seed image corresponding to the original seed image, and the actual size corresponding to each seed in the target seed image is determined. Based on the seed posture category and the actual size, average phenotypic data corresponding to the seed is determined.

[0042] Here, the actual size can be understood as the actual size of the seed.

[0043] Specifically, multiple posture classification images are re-joined based on a preset pixel overlap to obtain a target seed image corresponding to the original seed image and annotated with a sub-region occupied by each seed and a seed posture category corresponding to the sub-region occupied by each seed. The actual size corresponding to the target seed is determined, and the average phenotypic data corresponding to the seed is determined based on different seed posture categories and the actual sizes of different seed posture categories.

[0044] Optionally, after splicing the multiple posture classification images based on the preset pixel overlap to obtain the target seed image corresponding to the original seed image, it also includes: determining the image overlapping area in the posture classification image, and determining the classification accuracy corresponding to each seed in the image overlapping area, and determining the classification confidence corresponding to each seed in the image overlapping area based on the classification accuracy, wherein the classification accuracy is positively correlated with the classification confidence; determining the bounding box corresponding to each seed in the image overlapping area, and determining a first overlap between the bounding boxes; when the first overlap is greater than a first preset threshold, determining the outline of the overlapping seeds, and determining a second overlap between the seeds based on the outline; when the second overlap is greater than a second preset threshold, deduplicating the seeds in the posture classification image according to the classification confidence, and splicing the processed posture classification images to obtain the target seed image corresponding to the original seed image.

[0045] The classification accuracy can be understood as the accuracy of the seed pose classification. The classification confidence can be understood as the credibility of the seed pose classification result. The bounding box can be understood as the rectangular box where the seed is located. The first overlap can be understood as the bounding box overlap. The second overlap can be understood as the seed outline overlap.

[0046] Specifically, the image overlapping area in the posture classification image is determined, and the classification confidence corresponding to each seed can be determined by the classification accuracy of each seed in the area output by the pre-trained classification model. The higher the image classification accuracy, the higher the corresponding classification confidence. Determine the rectangular bounding box corresponding to each seed in the image overlapping area, perform at least one group of similar seeds comparison based on multiple rectangular bounding boxes corresponding to each seed, and determine at least one group of similar seeds with a first overlap between the bounding boxes and a first preset threshold, wherein each group of similar seeds includes two or more seeds. For each group of similar seeds, determine the outer contour of the seed respectively, perform overlap comparison based on the outer contour of the seed, and when the contour overlap is greater than the second preset threshold, only retain the seed with the highest classification confidence, and remove the remaining seeds. The posture classification images after deduplication are spliced ​​to obtain a target seed image corresponding to the original seed image. Among them, the first preset threshold and the second preset threshold can be preset based on experience, and this embodiment does not limit them.

[0047] In an embodiment of the present invention, an overlap comparison is first performed using bounding boxes. When the overlap of the bounding boxes reaches a first preset threshold, an overlap comparison is performed based on the seed outline to avoid deduplication errors caused by a high degree of overlap between the bounding box corresponding to the identified seed and the bounding boxes of other seeds due to the proximity of the seeds, thereby improving the accuracy of overlap recognition and the accuracy of deduplication processing.

[0048] Optionally, the target seed image includes a reference object; determining the actual size corresponding to each seed in the target seed image includes: measuring the seed image size and the reference image size in the target seed image; determining the scale corresponding to the target seed image based on the pre-measured actual size of the reference object and the image size of the reference object in the target seed image; determining the actual size corresponding to each seed based on the seed image size and scale of each seed.

[0049] The seed image size can be understood as the size of the seed in the image. The reference object can be a label pre-placed in the image, such as a circular label or a rectangular label.

[0050] Specifically, the major axis and minor axis of the seed are calculated through the contour, and the contour points of each seed in the target seed image are determined according to the results of seed region segmentation. For the contour points corresponding to each seed, the straight line between the two contour points with the longest distance is determined as the major axis of the seed, and the target contour points on both sides with the longest vertical distance from the major axis are determined. The vertical distances between the contour points on both sides and the major axis are added to obtain the minor axis of the seed. The image dimensions such as the area, circumference and roundness of the seed are measured. The scale of the target seed image can be determined according to the actual size of the reference object measured in advance and the image size of the reference object in the image. The actual size of the seed is calculated according to the scale of the target image and the image size of the seed.

[0051] Optionally, the determining of the average phenotypic data corresponding to the seeds based on the seed posture category and the actual size includes: calculating the average length and average width of the seeds based on the actual size corresponding to the seeds in the crawling posture, and calculating the average thickness of the seeds based on the actual size corresponding to the seeds in the side posture; and determining the average phenotypic data corresponding to the seeds based on the average length, the average width and the average thickness of the seeds.

[0052] Specifically, the actual size of the seeds in the prostrate posture is obtained, and the actual size of the seeds in the prostrate posture is averaged to obtain the average length and average width of the seeds. The actual size corresponding to the seeds in the lateral posture is obtained, and the actual size of the seeds in the lateral posture is averaged to obtain the average thickness of the seeds. The average thickness, average length and average width of the seeds are used as the average phenotypic data corresponding to the seeds.

[0053] The technical solution of the embodiment of the present invention is to obtain an original seed image, and then crop the original seed image according to a preset size and a preset pixel overlap to obtain multiple seed cropped images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on the maximum diameter of the seeds; the large-sized original seed image can be cropped and processed to improve the accuracy of subsequent image classification. Then, for each seed cropped image, the seed cropped image is output to a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is annotated with the sub-region occupied by each seed and the seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a creeping posture, a lateral posture, and other postures; the sub-region occupied by each seed in the seed cropped image and the seed posture category corresponding to the sub-region occupied by each seed are accurately annotated. Finally, based on the preset pixel overlap, multiple posture classification images are spliced ​​to obtain a target seed image corresponding to the original seed image, the actual size corresponding to each seed in the target seed image is determined, and the average phenotypic data corresponding to the seed is determined based on the seed posture category and the actual size. The problem of being unable to accurately obtain wheat seed phenotypic data is solved, and the average phenotypic data of wheat seeds is accurately calculated, which is beneficial for subsequent improvement of wheat germplasm.

[0054] Embodiment 2

[0055] Figure 2a A flow chart of a method for determining average phenotypic data of a seed provided in Embodiment 2 of the present invention, this embodiment is a further refinement of the above embodiment of outputting the cropped seed image to a pre-trained classification model. Optionally, before outputting the cropped seed image to a pre-trained classification model, it also includes: obtaining multiple initial classification models, wherein the initial classification model includes at least a deep residual network, a feature pyramid component, and a target detection framework, and the model training parameters of different initial classification models are different; for each initial classification model, the initial classification model is trained a preset number of times based on a training set to obtain an optimized model, wherein the optimized model is obtained based on an adjustment of a model loss function of the model; and determining a target classification model based on multiple optimized models.

[0056] like Figure 2a As shown, the method includes:

[0057] S210, obtaining an original seed image, and cropping the original seed image according to a preset size and a preset pixel overlap to obtain a plurality of cropped seed images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on a maximum seed diameter.

[0058] Optionally, before training the initial classification model a preset number of times based on the training set, it also includes: obtaining a preset number of sample seed images of different varieties, and randomly cropping the sample seed images according to a preset size to obtain sample cropped images; generating a training set, a validation set and a test set based on the sample cropped images, wherein at least some of the sample seed images corresponding to the training set, the validation set and the test set are different.

[0059] Specifically, obtain a preset number of sample seed images and randomly crop them according to a preset size. Divide the sample cropped images into a training set according to the first preset number, into a validation set according to the second preset number, and into a test set according to the third preset number. Among them, the preset number of varieties, the first preset number, the second preset number, and the third preset number can be preset according to experience, and this embodiment does not limit them. Exemplarily, 150 varieties of wheat seeds are randomly selected, and 3 1024*1024 sample cropped images of each variety are randomly cropped from the large image, totaling 450 images, 400 of which are used as training sets and 50 as validation sets. Then randomly select 100 varieties of sample seed images, which contain the same and different seed varieties in the training set. Randomly crop a 1024*1024 size image from the sample seed image of each variety, and use the cropped 100 sample cropped images as a test set.

[0060] Optionally, after randomly cropping the sample seed image according to a preset size to obtain a sample cropped image, the method further includes: drawing a seed outline and annotating a seed posture category on the sample cropped image based on a polygon annotation tool to obtain the sample cropped image including a sample seed outline and a sample seed posture category.

[0061] Specifically, a polygon tool is used to draw the outline of the sample seed along the seed outline and the seed posture is labeled and classified. For example, the "other", "prostrate" and "lateral" postures are labeled as 0, 1 and 2 respectively. It is worth noting that the labeled seeds are complete seeds in the sample cropped image, and the half seeds on the boundary caused by cropping are not labeled.

[0062] In the embodiment of the present invention, by pre-drawing the outline of the seeds in the sample cropped image and marking and classifying the seed postures, the efficiency and accuracy of subsequent seed classification through the classification model can be improved.

[0063] S220. Acquire multiple initial classification models, wherein the initial classification models at least include a deep residual network, a feature pyramid component, and a target detection framework, and different initial classification models have different model training parameters.

[0064] Specifically, multiple initial classification models trained based on multiple groups of model training parameters are obtained.

[0065] S230. For each initial classification model, train the initial classification model a preset number of times based on the training set to obtain an optimized model, wherein the optimized model is obtained based on adjusting a model loss function of the model.

[0066] Specifically, for each initial classification model, the initial classification model is trained a preset number of times based on the training set, and during the training process, the model is verified based on the verification set to obtain the loss value of the model. The initial classification model is adjusted based on the model loss value to obtain an optimized model with the minimum loss value.

[0067] S240: Determine a target classification model based on the multiple optimization models.

[0068] Specifically, the target classification model is determined based on the corresponding target detection algorithm evaluation indicators of multiple optimization models.

[0069] Optionally, determining the target classification model based on multiple optimization models includes: testing each optimization model according to a test set to obtain the accuracy and recall rate corresponding to each optimization model; determining the target detection algorithm evaluation index corresponding to each optimization model according to the accuracy and recall rate corresponding to each optimization model; and determining the target classification model based on multiple target detection algorithm evaluation indexes.

[0070] Among them, accuracy can be understood as precision. Recall can be understood as recall. The target detection algorithm evaluation index can be understood as average accuracy.

[0071] Specifically, each optimization model is tested according to the test set to obtain the accuracy and recall rate corresponding to each optimization model, and the average accuracy rate corresponding to the optimization model is determined according to the accuracy and recall rate corresponding to each optimization model. The average accuracy rate is used as the target detection algorithm evaluation index corresponding to the optimization model. Based on multiple target detection algorithm evaluation indexes, the optimization model with the highest target detection algorithm evaluation index is used as the target classification model.

[0072] For example, if the training set has 50 sample cropped images, of which 20 sample images are in a crawling posture, the classification model marks 10 of the 50 sample cropped images as crawling postures. Among the 10 sample cropped images marked as crawling postures, only 4 seed postures are marked as correct. Then the accuracy rate is 4 / 10, i.e. 0.4, and the recall rate is 4 / 20, i.e. 0.2.

[0073] S250. For each seed cropped image, output the seed cropped image to a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is marked with a sub-region occupied by each seed and a seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture, and other postures.

[0074] S260, stitching the plurality of posture classification images based on the preset pixel overlap to obtain a target seed image corresponding to the original seed image, determining the actual size corresponding to each seed in the target seed image, and determining average phenotypic data corresponding to the seed based on the seed posture category and the actual size.

[0075] The technical solution of the embodiment of the present invention is to obtain multiple initial classification models, wherein the initial classification models at least include a deep residual network, a feature pyramid component and a target detection framework, and the model training parameters of different initial classification models are different. Then, for each initial classification model, the initial classification model is trained a preset number of times based on the training set to obtain an optimized model, wherein the optimized model is obtained based on the adjustment of the model loss function of the model. To obtain multiple optimization models with the smallest loss value, a target classification model is determined based on the multiple optimization models. To screen out the target accuracy model with the highest average accuracy of seed posture classification, the accuracy of seed posture classification is improved.

[0076] As an optional example of the first embodiment of the present invention, the method for determining the average phenotypic data of seeds in this embodiment specifically includes the following steps:

[0077] Step 1. Seed image acquisition. Figure 2b is a sample schematic diagram of an original seed image according to an optional example of a method for determining average phenotypic data of a seed provided in Embodiment 2 of the present invention; Figure 2b As shown, a high-resolution original seed image taken by a camera is obtained, a circular reference object is placed in the original seed image, and the reference object includes a circular label. The original seed image includes wheat seeds of at least one variety.

[0078] Step 2. Construct a data set. Randomly select 150 varieties of wheat seeds from the first three repeated images corresponding to each seed. Randomly crop three 1024*1024 sample cropped images from the large image for each variety of sample seed images, totaling 450 images. 400 images are used as training sets and 50 images are used as validation sets. Randomly select 100 varieties of sample seed images, which contain the same and different seed varieties in the training set. Randomly crop one 1024*1024 size image from each variety of sample seed images, and use the cropped 100 sample cropped images as the test set.

[0079] Step 3. Image annotation: Based on the polygon annotation tool, the sample cropped image is respectively subjected to seed contour drawing and seed posture category annotation to obtain the sample cropped image including the sample seed contour and the sample seed posture category. The dataset is annotated using the annotation tool. Figure 2c is a sample schematic diagram of seed posture categories according to an optional example of a method for determining average phenotypic data of seeds provided in Embodiment 2 of the present invention; Figure 2c As shown in the figure, the seed posture categories include other postures, crawling postures, and lateral postures. Use the polygon tool to draw the outline along the seed outline and mark and classify the seed postures, marking "other", "crawling", and "lateral" postures as 0, 1, and 2 respectively. Annotate each complete seed in the image, and do not mark the half seeds caused by cropping on the boundary. It is worth noting that the annotated seeds are complete seeds in the sample cropped image, and do not mark the half seeds caused by cropping on the boundary.

[0080] Step 4: Build a classification model. Obtain multiple initial classification models, wherein the initial segmentation classification model at least includes a deep residual network, a feature pyramid component, and an object detection framework, and different initial classification models have different model training parameters.

[0081] Step 5. Determine the target classification model. For each initial classification model, train the initial segmentation classification model a preset number of times based on the training set to obtain an optimized model, wherein the optimized model is obtained based on the adjustment of the model loss function of the model; determine the target classification model based on multiple optimized models.

[0082] Exemplarily, during the training process, the optimal model is selected based on the model with the smallest loss value on the validation set, and the evaluation is completed based on the performance evaluation index target detection algorithm evaluation index of the test set, and the optimized model with the highest target detection algorithm evaluation index on the test set is used as the target classification model.

[0083] Step 6. Image classification. The original seed image is cropped according to a preset size and a preset pixel overlap to obtain a plurality of seed cropped images, and for each seed cropped image, the seed cropped image is output to a pre-trained segmentation classification model to obtain a posture classification image, wherein the posture classification image is annotated with the sub-region occupied by each seed and the seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture, and other postures. Figure 2d is a sample schematic diagram of a posture classification image of an optional example of a method for determining average phenotypic data of a seed provided in Embodiment 2 of the present invention; Figure 2dAs shown, blue: other postures, green: crawling posture; red: lateral posture.

[0084] Step 7. Determine the scale. Measure the seed image size and the reference image size in the target seed image;

[0085] The scale corresponding to the target seed image is determined according to the actual size of the reference object measured in advance and the image size of the reference object in the target seed image.

[0086] Exemplarily, the target seed image is gray-scale transformed and median filtered, and the target seed image is compressed to one tenth of the original image size to speed up the processing. The contours of each object in the target seed image are found according to the binary image and the maximum inter-class variance method, and the size of the circular reference object is determined according to the area size of the target seed image and the roundness parameter corresponding to the circular reference object. The conversion between each pixel and millimeter is obtained according to the diameter of the circular reference object and the number of pixels of the measured circular reference object, that is, the scale corresponding to the target seed image.

[0087] Step 8. Image deduplication. Determine the bounding box corresponding to each seed in the overlapping area of ​​the image, and determine the first overlap between the bounding boxes; when the first overlap is greater than a first preset threshold, determine the outline of the overlapping seeds, and determine the second overlap between the seeds based on the outline; when the second overlap is greater than a second preset threshold, deduplicate the seeds in the posture classification image according to the classification confidence, and splice the processed posture classification images to obtain a target seed image corresponding to the original seed image.

[0088] Figure 2e is a sample schematic diagram of an image overlap area of ​​an optional example of a method for determining average phenotypic data of a seed provided in Embodiment 2 of the present invention; Figure 2e As shown, the complete image is cropped into 1024*1024 sub-images, and there is an overlap area of ​​150 pixels between the two images. Figure 2f is a sample schematic diagram of removing image overlapping areas according to an optional example of a method for determining average phenotypic data of seeds provided in Embodiment 2 of the present invention; Figure 2f As shown, the repeated seeds in the overlapping area of ​​the image are deduplicated to obtain a processed posture classification image.

[0089] Step 9. Phenotypic calculation. Based on the removed target seed image, calculate the major axis and minor axis of the seed through the contour, determine the contour points of each seed in the target seed image according to the result after seed region segmentation, and for each contour point corresponding to the seed, determine the straight line between the two contour points with the longest distance as the major axis of the seed, determine the target contour points on both sides with the longest vertical distance from the major axis, add the vertical distances between the contour points on both sides to the major axis to obtain the minor axis of the seed, and measure the seed image dimensions such as seed area, circumference, and roundness. Determine the actual size corresponding to each seed according to the seed image size and scale of each seed. Calculate the average length and average width of the seeds based on the actual size corresponding to the seeds in the crawling posture, and calculate the average thickness of the seeds based on the actual size corresponding to the seeds in the lateral posture; determine the average phenotypic data corresponding to the seeds based on the average length, average width, and average thickness of the seeds.

[0090] Embodiment 3

[0091] Figure 3 This is a schematic diagram of the structure of a device for determining average phenotypic data of seeds provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: an image acquisition module 310, an image classification module 320 and a phenotype determination module 330.

[0092] Among them, the image acquisition module 310 is used to acquire the original seed image, and crop the original seed image according to a preset size and a preset pixel overlap to obtain multiple seed cropped images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on the maximum diameter of the seeds; the image classification module 320 is used to output each seed cropped image to a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is marked with a sub-area occupied by each seed and a seed posture category corresponding to the sub-area occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture and other postures; the phenotype determination module 330 is used to splice multiple posture classification images based on the preset pixel overlap to obtain a target seed image corresponding to the original seed image, determine the actual size corresponding to each seed in the target seed image, and determine the average phenotypic data corresponding to the seed based on the seed posture category and the actual size.

[0093] The technical solution of the embodiment of the present invention is to obtain the original seed image through the image acquisition module, and to crop the original seed image according to the preset size and preset pixel overlap to obtain multiple seed cropped images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on the maximum diameter of the seeds; the large-size original seed image can be cropped and processed to improve the accuracy of subsequent image classification. Then, for each seed cropped image, the seed cropped image is output to a pre-trained classification model through the image classification module to obtain a posture classification image, wherein the posture classification image is annotated with the sub-region occupied by each seed and the seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a creeping posture, a lateral posture and other postures; the sub-region occupied by each seed in the seed cropped image and the seed posture category corresponding to the sub-region occupied by each seed are accurately annotated. Finally, through the phenotype determination module, multiple posture classification images are spliced ​​based on the preset pixel overlap to obtain a target seed image corresponding to the original seed image, determine the actual size of each seed in the target seed image, and determine the average phenotypic data corresponding to the seed based on the seed posture category and the actual size. The problem of being unable to accurately obtain wheat seed phenotypic data is solved, and the average phenotypic data of wheat is accurately calculated, which is beneficial for subsequent improvement of wheat germplasm.

[0094] Optionally, the device further includes a confidence determination module, a first overlap determination module, a second overlap determination module and a deduplication module, wherein:

[0095] The confidence determination module is used to determine the image overlap area in the posture classification image after splicing the multiple posture classification images based on the preset pixel overlap to obtain a target seed image corresponding to the original seed image, and determine the classification accuracy corresponding to each seed in the image overlap area, and determine the classification confidence corresponding to each seed in the image overlap area based on the classification accuracy, wherein the classification accuracy is positively correlated with the classification confidence;

[0096] The first overlap degree determination module is used to determine the bounding box corresponding to each seed in the image overlapping area, and determine the first overlap degree between the bounding boxes;

[0097] The second overlap degree determination module is used to determine the outline of the overlapping seeds when the first overlap degree is greater than a first preset threshold, and determine the second overlap degree between the seeds based on the outline;

[0098] The deduplication module is used to deduplicate the seeds in the posture classification image according to the classification confidence when the second overlap degree is greater than a second preset threshold, and to splice the processed posture classification images to obtain a target seed image corresponding to the original seed image.

[0099] Optionally, the target seed image includes a reference object; accordingly, the phenotype determination module includes:

[0100] A size measuring unit, used for measuring the size of a seed image and a size of a reference object image in a target seed image;

[0101] A scale determination unit, used to determine the scale corresponding to the target seed image according to the actual size of the reference object measured in advance and the image size of the reference object in the target seed image;

[0102] The actual size determination unit is used to determine the actual size corresponding to each seed according to the seed image size and scale of each seed.

[0103] Optionally, the phenotype determination module comprises:

[0104] An average size determination unit, used to calculate the average length and average width of the seeds based on the actual size corresponding to the seeds in the prostrate posture, and to calculate the average thickness of the seeds based on the actual size corresponding to the seeds in the lateral posture;

[0105] An average phenotypic data determination unit is used to determine the average phenotypic data corresponding to the seeds based on the average length, the average width and the average thickness of the seeds.

[0106] Optionally, the device also includes a model acquisition module, an optimization model determination module and a target classification model determination module.

[0107] The model acquisition module is used to acquire multiple initial classification models before outputting the seed cropped image to a pre-trained classification model, wherein the initial classification model at least includes a deep residual network, a feature pyramid component and an object detection framework, and the model training parameters of different initial classification models are different;

[0108] The optimization model determination module is used to train each initial classification model for a preset number of times based on the training set to obtain an optimization model, wherein the optimization model is obtained based on the adjustment of the model loss function of the model;

[0109] The target classification model determination module is used to determine the target classification model based on the multiple optimization models.

[0110] Optionally, the target classification model determination module includes:

[0111] A testing unit, used to test each of the optimization models according to a test set to obtain the accuracy and recall rate corresponding to each of the optimization models;

[0112] An evaluation index determination unit, used to determine the target detection algorithm evaluation index corresponding to each optimization model according to the accuracy and recall rate corresponding to each optimization model;

[0113] The target classification model determination unit is used to determine the target classification model based on multiple target detection algorithm evaluation indicators.

[0114] Optionally, the device further includes a sample cutting module and a sample set generating module.

[0115] The sample cropping module is used to obtain a preset number of sample seed images of a variety before training the initial classification model for a preset number of times based on the training set, and randomly crop the sample seed images according to a preset size to obtain sample cropped images;

[0116] The sample set generation module is used to generate a training set, a verification set and a test set based on the sample cropped images, wherein at least some of the sample seed images corresponding to the training set, the verification set and the test set are of different varieties.

[0117] Optionally, the device also includes a sample labeling module.

[0118] Among them, the sample annotation module is used to draw the seed outline and annotate the seed posture category of the sample cropped image based on the polygon annotation tool after randomly cropping the sample seed image according to a preset size to obtain the sample cropped image, so as to obtain the sample cropped image including the sample seed outline and the sample seed posture category.

[0119] The device for determining average phenotypic data of seeds provided in the embodiment of the present invention can execute the method for determining average phenotypic data of seeds provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0120] Embodiment 4

[0121] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0122] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0123] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0124] The processor 11 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 performs the various methods and processes described above, such as determining the average phenotypic data of the method seed.

[0125] In some embodiments, the average phenotypic data determination of the method seed can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the average phenotypic data determination of the method seed described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the average phenotypic data determination of the method seed in any other suitable manner (e.g., by means of firmware).

[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0127] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0128] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0129] To provide interaction with a service acquirer, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the service acquirer; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the service acquirer can provide input to the electronic device. Other types of devices may also be used to provide interaction with a service acquirer; for example, the feedback provided to the service acquirer may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the service acquirer may be received in any form (including acoustic input, voice input, or tactile input).

[0130] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a service acquirer computer having a graphical service acquirer interface or a web browser through which the service acquirer can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0131] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0133] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for determining average phenotypic data of seeds, characterized in that: include: Acquire an original seed image, and crop the original seed image according to a preset size and a preset pixel overlap to obtain a plurality of cropped seed images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on a maximum seed diameter; For each seed cropped image, the seed cropped image is input into a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is marked with a sub-region occupied by each seed and a seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture, and other postures; Based on the preset pixel overlap, multiple posture classification images are spliced ​​to obtain a target seed image corresponding to the original seed image, the actual size corresponding to each seed in the target seed image is determined, and the average phenotypic data corresponding to the seed is determined based on the seed posture category and the actual size.

2. The method according to claim 1, characterized in that After splicing the plurality of posture classification images based on the preset pixel overlap to obtain a target seed image corresponding to the original seed image, the method further includes: Determine an image overlap region in the posture classification image, determine a classification accuracy rate corresponding to each seed in the image overlap region, and determine a classification confidence rate corresponding to each seed in the image overlap region based on the classification accuracy rate, wherein the classification accuracy rate is positively correlated with the classification confidence rate; Determine a bounding box corresponding to each seed in the image overlapping area, and determine a first overlap degree between the bounding boxes; In a case where the first degree of overlap is greater than a first preset threshold, determining contours of the overlapping seeds, and determining a second degree of overlap between the seeds based on the contours; When the second overlap degree is greater than a second preset threshold, the seeds in the posture classification image are deduplicated according to the classification confidence, and the processed posture classification images are spliced ​​to obtain a target seed image corresponding to the original seed image.

3. The method according to claim 1, characterized in that: The target seed image includes a reference object; and determining the actual size corresponding to each seed in the target seed image includes: Measuring the seed image size and the reference image size in the target seed image; Determine the scale corresponding to the target seed image according to the actual size of the reference object measured in advance and the image size of the reference object in the target seed image; The actual size of each seed is determined according to the seed image size and scale of each seed.

4. The method according to claim 1, characterized in that: The step of determining average phenotypic data corresponding to the seeds based on the seed posture category and the actual size comprises: The average length and average width of the seeds are calculated based on the actual size of the seeds in the prostrate posture, and the average thickness of the seeds is calculated based on the actual size of the seeds in the lateral posture; The average phenotypic data corresponding to the seeds is determined based on the average length, the average width, and the average thickness of the seeds.

5. The method according to claim 1, characterized in that Before outputting the seed cropped image to the pre-trained classification model, the method further includes: Acquire multiple initial classification models, wherein the initial classification models at least include a deep residual network, a feature pyramid component, and an object detection framework, and different initial classification models have different model training parameters; For each initial classification model, the initial classification model is trained a preset number of times based on the training set to obtain an optimized model, wherein the optimized model is obtained based on adjusting the model loss function of the model; A target classification model is determined based on the multiple optimization models.

6. The method according to claim 5, characterized in that The determining of the target classification model based on the multiple optimization models comprises: Testing each of the optimization models according to the test set to obtain the accuracy and recall rate corresponding to each of the optimization models; Determine the target detection algorithm evaluation index corresponding to each optimization model according to the accuracy and recall rate corresponding to each optimization model; A target classification model is determined based on a plurality of target detection algorithm evaluation indicators.

7. The method according to claim 5, characterized in that: Before training the initial classification model for a preset number of times based on the training set, the method further includes: Obtaining a preset number of sample seed images of a variety, and randomly cropping the sample seed images according to a preset size to obtain sample cropped images; A training set, a validation set and a test set are generated based on the sample cropped images, wherein at least some of the sample seed images corresponding to the training set, the validation set and the test set are of different varieties.

8. The method according to claim 7, characterized in that After randomly cropping the sample seed image according to a preset size to obtain a sample cropped image, the method further includes: Based on a polygon annotation tool, seed contour drawing and seed posture category annotation are performed on the sample cropped image respectively to obtain the sample cropped image including the sample seed contour and the sample seed posture category.

9. A device for determining average phenotypic data of seeds, characterized in that: include: An image acquisition module, used for acquiring an original seed image, and cropping the original seed image according to a preset size and a preset pixel overlap to obtain a plurality of cropped seed images, wherein the original seed image includes at least one variety of wheat seeds, and the preset pixel overlap is determined based on a maximum seed diameter; An image classification module is used for outputting each seed cropped image to a pre-trained classification model to obtain a posture classification image, wherein the posture classification image is marked with a sub-region occupied by each seed and a seed posture category corresponding to the sub-region occupied by each seed, and the seed posture category includes at least one of a crawling posture, a lateral posture, and other postures; A phenotype determination module is used to splice multiple posture classification images based on the preset pixel overlap to obtain a target seed image corresponding to the original seed image, determine the actual size corresponding to each seed in the target seed image, and determine the average phenotype data corresponding to the seed based on the seed posture category and the actual size.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining average phenotypic data of seeds according to any one of claims 1 to 7 when executed.