Hyperspectral image classification method and device and electronic equipment
The features of hyperspectral images are extracted through principal component analysis and multi-kernel convolution modules, and combined with pooling operations and multi-layer perceptron processing, solving the problem of insufficient fusion of spectral and spatial features of convolutional neural networks in hyperspectral image classification, and improving improve the accuracy of classification results.
Patent Information
- Application Number
- CN202411292563.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-10-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Due to limitations of existing convolutional neural networks in hyperspectral image classification, spectral features and spatial features cannot be effectively fused, resulting in inaccurate classification results.
The principal component analysis algorithm is used to reduce dimensionality, and the multi-core convolution module combining the spectral branch and the spatial branch is used to extract the spectral features and spatial features of the hyperspectral image, and feature extraction and learning is performed through pooling operations and multi-layer perceptrons to generate second features. Then add them together to determine the classification result.
Effective fusion of spectral features and spatial features in hyperspectral images is achieved, improving the accuracy of classification results.
Smart Images

Figure CN118823486A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image classification, and in particular to a method, device and electronic equipment for classifying hyperspectral images. Background Art
[0002] In recent years, hyperspectral remote sensing technology has developed rapidly. The main feature of hyperspectral satellites is the use of imaging spectrometers with high spectral resolution. They are widely used in the fields of atmosphere, ocean and land exploration, among which the classification of hyperspectral images plays a key role. However, due to the large number of bands and complex imaging mechanisms, the classification of hyperspectral images is still a challenging task.
[0003] Machine learning models have been widely used in many aspects of remote sensing research, such as grassland community classification, crop area identification, and land cover change detection. Traditional hyperspectral image classification methods usually rely on spectral information and machine learning classifiers, such as k-nearest neighbor and support vector machine, to distinguish different categories through different spectral features. However, these methods have failed to produce satisfactory results due to the phenomenon of "same spectrum, different objects" and "same object, different spectrum".
[0004] Due to its powerful feature extraction capability, deep learning has gradually become the mainstream classification method for hyperspectral images, especially convolutional neural networks, which have shown excellent performance in the study of hyperspectral image classification. Among them, convolutional neural networks can include: hybrid spectral convolutional neural networks, deep feature fusion networks, enhanced multi-scale feature fusion networks, spectral attention sub-networks and a spatial attention sub-network, as well as spectral-spatial-semantic networks with multi-path attention mechanisms. However, due to the limitations of each convolutional neural network, the spectral features and space in the hyperspectral image cannot be effectively fused, which in turn leads to inaccurate final classification results. Summary of the invention
[0005] The present invention provides a hyperspectral image classification method, device and electronic device, which are used to solve the problem that the spectral features and space in the hyperspectral image cannot be effectively integrated due to the limitations of each convolutional neural network involved in the prior art, which further leads to the defect that the final classification result is not accurate enough, and the spectral features and spatial features corresponding to the hyperspectral image can be effectively integrated to obtain a classification result with higher accuracy.
[0006] The present invention provides a hyperspectral image classification method, comprising: Obtain spectral features and spatial features corresponding to the hyperspectral image; Performing feature extraction on the spatial feature to obtain a first feature; generating a second feature according to the spectral feature and the first feature; A classification result of the hyperspectral image is determined according to the spectral feature, the spatial feature and the second feature.
[0007] According to a hyperspectral image classification method provided by the present invention, the spectral features and spatial features corresponding to the hyperspectral image are obtained, including: using a principal component analysis algorithm to reduce the dimension of the hyperspectral image to obtain a target image; using multiple multi-core spectral convolution modules of spectral branches to extract spectral features of the hyperspectral image to obtain spectral features corresponding to the hyperspectral image; using multiple multi-core spatial convolution modules of spatial branches to extract spatial features of the target image to obtain spatial features corresponding to the hyperspectral image.
[0008] According to a hyperspectral image classification method provided by the present invention, the multiple multi-core spectral convolution modules are cascaded, and the multiple multi-core spectral convolution modules using spectral branches perform spectral feature extraction on the hyperspectral image to obtain spectral features corresponding to the hyperspectral image, including: using a first multi-core spectral convolution module to extract spectral features on the hyperspectral image to obtain a first extraction result; using other multi-core spectral convolution modules to extract spectral features on the extraction result output by the previous adjacent multi-core spectral convolution module to obtain a second extraction result; and determining the extraction result output by the last multi-core spectral convolution module as the spectral feature corresponding to the hyperspectral image.
[0009] According to a hyperspectral image classification method provided by the present invention, the first multi-core spectral convolution module includes: a first multi-core spectral convolution layer, multiple second multi-core spectral convolution layers and a third multi-core spectral convolution layer, and the first multi-core spectral convolution module is used to extract spectral features of the hyperspectral image to obtain a first extraction result, including: using the first multi-core spectral convolution layer to extract spectral features of the hyperspectral image to obtain a first sub-spectral feature; using the multiple second multi-core spectral convolution layers to extract spectral features of the hyperspectral image respectively to obtain multiple second sub-spectral features; adding the multiple second sub-spectral features to obtain a third sub-spectral feature; using the third multi-core spectral convolution layer to extract spectral features of the third sub-spectral feature to obtain a fourth sub-spectral feature; adding the first sub-spectral feature and the fourth sub-spectral feature to obtain the first extraction result.
[0010] According to a hyperspectral image classification method provided by the present invention, the feature extraction of the spatial feature to obtain the first feature includes: performing pooling operation and linear operation on the spatial feature to obtain a third feature; and using a multilayer perceptron to perform feature learning on the third feature to obtain the first feature.
[0011] According to a hyperspectral image classification method provided by the present invention, generating a second feature based on the spectral feature and the first feature includes: multiplying the spectral feature and the first feature to obtain the second feature.
[0012] According to a hyperspectral image classification method provided by the present invention, determining the classification result of the hyperspectral image based on the spectral feature, the spatial feature and the second feature includes: adding the spectral feature, the spatial feature and the second feature to obtain the classification result of the hyperspectral image.
[0013] According to a hyperspectral image classification method provided by the present invention, the pooling operation includes: a global average pooling operation and a global maximum pooling operation, and the pooling operation and the linear operation are performed on the spatial feature to obtain a third feature, including: performing the global average pooling operation on the spatial feature to obtain a first sub-feature; performing the global maximum pooling operation on the spatial feature to obtain a second sub-feature; using a fully connected layer to connect the first sub-feature and the second sub-feature to obtain a third sub-feature; performing the linear operation on the third sub-feature to obtain the third feature.
[0014] The present invention also provides a hyperspectral image classification device, comprising: A feature acquisition unit, used to acquire spectral features and spatial features corresponding to the hyperspectral image; A feature processing unit, configured to extract the spatial feature to obtain a first feature; and generate a second feature according to the spectral feature and the first feature; An image classification unit is used to determine a classification result of the hyperspectral image according to the spectral feature, the spatial feature and the second feature.
[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the hyperspectral image classification method described above is implemented.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for classifying a hyperspectral image as described above is implemented.
[0017] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned hyperspectral image classification methods.
[0018] The hyperspectral image classification method, device and electronic device provided by the present invention obtain the spectral features and spatial features corresponding to the hyperspectral image; extract the features of the spatial features to obtain the first feature; generate the second feature according to the spectral features and the first feature; and determine the classification result of the hyperspectral image according to the spectral features, the spatial features and the second feature. The method can effectively fuse the spectral features and spatial features corresponding to the hyperspectral image to obtain a classification result with high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 It is a schematic diagram of the process of the classification method of the hyperspectral image provided by the present invention; Figure 2 It is a schematic diagram of a scene for obtaining spectral features and spatial features provided by the present invention; Figure 3 It is a schematic diagram of a scene for obtaining spectral characteristics provided by the present invention; Figure 4 is a schematic diagram of a scene for obtaining spatial features provided by the present invention; Figure 5 It is a schematic diagram of a scenario for determining a classification result provided by the present invention; Figure 6 It is a structural schematic diagram of a hyperspectral image classification device provided by the present invention; Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 creative work are within the scope of protection of the present invention.
[0022] It should be noted that the execution subject involved in the embodiment of the present invention may be a hyperspectral image classification device or an electronic device, which is not specifically limited here.
[0023] The embodiment of the present invention is further described below by taking an electronic device as an example.
[0024] like Figure 1 FIG. 1 is a flow chart of a method for classifying hyperspectral images provided by the present invention, which may include: 101. Obtain spectral features and spatial features corresponding to the hyperspectral image.
[0025] The hyperspectral image is an information carrier with spectral characteristics and spatial characteristics. The hyperspectral image can be collected by a satellite or by an electronic device, which is not specifically limited here.
[0026] It should be noted that if the hyperspectral image is collected by a satellite, the satellite can send the hyperspectral image to an electronic device, so that the electronic device can obtain the hyperspectral image; if the hyperspectral image is collected by an electronic device, the electronic device is the satellite.
[0027] Spectral features refer to the spectral information of a hyperspectral image in each band, which is used to obtain different identification targets in the hyperspectral image.
[0028] Spatial features refer to the spatial position, distance, shape, size, texture and other information shown on the hyperspectral image, which are used to obtain different identification targets in the hyperspectral image.
[0029] In some embodiments, the electronic device obtains spectral features and spatial features corresponding to a hyperspectral image, which may include: the electronic device uses a principal component analysis algorithm to reduce the dimension of the hyperspectral image to obtain a target image; the electronic device uses multiple multi-core spectral convolution modules of a spectral branch to extract spectral features of the hyperspectral image to obtain spectral features corresponding to the hyperspectral image; the electronic device uses multiple multi-core spatial convolution modules of a spatial branch to extract spatial features of the target image to obtain spatial features corresponding to the hyperspectral image.
[0030] Among them, the principal component analysis algorithm is a widely used data dimensionality reduction algorithm and an unsupervised learning method. It uses orthogonal transformation to convert observation data represented by linearly dependent variables (such as hyperspectral images) into data represented by several linearly independent variables. The linearly independent variables become the principal components. The number of principal components (such as the number of channels in hyperspectral images) is usually less than the number of original variables, which belongs to the dimensionality reduction method.
[0031] The spectral branch focuses on the spectral dimension information of hyperspectral images. The hyperspectral images contain rich spectral bands, each of which represents the reflection or emission intensity at different frequencies. These spectral information are crucial for distinguishing different types of materials and objects.
[0032] Each multi-core spectral convolution module is a core component in the spectral branch, which is used to extract spectral features. Multiple convolution kernels are used to perform convolution operations on the spectral dimension of the hyperspectral image to capture different spectral patterns.
[0033] The spatial branch focuses on the spatial dimension information of the target image. The target image contains not only spectral information, but also rich spatial information, such as texture, shape, and edge. This spatial information is of great significance for understanding the spatial distribution and morphological structure of the objects.
[0034] Each multi-core spatial convolution module is a key component in the spatial branch and is used to extract spatial features. Similar to the multi-core spectral convolution module, multiple convolution kernels are used to perform convolution operations on the spatial dimension of the target image. These convolution kernels can learn and extract different spatial patterns in the target image, such as texture, edges, and shapes. Through the processing of the multi-core spatial convolution module, a more refined and rich spatial feature representation can be obtained, which helps to improve the performance and accuracy of subsequent classification tasks.
[0035] For example, Figure 2 The figure shows a schematic diagram of a scene for obtaining spectral features and spatial features provided by the present invention. After obtaining a hyperspectral image, the electronic device may first use a principal component analysis algorithm to reduce the number of channels of the hyperspectral image (such as from c to b, c>b>0), and then extract image blocks with each pixel in the hyperspectral image as the center to achieve dimensionality reduction of the hyperspectral image and obtain a target image; then, multiple multi-core spectral convolution modules are used to extract the spectral information of the hyperspectral image to obtain spectral features with higher accuracy, and multiple multi-core spatial convolution modules are used to extract the spatial information of the target image to obtain spatial features with higher accuracy.
[0036] It should be noted that the electronic device is not limited to the timing of acquiring spectral features and spatial features. In addition, the data processing operations of each multi-core spectral convolution module are the same, but the input data processed are different; similarly, the data processing operations of each multi-core spatial convolution module are the same, but the input data processed are different.
[0037] In some embodiments, multiple multi-core spectral convolution modules are cascaded, and the electronic device uses multiple multi-core spectral convolution modules of spectral branches to extract spectral features of the hyperspectral image to obtain spectral features corresponding to the hyperspectral image, including: the electronic device uses the first multi-core spectral convolution module to extract spectral features of the hyperspectral image to obtain a first extraction result; the electronic device uses other multi-core spectral convolution modules to extract spectral features of the extraction result output by the previous adjacent multi-core spectral convolution module to obtain a second extraction result; the electronic device determines the extraction result output by the last multi-core spectral convolution module as the spectral feature corresponding to the hyperspectral image.
[0038] Among them, the multi-core spectral convolution layer is used to extract spectral information.
[0039] Since the above-mentioned multiple multi-core spectral convolution modules are cascaded, the electronic device can sequentially use multiple multi-core spectral convolution modules to process the hyperspectral image. Specifically, the first multi-core spectral convolution module is used to extract spectral features of the hyperspectral image for the first time to obtain a first extraction result, and the first extraction result is used as the input of the next adjacent multi-core spectral convolution module; then other multi-core spectral convolution modules are used to extract spectral features of the extraction result output by the previous adjacent multi-core spectral convolution module to obtain a second extraction result, until the extraction result output by the last multi-core spectral convolution module is determined as the spectral feature corresponding to the hyperspectral image.
[0040] In some embodiments, the first multi-core spectral convolution module may include: a first multi-core spectral convolution layer, multiple second multi-core spectral convolution layers and a third multi-core spectral convolution layer. The electronic device uses the first multi-core spectral convolution module to extract spectral features from a hyperspectral image to obtain a first extraction result, which may include: the electronic device uses the first multi-core spectral convolution layer to extract spectral features from the hyperspectral image to obtain a first sub-spectral feature; the electronic device uses multiple second multi-core spectral convolution layers to extract spectral features from the hyperspectral image respectively to obtain multiple second sub-spectral features; the electronic device adds the multiple second sub-spectral features to obtain a third sub-spectral feature; the electronic device uses the third multi-core spectral convolution layer to extract spectral features from the third sub-spectral feature to obtain a fourth sub-spectral feature; the electronic device adds the first sub-spectral feature and the fourth sub-spectral feature to obtain the first extraction result.
[0041] Among them, the above-mentioned multiple second sub-spectral features are parallel and can be called multi-scale spectral features.
[0042] For example, Figure 3 As shown, it is a schematic diagram of the scene for obtaining spectral features provided by the present invention. Among them, the multi-core spectral convolution module may include: a first multi-core spectral convolution layer with a convolution kernel of 1*1*1, four second multi-core spectral convolution layers, and a third multi-core spectral convolution layer with a convolution kernel of 1*1*1. The above four second multi-core spectral convolution layers are: a second multi-core spectral convolution layer with a convolution kernel of 1*1*1, a second multi-core spectral convolution layer with a convolution kernel of 3*1*1, a second multi-core spectral convolution layer with a convolution kernel of 5*1*1, and a second multi-core spectral convolution layer with a convolution kernel of 7*1*1.
[0043] from Figure 3It can be seen that after acquiring the hyperspectral image, the electronic device can use the first multi-core spectral convolution layer to extract the key spectral features in the hyperspectral image for the first time, and obtain the first sub-spectral features with higher accuracy; at the same time, the above-mentioned four second multi-core spectral convolution layers can be used to extract the key spectral features in the hyperspectral image for the first time, fully capture the multi-scale spectral features, and obtain four second sub-spectral features with higher accuracy, and then add these four second sub-spectral features to enhance the key spectral features and obtain a third sub-spectral feature with higher accuracy; finally, the third multi-core spectral convolution layer is used to extract the spectral features of the third sub-spectral feature again to obtain the fourth sub-spectral feature, which is then added to the first sub-spectral feature to obtain the first extraction result, providing data support for the subsequent determination of spectral features.
[0044] It should be noted that the electronic device has no limitation on the timing of acquiring the first sub-spectrum feature and acquiring the plurality of second sub-spectrum features.
[0045] Optionally, multiple multi-core spatial convolution modules are cascaded, and the electronic device uses multiple multi-core spatial convolution modules with spatial branches to perform spatial feature extraction on the target image to obtain spatial features corresponding to the hyperspectral image, including: the electronic device uses the first multi-core spatial convolution module to extract spatial features on the target image to obtain a third extraction result; the electronic device uses other multi-core spatial convolution modules to perform spatial feature extraction on the extraction result output by the previous adjacent multi-core spatial convolution module to obtain a fourth extraction result; the electronic device determines the extraction result output by the last multi-core spatial convolution module as the spatial feature corresponding to the target image.
[0046] Among them, the multi-core spatial convolution layer is used to extract spatial information.
[0047] Since the above-mentioned multiple multi-core spatial convolution modules are cascaded, the electronic device can use multiple multi-core spatial convolution modules in sequence to process the target image. Specifically, the first multi-core spatial convolution module is used to perform spatial feature extraction on the target image for the first time to obtain a third extraction result, and the third extraction result is used as the input of the next adjacent multi-core spatial convolution module; then other multi-core spatial convolution modules are used to perform spatial feature extraction on the extraction result output by the previous adjacent multi-core spatial convolution module to obtain a fourth extraction result, until the extraction result output by the last multi-core spatial convolution module is determined as the spatial feature corresponding to the target image.
[0048] Optionally, the first multi-core spatial convolution module may include: a first multi-core spatial convolution layer, multiple second multi-core spatial convolution layers and a third multi-core spatial convolution layer. The electronic device uses the first multi-core spatial convolution module to perform spatial feature extraction on the target image to obtain a third extraction result, which may include: the electronic device uses the first multi-core spatial convolution layer to perform spatial feature extraction on the target image to obtain a first subspace feature; the electronic device uses multiple second multi-core spatial convolution layers to perform spatial feature extraction on the hyperspectral image respectively to obtain multiple second subspace features; the electronic device adds the multiple second subspace features to obtain a third subspace feature; the electronic device uses the third multi-core spatial convolution layer to perform spatial feature extraction on the third subspace feature to obtain a fourth subspace feature; the electronic device adds the first subspace feature and the fourth subspace feature to obtain a third extraction result.
[0049] Among them, the above-mentioned multiple second subspace features are parallel and can be called multi-scale spatial features.
[0050] For example, Figure 4 As shown, it is a schematic diagram of the scene for obtaining spatial features provided by the present invention. Among them, the multi-core spatial convolution module may include: a first multi-core spatial convolution layer with a convolution kernel of 1*1*1, four second multi-core spatial convolution layers, and a third multi-core spatial convolution layer with a convolution kernel of 1*1*1. The above four second multi-core spatial convolution layers are respectively: a second multi-core spatial convolution layer with a convolution kernel of 1*1*1, a second multi-core spatial convolution layer with a convolution kernel of 1*3*3, a second multi-core spatial convolution layer with a convolution kernel of 1*5*5, and a second multi-core spatial convolution layer with a convolution kernel of 1*7*7.
[0051] from Figure 4 It can be seen that after acquiring the target image, the electronic device can use the first multi-core spatial convolution layer to extract the key spatial features in the target image for the first time, and obtain the first subspace features with higher accuracy; at the same time, the above-mentioned four second multi-core spatial convolution layers can be used to extract the key spatial features in the target image for the first time, fully capture the multi-scale spatial features, and obtain four second subspace features with higher accuracy, and then add these four second subspace features to enhance the key spatial features and obtain the third subspace features with higher accuracy; finally, the third multi-core spatial convolution layer is used to extract the spatial features of the third subspace features again to obtain the fourth subspace features, and then add them to the first subspace features to obtain the third extraction result, which provides data support for the subsequent determination of spatial features.
[0052] It should be noted that there is no limitation on the time sequence for the electronic device to obtain the first subspace feature and the plurality of second subspace features.
[0053] Optionally, after step 101, the method may further include: the electronic device inputs the spectral feature and the spatial feature into a cross-interaction module to determine a classification result of the hyperspectral image.
[0054] 102. Perform feature extraction on the spatial feature to obtain a first feature.
[0055] In some embodiments, the electronic device performs feature extraction on the spatial feature to obtain the first feature, which may include: the electronic device performs pooling operation and linear operation on the spatial feature to obtain the third feature; the electronic device uses a multi-layer perceptron to perform feature learning on the third feature to obtain the first feature.
[0056] Among them, the pooling operation is used to adjust the size of the spatial feature map and extract relevant information that is robust to the spatial features.
[0057] The linear operation performs linear combination or linear transformation on the spatial features after pooling to achieve feature recombination and mapping.
[0058] The multilayer perceptron is a classic neural network model and a deep learning model based on the feedforward neural network. The basic structure of the multilayer perceptron can include: input layer, hidden layer and output layer, where the hidden layer can have multiple layers, each layer consists of multiple neurons. Each neuron layer is fully connected to the previous layer, that is, each neuron is connected to all neurons in the previous layer. In this way, through powerful nonlinear pattern recognition capabilities, feature extraction and conversion capabilities, and flexible application methods, it provides important tools and support for the fields of deep learning and machine learning.
[0059] After acquiring the spatial features, the electronic device can perform a pooling operation on the spatial features through a cross-interaction module to reduce the amount of calculation of the spatial features, and then perform a linear operation to extract more expressive features from the pooled spatial features. In this way, while improving the calculation efficiency of the third feature, the accuracy of the third feature can also be effectively improved; then, a multi-layer perceptron is used to perform feature learning on the third feature, and then a nonlinear transformation is performed through an activation layer (such as a Sigmoid function layer) to obtain an attention feature, that is, the first feature, to provide data support for subsequent image classification.
[0060] In some embodiments, the pooling operation may include: a global average pooling operation and a global maximum pooling operation. The electronic device performs a pooling operation and a linear operation on the spatial feature to obtain a third feature, which may include: the electronic device performs a global average pooling operation on the spatial feature to obtain a first sub-feature; the electronic device performs a global maximum pooling operation on the spatial feature to obtain a second sub-feature; the electronic device uses a fully connected layer to connect the first sub-feature and the second sub-feature to obtain a third sub-feature; the electronic device performs a linear operation on the third sub-feature to obtain a third feature.
[0061] Among them, the global average pooling operation is to average the entire spatial features. This operation can effectively reduce the computational complexity and help reduce the risk of overfitting.
[0062] The global maximum pooling operation takes the maximum value of all the values of each channel in the spatial feature to obtain a vector with the same number of channels, and concatenates these vectors together to form the final feature vector. The main function of this operation is to extract the most significant features in the spatial features, retain important features by taking the maximum value, and discard unimportant information.
[0063] The fully connected layer integrates the features extracted by the previous layer (i.e., the first sub-feature and the second sub-feature) through weighted connections and outputs them to the next layer or the final output layer for classification, recognition or other tasks.
[0064] In the process of pooling the spatial features, the electronic device may perform global average pooling operations and global maximum pooling operations on the spatial features respectively to obtain the first sub-feature and the second sub-feature, and then use a fully connected layer to connect the two sub-features to obtain the third sub-feature; then, a linear operation is performed on the third sub-feature to extract more expressive features in the third sub-feature to obtain a third feature with high accuracy.
[0065] It should be noted that the electronic device has no limitation on the timing of acquiring the first sub-feature and acquiring the second sub-feature.
[0066] 103. Generate a second feature according to the spectral feature and the first feature.
[0067] In some embodiments, the electronic device generates the second feature according to the spectral feature and the first feature, which may include: the electronic device multiplies the spectral feature and the first feature to obtain the second feature.
[0068] After acquiring the spectral feature and the first feature, the electronic device may multiply the spectral feature and the first feature in order to enhance the feature, make full use of the feature information they carry, generate a second feature with higher accuracy, and provide data support for subsequent image classification.
[0069] 104. Determine a classification result of the hyperspectral image according to the spectral feature, the spatial feature and the second feature.
[0070] In some embodiments, the electronic device determines the classification result of the hyperspectral image according to the spectral feature, the spatial feature and the second feature, which may include: the electronic device adds the spectral feature, the spatial feature and the second feature to obtain the classification result of the hyperspectral image.
[0071] In order to improve the classification accuracy, the electronic device can add the acquired spectral features, spatial features and second features to obtain the classification result of the hyperspectral image, which is also relatively accurate.
[0072] Optionally, in the process of determining the classification result of the hyperspectral image, the electronic device may first add the spectral feature, the spatial feature and the second feature to obtain an addition result; then input the addition result into a multilayer perceptron network, and classify the addition result through the multilayer perceptron network to obtain the classification result of the hyperspectral image.
[0073] Among them, the multilayer perceptron network is a powerful neural network model that can learn and approximate complex nonlinear functional relationships and realize various complex machine learning tasks. The multilayer perceptron network can be used for tasks such as image classification, target detection and face recognition.
[0074] In summary, the above steps 102-104 are all implemented in a cross-interaction module, which is used to fuse spectral features and spatial features to obtain a classification result with higher accuracy. Figure 5 FIG. 1 is a schematic diagram of a scenario for determining a classification result provided by the present invention. Figure 5 It can be seen that the electronic device inputs the acquired spatial features and spectral features into the cross-interaction module, and through the cross-interaction module, performs global average pooling operation and global maximum pooling operation on the spatial features respectively to obtain the first sub-feature and the second sub-feature; then uses a fully connected layer to connect the first sub-feature and the second sub-feature to obtain a third sub-feature, and then performs a linear operation on the third sub-feature to obtain a third feature; then, the third feature is input into a multi-layer perceptron, and feature learning is performed on the third feature through the multi-layer perceptron, and then the first feature is output through the Sigmoid function layer; then, the first feature is multiplied by the spectral feature to obtain the second feature, and then the second feature is added to the spectral feature and the spatial feature to obtain a classification result of the hyperspectral image with higher accuracy.
[0075] In the embodiment of the present invention, the spectral features and spatial features corresponding to the hyperspectral image are obtained; the spatial features are feature extracted to obtain the first feature; the second feature is generated based on the spectral features and the first feature; and the classification result of the hyperspectral image is determined based on the spectral features, the spatial features and the second feature. This method can effectively fuse the spectral features and spatial features corresponding to the hyperspectral image to obtain a classification result with high accuracy.
[0076] The hyperspectral image classification device provided by the present invention is described below. The hyperspectral image classification device described below and the hyperspectral image classification method described above can be referred to each other.
[0077] like Figure 6 FIG. 1 is a schematic diagram of the structure of a hyperspectral image classification device provided by the present invention, which may include: A feature acquisition unit 601 is used to acquire spectral features and spatial features corresponding to the hyperspectral image; The feature processing unit 602 is used to extract the spatial feature to obtain a first feature; and generate a second feature according to the spectral feature and the first feature; The image classification unit 603 is used to determine a classification result of the hyperspectral image according to the spectral feature, the spatial feature and the second feature.
[0078] Optionally, the feature acquisition unit 601 is specifically used to use a principal component analysis algorithm to reduce the dimension of the hyperspectral image to obtain a target image; use multiple multi-core spectral convolution modules of spectral branches to extract spectral features of the hyperspectral image to obtain spectral features corresponding to the hyperspectral image; use multiple multi-core spatial convolution modules of spatial branches to extract spatial features of the target image to obtain spatial features corresponding to the hyperspectral image.
[0079] Optionally, the multiple multi-core spectral convolution modules are cascaded, and the feature acquisition unit 601 is specifically used to use the first multi-core spectral convolution module to perform spectral feature extraction on the hyperspectral image to obtain a first extraction result; use other multi-core spectral convolution modules to perform spectral feature extraction on the extraction result output by the previous adjacent multi-core spectral convolution module to obtain a second extraction result; and determine the extraction result output by the last multi-core spectral convolution module as the spectral feature corresponding to the hyperspectral image.
[0080] Optionally, the first multi-core spectral convolution module includes: a first multi-core spectral convolution layer, multiple second multi-core spectral convolution layers and a third multi-core spectral convolution layer, and a feature processing unit 602, which is specifically used to use the first multi-core spectral convolution layer to extract spectral features of the hyperspectral image to obtain a first sub-spectral feature; use the multiple second multi-core spectral convolution layers to respectively extract spectral features of the hyperspectral image to obtain multiple second sub-spectral features; add the multiple second sub-spectral features to obtain a third sub-spectral feature; use the third multi-core spectral convolution layer to extract spectral features of the third sub-spectral feature to obtain a fourth sub-spectral feature; add the first sub-spectral feature and the fourth sub-spectral feature to obtain the first extraction result.
[0081] Optionally, the feature processing unit 602 is specifically used to perform pooling operations and linear operations on the spatial feature to obtain a third feature; and use a multilayer perceptron to perform feature learning on the third feature to obtain the first feature.
[0082] Optionally, the feature processing unit 602 is specifically configured to multiply the spectral feature and the first feature to obtain the second feature.
[0083] Optionally, the image classification unit 603 is specifically configured to add the spectral feature, the spatial feature and the second feature to obtain a classification result of the hyperspectral image.
[0084] Optionally, the pooling operation includes: a global average pooling operation and a global maximum pooling operation, and the feature processing unit 602 is specifically used to perform the global average pooling operation on the spatial feature to obtain a first sub-feature; perform the global maximum pooling operation on the spatial feature to obtain a second sub-feature; use a fully connected layer to connect the first sub-feature and the second sub-feature to obtain a third sub-feature; perform the linear operation on the third sub-feature to obtain the third feature.
[0085] like Figure 7 , is a schematic diagram of the structure of the electronic device provided by the present invention, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the classification method of the hyperspectral image, the method comprising: obtaining the spectral features and spatial features corresponding to the hyperspectral image; extracting the features of the spatial features to obtain the first features; generating the second features according to the spectral features and the first features; and determining the classification result of the hyperspectral image according to the spectral features, the spatial features and the second features.
[0086] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
[0087] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the classification method of the hyperspectral image provided by the above methods, and the method includes: obtaining spectral features and spatial features corresponding to the hyperspectral image; performing feature extraction on the spatial features to obtain a first feature; generating a second feature based on the spectral features and the first feature; and determining the classification result of the hyperspectral image based on the spectral features, the spatial features and the second features.
[0088] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the classification method of the hyperspectral image provided by the above methods, the method comprising: obtaining spectral features and spatial features corresponding to the hyperspectral image; performing feature extraction on the spatial features to obtain a first feature; generating a second feature based on the spectral features and the first feature; and determining the classification result of the hyperspectral image based on the spectral features, the spatial features and the second features.
[0089] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for classifying hyperspectral images, characterized in that: include: Obtain spectral features and spatial features corresponding to the hyperspectral image; Performing feature extraction on the spatial feature to obtain a first feature; generating a second feature according to the spectral feature and the first feature; Determining a classification result of the hyperspectral image according to the spectral feature, the spatial feature and the second feature; The obtaining of spectral features and spatial features corresponding to the hyperspectral image includes: Using a principal component analysis algorithm, the hyperspectral image is reduced in dimension to obtain a target image; Using a plurality of multi-core spectral convolution modules of spectral branches to extract spectral features of the hyperspectral image, and obtain spectral features corresponding to the hyperspectral image; A plurality of multi-core spatial convolution modules with spatial branches are used to extract spatial features of the target image to obtain spatial features corresponding to the hyperspectral image.
2. The method according to claim 1, characterized in that The multiple multi-core spectral convolution modules are cascaded, and the multiple multi-core spectral convolution modules using spectral branches perform spectral feature extraction on the hyperspectral image to obtain spectral features corresponding to the hyperspectral image, including: Using a first multi-core spectral convolution module to extract spectral features from the hyperspectral image, and obtaining a first extraction result; Using other multi-core spectral convolution modules, extracting spectral features from the extraction result output by the previous adjacent multi-core spectral convolution module to obtain a second extraction result; The extraction result output by the last multi-core spectral convolution module is determined as the spectral feature corresponding to the hyperspectral image.
3. The method according to claim 2, characterized in that The first multi-core spectral convolution module includes: a first multi-core spectral convolution layer, a plurality of second multi-core spectral convolution layers and a third multi-core spectral convolution layer. The first multi-core spectral convolution module is used to extract spectral features from the hyperspectral image to obtain a first extraction result, including: Using the first multi-core spectral convolution layer, extracting spectral features from the hyperspectral image to obtain a first sub-spectral feature; Using the plurality of second multi-core spectral convolution layers, respectively extracting spectral features from the hyperspectral image to obtain a plurality of second sub-spectral features; Adding the plurality of second sub-spectral features to obtain a third sub-spectral feature; Using the third multi-core spectral convolution layer, extracting spectral features from the third sub-spectral feature to obtain a fourth sub-spectral feature; The first sub-spectral feature and the fourth sub-spectral feature are added together to obtain the first extraction result.
4. The method according to any one of claims 1 to 3, characterized in that: The extracting the spatial feature to obtain the first feature includes: Performing a pooling operation and a linear operation on the spatial feature to obtain a third feature; A multi-layer perceptron is used to perform feature learning on the third feature to obtain the first feature.
5. The method according to any one of claims 1 to 3, characterized in that: The step of generating a second feature according to the spectral feature and the first feature comprises: The spectral feature and the first feature are multiplied to obtain the second feature.
6. The method according to any one of claims 1 to 3, characterized in that: Determining the classification result of the hyperspectral image according to the spectral feature, the spatial feature and the second feature includes: The spectral feature, the spatial feature and the second feature are added together to obtain a classification result of the hyperspectral image.
7. The method according to claim 4, characterized in that The pooling operation includes: a global average pooling operation and a global maximum pooling operation, and the pooling operation and the linear operation are performed on the spatial feature to obtain the third feature, including: Performing the global average pooling operation on the spatial feature to obtain a first sub-feature; Performing the global maximum pooling operation on the spatial feature to obtain a second sub-feature; Using a fully connected layer, the first sub-feature and the second sub-feature are connected to obtain a third sub-feature; The linear operation is performed on the third sub-feature to obtain the third feature.
8. A hyperspectral image classification device, characterized in that: include: A feature acquisition unit, used to acquire spectral features and spatial features corresponding to the hyperspectral image; The obtaining of spectral features and spatial features corresponding to the hyperspectral image includes: Using a principal component analysis algorithm, the hyperspectral image is reduced in dimension to obtain a target image; Using a plurality of multi-core spectral convolution modules of spectral branches to extract spectral features of the hyperspectral image, and obtain spectral features corresponding to the hyperspectral image; Using multiple multi-core spatial convolution modules with spatial branches to extract spatial features of the target image, and obtain spatial features corresponding to the hyperspectral image; A feature processing unit, configured to extract the spatial feature to obtain a first feature; and generate a second feature according to the spectral feature and the first feature; An image classification unit is used to determine a classification result of the hyperspectral image according to the spectral feature, the spatial feature and the second feature.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the hyperspectral image classification method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Space spectrum full convolution hyperspectral image classification method based on superpixel sample expansion
CN111695467A
Hyperspectral remote sensing image recognition method and device, electronic equipment and storage medium
CN113822207A
Hyperspectral image classification method based on twin network
CN114821164A
Remote sensing image panchromatic sharpening method and device based on de-noising diffusion probability model
CN116630189A
Statistical and semantic feature-based ground feature classification method for near-ground security and protection
CN117671345A
