Hyperspectral image cross-scene classification method based on bidirectional attention mechanism
Through the bidirectional attention mechanism and knowledge distillation technology, the problem of large generalization error in cross-scene classification of hyperspectral remote sensing images is solved, and efficient ground object classification and feature extraction are achieved, which is suitable for hyperspectral images in different scenes and times.
Patent Information
- Application Number
- CN202410679029.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-05-29
AI Technical Summary
Existing hyperspectral remote sensing image classification models have large generalization errors and poor interpretation effects in cross-scenario applications, and are difficult to adapt to spectral shifts in different scenarios and times, resulting in a decrease in the accuracy of ground object classification.
A cross-scene classification method for hyperspectral images based on a bidirectional attention mechanism is adopted. By constructing a semantic token parser and a coupling branch, two-way information interaction and feature alignment between the source domain and the target domain are achieved, and the loss function is optimized by combining knowledge distillation technology. to reduce differences between domains.
It improves the accuracy and efficiency of cross-domain feature classification, breaks through the inter-domain invariant representation capabilities of the traditional attention mechanism, realizes two-way domain adaptation of the feature layer, and enhances the extraction capability of domain invariant representations.
Smart Images

Figure CN118552853A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a hyperspectral image cross-scene classification method based on a bidirectional attention mechanism. Background Art
[0002] Hyperspectral remote sensing images are images with nanometer-level spectral resolution. By sampling in the visible to short-wave infrared band, each band has a spectral resolution of only a few nanometers, and imaging objects in dozens to hundreds of bands at the same time, it can capture rich spectral information while obtaining spatial information of objects. Hyperspectral remote sensing image classification technology can achieve accurate classification of objects by making full use of spatial information and spectral information.
[0003] Compared with the certainty of a single scene in the single scene classification of hyperspectral images, the area to be evaluated in actual tasks often has scene uncertainty, and the existing models have current scene limitations in the construction of features for detecting land object attributes. For example, investigators conduct field surveys over a large area and use airborne imaging systems to collect airborne images. Typically, airborne push-broom hyperspectral imagers acquire hyperspectral images. Data collection over a large area often takes days or weeks, which means that the acquired data may vary depending on the lighting (i.e., clear or partially cloudy conditions), resulting in significant differences in the spectral characteristics of the same land cover category, a phenomenon known as spectral shift. Since the training data and the test data have certain differences in the acquisition area, capture time, and sensor platform, it is difficult to meet the independent and identically distributed assumption, resulting in high generalization errors and poor interpretation effects for traditional models across scene tests.
[0004] In order to solve the problem of cross-scene object classification, it is necessary to design a feature alignment strategy suitable for hyperspectral images, reduce the distribution differences between the source domain and the target domain, realize the transformation and utilization of source domain information into target domain information, accurately capture the characteristic information of the target scene objects, thereby achieving accurate object classification and completing fine mapping. Summary of the invention
[0005] In order to solve the technical problems existing in the background technology, the present invention aims to provide a cross-scene classification method for hyperspectral images based on a bidirectional attention mechanism, which is suitable for both coarse-grained and fine-grained cross-domain classification tasks, and maintains high extraction accuracy and low computational complexity in cross-domain prediction.
[0006] In order to solve the technical problem, the technical solution of the present invention is:
[0007] A hyperspectral image cross-scene classification method based on a bidirectional attention mechanism, the method comprising:
[0008] S1: Select source scene data and labels, as well as target scene data, to build a training set;
[0009] S2: Build a semantic token parser and input spatial-spectral projection to obtain semantic tokens of the source and target domains;
[0010] S3: construct source domain and target domain branches, input the semantic token to obtain semantic token representation and classification token representation of the source domain and target domain;
[0011] S4: merge the semantic tokens of the source domain and the target domain, and input the coupling branch to obtain the coupled token representation;
[0012] S5: Calculate the loss function using the source domain, target domain, coupled semantic token representation and classification token representation for training the network model;
[0013] S6: Use the trained network for the target scene and perform panoramic reasoning to achieve precise recognition of ground objects in the target scene.
[0014] Further, the step S1 comprises:
[0015] Step 101: Select two hyperspectral remote sensing images of different phases in a large forest area;
[0016] Step 102: Use one of the images as the source domain and the other image as the target domain, and select all labeled samples in the source domain and unlabeled samples in the target domain to construct a training set.
[0017] Further, the step S2 comprises:
[0018] Step 201: construct a semantic token parser, which consists of a 3D convolution, two 2D convolutions, and a spatial-spectral projection operation;
[0019] Step 202: input the training set, obtain a spatial-spectral projection matrix through a 3D convolution and a 2D convolution, and obtain semantic tokens of the source domain and the target domain through projection and a 2D convolution;
[0020] Further, the step S3 comprises:
[0021] Step 301: construct source domain and target domain feature extraction branches. The source domain branch and the target domain branch have the same structure and are both constructed based on the transformer framework, in which the self-attention mechanism is used to complete the information interaction within the domain;
[0022] Step 302: input the semantic token, construct a self-learned category token and merge it with the semantic token, and obtain the semantic token representation and classification token representation of the source domain and the target domain respectively through the source domain branch and the target domain branch.
[0023] Further, the step S4 comprises:
[0024] Step 401: construct a coupled feature extraction branch, which is constructed based on the transformer framework, wherein a bidirectional attention mechanism is designed to achieve bidirectional information interaction between domains;
[0025] Step 402: input the semantic token, merge the semantic tokens of the source domain and the target domain, and obtain coupled semantic token representation and coupled classification token representation through coupling branches.
[0026] Further, the step S5 comprises:
[0027] Step 501: Input the source domain, target domain, coupled semantic token representation and classification token representation, and update the weights by calculating the loss function and returning the gradient. The overall loss function of the integrated network is as follows:
[0028] L total =L ce +λ 1 (L LMMD +L Bi-distill ) (1)
[0029] Among them, L ce represents the cross entropy loss, which is calculated from the above source domain classification token representation and label, L LMMD represents the local maximum mean difference loss, which is calculated by the semantic token representation of the source domain and the target domain. Bi-distill represents the bidirectional distillation loss, which is calculated from the above source domain, target domain, and coupled classification token representation;
[0030] Step 502: After the training is completed, the debugged network parameters are saved.
[0031] Further, the step S6 comprises:
[0032] Step 601: All label samples in the target domain data are used as test data sets and input into the trained network to obtain the classification results of hyperspectral image features;
[0033] Step 602: Input the entire target scene image into the trained network, and finally obtain a complete ground feature extraction result.
[0034] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any one of the above-mentioned methods for cross-scene classification of hyperspectral images based on a bidirectional attention mechanism is implemented.
[0035] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements any of the above-mentioned methods for cross-scene classification of hyperspectral images based on a bidirectional attention mechanism.
[0036] The present invention proposes a hyperspectral image cross-scene classification method based on a bidirectional attention mechanism; designs a bidirectional attention mechanism and a spatial-spectral semantic token parser, and adopts knowledge distillation technology. Compared with the prior art, the present invention has the following advantages:
[0037] (1) The present invention fully considers the single-element difference and multi-element difference in cross-domain classification tasks, and proposes a complete set of hyperspectral image cross-scene ground feature element recognition models. The method is used to alleviate the multi-dimensional differences of similar species under cross-temporal conditions, and can perform coarse-grained or fine-grained ground feature element extraction work on hyperspectral images in different regions or different phases, greatly improving the efficiency of large-scene ground feature element extraction;
[0038] (2) Compared with the traditional attention mechanism, the bidirectional attention mechanism proposed in this paper fully considers the information interaction between different domains in cross-domain classification, breaks through the upper limit of the ability of the traditional attention mechanism to learn invariant representations between domains, and realizes bidirectional domain adaptation at the feature layer;
[0039] (3) Compared with the existing knowledge distillation technology, the bidirectional distillation loss proposed in the present invention is more suitable for multi-branch domain adaptation models. It regards the predicted probability distribution of the coupled branches as soft labels, realizes bidirectional supervision of the source branch and the target branch, and strengthens the extraction of domain-invariant representations. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 , a flow chart of the hyperspectral image cross-scene classification method based on the bidirectional attention mechanism of the present invention;
[0041] Figure 2 , a structural diagram of the semantic token parser constructed by the present invention;
[0042] Figure 3 , flow chart of the semantic token parser designed by the present invention;
[0043] Figure 4 , source domain branch structure diagram designed by the present invention;
[0044] Figure 5 , a coupling branch structure diagram constructed by the present invention;
[0045] Figure 6 , a schematic diagram of loss calculation input and output of the present invention;
[0046] Figure 7 , color map and ground truth map of HyRANK dataset;
[0047] Figure 8 , the trained model in the embodiment produces a detailed recognition result of the ground object element information in the target scene. DETAILED DESCRIPTION
[0048] The specific implementation mode of the present invention is described below in conjunction with embodiments:
[0049] It should be noted that the structures, proportions, sizes, etc. shown in this specification are only used to match the contents disclosed in the specification so that people familiar with this technology can understand and read them, and are not used to limit the conditions under which the present invention can be implemented. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.
[0050] At the same time, the terms such as "upper", "lower", "left", "right", "middle" and "one" cited in this specification are only for the convenience of description and are not used to limit the scope of implementation of the present invention. Changes or adjustments to their relative relationships should be regarded as the scope of implementation of the present invention without substantially changing the technical content.
[0051] Embodiment 1:
[0052] like Figure 1 As shown, a hyperspectral image cross-scene classification method based on a bidirectional attention mechanism includes the following steps:
[0053] Step 1: Select source scene data and labels, as well as target scene data, to build a training set;
[0054] Step 2: Build a semantic token parser and input spatial-spectral projection to obtain semantic tokens;
[0055] Step 3: Construct source domain and target domain branches, input semantic tokens to obtain token representations;
[0056] Step 4: Merge the semantic tokens of the source domain and the target domain, and input the coupling branch to obtain the coupled token representation;
[0057] Step 5: Use the source domain and target domain token representations, as well as the coupled token representations, to calculate the loss function for training the model;
[0058] Step 6: Use the trained network for the target scene and perform panoramic reasoning to achieve precise recognition of the target scene’s ground object information.
[0059] Specifically, step 1 includes the following steps:
[0060] Step 1.1: Select two images of different regions and phases from the large-area forest hyperspectral image;
[0061] Step 1.2: Use one of the images as the source domain and the other as the target domain. Select all labeled samples in the source domain and unlabeled samples in the target domain to construct a training set, where the sample size is set to 13×13.
[0062] Specifically, step 2 includes the following steps:
[0063] Step 2.1: Build a semantic token parser, extract the space-spectrum projection matrix by sequentially connecting 3D convolution and 2D convolution, where the correlation of the spectral dimension is modeled by 3D convolution to obtain deep spectral features, and the semantic information of the spatial dimension is mined by 2D convolution to obtain the space-spectrum projection matrix. The softmax function is used on the projection matrix to calculate the space-spectrum attention map, which is applied to each pixel in the sample. Finally, it is input into a 2D convolution module with a convolution kernel of 1×1 to complete the dimensional mapping, thereby obtaining a semantic token T of size L. s / t , the structure diagram of the semantic token parser is as follows Figure 2 As shown;
[0064] Step 2.2: Input the training set samples in step 1.2 to obtain the semantic tokens of the source domain and the target domain. The flowchart of the semantic token parser is as follows: Figure 3 As shown;
[0065] Specifically, step 3 includes the following steps:
[0066] Step 3.1: Construct source domain and target domain feature extraction branches. The specific structure diagram is as follows Figure 4 This feature extraction branch is based on transformer and consists of a linear projection layer, a multi-head self-attention module, a summation & normalization module, and a feedforward network. Figure 4 The order of modules in series is: linear projection layer - multi-head self-attention module - summation & normalization module - feedforward network - summation & normalization module;
[0067] Step 3.2: Semantic tokens T of the source and target domains in step 2.2 s / t With the self-learning category token T cls Merge and input the source domain branch and the target domain branch respectively. First, the token is input into three linear projection layers to calculate the triple set (Q, K and V), and then the multi-head self-attention module mines the intra-domain correlation within the token sequence to obtain the semantic token representation of the source domain and the target domain. and classification token representation
[0068] Specifically, step 4 includes the following steps:
[0069] Step 4.1: Construct the coupling feature extraction branch. The specific structure diagram is as follows Figure 5This feature extraction branch is based on transformer and consists of a linear projection layer, a multi-head bidirectional attention module, a summation & normalization module, and a feedforward network. Figure 5 The order of the modules in series is: linear projection layer-multi-head bidirectional attention module-source domain target domain splitting-addition & normalization module (×2)-feedforward network (×2)-addition & normalization module (×2);
[0070] Step 4.2: Merge the semantic tokens of the source domain and the target domain in step 2.2 and input them into three linear projection layers to calculate the triple set (Q st , K st and V st ), and obtain coupled semantic token representation through coupling branches and and coupled classification token representation and
[0071] Specifically, step 5 includes the following steps:
[0072] Step 5.1: Loss calculation input and output diagram as shown below Figure 6 The classification tokens output by the source domain branch in step 3.2 are represented by the fully connected layer To the label space, the fully connected layer consists of a fully connected layer and a one-dimensional batch normalization, and the output dimension is set to the number of categories. Input softmax to obtain the predicted probability and calculate the cross entropy loss:
[0073]
[0074] where y s,i is x s,i One-hot label encoding, c is the index of the category, q s,i is the predicted probability, n s Represents the number of source domain samples.
[0075] Step 5.2: Input the semantic token representations of the source domain and target domain in steps 3.2 and 4.2 as well as the coupled semantic token representations, and calculate the local maximum mean difference loss:
[0076]
[0077] in and
[0078] They are and The i-th and j-th vectors of and Belongs to category c and The weight is calculated by the following formula:
[0079]
[0080] where y ic is the vector y i Here the one-hot true value label vector of the source domain is used as y i , which is used to calculate the weights. However, in the unsupervised domain adaptation training process, due to the lack of available target domain labels, the predicted probability of the target branch output needs to be regarded as y i . Calculate the local maximum mean difference loss between the source branch, the target branch, and the coupled branch:
[0081]
[0082] Step 5.3: Design a bidirectional distillation loss based on the idea of distillation learning. Input the source domain, target domain, and coupled classification token representation in steps 3.2 and 4.2, and convert the coupled classification token representation and The probability distribution of and is regarded as a soft label. The distillation loss of the source domain is calculated as follows:
[0083]
[0084] The distillation loss for the target domain is calculated as follows:
[0085]
[0086] Calculate the bidirectional distillation loss:
[0087]
[0088] Step 5.4: Integrate the above loss functions and calculate the overall network loss function as follows:
[0089] L total =L ce +λ 1 (L LMMD +L Bi-distill ) (8)
[0090] Step 5.5: Start training the network model. At the beginning of each round of training, all training images are input into the network. The network adjusts its own parameters according to the direction that minimizes the loss value of the loss function until the loss value is minimized. At this time, the best training effect can be obtained.
[0091] Step 5.6: After training is completed, save the network model parameters.
[0092] Specifically, step 6 includes the following sub-steps:
[0093] Step 6.1: Load the network model parameters, take all the labeled samples in the target domain data divided in step 1.2 as the test data set, input them into the network to obtain the classification results of the hyperspectral image test data set;
[0094] Step 5.2: Create 13×13 samples of the entire target scene image pixel by pixel, input them into the network, and finally obtain the complete target scene ground feature information and fine recognition results.
[0095] Embodiment 2:
[0096] The HyRANK hyperspectral image dataset is used, which is a satellite hyperspectral image collected by the Hyperion sensor (EO-1, USGS) with 176 spectral bands. The two labeled scenes are Dioni and Loukia, which consist of 250×1376 pixels and 249×945 pixels respectively, with a total of twelve common categories, with Dioni as the source domain and Loukia as the target domain. The color map and ground truth map of the HyRANK dataset are shown in Figure 7 The training of the complete network model for fine recognition of the target scene features is shown in Figure 8 shown.
[0097] Embodiment 3:
[0098] The present invention provides a terminal device, which includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function; the processor described in this embodiment can be used for the operation of the hyperspectral image cross-scene classification method based on the bidirectional attention mechanism, including the following steps:
[0099] Step 1: Select source scene data and labels, as well as target scene data, to build a training set;
[0100] Step 2: Build a semantic token parser and input spatial-spectral projection to obtain semantic tokens;
[0101] Step 3: Construct source domain and target domain branches, input semantic tokens to obtain token representations;
[0102] Step 4: Merge the semantic tokens of the source domain and the target domain, and input the coupling branch to obtain the coupled token representation;
[0103] Step 5: Use the source domain and target domain token representations, as well as the coupled token representations, to calculate the loss function for training the model;
[0104] Step 6: Use the trained network for the target scene and perform panoramic reasoning to achieve precise recognition of the target scene’s ground object information.
[0105] Embodiment 4:
[0106] The present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a terminal device for storing programs and data. It is understandable that the computer-readable storage medium here can include both the built-in storage medium in the terminal device and the extended storage medium supported by the terminal device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0107] One or more instructions stored in a computer-readable storage medium may be loaded and executed by a processor to implement the corresponding steps of the cross-scene classification method of hyperspectral images based on a bidirectional attention mechanism in the above embodiment; one or more instructions in the computer-readable storage medium are loaded and executed by the processor as follows:
[0108] Step 1: Select source scene data and labels, as well as target scene data, to build a training set;
[0109] Step 2: Build a semantic token parser and input spatial-spectral projection to obtain semantic tokens;
[0110] Step 3: Construct source domain and target domain branches, input semantic tokens to obtain token representations;
[0111] Step 4: Merge the semantic tokens of the source domain and the target domain, and input the coupling branch to obtain the coupled token representation;
[0112] Step 5: Use the source domain and target domain token representations, as well as the coupled token representations, to calculate the loss function for training the model;
[0113] Step 6: Use the trained network for the target scene and perform panoramic reasoning to achieve precise recognition of the target scene’s ground object information.
[0114] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0115] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0116] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0117] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0118] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the implementation methods of the present invention, and should be understood that the protection scope of the present invention is not limited to such special statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.
[0119] The preferred embodiments of the present invention are described in detail above, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
[0120] Many other changes and modifications may be made without departing from the concept and scope of the present invention.It should be understood that the present invention is not limited to the specific embodiments, and the scope of the present invention is defined by the appended claims.
Claims
1. A hyperspectral image cross-scene classification method based on a bidirectional attention mechanism, characterized in that: The method comprises: S1: Select source scene data and labels, as well as target scene data, to build a training set; S2: Build a semantic token parser and input spatial-spectral projection to obtain semantic tokens of the source and target domains; S3: construct source domain and target domain branches, input the semantic token to obtain semantic token representation and classification token representation of the source domain and target domain; S4: merge the semantic tokens of the source domain and the target domain, and input the coupling branch to obtain the coupled token representation; S5: Calculate the loss function using the source domain, target domain, coupled semantic token representation and classification token representation for training the network model; S6: Use the trained network for the target scene and perform panoramic reasoning to achieve precise recognition of ground objects in the target scene.
2. The hyperspectral image cross-scene classification method based on the bidirectional attention mechanism according to claim 1 is characterized in that: The step S1 comprises: Step 101: Select two hyperspectral remote sensing images of different phases in a large forest area; Step 102: Use one of the images as the source domain and the other image as the target domain, and select all labeled samples in the source domain and unlabeled samples in the target domain to construct a training set.
3. The hyperspectral image cross-scene classification method based on the bidirectional attention mechanism according to claim 1 is characterized in that: The step S2 comprises: Step 201: construct a semantic token parser, which consists of a 3D convolution, two 2D convolutions, and a spatial-spectral projection operation; Step 202: Input the training set, obtain a spatial-spectral projection matrix through a 3D convolution and a 2D convolution, and obtain semantic tokens of the source domain and the target domain through projection and a 2D convolution.
4. The hyperspectral image cross-scene classification method based on the bidirectional attention mechanism according to claim 1 is characterized in that: The step S3 comprises: Step 301: construct source domain and target domain feature extraction branches. The source domain branch and the target domain branch have the same structure and are both constructed based on the transformer framework, in which the self-attention mechanism is used to complete the information interaction within the domain; Step 302: input the semantic token, construct a self-learned category token and merge it with the semantic token, and obtain the semantic token representation and classification token representation of the source domain and the target domain respectively through the source domain branch and the target domain branch.
5. The method for cross-scene classification of hyperspectral images based on a bidirectional attention mechanism according to claim 1 is characterized in that: The step S4 comprises: Step 401: construct a coupled feature extraction branch, which is constructed based on the transformer framework, wherein a bidirectional attention mechanism is designed to achieve bidirectional information interaction between domains; Step 402: input the semantic token, merge the semantic tokens of the source domain and the target domain, and obtain coupled semantic token representation and coupled classification token representation through coupling branches.
6. The method for cross-scene classification of hyperspectral images based on a bidirectional attention mechanism according to claim 1, characterized in that: The step S5 comprises: Step 501: Input the source domain, target domain, coupled semantic token representation and classification token representation, and update the weights by calculating the loss function and returning the gradient. The overall loss function of the integrated network is as follows: L total =L ce +λ1(L LMMD +L Bi-distill ) (1) Among them, L ce represents the cross entropy loss, which is calculated from the above source domain classification token representation and label, L LMMD represents the local maximum mean difference loss, which is calculated by the semantic token representation of the source domain and the target domain. Bi-distill represents the bidirectional distillation loss, which is calculated from the above source domain, target domain, and coupled classification token representation; Step 502: After the training is completed, the debugged network parameters are saved.
7. The method for cross-scene classification of hyperspectral images based on a bidirectional attention mechanism according to claim 1, characterized in that: The step S6 comprises: Step 601: All label samples in the target domain data are used as test data sets and input into the trained network to obtain the classification results of hyperspectral image features; Step 602: Input the entire target scene image into the trained network, and finally obtain a complete ground feature extraction result.
8. A computer device, characterized in that:The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for cross-scene classification of hyperspectral images based on a bidirectional attention mechanism as described in any one of claims 1 to 7 is implemented.
9. A computer-readable storage medium, characterized in that: A computer program is stored on a computer-readable storage medium, and when the program is executed by a processor, the method for cross-scene classification of hyperspectral images based on a bidirectional attention mechanism described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Lightweight visual question and answer method based on bidirectional segmentable deep self-attention network
CN114647752A
Hyperspectral image cross-domain ground feature element extraction method based on block characterization mechanism
CN116883752A
Cited By
Multi-teacher model knowledge distillation method integrating semantic weight soft labels
CN119442014A
Method for distinguishing producing areas of two artemisia plants based on double-sided hyperspectral information in combination with double-flow collaborative attention classification model and application
CN122049656A
