Corn ear DUS trait identification method, device, equipment and storage medium
By using Deepvit and ASPP neural network models to gradually increase the method of training samples, the problems of the existing corn ears DUS trait judgment method efficiency and accuracy are not high, and the more efficient and more accurate corn ears are judged.
Patent Information
- Application Number
- CN202411526815.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-30
AI Technical Summary
The existing corn ear DUS trait discrimination method has low efficiency and accuracy, the processing workload is large, and it is affected by subjective factors, making it difficult to accurately identify different corn varieties and trait characteristics.
The neural network model based on DeepVit and ASPP is used for training and testing of corn ears image, and the training samples are gradually increased, the image sample set is adjusted, and the training and testing process is repeated until the accuracy requirement requirements are met.
The efficiency and accuracy of corn fruit spike DUS traits have been improved, the sample processing workload is reduced, and the dependence on subjective factors is reduced.
Smart Images

Figure CN119068068B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of crop trait identification, and in particular to a corn ear DUS trait identification method, device, equipment and storage medium. Background Art
[0002] DUS test, namely specificity, consistency and stability test, is an important means to evaluate the specificity of corn varieties. Through DUS test, different corn varieties can be effectively identified and distinguished to ensure that each variety has unique characteristics, thus avoiding variety confusion and market chaos. The specific significance of DUS trait identification is: Protecting variety rights: Through DUS test, the specificity of varieties can be ensured, thereby effectively protecting variety rights and preventing infringement; Promoting agricultural development: Accurate variety identification is helpful for agricultural scientific research and breeding work, and promotes the progress and development of agricultural technology; Ensuring food security: Through stable variety identification, food security and quality control in agricultural production can be ensured.
[0003] The existing methods for distinguishing the DUS trait of corn ears all use manual discrimination, which has the defects of low discrimination efficiency, low accuracy, and being affected by subjective factors. Although the use of some artificial intelligence technologies in related fields can realize the discrimination of crop traits based on image features, the characteristics of many corn varieties (thousands of small varieties) and many types of trait characteristics (the "Guidelines for Testing Plant Variety Specificity, Consistency and Stability Corn" (GB / T 19557.24-2018) proposes 7 types of trait characteristics) lead to the problems of large sample processing workload, long training time, and different recognition effects of the discrimination model for different trait characteristics when distinguishing the DUS trait of corn ears for different corn varieties and different trait characteristics. Therefore, how to improve the efficiency and accuracy of corn ear DUS trait discrimination and reduce the processing workload is a technical problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the present invention is to provide a method, device, equipment and storage medium for distinguishing DUS traits of corn ears, aiming to solve the technical problems of low efficiency and accuracy in distinguishing DUS traits of corn ears and large processing workload.
[0005] To achieve the above object, the present invention provides a method for distinguishing DUS traits of corn ears, comprising the following steps:
[0006] Collect several corn ear images of different corn varieties to construct a corn ear image set;
[0007] Performing data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set;
[0008] Inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and using a corn ear image test set in the corn ear image sample set for testing to obtain training test results;
[0009] According to the training and testing results, the corn ear image sample set is adjusted and the training and testing process is repeated until a trained corn ear DUS trait discrimination model is obtained;
[0010] An image of a corn ear to be identified is collected, the image of the corn ear to be identified is input into the trained corn ear DUS trait discrimination model, and the output of the trained corn ear DUS trait discrimination model is used as the DUS trait discrimination result of the corn ear to be identified.
[0011] Optionally, collecting a plurality of corn ear images of different corn varieties to construct a corn ear image set step specifically includes:
[0012] preparing a number of corn ears of the first batch of corn varieties and a number of corn ears of the second batch of corn varieties;
[0013] Performing group visual inspection on corn ears of each corn variety, and selecting two target corn ears based on the seven trait categories of corn ear DUS trait discrimination; wherein the target corn ears are configured as the two corn ears with the highest proportion of trait characteristic types in any one of the seven trait categories;
[0014] An image shooting environment is built, and the two selected target corn ears are placed in the image shooting environment for image shooting to construct a corn ear image set.
[0015] Optionally, the two selected target corn ears are placed in an image shooting environment for image shooting, and the step of constructing a corn ear image set specifically includes:
[0016] Building an image shooting environment; wherein the image shooting environment includes an image shooting box, a camera arranged in the image shooting box, a light source and background paper;
[0017] One of the two target corn ears of each corn variety is placed directly on the background paper in the image shooting environment without any treatment, and the other of the two target corn ears of each corn variety is threshed for 4-6 rows, and the 9 corn kernels threshed at the middle 1 / 3 of the corn ear are placed together with the threshed corn ear on the background paper in the image shooting environment;
[0018] The standard colorimetric card is placed on a background paper, and an image of two target corn ears on the background paper in an image capturing box is captured by a camera to construct a corn ear image set.
[0019] Optionally, the step of performing data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set specifically includes:
[0020] Based on the seven trait categories of corn ear DUS trait discrimination, a visual inspection method is used to determine and grade the trait feature types of several corn ear images in the corn ear image set, and data annotation is performed on the corn ear image set according to the determination and grading results;
[0021] A corn ear image set is expanded using a customized random data enhancement method to obtain a corn ear image sample set; wherein the random data enhancement method includes at least one of translation and rotation processing, salt and pepper noise addition, Gaussian noise addition, and image brightness and contrast adjustment;
[0022] Among them, the corn ear image sample set includes a corn ear image training set generated by image acquisition, data annotation and data set expansion of corn ears of the first batch of corn varieties, and a corn ear image test set generated by image acquisition, data annotation and data set expansion of corn ears of the second batch of corn varieties.
[0023] Optionally, the step of inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and using a corn ear image test set in the corn ear image sample set for testing to obtain a training test result specifically includes:
[0024] Inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training;
[0025] Wherein, the neural network model based on DeepViT and ASPP includes:
[0026] The ViT module, including a multi-head attention mechanism and a multi-layer perceptron, is configured to extract image features from the corn ear image training set and model the global context;
[0027] The ASPP module includes 4 parallel dilated convolutional layers. The first dilated convolutional layer has a dilation rate of 6, uses a 3*3 convolution kernel, has an output channel of 256, and uses a ReLU activation function. The second layer increases the dilation rate to 12 while keeping other parameters unchanged. The third layer increases the dilation rate to 18. The last layer performs a global average pooling with a dilation rate of 1, which is configured to capture and integrate information of different scales.
[0028] The head module, including convolutional layers, upsampling layers, feature fusion and classification layers, is configured to extract multi-scale semantic information in the output feature map generated by the ASPP module and restore the output feature map to the resolution of the original input image by upsampling using bilinear interpolation;
[0029] Regularization was used to normalize the results of corn ear DUS trait discrimination and grading based on the neural network model of DeepViT and ASPP.
[0030] The currently trained neural network model based on DeepViT and ASPP is tested using the corn ear image test set in the corn ear image sample set to obtain a training test result.
[0031] Optionally, according to the training and testing results, the corn ear image sample set is adjusted and the training and testing process is repeated until a trained corn ear DUS trait discrimination model is obtained, specifically comprising:
[0032] Extract the discrimination accuracy of each of the seven trait categories for corn ear DUS trait discrimination in the training test results, and determine whether the discrimination accuracy of each trait category is higher than the target accuracy;
[0033] If yes, the training of the corn ear DUS trait discrimination model is completed; if no, the two corn ears with the highest proportion of trait characteristic types of the trait category with the lowest discrimination accuracy among the remaining 6 trait categories other than the corresponding trait category of the target corn ear are determined as the newly added target corn ears;
[0034] The two newly added target corn ears are placed in the image shooting environment for image shooting, and a corn ear image set is constructed together with the previously captured corn ear images to obtain the adjusted corn ear image sample set and repeat the training and testing process until the discrimination accuracy of each trait category in the training and testing results is higher than the target accuracy.
[0035] Optionally, the step of collecting an image of a corn ear to be identified, inputting the image of the corn ear to be identified into the trained corn ear DUS trait discrimination model, and using the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be identified specifically includes:
[0036] Putting the corn ear to be identified into an image shooting environment for image shooting, acquiring an image of the corn ear to be identified, and inputting the trained corn ear DUS trait discrimination model;
[0037] The output of the trained corn ear DUS trait discrimination model is used as the DUS trait discrimination result of the corn ear to be discriminated; wherein the DUS trait discrimination result of the corn ear to be discriminated includes discrimination levels corresponding to trait characteristic types of 7 trait categories.
[0038] In addition, in order to achieve the above-mentioned purpose, a corn ear DUS trait discrimination device comprises:
[0039] A construction module, used for collecting a number of corn ear images of different corn varieties to construct a corn ear image set;
[0040] A processing module, used for performing data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set;
[0041] A training module, used for inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and using a corn ear image test set in the corn ear image sample set for testing to obtain training test results;
[0042] An adjustment module, used for adjusting the corn ear image sample set according to the training and testing results and repeating the training and testing process until a trained corn ear DUS trait discrimination model is obtained;
[0043] The discrimination module is used to collect images of corn ears to be discriminated, input the images of corn ears to be discriminated into the trained corn ear DUS trait discrimination model, and use the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be discriminated.
[0044] In addition, in order to achieve the above-mentioned purpose, the present invention also provides a corn ear DUS trait discrimination device, which includes: a memory, a processor, and a corn ear DUS trait discrimination program stored in the memory and executable on the processor, and when the corn ear DUS trait discrimination program is executed by the processor, the steps of the corn ear DUS trait discrimination method as described above are implemented.
[0045] In addition, in order to achieve the above-mentioned purpose, the present invention also provides a storage medium, on which a corn ear DUS trait discrimination program is stored, and when the corn ear DUS trait discrimination program is executed by a processor, the steps of the above-mentioned corn ear DUS trait discrimination method are implemented.
[0046] The beneficial effects of the present invention are as follows: a method, device, equipment and storage medium for distinguishing DUS traits of corn ears are proposed, a plurality of images of corn ears of different corn varieties are collected, a corn ear image set is constructed after data annotation and data set expansion, a corn ear image training set in the corn ear image sample set is input into a pre-constructed neural network model based on DeepViT and ASPP for training, a corn ear image test set in the corn ear image sample set is tested, and then based on the training and test results, ear images of different corn varieties in other trait categories are added to update the corn ear image sample set and the training is repeated The training and testing process is carried out until the training and testing results meet the requirements. The finally trained corn ear DUS trait discrimination model is used to perform discriminant analysis on the image of the corn ear to be discriminated, and the DUS trait discrimination result of the corn ear to be discriminated is obtained. Therefore, by considering the impact of the introduction of corn ear image samples of each trait category on the improvement of the discrimination accuracy of all trait categories, the method of gradually increasing training samples is adopted. Under the premise of ensuring that the discrimination accuracy of each trait category meets the requirements, as few samples as possible are used for processing and training, which can improve the efficiency and accuracy of corn ear DUS trait discrimination and reduce the sample processing workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. 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 paying creative labor.
[0048] Figure 1 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0049] Figure 2The figure is a schematic diagram of the process of an embodiment of the method for distinguishing DUS traits of corn ears of the present invention.
[0050] Figure 3 It is a structural diagram of the neural network model based on DeepViT and ASPP in an embodiment of the present invention.
[0051] Figure 4 It is a structural block diagram of a corn ear DUS trait discrimination device in an embodiment of the present invention.
[0052] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.
[0054] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0055] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0056] Those skilled in the art will understand that Figure 1 The structure of the device shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0057] like Figure 1As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a corn ear DUS trait discrimination program.
[0058] exist Figure 1 In the terminal shown, the network interface 1004 is mainly used to connect to the backend server and perform data communication with the backend server; the user interface 1003 is mainly used to connect to the client (user end) and perform data communication with the client; and the processor 1001 can be used to call the corn ear DUS trait discrimination program stored in the memory 1005, and perform the following operations:
[0059] Collect several corn ear images of different corn varieties to construct a corn ear image set;
[0060] Performing data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set;
[0061] Inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and using a corn ear image test set in the corn ear image sample set for testing to obtain training test results;
[0062] According to the training and testing results, the corn ear image sample set is adjusted and the training and testing process is repeated until a trained corn ear DUS trait discrimination model is obtained;
[0063] An image of a corn ear to be identified is collected, the image of the corn ear to be identified is input into the trained corn ear DUS trait discrimination model, and the output of the trained corn ear DUS trait discrimination model is used as the DUS trait discrimination result of the corn ear to be identified.
[0064] The specific embodiments of the present invention applied to the device are basically the same as the embodiments of the method for distinguishing DUS traits of corn ears described below, and will not be described in detail here.
[0065] The embodiment of the present invention provides a method for distinguishing DUS traits of corn ears, referring to Figure 2 , Figure 2 The figure is a schematic diagram of the process of an embodiment of the method for distinguishing DUS traits of corn ears of the present invention.
[0066] In this embodiment, the corn ear DUS trait discrimination method comprises the following steps:
[0067] S100: collecting a number of corn ear images of different corn varieties to construct a corn ear image set;
[0068] S200: performing data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set;
[0069] S300: inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and using a corn ear image test set in the corn ear image sample set for testing to obtain training test results;
[0070] S400: According to the training and testing results, the corn ear image sample set is adjusted and the training and testing process is repeated until a trained corn ear DUS trait discrimination model is obtained;
[0071] S500: Collecting an image of a corn ear to be identified, inputting the image of the corn ear to be identified into the trained corn ear DUS trait discrimination model, and using the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be identified.
[0072] It should be noted that the existing methods for distinguishing the DUS trait of corn ears all use manual discrimination, which has the defects of low discrimination efficiency, low accuracy, and being affected by subjective factors. Although the use of some artificial intelligence technologies in related fields can realize the discrimination of crop traits based on image features, the characteristics of many corn varieties (thousands of small varieties) and many types of trait characteristics (the "Guidelines for Testing Plant Variety Specificity, Consistency and Stability Corn" (GB / T 19557.24-2018) proposes 7 types of trait characteristics) lead to problems such as large sample processing workload, long training time, and different recognition effects of the discrimination model for different trait characteristics when distinguishing the DUS trait of corn ears of different corn varieties and different trait characteristics. In order to solve the above problems, this embodiment collects several corn ear images of different corn varieties, constructs a corn ear image set after data annotation and data set expansion, inputs the corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and tests the corn ear image test set in the corn ear image sample set. Then, based on the training and test results, the corn ear images of different corn varieties in the remaining trait categories are added to update the corn ear image sample set, and the training and testing process is repeated until the training and test results are satisfactory. In order to meet the requirements, the DUS trait discrimination model of corn ears to be discriminated is used to perform discriminant analysis on the images of corn ears to be discriminated, and the DUS trait discrimination results of corn ears to be discriminated are obtained. Therefore, by considering the impact of the introduction of corn ear image samples of each trait category on the improvement of the discrimination accuracy of all trait categories, the method of gradually increasing training samples is adopted. Under the premise of ensuring that the discrimination accuracy of each trait category meets the requirements, as few samples as possible are used for processing and training, so as to improve the efficiency and accuracy of corn ear DUS trait discrimination and reduce the sample processing workload.
[0073] In a preferred embodiment, the step of collecting a plurality of corn ear images of different corn varieties and constructing a corn ear image set specifically includes:
[0074] S110: preparing a plurality of corn ears of the first batch of corn varieties and a plurality of corn ears of the second batch of corn varieties;
[0075] S120: Visually inspect corn ears of each corn variety, and select two target corn ears based on seven trait categories of corn ear DUS trait discrimination; wherein the target corn ears are configured as the two corn ears with the highest proportion of trait characteristic types of any one of the seven trait categories;
[0076] S130: Building an image shooting environment, placing the selected two target corn ears in the image shooting environment for image shooting, and constructing a corn ear image set.
[0077] Furthermore, the two selected target corn ears are placed in an image shooting environment for image shooting, and the steps of constructing a corn ear image set specifically include:
[0078] S131: Building an image shooting environment; wherein the image shooting environment includes an image shooting box, a camera arranged in the image shooting box, a light source and background paper;
[0079] S132: placing one of the two target corn ears of each corn variety directly on the background paper in the image shooting environment without any processing, threshing 4-6 rows of the other one of the two target corn ears of each corn variety, and placing the 9 corn kernels threshed at the middle 1 / 3 of the corn ear together with the threshed corn ear on the background paper in the image shooting environment;
[0080] S133: placing a standard colorimetric card on a background paper, and using a camera to capture an image of two target corn ears on the background paper in the image capturing box, thereby constructing a corn ear image set.
[0081] In this embodiment, when collecting corn ear images, the following specific execution process is included:
[0082] A total of two batches of corn ear images were collected. All varieties were common corn varieties, and there were no special use varieties. The first batch collected 1,000 corn ear images for model training; the second batch collected 1,151 corn ear images for model testing.
[0083] The image acquisition of ear includes the following steps: 1) Install the image capture device, turn on the power, place the 24-color colorimetric card, and set the shooting parameters; 2) Visually inspect the ear population of the corn variety and select two representative ears (that is, select the two corn ears with the highest proportion of trait characteristics in any of the seven trait categories); 3) The first ear is not processed in any way, and the second ear is threshed for 4 to 6 rows and placed in the shooting box with the exposed cob facing up; 4) Select 9 corn kernels that are representative of the variety from the corn kernels peeled from the middle 1 / 3 of the ear, and place them on a green circular background paper with the back of the kernels facing up; 5) After the corn ears are prepared, they are photographed, and a qualified image is saved for each variety, and labeled.
[0084] Image acquisition parameters: (1) Camera configuration: fixed-focus 35mm lens, aperture value F / 5, exposure time 1 / 100s, ISO-320, exposure compensation 0 step; (2) Light source: color temperature 6500K, color rendering index Ra>85, shooting plane illumination uniformity>95%; (3) Overall background: neutral gray background cloth, seed background: green background paper. It should be noted that when collecting images, the background of the collected images is required to be clear and free of impurities, and the images are finally stored in JPG format.
[0085] In a preferred embodiment, the step of performing data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set specifically includes:
[0086] S210: Based on the seven trait categories of corn ear DUS trait discrimination, a plurality of corn ear images in the corn ear image set are judged and graded for trait feature types by visual inspection, and data annotation is performed on the corn ear image set according to the judgement and grading results;
[0087] S220: using a customized random data enhancement method to expand the data set of the corn ear image set to obtain a corn ear image sample set; wherein the random data enhancement method includes at least one of translation and rotation processing, salt and pepper noise addition, Gaussian noise addition, and image brightness and contrast adjustment;
[0088] Among them, the corn ear image sample set includes a corn ear image training set generated by image acquisition, data annotation and data set expansion of corn ears of the first batch of corn varieties, and a corn ear image test set generated by image acquisition, data annotation and data set expansion of corn ears of the second batch of corn varieties.
[0089] In this embodiment, when performing data annotation, firstly, based on the 7 trait categories of corn ear DUS trait discrimination, a number of corn ear images in the corn ear image set are visually inspected to determine and grade the trait feature types. Specifically, in accordance with the specific requirements of the "Guidelines for Plant Variety Specificity, Consistency and Stability Testing - Corn" (GB / T 19557.24-2018), the corn ear images that have completed image acquisition are visually inspected to obtain the codes of the cob-related traits of each corn variety (see Table 1). "VG" in Table 1 indicates that the test method for this trait in the corn DUS test guide is group visual inspection.
[0090] Table 1 Morphological characteristics of corn ears
[0091] Serial number Trait name Observation site Observation method Serial number Trait name Observation site Observation method 1 Ear: Shape Whole bunch VG 5 For solid color corn only: Primary color on the back of kernel Middle of the ear VG 2 Ear: Color and quantity of kernels Whole bunch VG 6 Kernel: Shape Middle of the ear VG 3 Kernel: Type Middle of the ear VG 7 Cob: Glume anthocyanin color intensity Cob VG 4 For solid color corn only: Primary color at the top of the kernel Middle of the ear VG — — — —
[0092] In this embodiment, when expanding the data set, considering the noise conditions of data acquisition, such as differences in brightness, exposure rate, etc., which may lead to low generalization of the trained model, a customized random data enhancement method is used to expand the data set.
[0093] Specifically, the following operations are performed on the original image data:
[0094] (1) Translation and rotation: Randomly rotate the image along the X-axis, Y-axis, or Z-axis to increase data diversity.
[0095] (2) Salt and pepper noise: Add random salt and pepper noise (impulse noise) to the image.
[0096]
[0097] Salt and pepper noise is black and white light and dark noise generated by image sensors, transmission channels, decoding processing, etc. In the formula, N is the three-channel color value after the pixel is changed. This method can simulate the interference caused by sensor equipment problems and ultimately help improve the robustness of the model.
[0098] (3) Gaussian noise: Add random Gaussian noise to the image.
[0099]
[0100] Among them, Gaussian noise f(x) means that its probability density function obeys Gaussian distribution (i.e. normal distribution, and are two controllable parameters, the curve is symmetric about x = µ, and the amplitude is , Represents a natural constant) and reprocesses each pixel using this rule to obtain a noisy image. This method can simulate the interference of image data under different lighting and environmental conditions and help improve the generalization of the model.
[0101] (4) Adjusting image brightness and contrast: The brightness and contrast of the image were adjusted to simulate the differences in data acquired at different times and lighting conditions, thereby improving the accuracy of the entire method.
[0102] In a preferred embodiment, the corn ear image training set in the corn ear image sample set is input into a pre-built neural network model based on DeepViT and ASPP for training, and the corn ear image test set in the corn ear image sample set is used for testing to obtain the training test result step, which specifically includes:
[0103] S310: inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training;
[0104] Wherein, the neural network model based on DeepViT and ASPP includes:
[0105] The ViT module, including a multi-head attention mechanism and a multi-layer perceptron, is configured to extract image features from the corn ear image training set and model the global context;
[0106] The ASPP module includes 4 parallel dilated convolutional layers. The first dilated convolutional layer has a dilation rate of 6, uses a 3*3 convolution kernel, has an output channel of 256, and uses a ReLU activation function. The second layer increases the dilation rate to 12 while keeping other parameters unchanged. The third layer increases the dilation rate to 18. The last layer performs a global average pooling with a dilation rate of 1, which is configured to capture and integrate information of different scales.
[0107] The head module, including convolutional layers, upsampling layers, feature fusion and classification layers, is configured to extract multi-scale semantic information in the output feature map generated by the ASPP module and restore the output feature map to the resolution of the original input image by upsampling using bilinear interpolation;
[0108] S320: using regularization normalization to normalize the corn ear DUS trait discrimination and grading results based on the neural network model of DeepViT and ASPP;
[0109] S330: Testing the currently trained neural network model based on DeepViT and ASPP using the corn ear image test set in the corn ear image sample set to obtain a training test result.
[0110] In this embodiment, Figure 3As shown in the figure, Vision Transformer is used as the backbone network and encoder to extract image features and model global context. For the input embedding part, the image is divided into a set of non-overlapping image patches. Each image patch is usually a square area of fixed size. Each image patch is flattened into a vector and then converted into a low-dimensional embedding vector through a learnable linear mapping (usually a fully connected layer). After that, it is linearly transformed using a fully connected layer. Next, the embedding vector is combined with the position embedding to form an input sequence. This sequence passes through multiple stacked Transformer encoder layers. Each Transformer encoder layer includes a self-attention mechanism (multi-head attention), a feedforward neural network, and a residual connection. The self-attention mechanism is used to obtain the semantic associations and dependencies between different positions in the input sequence. For the output layer, the output sequence of the last Transformer encoder is usually fed into the output layer for performing specific computer vision tasks. ViT converts image patches into sequence data and then applies Transformer to these sequences. At the same time, through the self-attention mechanism, ViT can capture global context information.
[0111] The ASPP module is the core component of the network. It uses different dilated convolution kernel sizes to capture information at different scales and uses pyramid pooling operations to integrate this information. Typically, the ASPP module includes multiple parallel dilated convolution layers, each with a different dilation rate to increase the receptive field. Specifically, ASPP has four layers. The first layer has a dilation rate of 6, uses a 3*3 convolution kernel, has 256 output channels, and uses ReLU as the activation function; the second layer increases the dilation rate to 12 while keeping other parameters unchanged; the third layer increases it to 18; and the last layer performs a global average pooling with a dilation rate of 1. These layers are executed in parallel, and the output feature maps of each ASPP layer have the same number of channels (256). In addition, the model uses an expansion path based on dilated convolution to restore the output feature map of the ASPP module to the resolution of the original input image. The expansion path uses inverse convolution (deconvolution or transposed convolution) and upsampling operations.
[0112] The head of DeepViT+, the "Head" part, uses a variety of functions and operations to perform segmentation tasks, and consists of convolutional layers, upsampling layers, feature fusion and classification layers. Specifically, this part of the input feature map is the feature map generated from the ASPP module and the expansion path. These feature maps contain multi-scale semantic information, but the resolution is relatively low. In order to reduce the number of channels, a 1×1 convolution layer is usually added. The purpose of this layer is to reduce the dimension of the feature map to reduce computational complexity while maintaining important feature information. After that, a bilinear interpolation method is used to upsample it to restore it to the same resolution as the input image:
[0113]
[0114] Where µ is a fixed value and θ is the weight of different points in bilinear interpolation.
[0115] After that, through the above-mentioned feature learning and fusion, the method can classify and discriminate the DUS traits of the ear. However, the classification training data is greatly affected by human factors, resulting in the intermediate grades being close to each other. The regularization method is used to normalize the classification data, thereby eliminating the inaccurate classification of training and evaluation samples caused by the influence of experience of different evaluators.
[0116] In a preferred embodiment, according to the training and testing results, the corn ear image sample set is adjusted and the training and testing process is repeated until a trained corn ear DUS trait discrimination model is obtained, which specifically includes:
[0117] S410: extracting the discrimination accuracy of each of the seven trait categories for corn ear DUS trait discrimination in the training test results, and determining whether the discrimination accuracy of each trait category is higher than the target accuracy;
[0118] S420: If yes, complete the training of the corn ear DUS trait discrimination model; if no, determine the two corn ears with the highest proportion of trait characteristic types of the trait category with the lowest discrimination accuracy among the remaining 6 trait categories other than the trait category corresponding to the target corn ear as newly added target corn ears;
[0119] S430: The two newly added target corn ears are selected and placed in an image shooting environment for image shooting, and a corn ear image set is constructed together with the corn ear images captured previously, an adjusted corn ear image sample set is obtained, and the training and testing process is repeated until the discrimination accuracy of each trait category in the training test results is higher than the target accuracy.
[0120] In this embodiment, after each training is completed, the corn ear image test set in the corn ear image sample set is tested, and then based on the training test results, the ear images of different corn varieties in the remaining trait categories are added to update the corn ear image sample set and repeat the training and testing process until the training test results meet the requirements (for example, the discrimination accuracy of each trait category reaches more than 90%). As shown in Table 2, the test results of the corn ear DUS trait discrimination model that has been finally trained are shown in Table 2. It can be seen from the table that the corn ear trait automatic grading model based on the DeepVit network has a relatively high overall analysis accuracy on the 7 corn ear DUS traits. The trait with the highest analysis accuracy is the ear trait, which is 99.57%; the trait with the lowest analysis accuracy is the grain trait, which is 90.44%, and the analysis accuracy of the other 5 traits is between the two. The average analysis accuracy of this analysis method on 7 traits reaches 96.28%.
[0121] Table 2 The accuracy of the model in analyzing 7 corn ear traits
[0122] Trait name Ear shape Seed color quantity Kernel type Main color of the top of the seed Main color on the back of the kernel Grain shape Color intensity of anthocyanin in spike glume Mean Accuracy / % 99.57 97.83 95.83 97.11 95.12 90.44 98.09 96.28
[0123] Therefore, by considering the impact of introducing corn ear image samples of each trait category on improving the discrimination accuracy of all trait categories (that is, when introducing newly added corn ear image samples for a certain trait category, it will also provide training features for the discrimination of other trait categories), the method of gradually increasing training samples is adopted. Under the premise of ensuring that the discrimination accuracy of each trait category meets the requirements, as few samples as possible are used for processing and training, thereby improving the efficiency and accuracy of corn ear DUS trait discrimination and reducing the sample processing workload.
[0124] In a preferred embodiment, the steps of collecting an image of a corn ear to be identified, inputting the image of the corn ear to be identified into the trained corn ear DUS trait discrimination model, and using the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be identified specifically include:
[0125] S410: placing a corn ear to be identified in an image capturing environment for image capturing, acquiring an image of the corn ear to be identified, and inputting the trained corn ear DUS trait discrimination model;
[0126] S420: Using the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be discriminated; wherein the DUS trait discrimination result of the corn ear to be discriminated includes discrimination levels corresponding to trait characteristic types of 7 trait categories.
[0127] In this embodiment, the corn ear DUS trait discrimination model that has been finally trained is used to perform discriminant analysis on the image of the corn ear to be discriminated, so as to obtain the DUS trait discrimination result of the corn ear to be discriminated.
[0128] In addition, in order to achieve the above-mentioned purpose, a corn ear DUS trait discrimination device comprises:
[0129] Reference Figure 4 , Figure 4 It is a structural block diagram of an embodiment of a device for distinguishing DUS traits of corn ears according to the present invention.
[0130] like Figure 4 As shown, the corn ear DUS trait discrimination device proposed in the embodiment of the present invention includes:
[0131] A construction module 10 is used to collect a number of corn ear images of different corn varieties to construct a corn ear image set;
[0132] A processing module 20 is used to perform data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set;
[0133] A training module 30 is used to input the corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and to use the corn ear image test set in the corn ear image sample set for testing to obtain training test results;
[0134] An adjustment module 40, for adjusting the corn ear image sample set according to the training and testing results and repeating the training and testing process until a trained corn ear DUS trait discrimination model is obtained;
[0135] The discrimination module 50 is used to collect images of corn ears to be discriminated, input the images of corn ears to be discriminated into the trained corn ear DUS trait discrimination model, and use the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be discriminated.
[0136] Other embodiments or specific implementations of the corn ear DUS trait discrimination device of the present invention can refer to the above-mentioned method embodiments and will not be repeated here.
[0137] In addition, the present invention also proposes a corn ear DUS trait discrimination device, which includes: a memory, a processor, and a corn ear DUS trait discrimination program stored in the memory and executable on the processor, and when the corn ear DUS trait discrimination program is executed by the processor, the steps of the corn ear DUS trait discrimination method as described above are implemented.
[0138] The specific implementation of the corn ear DUS trait discrimination device of the present application is basically the same as the various embodiments of the above-mentioned corn ear DUS trait discrimination method, and will not be repeated here.
[0139] In addition, the present invention also provides a readable storage medium, which includes a computer-readable storage medium on which a corn ear DUS trait discrimination program is stored. The readable storage medium may be Figure 1 The memory 1005 in the terminal may also be at least one of a ROM (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, and an optical disk. The readable storage medium includes a number of instructions for enabling a corn ear DUS trait discrimination device having a processor to execute the corn ear DUS trait discrimination method described in each embodiment of the present invention.
[0140] The specific implementation in the readable storage medium of the present application is basically the same as the various embodiments of the above-mentioned corn ear DUS trait discrimination method, and will not be repeated here.
[0141] It is understood that, in the description of this specification, the description with reference to the terms "one embodiment", "another embodiment", "other embodiments", or "first to Nth embodiments" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0142] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0143] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0144] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0145] Finally, it should be noted that the above embodiments are only used to illustrate rather than limit the technical solutions of the present invention. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that the present invention can still be modified or replaced by equivalents. Any modification or partial replacement that does not depart from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A method for distinguishing DUS traits of corn ears, characterized in that: The following steps are involved: Collect several corn ear images of different corn varieties to construct a corn ear image set; Data annotation and data set expansion are performed on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set, specifically including: Based on the seven trait categories of corn ear DUS trait discrimination, a visual inspection method is used to determine and grade the trait feature types of several corn ear images in the corn ear image set, and data annotation is performed on the corn ear image set according to the determination and grading results; A corn ear image set is expanded using a customized random data enhancement method to obtain a corn ear image sample set; wherein the random data enhancement method includes at least one of translation and rotation processing, salt and pepper noise addition, Gaussian noise addition, and image brightness and contrast adjustment; The corn ear image sample set includes a corn ear image training set generated by corn ears of a first batch of corn varieties after image collection, data annotation and data set expansion, and a corn ear image test set generated by corn ears of a second batch of corn varieties after image collection, data annotation and data set expansion; Inputting the corn ear image training set in the corn ear image sample set into the pre-built neural network model based on DeepViT and ASPP for training, and using the corn ear image test set in the corn ear image sample set for testing, to obtain training test results, specifically including: Inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training; Wherein, the neural network model based on DeepViT and ASPP includes: The ViT module, including the multi-head attention mechanism and the multi-layer perception mechanism, is configured to extract image features from the corn ear image training set and model the global context; The ASPP module includes 4 parallel dilated convolutional layers. The first dilated convolutional layer has a dilation rate of 6, uses a 3*3 convolution kernel, has an output channel of 256, and uses a ReLU activation function. The second layer increases the dilation rate to 12 while keeping other parameters unchanged. The third layer increases the dilation rate to 18. The last layer performs a global average pooling with a dilation rate of 1, which is configured to capture and integrate information of different scales. The head module, including convolutional layers, upsampling layers, feature fusion and classification layers, is configured to extract multi-scale semantic information in the output feature map generated by the ASPP module and restore the output feature map to the resolution of the original input image by upsampling using bilinear interpolation; Regularization was used to normalize the results of corn ear DUS trait discrimination and grading based on the neural network model of DeepViT and ASPP. Using the corn ear image test set in the corn ear image sample set to test the currently trained neural network model based on DeepViT and ASPP, to obtain a training test result; According to the training and testing results, the corn ear image sample set is adjusted and the training and testing process is repeated until a trained corn ear DUS trait discrimination model is obtained, which specifically includes: Extract the discrimination accuracy of each of the seven trait categories for corn ear DUS trait discrimination in the training test results, and determine whether the discrimination accuracy of each trait category is higher than the target accuracy; If yes, the training of the corn ear DUS trait discrimination model is completed; if no, the two corn ears with the highest proportion of trait characteristic types of the trait category with the lowest discrimination accuracy among the remaining 6 trait categories other than the corresponding trait category of the target corn ear are determined as the newly added target corn ears; The two newly added target corn ears are placed in the image shooting environment for image shooting, and the corn ear image set is constructed together with the previously captured corn ear images to obtain the adjusted corn ear image sample set and repeat the training and testing process until the discrimination accuracy of each trait category in the training test results is higher than the target accuracy An image of a corn ear to be identified is collected, the image of the corn ear to be identified is input into the trained corn ear DUS trait discrimination model, and the output of the trained corn ear DUS trait discrimination model is used as the DUS trait discrimination result of the corn ear to be identified.
2. The method for distinguishing corn ear DUS traits according to claim 1, characterized in that: The steps of collecting several corn ear images of different corn varieties and constructing a corn ear image set include: preparing a number of corn ears of the first batch of corn varieties and a number of corn ears of the second batch of corn varieties; Performing group visual inspection on corn ears of each corn variety, and selecting two target corn ears based on the seven trait categories of corn ear DUS trait discrimination; wherein the target corn ears are configured as the two corn ears with the highest proportion of trait characteristic types in any one of the seven trait categories; An image shooting environment is built, and the two selected target corn ears are placed in the image shooting environment for image shooting to construct a corn ear image set.
3. The method for distinguishing corn ear DUS traits as claimed in claim 2, characterized in that: The steps of placing the two selected target corn ears into an image shooting environment for image shooting and constructing a corn ear image set specifically include: Building an image shooting environment; wherein the image shooting environment includes an image shooting box, a camera arranged in the image shooting box, a light source and background paper; One of the two target corn ears of each corn variety is placed directly on the background paper in the image shooting environment without any treatment, and the other of the two target corn ears of each corn variety is threshed for 4-6 rows, and the 9 corn kernels threshed at the middle 1 / 3 of the corn ear are placed together with the threshed corn ear on the background paper in the image shooting environment; The standard colorimetric card is placed on a background paper, and an image of two target corn ears on the background paper in an image capturing box is captured by a camera to construct a corn ear image set.
4. The method for distinguishing corn ear DUS traits as claimed in claim 3, characterized in that: The steps of collecting an image of a corn ear to be identified, inputting the image of the corn ear to be identified into the trained corn ear DUS trait discrimination model, and using the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be identified specifically include: Putting the corn ear to be identified into an image shooting environment for image shooting, acquiring an image of the corn ear to be identified, and inputting the trained corn ear DUS trait discrimination model; The output of the trained corn ear DUS trait discrimination model is used as the DUS trait discrimination result of the corn ear to be discriminated; wherein the DUS trait discrimination result of the corn ear to be discriminated includes discrimination levels corresponding to trait characteristic types of 7 trait categories.
5. A corn ear DUS trait identification device, characterized in that: include: A construction module, used for collecting a number of corn ear images of different corn varieties to construct a corn ear image set; A processing module is used to perform data annotation and data set expansion on a plurality of corn ear images in the corn ear image set to obtain a corn ear image sample set, specifically comprising: Based on the seven trait categories of corn ear DUS trait discrimination, a visual inspection method is used to determine and grade the trait feature types of several corn ear images in the corn ear image set, and data annotation is performed on the corn ear image set according to the determination and grading results; A corn ear image set is expanded using a customized random data enhancement method to obtain a corn ear image sample set; wherein the random data enhancement method includes at least one of translation and rotation processing, salt and pepper noise addition, Gaussian noise addition, and image brightness and contrast adjustment; The corn ear image sample set includes a corn ear image training set generated by corn ears of a first batch of corn varieties after image collection, data annotation and data set expansion, and a corn ear image test set generated by corn ears of a second batch of corn varieties after image collection, data annotation and data set expansion; A training module is used to input the corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training, and to use the corn ear image test set in the corn ear image sample set for testing to obtain training test results, specifically including: Inputting a corn ear image training set in the corn ear image sample set into a pre-built neural network model based on DeepViT and ASPP for training; Wherein, the neural network model based on DeepViT and ASPP includes: The ViT module, including the multi-head attention mechanism and the multi-layer perception mechanism, is configured to extract image features from the corn ear image training set and model the global context; The ASPP module includes 4 parallel dilated convolutional layers. The first dilated convolutional layer has a dilation rate of 6, uses a 3*3 convolution kernel, has an output channel of 256, and uses a ReLU activation function. The second layer increases the dilation rate to 12 while keeping other parameters unchanged. The third layer increases the dilation rate to 18. The last layer performs a global average pooling with a dilation rate of 1, which is configured to capture and integrate information of different scales. The head module, including convolutional layers, upsampling layers, feature fusion and classification layers, is configured to extract multi-scale semantic information in the output feature map generated by the ASPP module and restore the output feature map to the resolution of the original input image by upsampling using bilinear interpolation; Regularization was used to normalize the results of corn ear DUS trait discrimination and grading based on the neural network model of DeepViT and ASPP. Using the corn ear image test set in the corn ear image sample set to test the currently trained neural network model based on DeepViT and ASPP, to obtain a training test result; The adjustment module is used to adjust the corn ear image sample set according to the training and testing results and repeat the training and testing process until a trained corn ear DUS trait discrimination model is obtained, specifically including: Extract the discrimination accuracy of each of the seven trait categories for corn ear DUS trait discrimination in the training test results, and determine whether the discrimination accuracy of each trait category is higher than the target accuracy; If yes, the training of the corn ear DUS trait discrimination model is completed; if no, the two corn ears with the highest proportion of trait characteristic types of the trait category with the lowest discrimination accuracy among the remaining 6 trait categories other than the corresponding trait category of the target corn ear are determined as the newly added target corn ears; The two newly added target corn ears are placed in the image shooting environment for image shooting, and the corn ear image set is constructed together with the previously captured corn ear images to obtain the adjusted corn ear image sample set and repeat the training and testing process until the discrimination accuracy of each trait category in the training test results is higher than the target accuracy The discrimination module is used to collect images of corn ears to be discriminated, input the images of corn ears to be discriminated into the trained corn ear DUS trait discrimination model, and use the output of the trained corn ear DUS trait discrimination model as the DUS trait discrimination result of the corn ear to be discriminated.
6. A corn ear DUS trait identification device, characterized in that: The corn ear DUS trait identification device includes: a memory, a processor, and a corn ear DUS trait identification program stored in the memory and executable on the processor. When the corn ear DUS trait identification program is executed by the processor, the steps of the corn ear DUS trait identification method as described in any one of claims 1 to 4 are implemented.
7. A storage medium, characterized in that: The storage medium stores a corn ear DUS trait discrimination program, which, when executed by a processor, implements the steps of a corn ear DUS trait discrimination method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Convolutional-neural-network-based primary classification method for ear image of corn seed production
CN108549910A
CBAM-HRNet model wheat ear grain segmentation and counting method based on convolution attention mechanism
CN116703932A