Hyperspectral and LiDAR combined classification method of wavelet feature guided head selection Transform network
Through the wavelet feature guidance head selection Transformer network, combined with CNN and Transformer, it solves the problem of feature information loss and redundant processing of convolutional neural network in hyperspectral image and LiDAR data processing, and achieves efficient multi-modal feature extraction and decision-making. The network improves the accuracy and efficiency of feature classification.
Patent Information
- Application Number
- CN202410371409.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2024-09-03
AI Technical Summary
Existing convolutional neural networks are susceptible to noise interference when processing hyperspectral images and LiDAR data, and are difficult to learn robust high-level features, resulting in the loss of key feature information, and the model structure has problems with redundant information processing and high computing costs. .
A wavelet feature guidance head selection Transformer network is designed. Through the spectral-spatial frequency domain feature extraction module and the adaptive global feature extraction module, combined with CNN and Transformer, multi-modal feature fusion and decision-making network are used to reduce the number of model parameters. and computational costs, reducing redundant information processing.
Effectively extract the spatial and spectral features of HSI and LiDAR data, improve the accuracy and efficiency of ground object classification, shorten the training and inference time of the model, and improve the model performance.
Smart Images

Figure CN118587467A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical fields of computer vision, deep learning, remote sensing image processing, etc., and specifically relates to a hyperspectral and LiDAR joint classification method of a wavelet feature guided head selection Transformer network. Background Art
[0002] With the diversification of land cover types, the application of remote sensing technology in land feature classification tasks faces many challenges. Integrating remote sensing data obtained by different sensors, such as hyperspectral images and LiDAR data, helps to achieve information sharing and data advantages complementarity, thereby improving classification accuracy.
[0003] The rise of deep learning has brought new prospects for remote sensing image processing. Convolutional neural networks can extract local features while maintaining the continuity of images, so they are widely used in land object classification tasks when processing complex hyperspectral images and LiDAR data. Although convolutional neural networks have shown excellent capabilities in this field, their model structure has some defects that may lead to the loss of key feature information. For example, convolutional layers are often susceptible to noise interference, and high-frequency noise makes it difficult for convolutional neural networks to learn robust high-level features.
[0004] In recent years, due to the powerful global context modeling capabilities of the Transformer network, it has been applied to image classification tasks. In the field of remote sensing image processing, the combined use of convolutional neural networks and Transformer structures has provided a new development direction for object classification tasks. By combining CNN and Transformer, it helps to solve the heterogeneity of hyperspectral images and LiDAR data, enabling the model to better handle the characteristics and resolution differences of different data sources, thereby better capturing the spatial relationship between objects and improving classification accuracy, which is of great significance for applications such as urban planning, land use monitoring, and environmental management. Summary of the invention
[0005] To solve the above problems, the present invention discloses a hyperspectral and LiDAR joint classification method based on a wavelet feature guided head selection Transformer network, which effectively reduces the number of model parameters and the processing of redundant information while considering the network performance, shortens the training and reasoning time of the model, and greatly improves the model performance.
[0006] To achieve the above object, the technical solution of the present invention is as follows:
[0007] A hyperspectral and LiDAR joint classification method based on wavelet feature guided head selection Transformer network includes the following steps:
[0008] Step 1) Input the original HSI image, perform data filling operation around edge pixels, and then perform patch extraction operation to obtain an HSI image patch dataset;
[0009] Step 2) input the original LiDAR data, perform data filling operation around edge pixels, and then perform patch extraction operation to obtain a LiDAR image patch dataset;
[0010] Step 3) After obtaining the data sets of step 1) and step 2), randomly select 20 samples from each category in both data sets as training sets, and the remaining samples as test sets;
[0011] Step 4) taking the HSI image block training set obtained in step 3) as input, and sequentially passing through a spectral-spatial feature encoder and a spatial feature encoder to obtain the spectral-spatial features of the HSI data;
[0012] Step 5) using the LiDAR cube training set obtained in step 3) as input, and obtaining the elevation-spatial features of the LiDAR data through two spatial feature encoders;
[0013] Step 6) performing linear weighted feature fusion on the spectral-spatial features of the HSI data obtained in step 4) and the elevation-spatial features of the LiDAR data obtained in step 5) to obtain multimodal local spectral-spatial features;
[0014] Step 7) Tokenization strategy is performed on the multimodal local spectral-spatial features obtained in step 6), and the obtained feature sequence is used as input, and sequentially passes through the traditional Transformer encoder and the adaptive global feature extraction module based on the head selection pooling Transformer to obtain the global-local spectral sequence features;
[0015] Step 8) classifying the multimodal local spectral-spatial features obtained in step 6) through a CNNs-based network to obtain a convolution-based classification probability vector;
[0016] Step 9) inputting the global-local spectral sequence features obtained in step 7) into the multi-layer perceptron and soft-max layer for classification to obtain a classification probability vector based on Transformer;
[0017] Step 10) performing feature fusion decision classification on the convolution-based classification probability vector obtained in step 8) and the convolution-based classification probability vector obtained in step 9) to obtain a pixel-level classification result;
[0018] Step 11) The input HSI image and LiDAR data are processed through the above steps to obtain the trained model and inference result graph, thereby realizing the joint classification of the HSI image and LiDAR data.
[0019] The beneficial effects of the present invention are:
[0020] The present invention uses HSI images and LiDAR data as network inputs, effectively utilizes 3D and 2D convolutions and downsampling layers based on discrete wavelet transform and pooling, and the designed spectral-spatial frequency domain feature extraction module can simultaneously extract the spectral-spatial features of HSI and the elevation-spatial features of LiDAR data in the frequency domain and spatial domain, and introduces grouped convolution to reduce the number of model parameters. The fusion features of HSI and LiDAR are integrated with multimodal features and further extracted from global-local spectral features using an adaptive global feature extraction module based on a Transformer network. At the same time, a decision network is proposed to determine whether to retain or discard the head of the self-attention mechanism in the Transformer to reduce the computational cost of the model and minimize the processing of redundant information. Finally, a multimodal feature fusion classification module with local features and global category labels is embedded to utilize powerful global-local fusion features. Compared with other related algorithms, the present invention effectively reduces the number of model parameters and the processing of redundant information while considering network performance, shortens the training and reasoning time of the model, and greatly improves the model performance. Therefore, the algorithm proposed in this invention has made outstanding contributions to improving the accuracy and efficiency of ground object classification in remote sensing image processing. Specifically:
[0021] (1) The spectral-spatial frequency domain feature extraction module embedded in the present invention can capture the spatial and spectral features of HSI and LiDAR data in both the frequency domain and the spatial domain, effectively considering the global structure and local detail features of the objects in different dimensions.
[0022] (2) The present invention proposes a head-selective pooling Transformer based on a decision network to learn global and non-redundant spectral features, which reduces the computational cost of the model and minimizes the processing of redundant information. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is the overall flow chart of the present invention.
[0024] Figure 2 Schematic diagram of discrete wavelet transform in the spectral-spatial frequency domain feature extraction module.
[0025] Figure 3 Diagram of selecting the pooling Transformer for the head. DETAILED DESCRIPTION
[0026] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0027] As shown in the figure, the hyperspectral and LiDAR joint classification method of the wavelet feature guided head selection Transformer network described in the present invention includes the following steps:
[0028] Step 1) Input the original HSI image, perform data filling operation around edge pixels, and then perform patch extraction operation to obtain an HSI image patch dataset;
[0029] Step 2) input the original LiDAR data, perform data filling operation around edge pixels, and then perform patch extraction operation to obtain a LiDAR image patch dataset;
[0030] Step 3) After obtaining the data sets of step 1) and step 2), randomly select 20 samples from each category in both data sets as training sets, and the remaining samples as test sets;
[0031] Step 4) taking the HSI image block training set obtained in step 3) as input, and sequentially passing through a spectral-spatial feature encoder and a spatial feature encoder to obtain the spectral-spatial features of the HSI data;
[0032] Step 5) using the LiDAR cube training set obtained in step 3) as input, and obtaining the elevation-spatial features of the LiDAR data through two spatial feature encoders;
[0033] Step 6) performing linear weighted feature fusion on the spectral-spatial features of the HSI data obtained in step 4) and the elevation-spatial features of the LiDAR data obtained in step 5) to obtain multimodal local spectral-spatial features;
[0034] Step 7) Tokenization strategy is performed on the multimodal local spectral-spatial features obtained in step 6), and the obtained feature sequence is used as input, and sequentially passes through the traditional Transformer encoder and the adaptive global feature extraction module based on the head selection pooling Transformer to obtain the global-local spectral sequence features;
[0035] Step 8) classifying the multimodal local spectral-spatial features obtained in step 6) through a CNNs-based network to obtain a convolution-based classification probability vector;
[0036] Step 9) inputting the global-local spectral sequence features obtained in step 7) into the multi-layer perceptron and soft-max layer for classification to obtain a classification probability vector based on Transformer;
[0037] Step 10) performing feature fusion decision classification on the convolution-based classification probability vector obtained in step 8) and the convolution-based classification probability vector obtained in step 9) to obtain a pixel-level classification result;
[0038] Step 11) The input HSI image and LiDAR data are processed through the above steps to obtain the trained model and inference result graph, thereby realizing the joint classification of the HSI image and LiDAR data.
[0039] The steps 4), 5) and 6) include the following steps:
[0040] 2D CNN is used to extract the local spatial features of each pixel, and 3DCNN is further developed to jointly extract spatial and spectral features from HSI data. The calculation formulas of 2DCNN and 3DCNN are as follows:
[0041]
[0042]
[0043] Where f represents the output variable in the feature map; M(i) represents the number of feature maps in the i-th layer, H(i) and W(i) represent the height and width of the convolution kernel in space, respectively, and D(i) represents the size of the convolution kernel in the spectral dimension; k represents the parameter in the convolution kernel, and b ij Represents the bias of the jth feature map of the i-th layer;
[0044] The spectral-spatial frequency domain feature extraction module is composed of a spectral-spatial feature encoder and a spatial feature encoder to capture features from HSI and LiDAR image patches. The spectral-spatial feature encoder is a sequence of 3D CNN and downsampling layers based on 3D discrete wavelet transform and 3D maximum pooling, represented as the sequence operator E ssf The 2D convolutional sequence spatial feature encoder combines 2DCNN with a downsampling layer based on 2D discrete wavelet transform and 2D maximum pooling, denoted as sequence operator E. sf This module comprehensively considers the particularities of HSI and LiDAR image slices in both the frequency domain and the spatial domain, selects appropriate wavelet transform basis functions and reasonably designs the corresponding convolution kernel parameters, effectively reducing the interference of high-frequency noise on the feature description of HSI and LiDAR image blocks while increasing the richness of feature semantic information.
[0045] In the process of downsampling feature maps using maximum pooling or average pooling in the spatial domain, the noise of high-frequency components may be downsampled into the output features, thus affecting the classification accuracy of the model. To solve this problem, a discrete wavelet transform layer suitable for various wavelets is designed. Combined with the traditional maximum pooling, the dual-branch downsampling layer is inserted into the spectral-spatial frequency domain feature extraction module, aiming to consider the characteristics of the input features in both the frequency domain and the spatial domain. The designed discrete wavelet transform layer divides the input features into low-frequency components containing overall structural information and high-frequency components with detailed features and noise.
[0046] The schematic diagram of discrete wavelet transform in the spectral-spatial frequency domain feature extraction module is as follows Figure 2 As shown in the figure, the 2D discrete wavelet transform produces a low-frequency component containing the main structural information and three high-frequency components containing noise and image details; the 3D discrete wavelet transform produces a low-frequency component and seven corresponding high-frequency components. With a slight modification based on the 2D discrete wavelet transform, it can be extended to the 3D discrete wavelet transform. The feature map output by the 2D CNN is recorded as Then the components after 2D discrete wavelet transform can be calculated by the following formula:
[0047]
[0048]
[0049] in Represent low-pass filter and high-pass filter respectively.
[0050] Will The feature representation obtained by downsampling the maximum pooling operation in the spatial domain is: For the output of discrete wavelet transform, only the low-frequency component is used for further feature extraction, then the fusion feature f based on frequency domain and spatial domain 2d It can be obtained by the following formula:
[0051]
[0052] In addition, in order to reduce the number of parameters and the amount of calculation of the convolution network, the present invention considers it from another aspect. In the classical convolution operation, the convolution operation performs feature map convolution similar to the fully connected calculation method for the feature map of each channel. This calculation method directly affects the number of parameters and the amount of calculation of the convolution kernel. The designed 2D and 3D convolution networks are grouped according to the number of channels, and then the convolution operation is performed, so that the feature maps in each group are subjected to independent convolution operations. The number of parameters and the amount of calculation of the spectral-spatial frequency domain feature extraction module will be significantly reduced as the number of input feature map channels and the number of output feature map channels decrease. If the number of groups is set to 1, it evolves into a classical convolution operation, but too many groups will also affect the effect of feature extraction. For the grouping parameters of the convolution in the spectral-spatial feature encoder and the spatial feature encoder, it is set to an exponential power of 2 according to the setting of the number of CNN channels. In addition, in order to improve training efficiency and alleviate potential overfitting problems, we introduced continuous batch normalization layers and ReLU activation functions after each convolution layer. The details of the ReLU activation function are as follows:
[0053] f(x)=max(0,x) (6)
[0054] HSI data LiDAR Data Where H×W represents the original size of the HSI and LiDAR data spatial dimensions, d h is the original size of the spectral dimension of the HSI data. After filling around the edge pixels, patch extraction operations are performed on each pixel of the HSI and LiDAR data to obtain the HSI image block. and LiDAR image patches Where γ×γ represents the size of the space.
[0055] Use HSI image patches from the training set As the input sample for training. Initially, The spectral-spatial feature image block is generated by the spectral-spatial feature encoder. After flattening along the depth dimension, the feature map is input into the spatial feature encoder to further extract spatial features from the spectral-spatial feature image block, thereby obtaining the spectral-spatial features of the HSI data. Similarly, for the LiDAR image patches used for training Through two layers of the same spatial feature encoder, the elevation-spatial features of LiDAR data are generated feature and It can be obtained by the following formula:
[0056]
[0057]
[0058] Multimodal local spectral-spatial features extracted based on CNNs cnn It can be calculated using the following formula, where ω is the weight coefficient, which can be adjusted manually:
[0059]
[0060] The step 7) comprises the following steps:
[0061] The Transformer based on the Multi-Head Self-Attention (MHSA) mechanism can capture the correlation between different bands in a global scope and effectively process multimodal data and integrate them into a unified feature representation. Therefore, the present invention first uses a multi-layer traditional Transformer to integrate the local spectral-spatial f cnn The multimodal features of the proposed method are obtained and the initial feature extraction of the global spectrum by the adaptive global-local feature extraction module is performed. represents f cnn After the features obtained by the tokenization strategy, the process of z0 through traditional Transfor-mer is as follows:
[0062] z′ l =HMSA(LN(z l-1 ))+z l-1 , l = 1, 2, ..., L1 (10)
[0063] z l =FFN(LN(z′ l ))+z′ l , l = 1, 2, ..., L1 (11)
[0064] Where L1 represents the depth of the traditional Transformer. Let f′ vit is the spectral sequence attribute feature obtained after the L1 layer traditional Transformer block. FFN, LN and MHSA represent feedforward network, layer normalization and multi-head self-attention respectively. The attention of each head is calculated as:
[0065]
[0066] where Q, K and V are query, key and value matrices, d k Denotes the scaling factor. MHSA adopts the same calculation process to obtain the attention scores of each head, concatenates the attention scores of multiple heads, and then projects them to:
[0067] MHSA(Q,K,V)=Concat(Attn1,...,Attnh )W O (13)
[0068] Where h represents the number of attention heads, W O represents the parameter matrix. N is the number of markers.
[0069] The MHSA mechanism in the traditional Transformer can map features into different subspaces to extract global spectral sequence features, but as the number of layers in the traditional Transformer block increases, the possibility of overlapping attention between self-attention heads will gradually increase, which will lead to unnecessary information redundancy. In addition, due to the significant differences between the feature maps of different channels, their processing of long-range dependencies is also different. Therefore, the present invention designs an adaptive head selection decision network to learn the usage strategy of self-attention heads. The network selectively deactivates certain self-attention heads, reduces the computational cost of the model, and minimizes the processing of redundant information.
[0070] The decision network consists of a linear layer, a sampling process, and a threshold selection layer (Θ(·)). The linear layer and the sampling process are used to generate the policy probability matrix, and the threshold selection layer sets the probability threshold (0.5) to decide whether to keep or discard the self-attention head. For the input z of the lth block l , the header selection is:
[0071]
[0072] Where H = 16 is the number of self-attention heads. l∈[L1+1,L1+L2], L2 represents the depth of the head selection pooling Transformer. G l =-log(Exp l ), where Exp l is sampled from an exponential distribution, and τ is used to control the distribution of the output probability. l is the head selection strategy matrix in the lth Transformer block. l,i =1, the i-th header of the l-th block is retained.
[0073] A pooling operation is introduced to capture the spatial relationship between patches in MHSA to consider both global spectral information and local spatial information:
[0074]
[0075] like Figure 3 As shown in Figure 1, the head selection decision network and pooling operation are inserted into the head selection pooling Transformer block. Then the attention of the i-th head of the l-th block is calculated as follows:
[0076]
[0077] Spectral sequence features f′ obtained from the traditional global Transformer vit As input, the global-local spectral sequence feature f is obtained after the L2 layer head selects the pooling Transformer block vit From f vit Category Mark Used for the classification task in step 9).
[0078]
[0079] The steps 8), 9) and 10) include the following steps:
[0080] In multimodal feature fusion classification, feature fusion decision classification is adopted to fully capture local spectral-spatial features and global-local spectral features. Local spectral-spatial features f cnn Classification is performed by a CNN-based network. The network consists of two modules. The first module includes 2D CNN, batch normalization, and ReLU activation layers. The second module consists of adaptive global average pooling, fully connected layers, and softmax layers to output classification probabilities. For the global-local spectral sequence feature f vit The category tags extracted from It is input into the multilayer perceptron (MLP) and softmax layer for classification. Then, according to the classification probability vector P corresponding to CNN and Transformer cnn and P vit Perform decision classification and obtain the final probability vector P f It can be calculated by the following formula, where λ is the weight coefficient of feature fusion decision, which can be set manually:
[0081] P f =λ·P vit +(1-λ)·P cnn (18)
[0082] Assume that the fusion classification probability obtained by the mth target pixel sample in batch M is Then on a data set with C classes, the final classification result can be expressed as:
[0083]
[0084] It should be noted that the above content only illustrates the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. 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 all fall within the protection scope of the claims of the present invention.
Claims
1. A hyperspectral and LiDAR joint classification method based on wavelet feature guided head selection Transformer network, characterized by: The following steps are involved: Step 1) Input the original HSI image, perform data filling operation around edge pixels, and then perform patch extraction operation to obtain an HSI image patch dataset; Step 2) input the original LiDAR data, perform data filling operation around edge pixels, and then perform patch extraction operation to obtain a LiDAR image patch dataset; Step 3) After obtaining the data sets of step 1) and step 2), randomly select 20 samples from each category in both data sets as training sets, and the remaining samples as test sets; Step 4) taking the HSI image block training set obtained in step 3) as input, and sequentially passing through a spectral-spatial feature encoder and a spatial feature encoder to obtain the spectral-spatial features of the HSI data; Step 5) using the LiDAR cube training set obtained in step 3) as input, and obtaining the elevation-spatial features of the LiDAR data through two spatial feature encoders; Step 6) performing linear weighted feature fusion on the spectral-spatial features of the HSI data obtained in step 4) and the elevation-spatial features of the LiDAR data obtained in step 5) to obtain multimodal local spectral-spatial features; Step 7) performing a tokenization strategy on the multimodal local spectral-spatial features obtained in step 6), taking the obtained feature sequence as input, and sequentially passing through a traditional Transformer encoder and an adaptive global feature extraction module based on head selection pooling Transformer to obtain a global-local spectral sequence feature; Step 8) classifying the multimodal local spectral-spatial features obtained in step 6) through a CNNs-based network to obtain a convolution-based classification probability vector; Step 9) inputting the global-local spectral sequence features obtained in step 7) into the multi-layer perceptron and soft-max layer for classification to obtain a classification probability vector based on Transformer; Step 10) performing feature fusion decision classification on the convolution-based classification probability vector obtained in step 8) and the convolution-based classification probability vector obtained in step 9) to obtain a pixel-level classification result; Step 11) The input HSI image and LiDAR data are processed through the above steps to obtain the trained model and inference result graph, thereby realizing the joint classification of the HSI image and LiDAR data.
2. The hyperspectral and LiDAR joint classification method of the wavelet feature guided head selection Transformer network according to claim 1 is characterized by: The steps 4), 5) and 6) include the following steps: The 2D CNN is used to extract the local spatial features of each pixel, and the 3D CNN is further developed to jointly extract spatial and spectral features from HSI data; the calculation formulas of 2D CNN and 3D CNN are as follows: Where f represents the output variable in the feature map; M(i) represents the number of feature maps in the i-th layer, H(i) and W(i) represent the height and width of the convolution kernel in space, respectively, and D(i) represents the size of the convolution kernel in the spectral dimension; k represents the parameter in the convolution kernel, and b ij Represents the bias of the jth feature map of the i-th layer; The spectral-spatial frequency domain feature extraction module is composed of a spectral-spatial feature encoder and a spatial feature encoder to capture features from HSI and LiDAR image patches; the spectral-spatial feature encoder is a sequence of 3D CNN and downsampling layers based on 3D discrete wavelet transform and 3D maximum pooling, represented as the sequence operator E. ssf ; The 2D convolutional sequence spatial feature encoder combines a 2D CNN with a downsampling layer based on 2D discrete wavelet transform and 2D maximum pooling, denoted as the sequence operator E sf ; A discrete wavelet transform layer suitable for various wavelets is designed. It is combined with the traditional maximum pooling, and the dual-branch downsampling layer is inserted into the spectral-spatial frequency domain feature extraction module, aiming to simultaneously consider the characteristics of the input features in the frequency domain and the spatial domain; the designed discrete wavelet transform layer divides the input features into low-frequency components containing overall structural information and high-frequency components with detailed features and noise; The 2D discrete wavelet transform produces a low-frequency component containing the main structural information and three high-frequency components containing noise and image details; the 3D discrete wavelet transform produces a low-frequency component and seven corresponding high-frequency components; the 2D discrete wavelet transform is modified and extended to the 3D discrete wavelet transform; the feature map output by the 2D CNN is recorded as Then the components after 2D discrete wavelet transform are calculated by the following formula: Where L = {l k } k∈z , H = {h k } k∈z Represent low-pass filter and high-pass filter respectively; Will The feature representation obtained by downsampling the maximum pooling operation in the spatial domain is: For the output of discrete wavelet transform, only the low-frequency component is used for further feature extraction, then the fusion feature f based on frequency domain and spatial domain 2d It is obtained from the following formula: In addition, in order to reduce the number of parameters and computations of the convolutional network, the grouping parameters of the convolution in the spectral-spatial feature encoder and the spatial feature encoder are set to an exponential power of 2 according to the number of CNN channels. In addition, in order to improve training efficiency and alleviate potential overfitting problems, continuous batch normalization layers and ReLU activation functions are introduced after each convolutional layer. The details of the ReLU activation function are as follows: f(x)=max(0,x) (6) HSI data LiDAR Data Where H×W represents the original size of the HSI and LiDAR data spatial dimensions, d h is the original size of the spectral dimension of the HSI data. After filling around the edge pixels, patch extraction operations are performed on each pixel of the HSI and LiDAR data to obtain the HSI image block and LiDAR image patches Where γ×γ represents the size of the space, Use HSI image patches from the training set As the input sample for training, initially, The spectral-spatial feature image block is generated by the spectral-spatial feature encoder; after flattening along the depth dimension, the feature map is input into the spatial feature encoder to further extract spatial features from the spectral-spatial feature image block, thereby obtaining the spectral-spatial features of the HSI data. Similarly, for the LiDAR image patches used for training Through two layers of the same spatial feature encoder, the elevation-spatial features of LiDAR data are generated feature and It is obtained by the following formula: Multimodal local spectral-spatial features extracted based on CNNs cnn Use the following formula to calculate, where ω is the weight coefficient, which is adjusted manually:
3. The hyperspectral and LiDAR joint classification method of the wavelet feature guided head selection Transformer network according to claim 1 is characterized in that: The step 7) comprises the following steps: The Transformer based on the multi-head self-attention mechanism can capture the correlation between different bands in a global scope and effectively process multimodal data and integrate them into a unified feature representation. Therefore, we first use a multi-layer traditional Transformer to integrate the local spectral-spatial f cnn The multimodal features of the , and perform initial feature extraction of the global spectrum of the adaptive global-local feature extraction module, represents f cnn After the features obtained by the tokenization strategy, the process of z0 through traditional Transfor-mer is as follows: z′ l =MHSA(LN(z l-1 ))+z l-1 ,l=1,2,...,L1 (10) from' l =FFN(LN(z′ l ))+z′ l ,l=1,2,...,L1 (11) Where L1 represents the depth of the traditional Transformer; f′ vit is the spectral sequence attribute feature obtained after the traditional Transformer block of the L1 layer. FFN, LN and MHSA represent feedforward network, layer normalization and multi-head self-attention respectively. The attention of each head is calculated as: where Q, K and V are query, key and value matrices, d k Denotes the scaling factor, MHSA adopts the same calculation process to obtain the attention score of each head, concatenates the attention scores of multiple heads, and then projects them to: MHSA(Q,K,V)=Concat(Attn1,...,Attn h )W o (13) Where h represents the number of attention heads, W o represents the parameter matrix; N is the number of markers, Design an adaptive head selection decision network to learn the usage strategy of self-attention heads. The network selectively deactivates certain self-attention heads, reducing the computational cost of the model and minimizing the processing of redundant information. The decision network consists of a linear layer, a sampling process, and a threshold selection layer (Θ(·)). The linear layer and the sampling process are used to generate the policy probability matrix. The threshold selection layer sets the probability threshold (0.5) to decide whether to keep or discard the self-attention head. For the input z of the lth block l , the header selection is: where H = 16 is the number of self-attention heads, l∈[L1+1,L1+L2], L2 represents the depth of the head selection pooling Transformer, G l =-log(Exp l ), where Exp l is sampled from an exponential distribution, τ is used to control the distribution of the output probability, P l is the head selection strategy matrix in the lth Transformer block, when P l,i = 1, the i-th header of the l-th block is retained. A pooling operation is introduced to capture the spatial relationship between patches in MHSA to consider both global spectral information and local spatial information: The head selection decision network and pooling operation are inserted into the head selection pooling Transformer block, then the attention of the i-th head of the l-th block is calculated as follows: Spectral sequence features f′ obtained from the traditional global Transformer vit As input, the global-local spectral sequence feature f is obtained after the L2 layer head selects the pooling Transformer block vit , from f vit Category Mark Used for the classification task in step 9); 。 4. The hyperspectral and LiDAR joint classification method of the wavelet feature guided head selection Transformer network according to claim 1 is characterized by: The steps 8), 9) and 10) include the following steps: In multimodal feature fusion classification, feature fusion decision classification is adopted to fully capture local spectral-spatial features and global-local spectral features. The local spectral-spatial features f cnn The classification is performed by a CNN-based network, which consists of two modules. The first module includes 2D CNN, batch normalization and ReLU activation layers, and the second module consists of adaptive global average pooling, fully connected layers and softmax layers to output classification probabilities for the global-local spectral sequence features f vit The category tags extracted from It is input into the multi-layer perceptron and softmax layer for classification, and then the classification probability vector P corresponding to CNN and Transformer is obtained. cnn and P vit Perform decision classification and obtain the final probability vector P f It is calculated by the following formula, where λ is the weight coefficient of feature fusion decision, which is set manually: P f =λ·P vit +(1-λ)·P cnn (18) Assume that the fusion classification probability obtained by the mth target pixel sample in batch M is Then on a data set with C classes, the final classification result is expressed as: 。
Citation Information
Cited By
Hyperspectral image classification method and system
CN119418114A
A hyperspectral image classification method and system
CN119418114B
Multi-source remote sensing image classification method based on spectrum adaptive feature fusion
CN119723216A
Multi-source Remote Sensing Image Classification Method Based on Spectrum Adaptive Feature Fusion
CN119723216B
Land utilization classification method based on high-frequency feature guidance
CN119992321A
