Unbalanced hyperspectral image classification method

By combining a deep generative model with data generation and classification, and using implicit space for small category upsampling, the problem of poor classification accuracy caused by unbalanced sample distribution in hyperspectral images is solved, and higher classification accuracy and robustness are achieved. Especially in small category data processing.

CN114882368BActive Publication Date: 2024-10-25XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210626027.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-02
Publication Date
2024-10-25
Estimated Expiration
2042-06-02

AI Technical Summary

Technical Problem

In the classification of hyperspectral images, the existing technology faces the problem that the classifier is biased towards large categories due to unbalanced sample distribution, and the classification accuracy of small category samples is poor, and the depth generation model is difficult to fully utilize the high-dimensional spectral-spatial information, resulting in poor classification results.

Method used

Design a non-balanced hyperspectral image classification method based on depth generation. By constructing a network model including a three-dimensional encoder, a small category upsampling module and a classifier, the data generation and classification are combined, and the implicit space is used for small category upsampling. , improve the quality and classification accuracy of generated samples.

Benefits of technology

It achieves higher classification accuracy and robustness, especially in small category data processing, improves the classification performance of hyperspectral images, and effectively utilizes spectral-spatial integrated feature information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114882368B_ABST
    Figure CN114882368B_ABST
Patent Text Reader

Abstract

The present invention discloses an unbalanced hyperspectral image classification method based on a deep generative spectral-spatial classifier, which mainly solves the problem of poor classification accuracy of small categories in the existing technology when facing unbalanced hyperspectral classification tasks. Its implementation scheme is: obtain a hyperspectral image and perform band selection, and divide it into training samples and test samples; construct a classification network for unbalanced hyperspectral images including a two-stage three-dimensional encoder, a three-dimensional decoder, a small category upsampling module and a classifier; train the classification network using training samples, set the overall loss function, initialize the network training parameters, and use the gradient descent method to update the classification network until the maximum number of iterations is reached; input the test sample into the trained classification network to obtain the classification result. The present invention improves the classification accuracy of small categories in hyperspectral images, enhances robustness, and can be used for mineral exploration, ecological monitoring, smart agriculture and medical diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing technology, and in particular relates to a non-equilibrium hyperspectral image classification method, which can be used for mineral exploration, ecological monitoring, smart agriculture and medical diagnosis. Background Art

[0002] Hyperspectral images have high spectral resolution and can cover the visible light, near infrared and short-wave infrared wavelength ranges, usually with dozens to hundreds of bands. The unique and detailed spectral information of different substances makes it possible to distinguish land cover categories with only slight differences. At present, it has been widely used in mineral exploration, ecological monitoring, smart agriculture, medical diagnosis and other aspects. Hyperspectral image classification is one of the important means of hyperspectral image interpretation. It is committed to assigning specific labels to each pixel in the image, thereby realizing pixel-level semantic analysis of the scene, which can provide strong support for higher-level applications such as ground object monitoring and change detection.

[0003] In the actual hyperspectral images, the area proportions of different categories of objects in the images vary greatly. Therefore, the sample data used to train the classifier presents an unbalanced distribution law, that is, some categories have a large number of samples, belonging to large categories, and some categories have a small number of samples, belonging to small categories. In the above case, the training process of the classifier will rely heavily on the annotation information of large category samples, and pay less attention to small category samples, resulting in the classification results being biased towards large categories and poor classification accuracy of small categories. However, the minority classes in a scene are usually more valuable and require high-quality recognition rates. For example, in the classification of vegetation coverage scenes, the precious and rare species that people pay more attention to usually only occupy a small number of pixels in the image; in real-time classification applications, forest fires only occupy a small area in the image scene in the initial stage. The classifier should accurately divide this small category as early as possible, so as to achieve timely disaster prevention and mitigation. Therefore, it is of great significance and value to design an unbalanced hyperspectral image classification method.

[0004] The traditional method for solving the problem of unbalanced hyperspectral image classification directly resamples the original sample data, that is, upsampling and downsampling the small and large category samples respectively, so that the number of samples of all categories is balanced. This method targets relatively low-dimensional sample features, that is, the one-dimensional spectral curve corresponding to the sample, and it is difficult to handle high-dimensional data such as three-dimensional spectral-spatial neighborhood samples. Deep learning models can be driven by raw data and effectively map high-dimensional data to low-dimensional feature embedding spaces with stronger distinguishing capabilities. Inspired by this, researchers introduced resampling strategies into deep learning models, captured the data distribution in the embedding space by training deep networks, and then used the embedding space as a bridge to synthesize new samples. This type of method is collectively called a deep generative model, among which the representative algorithms are conditional variational autoencoders and generative adversarial networks. Conditional variational autoencoders use implicit features extracted by the network to capture the dependencies of data, and can generate samples of specific categories from the learned latent variable distribution with label information as a condition, without the need for a complex adversarial learning process. However, if conditional variational autoencoders are used directly to synthesize samples, data generation and classification are isolated processes, resulting in poor classification results. In addition, conditional variational autoencoders are usually used to generate simple one-dimensional sequence signals or two-dimensional natural images rather than high-dimensional hyperspectral spatial-spectral neighborhood sample data, resulting in the inability to fully utilize the rich spectral-spatial information.

[0005] Swalpa Kumar Roy et al. proposed a small category upsampling method (HyperGAMO) based on generative adversarial network in their article "Generative Adversarial Minority Oversampling for Spectral-spatial Hyperspectral Image Classification" (IEEE Transactions on Geoscience & Remote Sensing, 2022, 60:1-15) to overcome the problems existing in unbalanced hyperspectral classification. This method designs a three-dimensional convex hull generator based on conditional generative adversarial network to generate new sample features in the convex hull formed by the deep features of small category samples, thereby implementing the sample generation and classification process in an "end-to-end" manner, reducing the complexity of deep generative models for classification tasks. Despite this, the method still has the defect that the convex hull of the small category is far from the real data distribution, resulting in less useful information in the synthetic samples, and cannot solve the problem of insufficient small category samples, and the classification performance needs to be further improved. Summary of the invention

[0006] The purpose of the present invention is to address the deficiencies of the above-mentioned prior art and propose an unbalanced hyperspectral image classification method based on deep generation of spectral-spatial classifiers to make full use of spectral-spatial information, enhance the quality and quantity of small class samples, and improve the image classification effect.

[0007] The technical idea to achieve the above purpose is to combine data generation and classification into a unified process, fully mine the hyperspectral image information through the encoder, and make the generated samples closer to the real samples by upsampling small categories in the latent space, so as to obtain more accurate data enhancement effect and further improve the classification accuracy.

[0008] According to the above ideas, the implementation steps of the present invention include the following:

[0009] 1) Obtain hyperspectral image data and perform band selection, segment the hyperspectral image after band selection into spectral-spatial feature neighborhood blocks according to a fixed size, and then divide it into training samples and test samples at a ratio of 1:99;

[0010] 2) Construct an unbalanced hyperspectral image classification network model:

[0011] 2a) Establishing a 3D encoder composed of three 3D convolution modules cascaded with a 2D convolution module, cascaded with two parallel fully connected networks, and then cascaded with a re-parameter module;

[0012] 2b) Setting a small category upsampling module in the latent space;

[0013] 2c) building a 3D decoder consisting of one fully connected layer and multiple deconvolutional layers;

[0014] 2d) Building an image classifier module consisting of one fully connected layer;

[0015] 2e) cascading the three-dimensional encoder and the small category upsampling module, connecting the three-dimensional decoder and the classifier in parallel, and inputting the output of the small category upsampling module into the three-dimensional decoder and the classifier in parallel to form an unbalanced hyperspectral image classification network model;

[0016] 3) Training the unbalanced hyperspectral image classification network model:

[0017] 3a) Construct the overall loss function L of the network model Total =λ·L mmd +L PdRec +L cls , where L mmd is the regularization loss function based on maximizing the mean difference, L PdRec is the reconstruction loss function based on neighborhood distance, L cls is the classification loss function based on cross entropy, λ is the parameter;

[0018] 3b) Initializing the parameters of the unbalanced hyperspectral image classification network model includes the weight parameter w, bias parameter b and parameter θ={θ1,θ2} in the 3D encoder, the weight parameter w, bias parameter b and parameter θ={θ1,θ2} in the 3D decoder Mean parameter in the upsampling module for small class sample features and variance parameter and classifier parameter η;

[0019] 3c) inputting the training samples into the unbalanced hyperspectral image classification network model, using the gradient descent method to cyclically update the parameters in the unbalanced hyperspectral image classification network to reduce the gradient value of the total loss function until the maximum number of iterations T is reached, thereby obtaining a trained unbalanced hyperspectral image classification network model;

[0020] 4) Input the test sample into the trained unbalanced hyperspectral image classification network model and output the hyperspectral image classification result map.

[0021] The beneficial effects of the present invention are:

[0022] First, since the present invention constructs an unbalanced hyperspectral image classification network including a two-stage three-dimensional encoder, a small category upsampling module, a three-dimensional decoder and a classifier, the input data can directly obtain the output result through the trained unbalanced hyperspectral image classification network, avoiding manual preprocessing and subsequent processing, and improving the classification speed of hyperspectral images.

[0023] Second, the reconstruction loss function based on neighborhood distance designed by the present invention, compared with the traditional method of using Euclidean distance to measure one-dimensional signal or two-dimensional image features to calculate the reconstruction loss function, effectively improves the consistency between the three-dimensional samples generated after decoding and the input three-dimensional samples, and improves the overall classification accuracy of the classifier.

[0024] Third, the present invention captures the data distribution of implicit features in the embedding space and realizes the resampling of small category samples, thereby integrating deep spectral-spatial feature generation and classifiers into a unified framework, so that the classifier has higher accuracy and stronger robustness when processing unbalanced data, especially for small category data.

[0025] In summary, compared with the prior art, the present invention can better utilize the spectral-spatial integrated feature information of hyperspectral images. Under the condition of sample imbalance, it can not only maintain the overall classification accuracy at a high level, but also effectively improve the classification performance of small sample categories, and can provide better services for higher-level applications such as land object monitoring and change detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a schematic diagram of the method flow of the present invention;

[0027] Figure 2 A block diagram of the unbalanced hyperspectral image classification model constructed in the present invention;

[0028] Figure 3 The hyperspectral images are obtained from public websites;

[0029] Figure 4 To use the existing HyperGAMO method Figure 3 Simulation result diagram for classification;

[0030] Figure 5 In order to use the present invention Figure 3 Figure 2. Simulation results of classification. DETAILED DESCRIPTION

[0031] The embodiments and effects of the present invention are further described below in conjunction with the accompanying drawings:

[0032] This example uses the University of Pavia hyperspectral classification standard dataset as an example to classify it. The pseudo-color composite image of the University of Pavia data obtained by the imaging spectrometer of the reflective optical system is shown in Figure 3 As shown in (a), the corresponding true value label is Figure 3 As shown in (b), it contains 9 types of ground objects and a total of 42,776 labeled samples.

[0033] Reference Figure 1 The specific implementation steps of this example are as follows:

[0034] Step 1: Construct training and testing samples.

[0035] 1.1) Use principal component analysis to process hyperspectral images, achieve feature dimensionality reduction, and retain the first 20 principal components;

[0036] 1.2) The principal component bands are used to construct samples by taking spectral-spatial neighborhood features with a fixed size, and the size of each sample is 13×13×20;

[0037] 1.3) From Figure 3 Among the samples shown, 1% is randomly selected as the training set, totaling 423 samples, and the remaining samples are used as the test set, totaling 42353 samples, where the training set is represented by X = {x1, ..., x 423}, the label is Y = {y1,...,y 423}, x i is any training sample. Since there are 9 types of objects in the data, x i The corresponding label yi ∈{1,2,...,9};

[0038] 1.4) Encode the label of each training sample into a vector y in one-hot form i .

[0039] Step 2: Build an unbalanced hyperspectral image classification algorithm model based on a deep generative model.

[0040] Reference Figure 2 , the specific implementation of this step is as follows:

[0041] 2.1) Establish a three-dimensional encoder f θ :

[0042] 2.1.1) Set up three three-dimensional convolution modules, where the first two three-dimensional convolution modules are composed of a cascade of convolution layers, normalization layers, and activation layers, and the last three-dimensional convolution module is composed of a cascade of convolution layers, normalization layers, activation layers, and reconstruction layers. The three normalization layers have the same structure and parameters as the three activation layers, and the convolution kernel parameters of the three convolution layers are different, namely:

[0043] For the first three-dimensional convolutional layer, the number of input vectors is 1, the size of each input vector is (13, 13, 20), the number of convolution kernels is 32, the size of each convolution kernel is (3, 3, 7), the stride is (1, 1, 1), the number of output vectors is 32, and the size of each input vector is (11, 11, 14);

[0044] The second three-dimensional convolution layer has 32 input vectors, each of which has a size of (11, 11, 14), 64 convolution kernels, each of which has a size of (3, 3, 5), a stride of (1, 1, 1), and 64 output vectors, each of which has a size of (9, 9, 10).

[0045] The third three-dimensional convolution module has an input vector size of 64, the size of each input vector is (9,9,10), the number of convolution kernels is 128, the size of each convolution kernel is (3,3,3), the stride is (1,1,1), the number of output vectors is 128, and the size of each output vector is (7,7,8). In order to facilitate connection with subsequent modules, the reconstruction layer converts the 128 (7,7,8) output vector sizes into (7,7,1024).

[0046] 2.1.2) Set up a two-dimensional convolution module, which is composed of a cascade of convolutional layers, normalization layers, activation layers, and reconstruction layers. The number of input vectors of the convolutional layer is 1024, and the size of each vector is (7,7). The number of convolution kernels is 128, and the size of each convolution kernel is (3,3). The number of output vectors is 128, and the size of each vector is (5,5).

[0047] The output of the two-dimensional convolution needs to be converted into a one-dimensional vector through the reconstruction layer, that is, the output is reconstructed into a one-dimensional output vector of size 3200 Among them, θ1 represents the parameters of the first stage, x i is the i-th training sample. The two-dimensional convolution module mines the deep spatial features in the hyperspectral samples, thereby making full use of the spatial information contained in the hyperspectral.

[0048] 2.1.3) Set up a fully connected network, which consists of a connection layer cascaded with two parallel fully connected networks, where:

[0049] The connection layer converts the label y i With features Connect so that the feature vector obtains the label information;

[0050] The first fully connected network consists of two fully connected layers of different sizes. The conversion matrix size of the first fully connected layer is (3209, 3200), and the conversion matrix size of the second fully connected layer is (3200, 64);

[0051] The second fully connected network also consists of two fully connected layers of different sizes. The transformation matrix size of the first fully connected layer is (3209, 3200), and the transformation matrix size of the second fully connected layer is (3200, 64).

[0052] 2.1.4) The above three three-dimensional convolution modules, one two-dimensional convolution module, one fully connected module and the existing heavy parameter module are sequentially cascaded to form a three-dimensional encoder;

[0053] 2.2) Select the small category upsampling module to perform the variable z in the implicit space i The small sample upsampling in is Among them, n c Represents sample x i The number of samples belonging to the cth category;

[0054] 2.3) Build a 3D decoder

[0055] 2.3.1) Set up a fully connected layer with a transformation matrix size of (64,4032) and an output size of 4032;

[0056] 2.3.2) Set up a reconstruction layer for resizing the output of the fully connected layer, whose output is 64 vectors of size (3,3,7);

[0057] 2.3.3) Construct three 3D deconvolution modules. Each 3D deconvolution module is composed of a cascade of deconvolution layers, normalization layers, and activation layers. The three normalization layers have the same structure as the three activation layers, and the convolution kernel parameters of the three deconvolution layers are different, namely:

[0058] The number of input vectors of the first deconvolution layer is 64, the size of each input vector is (3,3,7), the number of convolution kernels is 32, the size of each convolution kernel is (3,3,3), the step size is (2,2,2), the number of output vector sizes is 32, and the size of each output vector is (6,6,10);

[0059] The number of input vectors of the second deconvolution layer is 32, the size of each input vector is (6, 6, 10), the number of convolution kernels is 16, the size of each convolution kernel is (3, 3, 3), the step size is (2, 2, 2), the number of output vectors is 16, and the size of each output vector is (12, 12, 20);

[0060] The number of input vectors of the third deconvolution layer is 16, the size of each input vector is (12, 12, 20), the number of convolution kernels is 1, the size is (2, 2, 2), the step size is (1, 1, 1), and the output vector size is (13, 13, 20).

[0061] 2.3.3) The above-mentioned 1 fully connected layer, 1 reconstruction layer, 1 2D convolution module and 3 3D deconvolution modules are sequentially cascaded to form a 3D decoder.

[0062] 2.3.4) The 3D decoder converts the implicit features obtained in step 2.1 into and the upsampled feature z obtained in step 2.2 i Reconstructed into generated samples that are close to the original spectral-spatial neighborhood samples To ensure the implicit features’ ability to represent the input samples.

[0063] 2.4) Construct classifier g η . g η It includes 1 fully connected layer, and the size of the transformation matrix is ​​(64,9) to transform the above original latent features And upsampled features, converted into probability vectors belonging to each category Used to determine the category to which the sample belongs.

[0064] 2.5) The three-dimensional encoder is cascaded with the small category upsampling module, and the three-dimensional decoder is connected in parallel with the classifier. The output of the small category upsampling module is simultaneously input into the three-dimensional decoder and the classifier in parallel to form an unbalanced hyperspectral image classification network model.

[0065] Step 3: Construct the loss function of the unbalanced hyperspectral image classification network model training model.

[0066] 3.1) Construct a regularization loss function L based on maximizing the mean difference mmd , which is used to constrain the mean μ and variance parameter σ 2 The conditional probability distribution of the determined implicit features is consistent with the Gaussian prior distribution. The specific formula is as follows:

[0067]

[0068] Among them, p θ (z i |x i ,y i ) represents the conditional probability distribution of the implicit features, A Gaussian prior distribution representing latent features;

[0069] 3.2) Constructing the reconstruction loss function L based on neighborhood distance PdRec , which is used to make the reconstructed 3D features similar to the original sample features:

[0070] Calculate pixel p ik and Distance between:

[0071] Counting pixels With x i Distance between:

[0072] Using the two distances above, calculate pixel p ik With pixels Distance between:

[0073] According to the pixel p ik With pixels The distance between them is used to obtain the reconstruction loss function based on the neighborhood distance:

[0074]

[0075] Among them, d represents the calculation of Euclidean distance, p ik Represents x i Any pixel in express Any pixel in For x i The corresponding generated samples;

[0076] 3.3) Select the existing classification loss function based on cross entropy: It is used to reduce the difference between the classification results of the training sample features and the upsampled features and their true value labels, where y ic and denote the true and predicted x respectively. i The probability of belonging to class c;

[0077] 3.4) Use the regularization loss function L based on maximizing the mean difference mmd , reconstruction loss function L based on neighborhood distance PdRec , classification loss function L based on cross entropy cls , and get the total loss function L of the training model total :

[0078] L total =λ·L mmd +L PdRec +L cls , where λ represents the weight parameter, and its value in this example is 0.01.

[0079] Step 4: Use the training samples and the gradient descent method to train the parameters of the hyperspectral image classification model.

[0080] 4.1) Set the initial value of the learning rate α, the maximum number of iterations T, and the number of batches B;

[0081] 4.2) Initialize the parameters of the network model, including the weight parameter w, bias parameter b and parameter θ = {θ1, θ2} in the 3D encoder, the weight parameter w, bias parameter b and parameter θ in the 3D decoder Mean parameter in the upsampling module for small class sample features and variance parameter and classifier parameter η;

[0082] 4.3) Divide the training samples into batches according to the batch size and input them into the unbalanced hyperspectral image classification network in turn for back propagation to update the total loss function The gradient of The network training parameters are updated in the descending direction through forward propagation, and the above calculations are performed for each batch of input networks until the entire training set sample input network is traversed, completing one training;

[0083] 4.4) Repeat the process in 4.3) until the maximum number of iterations T is reached to obtain a trained unbalanced image classification model.

[0084] Step 5: Use the trained unbalanced hyperspectral image classification model to classify the test samples.

[0085] Each test sample is input into the trained unbalanced hyperspectral image classification model, and the potential features corresponding to each sample are upsampled s times. The importance sampling is used to approximate the Bayesian rule to obtain the probability p(y|x) of the label to which each test sample belongs:

[0086]

[0087] Among them, softmax is the normalization function, L total is the total loss function, x is the test sample, y c is the label corresponding to the c-th test sample, is the potential feature corresponding to the c-th test sample upsampled s times, θ is the trainable parameter of the three-dimensional encoder, is the trainable parameter of the 3D decoder, and η is the trainable parameter of the classifier.

[0088] The effect of the present invention can be further illustrated by the following simulation results.

[0089] 1. Simulation conditions

[0090] 1. Test data: Using the University of Pavia data, randomly select 1% of the labeled samples as the training set and the rest of the samples as the test set.

[0091] 2. Test environment: Ubuntu 16.04LTS system, NVIDIA GeForce GTX 1080Ti GPU, TensorFlow deep learning framework.

[0092] 2. Simulation content

[0093] Simulation 1: Under the above conditions, the existing small-category upsampling hyperspectral image classification method HyperGAMO based on generative adversarial network is used to classify the University of Pavia data. The results are as follows: Figure 4 shown.

[0094] Simulation 2: Under the above conditions, the University of Pavia data is classified using the method of the present invention. The results are as follows: Figure 5 shown.

[0095] pass Figure 4 and Figure 5 By comparison, it can be found that the classification result map obtained by the method proposed in the present invention is closer to the distribution of objects in the true value map, the classification effect obtained on most small categories is better, and better classification performance is achieved.

[0096] Evaluation indicators

[0097] The above two methods were tested 10 times using the same 10 random numbers, and the confusion matrix, classification accuracy PA of each category, average classification accuracy AA, overall classification accuracy OA and KAPPA coefficient were calculated. The test results are shown in Table 1.

[0098] The indicator calculation formula is as follows:

[0099]

[0100]

[0101]

[0102] Among them, TP is the number of samples correctly classified into this category, FN is the number of samples of this category that are incorrectly classified as other categories, TN is the number of non-class samples classified as other categories, and FP is the number of other samples that are incorrectly classified as samples of this category. x i+ represents the sum of all elements in the i-th row of the confusion matrix, that is, the sum of the actual number of this category, x +i represents the sum of all elements in the i-th column of the confusion matrix, that is, the sum of the number of predicted cost categories, N represents the sum of all elements, c is the number of categories, x ii Represents the elements on the diagonal of the confusion matrix, that is, the number of correct predictions for each category.

[0103] Table 1 Simulation results of the present invention and the comparative method

[0104]

[0105] The bold category numbers in Table 1 are small sample categories, whose sample numbers are smaller than the average sample number of each category.

[0106] It can be seen from Table 1 that, compared with the current more advanced HyperGAMO method, the classification accuracy of the small categories with category numbers 3, 4, 5, 7, and 8 in the present invention is improved, and the average classification accuracy, overall classification accuracy, and KAPPA coefficient are also significantly improved. In addition, the standard deviation obtained by the method of the present invention is small, which verifies the robustness of the method in the face of non-equilibrium hyperspectral classification.

Claims

1. A classification method for unbalanced hyperspectral images, characterized in that: The following steps are involved: 1) Obtain hyperspectral image data and perform band selection, segment the hyperspectral image after band selection into spectral-spatial feature neighborhood blocks according to a fixed size, and then divide it into training samples and test samples at a ratio of 1:99; 2) Construct an unbalanced hyperspectral image classification network model: 2a) Establishing a 3D encoder composed of three 3D convolution modules cascaded with a 2D convolution module, cascaded with two parallel fully connected networks, and then cascaded with a re-parameter module; 2b) Setting a small category upsampling module in the latent space; 2c) building a 3D decoder consisting of one fully connected layer and multiple deconvolutional layers; 2d) Building an image classifier module consisting of one fully connected layer; 2e) cascading the three-dimensional encoder and the small category upsampling module, connecting the three-dimensional decoder and the classifier in parallel, and inputting the output of the small category upsampling module into the three-dimensional decoder and the classifier in parallel to form an unbalanced hyperspectral image classification network model; 3) Training the unbalanced hyperspectral image classification network model: 3a) Construct the overall loss function L of the network model Total =λ·L mmd +L PdRec +L cls , where L mmd is the regularization loss function based on maximizing the mean difference, L PdRec is the reconstruction loss function based on neighborhood distance, L cls is the classification loss function based on cross entropy, λ is the parameter; 3b) Initializing the parameters of the unbalanced hyperspectral image classification network model includes the weight parameter w, bias parameter b and parameter θ={θ1,θ2} in the 3D encoder, the weight parameter w, bias parameter b and parameter θ={θ1,θ2} in the 3D decoder Mean parameter in the upsampling module for small class sample features and variance parameter and classifier parameter η; 3c) inputting the training samples into the unbalanced hyperspectral image classification network model, using the gradient descent method to cyclically update the parameters in the unbalanced hyperspectral image classification network to reduce the gradient value of the total loss function until the maximum number of iterations T is reached, thereby obtaining a trained unbalanced hyperspectral image classification network model; 4) Input the test sample into the trained unbalanced hyperspectral image classification network model and output the hyperspectral image classification result map.

2. The method according to claim 1, characterized in that: The step 1) of obtaining the hyperspectral image data and performing band selection is to perform band selection processing on the hyperspectral image using the principal component analysis method to achieve feature dimensionality reduction and retain the first K principal components; In the above 1), the hyperspectral image after band selection is segmented into spectral-spatial feature neighborhood blocks according to a fixed size, and samples are selected by using the principal component band, and the size of each sample is S×S×K, so as to obtain spectral-spatial neighborhood features, where S represents the spatial size of the neighborhood; The training image in 1) is represented as X = {x1, ...x i ...,x N }, the label corresponding to the training image is Y = {y1,...y i ...,y N }, where x i is the i-th training image, y i is the i-th label, i ranges from 1 to N, and N represents the number of training images.

3. The method according to claim 1, characterized in that: The three three-dimensional convolution modules in 2a) are all composed of a cascade of convolution layers, normalization layers and activation layers. The convolution kernels of the three convolution layers are (3, 3, 7), (3, 3, 5) and (3, 3, 3), respectively. The three normalization layers have the same structure as the three activation layers, and their structure is: first convolution layer->first normalization layer->first activation layer->second convolution layer->second normalization layer->second activation layer->third convolution layer->third normalization layer->third activation layer.

4. The method according to claim 1, characterized in that: The two-dimensional convolution module in 2a) is composed of a convolution layer with a convolution kernel of (3, 3), a normalization layer, and an activation layer cascaded, and its structure is: convolution layer->normalization layer->activation layer.

5. The method according to claim 1, characterized in that: The 2a) heavy parameter module is derived from the Gaussian distribution The variable ε is sampled from the input image, and then the potential features of the input image are calculated by combining the output of the fully connected layer: i =μ+εσ, where μ and σ are the mean and variance parameters of the outputs of two parallel fully connected networks, respectively. x i is the i-th input image, y i is the label corresponding to the input image, and θ2 is the training parameter of the encoder.

6. The method according to claim 1, characterized in that: The 2b) small category upsampling module is set in the implicit space, which is to perform the following number of upsampling on each sample of the small category in the implicit space: Upsampling, where r represents the upsampling factor, n max Indicates the number of samples in the largest category, n c Represents sample x i The number of samples belonging to the cth category is used to expand the small category.

7. The method according to claim 1, characterized in that: The three-dimensional decoder constructed in 2c) is composed of a fully connected layer and two deconvolution modules, each of which includes a deconvolution layer, a normalization layer and an activation layer. The convolution kernels of the two deconvolution layers are (3, 3, 7) and (3, 3, 5) respectively, and the two normalization layers have the same structure as the two activation layers. The structure of the 3D decoder is: Fully connected layer -> first deconvolution layer -> first normalization layer -> first activation layer -> second deconvolution layer -> second normalization layer -> second activation layer.

8. The method according to claim 1, characterized in that: The regularization term loss function L in 3a) is based on maximizing the mean difference mmd , reconstruction loss function L based on neighborhood distance PdRec , classification loss function L based on cross entropy cls They are respectively expressed as follows: Among them, p θ (z i |x i ,y i ) represents the conditional probability distribution of the implicit features, represents the Gaussian prior distribution of the implicit features, x i is the i-th input image, y i is the label corresponding to the i-th input image, z i is the i-th input image, θ is the training parameter of the 3D encoder, are the training parameters of the 3D decoder; Represents pixel p ik With pixels The distance between Represents pixels With x i The distance between Represents pixel p ik and The distance between d means calculating the Euclidean distance, p ik Represents x i For any pixel in express For any pixel in For x i The corresponding generated sample, S is the image x i The side length, y ic and denote the true and predicted x respectively. i The probability of belonging to class c.

9. The method according to claim 1, characterized in that: In 3c), the gradient descent method is used to cyclically update the parameters in the unbalanced hyperspectral image classification network, which is implemented as follows: 3c1) Set the initial value of the learning rate α, the maximum number of iterations T, the batch size B, and initialize the network training parameters; 3c2) Divide the training samples into batches according to the batch size and input them into the unbalanced hyperspectral image classification network in turn for back propagation to update the total loss function The gradient of The network training parameters are updated by forward propagation in the descending direction; the above calculations are performed for each batch of input networks until the entire training set sample input network is traversed and one training is completed; 3c3) Repeat the process of 3c2) until the maximum number of iterations T is reached to obtain a trained unbalanced image classification model.