Corn kernel quality evaluation method, machine readable storage medium and equipment

By explicitly modeling the correlation of spectral features of corn kernels using a multi-view graph neural network model, the problems of insufficient feature correlation and poor stability in existing spectral modeling technologies are solved, enabling rapid and accurate detection of corn kernel quality.

CN121633007APending Publication Date: 2026-03-10HENAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies for corn kernel quality testing suffer from insufficient correlation of spectral modeling features, strong noise interference, and poor result stability, making it difficult to achieve rapid, accurate, and non-destructive testing.

Method used

A multi-view graph neural network model is adopted. By constructing a sample-level graph structure, the correlation between different preprocessed spectra is explicitly modeled. Combined with graph isomorphic convolution-node-level scalar attention module and multi-scale feature fusion strategy, multi-scale topological-spectral representation is extracted to construct a quality evaluation model.

Benefits of technology

It improves the accuracy and robustness of spectral modeling, maintains high prediction accuracy and stability under complex samples or noisy conditions, and is highly adaptable, suitable for rapid detection of corn kernels and other agricultural products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121633007A_ABST
    Figure CN121633007A_ABST
Patent Text Reader

Abstract

The invention relates to a corn kernel quality evaluation method, a machine readable storage medium and equipment, and belongs to corn kernel quality evaluation in the field of agricultural products, the method comprises the following steps: firstly obtaining the absorbance spectrum and the protein content of each sample in a sample set, then preprocessing the absorbance spectrum, converting a spectrum view into a graph structure in a graph neural network, constructing a quality evaluation model, sequentially training and evaluating the model, and finally evaluating the quality of the corn kernels by using the established quality evaluation model. According to the method, explicit modeling and feature fusion are carried out on potential relationships among all views, and adaptive enhancement of key spectral information and suppression of redundant features are realized; by combining hierarchical feature extraction and a multi-scale fusion strategy, the obtained spectral representation has both a global trend and local details, and high prediction precision and good robustness can still be kept under the condition of large sample difference or limited data scale.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of agricultural products, in particular to a corn kernel quality evaluation method, a machine readable storage medium and equipment. BACKGROUND

[0002] At present, the quality evaluation of agricultural products usually depends on the quantitative analysis of its main chemical components. Traditional detection methods mostly use chemical or biological analysis methods, such as titration, photometry and chromatography. Although these methods can obtain high detection accuracy, the operation process is complicated, the detection period is long, and usually destructive treatment of the sample is required, which is difficult to meet the demand for rapid, non-destructive and real-time detection in modern production process. With the improvement of the intelligentization and standardization level of agricultural product industry, developing a technical means that can realize efficient detection while maintaining the integrity of the sample has become a key research and application direction.

[0003] Near-infrared spectroscopy technology (NIRS) can realize rapid and non-destructive measurement of component content by detecting the characteristic vibration of molecular bonds in the sample, and has the advantages of fast detection speed, simple operation and online monitoring. This technology has been widely used in the field of food for evaluating main components such as protein. However, due to the characteristics of high dimension, strong correlation and low signal-to-noise ratio of near-infrared spectrum signal, direct modeling often fails to effectively extract key features, and the consistency and stability of the model between different samples are poor.

[0004] Existing spectral analysis methods are mostly based on the processing or linear combination of single spectrum, and fail to fully utilize the complementary information contained in different spectral pretreatments, resulting in limited adaptability to complex samples. In addition, there are potential nonlinear correlations and global dependencies between different sections of the spectrum. If these structural characteristics are ignored, it will lead to insufficient information utilization and affect the accuracy and robustness of the prediction results.

[0005] Therefore, the existing technology still has deficiencies in spectral feature correlation modeling and information fusion, and there is an urgent need for a modeling method that can fully exploit the correlation of multi-source spectral features, improve the analysis accuracy and model stability, in order to realize rapid, accurate and non-destructive detection of corn kernel samples. SUMMARY

[0006] The purpose of the present application is to provide a corn kernel quality evaluation method, a machine readable storage medium and equipment, which can overcome the problems of insufficient feature correlation, strong noise interference and poor result stability in the existing method during spectral modeling.

[0007] The technical solution adopted by the present application to achieve the above technical problems is as follows: a corn kernel quality evaluation method, comprising the following steps: 1) Take at least 20 corn kernels as one bag, as a sample, multiple samples constitute a sample set, obtain the near-infrared reflectance spectrum of each sample in the sample set, and convert its reflectivity into absorbance form, to obtain the absorbance spectrum of each sample; 2) Obtain the protein content of each sample in the sample set, and divide the sample set into a training set, a validation set and a test set according to the Kennard-Stone algorithm in the ratio of 6:2:2; 3) Absorbance spectrum pretreatment Five existing methods, standard normal variate transformation, Savitzky-Golay smoothing first derivative, Savitzky-Golay smoothing second derivative, standard normal variate transformation combined with Savitzky-Golay smoothing first derivative, and standard normal variate transformation combined with Savitzky-Golay smoothing second derivative, are used to pretreat the absorbance spectrum of each sample in step 1), thereby obtaining one original d-dimensional spectrum and five pretreated d-dimensional spectra for each sample; 4) Quality evaluation model construction 4.1) Spectral view conversion to graph structure in graph neural network Each of the six d-dimensional spectra in step 3) is regarded as a node, and each node is connected to each other to form a node feature matrix with a shape of 6xd and an edge index tensor for recording the complete connection relationship between the six view nodes; 4.2) Construction of quality evaluation model The quality evaluation model includes a backbone network module, a feature fusion network module, and a prediction head network module; Among them, the backbone network module is composed of at least three cascaded graph isomorphism convolution-node level scalar attention modules to extract multi-scale topological-spectral representations from the input graph structure; The feature fusion network module fuses the outputs of the at least three cascaded graph isomorphism convolution-node level scalar attention modules to generate a comprehensive fusion feature that can simultaneously retain global and local spectral dependencies; The prediction head network module predicts the input comprehensive fusion feature and outputs the predicted value of the protein content; 4.3) The quality evaluation model is trained by minimizing the mean square error between the predicted value and the true value, and the optimization of the quality evaluation model is completed; 5) Evaluation of quality evaluation model The quality evaluation model is evaluated by using a determination coefficient, a root mean square error or a residual prediction bias, and if the evaluation result is lower than a preset evaluation index, the quality evaluation model is optimized in step 4.3), and the construction of the quality evaluation model is completed until the evaluation result of the quality evaluation model meets the preset evaluation index. 6) Evaluating the quality of the corn kernels using the quality evaluation model The corn kernel sample to be evaluated is subjected to the method of step 1) to obtain its absorbance spectrum, and then the absorbance spectrum is input into the constructed quality evaluation model to output an evaluation result, thereby completing the evaluation of the quality of the corn kernels.

[0008] As an optimization scheme of the above-mentioned corn kernel quality evaluation method, in step 1), the specific operation of obtaining the near-infrared reflectance spectrum of each sample in the sample set is that each bag of corn kernels is scanned by using a SW2860 type near-infrared spectrometer, the spectrum collection mode is reflectance mode, the collection waveband range is 900-1700 nm, and the spectrum resolution is 3-3.25 nm, and 248 reflectance spectrum variables are obtained for each sample.

[0009] As another optimization scheme of the above-mentioned corn kernel quality evaluation method, in step 1), the formula for converting reflectance into absorbance form is , wherein A represents absorbance and R represents reflectance.

[0010] As another optimization scheme of the above-mentioned corn kernel quality evaluation method, in step 2), the method for obtaining the protein content of each sample in the sample set is that the protein content of each bag of corn kernels is determined by using a Kjeltec2300 type automatic Kjeldahl nitrogen analyzer, each bag of corn kernels is measured repeatedly three times, and the average value is taken as the measurement result.

[0011] As another optimization scheme of the above-mentioned corn kernel quality evaluation method, in step 3), the pretreatment is performed in the same wavelength range to ensure that the dimensions of the spectra are consistent, and the pretreated spectra are not subjected to scaling operation.

[0012] As another optimization scheme of the above-mentioned corn kernel quality evaluation method, the specific operation of step 4.2) is as follows: 4.2.1) The determination coefficient of the quality evaluation model is calculated by using the following formula: The graph concatenation isomorphism convolution-node level scalar attention module stack to constitute the backbone network module, and each graph isomorphism convolution-node level scalar attention module performs message passing and feature updating on six view nodes. Let represent the view node In the first layer representation, representing the neighborhood of view nodes in the constructed complete graph ; for each neighbor , its input features are first mapped and passed through a sigmoid activation to obtain a scalar attention score, which is represented as ; where denotes the Sigmoid function, is the light-weight perceptron of the th layer; is the resulting attention scalar; is formed by normalizing the attention scores within the neighborhood according to ; where is used to ensure numerical stability; The neighborhood message of a view node is obtained by combining the attention-weighted features, which is represented as ; where , to avoid over-smoothing and preserve the wavelength-specific information of view nodes, an enhanced residual path in graph isomorphic networks is adopted to combine the representation of the previous layer of view nodes with the aggregated message: where is the pre-activation update; is a learnable scaling factor to control the contribution of the residual self-feature path; The updated view node embedding is computed by a multi-layer perceptron according to where is the learnable mapping of the th layer, which outputs the updated embedding of the view node ; The above update operation is applied to all six view nodes to obtain six updated view nodes, and the six updated view nodes in the th layer are stacked to form a node feature matrix ; let denote the node feature matrix of the th layer, and the expression of the node feature matrix is ; where d denotes the dimension of each view node, is the set of view nodes;​ 4.2.2) Concatenate all node feature matrices along the feature dimension. The concatenated node feature matrix is ​​represented as follows: ; After that, We apply average pooling, max pooling, and summation pooling functions to obtain three graph-level representations: ; Then, these three graph-level vectors are concatenated to form a fused representation: 4.2.3) The fused multidimensional features are input into the prediction head network module, which performs a hierarchical linear-to-nonlinear transformation to map the fused multidimensional features to the final predicted protein content. .

[0013] In step 4.3), the formula for calculating the mean square error is: In the formula, For the sample size, This indicates the protein content predicted by the quality assessment model. The measured value of protein content obtained in step 2) is denoted as .

[0014] As another optimization scheme for the above-mentioned corn kernel quality evaluation method, the calculation formula for evaluating the quality evaluation model using the coefficient of determination in step 5) is as follows: ; The formula for evaluating the quality assessment model using the root mean square error is as follows: ; The formula for evaluating the quality assessment model using residual prediction bias is as follows: ; In the above formula, and They represent the first Measured and predicted values ​​for each sample; and Let represent the average of the measured values ​​and predicted values ​​of all N samples, respectively.

[0015] A machine-readable storage medium storing executable code that, when executed by a processor of an electronic device, enables the processor to at least implement the methods described above.

[0016] A device for recording decision-making behavior, comprising a memory and a processor, wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can perform the method as described above.

[0017] Compared with the prior art, the present application has the following beneficial effects: 1) The present application uniformly models the original spectrum and multiple preprocessed spectra of the same sample, considers the spectra obtained by different preprocessing as multiple interrelated views, constructs a sample-level graph structure, explicitly models the potential relationship between views and fuses features, realizes adaptive reinforcement of key spectral information and suppression of redundant features through node interaction and relationship weighting mechanism, and simultaneously combines hierarchical feature extraction and multi-scale fusion strategy, so that the obtained spectral representation has both global trend and local detail, and can still maintain high prediction accuracy and good robustness under the condition that the sample difference is large or the data size is limited. 2) The present application establishes a multi-view graph structure for the original spectrum and five preprocessed spectra of the same sample, takes each view as a node and interacts features, realizes comprehensive fusion of spectral information, and compared with the traditional single preprocessing or simple splicing method, the present application can explicitly mine the complementary relationship between different preprocessing, improve information utilization rate, thereby effectively enhance feature expression ability and modeling accuracy, still maintain high prediction stability under complex samples or noisy conditions, and significantly improve the reliability and robustness of spectral modeling. 3) The present application realizes hierarchical fusion of spectral features through interlayer feature splicing and multi-statistical pooling strategy, integrates deep global information while retaining shallow local features, multi-statistical pooling (average, maximum, summation) enhances the diversity and robustness of feature expression, which is helpful to improve the prediction accuracy and generalization ability of the model under different samples and environmental conditions; this design enables the model to fully utilize multi-scale information without increasing the computational complexity, thereby obtaining more accurate quantitative regression results. 4) The present application has good generalization in both model structure and data processing: the preprocessing process is completed in a unified waveband range, and the target variable normalization is only based on the training set parameters, strictly avoiding data leakage; the graph structure enables the model to adapt to different instruments, wavelength resolution and sample sources; the node attention provides a "view contribution degree" that can be intuitively analyzed, which is helpful to explain the model decision mechanism; experiments show that this design has strong robustness and migration ability. 5) The present application can not only be applied to corn kernels, but also can be widely applied to rapid detection and quality evaluation in the fields of food, medicinal materials and agricultural products, and has the advantages of fast detection speed, stable results, strong adaptability and easy engineering implementation. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1A flow chart of the present application; Figure 2 An architecture diagram of the quality evaluation model in the present application; Figure 3 An architecture diagram of the graph isomorphism convolution-node level scalar attention module in the quality evaluation model; Figure 4 An average near-infrared spectrum of corn kernels in the experimental example; Figure 5 A scatter plot of the predicted value and the measured value in the experimental example. DETAILED DESCRIPTION

[0019] The technical solutions of the present application will be further described in detail below in combination with specific embodiments. The parts not described in the following embodiments of the present application are considered as existing technology known or known by those skilled in the art.

[0020] Embodiment 1 A corn kernel quality evaluation method, as shown in Figure 1 , comprising the following steps: 1) Take at least 20 corn kernels as a bag as a sample, and multiple samples constitute a sample set. Obtain the near-infrared reflectance spectrum of each sample in the sample set, and convert the reflectivity into absorbance form to represent, to obtain the absorbance spectrum of each sample; In this step, the specific operation of obtaining the near-infrared reflectance spectrum of each sample (i.e. each bag of corn kernels) in the sample set is to scan each bag of corn kernels by using a SW2860 type near-infrared spectrometer. The spectrum collection mode is reflectivity mode, the collection waveband range is 900-1700nm, and the spectrum resolution is 3-3.25nm. Each sample obtains 248 reflectivity spectrum variables; In this step, the formula for converting reflectivity into absorbance form is , wherein A represents absorbance, and R represents reflectivity. By converting reflectivity R into absorbance A, the linear modelability of the spectrum during modeling is improved; 2) Obtain the protein content of each sample in the sample set, and divide the sample set into a training set, a validation set and a test set according to a 6:2:2 ratio by using Kennard-Stone algorithm; In this step, the method for obtaining the protein content of each sample in the sample set is to determine the protein content of each bag of corn kernels by using a Kjeltec2300 type full-automatic Kjeldahl nitrogen analyzer. Each bag of corn kernels is measured repeatedly three times, and the average value is taken as the measurement result; 3) Absorbance spectrum pretreatment The absorbance spectrum of each sample in step 1) is preprocessed by using five existing methods, namely, standard normal variate transformation, Savitzky-Golay smoothing first derivative, Savitzky-Golay smoothing second derivative, standard normal variate transformation combined with Savitzky-Golay smoothing first derivative, and standard normal variate transformation combined with Savitzky-Golay smoothing second derivative, to obtain one original d-dimensional spectrum and five preprocessed d-dimensional spectra of each sample; In this step, five widely used and well-verified preprocessing methods in the field of near-infrared chemometrics are first used for absorbance spectra, including standard normal variate transformation (SNV), Savitzky-Golay (SG) smoothing first and second derivatives, and two combined forms (SNV+first derivative, SNV+second derivative, window length 13). These preprocessing steps are mature techniques in near-infrared spectral analysis, mainly used to correct scattering, improve signal-to-noise ratio and highlight overlapping absorption peaks, and have been proven to have good stability and reliability in a large number of food and agricultural product spectral studies.

[0021] All preprocessing operations are performed in the same wavelength range to ensure consistent dimensions of the spectral representations; to avoid data leakage, standardization transformation (Z-score) is only used for normalization of the target variable (mean and standard deviation are estimated in the training set and used in the validation and test sets); spectral features are not scaled after preprocessing; The output of this step: each sample obtains six spectral representations (original + five preprocessed), which will be used as "multi-view nodes" for graph modeling in the next step; 4) Constructing a quality evaluation model, the architecture diagram is as shown in Figure 2 ; The construction of the quality evaluation model in this embodiment mainly includes two stages: near-infrared spectral data transformation and quality evaluation model construction; the backbone network of the quality evaluation model consists of three cascaded graph isomorphism convolution modules and node-level scalar attention (GIN-Attention) modules, which can adaptively extract multi-scale topological-spectral representations from the graph-transformed near-infrared data; the outputs of the three GIN-Attention layers are fused through a multi-pooling feature fusion module to generate a comprehensive fused feature representation that can simultaneously preserve global and local spectral dependencies; finally, the fused features are input into a three-layer fully connected prediction head to accurately evaluate the protein content. The specific operations are as follows: 4.1) Spectral view is converted into a graph structure in a graph neural network, i.e., near-infrared spectral data transformation; The traditional method usually simply splices the outputs of different pretreatments, ignoring their inherent correlation. To this end, the embodiment organizes multiple pretreatment spectra of the same sample into a sample-level graph structure, and explicitly encodes the complementarity and synergy between views in the graph neural network Figure 2 As shown in the upper half of FIG. 1. To capture the inherent dependence between wavelength variables, each of the six d-dimensional spectra in step 3) is regarded as a node, and each node is connected to each other, forming a node feature matrix with a shape of 6xd and an edge index tensor for recording the full connection relationship between the six view nodes; 4.2) Constructing a quality evaluation model After completing the sample-level graph construction of multiple pretreatment spectra, the embodiment takes the graph structure as the input of the graph neural network, and further models the synergy between different pretreatment views through graph isomorphism convolution-node level scalar attention module. In this framework, each pretreatment method corresponds to a node, and the node feature is the d-dimensional spectral representation of the view. The fully connected graph topology enables information exchange between all views. The task of the model is not to model the local dependence between individual wavelengths, but to learn the correlation between the spectral features strengthened by different pretreatment methods, thereby integrating multi-angle spectral representation; Based on this input graph structure, the quality evaluation model includes a backbone network module, a feature fusion network module, and a prediction head network module; The backbone network module is composed of at least three cascaded graph isomorphism convolution-node level scalar attention modules to extract multi-scale topological-spectral representations from the input graph structure; The feature fusion network module fuses the outputs of the at least three cascaded graph isomorphism convolution-node level scalar attention modules to generate a comprehensive fusion feature that can simultaneously retain global and local spectral dependencies; The prediction head network module predicts the input comprehensive fusion feature and outputs the predicted value of the protein content; The specific operation of this step is as follows: 4.2.1) The input of the backbone network module is the sample-level graph structure constructed in step 4.1), and the output is a comprehensive fusion feature that can simultaneously retain global and local spectral dependencies. The backbone network module is stacked by at least three cascaded graph isomorphism convolution-node level scalar attention modules, and each graph isomorphism convolution-node level scalar attention module performs message passing and feature updating on the six view nodes, as shown in FIG. 2. Figure 3 Let represent the view node At the first layer, the representation of is , and the neighborhood of the view node in the constructed complete graph is represented by First, its input features are mapped, and then a sigmoid activation is performed to obtain a scalar attention score, which is represented as follows: ; In the formula, This represents the Sigmoid function. For the first A lightweight perceptron for layers; The obtained attention scalar; To achieve cross-view information fusion, the backbone network module executes the standard graph neural network message passing process at each layer, such as... Figure 3 As shown, using Represents view node In the Layer representation, For its set of adjacent nodes; in the updated node When representing a value, the model will iterate through all its neighbors. The features are mapped through a lightweight perceptron (MLP) and then a scalar attention score is obtained through a sigmoid function to measure the contribution of neighbor features in the aggregation process. This design follows the neighborhood message passing mechanism common in graph neural networks, and introduces scalar attention on this basis to achieve adaptive cross-view feature fusion; To form the attention aggregation weights, the attention scores within the neighborhood are normalized using the following formula: ; in, Used to ensure numerical stability; view node The neighborhood messages are obtained through attention-weighted feature combinations, expressed as follows: ; in, To avoid over-smoothing and preserve the band-specific information of view nodes, a graph isomorphic network is used. Enhanced residual paths combine the representation of the parent view node with aggregated messages: in, It is a pre-activation update; It is a learnable scaling factor used to control the contribution of residual self-feature paths; The updated view node embedding is calculated by the multilayer perceptron according to the following formula: in, For the first Layers can learn mappings and output view nodes. ; The above update operation is applied to all six view nodes to obtain six updated view nodes, and the first view node is selected as the representative view node of the sixth layer. The six updated view nodes in the sixth layer are stacked to form a node feature matrix , denoted as , where is the node feature matrix of the sixth layer, and the expression of the node feature matrix is as follows: ; In the formula, d represents the dimension of each view node, is a set of view nodes. 4.2.2) The output features of the three graph isomorphism convolution-node level scalar attention modules are further processed by a multi-pooling feature fusion module, which fuses the features of each layer through different pooling operations (including mean pooling, maximum pooling and sum pooling) to fully capture local and global spectral information; in this process, various pooling operations extract features from different angles, and combined with the subsequent concatenation (Concatenation) step to generate comprehensive feature representation, the specific process is as follows: After obtaining the wavelength level node embedding from different layers of the backbone network composed of graph isomorphism convolution-node level scalar attention modules, the feature fusion network aggregates these multi-layer outputs to form a more comprehensive overall representation. Specifically, all node feature matrices are concatenated along the feature dimension to denote the node feature matrix of the sixth layer, and in this embodiment, the value of is 1, 2 or 3, denotes the number of nodes, denotes the feature dimension of each node, and the concatenated node feature matrix is represented as: ; After that, the is processed by an average pooling function, a maximum pooling function and a sum pooling function to obtain three graph level representations: ; These pooled representations capture complementary spectral features of all wavelength nodes: the average pooling vector reflects the overall spectral trend, the maximum pooling vector emphasizes the most significant response, and the sum pooling vector represents cumulative intensity information; These three graph level vectors are concatenated to form a fused representation: This hierarchical feature fusion process can capture both smooth spectral trends and significant local variations, thus enhancing the robustness and expressiveness of spectral representation in downstream prediction tasks; 4.2.3) The fused multi-dimensional features are flattened and input into a prediction head network module, which includes two hidden layers and an output layer, performing hierarchical linear-to-nonlinear transformations to map the fused multi-dimensional features to the final predicted protein content; ; 4.3) The quality evaluation model is trained by minimizing the mean squared error between the predicted value and the true value, and the optimization of the quality evaluation model is completed; In this step, the calculation formula of the mean squared error is: In the formula, is the number of samples, represents the protein content predicted by the quality evaluation model, is the measured value of the protein content measured in step 2); 5) Evaluation of the quality evaluation model The quality evaluation model is evaluated using the coefficient of determination, root mean square error, or residual prediction deviation. If the evaluation result is lower than the preset evaluation index, the quality evaluation model is optimized in step 4.3), until the evaluation result of the quality evaluation model meets the preset evaluation index, i.e., the construction of the quality evaluation model is completed; In this step, the prediction performance of the model is evaluated using three commonly used indicators: the coefficient of determination (R 2 ), the root mean square error (RMSE), and the residual prediction deviation (RPD); Among them, R 2 evaluates the proportion of the variance of the measured data explained by the model, reflecting the prediction accuracy, and the calculation formula is: ; R 2 represents the proportion of the variance of the measured data explained by the model (0-1), and the closer to 1, the closer the predicted value of the model to the true value; RMSE quantifies the size of the prediction error, representing the average deviation between the predicted value and the observed value, and the calculation formula is: ; The lower the RMSE, the more accurate the prediction; The calculation formula of RPD is: ; RPD measures the robustness of the model by comparing the variability of the observed data and the variability of the predicted residuals, the higher the better, the evaluation standard of RPD in the international spectrum analysis field is shown in the following table: In the above formula, and respectively represent the measured value and the predicted value of the first sample; and respectively represent the average value of the measured value and the predicted value of all N samples; In order to avoid data leakage, all evaluations are based on the consistent processing of the validation set and the test set by the standardized parameters determined only on the training set; 6) Using the quality evaluation model to evaluate the quality of corn kernels The corn kernel sample to be evaluated is obtained by the method of step 1) to obtain its absorbance spectrum, and then the absorbance spectrum is input into the constructed quality evaluation model to output the evaluation result, thereby completing the evaluation of the quality of the corn kernels.

[0022] Example 2 A machine-readable storage medium, the machine-readable storage medium has executable code stored thereon, when the executable code is executed by a processor of an electronic device, the processor can at least implement the method in embodiment 1.

[0023] Example 3 A device for recording decision-making behavior, comprising a memory and a processor, the memory has executable code stored thereon, when the executable code is executed by the processor, the processor can perform according to the method in embodiment 1.

[0024] In order to verify the prediction of the technical scheme of the application, the following experiments are carried out: Experimental example 356 corn kernel samples were collected from eight major corn producing areas in China (Anyang, Hebi in Henan, Bozhou in Anhui, Heze in Shandong, Hengshui, Handan in Hebei, Jiamusi, Qiqihar in Heilongjiang), all samples were stored at 4℃, and balanced to 25℃ before scanning to ensure that the sample moisture and temperature are stable, reduce the influence of environmental differences on spectrum measurement, the average near infrared spectrum of corn kernels is as shown in Figure 4 .

[0025] Establish the corn kernel data set: a total of 356 samples, according to Kennard-Stone algorithm, divide into training set 213, validation set 71 and test set 72 in the ratio of 6:2:2; In the experiment, for the corn kernel data set, the batch size is set to 32, and the learning rate is 0.005; the learning rate decay uses the ReduceLROnPlateau scheduler, and if the validation set R 2 If there is no improvement in 25 cycles, the learning rate is reduced by 0.5 times; the Adam optimizer is used, and the weight decay is 0.001; this experimental setting ensures the convergence stability and prediction performance of the model under the condition of spectral samples, avoids data leakage and evaluation bias, and makes the experimental results reliable and reproducible.

[0026] The method in embodiment 1 of the present application is used to predict the protein content of corn kernels, and a scatter plot is made with the measured value, as shown in Figure 5 , Figure 5 The data points are shown to be closely gathered along the reference line, R 2 reach 0.9564, RMSE = 0.2758, RPD = 4.812, indicating that the model has excellent prediction accuracy and robustness, confirming the reliability of the model and its applicability in quantitative analysis of corn kernel quality.

Claims

1. A method for evaluating the quality of corn kernels, characterized by, It comprises the following steps: 1) Take at least 20 corn kernels as one bag as a sample, multiple samples constitute a sample set, obtain the near-infrared reflectance spectrum of each sample in the sample set, and convert its reflectivity into absorbance form, thereby obtaining the absorbance spectrum of each sample; 2) Obtain the protein content of each sample in the sample set, and divide the sample set into a training set, a validation set and a test set according to a Kennard-Stone algorithm in a ratio of 6:2:2; 3) Absorbance spectrum pretreatment Five existing methods, namely standard normal variate transformation, Savitzky-Golay smoothing first derivative, Savitzky-Golay smoothing second derivative, standard normal variate transformation combined with Savitzky-Golay smoothing first derivative, and standard normal variate transformation combined with Savitzky-Golay smoothing second derivative, are used to pretreat the absorbance spectrum of each sample in step 1), thereby obtaining one original d-dimensional spectrum and five pretreated d-dimensional spectra of each sample; 4) Construction of quality evaluation model 4.1) Convert the spectrum view into a graph structure in the graph neural network Each of the six d-dimensional spectra in step 3) is regarded as a node, and each node is connected to each other to form a node feature matrix with a shape of 6xd and an edge index tensor for recording the complete connection relationship between the six view nodes; 4.2) Construction of quality evaluation model The quality evaluation model comprises a backbone network module, a feature fusion network module and a prediction head network module; The backbone network module is composed of at least three cascaded graph isomorphism convolution-node level scalar attention modules to extract multi-scale topological-spectral representations from the input graph structure; The feature fusion network module fuses the outputs of the at least three cascaded graph isomorphism convolution-node level scalar attention modules to generate a comprehensive fusion feature that can simultaneously retain global and local spectral dependencies; The prediction head network module predicts the input comprehensive fusion feature and outputs a predicted value of the protein content; 4.3) Train the quality evaluation model by minimizing the mean square error between the predicted value and the true value, and optimize the quality evaluation model; 5) Evaluation of quality evaluation model The quality evaluation model is evaluated using the coefficient of determination, root mean square error or residual prediction bias. If the evaluation result is lower than the preset evaluation index, the quality evaluation model is optimized in step 4.3), until the evaluation result of the quality evaluation model meets the preset evaluation index, i.e. the construction of the quality evaluation model is completed; 6) Use the quality evaluation model to evaluate the quality of corn kernels The absorbance spectrum of the corn kernel sample to be evaluated is obtained by the method of step 1), and then the absorbance spectrum is input into the constructed quality evaluation model to output the evaluation result, thereby completing the evaluation of the quality of the corn kernels.

2. The method of claim 1, wherein: In the step 1), the specific operation of acquiring the near-infrared reflectance spectrum of each sample in the sample set is that a SW2860 type near-infrared spectrometer is used to scan each bag of corn kernels, the spectrum collection mode is reflectance mode, the collection wave band range is 900-1700 nm, the spectral resolution is 3-3.25 nm, and 248 reflectance spectrum variables of each sample are obtained.

3. The method of claim 1, wherein: In the step 1), the formula for converting the reflectance into the absorbance form is expressed as, where A represents the absorbance and R represents the reflectance.

4. The method of claim 1, wherein: In the step 2), the method for acquiring the protein content of each sample in the sample set is that a Kjeltec2300 type automatic Kjeldahl nitrogen analyzer is used to measure the protein content of each bag of corn kernels, each bag of corn kernels is measured repeatedly for three times, and the average value is taken as the measurement result.

5. The method of claim 1, wherein: In the step 3), the pretreatment is performed in the same wavelength range to ensure that the spectra have consistent dimensions, and the pretreated spectrum is not subjected to scaling operation.

6. The method of claim 1, wherein the method is a method for evaluating the quality of a corn kernel. The specific operation of the step 4.2) is that: 4.2.1) to The backbone network module is stacked by the graph isomorphism convolution-node level scalar attention module, and each graph isomorphism convolution-node level scalar attention module performs message passing and feature updating on six view nodes. With representing view nodes In the first layer of representation, representing the neighborhood of view nodes in the constructed complete graph; for each neighbor , first map the input features and get a scalar attention score through sigmoid activation, which is represented as: ; wherein represents a Sigmoid function, is the layer of lightweight perceptron; is the resulting attention scalar; In order to form the attention aggregation weight, the attention scores in the neighborhood are normalized as follows: ; wherein, for ensuring numerical stability; View node The neighborhood message of the i-th view node is obtained by attention-weighted feature combination, denoted as: ; wherein, To avoid over-smoothing and preserve band-specific information of view nodes, an enhanced residual path is employed that combines the previous layer view node representation with the aggregated message: enhanced residual path combines the previous layer view node representation with the aggregated message: wherein, is a pre-activation update; is a learnable scaling factor to control the contribution of the residual self- feature path; The updated view node embedding is calculated by a multilayer perceptron as follows: wherein, is the first layer learnable mapping, output view node updated embedding; The above update operation is applied to all six view nodes to obtain six updated view nodes. The first node is then... The six updated view nodes in the layer are stacked to form a node feature matrix. ,by Indicates the first Layer node feature matrix, node feature matrix The expression is: ; where d denotes the dimension of each view node, is a set of view nodes; 4.2.2) All node feature matrices are spliced along the feature dimension, and the spliced node feature matrix is represented as: ; After that, We apply average pooling, max pooling, and summation pooling functions to obtain three graph-level representations: ; The three graph-level vectors are spliced to form a fusion representation. 4.2.3) inputting the fused multi-dimensional features into a prediction head network module, which performs a hierarchical linear-to-nonlinear transformation to map the fused multi-dimensional features to final predicted values of protein content .

7. The method of claim 1, wherein the method is a method for evaluating the quality of a corn kernel. In the step 4.3), the calculation formula of the mean square error is as follows: In the formula, is the number of samples, represents the protein content predicted by the quality evaluation model, is the measured value of the protein content measured in step 2).

8. The method of claim 1, wherein, In the step 5), the calculation formula for evaluating the quality evaluation model by using the determination coefficient is as follows: ; The calculation formula for evaluating the quality evaluation model by using the root mean square error is as follows: ; The calculation formula for evaluating the quality evaluation model by using the residual prediction bias is as follows: ; In the above equations, and denote the measured and predicted values of the i-th sample, respectively; and denote the average of the measured and predicted values of all N samples, respectively.​ 9. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores executable codes, and when the executable codes are executed by the processor of the electronic device, the processor can at least implement the method in any one of claims 1 to 9.

10. A device for recording decision making behavior, comprising a memory and a processor, the memory having stored thereon executable code, the device characterized by: When the executable codes are executed by the processor, the processor can perform the method in any one of claims 1 to 9.