Hyperspectral image unmixing method and device based on priori knowledge correction and Swin Transformer
By introducing prior knowledge correction and Swin Transformer dual-branch network into hyperspectral image unmixing, the problems of low unmixing accuracy and insufficient reliability in the existing technology are solved, and a more efficient hyperspectral image unmixing effect is achieved.
Patent Information
- Application Number
- CN202410505185.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-25
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-04-25
AI Technical Summary
Existing hyperspectral image unmixing methods have low unmixing accuracy, insufficient reliability, and good generalization. In particular, deep learning models have deficiencies in capturing global contextual features and multi-scale features, resulting in unsatisfactory unmixing results. .
The Swin Transformer dual-branch hyperspectral image unmixing network model based on prior knowledge correction is used. The upper branch is used to provide pure pixel prior information. The lower branch uses the Swin Transformer structure for feature extraction and decomposition processing, and a priori is introduced through a weight sharing strategy. knowledge to improve the reliability and demixing accuracy of network models.
It improves the accuracy and reliability of hyperspectral image unmixing, reduces computational complexity, can extract endmembers and abundance maps more accurately, improves unmixing performance, and outperforms traditional methods.
Smart Images

Figure CN118736428A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hyperspectral image unmixing, and in particular to a hyperspectral image unmixing method and device based on prior knowledge correction and SwinTransformer. Background Art
[0002] With the development of science and technology, remote sensing earth observation technology has become increasingly mature, and refinement, practicality, and integration have become the future development direction of high-resolution earth observation systems. As an advanced technology in aerospace science and technology, hyperspectral remote sensing technology has the advantages of rich spectral information and high spectral resolution. It has a wide range of application needs in civil fields such as environmental monitoring and disaster assessment, fine classification of crops and vegetation, marine resource surveys, detection and identification of rocks and minerals, illegal planting investigations, and military fields such as military target reconnaissance. However, the complexity and diversity of ground objects leads to the existence of mixed pixels in hyperspectral images. In addition, the resolution of hyperspectral imaging systems is usually not high, resulting in a pixel usually covering a range of tens or even hundreds of meters. This greatly limits the development of quantitative applications of hyperspectral data. Therefore, how to reduce the impact of mixed pixels, study the unmixing method of hyperspectral images, and improve the unmixing accuracy of hyperspectral images is of great practical significance for improving the accuracy of quantitative applications of hyperspectral image data, improving target detection capabilities, and realizing fine classification of ground objects.
[0003] At present, spectral unmixing mainly uses deep learning to construct nonlinear unmixing models and physically based linear models to fit the mixture. However, since spectral imaging is caused by the scale factor caused by lighting and terrain changes, complex noise generated by environmental conditions or instrument sensors, physical and chemical atmospheric effects, and nonlinear mixing of materials, simple linear models can hardly fully fit the complex spectral mixing phenomenon and it is difficult to accurately decompose mixed pixels. Therefore, the study of nonlinear models for spectral decomposition is particularly important. The powerful nonlinear fitting ability of deep learning methods represented by convolutional neural networks has excellent performance in the field of spectral unmixing and performs well in the field of spectral unmixing.
[0004] At present, existing methods are mainly based on convolutional neural networks, which mainly learn features in local intervals and do not have the ability to capture global context features. In addition, operations such as downsampling and pooling lead to loss of details in the unmixing process. The unmixing network with a Transformer structure has considerable computational complexity and has the problem of poor ability to capture multi-scale features. In addition, most deep learning models are prone to generate meaningless or non-existent end members when performing spectral decomposition, and do not have sufficient reliability and good generalization. Summary of the invention
[0005] In order to solve the technical problems that the existing hyperspectral image unmixing methods based on deep learning have low unmixing accuracy and lack of sufficient reliability and good generalization, the embodiment of the present invention provides a hyperspectral image unmixing method and device based on prior knowledge correction and Swin Transformer. The technical solution is as follows:
[0006] On the one hand, a hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer is provided, the method is implemented by a hyperspectral image unmixing device, and the method includes:
[0007] S1. Obtain a hyperspectral image to be unmixed.
[0008] S2. Input the hyperspectral image into the trained hyperspectral image unmixing network model.
[0009] The hyperspectral image unmixing network model includes a first hyperspectral image unmixing network model branch and a second hyperspectral image unmixing network model branch.
[0010] The first hyperspectral image unmixing network model branch includes a first branch encoder, a first branch SwinTransformer module and a first branch decoder.
[0011] The second hyperspectral image unmixing network model branch includes a second branch encoder, a second branch SwinTransformer module and a second branch decoder.
[0012] A weight sharing strategy is used between the first hyperspectral image unmixing network model branch and the second hyperspectral image unmixing network model branch.
[0013] S3. Obtain a hyperspectral image unmixing result according to the hyperspectral image and the hyperspectral image unmixing network model.
[0014] Optionally, the training process of the hyperspectral image unmixing network model in S2 includes:
[0015] S21, obtaining a hyperspectral data set, performing pure pixel point extraction on an original hyperspectral image in the hyperspectral data set, and obtaining an extracted image.
[0016] S22. Obtain a weight of a first branch according to the extracted image and the first hyperspectral image unmixing network model branch.
[0017] S23, obtaining a weighted second hyperspectral image unmixing network model branch according to the weight of the first branch and the second hyperspectral image unmixing network model branch.
[0018] S24, inputting the original hyperspectral image into the weighted second hyperspectral image unmixing network model branch to obtain a reconstructed hyperspectral image.
[0019] S25. Design a loss function, and train the hyperspectral image unmixing network model according to the loss function to obtain a trained hyperspectral image unmixing network model.
[0020] Optionally, the hyperspectral image unmixing network model in S2 is as shown in the following formula (1):
[0021] Y=EA+N,st0≤E≤1,A≥0 (1)
[0022] Where Y represents the observed original hyperspectral image, E represents the endmember matrix, A represents the abundance matrix, and N represents the noise matrix.
[0023] Optionally, the loss function in S25 is as shown in the following equations (2)-(4):
[0024] L=ηL downstreamRE +σL downstreamSAD (2)
[0025]
[0026]
[0027] In the formula, L represents the total loss function, η represents the regularization parameter weight, and L downstreamRE represents the downstream network reconstruction error loss, σ represents the regularization parameter weight, L downstreamSAD represents the spectral angular distance loss of the downstream network, e represents the real end member, represents the estimated endmember, H represents the height of the original image, and W represents the width of the original image. represents the jth band of the ith endmember estimated by the network, e ij represents the jth band of the i-th endmember of the image, M represents the number of endmembers of the original hyperspectral image, and e i represents the i-th end member of the image, represents the ith endmember of the network estimate.
[0028] Optionally, the first branch encoder is used to extract features from the input image to obtain a first branch encoder output.
[0029] The first branch Swin Transformer module is used to divide the first branch encoder output into non-overlapping tokens, obtain context global information, and obtain the first branch Swin Transformer module output.
[0030] The first branch decoder is used to reconstruct the hyperspectral image of the output of the first branch Swin Transformer module.
[0031] Optionally, the first branch encoder includes a first convolutional layer, a second convolutional layer, and a third convolutional layer.
[0032] Among them, the first convolution layer includes the first convolution Conv 2D layer, the first batch normalization BN layer, the first Dropout layer and the Leaky ReLU function.
[0033] The second convolutional layer includes the second Conv 2D layer, the second BN layer, and the second Dropout layer.
[0034] The third convolutional layer includes the third Conv 2D layer and the third BN layer.
[0035] Optionally, the first branch Swin Transformer module includes one or more Swin Transformer encoders.
[0036] Each Swin Transformer encoder includes one or more moving window multi-head self-attention networks.
[0037] On the other hand, a hyperspectral image unmixing device based on prior knowledge correction and Swin Transformer is provided, and the device is applied to a hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer, and the device comprises:
[0038] The acquisition module is used to acquire the hyperspectral image to be unmixed.
[0039] An input module is used to input the hyperspectral image into the trained hyperspectral image unmixing network model;
[0040] The hyperspectral image unmixing network model includes a first hyperspectral image unmixing network model branch and a second hyperspectral image unmixing network model branch.
[0041] The first hyperspectral image unmixing network model branch includes a first branch encoder, a first branch SwinTransformer module and a first branch decoder.
[0042] The second hyperspectral image unmixing network model branch includes a second branch encoder, a second branch SwinTransformer module and a second branch decoder.
[0043] A weight sharing strategy is used between the first hyperspectral image unmixing network model branch and the second hyperspectral image unmixing network model branch.
[0044] The output module is used to obtain the hyperspectral image unmixing result according to the hyperspectral image and the hyperspectral image unmixing network model.
[0045] Optionally, the input module is further configured to:
[0046] S21, obtaining a hyperspectral data set, performing pure pixel point extraction on an original hyperspectral image in the hyperspectral data set, and obtaining an extracted image.
[0047] S22. Obtain a weight of a first branch according to the extracted image and the first hyperspectral image unmixing network model branch.
[0048] S23, obtaining a weighted second hyperspectral image unmixing network model branch according to the weight of the first branch and the second hyperspectral image unmixing network model branch.
[0049] S24, inputting the original hyperspectral image into the weighted second hyperspectral image unmixing network model branch to obtain a reconstructed hyperspectral image.
[0050] S25. Design a loss function, and train the hyperspectral image unmixing network model according to the loss function to obtain a trained hyperspectral image unmixing network model.
[0051] Optionally, the hyperspectral image unmixing network model is as shown in the following formula (1):
[0052] Y=EA+N,st0≤E≤1,A≥0 (1)
[0053] Where Y represents the observed original hyperspectral image, E represents the endmember matrix, A represents the abundance matrix, and N represents the noise matrix.
[0054] Optionally, the loss function is as shown in the following equations (2)-(4):
[0055] L=ηL downstreamRE +σL downstreamSAD (2)
[0056]
[0057]
[0058] In the formula, L represents the total loss function, η represents the regularization parameter weight, and L downstreamRE represents the downstream network reconstruction error loss, σ represents the regularization parameter weight, L downstreamSAD represents the spectral angular distance loss of the downstream network, e represents the real end member, represents the estimated endmember, H represents the height of the original image, and W represents the width of the original image. represents the jth band of the ith endmember estimated by the network, e ij represents the jth band of the i-th endmember of the image, M represents the number of endmembers of the original hyperspectral image, and e i represents the i-th end member of the image, represents the ith endmember of the network estimate.
[0059] Optionally, the first branch encoder is used to extract features from the input image to obtain a first branch encoder output.
[0060] The first branch Swin Transformer module is used to divide the first branch encoder output into non-overlapping tokens, obtain context global information, and obtain the first branch Swin Transformer module output.
[0061] The first branch decoder is used to reconstruct the hyperspectral image of the output of the first branch Swin Transformer module.
[0062] Optionally, the first branch encoder includes a first convolutional layer, a second convolutional layer, and a third convolutional layer.
[0063] Among them, the first convolution layer includes the first convolution Conv 2D layer, the first batch normalization BN layer, the first Dropout layer and the Leaky ReLU function.
[0064] The second convolutional layer includes the second Conv 2D layer, the second BN layer, and the second Dropout layer.
[0065] The third convolutional layer includes the third Conv 2D layer and the third BN layer.
[0066] Optionally, the first branch Swin Transformer module includes one or more Swin Transformer encoders.
[0067] Each Swin Transformer encoder includes one or more moving window multi-head self-attention networks.
[0068] On the other hand, a hyperspectral image unmixing device is provided, comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the hyperspectral image unmixing methods based on prior knowledge correction and Swin Transformer is implemented.
[0069] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned hyperspectral image unmixing methods based on prior knowledge correction and SwinTransformer.
[0070] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0071] In the embodiment of the present invention, a Swin Transformer dual-branch hyperspectral image unmixing network model with prior information correction is constructed, and the upper branch uses pre-extracted end members to provide pure pixel prior information. The lower branch uses the Swin Transformer structure to perform feature extraction and decomposition processing. A weight sharing strategy is adopted between the two branches to introduce prior knowledge to improve the reliability of the network model, pay attention to global information, and improve the unmixing accuracy with lower computational complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0073] Figure 1 This is a flow chart of a hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer provided by an embodiment of the present invention;
[0074] Figure 2 This is a schematic diagram of the structure of the hyperspectral image unmixing network model provided by the embodiment of the present invention. Figure 1 ;
[0075] Figure 3 This is a schematic diagram of the structure of the hyperspectral image unmixing network model provided by the embodiment of the present invention. Figure 2 ;
[0076] Figure 4 It is a schematic diagram of comparison between an end member spectral curve (Extracted curve) extracted from a Samson data set using the method of the present invention and a true end member spectral curve (GT curve) provided in an embodiment of the present invention;
[0077] Figure 5It is a schematic diagram of comparing an endmember spectral curve (Extracted curve) extracted on a Samson data set using an existing comparison method Deep Hyperspectral Unmixingusing Transformer Network provided by an embodiment of the present invention with a true endmember spectral curve (GT curve);
[0078] Figure 6 It is a schematic diagram of comparison between an abundance map extracted on a Samson data set using the method of the present invention and a true abundance map provided in an embodiment of the present invention;
[0079] Figure 7 It is a schematic diagram of comparing the abundance map extracted on the Samson dataset using the existing comparison method Deep Hyperspectral Unmixingusing Transformer Network provided by an embodiment of the present invention with the real abundance map;
[0080] Figure 8 It is a block diagram of a hyperspectral image unmixing device based on prior knowledge correction and Swin Transformer provided by an embodiment of the present invention;
[0081] Fig. 9 It is a structural schematic diagram of a hyperspectral image unmixing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0082] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0083] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0084] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0085] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.
[0086] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0087] The embodiment of the present invention provides a hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer, which can be implemented by a hyperspectral image unmixing device, which can be a terminal or a server. Figure 1 The flowchart of the hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer is shown. The processing flow of the method may include the following steps:
[0088] S1. Obtain a hyperspectral image to be unmixed.
[0089] In a feasible implementation, spectral decomposition is an important preprocessing method before spectral data analysis, and its purpose is to synchronously obtain the components (end members) in the spectrum and the proportion (abundance) of each component. The powerful nonlinear fitting ability of deep learning performs well in the field of spectral unmixing. However, due to the local spatial information used by traditional convolutional models, it is easy to lose some details during the reconstruction process, resulting in a certain error between the extracted end members and their abundances and the true values. Although the model based on the Transformer network takes into account global information, the computational complexity is high and is not conducive to the learning of multi-scale features. In addition, since most deep learning models are not guided by reliable prior knowledge, when the spectral pixels are highly mixed, it is easy to cause the network unmixing results to be unsatisfactory, and a good abundance map cannot be obtained.
[0090] To solve the above problems, the present invention designs a dual-branch network. The upper network obtains reliable network weights by learning pure pixel blocks, and corrects the unmixing results of the lower branch Swin Transformer network on the hyperspectral image through a shared weight strategy. The Swin Transformer module window multi-head self-attention and moving window multi-head self-attention are used to calculate the non-local spatial correlation between hyperspectral pixels to improve the estimated abundance quality and improve the unmixing performance.
[0091] S2. Input the hyperspectral image into the trained hyperspectral image unmixing network model.
[0092] like Figure 2 , Figure 3 As shown, the hyperspectral image unmixing network model includes a first hyperspectral image unmixing network model branch and a second hyperspectral image unmixing network model branch.
[0093] A weight sharing strategy is used between the first hyperspectral image unmixing network model branch and the second hyperspectral image unmixing network model branch.
[0094] In a feasible implementation, the upper branch (first branch) uses pre-extracted end members to provide pure pixel prior information and obtain reliable network weight parameters; the lower branch (second branch) uses the Swin Transformer structure to perform feature extraction and decomposition processing; a weight sharing strategy is adopted between the two branches to share the query parameters generated in the Swin Transformer encoder of the upper branch to the lower branch.
[0095] The first hyperspectral image unmixing network model branch includes a first branch encoder, a first branch SwinTransformer module and a first branch decoder.
[0096] Optionally, the first branch encoder is used to extract features from the input image to obtain a first branch encoder output.
[0097] The first branch Swin Transformer module is used to divide the first branch encoder output into non-overlapping tokens, obtain context global information, and obtain the first branch Swin Transformer module output.
[0098] The first branch decoder is used to reconstruct the hyperspectral image of the output of the first branch Swin Transformer module.
[0099] The second hyperspectral image unmixing network model branch includes a second branch encoder, a second branch SwinTransformer module and a second branch decoder.
[0100] In a feasible implementation, each branch includes an encoder, a Swin Transformer module, and a decoder; wherein the encoder is used to extract the main features of the input image and reduce the data dimension; the Swin Transformer module is used to divide the image after dimensionality reduction into non-overlapping tokens, extract information between different windows, and obtain contextual global information; the decoder is used to reconstruct the hyperspectral image based on the output of the Swin Transformer module.
[0101] Optionally, the first branch encoder includes a first convolutional layer, a second convolutional layer, and a third convolutional layer.
[0102] Among them, the first convolution layer includes the first convolution Conv 2D layer, the first batch normalization BN layer, the first Dropout layer and the Leaky ReLU function.
[0103] The second convolutional layer includes the second Conv 2D layer, the second BN layer, and the second Dropout layer.
[0104] The third convolutional layer includes the third Conv 2D layer and the third BN layer.
[0105] In a feasible implementation, the encoder includes three convolutional layers: the first convolutional layer is composed of a Conv2D layer, a BN (Batch Normalization) layer, a Dropout layer, and a Leaky ReLU function in sequence; the second convolutional layer is composed of a Conv 2D layer, a BN layer, and a Dropout layer in sequence; the third convolutional layer is composed of a Conv 2D layer and a BN layer in sequence. The specific parameters are shown in Table 1:
[0106] Table 1
[0107]
[0108] Optionally, the first branch Swin Transformer module includes one or more Swin Transformer encoders.
[0109] Each Swin Transformer encoder includes one or more moving window multi-head self-attention networks.
[0110] Optionally, the training process of the hyperspectral image unmixing network model in S2 includes:
[0111] S21, obtaining a hyperspectral data set, performing pure pixel point extraction on an original hyperspectral image in the hyperspectral data set, and obtaining an extracted image.
[0112] S22. Obtain a weight of a first branch according to the extracted image and the first hyperspectral image unmixing network model branch.
[0113] S23, obtaining a weighted second hyperspectral image unmixing network model branch according to the weight of the first branch and the second hyperspectral image unmixing network model branch.
[0114] S24, inputting the original hyperspectral image into the weighted second hyperspectral image unmixing network model branch to obtain a reconstructed hyperspectral image.
[0115] S25. Design a loss function, and train the hyperspectral image unmixing network model according to the loss function to obtain a trained hyperspectral image unmixing network model.
[0116] Optionally, the hyperspectral image unmixing network model in S2 is as shown in the following formula (1):
[0117] Y=EA+N,st0≤E≤1,A≥0 (1)
[0118] Where Y represents the observed original hyperspectral image, E represents the endmember matrix, which contains r endmembers; A represents the corresponding abundance matrix, in which the sum of the abundance of each endmember is 1, and N represents the noise matrix.
[0119] Optionally, the loss function in S25 is as shown in the following equations (2)-(4):
[0120] L=ηL downstreamRE +σL downstreamSAD (2)
[0121]
[0122]
[0123] In the formula, L represents the total loss function, η represents the regularization parameter weight, and L downstreamRE represents the downstream network reconstruction error loss, σ represents the regularization parameter weight, L downstreamSAD represents the spectral angular distance loss of the downstream network, e represents the real end member, represents the estimated endmember, H represents the height of the original image, and W represents the width of the original image. represents the jth band of the ith endmember estimated by the network, e ij represents the jth band of the i-th endmember of the image, M represents the number of endmembers of the original hyperspectral image, and e i represents the i-th end member of the image, represents the ith endmember of the network estimate.
[0124] Regarding the values of weights η and σ, the choice of parameter values can be determined by comparing the impact of different parameter values on the experimental results. Different parameter values are chosen for different data sets. Figure 4 It is a schematic diagram for comparing the endmember spectral curve (Extracted curve) extracted on the Samson data set using the method of the present invention and the true endmember spectral curve (GT curve); wherein the left, middle and right figures respectively represent the schematic diagrams for comparing the spectral curves of the three endmembers of soil, tree and water in the hyperspectral image.
[0125] S3. Obtain a hyperspectral image unmixing result according to the hyperspectral image and the hyperspectral image unmixing network model.
[0126] This embodiment takes the Samson dataset as an example to further illustrate the hyperspectral image unmixing method of the present invention.
[0127] The Samson dataset is used. This dataset is obtained by the Samson sensor and is one of the most widely used hyperspectral datasets. The original image contains 95×95 pixels, 156 bands, and covers the wavelength range of [401–889] nm. In this research scene, three end members are included: #1 soil, #2 tree, and #3 water.
[0128] According to the method of the present invention, pure endmembers are extracted by using an endmember extraction algorithm, and a matrix result obtained by copying and deforming the matrix is obtained by MATLAB to obtain a pure pixel block, which is used as the input of the upper branch of the network, and the lower branch network inputs the original image.
[0129] The upper and lower branches simultaneously input their own inputs into the encoder, which extracts a basic feature map of the input data. Specifically, the input hyperspectral image is represented by 24 channels through three convolutional layers in sequence, which greatly reduces the spectral bands of the hyperspectral image and extracts the high-level features required by the next Transformer module. At this time, the encoder outputs a discriminative feature map of 95×95×24.
[0130] Then enter the Swin Transformer module, which first normalizes the features with a normalization layer (LN), divides the hyperspectral image into non-overlapping local windows of size 5×5, and performs MSA (Multi-head Self-Attention) calculations in each window. In order to overcome the lack of information exchange between windows and thus limit the model's ability to capture long-range dependencies, the former window is offset by [M / 2, M / 2] pixels to achieve cross-window information interaction. Then another LN, MLP (Multilayer Perceptron) and residual operation are used to obtain the output of this layer.
[0131] The output of the Swin Transformer module is passed through a multi-layer perceptron to obtain a 3×95×95 output. In order to satisfy the constraints that the abundance and abundance of the abundance graph are non-negative, a layer of softmax function is introduced to obtain the final 3×95×95 abundance matrix.
[0132] Finally, in the decoder, the dimensionality of the abundance map is increased using a 1×1 convolution operation and a ReLU (Rectified Linear Unit) function, with the weights being the endmember matrix, resulting in a reconstructed 156×95×95 hyperspectral image. Quantitative results are provided by the RMSE (Root Mean Squared Error) between the estimated abundance fraction and the actual abundance fraction, and the SAD between the estimated endmember and the ground truth endmember. The lower the values of these indicators, the better the unmixing effect and the closer it is to the true value. Figure 5 (The left, middle and right pictures respectively show the comparison of the spectral curves of the three end members of soil, tree and water in the hyperspectral image). Figure 6 (The left, middle and right pictures on the upper side respectively represent the true abundance maps of the three end members of soil, tree and water in the hyperspectral image; the left, middle and right pictures on the lower side respectively represent the abundance maps of the three end members of soil, tree and water extracted by the method of the present invention). Figure 7 (The left, middle and right pictures on the upper side respectively represent the true abundance maps of the three end members of soil, tree and water in the hyperspectral image; the left, middle and right pictures on the lower side respectively represent the abundance maps of the three end members of soil, tree and water extracted by the comparison method DeepHyperspectral Unmixing using Transformer Network) and Table 2 (RMSE comparison on the Samson dataset), Table 3 (SAD comparison on the Samson dataset) respectively give the end member map, abundance map and corresponding quantitative results of the Samson dataset. The present invention is superior to other technologies in terms of general results, with an average root mean square error of 0.0686, which is the best performance among all methods; the average SAD value is 0:0596, which is second only to the method of AE combine Transformer model in the comparison method, but the results on soil and trees are the best.
[0133] Table 2
[0134]
[0135] Table 3
[0136]
[0137] In the embodiment of the present invention, a Swin Transformer dual-branch hyperspectral image unmixing network model with prior information correction is constructed, and the upper branch uses pre-extracted end members to provide pure pixel prior information. The lower branch uses the Swin Transformer structure to perform feature extraction and decomposition processing. A weight sharing strategy is adopted between the two branches to introduce prior knowledge to improve the reliability of the network model, pay attention to global information, and improve the unmixing accuracy with lower computational complexity.
[0138] Figure 8 The block diagram of a hyperspectral image unmixing device based on prior knowledge correction and Swin Transformer according to an exemplary embodiment is shown. The device is used for a hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer. Figure 8 The device includes an acquisition module 310, an input module 320 and an output module 330. Among them:
[0139] The acquisition module 310 is used to acquire the hyperspectral image to be unmixed.
[0140] An input module 320 is used to input the hyperspectral image into the trained hyperspectral image unmixing network model;
[0141] The hyperspectral image unmixing network model includes a first hyperspectral image unmixing network model branch and a second hyperspectral image unmixing network model branch.
[0142] The first hyperspectral image unmixing network model branch includes a first branch encoder, a first branch SwinTransformer module and a first branch decoder.
[0143] The second hyperspectral image unmixing network model branch includes a second branch encoder, a second branch SwinTransformer module and a second branch decoder.
[0144] A weight sharing strategy is used between the first hyperspectral image unmixing network model branch and the second hyperspectral image unmixing network model branch.
[0145] The output module 330 is used to obtain a hyperspectral image unmixing result according to the hyperspectral image and the hyperspectral image unmixing network model.
[0146] Optionally, the input module 320 is further configured to:
[0147] S21, obtaining a hyperspectral data set, performing pure pixel point extraction on an original hyperspectral image in the hyperspectral data set, and obtaining an extracted image.
[0148] S22. Obtain a weight of a first branch according to the extracted image and the first hyperspectral image unmixing network model branch.
[0149] S23, obtaining a weighted second hyperspectral image unmixing network model branch according to the weight of the first branch and the second hyperspectral image unmixing network model branch.
[0150] S24, inputting the original hyperspectral image into the weighted second hyperspectral image unmixing network model branch to obtain a reconstructed hyperspectral image.
[0151] S25. Design a loss function, and train the hyperspectral image unmixing network model according to the loss function to obtain a trained hyperspectral image unmixing network model.
[0152] Optionally, the hyperspectral image unmixing network model is as shown in the following formula (1):
[0153] Y=EA+N,st0≤E≤1,A≥0 (1)
[0154] Where Y represents the observed original hyperspectral image, E represents the endmember matrix, A represents the abundance matrix, and N represents the noise matrix.
[0155] Optionally, the loss function is as shown in the following equations (2)-(4):
[0156] L=ηL downstreamRE +σL downstreamSAD (2)
[0157]
[0158]
[0159] In the formula, L represents the total loss function, η represents the regularization parameter weight, and L downstreamRE represents the downstream network reconstruction error loss, σ represents the regularization parameter weight, L downstreamSAD represents the spectral angular distance loss of the downstream network, e represents the real end member, represents the estimated endmember, H represents the height of the original image, and W represents the width of the original image. represents the jth band of the ith endmember estimated by the network, e ij represents the jth band of the i-th endmember of the image, M represents the number of endmembers of the original hyperspectral image, and e i represents the i-th end member of the image, represents the ith endmember of the network estimate.
[0160] Optionally, the first branch encoder is used to extract features from the input image to obtain a first branch encoder output.
[0161] The first branch Swin Transformer module is used to divide the first branch encoder output into non-overlapping tokens, obtain context global information, and obtain the first branch Swin Transformer module output.
[0162] The first branch decoder is used to reconstruct the hyperspectral image of the output of the first branch Swin Transformer module.
[0163] Optionally, the first branch encoder includes a first convolutional layer, a second convolutional layer, and a third convolutional layer.
[0164] Among them, the first convolution layer includes the first convolution Conv 2D layer, the first batch normalization BN layer, the first Dropout layer and the Leaky ReLU function.
[0165] The second convolutional layer includes the second Conv 2D layer, the second BN layer, and the second Dropout layer.
[0166] The third convolutional layer includes the third Conv 2D layer and the third BN layer.
[0167] Optionally, the first branch Swin Transformer module includes one or more Swin Transformer encoders.
[0168] Each Swin Transformer encoder includes one or more moving window multi-head self-attention networks.
[0169] In the embodiment of the present invention, a Swin Transformer dual-branch hyperspectral image unmixing network model with prior information correction is constructed, and the upper branch uses pre-extracted end members to provide pure pixel prior information. The lower branch uses the Swin Transformer structure to perform feature extraction and decomposition processing. A weight sharing strategy is adopted between the two branches to introduce prior knowledge to improve the reliability of the network model, pay attention to global information, and improve the unmixing accuracy with lower computational complexity.
[0170] Fig. 9 is a schematic diagram of the structure of a hyperspectral image unmixing device provided by an embodiment of the present invention, such as Fig. 9 As shown, the hyperspectral image unmixing device may include the above Figure 8 The hyperspectral image unmixing device based on prior knowledge correction and Swin Transformer is shown. Optionally, the hyperspectral image unmixing device 410 may include a first processor 2001 .
[0171] Optionally, the hyperspectral image unmixing device 410 may further include a memory 2002 and a transceiver 2003 .
[0172] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.
[0173] Combine the following Fig. 9The components of the hyperspectral image unmixing device 410 are specifically introduced as follows:
[0174] The first processor 2001 is the control center of the hyperspectral image unmixing device 410, and may be a processor or a general term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or may be application specific integrated circuits (ASICs), or may be configured to implement one or more integrated circuits of the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).
[0175] Optionally, the first processor 2001 may perform various functions of the hyperspectral image unmixing device 410 by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002 .
[0176] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Fig. 9 CPU0 and CPU1 are shown in FIG.
[0177] In a specific implementation, as an embodiment, the hyperspectral image unmixing device 410 may also include multiple processors, such as Fig. 9 The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0178] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.
[0179] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001, or may exist independently, and may be accessed through the interface circuit ( Fig. 9 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0180] The transceiver 2003 is used to communicate with a network device or a terminal device.
[0181] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Fig. 9 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0182] Optionally, the transceiver 2003 may be integrated with the first processor 2001, or may exist independently and communicate with the first processor 2001 through the interface circuit ( Fig. 9 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0183] It should be noted that Fig. 9 The structure of the hyperspectral image unmixing device 410 shown in the figure does not constitute a limitation on the router, and the actual knowledge structure recognition device may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0184] In addition, the technical effects of the hyperspectral image unmixing device 410 can refer to the technical effects of the hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer described in the above method embodiment, which will not be repeated here.
[0185] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0186] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0187] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0188] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0189] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0190] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0191] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0192] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0193] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0194] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0195] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0196] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling 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 methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0197] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer, characterized in that: The method comprises: S1. Acquire the hyperspectral image to be unmixed; S2. Inputting the hyperspectral image into a trained hyperspectral image unmixing network model; The hyperspectral image unmixing network model includes a first hyperspectral image unmixing network model branch and a second hyperspectral image unmixing network model branch; The first hyperspectral image unmixing network model branch includes a first branch encoder, a first branch SwinTransformer module and a first branch decoder; The second hyperspectral image unmixing network model branch includes a second branch encoder, a second branch SwinTransformer module and a second branch decoder; A weight sharing strategy is used between the first hyperspectral image unmixing network model branch and the second hyperspectral image unmixing network model branch; S3. Obtain a hyperspectral image unmixing result according to the hyperspectral image and the hyperspectral image unmixing network model.
2. The hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer according to claim 1 is characterized in that: The training process of the hyperspectral image unmixing network model in S2 includes: S21, obtaining a hyperspectral dataset, and performing pure pixel extraction on an original hyperspectral image in the hyperspectral dataset to obtain an extracted image; S22, obtaining a weight of a first branch according to the extracted image and the first hyperspectral image unmixing network model branch; S23, obtaining a weighted second hyperspectral image unmixing network model branch according to the weight of the first branch and the second hyperspectral image unmixing network model branch; S24, inputting the original hyperspectral image into the weighted second hyperspectral image unmixing network model branch to obtain a reconstructed hyperspectral image; S25. Design a loss function, and train the hyperspectral image unmixing network model according to the loss function to obtain a trained hyperspectral image unmixing network model.
3. The hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer according to claim 2 is characterized in that: The hyperspectral image unmixing network model in S2 is shown in the following formula (1): Y=EA+E,st0≤E≤1,A≥0 (1) Where Y represents the observed original hyperspectral image, E represents the endmember matrix, A represents the abundance matrix, and N represents the noise matrix.
4. The hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer according to claim 2 is characterized in that: The loss function in S25 is shown in the following equations (2)-(4): L=ηL downstreamRE +σL downstreamSAD (2) In the formula, L represents the total loss function, η represents the regularization parameter weight, and L downstreamRE represents the downstream network reconstruction error loss, σ represents the regularization parameter weight, L downstreamSAD represents the spectral angular distance loss of the downstream network, e represents the real end member, Represents the estimated end member, H represents the height of the original image, W represents the width of the original image, represents the jth band of the ith endmember estimated by the network, e ij represents the jth band of the i-th endmember of the image, M represents the number of endmembers of the original hyperspectral image, e i represents the i-th end member of the image, represents the i-th endmember of the network estimate.
5. The hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer according to claim 1 is characterized in that: The first branch encoder is configured to extract features from an input image to obtain a first branch encoder output; The first-branch Swin Transformer module is used to divide the first-branch encoder output into non-overlapping tokens, obtain contextual global information, and obtain the first-branch Swin Transformer module output; The first branch decoder is used to reconstruct a hyperspectral image based on the output of the first branch Swin Transformer module.
6. The hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer according to claim 1 is characterized in that: The first branch encoder includes a first convolutional layer, a second convolutional layer, and a third convolutional layer; The first convolutional layer includes a first convolution Conv 2D layer, a first batch normalization BN layer, a first Dropout layer and a Leaky ReLU function; The second convolutional layer includes a second Conv 2D layer, a second BN layer and a second Dropout layer; The third convolutional layer includes a third Conv 2D layer and a third BN layer.
7. The hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer according to claim 1 is characterized in that: The first branch Swin Transformer module includes one or more Swin Transformer encoders; Among them, each Swin Transformer encoder includes one or more moving window multi-head self-attention networks.
8. A hyperspectral image unmixing device based on prior knowledge correction and Swin Transformer, wherein the hyperspectral image unmixing device based on prior knowledge correction and Swin Transformer is used to implement the hyperspectral image unmixing method based on prior knowledge correction and Swin Transformer according to any one of claims 1 to 7, characterized in that: The device comprises: An acquisition module, used for acquiring the hyperspectral image to be unmixed; An input module, configured to input the hyperspectral image into a trained hyperspectral image unmixing network model; The hyperspectral image unmixing network model includes a first hyperspectral image unmixing network model branch and a second hyperspectral image unmixing network model branch; The first hyperspectral image unmixing network model branch includes a first branch encoder, a first branch SwinTransformer module and a first branch decoder; The second hyperspectral image unmixing network model branch includes a second branch encoder, a second branch SwinTransformer module and a second branch decoder; A weight sharing strategy is used between the first hyperspectral image unmixing network model branch and the second hyperspectral image unmixing network model branch; The output module is used to obtain a hyperspectral image unmixing result according to the hyperspectral image and the hyperspectral image unmixing network model.
9. A hyperspectral image unmixing device, characterized in that: The hyperspectral image unmixing device includes: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Hyperspectral image super-resolution method based on spectral unmixing convolutional neural network
CN113744134A
Image registration method based on Swin Transform and CNN double-branch coupling
CN115082293A
Hyperspectral image unmixing method based on minimum simplex volume constraint and Transform structure
CN116012349A
Medical image segmentation method based on Swin Transform and CNN parallel network
CN117351030A
Multi-focus image end-to-end fusion system
CN117372832A
Cited By
Hyperspectral image unmixing method and system based on end member guided Transform and end member beam
CN119516376A
Hyperspectral blind unmixing method
CN119810660A
Method for accurately classifying hyperspectral images based on CNN (Convolutional Neural Network) and Dual-Swin-Transformer fusion network
CN119888329A
Hyperspectral image accurate classification method based on CNN and dual-swin-transformer fusion network
CN119888329B
Hyperspectral image demixing method and device, electronic equipment and computer program product
CN121010897A
