A hyperspectral image classification method based on deep transfer network
Through the combination of deep transfer network and CORAL/LMMD algorithm, the problem of poor classification effect when the training set and test set data distribution are different in hyperspectral image classification is solved. Only source domain labeled samples are used to achieve effective classification of unlabeled samples in the target domain. classification, improving classification accuracy.
Patent Information
- Application Number
- CN202111503748.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-10
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2041-12-10
AI Technical Summary
Existing hyperspectral image classification methods are difficult to obtain ideal classification results when the data distribution of the training set and test set is different, and insufficient labeled samples affect the application of deep learning methods.
A method based on the deep transfer network is used to reduce dimensionality through band selection and construct a deep transfer neural network. The CORAL and LMMD algorithms are used to reduce the statistical difference between domains, and only the source domain labeled samples are used to complete the classification of unlabeled samples in the target domain.
It extracts deep and discriminative features of the target domain, realizes cross-domain classification, improves the classification accuracy of hyperspectral images, and can complete effective classification with a small number of labeled samples.
Smart Images

Figure CN114494762B
Abstract
Description
Technical Field
[0001] The invention relates to a method for realizing hyperspectral image classification by utilizing a deep migration network, and belongs to the field of pattern recognition. Background Art
[0002] Hyperspectral images (HSI) have rich spectral and spatial information, and have broad application prospects in agriculture, climate detection, national defense and security, etc. HSI classification is a common task in these applications, and its purpose is to classify each pixel in the image into different categories based on the spectral and spatial information obtained by the detection of the ground objects. Researchers have proposed many methods to improve the accuracy of HSI classification, including random forests, support vector machines, and decision trees. Although these traditional hyperspectral image classification methods have simple models, most of them cannot guarantee classification accuracy.
[0003] In recent years, deep learning has achieved excellent performance in many computer vision tasks, such as image processing, target detection, and natural language processing. Deep learning can automatically learn features, which makes it applicable to various task scenarios. In addition, deep learning has a strong nonlinear representation ability and can extract relatively deep and discriminative features of the data. The above advantages make deep learning successfully applied to hyperspectral image classification tasks. The powerful feature expression ability of deep learning often requires a large number of labeled training samples to support it. As we all know, with the development of a new generation of satellite hyperspectral sensors, we can quickly obtain a large number of unlabeled HSIs, but it still takes relevant experts a lot of time to label these images. Therefore, insufficient labeled samples seriously affect the application of deep learning methods in hyperspectral classification tasks. To solve the above problems, many researchers have combined active learning, data enhancement and other methods with deep learning to complete hyperspectral image classification using a small number of labeled samples. Although the above methods can alleviate the problem of insufficient training samples caused by the difficulty of HSI labeling to a certain extent, when the training set and test set data come from similar but different fields, that is, when the data distribution of the training set and the test set is similar but different, the above methods are difficult to obtain ideal experimental results. Transfer learning can solve this problem well. It transfers knowledge from a labeled domain (source domain) to a similar but differently distributed domain (target domain) by exploring domain-invariant structures, thereby completing cross-domain classification. The deep transfer learning model obtained by combining deep networks with transfer learning can learn deeper and more transferable features, and has achieved breakthrough results in hyperspectral classification tasks. This is because the deep transfer learning network can extract discriminative features and invariant factors from the data, and effectively group HSI features according to the correlation of invariant factors. Summary of the invention
[0004] Purpose of the invention: In order to overcome the deficiencies in the prior art, the present invention proposes a hyperspectral image classification method based on a deep migration network, which can classify unlabeled samples in the target domain using only labeled samples in the source domain.
[0005] Technical solution: A hyperspectral image classification method based on a deep migration network, comprising the following steps:
[0006] Step 1: Use band selection to reduce the dimension of the original hyperspectral image: remove band redundancy and obtain the hyperspectral data X0 after dimension reduction. The hyperspectral data X0 includes the source domain data after dimension reduction. and target domain data
[0007] Step 2: Use the source domain labeled samples to train the auxiliary classifier, and use the auxiliary classifier to obtain the target domain pseudo label;
[0008] Step 3: Build a deep transfer neural network, use the domain adaptation layer to adapt the source domain and target domain based on CORAL loss to reduce the difference in second-order statistics, and reduce the difference in first-order statistics between the source domain and target related subspace based on LMMD;
[0009] Step 4: Use the trained auxiliary classifier to classify the target domain data.
[0010] Furthermore, in step 1, the original hyperspectral image is reduced in dimension by band selection: band redundancy is removed to obtain the hyperspectral data X0 after dimension reduction, which specifically includes the following process:
[0011] Define the number of original HSI bands as N b , with the interval number as and Select a and b bands respectively, and the number of bands after dimensionality reduction is d, where represents the rounding down operation, we can get:
[0012]
[0013] Define the hyperspectral data X0∈R after dimensionality reduction n×d As the input of the model, n represents the number of samples, and the spectral data X0 includes the source domain data after dimensionality reduction and target domain data in, and where n s Indicates the number of source domain samples, n t represents the number of samples in the target domain, Y s is the source domain label.
[0014] Furthermore, in step 3, a deep transfer neural network is constructed, and the domain adaptation layer is used to adapt the source domain and the target domain based on the CORAL method to reduce the difference in second-order statistics, and at the same time, the first-order statistics difference between the source domain and the target related subspace is reduced based on LMMD; specifically, the following contents are included:
[0015] The deep migration network DTN includes a fully connected layer, a nonlinear layer, a domain adaptation layer, and a Softmax layer. and target domain data Input the deep transfer network DTN, and extract features through the feature extractor composed of a fully connected layer and a nonlinear layer; the fully connected layer input is:
[0016] F1=I×W1+b1
[0017] Among them, I is the input of the fully connected layer, b1 is the bias; the output of the fully connected layer is connected to the nonlinear layer as input, and the output of the nonlinear layer is:
[0018]
[0019] Among them, I N Input to the nonlinear layer;
[0020] The domain adaptation layer is used to adapt the distribution differences between the two domains, and then the output of the domain adaptation layer is connected to the Softmax layer; the loss function of the deep transfer network DTN is defined as:
[0021]
[0022] in, is the covariance domain adaptation term, is the subspace adaptation term, is the source domain data classification loss, α1 and α2 are variance domain adaptation parameters and subspace adaptation parameters respectively; the covariance domain adaptation term can be expressed as:
[0023]
[0024] Among them, d1 is the dimension of the domain adaptation layer input, C s and C t Represent the covariance matrix of source domain and target domain data respectively;
[0025] The subspace adaptation term can be expressed as:
[0026]
[0027] in, is the target domain pseudo label obtained by the auxiliary classifier, c∈{1,2,...,C} is the category index, and express and The weight of class c is is the weighted sum of class c, It can be calculated as:
[0028]
[0029] The classification loss of source domain data can be expressed as:
[0030]
[0031] Among them, C is the number of categories, Y represents the category matrix, and S is the prediction result of the deep migration network DTN model.
[0032] Beneficial effects: The cross-domain hyperspectral image classification method of the deep migration network of the present invention not only aligns the second-order statistical information of the two domains as a whole based on CORAL, and adapts the global distribution of the two domains. It also aligns the first-order statistical information of the relevant sub-domains based on the local maximum mean difference, and adapts the local distribution of the two domains. The proposed method can extract deep and discriminative features of the target domain, and complete the classification of unlabeled samples in the target domain using only labeled samples in the source domain. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 Schematic diagram of the method of the present invention. DETAILED DESCRIPTION
[0034] The present invention will be further explained below in conjunction with the accompanying drawings.
[0035] A hyperspectral image classification method based on deep transfer network can classify unlabeled samples in target domain using only labeled samples in source domain.
[0036] Technical solution: A hyperspectral image classification method based on a deep migration network, comprising the following steps:
[0037] Step 1: Use band selection to reduce the dimension of the original hyperspectral image: remove band redundancy and obtain the hyperspectral data X0 after dimension reduction. The hyperspectral data X0 includes the source domain data after dimension reduction. and target domain data
[0038] The original HSI has many bands and strong correlation between bands, so there is a lot of redundant information between bands. Directly inputting the original HSI into the deep migration network DTN will increase the network parameters and reduce the model performance. Apply band selection to reduce the dimension of the original HSI data. Define the number of original HSI bands as N b , with the interval number as and Select a and b bands respectively, and the number of bands after dimensionality reduction is d, where represents the rounding down operation, we can get:
[0039]
[0040] Define the hyperspectral data X0∈R after dimensionality reduction n×d As the input of the model, n represents the number of samples, and the spectral data X0 includes the source domain data after dimensionality reduction and target domain data in, and where n s Indicates the number of source domain samples, n t represents the number of samples in the target domain, Y s is the source domain label.
[0041] Step 2: Use the source domain labeled samples to train the auxiliary classifier, and use the auxiliary classifier to obtain the target domain pseudo label;
[0042] Step 3: Construct a deep transfer neural network. Based on the CORAL (CORrelation Alignment) algorithm, use the domain adaptation layer to reduce the difference in the second-order statistics of the two domains. At the same time, use the LMMD (Local Maximum Mean Discrepancy) to reduce the difference in the first-order statistics of the source and target related subspaces.
[0043] Deep neural networks are widely used in HSI classification due to their powerful deep feature extraction capabilities. However, when the training set and the test set belong to different data distributions, it is difficult for deep neural networks to learn transferable knowledge, resulting in insufficient model classification capabilities. To solve the above problems, a deep transfer network (DTN) is proposed. A domain adaptation layer is added to the DNN to align the deep, discriminative source and target domain features extracted by the DNN with global second-order statistics and first-order statistics of each related subspace.
[0044] The deep transfer network DTN is a feed-forward neural network consisting of a fully connected layer, a nonlinear layer, a domain adaptation layer, and a Softmax layer. Figure 1 FC1 in the figure represents the domain adaptation layer, and FC2 represents the Softmax layer.
[0045] The source domain data after dimension reduction and target domain data Input into the deep transfer network DTN, and extract features through the feature extractor composed of a fully connected layer and a nonlinear layer. Among them, the fully connected layer input is:
[0046] F1=I×W1+b1
[0047] Among them, I is the input of the fully connected layer, and b1 is the bias. The output of the fully connected layer is connected to the nonlinear layer as input, and the output of the nonlinear layer is:
[0048]
[0049] Among them, I N is the input of the nonlinear layer. A domain adaptation layer is added to adapt to the distribution difference between the two domains, and then the output of the domain adaptation layer is connected to the Softmax layer. The loss function of the deep transfer network DTN is defined as:
[0050]
[0051] in, is the covariance domain adaptation term, is the subspace adaptation term, is the source domain data classification loss, α1 and α2 are the variance domain adaptation parameter and subspace adaptation parameter respectively.
[0052] The covariance domain adaptation term can be expressed as:
[0053]
[0054] Among them, d1 is the dimension of the domain adaptation layer input, C s and C t Represent the covariance matrices of source domain and target domain data respectively.
[0055] The subspace adaptation term can be expressed as:
[0056]
[0057] in, is the target domain pseudo label obtained by the auxiliary classifier, c∈{1,2,...,C} is the category index, and express and The weight of class c is is the weighted sum of class c, It can be calculated as:
[0058]
[0059] The classification loss of source domain data can be expressed as:
[0060]
[0061] Among them, C is the number of categories, Y represents the category matrix, and S is the prediction result of the deep migration network DTN model.
[0062] Step 4: Use the trained auxiliary classifier to classify the target domain data.
[0063] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A hyperspectral image classification method based on a deep migration network, characterized in that: The steps include: Step 1: Use band selection to reduce the dimension of the original hyperspectral image: remove band redundancy and obtain the hyperspectral data X0 after dimension reduction. The hyperspectral data X0 includes the source domain data after dimension reduction. and target domain data Step 2: Use the source domain labeled samples to train the auxiliary classifier, and use the auxiliary classifier to obtain the target domain pseudo label; Step 3: Build a deep transfer neural network, use the domain adaptation layer to adapt the source domain and target domain based on CORAL loss to reduce the difference in second-order statistics, and reduce the difference in first-order statistics between the source domain and target related subspace based on LMMD; Step 4: Use the trained auxiliary classifier to classify the target domain data; In step 3, a deep transfer neural network is constructed. Based on the CORAL method, the domain adaptation layer is used to adapt the source domain and the target domain to reduce the difference in second-order statistics. At the same time, the first-order statistics difference between the source domain and the target related subspace is reduced based on LMMD. The specific contents include the following: The deep migration network DTN includes a fully connected layer, a nonlinear layer, a domain adaptation layer, and a Softmax layer. and target domain data Input the deep transfer network DTN, and extract features through the feature extractor composed of a fully connected layer and a nonlinear layer; the fully connected layer input is: F1=I×W1+b1 Among them, I is the input of the fully connected layer, b1 is the bias; the output of the fully connected layer is connected to the nonlinear layer as input, and the output of the nonlinear layer is: Among them, I N Input to the nonlinear layer; The domain adaptation layer is used to adapt the distribution differences between the two domains, and then the output of the domain adaptation layer is connected to the Softmax layer; the loss function of the deep transfer network DTN is defined as: in, is the covariance domain adaptation term, is the subspace adaptation term, is the source domain data classification loss, α1 and α2 are variance domain adaptation parameters and subspace adaptation parameters respectively; the covariance domain adaptation term can be expressed as: Among them, d1 is the dimension of the domain adaptation layer input, C s and C t Represent the covariance matrix of source domain and target domain data respectively; The subspace adaptation term can be expressed as: in, is the target domain pseudo label obtained by the auxiliary classifier, c∈{1,2,...,C} is the category index, and express and The weight of class c is is the weighted sum of class c, It can be calculated as: The classification loss of source domain data can be expressed as: Among them, C is the number of categories, Y represents the category matrix, and S is the prediction result of the deep migration network DTN model.
2. According to claim 1, a hyperspectral image classification method based on deep migration network is characterized in that: In step 1, band selection is used to reduce the dimension of the original hyperspectral image: band redundancy is removed to obtain the hyperspectral data X0 after dimension reduction, which specifically includes the following process: Define the number of original HSI bands as N b , with the interval number as and Select a and b bands respectively, and the number of bands after dimensionality reduction is d, where represents the rounding down operation, we can get: Define the hyperspectral data X0∈R after dimensionality reduction n×d As the input of the model, n represents the number of samples, and the spectral data X0 includes the source domain data after dimensionality reduction and target domain data in, and where n s Indicates the number of source domain samples, n t represents the number of samples in the target domain, Y s is the source domain label.
