Rice variety classification method based on hyperspectral data and deep learning technology

By subdividing hyperspectral data into small bands and using a SpectraCNN model with convolutional neural network and hybrid attention mechanism for feature classification, the problem of low classification accuracy caused by the complexity of hyperspectral data is solved, and efficient rice variety classification is achieved.

CN120495734AInactive Publication Date: 2025-08-15JILIN TEACHERS INST OF ENG & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510560936.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-15
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The high dimensions and complex structure of hyperspectral data lead to low classification accuracy of rice varieties, and the traditional methods are complex in processing and poor adaptability.

Method used

The hyperspectral data is subdivided into smaller bands, and the convolutional neural network and hybrid attention mechanism are used for feature extraction and classification, and the SpectraCNN deep learning model is used for feature classification.

Benefits of technology

It improves the accuracy and efficiency of rice variety classification, simplifies the data processing process, and improves the adaptability of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120495734A_ABST
    Figure CN120495734A_ABST
Patent Text Reader

Abstract

The invention provides a rice variety classification method based on hyperspectral data and a deep learning technology. The method comprises the following steps: acquiring hyperspectral images of rice seeds; performing black and white correction operation on the hyperspectral image to obtain a rice seed image; performing distortion processing and binary mask processing on the rice seed image to obtain spectral data; performing structure reconstruction operation on the spectral data to obtain a vector matrix; and performing feature classification operation on the vector matrix through a pre-constructed SpectraCNN deep learning model to obtain a classification result. According to the method, continuous hyperspectral data is subdivided into small wave bands, and the convolutional neural network and the mixed attention mechanism are adopted to perform feature extraction and classification, so that the problem of low classification accuracy caused by high dimension and complex data structure of the hyperspectral data during hyperspectral data screening is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of hyperspectral application technology, and in particular to a rice variety classification method based on hyperspectral data and deep learning technology. Background Art

[0002] In the field of rice seed classification research, traditional techniques such as manual morphological identification, chemical analysis, or biological analysis still play a role in some aspects, but they inevitably bring some challenges, including potential damage to seeds, time-consuming and costly analysis processes, and potential dangers. The rise of hyperspectral imaging technology (HSI) has revolutionized seed classification by providing richer and more detailed spectral information than near-infrared spectroscopy. HSI technology can capture tiny spectral changes in seeds, thereby revealing their external morphology and internal chemical composition, which is crucial for achieving non-destructive and accurate seed classification.

[0003] However, the high dimensionality of hyperspectral imaging (HSI) data introduces significant complexity in data processing. Traditional processing methods, such as feature extraction, feature dimensionality reduction, and denoising, combined with machine learning, are not only cumbersome but also require specific algorithm tuning and feature analysis for different spectral data, which limits the method's adaptability. Therefore, it is necessary to design a rice variety classification method based on hyperspectral data and deep learning technology. Summary of the Invention

[0004] The purpose of this invention is to provide a rice variety classification method based on hyperspectral data and deep learning technology. By subdividing continuous hyperspectral data into smaller bands and using convolutional neural networks and hybrid attention mechanisms for feature extraction and classification, the problem of low classification accuracy during hyperspectral data screening can be solved due to the high dimensionality and complex data structure of hyperspectral data.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] A rice variety classification method based on hyperspectral data and deep learning technology includes the following steps:

[0007] Collect hyperspectral images of rice seeds;

[0008] Perform black and white correction on the hyperspectral image to obtain the rice seed image;

[0009] The rice seed image is distorted and processed with a binary mask to obtain spectral data;

[0010] Perform structural reconstruction on the spectral data to obtain a vector matrix;

[0011] The pre-built SpectraCNN deep learning model is used to perform feature classification operations on the vector matrix to obtain the classification results; the SpectraCNN deep learning model includes: an initial convolutional layer, a depth-wise separable residual block, an attention module, a multi-level convolutional pooling module, and a fully connected classification layer.

[0012] Optionally, the specific steps of collecting hyperspectral images of rice seeds are as follows: 200 rice seeds of the same type are randomly selected and arranged in a 10×20 template, the template is placed on a black translation stage without overlapping or sticking seeds, and the template is scanned with a hyperspectral camera to obtain a hyperspectral image.

[0013] Optionally, performing a black and white correction operation on the hyperspectral image to obtain a rice seed image includes:

[0014] Obtaining light intensity of hyperspectral images;

[0015] According to the formula The light intensity is converted into reflectivity to obtain the rice seed image; where I is the rice seed image, I r is the hyperspectral image, I d is the black reference, I w The white reference.

[0016] Optionally, the rice seed image is subjected to distortion processing and binary mask processing to obtain spectral data, including:

[0017] removing edge regions or distorted images from the rice seed image to obtain a preprocessed image;

[0018] determining a base image in the preprocessed image based on spectral differences;

[0019] Convert the base image into a binary image according to the preset grayscale threshold;

[0020] Extract pixel coordinates from binary images;

[0021] Statistical calculations are performed based on pixel coordinates to obtain spectral data; statistical calculations include mean calculation, median calculation, and mode calculation.

[0022] Optionally, extract pixel coordinates in a binary image, including:

[0023] Extract boundary contours from binary images using connected component analysis;

[0024] Perform contour filling operation on the boundary contour to obtain the seed area mask;

[0025] Traverse the seed region mask and integrate all pixel positions where the mask value is 1 into pixel coordinates.

[0026] Optionally, the specific steps of mean calculation are: obtain the pixel grayscale value in the binary image, and use the formula Calculate the mean of the pixel grayscale value; where λ k is the wavelength, (x i ,y i ) is the pixel coordinate, H(·) is the reflection value, and n is the total number of pixels;

[0027] The specific steps of median calculation are: obtain the spectral values in the binary image, arrange the spectral values in ascending order, and use the formula Calculate the median of the spectrum values; where median(·) is the median operation.

[0028] Optionally, a structure reconstruction operation is performed on the spectral data to obtain a vector matrix, including:

[0029] Convert spectral data into one-dimensional feature vectors;

[0030] Divide the one-dimensional feature vector into multiple sub-band vectors;

[0031] The sub-band vectors are combined row by row to form a vector matrix; the expression of the vector matrix is: Among them, F (21) is the 21st sub-band vector of the spectral data, f 462 is the statistical characteristic value of the 462nd band.

[0032] Optionally, perform feature classification operations on the vector matrix using a pre-built SpectraCNN deep learning model to obtain classification results, including:

[0033] The vector matrix is sequentially subjected to 1×1 convolution and 3×3 convolution operations through the initial convolution layer to obtain convolution features;

[0034] The convolutional features are sequentially subjected to single-channel convolution, channel fusion, and residual connection operations through the depth-separable residual block to obtain the residual features;

[0035] The attention module performs channel attention and spatial attention extraction operations on the residual features in sequence to obtain the attention features;

[0036] The attention features are pooled through a multi-level convolutional pooling module to obtain pooled features;

[0037] The pooled features are flattened or globally averaged pooled through the fully connected classification layer to obtain the classification results.

[0038] According to a specific embodiment provided by the present invention, the present invention discloses the following technical effects: The present invention provides a rice variety classification method based on hyperspectral data and deep learning technology, which includes collecting hyperspectral images of rice seeds; performing black and white correction operations on the hyperspectral images to obtain rice seed images; performing distortion processing and binary masking on the rice seed images to obtain spectral data; performing structural reconstruction operations on the spectral data to obtain a vector matrix; and performing feature classification operations on the vector matrix using a pre-built SpectraCNN deep learning model to obtain classification results. This method solves the problem of low classification accuracy during hyperspectral data screening due to the high dimensionality and complex data structure of hyperspectral data by subdividing continuous hyperspectral data into smaller bands and using convolutional neural networks and hybrid attention mechanisms for feature extraction and classification. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0040] Figure 1 This is a flow chart of the rice variety classification method of the present invention;

[0041] Figure 2 This is a flow chart of the feature classification operation for a vector matrix according to the present invention. DETAILED DESCRIPTION

[0042] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0043] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0044] like Figure 1 As shown, the present invention provides a rice variety classification method based on hyperspectral data and deep learning technology, comprising the following steps:

[0045] Step 100: Collecting hyperspectral images of rice seeds;

[0046] Specifically, this example uses a hyperspectral imaging device to collect hyperspectral images and image data of rice seeds. The device includes a CCD camera, a hyperspectral camera, a mounting tower, an illumination assembly, a linear translation stage, a power supply for the illumination assembly, and a hyperspectral imaging spectrometer. The hyperspectral imaging spectrometer covers a spectral range of 392.38 nm to 1011.01 nm, has 462 bands, a wavelength interval of 50 μm, a spatial resolution of 0.15 mm / pixel, and a spectral resolution of 1.3 nm. The image data is processed and analyzed using data analysis software such as ENVI 5.3, The Unscrambler X 10.4, Excel 2019, Origin 2018, MATLAB R 2020, or PyCharm.

[0047] Specifically, 200 rice seeds of the same type were randomly selected and arranged in a 10×20 template. The template was then placed on a black translation stage, ensuring no seeds overlapped or adhered to each other. A hyperspectral camera was used to scan the template, acquiring hyperspectral and RGB images. This process was repeated, collecting five hyperspectral images for each category, for a total of 15 images, encompassing a total of 3,000 rice seeds.

[0048] Step 200: performing a black and white correction operation on the hyperspectral image to obtain a rice seed image;

[0049] Specifically, the light intensity of the hyperspectral image is first obtained. Due to the uneven distribution of light intensity and the presence of dark current in the CCD camera, the light radiation energy of each band is uneven. Therefore, the black and white correction operation is achieved by converting the light intensity into reflectance. The formula for converting light intensity to reflectance is:

[0050]

[0051] Among them, I is the corrected rice seed image, I r is the original hyperspectral image, I d is a black reference obtained by completely covering the lens of the hyperspectral camera using a black lens cover, I w This is a white benchmark obtained using a standard polyurethane whiteboard.

[0052] Step 300: performing distortion processing and binary mask processing on the rice seed image to obtain spectral data;

[0053] Specifically, the corrected rice seed image is preprocessed to eliminate the reflection effect introduced by part of the image during the translation stage, thereby improving the accuracy of subsequent segmentation. First, the edge area or the obviously distorted image part in the rice seed image is removed to ensure the stability of the image quality used for seed identification. Then, a binary mask for marking the seed outline is obtained. In this embodiment, by analyzing the spectral difference between the sample and the background in each band of hyperspectral images, it is determined that in the image with a wavelength of 656.1300nm (i.e., the 200th band), the grayscale contrast between the sample and the background is the most obvious, so this band image is selected as the basic image for mask extraction. On the basis of this basic image, an appropriate grayscale threshold is set for the band image to generate an initial binary image. Based on the binary image, the connected region analysis method is used to extract the boundary outline of each rice grain. Then, a contour filling operation is performed on the extracted boundary contour area to generate a complete seed area mask. After traversing the filled area mask, all pixel positions with a mask value of 1 (or 255) are extracted as a coordinate point set. (i.e., the pixel coordinate set of the rice grain.) Based on the obtained pixel coordinates, mean, median, and mode calculations are performed on each wavelength channel in the hyperspectral image (a total of 462 in this embodiment) to obtain characteristic information of each rice grain in different spectral dimensions.

[0054] More specifically, for each wavelength λ k , calculate the average value of all pixel gray values in the grain area to perform mean calculation. The specific calculation formula is:

[0055] Among them, (x i ,y i ) is the pixel coordinate, H(x i ,y i ,λ k ) represents the wavelength λ k , pixel coordinates (x i ,y i ), where n is the total number of pixels in the area;

[0056] The wavelength λ k The spectral values of all pixels are arranged in ascending order, and the median is taken as the median spectral value. The specific calculation formula is:

[0057]

[0058] Among them, median(·) is the median operation.

[0059] mode k The specific calculation formula is:

[0060]

[0061] Where v is a possible grayscale value, and the function #{·} represents the number of pixels that meet the condition. This embodiment generates three data sets through three statistical calculations: a mean data set, a median data set, and a mode data set. Each data set contains 462 features, which is equal to the number of wavelengths.

[0062] Step 400: Performing a structural reconstruction operation on the spectral data to obtain a vector matrix;

[0063] Specifically, in order to reduce the dimension of hyperspectral data and extract stable and effective features, the original hyperspectral data containing 462 bands was restructured and converted into a 21×22 eigenvector matrix, which not only simplified the data structure but also retained the core information.

[0064] First, the spectral data is converted into a one-dimensional feature vector F = [f1, f2, ..., f 462 ], where f i Represents the grayscale statistical value of the hyperspectral image in the i-th band (can be the mean, mode or median). Then the 462-dimensional vector is divided into 21 larger sub-bands, each of which contains 22 continuous bands. The division process is expressed as follows:

[0065] F (j) =[f (j-1)×22+1 ,f (j-1)×22+2 ,…,f j×22 ],j=1,2,…,21;

[0066] Where j represents the jth sub-band. Each sub-band vector F (j) Each is a 1×22 local sub-feature vector. Then all sub-band vectors F (j) Combining rows together, we form a two-dimensional feature matrix M (dimension is 21×22), which is expressed as:

[0067]

[0068] Among them, f i is the statistical characteristic value of the i-th band.

[0069] Step 500: Perform feature classification operations on the vector matrix using the pre-built SpectraCNN deep learning model to obtain classification results.

[0070] Specifically, the SpectraCNN deep learning model includes: an initial convolutional layer, a depthwise separable residual block, an attention module, a multi-level convolutional pooling module, and a fully connected classification layer. The initial convolutional layer extracts low-level features from the input single-channel data through a cascade of 1×1 convolution and 3×3 convolution, and enhances the nonlinear expression capability through batch normalization and LeakyReLU activation function. The depthwise separable residual block uses a combination of grouped convolution and pointwise convolution to effectively alleviate the gradient vanishing problem through residual connections while maintaining a low number of parameters. The attention module uses channel and spatial attention mechanisms to weight the feature maps output by the depthwise separable residual block to highlight key information. The multi-level convolutional pooling module further improves the feature abstraction capability and gradually reduces the spatial dimension of the feature map. Finally, the fully connected classification layer maps the high-dimensional features output by the convolutional layer to a preset category space to achieve efficient classification of the spectral data. Through the hierarchical collaboration of each module, the feature expression and classification performance of the spectral data can be significantly improved while ensuring computational efficiency.

[0071] More specifically, the specific implementation process of this embodiment is as follows Figure 2 Shown, including:

[0072] Step 501: Perform 1×1 convolution and 3×3 convolution operations on the vector matrix in sequence through the initial convolution layer to obtain convolution features;

[0073] Furthermore, the channel dimension of the vector matrix is adjusted and mapped by 1×1 convolution without changing the input spatial resolution. The process formula of 1×1 convolution is:

[0074]

[0075] in, is a single-channel input spectrum (feature tensor), W (1×1) is a 1×1 convolution kernel, c is the number of feature channels, h is the height index of the current position in the feature map, w is the width index of the current position in the feature map, c' represents the input channel index of the input feature map (in this embodiment, there is only one input channel, so c'=1), b c The corresponding bias term of the output channel c. After completing the channel adjustment (expansion or compression), 3×3 convolution is further used to extract local neighborhood information. The process formula of 3×3 convolution is:

[0076]

[0077] And through batch normalization (Batch Normalization) and LeakyReLU activation function to ensure the stability of the training process, in order to enhance the nonlinear characterization ability of the model, the process formula is: X(out) =LeakyReLU(BN(X (2) )), where BN stands for batch normalization.

[0078] It should be noted that traditional image convolutional networks typically use 3×3 or 7×7 convolutions for initial feature extraction. However, this invention first uses 1×1 convolutions to perform "channel reconstruction" on single-channel data, allowing subsequent convolutional layers to gain more freedom of expression in the channel dimension. This not only improves the ability to analyze spectrogram data but also reduces computational redundancy in early layers.

[0079] Step 502: Perform single-channel convolution, channel fusion, and residual connection operations on the convolution features in sequence through a depth-wise separable residual block to obtain residual features;

[0080] Furthermore, depthwise separable convolution splits the traditional convolution operation: first performing "depthwise convolution" or "grouped convolution" and then "pointwise convolution", thereby significantly reducing the number of parameters. The present invention combines this with residual connections to further improve the trainability of the network.

[0081] In this embodiment, the convolution feature is first convolved separately through the channel by the function depthwise=nn.Conv2d(in_channels, in_channels, kernel_size=3, groups=in_channels), that is, depth or group convolution is performed. The process formula is:

[0082]

[0083] Among them, w (dw) Each channel is independent, dw refers to depthwise convolution (depth convolution), that is, each input channel corresponds to an independent convolution kernel for convolution operation, without mixing features between different channels, and k defines the receptive field radius of the convolution kernel. Then, the function pointwise = nn.Conv2d(in_channels, out_channels, kernel_size = 1) is used to perform channel fusion, that is, point-by-point convolution. The process formula is:

[0084]

[0085] During the channel fusion process, when the number of input and output channels is inconsistent, a 1×1 convolution with residual connection is used to ensure dimension matching. The process expression is:

[0086] Y=F (pw) +f(X);

[0087] Where Y is the feature tensor at any stage, and f(·) is the identity mapping or 1×1 convolution operation to match the number of input and output channels.

[0088] It should be noted that unlike standard depthwise separable convolution, which only divides channels by channel, this embodiment incorporates a "grouping" strategy, dividing channels into groups based on channel correlation for convolution operations. Even after data expansion on a single channel, grouped convolution can still be used to reduce redundant parameters. Adding input and output features through residual connections can alleviate the vanishing gradient problem that can occur in deep networks while also preserving the original spectral feature information.

[0089] Step 503: The attention module performs channel attention and spatial attention extraction operations on the residual features in sequence to obtain attention features;

[0090] Specifically, channel attention performs channel weighting on the residual features through global pooling, and then performs maximum pooling and average pooling again. The two pooling results are spliced through 7×7 convolution and then spatially weighted to complete the extraction process of attention features. The expression in this embodiment is as follows:

[0091]

[0092] α c =σ(W2δ(W1s)) c ;

[0093]

[0094] M spatial =σ(Conv([M (max) ,M (avg) ]));

[0095]

[0096] Among them, α is the negative slope of LeakyReLU, δ(·) is the ReLU activation function, and σ(·) is the Sigmoid function.

[0097] It should be noted that channel weighting on the output of grouped or depthwise convolution can highlight the contribution of different channel groups to classification in a more granular manner. In the spatial dimension of spectral data, the focus area is obtained through maximum pooling and average pooling. Especially for two-dimensional representations, spatial attention can be more focused on the local information in specific bands or adjacent feature points that is most discriminative for classification.

[0098] Step 504: performing a pooling operation on the attention feature through a multi-level convolutional pooling module to obtain a pooled feature;

[0099] Specifically, after each convolution block, nn.MaxPool2d(2) is used to downsample the attention features (i.e., multiple convolution operations), while increasing the channel dimension (from 32->48->64->128) to continuously improve the feature dimension and extract higher-level features. A pooling layer is used after each or every few convolution blocks to reduce the spatial size, significantly reducing the amount of computation while preserving key semantics.

[0100] More specifically, the downsampling operation is expressed as:

[0101] Z (l+1) =Act(BN(Conv(Z (l) )));

[0102] Conv(·) represents the convolution operation, BN(·) represents batch normalization, and Act(·) represents the activation function. The expression of the pooling operation in the pooling layer is:

[0103]

[0104] Where p = 2

[0105] It should be noted that spectral data usually has a low resolution. Directly using multiple pooling operations can easily lead to over-compression. This embodiment appropriately controls the number of pooling operations and convolutions in the encoding structure to ensure that good abstraction capabilities can be obtained without losing important details.

[0106] Step 505: Flatten or perform global average pooling on the pooled features through the fully connected classification layer to obtain the classification result.

[0107] Specifically, the high-dimensional feature map (pooled features) output by the multi-level convolutional pooling module is flattened or globally averaged to obtain a 1D feature vector. The 1D feature vector is then mapped to the preset number of categories K to complete the classification task.

[0108] More specifically, the expression for the flatten operation is:

[0109] The expression of the global average pooling operation is:

[0110] The expression of the mapping process is: o = W fc z+b fc ;

[0111] Among them, o is the output vector of the fully connected classification layer, and z is the vector representation after flattening or global pooling.

[0112] The beneficial effects of the present invention are as follows:

[0113] 1) By using depthwise separable convolutional layers, the traditional convolution operation is decomposed into depthwise convolution and pointwise convolution, which effectively reduces the number of model parameters and computational complexity while maintaining efficient feature extraction capabilities;

[0114] 2) Channel attention identifies and highlights important channel features, while spatial attention focuses on capturing key position information in the image. This dual-perspective attention mechanism enables the SpectraCNN model to automatically focus on key channels and spatial regions in the input features, significantly improving the model's performance and generalization capabilities.

[0115] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0116] The present invention uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims

1. A rice variety classification method based on hyperspectral data and deep learning technology, characterized in that: The steps include: Collect hyperspectral images of rice seeds; performing a black and white correction operation on the hyperspectral image to obtain a rice seed image; performing distortion processing and binary mask processing on the rice seed image to obtain spectral data; Performing a structural reconstruction operation on the spectral data to obtain a vector matrix; Performing feature classification operations on the vector matrix using a pre-built SpectraCNN deep learning model to obtain a classification result; The SpectraCNN deep learning model includes: an initial convolutional layer, a depth-separable residual block, an attention module, a multi-level convolutional pooling module and a fully connected classification layer.

2. The rice variety classification method based on hyperspectral data and deep learning technology according to claim 1, characterized in that: The specific steps for collecting hyperspectral images of rice seeds are as follows: 200 rice seeds of the same type are randomly selected and arranged in a 10×20 template, the template is placed on a black translation stage without overlapping or sticking seeds, and the template is scanned using a hyperspectral camera to obtain the hyperspectral image.

3. The rice variety classification method based on hyperspectral data and deep learning technology according to claim 1, characterized in that: Performing a black and white correction operation on the hyperspectral image to obtain a rice seed image includes: Acquiring the light intensity of the hyperspectral image; According to the formula The light intensity is converted into reflectivity to obtain the rice seed image; wherein, I is the rice seed image, I r is the hyperspectral image, I d is the black reference, I w The white reference.

4. The rice variety classification method based on hyperspectral data and deep learning technology according to claim 1, characterized in that: The rice seed image is subjected to distortion processing and binary mask processing to obtain spectral data, including: removing edge regions or distorted images from the rice seed image to obtain a preprocessed image; determining a base image in the preprocessed image according to the spectral difference; Converting the base image into a binary image according to a preset grayscale threshold; Extracting pixel coordinates in the binary image; Statistical calculation is performed according to the pixel coordinates to obtain the spectral data; the statistical calculation includes: mean calculation, median calculation and mode calculation.

5. The rice variety classification method based on hyperspectral data and deep learning technology according to claim 4, characterized in that: Extracting pixel coordinates from the binary image, including: Extracting the boundary contour in the binary image by connected component analysis; Performing a contour filling operation on the boundary contour to obtain a seed region mask; The seed region mask is traversed, and all pixel positions with a mask value of 1 are integrated into the pixel coordinates.

6. The rice variety classification method based on hyperspectral data and deep learning technology according to claim 4, characterized in that: The specific steps of the mean calculation are: obtaining the pixel grayscale value in the binary image, and using the formula Calculate the mean of the pixel grayscale values; where λ k is the wavelength, (x i ,y i ) is the pixel coordinate, H(·) is the reflection value, and n is the total number of pixels; The specific steps of calculating the median are: obtaining the spectral values in the binary image, arranging the spectral values in ascending order, and calculating the median value by the formula The median of the spectral values is calculated; wherein median(·) is a median operation.

7. The rice variety classification method based on hyperspectral data and deep learning technology according to claim 1, characterized in that: Performing a structural reconstruction operation on the spectral data to obtain a vector matrix, including: Converting the spectral data into a one-dimensional feature vector; Dividing the one-dimensional feature vector into a plurality of sub-band vectors; The sub-band vectors are combined row by row to form the vector matrix; the expression of the vector matrix is: Among them, F (21) is the 21st sub-band vector of the spectral data, f 462 is the statistical characteristic value of the 462nd band.

8. The rice variety classification method based on hyperspectral data and deep learning technology according to claim 1, characterized in that: The pre-built SpectraCNN deep learning model is used to perform feature classification operations on the vector matrix to obtain classification results, including: Performing 1×1 convolution and 3×3 convolution operations on the vector matrix in sequence through the initial convolution layer to obtain convolution features; Performing single-channel convolution, channel fusion, and residual connection operations on the convolution features in sequence through the depth-wise separable residual block to obtain residual features; Performing channel attention and spatial attention extraction operations on the residual features in sequence through the attention module to obtain attention features; Performing a pooling operation on the attention feature through the multi-level convolution pooling module to obtain a pooling feature; The pooled features are flattened or globally averaged pooled through the fully connected classification layer to obtain the classification result.