Hyperspectral image classification method and system based on center-domain interactive learning
By adopting the center-domain interactive learning method of Transformer structure in hyperspectral image classification, the features of the central and neighboring regions are extracted and fused, and the problem of difficulty in utilizing inter-image interactions in the prior art is solved, and higher classification performance is achieved.
Patent Information
- Application Number
- CN202210540901.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-17
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-05-17
AI Technical Summary
The existing hyperspectral image classification methods are difficult to effectively utilize the interaction between the central observation pixel and the neighborhood auxiliary pixel in the image, resulting in difficulty in improving the classification performance.
The center-domain interactive learning method based on the Transformer structure is adopted, and the characteristics of the central area and neighboring area are extracted respectively through the central Transformer branch and the neighboring Transformer branch, and the characteristics of the central area and the neighboring area are fused for classification.
Interactive feature extraction between the central observation pixel and the neighborhood assisted pixel is realized, which enhances the classification performance of hyperspectral images and can better preserve the global context and local detail features of the image.
Smart Images

Figure CN114821186B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and relates to an image classification method and system, and in particular to a hyperspectral image classification method and system based on center-domain interactive learning. Background Art
[0002] Hyperspectral images have the characteristics of unified image and spectrum, multiple bands, and high spectral resolution. They contain rich spectral features and spatial information, and provide an effective solution for the fine classification of objects. With the vigorous development of deep learning technology, convolutional neural networks, fully convolutional neural networks, and recurrent neural networks have achieved good performance in hyperspectral image classification tasks. Specifically, convolutional neural networks have the properties of local connection and weight sharing, and can automatically extract deep robust features without too many parameters. However, most of the hyperspectral image classification methods based on convolutional neural networks currently select fixed-size image blocks around each pixel as input data, focusing too much on the local central features of the image, and the classification performance is difficult to improve. In order to consider the global neighborhood information of hyperspectral images, fully convolutional neural networks are introduced into the field of hyperspectral image classification. Fully convolutional neural networks transform the fully connected layers in traditional convolutional neural networks into convolutional layers, and recover the category of each pixel from the abstract high-level features, completing the transformation from image-level classification to pixel-level classification. However, fully convolutional neural networks calculate all pixels contained in the image with a fixed-size convolution kernel, making it difficult to distinguish objects of different positions, shapes, and scales in the field. In recent years, since each pixel of a hyperspectral image has a continuous spectral curve, some studies have attempted to treat hyperspectral images as sequence data. Therefore, methods based on recurrent neural networks have emerged one after another. Through the cyclic calculation of the three gating mechanisms of the input gate, forget gate, and output gate of the recurrent neural network, the contextual features of the hyperspectral image have been fully mined. However, this feature extraction method is static and greatly ignores the interaction between the central observation pixel and the neighborhood auxiliary pixels in the image, which brings new challenges to the fine classification of hyperspectral images.
[0003] Recently, the Transformer structure has attracted more and more attention for its excellent feature extraction capabilities. By introducing non-local correlation calculations between different query, key and value operators, the Transformer structure can discriminately characterize the features of the central observation pixel and the neighborhood auxiliary pixel, realize interactive learning between pixels at different levels, and expand ideas for alleviating the above problems. Therefore, starting from the data characteristics of hyperspectral images, it is very important to use the Transformer structure to design a method that can take into account the central observation pixel and the neighborhood auxiliary pixel and realize interactive feature extraction between them to enhance the classification performance of hyperspectral images. Summary of the invention
[0004] In order to solve the above technical problems, the present invention provides a hyperspectral image classification method and system based on center-domain interactive learning.
[0005] The technical solution adopted by the method of the present invention is: a hyperspectral image classification method based on center-domain interactive learning, comprising the following steps:
[0006] Step 1: Input the original hyperspectral image and the ground object real distribution label map, determine the number of principal components p to be retained and the size w of the extracted image block;
[0007] Step 2: Perform dimensionality reduction processing on the original hyperspectral image to obtain a low-dimensional expression;
[0008] Step 3: For the hyperspectral image after dimensionality reduction, select an image block of size (1 / 3)w×(1 / 3)w×p around each pixel as the central area, input it into the central Transformer branch, and obtain the output features of the central Transformer branch;
[0009] Step 4: Focusing on the central area, we select image blocks of w×w×p and 5w×5w×p from near to far as the neighboring area and surrounding area, respectively, and build a surrounding area grid in the surrounding area. Then, we combine the neighboring area with the surrounding area and input them into the neighborhood Transformer branch to obtain the output features of the neighborhood Transformer branch.
[0010] Step 5: Fuse the output features of step 3 and step 4 to obtain the joint features after center-neighborhood interactive learning, and send the joint features to the multi-layer perceptron for classification;
[0011] Step 6: Repeat steps 3-5 for each pixel in the hyperspectral image to complete the classification of the entire image.
[0012] The technical solution adopted by the system of the present invention is: a hyperspectral image classification system based on center-domain interactive learning, including the following modules:
[0013] Module 1 is used to input the original hyperspectral image and the real distribution label map of the ground objects, determine the number of principal components p to be retained and the size w of the extracted image block;
[0014] Module 2 is used to perform dimensionality reduction processing on the original hyperspectral image to obtain a low-dimensional expression;
[0015] Module 3 is used to select an image block of size (1 / 3)w×(1 / 3)w×p around each pixel of the hyperspectral image after dimensionality reduction as the central area, input it into the central Transformer branch, and obtain the output features of the central Transformer branch;
[0016] Module 4 is used to focus on the central area, select w×w×p and 5w×5w×p image blocks from near to far as the neighboring area and surrounding area respectively, and construct a surrounding area grid in the surrounding area, and then combine the neighboring area with the surrounding area, input them into the neighborhood Transformer branch, and obtain the output features of the neighborhood Transformer branch;
[0017] Module 5 is used to fuse the output features of module 3 and module 4 to obtain the joint features after center-neighborhood interactive learning, and send the joint features to the multi-layer perceptron for classification;
[0018] Module 6 is used to repeatedly execute modules 3-5 for each pixel in the hyperspectral image to complete the classification of the entire image.
[0019] The beneficial effects of the present invention are:
[0020] (1) The present invention proposes a hierarchical regional sampling strategy, which can obtain multi-scale samples according to regions of different granularities. In addition, local detail features and surrounding environment information can be distinguished and calculated simultaneously, which conforms to the distribution law of hyperspectral image objects and retains the global context of the image, thereby generating more representative and meaningful samples.
[0021] (2) The present invention designs a central Transformer branch to extract low-level detail features in the central region. Considering that hyperspectral images contain a rich variety of objects, different objects often have large scale differences, and the central observation pixel often plays an important role in classification, constructing a feature extraction branch focused on the central region can improve classification performance;
[0022] (3) The present invention develops a neighborhood Transformer branch, which interactively learns the contextual information of neighboring areas and surrounding areas through correlation calculation, obtains high-level semantic information, and enhances the extraction of spatial location distribution features.
[0023] (4) The present invention fuses the features output by the central Transformer branch and the neighborhood Transformer branch and sends them to a multi-layer perceptron to obtain a classification result that takes into account the global environmental information of the image without losing local detail features, thereby achieving fine classification of hyperspectral images. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1A schematic diagram of the method principle of an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram of the central Transformer branch structure used in an embodiment of the present invention;
[0026] Figure 3 A schematic diagram of the neighborhood Transformer branch structure used in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to facilitate ordinary technicians in the field to understand and implement the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0028] Please see Figure 1 The present invention provides a hyperspectral image classification method based on center-domain interactive learning, comprising the following steps:
[0029] Step 1: Input the original hyperspectral image and the ground object real distribution label map, determine the number of principal components p to be retained and the size w of the extracted image block;
[0030] During specific implementation, those skilled in the art can pre-set the values of the principal components and the length and width of the image blocks. In particular, the length and width of the image blocks need to be unified and set to odd numbers. It is recommended that the number of principal components and the length and width of the image blocks be in the range of 5-8 and 25-29, respectively. Figure 1 It serves as the input data for the method.
[0031] Step 2: Use the principal component analysis (PCA) algorithm to reduce the dimensionality of the original hyperspectral image to obtain a low-dimensional expression;
[0032] In this implementation, the input hyperspectral image needs to be processed by PCA algorithm for dimensionality reduction. PCA algorithm seeks some orthogonal projection directions so that the data has the largest variance after projection in these directions. As a common dimensionality reduction method, PCA method can convert data from high dimension to low dimension with less information loss, greatly reducing redundancy.
[0033] The dimensionality reduction process specifically includes the following sub-steps:
[0034] Step 2.1: Calculate the hyperspectral image The covariance matrix C of ; where m is the total number of image pixels, n is the total number of spectral features, represents the field of real numbers;
[0035] Step 2.2: Perform singular value decomposition on the covariance matrix C to obtain the eigenvalues and corresponding eigenvectors of the matrix C;
[0036] Step 2.3: Sort the eigenvalues obtained in step 2.2 in descending order according to their numerical values, and sort the eigenvectors accordingly according to the order of their eigenvalues;
[0037] Step 2.4: Take the first p eigenvectors u1,u2,...u after sorting in step 2.3 p Composition Matrix
[0038] Step 2.5: Calculate using the formula Z=XU to obtain the reduced-dimensional image data Z.
[0039] Step 3: For the hyperspectral image after dimensionality reduction, select an image block of size (1 / 3)w×(1 / 3)w×p around each pixel as the central area, that is, as the input data to be input to the central Transformer branch; input it to the central Transformer branch to obtain the output features of the central Transformer branch;
[0040] Please see Figure 2 , the central Transformer branch of this embodiment includes a first-layer regularization module, a multi-head self-attention module, a second-layer regularization module, a feedforward network module, a first residual connection module, and a second residual connection module;
[0041] The first layer of regularization module is used to convert the input data into 1024 dimensions and then input it into the multi-head self-attention module;
[0042] The multi-head self-attention module first multiplies the input query and key value, then obtains the attention map through the Softmax layer, then multiplies the attention map and the value to be calculated, linearly projects it, and inputs it into the second-layer regularization module;
[0043] The second layer regularization module is used to convert the input data into 1024 dimensions and then input it into the feedforward network module;
[0044] A feedforward network module is used to sequentially pass the input data through a linear function, a Gaussian error linear unit function, a random drop function, a linear function, and a random drop function to obtain a processed value;
[0045] The first residual connection module is used to add the original data and the output value of the multi-head self-attention module;
[0046] The second residual connection module is used to add the output value of the first residual connection and the output value of the feedforward network module.
[0047] During specific implementation, technicians in this field need to take the central observation pixel as the center, and select an image block of corresponding size in the neighborhood of the pixel as the input sample for the central Transformer branch according to the image block length and width values set in step 1.
[0048] Step 4: Focusing on the central area, we select w×w×p and 5w×5w×p image blocks from near to far as the neighboring area and surrounding area, and construct the surrounding area grid in the surrounding area. It should be noted that the final surrounding area is formed by selecting grids at a fixed interval of 2. Then combine the neighboring area with the surrounding area as the input data of the neighborhood Transformer branch; input it into the neighborhood Transformer branch to obtain the output features of the neighborhood Transformer branch;
[0049] Please see Figure 3 , the neighborhood Transformer branch of this embodiment includes a first-layer regularization module, an interactive self-attention module, a second-layer regularization module, a feedforward network module, a first residual connection module, and a second residual connection module;
[0050] The first layer of regularization module is used to convert the input data into 1024 dimensions and then input it into the interactive self-attention module;
[0051] The interactive self-attention module first performs end-member transformation and linear projection on the surrounding area of the input to obtain the query, then performs end-member transformation and linear projection on the surrounding area of the input to obtain the key value and the value to be calculated, then multiplies the query and the key value through the Softmax layer to obtain the attention map, then multiplies the attention map and the value to be calculated and inputs it into the second-layer regularization module;
[0052] The second layer regularization module is used to convert the input data into 1024 dimensions and then input it into the feedforward network module;
[0053] A feedforward network module is used to sequentially pass the input data through a linear function, a Gaussian error linear unit function, a random drop function, a linear function, and a random drop function to obtain a processed value;
[0054] The first residual connection module is used to add the original data and the output value of the interactive self-attention module;
[0055] The second residual connection module is used to add the output value of the first residual connection and the output value of the feedforward network module.
[0056] During specific implementation, those skilled in the art need to select grids with a fixed interval of 2 to form the surrounding area.
[0057] Step 5: Fuse the output features of step 3 and step 4 to obtain the joint features after center-neighborhood interactive learning, and send the joint features to the multi-layer perceptron for classification;
[0058] In this embodiment, the output features of step 3 and step 4 are fused in the following manner:
[0059] o=o c +o s ;
[0060] Among them, o is the fused feature, o c is the feature output by the central Transformer branch, o s It is the feature output by the neighborhood Transformer branch, and + represents the element-by-element addition operation. The fusion of center-domain features helps to determine the object category to which each central observation pixel belongs.
[0061] The multilayer perceptron of this embodiment is used to sequentially pass the input data through the layer regularization function and the linear function, convert the network output value into a prediction label, and complete the classification process.
[0062] Step 6: Repeat steps 3-5 for each pixel in the hyperspectral image to complete the classification of the entire image;
[0063] In this embodiment, the positions corresponding to the real distribution label map of the ground objects in the original hyperspectral image are filled with marked labels in advance, and then the remaining pixels are classified one by one to reduce the amount of calculation.
[0064] In this embodiment, the pixels to be classified in the hyperspectral image can be generated by using steps 2-4 to generate test samples, which are input into the method proposed by the present invention for testing to obtain classification accuracy and classification result graphs. In specific implementation, those skilled in the art can use overall accuracy and Kappa coefficient to perform quantitative classification accuracy evaluation, and qualitative classification effect evaluation through edge separability and internal continuity of objects in the classification result graph.
[0065] The present invention provides a hyperspectral image classification method based on center-domain interactive learning, which introduces an advanced Transformer structure and constructs a new classification method without convolution. Specifically, a hierarchical region sampling strategy is designed, the region where the central observation pixel is located is selected as the central region, and the neighborhood auxiliary pixels are further divided into neighboring regions and surrounding regions from near to far around the central region; a central Transformer branch is proposed to focus on the central region, which can fully extract local fine-grained features, which plays a decisive role in high-precision classification; in order to consider the neighborhood auxiliary pixels, a neighborhood Transformer branch is developed to capture coarse-grained features, and the correlation calculation between the neighboring region and the surrounding region is used to realize the deep mining of non-local coarse-grained features; after obtaining the output features of the two branches, they are fused and sent to the multi-layer perceptron to complete the pixel-by-pixel classification process.
[0066] First, the present invention proposes a hierarchical region sampling strategy to obtain the central region, the neighboring region and the surrounding region. In order to obtain a low-dimensional data expression, the principal component analysis algorithm is used to reduce the dimension of the hyperspectral image to p spectral dimensions (p represents the number of principal components, the same below). Then, an image block of size (1 / 3)w×(1 / 3)w×p is selected around the central observation pixel as a representative central region (w represents the size of the neighboring region, the same below). Unlike the general Transformer structure, since the input data of the central Transformer is a one-dimensional vector, there is no need to set a flattening operation, thereby avoiding the loss of position information. In addition, for each image block embedding in the central region, it is mapped to D dimensions through a trainable linear projection layer, which is defined as follows:
[0067]
[0068] in, is the projection matrix, p is the number of image patches, and B is the number of channels. An additional learnable class embedding c is added at the first position of the embedding class , this type of embedding does not set any label preference. In order to preserve the spatial location information, the learnable position embedding E pos is added to the image block embedding to generate the center embedding z0 as the input data of the center Transformer. The specific process can be expressed as:
[0069]
[0070] z0=[c class ; c1E, c2E, …, c p E]+E pos (3)
[0071] Around the central area, areas of size w×w×p and 5w×5w×p are selected in a divergent manner from near to far as the neighboring area and surrounding area respectively. Divided into a series of surrounding area grids Wherein, Q is the number of grids, and B is the number of channels. It should be noted that the surrounding area grid designed by the present invention is selected at a fixed interval of 2. Therefore, the selected grid gradually expands outward with the central area as the focus, thereby covering more environmental information with less memory and time. Through careful design, the grid size of the neighboring area is the same as that of the surrounding area, so it can be combined with the surrounding area grid as the input data of the neighborhood Transformer. The hierarchical area sampling strategy can obtain multi-scale samples as input data for two branches according to areas of different granularity. In addition, local detail features and surrounding spatial information are distinguished and calculated at the same time, retaining the distribution law of ground objects in the hyperspectral image.
[0072] Then, the present invention designs a central Transformer branch to focus on extracting local features in the central area, thereby enhancing the data representation capability at a finer granularity. Assume x i is the i-th center embedding vector, which is combined with three different transformation matrices M q 、M k and M v Multiply them to get the corresponding query vector q i , key vector k j Sum value vector v j Specifically, query q i is the query vector of the i-th input data used to match other vectors, key k j Represents the key vector to be matched for the i-th input data, value v j represents the information to be extracted from the i-th input data. Each query vector q i First, query the key vector k j Get the complexity α i,j , and send it to the softmax layer to get the attention map b of the i-th input data i , the attention map b i With the value vector v j The output feature b is obtained by mapping through the linear projection layer i It should be noted that the central Transformer branch designed in the present invention converts the dot product result q i ·k j Conducted The scaling of (d is the query vector q i and key vector k j The specific process can be expressed as:
[0073] q i =M q x i ,k j =M k x j ,v j =M v x j (4)
[0074]
[0075]
[0076]
[0077] The above structure is called a single-head attention mechanism. Through the same multiple operations, the output characteristics of the multi-head self-attention mechanism can be obtained:
[0078]
[0079] Among them, [·] represents the cascade operation, head l is the lth head, W o is the linear transformation matrix of multiple heads, d is and The dimension of and The lth head corresponds to q i , k j and v j The multi-head self-attention mechanism models the internal structure of the input data from a global perspective through different heads, which is crucial for obtaining the detailed features of the central area. Based on the above structure, the central Transformer branch can be expressed as the following process:
[0080] z′ d =MSA(LN(z d-1 ))+z d-1 (9)
[0081] z d =FF(LN(z′ d ))+z′ d (10)
[0082] where d∈{1,…,D}, z d is the output of the d-th central Transformer branch, z′ d are intermediate features, D is the number of complete central Transformer branches, and FF represents a feed-forward layer containing two linear layers, a dropout layer, and a Gaussian error linear unit activation function.
[0083] Then, the present invention develops a neighborhood Transformer branch to capture neighborhood auxiliary pixels of different scales and conduct interactive learning between them. Similar to the central Transformer, the neighborhood area is divided and rearranged into m adjacent neighborhood image blocks of size (1 / m)w×(1 / m)w×p, and the query vector q is obtained by formula (4): i Through a series of linear mappings, the projection vectors are obtained from the q neighborhood image blocks, and the projection vectors are divided into the i-th embedded key vector k j Sum value vector v j The output of the neighborhood transformer can be further obtained by formulas (5)-(8). It should be noted that the neighborhood transformer branch proposed in this invention does not focus on all image blocks, but takes the middle neighboring area as the query and extracts a part of the embedding at multiple granularities as the query vector q i Sum value vector v j , thus being able to establish a wider range of visual dependencies at a reasonable scale. The internal fine-grained features and the external coarse-grained distribution are generated by the center Transformer and the neighborhood Transformer respectively.
[0084] Finally, in order to obtain an equal global representation, the present invention selects the class embedding of the vectors output by the two branches, sends them to the layer regularization for fusion, and then outputs the probability of each pixel belonging to a different category through the multi-layer perceptron. This process can be expressed as:
[0085] y i =MLP(LN(c i,cls )+LN(S i,cls )) (11)
[0086] Among them, y i is the predicted category of the i-th pixel, c i,cls represents the class embedding of the i-th pixel from the central Transformer, S i,cls is the class embedding of the ith pixel from the neighborhood Transformer, and + represents the addition operation. and i are the predicted category and true category of the i-th training pixel, respectively, m is the size of the training set, and the cross entropy loss function L can be defined as:
[0087]
[0088] The entire network is trained in an end-to-end mode, continuously optimized through back-propagation, and outputs the predicted category of each pixel.
[0089] The above are the implementation steps of the hyperspectral image classification method provided by the present invention. When it is implemented, a software platform can be used to run it, and the device for running the process should also be within the protection scope of the present invention.
[0090] It should be understood that the above description of the preferred embodiment is relatively detailed and cannot be regarded as limiting the scope of patent protection of the present invention. Under the enlightenment of the present invention, ordinary technicians in this field can also make substitutions or modifications without departing from the scope of protection of the claims of the present invention, which all fall within the scope of protection of the present invention. The scope of protection requested for the present invention shall be based on the attached claims.
Claims
1. A hyperspectral image classification method based on center-domain interactive learning, characterized in that: The following steps are involved: Step 1: Input the original hyperspectral image and the ground object real distribution label map, determine the number of principal components p to be retained and the size w of the extracted image block; Step 2: Perform dimensionality reduction processing on the original hyperspectral image to obtain a low-dimensional expression; Step 3: For the hyperspectral image after dimensionality reduction, select an image block of size (1 / 3)w×(1 / 3)w×p around each pixel as the central area, input it into the central Transformer branch, and obtain the output features of the central Transformer branch; The central Transformer branch includes a first-layer regularization module, a multi-head self-attention module, a second-layer regularization module, a feedforward network module, a first residual connection module, and a second residual connection module; The first-layer regularization module is used to convert the input data into 1024 dimensions and then input it into the multi-head self-attention module; The multi-head self-attention module first multiplies the input query and the key value, then obtains the attention map through the Softmax layer, and then multiplies the attention map and the value to be calculated, linearly projects it, and inputs it into the second-layer regularization module; The second layer regularization module is used to convert the input data into 1024 dimensions and then input the data into the feedforward network module; The feedforward network module is used to sequentially pass the input data through a linear function, a Gaussian error linear unit function, a random discard function, a linear function, and a random discard function to obtain a processed value; The first residual connection module is used to add the original data and the output value of the multi-head self-attention module; The second residual connection module is used to add the first residual connection output value and the feedforward network module output value; Step 4: Focusing on the central area, we select image blocks of w×w×p and 5w×5w×p from near to far as the neighboring area and surrounding area, respectively, and build a surrounding area grid in the surrounding area. Then, we combine the neighboring area with the surrounding area and input them into the neighborhood Transformer branch to obtain the output features of the neighborhood Transformer branch. Step 5: Fuse the output features of step 3 and step 4 to obtain the joint features after center-neighborhood interactive learning, and send the joint features to the multi-layer perceptron for classification; Step 6: Repeat steps 3-5 for each pixel in the hyperspectral image to complete the classification of the entire image.
2. The hyperspectral image classification method based on center-domain interactive learning according to claim 1 is characterized in that: In step 1, the number of principal components and the size of the extracted image block are set to fixed values, and the length value and width value of the image block size are the same; the value ranges of the number of principal components and the size of the extracted image block should be 5-8 and 25-29 respectively.
3. The hyperspectral image classification method based on center-domain interactive learning according to claim 1 is characterized in that: In step 2, the principal component analysis algorithm is used to reduce the dimension of the original hyperspectral image. The dimension reduction process specifically includes the following sub-steps: Step 2.1: Calculate the hyperspectral image The covariance matrix C of ; where m is the total number of image pixels, n is the total number of spectral features, represents the field of real numbers; Step 2.2: Perform singular value decomposition on the covariance matrix C to obtain the eigenvalues and corresponding eigenvectors of the matrix C; Step 2.3: Sort the eigenvalues obtained in step 2.2 in descending order according to their numerical values, and sort the eigenvectors accordingly according to the order of their eigenvalues; Step 2.4: Take the first p eigenvectors u1,u2,...u after sorting in step 2.3 p Composition Matrix Step 2.5: Calculate using the formula Z=XU to obtain the reduced-dimensional image data Z.
4. The hyperspectral image classification method based on center-domain interactive learning according to claim 1 is characterized in that: In step 4, the neighborhood Transformer branch includes a first-layer regularization module, an interactive self-attention module, a second-layer regularization module, a feedforward network module, a first residual connection module, and a second residual connection module; The first-layer regularization module is used to convert the input data into 1024 dimensions and then input it into the interactive self-attention module; The interactive self-attention module first performs end-member conversion and linear projection on the surrounding area of the input to obtain a query, then performs end-member conversion and linear projection on the surrounding area of the input to obtain a key value and a value to be calculated, then multiplies the query and the key value through a Softmax layer to obtain an attention map, then multiplies the attention map and the value to be calculated and inputs the second-layer regularization module; The second layer regularization module is used to convert the input data into 1024 dimensions and then input the data into the feedforward network module; The feedforward network module is used to sequentially pass the input data through a linear function, a Gaussian error linear unit function, a random discard function, a linear function, and a random discard function to obtain a processed value; The first residual connection module is used to add the original data and the output value of the interactive self-attention module; The second residual connection module is used to add the first residual connection output value and the feedforward network module output value.
5. The hyperspectral image classification method based on center-domain interactive learning according to claim 1 is characterized in that: In step 5, the output features of step 3 and step 4 are fused in the following way: o=o c +o s (1) Among them, o is the fused feature, o c is the feature output by the central Transformer branch, o s It is the feature output by the neighborhood Transformer branch, and + represents the element-by-element addition operation.
6. The hyperspectral image classification method based on center-domain interactive learning according to claim 1 is characterized in that: In step 5, the joint features are sent to a multi-layer perceptron for classification. The multi-layer perceptron is used to sequentially pass the input data through the layer regularization function and the linear function, convert the network output value into a prediction label, and complete the classification process.
7. A hyperspectral image classification system based on center-domain interactive learning, characterized in that: Includes the following modules: Module 1 is used to input the original hyperspectral image and the real distribution label map of the ground objects, determine the number of principal components p to be retained and the size w of the extracted image block; Module 2 is used to perform dimensionality reduction processing on the original hyperspectral image to obtain a low-dimensional expression; Module 3 is used to select an image block of size (1 / 3)w×(1 / 3)w×p around each pixel of the hyperspectral image after dimensionality reduction as the central area, input it into the central Transformer branch, and obtain the output features of the central Transformer branch; The central Transformer branch includes a first-layer regularization module, a multi-head self-attention module, a second-layer regularization module, a feedforward network module, a first residual connection module, and a second residual connection module; The first-layer regularization module is used to convert the input data into 1024 dimensions and then input it into the multi-head self-attention module; The multi-head self-attention module first multiplies the input query and the key value, then obtains the attention map through the Softmax layer, and then multiplies the attention map and the value to be calculated, linearly projects it, and inputs it into the second-layer regularization module; The second layer regularization module is used to convert the input data into 1024 dimensions and then input the data into the feedforward network module; The feedforward network module is used to sequentially pass the input data through a linear function, a Gaussian error linear unit function, a random discard function, a linear function, and a random discard function to obtain a processed value; The first residual connection module is used to add the original data and the output value of the multi-head self-attention module; The second residual connection module is used to add the first residual connection output value and the feedforward network module output value; Module 4 is used to focus on the central area, select w×w×p and 5w×5w×p image blocks from near to far as the neighboring area and surrounding area respectively, and construct a surrounding area grid in the surrounding area, and then combine the neighboring area with the surrounding area, input them into the neighborhood Transformer branch, and obtain the output features of the neighborhood Transformer branch; Module 5 is used to fuse the output features of module 3 and module 4 to obtain the joint features after center-neighborhood interactive learning, and send the joint features to the multi-layer perceptron for classification; Module 6 is used to repeatedly execute modules 3-5 for each pixel in the hyperspectral image to complete the classification of the entire image.
Citation Information
Patent Citations
Hyperspectral image ground object classification method based on spectral segmentation and homogeneous region detection
CN112308152A
Hyperspectral image classification method based on attention mechanism and weight sharing
CN113095409A