A wheat seed classification method based on multi-scale feature extraction
Through multi-scale deep learning network and continuous projection algorithm, multi-scale features of hyperspectral data are extracted, which solves the problem of low wheat seed classification accuracy in the existing technology and achieves fast and non-destructive wheat seed purity detection.
Patent Information
- Application Number
- CN202110253970.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-09
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-03-09
AI Technical Summary
Existing hyperspectral image classification methods rely on manual experience and are difficult to fully mine hyperspectral data features, resulting in low accuracy in wheat seed purity detection. Moreover, traditional methods are time-consuming and labor-intensive and cannot meet the rapid non-destructive testing needs of modern agriculture.
Using a method based on multi-scale deep learning network, multi-scale three-dimensional convolution kernels are used to extract features from the spatial and spectral dimensions, and combined with the continuous projection algorithm for dimensionality reduction, a wheat seed classification model is constructed to improve classification accuracy and generalization performance.
It significantly improves the accuracy of wheat seed classification and the robustness of the model, shortens the training time of the deep learning model, and achieves effective information retention and rapid non-destructive detection of hyperspectral data.
Smart Images

Figure CN112949725B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of hyperspectral technology, and in particular to a wheat seed classification method based on multi-scale feature extraction. Background Art
[0002] Wheat is one of the most widely distributed food crops in the world, and wheat seeds occupy an important position in its agricultural production. The development of bio-breeding technology has cultivated many excellent varieties. Different varieties have different roles in food, winemaking and fuel making. In the process of applying bio-breeding technology, it is necessary to collect seeds of superior varieties. However, the admixture of other varieties is inevitable during the seed collection process, which will reduce the purity of the superior variety seeds and thus lead to a decrease in wheat yield. Therefore, it is of great significance to conduct seed purity testing to reduce the mixing of other varieties.
[0003] Traditional seed purity detection methods include morphological methods and phenol staining methods. These traditional methods are time-consuming and labor-intensive, and will damage seeds, which is contrary to the requirements of rapid and non-destructive testing in modern agriculture. In recent years, with the development of spectral imaging technology, non-destructive testing based on hyperspectral imaging technology has been increasingly used in agriculture. When using hyperspectral imaging technology for seed purity detection, the features of hyperspectral image data are extracted for classification to distinguish different varieties of seeds. However, the existing hyperspectral image classification methods require manual extraction of spectral features, texture features or morphological features, resulting in the extraction of original features relying on manual experience and difficulty in fully mining hyperspectral image data. In addition, the learning criteria for feature selection and extraction are difficult to unify with the learning criteria of the classifier, resulting in difficulty in ensuring the accuracy of classification and low accuracy of seed purity detection results. Summary of the invention
[0004] In view of the above problems and technical requirements, the inventors have proposed a wheat seed classification method based on multi-scale feature extraction. The technical solution of the present invention is as follows:
[0005] A wheat seed classification method based on multi-scale feature extraction, the method comprising:
[0006] Acquire hyperspectral images of several wheat seed samples of different varieties as sample images;
[0007] Perform dimensionality reduction processing on each sample image;
[0008] A wheat seed classification model is obtained by training a model using sample images after dimensionality reduction based on a multi-scale deep learning network structure; wherein the multi-scale deep learning network structure includes a multi-scale convolution layer, a fully connected layer and a classifier connected in sequence, the multi-scale convolution layer includes a plurality of convolution units, each of which includes a three-dimensional convolution kernel, and the three-dimensional convolution kernel in the multi-scale convolution layer has at least two different scale types at least in the spectral dimension; the multi-scale convolution layer uses each convolution unit to extract features of the sample image from a two-dimensional spatial dimension and a one-dimensional spectral dimension, and the features extracted by all the convolution units are fused in the channel dimension and output;
[0009] A hyperspectral image to be classified containing wheat seeds to be classified is obtained, and the hyperspectral image to be classified is subjected to dimensionality reduction processing and then input into a wheat seed classification model to obtain variety classification results of each wheat seed in the hyperspectral image to be classified.
[0010] A further technical solution is that the three-dimensional convolution kernel in the multi-scale convolution layer has at least two different scale types in the spatial dimension and the spectral dimension respectively.
[0011] A further technical solution is that when the three-dimensional convolution kernels in the multi-scale convolution layer have p different scale types in the spatial dimension and q different scale types in the spectral dimension, the multi-scale convolution layer includes a total of p*q three-dimensional convolution kernels of different scale types, p≥2, q≥2, and the number of three-dimensional convolution kernels of various scale types is equal to M is the number of convolutional units included in the multi-scale convolutional layer.
[0012] Its further technical solution is that the multi-scale deep learning network structure includes at least two multi-scale convolutional layers cascaded in sequence, each multi-scale convolutional layer includes a number of convolutional units, each multi-scale convolutional layer includes a three-dimensional convolutional kernel of the same scale type, and the number of convolutional units included in each multi-scale convolutional layer doubles along the cascade direction.
[0013] Its further technical solution is that each convolution unit of the multi-scale convolution layer includes a three-dimensional convolution kernel, a batch normalization layer, an activation function layer and a three-dimensional pooling layer connected in sequence from input to output, and the activation function layer uses LeaKy_ReLU as the activation function.
[0014] Its further technical solution is to add dropout to the fully connected layer, use the Softmax classifier as the classifier, use the cross entropy as the loss function in the multi-scale deep learning network structure and use the Adam gradient descent optimization algorithm.
[0015] A further technical solution is to perform dimensionality reduction processing on each sample image, including:
[0016] Obtain the mean spectral feature of each band of the sample image as the band feature vector of the band;
[0017] The characteristic bands are selected based on the band characteristic vectors of all bands using the continuous projection algorithm;
[0018] The image data under the characteristic band of the sample image is extracted to form the sample image after dimensionality reduction.
[0019] A further technical solution is to obtain hyperspectral images of several wheat seed samples of different varieties as sample images, including:
[0020] Collecting original seed images of wheat seed samples of each variety, the original seed images including a hyperspectral image of the area where the wheat seed samples are located and a hyperspectral image of the background area;
[0021] A hyperspectral image of the area where the wheat seed sample is located is extracted from the original seed image, and the blank part is filled with zeros to obtain a sample image of a predetermined image size. The image sizes of the sample images of all wheat seed samples are equal.
[0022] A further technical solution is to extract a hyperspectral image of the area where the wheat seed sample is located from the original seed image, including:
[0023] After collecting the original seed image, use The spectral reflectance of each pixel in the original seed image is processed to obtain a corrected original seed image, and the spectral reflectance of each pixel in the corrected original seed image is in the range of [0,1]; wherein I0 is the spectral reflectance of a pixel in the original seed image, I is the spectral reflectance of the corresponding pixel after data processing, D is the spectral reflectance of the corresponding pixel in the standard blackboard image, and W is the spectral reflectance of the corresponding pixel in the standard whiteboard image;
[0024] A hyperspectral image of the area where the wheat seed sample is located is extracted from the corrected original seed image.
[0025] A further technical solution is to extract a hyperspectral image of the area where the wheat seed sample is located from the original seed image, including:
[0026] The threshold segmentation method is used to extract the area where the wheat seed sample is located in the original seed image from the image in the predetermined band to generate a binary mask;
[0027] The binary mask is multiplied with the original seed image to obtain a hyperspectral image of the area where the wheat seed sample is located.
[0028] The beneficial technical effects of the present invention are:
[0029] The present application discloses a wheat seed classification method based on multi-scale feature extraction. The method improves the structure of the multi-scale deep learning network structure used for modeling, and utilizes a multi-scale three-dimensional convolution kernel for feature extraction. It can extract information of different scales from spatial and spectral dimensions, and fully mine the features in hyperspectral data, thereby greatly improving the classification accuracy of the trained model, improving the accuracy of wheat seed classification, and having good generalization performance and good robustness.
[0030] In addition, the present application can effectively reduce the dimension of hyperspectral image data while retaining the effective information in the hyperspectral image data to the greatest extent through the SPA algorithm combined with the hyperspectral mean spectral features, thereby greatly shortening the training time of the deep learning model. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a schematic diagram of the process of the wheat seed classification method of the present application.
[0032] Figure 2 It is a schematic diagram of the process of extracting a sample image from an original seed image in this application.
[0033] Figure 3 It is a structural diagram of the multi-scale deep learning network structure used in this application. DETAILED DESCRIPTION
[0034] The specific implementation of the present invention will be further described below in conjunction with the accompanying drawings.
[0035] This application discloses a wheat seed classification method based on multi-scale feature extraction, please refer to Figure 1 The method comprises the following steps:
[0036] Step S1, obtaining hyperspectral images of several wheat seed samples of different varieties as sample images. Specifically, the steps include:
[0037] (1) Place wheat seed samples of each variety on a black plastic counting plate with grooves, and use a hyperspectral camera to capture the original seed image of the wheat seed sample. The original seed image obtained at this time includes a hyperspectral image of the area where the wheat seed sample is located and a hyperspectral image of the background area. In this application, the hyperspectral camera used covers 300 bands in the spectral range of 400-1000nm (spectral resolution 2nm).
[0038] (2) Extracting a hyperspectral image of the area where the wheat seed sample is located from the original seed image. Optionally, before extracting a hyperspectral image of the area where the wheat seed sample is located from the original seed image, the present application first corrects the original seed image. The spectral reflectance of each pixel in the original seed image is processed to obtain the corrected original seed image, and the spectral reflectance of each pixel in the corrected original seed image is in the range of [0,1]; where I0 is the spectral reflectance of a pixel in the original seed image, I is the spectral reflectance of the corresponding pixel after data processing, D is the spectral reflectance of the corresponding pixel in the standard blackboard image, and W is the spectral reflectance of the corresponding pixel in the standard whiteboard image. This correction preprocessing operation can reduce the impact of light source intensity fluctuations on hyperspectral images.
[0039] Then, the hyperspectral image of the area where the wheat seed sample is located is extracted from the corrected original seed image. Figure 2 The extraction schematic diagram shown uses the threshold segmentation method to extract the area where the wheat seed sample is located in the original seed image from the image in the predetermined band, and generates a binary mask. In this application, the predetermined band is selected as the 701.9nm band. Then, the binary mask is multiplied by the original seed image to extract the hyperspectral image of the area where the wheat seed sample is located.
[0040] After extracting the hyperspectral image of the area where the wheat seed samples are located, the blank part is filled with zeros to obtain a sample image of a predetermined image size, so that the image sizes of the sample images of all wheat seed samples are equal.
[0041] Step S2, dimensionality reduction processing is performed on each sample image. This application uses a continuous projection algorithm (SPA algorithm) to compress the sample image. The specific operation is as follows: the mean spectral characteristics of each band of the sample image are obtained as the band feature vector of the band, and then the continuous projection algorithm is used to select the characteristic band based on the band feature vectors of all bands, and then the image data under the characteristic band of the sample image is extracted to form the sample image after dimensionality reduction, so as to achieve the purpose of compressing data. The specific operation process of the continuous projection algorithm is not repeated in this application.
[0042] Step S3, based on the multi-scale deep learning network structure, the model is trained using each sample image after dimensionality reduction to obtain a wheat seed classification model.
[0043] The multi-scale deep learning network structure in this application is based on a deep convolutional neural network structure, but is different from the traditional deep convolutional neural network structure in that it uses a multi-scale three-dimensional convolution kernel to replace the convolution operation in the ordinary deep convolutional neural network structure. Figure 3As shown, the multi-scale deep learning network structure includes a multi-scale convolution layer, a fully connected layer and a classifier connected in sequence. A multi-scale convolution layer includes several convolution units, each of which includes a three-dimensional convolution kernel. The scale of a three-dimensional convolution kernel can be expressed as a*b*c, where a*b is the scale of the three-dimensional convolution kernel in the two-dimensional spatial dimension, and c is the scale of the three-dimensional convolution kernel in the one-dimensional spectral dimension. For example, if the scale of a three-dimensional convolution kernel is 5*5*5, then its scale in the spatial dimension is 5*5 and its scale in the spectral dimension is 5. And all three-dimensional convolution kernels in a multi-scale convolution layer have at least two different scale types at least in the spectral dimension. Further in the present application, all three-dimensional convolution kernels in a multi-scale convolution layer have at least two different scale types in the spatial dimension and the spectral dimension, respectively.
[0044] Optionally, when the three-dimensional convolution kernels in the multi-scale convolution layer have p different scale types in the spatial dimension and q different scale types in the spectral dimension, the multi-scale convolution layer includes a total of p*q three-dimensional convolution kernels of different scale types, p ≥ 2, q ≥ 2, and the number of three-dimensional convolution kernels of different scale types is equal to M is the number of convolutional units included in the multi-scale convolutional layer. For example, please refer to Figure 3 As shown in the example figure, when p=q=2, assuming that the three-dimensional convolution kernel in the multi-scale convolution layer has two different scale types in the spatial dimension, namely 3*3 and 5*5, and two different scale types in the spectral dimension, namely 3 and 5, then all scale types included in the multi-scale convolution layer can be combined to form a total of 4 different scale types, namely 3*3*3, 3*3*5, 5*5*3 and 5*5*5, and there are M / 4 three-dimensional convolution kernels of each scale type, so Figure 3 As shown, the multi-scale convolution layer includes M / 4 3*3*3 convolution units, M / 4 3*3*5 convolution units, M / 4 5*5*3 convolution units, and M / 4 5*5*5 convolution units, where the 3*3*3 convolution unit indicates that the scale type of the three-dimensional convolution kernel in the convolution unit is 3*3*3, and so on.
[0045] In addition to a three-dimensional convolution kernel, each convolution unit also includes other structures, such as Figure 3 As shown in the figure, each convolution unit includes a three-dimensional convolution kernel, a batch normalization layer, an activation function layer and a three-dimensional pooling layer connected in sequence from input to output. The activation function layer uses Leaky_ReLU as the activation function to prevent negative input from causing neuron silence. The three-dimensional pooling layer is used to compress the amount of data and parameters and reduce the complexity of the model.
[0046] Further in the present application, the multi-scale deep learning network structure includes at least two multi-scale convolutional layers cascaded in sequence, and in practice usually includes three multi-scale convolutional layers cascaded in sequence. Each multi-scale convolutional layer includes a number of convolutional units, and the specific structures are similar, that is, as described above. Each multi-scale convolutional layer includes a three-dimensional convolution kernel of the same scale type, and the number of convolutional units included in each multi-scale convolutional layer doubles in the cascade direction. For example, taking the first multi-scale convolution layer including M / 4 3*3*3 3D convolution kernels, M / 4 3*3*5 3D convolution kernels, M / 4 5*5*3 3D convolution kernels, and M / 4 5*5*5 3D convolution kernels as an example, the second multi-scale convolution layer includes 2M / 4 3*3*3 3D convolution kernels, 2M / 4 3*3*5 3D convolution kernels, 2M / 4 5*5*3 3D convolution kernels, and 2M / 4 5*5*5 3D convolution kernels; the third multi-scale convolution layer includes 4M / 4 3*3*3 3D convolution kernels, 4M / 4 3*3*5 3D convolution kernels, 4M / 4 5*5*3 3D convolution kernels, and 4M / 4 5*5*5 3D convolution kernels.
[0047] The multi-scale deep learning network structure in this application adds dropout in the fully connected layer to prevent model overfitting. The classifier adopts Softmax classifier. The multi-scale deep learning network structure adopts cross entropy as the loss function and uses Adam gradient descent optimization algorithm to ensure that the loss converges quickly to the global minimum.
[0048] Based on the multi-scale deep learning network structure of the structure of the present application, the sample images of wheat seed samples of various varieties after dimensionality reduction are input into the multi-scale deep learning network structure for model training. When the sample images after dimensionality reduction are input into the multi-scale deep learning network structure, each multi-scale convolution layer uses each convolution unit to extract features of the sample image from two-dimensional spatial dimensions and one-dimensional spectral dimensions, and the features extracted by all convolution units are fused in the channel dimension and output. The output feature data is the feature data of multiple channels, and the feature data of each channel is the feature extracted by each convolution unit. The multi-scale deep learning network structure of the structure of the present application can extract features in spatial and spectral dimensions at the same time and can extract information of different scales, can fully mine the features in hyperspectral data, greatly improve the classification accuracy of the model, and has good generalization performance.
[0049] Step S4, after the wheat seed classification model is trained, the wheat seed classification model can be used for classification, that is, a hyperspectral image to be classified containing the wheat seeds to be classified is obtained, and the hyperspectral image to be classified is preprocessed and dimensionally reduced as in the above steps and then input into the trained wheat seed classification model, so that the variety classification results of each wheat seed in the hyperspectral image to be classified can be obtained.
[0050] The above is only a preferred embodiment of the present application, and the present invention is not limited to the above embodiments. It is understood that other improvements and changes directly derived or associated by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included in the protection scope of the present invention.
Claims
1. A wheat seed classification method based on multi-scale feature extraction, characterized in that: The method comprises: Acquire hyperspectral images of several wheat seed samples of different varieties as sample images; Perform dimensionality reduction processing on each sample image; A wheat seed classification model is obtained by performing model training using sample images after dimensionality reduction based on a multi-scale deep learning network structure; wherein the multi-scale deep learning network structure comprises a multi-scale convolution layer, a fully connected layer and a classifier connected in sequence, the multi-scale convolution layer comprises a plurality of convolution units, each of which comprises a three-dimensional convolution kernel, and the scale of a three-dimensional convolution kernel is expressed as a*b*c, wherein a*b is the scale of the three-dimensional convolution kernel in a two-dimensional spatial dimension, and c is the scale of the three-dimensional convolution kernel in a one-dimensional spectral dimension; and the three-dimensional convolution kernel in the multi-scale convolution layer has at least two different scale types at least in the spectral dimension; the multi-scale convolution layer uses each convolution unit to extract features of the sample image from a two-dimensional spatial dimension and a one-dimensional spectral dimension, and fuses the features extracted by all convolution units in a channel dimension and outputs them; Acquire a hyperspectral image to be classified containing wheat seeds to be classified, perform dimensionality reduction processing on the hyperspectral image to be classified and input the image into the wheat seed classification model to obtain a variety classification result of each wheat seed in the hyperspectral image to be classified; When the three-dimensional convolution kernel in the multi-scale convolution layer has Different scale types, with When there are different scale types, the multi-scale convolution layer includes Three-dimensional convolution kernels of different scale types, , , and the number of three-dimensional convolution kernels of various scale types is equal to , is the number of convolutional units included in the multi-scale convolutional layer.
2. The method according to claim 1, characterized in that The three-dimensional convolution kernel in the multi-scale convolution layer has at least two different scale types in the spatial dimension and the spectral dimension respectively.
3. The method according to claim 1, characterized in that The multi-scale deep learning network structure includes at least two multi-scale convolutional layers cascaded in sequence, each multi-scale convolutional layer includes a number of convolutional units, each multi-scale convolutional layer includes a three-dimensional convolutional kernel of the same scale type, and the number of convolutional units included in each multi-scale convolutional layer doubles in sequence along the cascade direction.
4. The method according to claim 1, characterized in that: Each convolution unit of the multi-scale convolution layer includes a three-dimensional convolution kernel, a batch normalization layer, an activation function layer and a three-dimensional pooling layer which are sequentially connected from input to output, and the activation function layer uses Leaky_ReLU as an activation function.
5. The method according to claim 1, characterized in that The fully connected layer adds dropout, the classifier adopts Softmax classifier, and the multi-scale deep learning network structure adopts cross entropy as loss function and uses Adam gradient descent optimization algorithm.
6. The method according to any one of claims 1 to 5, characterized in that: The dimensionality reduction process is performed on each sample image, including: Obtaining the mean spectral feature of each band of the sample image as a band feature vector of the band; The characteristic bands are selected based on the band characteristic vectors of all bands using the continuous projection algorithm; Image data in a characteristic band of the sample image is extracted to form a sample image after dimensionality reduction.
7. The method according to any one of claims 1 to 5, characterized in that: The method of obtaining hyperspectral images of several wheat seed samples of different varieties as sample images includes: Collecting original seed images of wheat seed samples of each variety, wherein the original seed images include a hyperspectral image of an area where the wheat seed samples are located and a hyperspectral image of a background area; A hyperspectral image of the area where the wheat seed sample is located is extracted from the original seed image, and the blank part is filled with zeros to obtain the sample image of a predetermined image size, and the image sizes of the sample images of all wheat seed samples are equal.
8. The method according to claim 7, characterized in that The step of extracting a hyperspectral image of the area where the wheat seed sample is located from the original seed image comprises: After the original seed image is collected, The spectral reflectance of each pixel in the original seed image is processed to obtain a corrected original seed image, and the spectral reflectance of each pixel in the corrected original seed image is within within the scope; among them, is the spectral reflectance of a pixel in the original seed image, is the spectral reflectance of the corresponding pixel after data processing, is the spectral reflectance of the corresponding pixel in the standard blackboard image, is the spectral reflectance of the corresponding pixel in the standard whiteboard image; A hyperspectral image of the area where the wheat seed sample is located is extracted from the corrected original seed image.
9. The method according to claim 7, characterized in that: The step of extracting a hyperspectral image of the area where the wheat seed sample is located from the original seed image comprises: A binary mask is generated by extracting the area where the wheat seed sample is located in the original seed image from the image of the original seed image in a predetermined band using a threshold segmentation method; The binary mask is multiplied by the original seed image to obtain a hyperspectral image of the area where the wheat seed sample is located.
Citation Information
Patent Citations
Hyperspectral remote sensing image classification method based on multi-scale PCA-3D-CNN spatial spectrum combination
CN110210313A
