Corn seed activity spectrum deep learning detection method based on sequence-to-sequence
By combining hyperspectral imaging data with multi-head attention sequence to sequence network model, the model hyperparameters are optimized, and the problem of excessive training time in corn seed vitality detection is solved, fast, efficient and non-destructive detection is achieved, and detection efficiency is improved. accuracy.
Patent Information
- Application Number
- CN202411510605.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-01-10
AI Technical Summary
The existing corn seed vitality detection methods are complex in operation, time-consuming and cannot achieve rapid non-destructive testing, and the training time of deep learning models limits its application.
Using a sequence-to-sequence-based deep learning detection method for corn seed vitality spectroscopy, combining hyperspectral imaging data with multi-head attention sequence-to-sequence network model, the model hyperparameters are optimized through a subspace discriminant learner to generate fast, efficient and lossless corn seeds Vitality detection network.
It effectively solves the problem of too long training time, realizes fast, efficient and lossless corn seed vitality detection, and improves the accuracy and efficiency of the detection.
Smart Images

Figure CN119295945A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence vitality detection of grain crop seeds, and in particular to a sequence-to-sequence based deep learning detection method for corn seed vitality spectrum. Background Art
[0002] As one of the three major staple foods in the world, corn occupies a pivotal position in food production and human food supply. As the starting point of crop production, the vitality level of seeds largely determines the final yield performance. Currently, the commonly used methods for detecting corn seed vitality include tetrazolium salt staining, conductivity testing, and germination tests. Although these methods have a high accuracy rate in detecting corn seed vitality, there are also some problems, such as complex operation, long time consumption, and destructive testing, which make these methods unable to achieve rapid and non-destructive testing.
[0003] Hyperspectral imaging can obtain the spectral information of the surface and interior of seeds without destroying them. As aflatoxin has ultraviolet fluorescence characteristics, hyperspectral imaging technology has been successfully applied to the detection of aflatoxin.
[0004] Deep learning has powerful automatic feature extraction and nonlinear modeling capabilities. However, deep learning models also have some limitations. Among them, the long training time has become a key obstacle restricting the application of deep learning models in the rapid detection of corn seed vitality. Therefore, how to achieve fast, efficient and non-destructive corn seed vitality detection has become a hot topic in current research. In particular, the rapid optimization of the detection model has important practical significance for the realization of online detection, which is expected to improve the utilization efficiency of germplasm resources and promote the development of intelligent detection technology.
[0005] In view of this, we propose a sequence-to-sequence deep learning detection method for corn seed vitality spectra to solve the existing problems. Summary of the invention
[0006] The object of the present invention is to provide a sequence-to-sequence based deep learning detection method for corn seed vitality spectrum to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solution: a sequence-to-sequence based corn seed vitality spectrum deep learning detection method, comprising:
[0008] S1: Obtain hyperspectral data of the embryo surface of corn seeds;
[0009] S2: Using the hyperspectral data obtained in S1, obtain the binary image of the corn kernels and calculate the average spectrum of the embryo surface of each corn kernel;
[0010] S3: In an incubator at 25°C, the germination parameters of each seed were recorded by germinating between papers;
[0011] S4: Substitute the parameter index of germination of each seed measured in S3 into the evaluation formula of corn seed vitality index to calculate the vitality index value of each corn seed;
[0012] S5: Calculate the vitality index value of the seeds according to S4 and divide it into thresholds of strong vitality and weak vitality, and calibrate the spectrum category of each corn seed according to the average spectrum obtained by S2;
[0013] S6: The average spectrum obtained in S2 is imported into the multi-head attention sequence into the sequence network model. After optimization and iteration, the network model generates a reconstructed spectrum based on the original spectrum features.
[0014] S7: The network model obtained in S6 activates the spectral features of different depth layers, imports the spectral depth features into the subspace discriminant model, optimizes the iterative model hyperparameters, solidifies the network model hyperparameters with the highest accuracy, and outputs the final corn seed vitality detection network model.
[0015] Furthermore, the specific steps of S6 include:
[0016] S6-1: Establish a sequence-to-sequence convolutional channel model with a fixed number of layers;
[0017] S6-2: Keep the basic network architecture established in S6-1 unchanged, and set the initial values of the four hyperparameters: number of iterations, learning function, optimized learner, and activation function;
[0018] S6-3: Keep the network architecture obtained in S6-2 and set the evaluation index of the regression prediction layer to mean square error.
[0019] Furthermore, the specific steps of S7 include:
[0020] S7-1: Transfer the optimized sequence-to-sequence convolutional channel model to activate the spectral features of different depth concatenated layers within the model;
[0021] S7-2: Set the subspace discriminant learner to ensemble learning, import different depth features of the spectrum into ensemble learning, and set the number of subspace discriminant models;
[0022] S7-3: Keep the model framework obtained in S7-2 unchanged, set the number of optimization iterations, and output the final corn seed vitality detection model.
[0023] Furthermore, the first N-1 layers of the sequence-to-sequence convolutional channel model described in S6-1 are the encoder part containing a multi-head attention mechanism, a feature information fusion layer is set at the Nth layer, and the next N+1 layers to the last layer are the decoder part of the multi-head attention mechanism, a one-dimensional transposed convolution layer and a regression prediction layer respectively.
[0024] Furthermore, in S2, based on the hyperspectral data obtained in S1, the K-Means clustering algorithm is used to segment the embryo surface of the corn kernel from the background to obtain a binary image of the corn kernel.
[0025] Furthermore, the parameter index described in S3 or S4 includes the germination potential of corn kernels on the second day after germination and parameter information of germinated corn seeds on the seventh day after germination.
[0026] Furthermore, the germination potential corresponds to three states, namely, no germination, broken fruit seed coat, and broken coleoptile.
[0027] Furthermore, the parameter information includes seedling length, seedling weight, taproot length, and taproot weight.
[0028] Furthermore, if the corn seeds did not germinate, the germination potential was set to 0; if the seed coat was broken, the germination potential was set to 0.5; if the coleoptile was broken, the germination potential was set to 1.
[0029] Furthermore, the parameter information is normalized and processed.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] The present invention combines hyperspectral imaging data with a multi-head attention sequence-to-sequence network model to activate spectral deep features, and generates a corn seed vitality detection network by adjusting the hyperparameters of the subspace discriminant learner and training the network accuracy, which effectively solves the problem of long training time, breaks the constraints and limitations of deep learning on corn seed vitality detection, and realizes fast, efficient and non-destructive corn seed vitality detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The flowchart of the sequence-to-sequence based corn seed vitality spectrum deep learning detection method of the present invention is as follows;
[0033] Figure 2 It is a specific implementation diagram of the multi-head attention sequence-to-sequence network model of the present invention;
[0034] Figure 3 The detection performance specifically implemented by the subspace discrimination model based on different depth spectral features of the present invention;
[0035] Figure 4It is the detection performance specifically implemented by the subspace discrimination model based on the deep series layer 4 of the present invention. DETAILED DESCRIPTION
[0036] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0037] Embodiment 1
[0038] like Figure 1 , Figure 2 , Figure 3 and Figure 4 As shown, the corn seed vitality spectrum deep learning detection method based on sequence to sequence includes:
[0039] S1: Obtain hyperspectral data of the embryo surface of corn seeds;
[0040] S2: Using the hyperspectral data obtained in S1, the K-Means clustering algorithm is used to segment the embryo surface of the corn kernel from the background to obtain a binary image of the corn kernel, and the average spectrum of the embryo surface of each corn kernel is calculated;
[0041] S3: In an incubator at 25°C, using the paper germination method, the germination potential of corn kernels on the second day after germination was recorded. The germination potential corresponds to three states: no germination, seed coat rupture, and coleoptile rupture. The parameter information of the germinated corn seeds was measured on the seventh day after germination, including seedling length, seedling weight, taproot length, and taproot weight.
[0042] S4: Substitute the parameter index of each seed germination measured by S3 into the corn seed vitality index evaluation formula, the formula is: SVI = 0.6 × GP + 0.1 × (PRL + PRW + SL + SW); wherein SVI is the vitality index value of corn seeds, GP is the germination potential of corn seeds on the second day after germination, PRL is the taproot length of the germinated seeds on the seventh day after germination, PRW is the taproot weight of the germinated seeds on the seventh day after germination, SL is the seedling length of the germinated seeds on the seventh day after germination, and SW is the seedling weight of the germinated seeds on the seventh day after germination; if the corn seeds do not germinate, set GP to 0; if the seed coat is broken, set GP to 0.5; if the coleoptile is broken, set GP to 1; PRL, PRW, SL, and SW are normalized to standard processing;
[0043] S5: According to S4, the vitality index value of the seeds is calculated and divided into thresholds of strong vitality and weak vitality, and the index value of the strong vitality of corn seeds is set to be greater than or equal to 0.7, and the index value of the weak vitality of corn seeds is set to be less than or equal to 0.2. The spectrum category of each corn seed is calibrated according to the average spectrum obtained in S2;
[0044] S6: The average spectrum obtained in S2 is imported into the multi-head attention sequence into the sequence network model. After optimization and iteration, the network model generates a reconstructed spectrum based on the original spectrum features.
[0045] S7: The network model obtained in S6 activates the spectral features of different depth layers, imports the spectral depth features into the subspace discriminant model, optimizes the iterative model hyperparameters, solidifies the network model hyperparameters with the highest accuracy, and outputs the final corn seed vitality detection network model.
[0046] The specific steps of S6 include:
[0047] S6-1: Establish a sequence-to-sequence convolutional channel model with a fixed number of layers: the first 6 layers are the encoder part with a multi-head attention mechanism, and a feature information fusion layer is set in the 7th layer. The next 6 layers to the last layer are the decoder part of the multi-head attention mechanism, a one-dimensional transposed convolution layer, and a regression prediction layer. In the encoder part, the model contains two layers of one-dimensional convolution for downsampling spectral features. The kernel size of the first convolution layer is 7, the step size is 2, and the number of convolution kernels is 256. The kernel size of the second convolution layer is 7, the step size is 2, and the number of convolution kernels is 128. Each convolution layer is followed by a ReLU activation function to introduce nonlinearity, and Dropout (0.1) is used to prevent overfitting. In order to enhance the global dependence of the model on the feature sequence, In order to improve the ability to capture dependent relationships, a multi-head attention mechanism is introduced; the attention mechanism contains 4 heads, each with 256 keys and query channels; the summary layer fuses the information from the convolution layer and the multi-head attention layer and passes it to the next layer of the network; the structure of the decoder is similar to that of the encoder, and its main task is to reconstruct the downsampled features; the decoder uses transposed convolution for upsampling operations; the number of convolution kernels in the first layer of transposed convolution is 64, and the second layer is 128. The convolution kernel size of these two layers is 7, and the step size is 2; the last second layer of transposed convolution aims to reconstruct a spectral sequence with the same length as the original spectral sequence. This layer only contains 1 convolution kernel of size 7 and step size 1; the last layer uses a regression layer to predict the reflectance value at each spectral wavelength;
[0048] S6-2: Keep the basic network architecture established in S6-1 unchanged, set the initial values of the four hyperparameters: number of iterations to 500, learning rate to 0.0001, optimization learner to Adam, and activation function to ReLU;
[0049] S6-3: Keep the network architecture obtained in S6-2 and set the evaluation index of the regression prediction layer to mean square error.
[0050] The specific steps of S7 include:
[0051] S7-1: Migrate the optimized sequence-to-sequence convolutional channel model and activate the spectral features of the deep cascade layer 1, deep cascade layer 2, deep cascade layer 3, deep cascade layer 4 and merged deep cascade layer in the model;
[0052] S7-2: Set the subspace discriminant learner to ensemble learning, import different depth features of the spectrum into ensemble learning, and set the number of subspace discriminant models to 30;
[0053] S7-3: Keep the model framework obtained in S7-2 unchanged, set the number of optimization iterations to 100, and output the final corn seed vitality detection model.
[0054] Among them, the accuracy rates corresponding to deep tandem layer 1, deep tandem layer 2, deep tandem layer 3, deep tandem layer 4 and the merged deep tandem layer are compared, and the accuracy rate corresponding to deep tandem layer 4 is relatively the highest. The precision, recall rate and F1 score of strong vitality and weak vitality corresponding to deep tandem layer 4 are calculated.
[0055] The above-mentioned specific embodiments are only several preferred embodiments of the present invention. Based on the technical solutions of the present invention and the relevant inspirations of the above-mentioned embodiments, those skilled in the art can make various alternative improvements and combinations to the above-mentioned specific embodiments.
Claims
1. A sequence-to-sequence based deep learning detection method for corn seed vitality spectrum, characterized in that: include: S1: Obtain hyperspectral data of the embryo surface of corn seeds; S2: Using the hyperspectral data obtained in S1, obtain the binary image of the corn kernels and calculate the average spectrum of the embryo surface of each corn kernel; S3: In an incubator at 25°C, the germination parameters of each seed were recorded by germinating between papers; S4: Substitute the parameter index of germination of each seed measured in S3 into the evaluation formula of corn seed vitality index to calculate the vitality index value of each corn seed; S5: Calculate the vitality index value of the seeds according to S4 and divide it into thresholds of strong vitality and weak vitality, and calibrate the spectrum category of each corn seed according to the average spectrum obtained by S2; S6: The average spectrum obtained in S2 is imported into the multi-head attention sequence into the sequence network model. After optimization and iteration, the network model generates a reconstructed spectrum based on the original spectrum features. S7: The network model obtained in S6 activates the spectral features of different depth layers, imports the spectral depth features into the subspace discriminant model, optimizes the iterative model hyperparameters, solidifies the network model hyperparameters with the highest accuracy, and outputs the final corn seed vitality detection network model.
2. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 1, characterized in that: The specific steps of S6 include: S6-1: Establish a sequence-to-sequence convolutional channel model with a fixed number of layers; S6-2: Keep the basic network architecture established in S6-1 unchanged, and set the initial values of the four hyperparameters: number of iterations, learning function, optimized learner, and activation function; S6-3: Keep the network architecture obtained in S6-2 and set the evaluation index of the regression prediction layer to mean square error.
3. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 1, characterized in that: The specific steps of S7 include: S7-1: Transfer the optimized sequence-to-sequence convolutional channel model to activate the spectral features of different depth concatenated layers within the model; S7-2: Set the subspace discriminant learner to ensemble learning, import different depth features of the spectrum into ensemble learning, and set the number of subspace discriminant models; S7-3: Keep the model framework obtained in S7-2 unchanged, set the number of optimization iterations, and output the final corn seed vitality detection model.
4. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 2, characterized in that: The first N-1 layers of the sequence-to-sequence convolutional channel model described in S6-1 are the encoder part containing a multi-head attention mechanism, and a feature information fusion layer is set at the Nth layer. The next N+1 layers to the last layer are the decoder part of the multi-head attention mechanism, a one-dimensional transposed convolution layer, and a regression prediction layer.
5. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 1, characterized in that: In S2, based on the hyperspectral data obtained in S1, the K-Means clustering algorithm is used to segment the embryo surface of the corn kernel from the background to obtain a binary image of the corn kernel.
6. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 1, characterized in that: The parameter index described in S3 or S4 includes the germination potential of corn kernels on the second day after germination and the parameter information of the germinated corn seeds on the seventh day after germination.
7. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 6, characterized in that: The germination potential corresponds to three states, namely, no germination, broken fruit seed coat, and broken coleoptile.
8. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 6, characterized in that: The parameter information includes seedling length, seedling weight, taproot length, and taproot weight.
9. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 7, characterized in that: If the corn seeds do not germinate, the germination potential is set to 0; if the seed coat is broken, the germination potential is set to 0.5; if the coleoptile is broken, the germination potential is set to 1.
10. The method for detecting corn seed vitality spectrum based on sequence-to-sequence deep learning according to claim 8, characterized in that: The parameter information is normalized and processed.