Method, apparatus, and equipment for identifying grain origins based on hyperspectral imaging
The method enhances grain origin tracking by constructing pseudo-RGB images and using dimensionality reduction techniques to train a neural network, addressing inefficiencies and inaccuracies in existing hyperspectral image processing for grain origin determination.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- TECH CENT OF QINGDAO CUSTOMS
- Filing Date
- 2026-05-20
- Publication Date
- 2026-07-23
AI Technical Summary
Existing grain origin tracking methods using hyperspectral images face challenges with low efficiency, high resource consumption, and inaccurate segmentation, particularly in complex backgrounds and varying cultivation conditions, lacking both computational efficiency and generalization ability.
A method involving hyperspectral image processing that includes constructing pseudo-RGB images, performing grain instance partitioning, extracting average spectral information, and applying principal component analysis, local linear embedding, and sparse subspace clustering to train a fully connected neural network for accurate grain origin tracking.
Improves the accuracy and processing efficiency of grain origin identification, overcoming redundant dimensions and inaccurate segmentation, suitable for agricultural production and monitoring, with reduced reliance on human judgment.
Smart Images

Figure 0007894101000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to the field of image recognition technology, and more particularly to a method, apparatus, and device for identifying grain origins based on hyperspectral images. [Background technology]
[0002] With the expansion of global agricultural trade, information on the origin of various grains (e.g., soybeans) has become crucial for quality control, market surveillance and management, and international trade. Traditional grain origin tracking methods often rely on agricultural parameters, environmental factors, or feature extraction based on RGB images. These methods are susceptible to human factors and collection conditions, lacking objectivity and accuracy, making it difficult to meet the needs arising from the development of smart and automated modern agriculture.
[0003] Hyperspectral imaging technology, as an advanced detection method that fuses image and spectral information, can provide the reflectivity characteristics of an object across multiple wavelength bands, offering superior material identification capabilities. However, hyperspectral images typically exhibit characteristics such as high dimension and redundancy, leading to challenges such as low efficiency and high resource consumption when directly applied to deep learning models. Furthermore, the automatic segmentation of grain instances still faces accuracy limitations even in complex backgrounds and different cultivation conditions, restricting the subsequent extraction and classification effects of spectral data.
[0004] In recent years, several research teams both domestically and internationally have been studying the use of hyperspectral technology in tracking the origin of agricultural products. For example, the Chinese Academy of Agricultural Sciences is using hyperspectral and machine learning models to identify the origin of apples, and a team at a university in Beijing is attempting to identify the origin of tea leaves by combining near-infrared spectroscopy with deep neural networks. Regarding grains, some research has already been conducted on their variety identification, quality classification, and estimation of protein content, but there is still little research on accurately tracking the origin of grains using a combination of hyperspectral and deep learning models, and in particular, there is a lack of tracking methods that possess both high identification accuracy and generalization ability.
[0005] Therefore, in order to achieve accurate identification of grain samples and automatic origin determination, a hyperspectral image processing method is needed that combines computational efficiency, division accuracy, and tracking accuracy. [Overview of the Initiative] [Problems that the invention aims to solve]
[0006] Embodiments of the present invention provide a method, apparatus, and device for identifying grain origins based on hyperspectral images, which combine computational efficiency, division accuracy, and tracking accuracy for identifying grain origins. [Means for solving the problem]
[0007] In a first aspect, an embodiment of the present invention provides a method for identifying the origin of grains based on hyperspectral images. The steps include: collecting hyperspectral sample images of grains from different origins using a hyperspectral imaging instrument, and each hyperspectral sample image containing image information across multiple wavelength bands. For each hyperspectral sample image, the initial weights for each wavelength band in the hyperspectral sample image are determined based on the origin corresponding to the hyperspectral sample image, and three representative wavelength bands are selected based on the initial weights and a continuous projection algorithm to construct a pseudo-RGB image of the hyperspectral sample image. The steps include performing grain instance partitioning on each of the pseudo-RGB images, identifying the boundaries and positions of each grain within each of the pseudo-RGB images, and obtaining a partitioning mask corresponding to each of the pseudo-RGB images. The steps include: using a division mask corresponding to each of the pseudo-RGB images to extract the average spectral information of each grain in each of the corresponding hyperspectral sample images, and constructing a spectral information matrix based on the average spectral information of each grain in each of the hyperspectral sample images; The steps include sequentially performing principal component analysis, local linear embedding, and sparse subspace clustering on the spectral information matrix to obtain a dimensionality reduction matrix, The process includes the steps of: training a fully connected neural network model based on the dimensionality reduction matrix to obtain a grain origin tracking model; and performing grain origin tracking based on the grain origin tracking model.
[0008] In a possible embodiment, the step of selecting three representative wavelength bands based on the initial weights and continuous projection algorithm to construct a pseudo-RGB image of the hyperspectral sample image is: The steps include initializing the selected wavelength bands and candidate wavelength bands based on the hyperspectral sample image to construct a set of selected wavelength bands and a set of candidate wavelength bands, and determining the current weight of each candidate wavelength band based on the initial weight of each wavelength band in the hyperspectral sample image. A step of calculating the projection residual between the component in each candidate wavelength band of the hyperspectral sample image and the component in each selected wavelength band of the hyperspectral sample image, based on the current weight of each candidate wavelength band. Taking the candidate wavelength band corresponding to the maximum value of the projection residual as the new selected wavelength band, updating the set of selected wavelength bands and the set of candidate wavelength bands based on the new selected wavelength band, and updating the current weight of each candidate wavelength band in the updated set of candidate wavelength bands based on the new selected wavelength band; Until the number of selected wavelength bands in the set of selected wavelength bands reaches three, based on the updated current weights of each candidate wavelength band in the updated set of candidate wavelength bands, calculating the projection residuals between the components in each candidate wavelength band of the hyperspectral sample image and the components in each selected wavelength band of the hyperspectral sample image, and then re - executing the subsequent steps; Constructing a pseudo - RGB image of the hyperspectral sample image based on the three selected wavelength bands in the set of selected wavelength bands.
[0009] In a possible embodiment, the step of updating the current weight of each candidate wavelength band in the updated set of candidate wavelength bands based on the new selected wavelength band includes: Calculating the correlation coefficients between the components of the hyperspectral sample image in each candidate wavelength band in the updated set of candidate wavelength bands and the components in the new selected wavelength band of the hyperspectral sample image respectively; Adding all the correlation coefficients to obtain the sum of the correlation coefficients; For each candidate wavelength band in the updated set of candidate wavelength bands, calculating the ratio of the correlation coefficient corresponding to the candidate wavelength band to the sum of the correlation coefficients, and updating the current weight of the candidate wavelength band based on the difference between 1 and the ratio.
[0010] In a possible embodiment, the step of extracting the average spectral information of each grain in each corresponding hyperspectral sample image using the segmentation mask corresponding to each pseudo - RGB image includes: For each wavelength band in each hyperspectral sample image, the step of calculating the product between each pixel contained in each grain within the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image and the component of the corresponding pixel in the hyperspectral sample image in that wavelength band. The method includes the step of calculating the average of the sum of all the aforementioned products according to the total number of pixels contained in each grain in the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image, thereby obtaining the average spectral information of each grain in the hyperspectral sample image.
[0011] In a possible embodiment, the step of obtaining a dimensionality reduction matrix is performed sequentially on the spectral information matrix by principal component analysis, local linear embedding, and sparse subspace clustering. The steps include: performing principal component analysis on the spectral information matrix to obtain an initial dimensionality reduction matrix; The steps include: performing nonlinear dimensionality reduction on the initial dimensionality reduction matrix based on a local linear embedding to obtain a two-dimensionality reduction matrix; The method includes the steps of performing sparse subspace clustering on the aforementioned two-dimensionality reduction matrix and obtaining a dimensionality reduction matrix based on the clustering results.
[0012] A possible mechanism involves performing sparse subspace clustering on the two-dimensional reduction matrix and obtaining a dimensional reduction matrix based on the clustering results. The steps include: calculating the similarity between each sample point in the aforementioned two-dimensional reduction matrix to obtain a similarity matrix; Performing spectral clustering on the similarity matrix, classify each sample point in the two-dimensional reduction matrix into the same number of clusters as the number of grain producing region categories, with each cluster corresponding to one subspace in the step, For each subspace, the subspace purity of the subspace is obtained based on the proportion of the total sample points of the subspace that are most numerous in the single origin, and the classification contribution of the subspace is obtained based on the influence of the subspace on the origin classification result, and the importance of the subspace is obtained based on the subspace purity and the classification contribution. For each sample point in the aforementioned two-dimensional reduction matrix, the average contribution value of the sample point in reducing data impurities within each subspace is evaluated based on a random forest model to obtain the feature contribution of the sample point in each subspace. The process includes the steps of selecting sample points based on the feature contribution of each sample point in each subspace and the importance of the corresponding subspace, constructing a sparse feature vector based on the selection results, and obtaining a dimensionality reduction matrix.
[0013] In a second aspect, an embodiment of the present invention provides a grain origin identification device based on hyperspectral imaging. A collection module for collecting hyperspectral sample images of grains from different origins using a hyperspectral imaging instrument, A wavelength band extraction module for constructing a pseudo-RGB image of a hyperspectral sample image by determining the initial weights of each wavelength band in the hyperspectral sample image based on the origin of the hyperspectral sample image, selecting three representative wavelength bands based on the initial weights and a continuous projection algorithm, and A mask splitting module for performing grain instance splitting on each of the pseudo-RGB images, identifying the boundaries and positions of each grain within each of the pseudo-RGB images, and obtaining a splitting mask corresponding to each of the pseudo-RGB images, A spectral information extraction module for extracting the average spectral information of each grain in each corresponding hyperspectral sample image using a division mask corresponding to each pseudo-RGB image, and constructing a spectral information matrix based on the average spectral information of each grain in each hyperspectral sample image, A dimensionality reduction module for obtaining a dimensionality reduction matrix by sequentially performing principal component analysis, local linear embedding, and sparse subspace clustering on the aforementioned spectral information matrix, The system includes a fully connected neural network model that is trained based on the dimensionality reduction matrix to obtain a grain origin tracking model, and an origin identification module for performing grain origin tracking based on the grain origin tracking model.
[0014] In a third aspect, an embodiment of the present invention provides an electronic device comprising a memory in which a computer program is stored, and a processor, wherein when the computer program is executed by the processor, the method of the first aspect, or any possible embodiment of the first aspect, is carried out.
[0015] In a fourth aspect, an embodiment of the present invention provides a non-temporary computer-readable storage medium in which a computer program is stored, which, when executed by a processor, performs a method in the first aspect or any possible embodiment of the first aspect.
[0016] In a fifth aspect, an embodiment of the present invention provides a computer program product that, when executed by a processor, performs a computer program that implements the method in the first aspect or any possible embodiment of the first aspect.
[0017] In an embodiment of the present invention, first, hyperspectral sample images of grains from different origins are collected using a hyperspectral imaging device. Then, for each hyperspectral sample image, initial weights for each wavelength band in the hyperspectral sample image are determined based on the origin corresponding to the hyperspectral sample image. Three representative wavelength bands are selected based on the initial weights and a continuous projection algorithm to construct a pseudo-RGB image of the hyperspectral sample image. Subsequently, grain instance partitioning is performed on each pseudo-RGB image to identify the boundaries and positions of each grain within each pseudo-RGB image and obtain a partitioning mask corresponding to each pseudo-RGB image. Then, using the partitioning mask corresponding to each pseudo-RGB image, the average spectral information of each grain within the corresponding hyperspectral sample image is extracted. A spectral information matrix is constructed based on the average spectral information of each grain within each hyperspectral sample image, and principal component analysis, local linear embedding, and sparse subspace clustering are sequentially performed on the spectral information matrix to obtain a dimensionality reduction matrix. Finally, a fully connected neural network model is trained based on the dimensionality reduction matrix to obtain a grain origin tracking model, and grain origin tracking is performed based on the grain origin tracking model. The present invention significantly improves the accuracy and processing efficiency of grain origin identification, overcoming problems such as redundant dimensions, inaccurate segmentation, and high reliance on tracking present in existing technologies. It is suitable for actual agricultural production and agricultural product monitoring and management scenarios, and has excellent prospects for industrial application. [Brief explanation of the drawing]
[0018] [Figure 1] This is an implementation flowchart for the grain origin identification method based on hyperspectral images provided in an embodiment of the present invention. [Figure 2] This is an implementation flowchart for the soybean origin identification method based on hyperspectral images provided in an embodiment of the present invention. [Figure 3] This is a schematic diagram of the structure of a grain origin identification device based on hyperspectral images provided in an embodiment of the present invention. [Figure 4]This is a schematic diagram of an electronic device provided in an embodiment of the present invention. [Modes for carrying out the invention]
[0019] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0020] Referring to Figure 1, an implementation flowchart of the grain origin identification method based on hyperspectral images provided in an embodiment of the present invention is shown. Using soybeans as an example, the method will be explained in detail below with reference to Figures 1 and 2.
[0021] In step 101, hyperspectral sample images of grains from different origins are collected using a hyperspectral imaging instrument.
[0022] In this embodiment, a hyperspectral imaging device can be used to collect grain sample images from different countries and regions, thereby obtaining high-dimensional image data containing multiple wavelength bands of visible and near-infrared light. The high-dimensional image data can contain B wavelength bands (where B is typically several tens to several hundreds), denoted as I(x,y,b), where x and y represent image pixel coordinates and b∈(1,2,L,B) represents the wavelength band index. Each hyperspectral sample image contains image information across multiple wavelength bands.
[0023] For example, hyperspectral imaging equipment can be used to collect images of soybean samples, corn samples, wheat samples, etc., from different countries and regions, and this embodiment does not limit the specific types of grains.
[0024] In step 102, for each hyperspectral sample image, the initial weights for each wavelength band in the hyperspectral sample image are determined based on the origin corresponding to the hyperspectral sample image. Based on the initial weights and a continuous projection algorithm, three representative wavelength bands are selected to construct a pseudo-RGB image of the hyperspectral sample image.
[0025] In this embodiment, wavelength band selection and RGB image conversion are performed. Using soybeans as an example, three representative wavelength bands are selected based on the spectral characteristics of soybeans to construct a pseudo-RGB image. In other words, by reducing dimensionality while maintaining spectral differences, model processing can be facilitated.
[0026] Selectively, step 102 is, The steps include initializing the selected wavelength bands and candidate wavelength bands based on the hyperspectral sample image to construct the set of selected wavelength bands and the set of candidate wavelength bands, and determining the current weight of each candidate wavelength band based on the initial weight of each wavelength band in the hyperspectral sample image, The steps include: calculating the projection residual between the components in each candidate wavelength band of the hyperspectral sample image and the components in each selected wavelength band of the hyperspectral sample image, based on the current weights of each candidate wavelength band; The steps include setting the candidate wavelength band corresponding to the maximum value of the projection residual as the new selected wavelength band, updating the selected wavelength band set and the candidate wavelength band set based on the new selected wavelength band, and updating the current weight of each candidate wavelength band in the updated candidate wavelength band set based on the new selected wavelength band, The steps include: calculating the projection residuals between the components in each candidate wavelength band of the hyperspectral sample image and the components in each selected wavelength band of the hyperspectral sample image, based on the updated current weights of each candidate wavelength band in the updated candidate wavelength band set, until the number of selected wavelength bands in the selected wavelength band set is three; and repeating the subsequent steps. The process may include the step of constructing a pseudo-RGB image of the hyperspectral sample image based on three selected wavelength bands within a set of selected wavelength bands, wherein the three selected wavelength bands are the three representative wavelength bands. The components of each candidate wavelength band differ from those of the selected wavelength band; the wavelength band is represented by the symbol 'b'. Assuming the range of b is from 1 to 100, and the selected wavelength band is b=3, the candidate wavelength bands refer to the remaining 99 wavelength bands within the range of 1 to 100, excluding the 3rd wavelength band. The component in the selected wavelength band of the hyperspectral sample image is represented by I(x,y,3), and the components in the candidate wavelength bands are I(x,y,1), I(x,y,2), I(x,y,4), I(x,y,5), etc. Each component represents the spectral information of the image. For example, I(x,y,3) represents the spectral information of the 3rd wavelength band at the pixel at image coordinates (x,y), and this spectral information generally means spectral radiance or radiant intensity. The components in a specific wavelength band of the hyperspectral sample image are fixed and unrelated to updating. The update in step 102 of this specification refers to the update of wavelength bands. The set of selected wavelength bands is an empty set in the initial state. By calculating the projected residual through weight initialization, one wavelength band (e.g., the 3rd wavelength band) is first selected. The updated set of selected wavelength bands will include the third wavelength band, while the third wavelength band will be excluded from the updated set of candidate wavelength bands, and all other wavelength bands will be retained.
[0027] The step of selectively updating the current weights of each candidate wavelength band in the updated set of candidate wavelength bands based on the newly selected wavelength bands is: The steps include: calculating the correlation coefficient between the components of the hyperspectral sample image in each candidate wavelength band within the updated set of candidate wavelength bands and the components of the hyperspectral sample image in the newly selected wavelength band; The steps include adding up all correlation coefficients to obtain the sum of the correlation coefficients, The process includes the steps of: for each candidate wavelength band in the updated set of candidate wavelength bands, calculating the ratio between the correlation coefficient corresponding to that candidate wavelength band and the sum of the correlation coefficients, and updating the current weight of that candidate wavelength band based on the difference between 1 and the ratio.
[0028] In this example, an adaptive weighting mechanism is introduced based on the existing Successive Projection Algorithm (SPA) to improve the accuracy and suitability of wavelength band selection. Conventional SPA algorithms select wavelength bands based solely on projection residuals and therefore do not adequately consider the differential weights of grain spectral features from different origins. Using soybeans as an example, the steps of the improved algorithm are as follows.
[0029] Initialization: The original set of wavelength bands is B={b1,b2,L,b B The selected wavelength band set S=φ and the candidate wavelength band set C=B are set, and initial weights are assigned to each wavelength band based on prior knowledge of soybean spectral data from different production areas.
number
number
[0030] Iterative process: 1) Projection residuals between each wavelength band in C and S
number
number
number
[0031] Here, when the selected wavelength band set S = φ, I(:, :, b j ) is zero, and the above equation becomes
Equation
[0032] 2) Projection Residual
Equation
Equation
[0033] Construction of the pseudo-RGB image: The three selected wavelength bands b s1 , b s2 , b s3 are mapped to the red (R), green (G), and blue (B) channels respectively, and the calculation formulas are as follows: R(x, y) = I(x, y, b s1 ) G(x, y) = I(x, y, b s2 ) B(x, y) = I(x, y, b s3 )<000管理コマンドにより、システムの状態を変更することができる。Finally, a pseudo-RGB image RGB(x, y) = [R(x, y), G(x, y), B(x, y)] is generated.
[0034] Step 103 involves performing grain instance partitioning on each pseudo-RGB image, identifying the boundaries and positions of each grain within each pseudo-RGB image, and obtaining a partitioning mask corresponding to each pseudo-RGB image.
[0035] In this embodiment, grain instance partitioning is performed, and as an example, an improved Mask R-CNN (Mask Region-based Convolutional Neural Network) model is used to perform instance-level partitioning on a pseudo-RGB image, accurately identifying the boundaries and locations of each grain and obtaining the corresponding mask.
[0036] Here, using soybeans as an example, the Mask R-CNN model is: Feature extraction that generates feature diagrams from pseudo-RGB images via a backbone network. Regional Proposal Networks (RPNs) generate candidate regions based on an anchor box mechanism. The mask branch predicts a binary mask for each candidate region and outputs the boundaries of the soybean instance, and Instance splitting is performed by a category prediction process that determines the probability of the target category output from the category branch as the soybean target.
[0037] The improved Mask R-CNN model may include the following two features: 1. Optimization of the feature extraction network: The backbone network is replaced with ResNext-101, a grouping convolution mechanism is introduced, and the parallel processing of feature channels is controlled by the number of groupings g, thereby enhancing the feature representation capability. The formula for calculating residual blocks is as follows. x l+1 =x l +ResBlock(x l ) Here, ResBlock(x l ) includes a grouped convolutional layer, a batch normalization layer, and an activation function layer.
[0038] 2. Introduction of the attention mechanism: A Spatial Attention Module (SAM) is added after the ROIAlign (Region of Interest Align) layer, and the calculation formula is as follows. M s (F) = σ(f 7*7 ([avgPool(F);maxPool(F)])) Here, F is the input feature diagram, avgPool(·) and maxPool(·) are the average pooling and max pooling operations, respectively, and f 7*7 The ∫ represents a convolutional layer, and σ is the sigmoid activation function. The generated attention weight M s (F) is multiplied with the original feature diagram F to enhance the feature response for the target region of soybeans.
[0039] In step 104, a segmentation mask corresponding to each pseudo-RGB image is used to extract the average spectral information of each grain in the corresponding hyperspectral sample image, and a spectral information matrix is constructed based on the average spectral information of each grain in the hyperspectral sample image.
[0040] In this embodiment, average spectral extraction is performed, and using a division mask, average spectral information for each grain region is extracted from the original hyperspectral image (i.e., hyperspectral sample image) to construct a high-dimensional spectral vector.
[0041] Selectively, step 104 is, For each wavelength band in each hyperspectral sample image, the step of calculating the product between each pixel contained in each grain within the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image and the component of the corresponding pixel in the hyperspectral sample image in that wavelength band. The process may include the steps of: calculating the average of the sum of all products according to the total number of pixels contained in each grain within the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image, thereby obtaining the average spectral information of each grain in the hyperspectral sample image.
[0042] As an example, still using soybeans as an example, for each soybean grain mask M(x,y) output from Mask R-CNN (values are 0 or 1, where 1 indicates a soybean region), we can obtain the average spectral vector from the original hyperspectral image.
number
number
number
[0043] Based on this, the corresponding average spectral information for each soybean grain in each pseudo-RGB image corresponding to a different production area is obtained.
number
number
[0044] In step 105, principal component analysis, local linear embedding, and sparse subspace clustering are sequentially performed on the spectral information matrix to obtain a dimensionality reduction matrix.
[0045] In this embodiment, to overcome the problems of high dimension and high redundancy, a multi-stage dimensionality reduction strategy is constructed, and based on Principal Component Analysis (PCA), Locally Linear Embedding (LLE) and Sparse Subspace Clustering (SSC) algorithms are introduced to dig spectral data features from different angles.
[0046] Selectively, step 105 is, The steps include performing principal component analysis on the spectral information matrix to obtain an initial dimensionality reduction matrix, The steps include: performing nonlinear dimensionality reduction on the initial dimensionality reduction matrix based on a local linear embedding to obtain a quadratic dimensionality reduction matrix; This may include the steps of performing sparse subspace clustering on a two-dimensional reduction matrix and obtaining a reduction matrix based on the clustering results.
[0047] In this embodiment, dimensionality reduction is first performed using principal component analysis (PCA). Exemplarily, a PCA transformation is performed on the spectral information matrix X, which consists of the mean spectral vectors of all soybean samples, and this is projected onto a lower-dimensional subspace. Here, PCA finds the main directions of change in the data by calculating the feature values and feature vectors of the data's covariance matrix Σ. The formula for calculating the covariance matrix is as follows.
number
number
[0048] Based on this, considering the possibility of nonlinear structures existing in the soybean spectral data within low-dimensional space, PCA has difficulty adequately preserving the local geometric features of the data, therefore the LLE algorithm is introduced to X PCA Further processing.
[0049] Here, the LLE algorithm assumes that the data approximates linearly within a local region, calculates local reconstruction coefficients for each data point, and then uses these coefficients to reconstruct the data in a low-dimensional space. The specific steps are as follows: Search for nearby areas: each data point x i Regarding X PCA k LLE Find the nearest neighbors. Calculation of reconstruction coefficients: Minimize the re-reconstruction error.
number
number
number
number
number
[0050] Based on this, the dimensionality is reduced using the LLE algorithm, and then the SSC algorithm is used to select the feature with the highest discriminative power from the data.
[0051] The process of selectively performing sparse subspace clustering on a two-dimensional reduction matrix and obtaining a dimensional reduction matrix based on the clustering results is as follows: The steps include: calculating the similarity between each sample point in a two-dimensional reduction matrix to obtain a similarity matrix; Spectral clustering is performed on the similarity matrix to classify each sample point in the two-dimensional reduction matrix into the same number of clusters as the number of grain-producing region categories, with each cluster corresponding to one subspace in the step, For each subspace, the subspace purity is obtained based on the proportion of the total sample points in the subspace that are most numerous from a single origin, and the classification contribution of the subspace is obtained based on the influence of the subspace on the origin classification results, and the importance of the subspace is obtained based on the subspace purity and classification contribution. For each sample point in the two-dimensional reduction matrix, the average contribution of that sample point to reduce data impurity within each subspace is evaluated based on a random forest model, and the feature contribution of that sample point in each subspace is obtained. The process includes the steps of selecting sample points based on the feature contribution of each sample point in each subspace and the importance of the corresponding subspace, constructing a sparse feature vector based on the selection results, and obtaining a dimensionality reduction matrix.
[0052] In this embodiment, the SSC algorithm assumes that the data comes from multiple subspaces, constructs a sparse representation matrix, and digs into the subspace structure of the data. First, it calculates the similarity matrix S between data points, and S ij This is the data point x i and x j It shows similarities to the above.
number
number
number
number
[0053] In this embodiment, spectral clustering is performed based on a similarity matrix, classifying the data into the same number of clusters as the number of origin categories, with each cluster corresponding to one subspace. In the classification process, by analyzing the spectral features of the matrix, samples within the same subspace have a higher degree of similarity, and the differences between samples in different subspaces become more pronounced, thereby achieving effective grouping that follows the latent structure of the data.
[0054] Here, when selecting key features based on the importance of subspaces and the contribution of features, the importance of subspaces can be comprehensively evaluated from two dimensions.
[0055] First, there is subspace purity. This measures the categorical consistency of samples within a subspace. It can be obtained by calculating the proportion of samples from the most numerous single locality within a subspace to the total samples in that subspace. A higher proportion indicates a greater concentration of locality attributes among the samples within the subspace, and thus a higher subspace purity. For example, if a subspace contains 100 samples, and 80 of them belong to the same locality, the purity of that subspace is 80%.
[0056] Next is classification contribution, which evaluates the influence of subspaces on the origin classification results. A linear classifier can be trained to compare the difference in classification accuracy before and after removing a sample from a certain subspace. The larger the difference (i.e., the more significant the decrease in accuracy), the more important the classification information contained in that subspace is.
[0057] For example, the final importance of a subspace can be obtained by weighting subspace purity (e.g., 60% weight) and classification contribution (e.g., 40% weight), with subspaces having a higher score having a more significant impact on origin tracking.
[0058] Here, when calculating feature contributions, a random forest model can be used to evaluate the discriminative ability of each feature for each subspace. For example, a forest consisting of 100 decision trees can be trained, and the average contribution value of each feature in reducing data impurity in all decision trees can be calculated. A higher contribution value indicates a more significant role of that feature in distinguishing between samples from different origins. For example, a feature may be able to effectively separate samples from different origins in multiple trees, and its contribution value may be significantly higher than that of a randomly separated feature.
[0059] Based on this, key features are selected, and each feature is comprehensively evaluated by combining its feature contribution and subspace importance. Specifically, the final score of a feature is equal to the sum of the products of its feature contribution in each subspace and its corresponding subspace importance. For example, after sorting all features according to their final scores, the top 30% of features can be selected to construct a sparse feature vector. This process allows for the removal of redundant features with low contributions while maintaining key features in important subspaces, significantly reducing the data dimensionality and ensuring the preservation of the most crucial spectral information for origin classification.
[0060] In this embodiment, the multi-stage dimensionality reduction strategy described above effectively overcomes the problems of high dimensionality and high redundancy in hyperspectral data, and significantly improves computational efficiency and model classification performance while maintaining key information in the spectral data.
[0061] In step 106, a fully connected neural network model is trained based on a dimensionality reduction matrix to obtain a grain origin tracking model, and grain origin tracking is performed based on the grain origin tracking model.
[0062] In this embodiment, we classify and discriminate the origin of grains, input the dimensionality reduction matrix into an improved fully connected neural network (FCN) model, perform training and prediction, and output the corresponding grain origin, thereby achieving highly accurate automated tracking.
[0063] For example, the following optimization strategies can be used for an improved fully connected neural network (FCN): Network structure: For an FCN with three hidden layers, the number of neurons can be [256, 128, 64], respectively, and the number of neurons in the output layer is equal to the number of origin categories D. Activation function: The LeakyReLU function is used for the hidden layer.
number
number
[0064] During the model training process, weight parameters can be updated using a backpropagation algorithm.
number
number
number
[0065] To make it understandable, the present invention performs image processing on grains of the same category from different origins to ultimately obtain an origin tracking model for the grains of that category. It is possible to obtain different origin tracking models for different categories of grains from different origins. Here, for grains of the same category, one hyperspectral sample image is collected for each origin, and each hyperspectral sample image contains one or more grain particles. The number of collected hyperspectral sample images is equal to the number of origins, thereby enabling the construction of an origin tracking model that aggregates multiple origin features. For different categories of grains, based on the same method, it is possible to ultimately construct multiple origin tracking models that aggregate multiple origin features, such as an origin tracking model based on soybeans, an origin tracking model based on wheat, or an origin tracking model based on corn. After obtaining a corresponding origin tracking model, a hyperspectral imaging device is used to collect hyperspectral images of the target grain for origin determination. This image is then sequentially processed with wavelength band extraction, mask segmentation, spectral information extraction, and dimensionality reduction. This data is then input into the grain origin tracking model to obtain the probability distribution of origin predictions, and the origin category with the highest probability is selected as the final origin prediction result. Specifically, the hyperspectral imaging device transmits the collected hyperspectral images to a computer via data cable, Ethernet, wireless network, Bluetooth, or other communication methods. Bidirectional control is possible between the hyperspectral imaging device and the computer. The computer's processor performs processes such as wavelength band selection, mask segmentation, spectral information extraction, and dimensionality reduction, and transmits the resulting matrix data to the grain origin tracking model. This model can output the probability distribution of the origin prediction results. This allows for tracking tasks for different origins and different varieties. Conventional origin identification relies on manual visual inspection, physicochemical indicator tests, and DNA testing, resulting in cumbersome procedures, long testing cycles, and high costs. The hyperspectral imaging-based origin identification technology disclosed in this disclosure enables high-speed image acquisition and automated determination using intelligent algorithms. It allows for screening large quantities of samples in a short time, significantly shortening the detection period and meeting the daily large-scale testing needs of testing laboratories. The technology disclosed in this disclosure does not require complex chemical reagents, physicochemical laboratory consumables, or specialized biological testing equipment. Since detection is achieved solely through high-spectral imaging and model recognition, it reduces costs associated with laboratory consumables, labor costs, and equipment operation and maintenance, thereby easing the daily operational burden on testing laboratories. Conventional manual origin identification is highly subjective and relies on experience, making it prone to misjudgments. In contrast, this technology employs quantitative analysis based on spectral features and algorithmic models, ensuring standardization and reproducibility of results and suppressing variability caused by manual judgment.
[0066] This invention provides a grain instance segmentation and origin tracking method based on a combination of hyperspectral imaging and deep learning techniques. Through key steps such as wavelength band selection, image reconstruction, depth segmentation, and spectral classification, this method forms a highly efficient, accurate, and scalable technical solution applicable to automated tracking tasks for grains of multiple origins and varieties.
[0067] The numbering of each step in the above embodiment does not indicate the priority of the execution order. The execution order of each process should be determined by its function and inherent logic, and it should be understood that this does not limit the implementation process of the embodiment of the present invention.
[0068] The following are embodiments of the apparatus of the present invention; for details not described herein, refer to the corresponding embodiments of the method described above.
[0069] Figure 3 shows a schematic diagram of the structure of a grain origin identification device based on hyperspectral images provided in an embodiment of the present invention. For the sake of explanation, only the parts relevant to the embodiment of the present invention are shown and described in detail below.
[0070] As shown in Figure 3, the grain origin identification device based on hyperspectral images includes a collection module 31, a wavelength band extraction module 32, a mask division module 33, a spectral information extraction module 34, a dimensionality reduction module 35, and an origin identification module 36.
[0071] The acquisition module 31 is used to collect hyperspectral sample images of grains from different origins using a hyperspectral imaging instrument. Each hyperspectral sample image contains image information across multiple wavelength bands.
[0072] The wavelength band extraction module 32 is used to determine the initial weights of each wavelength band in each hyperspectral sample image based on the origin corresponding to the hyperspectral sample image, and to construct a pseudo-RGB image of the hyperspectral sample image by selecting three representative wavelength bands based on the initial weights and a continuous projection algorithm.
[0073] The mask division module 33 is used to perform grain instance division on each pseudo-RGB image, identify the boundaries and positions of each grain within each pseudo-RGB image, and obtain a division mask corresponding to each pseudo-RGB image.
[0074] The spectral information extraction module 34 is used to extract the average spectral information of each grain in each corresponding hyperspectral sample image using a division mask corresponding to each pseudo-RGB image, and to construct a spectral information matrix based on the average spectral information of each grain in each hyperspectral sample image.
[0075] The dimensionality reduction module 35 is used to obtain a dimensionality reduction matrix by sequentially performing principal component analysis, local linear embedding, and sparse subspace clustering on the spectral information matrix.
[0076] The origin identification module 36 is used to train a fully connected neural network model based on a dimensionality reduction matrix to obtain a grain origin tracking model, and then to perform grain origin tracking based on the grain origin tracking model.
[0077] In a possible embodiment, the wavelength band extraction module 32 initializes selected wavelength bands and candidate wavelength bands based on the hyperspectral sample image to form a set of selected wavelength bands and a set of candidate wavelength bands, determines the current weight of each candidate wavelength band based on the initial weight of each wavelength band in the hyperspectral sample image, calculates the projection residual between the component in each candidate wavelength band of the hyperspectral sample image and the component in each selected wavelength band of the hyperspectral sample image based on the current weight of each candidate wavelength band, sets the candidate wavelength band corresponding to the maximum value of the projection residual as the new selected wavelength band, and determines the selected wavelength based on the new selected wavelength band. The steps of updating the band set and the candidate wavelength band set, updating the current weight of each candidate wavelength band in the updated candidate wavelength band set based on the new selected wavelength bands, and calculating the projection residual between the component in each candidate wavelength band of the hyperspectral sample image and the component in each selected wavelength band of the hyperspectral sample image based on the updated current weight of each candidate wavelength band in the updated candidate wavelength band set until the number of selected wavelength bands in the selected wavelength band set is three, and the steps of calculating hyperspectral sample image based on the three selected wavelength bands in the selected wavelength band set, can be used to construct a pseudo-RGB image of the hyperspectral sample image based on the three selected wavelength bands in the selected wavelength band set.
[0078] In a possible embodiment, the wavelength band extraction module 32 can calculate the correlation coefficient between the component of the hyperspectral sample image in each candidate wavelength band within the updated candidate wavelength band set and the component of the hyperspectral sample image in the new selected wavelength band, add all the correlation coefficients together to obtain a sum of correlation coefficients, calculate the ratio of the correlation coefficient corresponding to each candidate wavelength band within the updated candidate wavelength band set to the sum of correlation coefficients, and use the difference between 1 and the ratio to update the current weight of the candidate wavelength band.
[0079] In a possible embodiment, the spectral information extraction module 34 can be used to obtain average spectral information for each grain in the hyperspectral sample image by calculating the product of each pixel contained in each grain in the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image and the component of the corresponding pixel in the hyperspectral sample image in that wavelength band, for each wavelength band in each hyperspectral sample image, and calculating the average of the sum of all such products according to the total number of pixels contained in each grain in the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image.
[0080] In a possible embodiment, the dimensionality reduction module 35 can be used to perform principal component analysis on the spectral information matrix to obtain an initial dimensionality reduction matrix, to perform nonlinear dimensionality reduction on the initial dimensionality reduction matrix based on local linear embeddings to obtain a quadratic dimensionality reduction matrix, to perform sparse subspace clustering on the quadratic dimensionality reduction matrix to obtain a dimensionality reduction matrix based on the clustering results.
[0081] In a possible embodiment, the dimensionality reduction module 35 calculates the similarity between each sample point in the two-dimensional reduction matrix to obtain a similarity matrix, performs spectral clustering on the similarity matrix to classify each sample point in the two-dimensional reduction matrix into the same number of clusters as the number of grain origin categories, each cluster corresponds to one subspace, and for each subspace, obtains the subspace purity of the subspace based on the proportion of the total sample points in the subspace that the most numerous single origin sample points in the subspace have, and obtains the classification contribution of the subspace based on the influence of the subspace on the origin classification result, obtains the importance of the subspace based on the subspace purity and the classification contribution, evaluates the average contribution of each sample point in the two-dimensional reduction matrix to reduce data impurity within each subspace based on a random forest model to obtain the feature contribution of the sample point in each subspace, selects sample points based on the feature contribution of each sample point in each subspace and the importance of the corresponding subspace, constructs sparse feature vectors based on the selection results and can be used to form a dimensionality reduction matrix.
[0082] Figure 4 is a schematic diagram of an electronic device provided in an embodiment of the present invention. As shown in Figure 4, the electronic device 4 of this embodiment includes a processor 40 and a memory 41. A computer program 42 is stored in the memory 41. When the computer program 42 is executed by the processor 40, the steps in each embodiment of the above method are performed. Alternatively, when the computer program 42 is executed by the processor 40, the functions of each module / unit in each embodiment of the above device are realized.
[0083] Exemplary, the computer program 42 can be divided into one or more modules / units, which are stored in memory 41 and executed by the processor 40 to complete the present invention. The one or more modules / units are a series of computer program instruction segments that can complete a specific function, and these instruction segments are used to describe the execution process of the computer program 42 in the electronic device 4.
[0084] The electronic device 4 may include, but is not limited to, a processor 40 and memory 41. As those skilled in the art will know, Figure 4 is merely an example of the electronic device 4 and is not limiting to it. It may include more or fewer components than those shown, or some or different components may be combined. For example, the electronic device 4 may also include input / output devices, network access devices, buses, etc.
[0085] The processor 40 may be a Central Processing Unit (CPU), another general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or another programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The general-purpose processor may be a microprocessor or any regular processor, etc.
[0086] Memory 41 may be the internal storage unit of the electronic device 4, for example, the hard disk or memory of the electronic device 4. Memory 41 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., installed in the electronic device 4. Furthermore, memory 41 may include both the internal storage unit and the external storage device of the electronic device 4. Memory 41 is used to store the computer program 42 and other programs and data necessary for the electronic device 4. Memory 41 can also be used to temporarily store data that has already been acquired or is to be output.
[0087] For the sake of clarity and conciseness, the above classification of each functional module / unit has been used as an example; however, in actual application, the above functions can be assigned to different functional modules / units as needed. The above modules / units can be implemented in hardware form, software form, or a combination of hardware and software.
[0088] Embodiments of the present invention further provide a non-temporary computer-readable storage medium in which a computer program is stored. When the computer program is executed by a processor, the methods of each embodiment of the above method are carried out.
[0089] Embodiments of the present invention further provide a computer program product including a computer program. When the computer program is executed by a processor, the methods in each embodiment of the above-described method are carried out.
[0090] Here, a computer program includes computer program code, which may be in the form of source code, object code, an executable file, or some intermediate form. Computer-readable storage media may include any entity or device, recording medium, USB memory, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media that can store computer program code.
[0091] In the embodiments described above, the descriptions of each embodiment differ in their emphasis, and parts not described in detail or stated in one embodiment can be referenced to the relevant descriptions in other embodiments. Unless the specific explanations and logic contradict each other, the terminology and / or descriptions between different embodiments are consistent and can be quoted from one another, and new embodiments can be formed by combining the technical features of different embodiments based on their inherent logical relationships.
[0092] The above embodiments are not intended to limit the technical proposals of the present invention, but are for illustrative purposes only. The present invention can be described in detail by reference to the above embodiments, and as those skilled in the art will understand, the technical proposals described in each of the above embodiments can still be modified or equivalent substitutions can be made for some of their technical features. Such modifications or equivalent substitutions do not cause the essence of the corresponding technical proposals to deviate from the spirit and scope of the technical proposals in each embodiment of the present invention, and all fall within the scope of protection of the present invention.
Claims
1. The steps include: collecting hyperspectral sample images of grains from different origins using a hyperspectral imaging instrument; For each hyperspectral sample image, the initial weights for each wavelength band in the hyperspectral sample image are determined based on the origin corresponding to the hyperspectral sample image, and three representative wavelength bands are selected based on the initial weights and a continuous projection algorithm to construct a pseudo-RGB image of the hyperspectral sample image. The steps include performing grain instance partitioning on each pseudo-RGB image, identifying the boundaries and positions of each grain within each pseudo-RGB image, and obtaining a partitioning mask corresponding to each pseudo-RGB image. The steps include: using a division mask corresponding to each of the pseudo-RGB images to extract the average spectral information of each grain in each of the corresponding hyperspectral sample images, and constructing a spectral information matrix based on the average spectral information of each grain in each of the hyperspectral sample images; The steps include sequentially performing principal component analysis, local linear embedding, and sparse subspace clustering on the spectral information matrix to obtain a dimensionality reduction matrix, The steps include: training a fully connected neural network model based on the dimensionality reduction matrix to obtain a grain origin tracking model, and performing grain origin tracking based on the grain origin tracking model; Here, the step of selecting three representative wavelength bands based on the initial weights and continuous projection algorithm to construct a pseudo-RGB image of the hyperspectral sample image is: The steps include initializing the selected wavelength bands and candidate wavelength bands based on the hyperspectral sample image to construct a set of selected wavelength bands and a set of candidate wavelength bands, and determining the current weight of each candidate wavelength band based on the initial weight of each wavelength band in the hyperspectral sample image. A step of calculating the projection residual between the component in each candidate wavelength band of the hyperspectral sample image and the component in each selected wavelength band of the hyperspectral sample image, based on the current weight of each candidate wavelength band. The steps include setting the candidate wavelength band corresponding to the maximum value of the projection residual as the new selected wavelength band, updating the selected wavelength band set and the candidate wavelength band set based on the new selected wavelength band, and updating the current weight of each candidate wavelength band in the updated candidate wavelength band set based on the new selected wavelength band; The steps include: calculating the projection residual between the component in each candidate wavelength band of the hyperspectral sample image and the component in each selected wavelength band of the hyperspectral sample image, based on the updated current weight of each candidate wavelength band in the updated candidate wavelength band set, until the number of selected wavelength bands in the selected wavelength band set becomes three; and repeating the subsequent steps. The steps include constructing a pseudo-RGB image of the hyperspectral sample image based on three selected wavelength bands within the selected set of wavelength bands, Here, the step of updating the current weight of each candidate wavelength band in the updated set of candidate wavelength bands based on the newly selected wavelength band is: The steps include: calculating the correlation coefficient between the components of the hyperspectral sample image in each candidate wavelength band within the updated set of candidate wavelength bands and the components of the hyperspectral sample image in the newly selected wavelength band; The steps include adding up all the aforementioned correlation coefficients to obtain the sum of the correlation coefficients, The process includes the step of calculating the ratio between the correlation coefficient corresponding to each candidate wavelength band in the updated set of candidate wavelength bands and the sum of the correlation coefficients, and updating the current weight of the candidate wavelength band based on the difference between 1 and the ratio. A method for identifying grain origins based on hyperspectral images, characterized by the following features.
2. The step of extracting the average spectral information of each grain in each corresponding hyperspectral sample image using a division mask corresponding to each of the pseudo-RGB images is as follows: For each wavelength band in each hyperspectral sample image, the step of calculating the product of each pixel contained in each grain within the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image and the component of the corresponding pixel in the hyperspectral sample image in that wavelength band, The step of obtaining average spectral information for each grain in the hyperspectral sample image is calculated by determining the average of the sum of all the aforementioned products according to the total number of pixels contained in each grain within the division mask corresponding to the pseudo-RGB image of the hyperspectral sample image. The method for identifying grain origins based on hyperspectral images as described in feature 1.
3. The step of obtaining a dimensionality reduction matrix by sequentially performing principal component analysis, local linear embedding, and sparse subspace clustering on the spectral information matrix is as follows: The steps include: performing principal component analysis on the spectral information matrix to obtain an initial dimensionality reduction matrix; The steps include: performing nonlinear dimensionality reduction on the initial dimensionality reduction matrix based on a local linear embedding to obtain a two-dimensionality reduction matrix; The process includes the steps of performing sparse subspace clustering on the aforementioned two-dimensional reduction matrix and obtaining a dimensional reduction matrix based on the clustering results. The method for identifying grain origins based on hyperspectral images as described in feature 1.
4. The step of performing sparse subspace clustering on the aforementioned two-dimensional reduction matrix and obtaining a dimensional reduction matrix based on the clustering results is: The steps include: calculating the similarity between each sample point in the aforementioned two-dimensional reduction matrix to obtain a similarity matrix; Perform spectral clustering on the similarity matrix to classify each sample point in the two-dimensional reduction matrix into the same number of clusters as the number of grain producing area categories, with each cluster corresponding to one subspace in the step, For each subspace, the subspace purity of the subspace is obtained based on the proportion of the total sample points of the subspace that are most numerous in the single origin, and the classification contribution of the subspace is obtained based on the influence of the subspace on the origin classification result, and the importance of the subspace is obtained based on the subspace purity and the classification contribution. For each sample point in the aforementioned two-dimensional reduction matrix, the average contribution value of the sample point in reducing data impurities within each subspace is evaluated based on a random forest model to obtain the feature contribution of the sample point in each subspace. The process includes the steps of selecting sample points based on the feature contribution of each sample point in each subspace and the importance of the corresponding subspace, constructing a sparse feature vector based on the selection results, and obtaining a dimensionality reduction matrix. The method for identifying grain origins based on hyperspectral images as described in feature 3.
5. A collection module for collecting hyperspectral sample images of grains from different origins using a hyperspectral imaging instrument, A wavelength band extraction module for constructing a pseudo-RGB image of a hyperspectral sample image by determining the initial weights of each wavelength band in the hyperspectral sample image based on the origin corresponding to the hyperspectral sample image, and selecting three representative wavelength bands based on the initial weights and a continuous projection algorithm. A mask splitting module for performing grain instance splitting on each of the pseudo-RGB images, identifying the boundaries and positions of each grain within each of the pseudo-RGB images, and obtaining a splitting mask corresponding to each of the pseudo-RGB images, A spectral information extraction module for extracting average spectral information for each grain in each corresponding hyperspectral sample image using a division mask corresponding to each pseudo-RGB image, and constructing a spectral information matrix based on the average spectral information for each grain in each hyperspectral sample image, A dimensionality reduction module for obtaining a dimensionality reduction matrix by sequentially performing principal component analysis, local linear embedding, and sparse subspace clustering on the aforementioned spectral information matrix, Includes a grain origin identification module for training a fully connected neural network model based on the dimensionality reduction matrix to obtain a grain origin tracking model, and for performing grain origin tracking based on the grain origin tracking model, Here, the wavelength band extraction module specifically refers to: Based on the hyperspectral sample image, the selected wavelength bands and candidate wavelength bands are initialized to form a set of selected wavelength bands and a set of candidate wavelength bands, and the current weight of each candidate wavelength band is determined based on the initial weight of each wavelength band in the hyperspectral sample image. Based on the current weights of each candidate wavelength band, the projected residuals between the components of the hyperspectral sample image in each candidate wavelength band and the components of the hyperspectral sample image in each selected wavelength band are calculated. The candidate wavelength band corresponding to the maximum value of the projection residual is set as the new selected wavelength band, the selected wavelength band set and the candidate wavelength band set are updated based on the new selected wavelength band, and the current weight of each candidate wavelength band in the updated candidate wavelength band set is updated based on the new selected wavelength band. The steps of calculating the projection residuals between the component in each candidate wavelength band of the hyperspectral sample image and the component in each selected wavelength band of the hyperspectral sample image, based on the updated current weight of each candidate wavelength band in the updated candidate wavelength band set, and the subsequent steps are repeated until the number of selected wavelength bands in the selected wavelength band set is three. Used to construct a pseudo-RGB image of the hyperspectral sample image based on three selected wavelength bands within the aforementioned selected set of wavelength bands, Here, the step of updating the current weight of each candidate wavelength band in the updated set of candidate wavelength bands based on the newly selected wavelength band is: The steps include: calculating the correlation coefficient between the components of the hyperspectral sample image in each candidate wavelength band within the updated set of candidate wavelength bands and the components of the hyperspectral sample image in the newly selected wavelength band; The steps include adding up all the aforementioned correlation coefficients to obtain the sum of the correlation coefficients, The process includes the step of calculating the ratio between the correlation coefficient corresponding to each candidate wavelength band in the updated set of candidate wavelength bands and the sum of the correlation coefficients, and updating the current weight of the candidate wavelength band based on the difference between 1 and the ratio. A grain origin identification device based on hyperspectral imaging, characterized by the following features.
6. The system includes a memory in which a computer program is stored and a processor, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 4 is performed. An electronic device characterized by the following features.
7. A computer program is stored which, when executed by a processor, performs the method described in any one of claims 1 to 4. A non-temporary computer-readable storage medium characterized by the following features.
8. A computer program that, when executed by a processor, performs the method described in any one of claims 1 to 4, A computer program product characterized by the following features.