Method, device and equipment for carrying out cross-scene classification on hyperspectral image

By using frequency transform FT network and balanced attention consistency BAC network in the cross-scene classification of hyperspectral images, the problem of insufficient feature mining is solved, and the cross-scene classification accuracy of hyperspectral images is significantly improved.

CN118898746AActive Publication Date: 2024-11-05WUHAN UNIV

Patent Information

Application Number
CN202410950994.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-05
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

The prior art has the problem of insufficient feature mining in the cross-scene classification of hyperspectral images, resulting in poor cross-scene classification performance of deep learning models for hyperspectral images.

Method used

The frequency transformed FT network in the preset training framework is adopted to enhance feature diversity by transforming the frequency characteristics of the image in the training stage, and a reliable constraint strategy is built in combination with the balanced attention consistency BAC network to generate extended domain samples and improve the cross-span of the model. Scene classification ability.

Benefits of technology

The cross-scene classification accuracy of hyperspectral images is significantly improved, and it has better scene classification capabilities compared with the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118898746A_ABST
    Figure CN118898746A_ABST
Patent Text Reader

Abstract

The invention discloses a method, device and equipment for carrying out cross-scene classification on a hyperspectral image, and the method comprises the steps: obtaining a target domain image; wherein the target domain image is a hyperspectral image of a target area needing cross-scene classification; inputting the target domain image into a preset cross-scene classification model, and outputting a classification category about the target domain image through the preset cross-scene classification model; wherein the preset cross-scene classification model is obtained by training based on a preset training framework and at least one group of training data, and each group of training data in the at least one group of training data comprises a source domain sample image and a corresponding label value; the preset training framework can generate corresponding extended domain sample images based on the source domain sample images in each group of training data. By using the method disclosed by the invention, the generalization ability of the model can be improved by changing the frequency characteristic of the image in the training stage, so that the accuracy of performing cross-scene classification on the hyperspectral image by the preset cross-scene classification model obtained by training is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of remote sensing image processing technology, and in particular to a method, device, electronic device, non-transitory computer-readable storage medium and computer program product for cross-scene classification of hyperspectral images. Background Art

[0002] With the development of economy and technology, the use of hyperspectral remote sensing images (HSI) containing rich spectral information to identify feature categories has been widely used in agriculture, military and other fields. Among them, with the rapid development of deep learning technology, the accuracy of HSI classification has been significantly improved.

[0003] In deep learning related technologies, in order to solve the problem of high manual labeling costs, cross-scene classification can be used to train deep learning models, where the cross-scene classification specifically refers to using a source domain (SD) containing a large number of existing labeled images to classify a target domain (TD) containing a small number of or even no labeled images. However, HSI is affected by various factors such as lighting, weather, and sensors during the acquisition process, which causes changes in the spectral reflectance of the same object in SD images and TD images; this phenomenon will cause the deep learning-based classification model trained on SD images to have poor accuracy on TD images. To solve the above problems, domain adaptation (DA) and domain generalization (DG) technologies are introduced in the prior art; they can alleviate the problem of model performance degradation caused by the presence of differentiated features between the source domain (SD) and the target domain (TD) to a certain extent.

[0004] However, the domain adaptation (DA) and domain generalization (DG) methods of the above-mentioned existing technologies have the problem of insufficient feature mining, which leads to the fact that the deep learning models trained in this way still have poor performance in cross-scene classification of hyperspectral images. Summary of the invention

[0005] The present invention discloses a method, an apparatus, an electronic device, a non-transitory computer-readable storage medium and a computer program product for cross-scene classification of hyperspectral images, so as to solve the defects in the prior art.

[0006] The present invention discloses a method for cross-scene classification of hyperspectral images, comprising: Acquire a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be classified across scenes; Inputting the target domain image into a preset cross-scene classification model, and outputting a classification category of the target domain image through the preset cross-scene classification model; The preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data. The present invention also provides a device for performing cross-scene classification on a hyperspectral image, comprising: The image acquisition module is configured to: acquire a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be classified across scenes; A classification prediction execution module is configured to: input the target domain image into a preset cross-scene classification model, and output a classification category of the target domain image through the preset cross-scene classification model; Among them, the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

[0007] The present invention also provides an electronic device, comprising 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 as described in any one of the above is implemented.

[0008] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for cross-scene classification of hyperspectral images as described in any one of the above is implemented.

[0009] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above methods for cross-scene classification of hyperspectral images.

[0010] As described above, the method for cross-scene classification of hyperspectral images utilizes the frequency transformation FT network in the preset training framework, which can achieve domain generalization and enhance feature diversity (i.e., more sufficient feature mining) by transforming the frequency characteristics of the image during the training phase; combined with the reliable constraint strategy constructed by the balanced attention consistency BAC network, the preset cross-scene classification model obtained by training has better scene classification capabilities than the existing technology; that is, the accuracy of cross-scene classification of hyperspectral images is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0012] Figure 1 It is one of the flowcharts of the method for cross-scene classification of hyperspectral images provided by an embodiment of the present invention; Figure 2 is a schematic diagram of the structure of the preset cross-scenario classification model provided in an embodiment of the present invention; Figure 3 is a structural diagram of the balanced attention consistency BAC network provided in an embodiment of the present invention; Figure 4 is a schematic diagram of the structure of the preset training framework provided in an embodiment of the present invention; Figure 5 is a schematic diagram of the structure of a frequency conversion FT network provided by an embodiment of the present invention; Figure 6 This is a second flow chart of a method for cross-scene classification of hyperspectral images provided by an embodiment of the present invention; Figure 7 is a schematic diagram of the structure of a device for cross-scene classification of hyperspectral images provided by an embodiment of the present invention; Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0013] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0014] To solve the above problems in the prior art, the present inventors have proposed, after research, a solution for cross-scene classification of hyperspectral images as described in the following embodiment.

[0015] Example: The following describes the scheme for cross-scene classification of hyperspectral images according to the present invention in conjunction with the accompanying drawings.

[0016] Figure 11 is a flow chart of a method for cross-scene classification of hyperspectral images provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices (eg, servers or cloud computing platforms), such as Figure 1 As shown, the method for cross-scene classification of hyperspectral images includes the following steps: S110: Acquire a target domain image.

[0017] The target domain image is a hyperspectral image of a target area that needs to be classified across scenes. Preferably, the hyperspectral image may be a hyperspectral remote sensing image.

[0018] The target area may be determined or selected according to actual mission requirements, for example, it may be a water area or swamp in a nature reserve.

[0019] The present invention does not limit the acquisition method. For example, an electronic device (eg, a server or a cloud computing platform) as an execution subject may communicate with a server storing the “target domain image” to acquire the “target domain image”.

[0020] S120, inputting the target domain image into a preset cross-scene classification model, and outputting a classification category of the target domain image through the preset cross-scene classification model; that is, Figure 1 Prediction categories shown.

[0021] Among them, the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

[0022] Optionally, the preset training framework may include a balanced attention consistency BAC network and a frequency transform FT network; wherein the frequency transform FT network can generate corresponding extended domain sample images based on the source domain sample images in each set of training data, thereby increasing the feature diversity of model training.

[0023] Among them, the preset cross-scene classification model is mainly determined based on the balanced attention consistency BAC network. The specific details of the model structure and training will be described below and will not be repeated here.

[0024] As described above, the method for cross-scene classification of hyperspectral images utilizes the frequency transformation FT network in the preset training framework, which can achieve domain generalization and enhance feature diversity (i.e., more sufficient feature mining) by transforming the frequency characteristics of the image during the training phase; combined with the reliable constraint strategy constructed by the balanced attention consistency BAC network, the preset cross-scene classification model obtained by training has better scene classification capabilities than the existing technology; that is, the accuracy of cross-scene classification of hyperspectral images is higher.

[0025] exist Figure 1 Based on the embodiment, as an optional implementation method, refer to Figure 2 The preset cross-scenario classification model includes a cascaded feature extractor and classifier (i.e. Figure 2 "classifier side" shown).

[0026] Reference Figure 3 , the feature extractor includes three first convolution blocks cascaded in sequence. Each of the first convolution blocks includes a cascaded first convolution layer and an activation function ReLU layer; the convolution kernel parameter of the first convolution layer is 3×3.

[0027] Reference Figure 3 , the classifier includes a cascaded average pooling layer, a flattening layer and a linear layer.

[0028] exist Figure 1 Based on the embodiment, as an optional implementation method, refer to Figure 4 , the preset training framework includes a balanced attention consistency BAC network (i.e., Figure 4 "BAC module") and the frequency conversion FT network (i.e., Figure 4 "FT Module" shown).

[0029] As an optional example, the balanced attention consistency BAC network includes a first BAC sub-network with the same structure and connected in parallel (ie, Figure 4 As shown, the network branch that receives the source domain samples) and the second BAC sub-network (i.e., Figure 4 As shown, a network branch for receiving extended domain samples). Wherein, the first BAC sub-network includes a cascaded one of the feature extractors to be trained (ie, Figure 4 ” feature extractor” as shown) and 1 activation classification unit, the activation classification unit includes 1 class activation module in parallel (i.e., Figure 4 The "class activation end" shown in the figure) and a classifier to be trained (i.e., Figure 4The "classifier end" shown in the figure); the class activation module includes a 2D convolutional layer; the feature extractor to be trained in the first BAC subnetwork is jump-connected with the feature extractor to be trained in the second BAC subnetwork so that weight sharing between the two can be achieved during the training stage. The structure of the feature extractor to be trained is the same as that of the feature extractor; the structure of the classifier to be trained is the same as that of the classifier. Here, the feature extractor to be trained is mainly used to extract features of samples.

[0030] As an alternative example, refer to Figure 5 , the frequency transform FT network comprises a cascade of Fourier transform layers (i.e., Figure 5 The second convolution block includes a cascaded 2D convolution layer, a normalization layer, and an activation function ReLU layer; the pooling block includes a parallel 3D average pooling layer and a 3D maximum pooling layer; the third convolution block includes a cascaded 2D convolution layer and an activation function Sigmoid layer; the output end of the second convolution block is jump-connected to the point-to-point product layer.

[0031] As an alternative example, continue to refer to Figure 4 as well as Figure 5 , the input end of the feature extractor to be trained in the first BAC sub-network is used to receive the source domain sample image; the input end of the Fourier transform layer is used to receive the source domain sample image, and the output end of the inverse Fourier transform layer is connected to the input end of the feature extractor to be trained in the second BAC sub-network. The input end of the feature extractor to be trained in the second BAC sub-network is used to receive the "extended domain sample" output by the inverse Fourier transform layer.

[0032] The working principle of the frequency conversion FT network is summarized as follows: During the training phase, the frequency transform FT network generates extended domain samples with richer features by changing the frequency characteristics corresponding to the source domain samples. The specific steps are: Given a source domain (SD) sample , where C, H and W represent the number of channels, height and width of the source domain samples respectively. The formula for FT operation is as follows:

[0033] in represents the extended domain (ED) samples obtained by FT. Specifically, to obtain the frequency The first step is to apply a two-dimensional Fast Fourier Transform. Mathematically this transform is expressed as:

[0034] Above The real and imaginary parts after FFT (each channel has C) are concatenated to obtain 2C channels. In addition, due to the conjugate symmetry of FFT, Only half of the spatial dimensions need to be preserved. Expressed as frequency characteristics. The elements at different spatial positions in represent SD samples This can be seen as the different frequency components of More importantly, we can learn the attention map by designing a spatial attention module. Inspired by the design of the attention architecture, we Two-dimensional convolution (Conv2D) with a kernel size of 1×1, batch normalization (BN), and ReLU activation were performed to capture global frequency characteristics. After implementation, we use 3D average pooling (AvgPool3D) and 3D maximum pooling (MaxPool3D), both with a kernel size of 2C×1×1, to aggregate the channels Information, generating two frequency self-fusion graphs, represented as and . Then and Connected together, a Conv2D with a convolution kernel size of 7×7 and a sigmoid function are used to learn a dynamic frequency attention map. Mathematically, this process can be expressed as:

[0035] in, Represents the sigmoid function; Figure 2 shows a two-dimensional convolution with a kernel size of 7×7. and denote the average and maximum pooling operations respectively. Subsequently, we use the dynamic frequency attention map Local frequency characteristics Perform element-to-element multiplication to retain the frequency components suitable for DG. The formula is:

[0036] in, Represents the multiplication between elements; is the frequency characteristic after transformation.

[0037] Finally, we transform the frequency characteristics through inverse fast Fourier transform (iFFT) Transformed to the original feature space, in short, the formula is:

[0038] As mentioned above, Figure 5 The frequency transform FT network shown in the figure processes the source domain samples to obtain the basic process of the extended domain samples.

[0039] Below Figure 4 The implementation method of "obtaining the prediction probability through the classifier side and obtaining the class activation map through the class activation side" is summarized as follows: The features of SD samples and ED samples are passed through the classifier end (i.e., the "classifier to be trained") Get the predicted probability, It consists of an average pooling operation and a linear classifier, and is mainly used for classification tasks. The features of SD samples and ED samples are also passed through the class activation end (i.e., the "class activation module") Get the class activation atlas CAM, Focuses on obtaining CAM from a given feature. Given a sample , the CAM set can be determined using the following calculation formula:

[0040] in, represents the class activation atlas CAM, N represents the number of categories, s represents the number of spatial locations of features, represents the function of the feature extractor, represents the weight of the classifier linear layer, Represents a softmax operation with a temperature parameter T.

[0041] Specifically, The calculation formula is:

[0042] The value of parameter T can be 1.

[0043] Based on the above embodiment, as an optional implementation mode, refer to Figure 6 , based on the preset training framework, the training steps of obtaining the preset cross-scenario classification model include: S610: Obtain the at least one set of training data.

[0044] Wherein, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value; the label value can be obtained by manual annotation.

[0045] S620, input the source domain sample images in each group of training data into the first BAC sub-network, and input the source domain sample images in each group of training data into the second BAC sub-network after being processed by the frequency transform FT network, and output the first prediction probability and the first type of activation atlas through the first BAC sub-network, and output the second prediction probability and the second type of activation atlas through the second BAC sub-network.

[0046] S630. Using a preset comprehensive loss function, based on the label value in each set of training data and the corresponding first prediction probability, first type activation atlas, second prediction probability and second type activation atlas, obtain a function value of the comprehensive loss function.

[0047] As an optional example, step S630 may include the following steps: 1) Based on the label value in each set of training data and the corresponding first prediction probability, first type activation atlas, second prediction probability and second type activation atlas, respectively calculate the function value of the cross entropy loss function, the function value of the positive attention consistency loss function and the function value of the negative attention consistency loss function.

[0048] Optionally, calculating a function value of a cross entropy loss function based on the label value in each set of training data and the corresponding first prediction probability and second prediction probability includes: The function value of the cross entropy loss function is calculated by the following calculation formula (1); (1) in, represents a source domain sample image in each set of training data; Indicates the corresponding The extended domain sample image; Indicates the corresponding The label value of represents the first predicted probability; represents the second predicted probability.

[0049] Optionally, based on the label value in each set of training data and the corresponding first type activation atlas and second type activation atlas, calculating the function value of the positive attention consistency loss function includes: The function value of the forward attention consistency loss function is calculated by the following calculation formula (2); (2) in, Represents the first type of activation atlas corresponding to each set of training data; Representing the second type of activation atlas corresponding to each set of training data; Represents the first-class activation atlas of the source domain sample image with label value y; Represents the second type of activation atlas of the extended domain sample image with label value y; represents the JS divergence metric function; Indicates the corresponding The label value of .

[0050] Optionally, based on the first type activation atlas and the second type activation atlas corresponding to each set of training data, calculating the function value of the negative attention consistency loss function includes: The function value of the negative attention consistency loss function is calculated by the following calculation formula (3); (3) in, Represents the sample image according to the source domain The set of top k non-corresponding labels calculated by the confidence score of ; represents the KL divergence metric function; Represents the first-class activation atlas of the source domain sample image with label value n; Represents the second type of activation atlas of the extended domain sample image with label value n; Represents a uniform distribution of activation atlases in spatial locations.

[0051] 2) Using preset weights, weighted fusion is performed on the function value of the cross entropy loss function, the function value of the positive attention consistency loss function, and the function value of the negative attention consistency loss function to obtain the function value of the comprehensive loss function.

[0052] Optionally, the function value of the comprehensive loss function is calculated by the following calculation formulas (4) and (5); (4) (5) in, represents the weight of the forward attention consistency loss function; represents a hyperparameter.

[0053] S640. Based on the function value of the comprehensive loss function, the first BAC subnetwork, the second BAC subnetwork and the frequency transform FT network are trained until the preset training completion conditions are met, and the preset cross-scene classification model is obtained by the feature extractor to be trained and the classifier to be trained in the first BAC subnetwork or the second BAC subnetwork.

[0054] Optionally, step S640 may be implemented by the following steps: First, the function value of the comprehensive loss function is fed back to the first BAC sub-network, the second BAC sub-network and the frequency transformation FT network; secondly, the first BAC sub-network, the second BAC sub-network and the frequency transformation FT network adjust the network parameters of each network layer according to the function value of the comprehensive loss function; finally, iteratively execute the step of obtaining the function value of the comprehensive loss function to the step of adjusting the network parameters of each network layer until the preset training completion condition is met.

[0055] It should be explained that the preset training completion condition may be that the function value of the comprehensive loss function is less than a preset loss threshold; or, the number of training iterations reaches a preset threshold.

[0056] As described above, the method for cross-scene classification of hyperspectral images utilizes the frequency transformation FT network in the preset training framework, which can achieve domain generalization and enhance feature diversity (i.e., more sufficient feature mining) by transforming the frequency characteristics of the image during the training phase; combined with the reliable constraint strategy constructed by the balanced attention consistency BAC network, the preset cross-scene classification model obtained by training has better scene classification capabilities than the existing technology; that is, the accuracy of cross-scene classification of hyperspectral images is higher.

[0057] The following is a description of a device for cross-scene classification of hyperspectral images provided by the present invention. The device for cross-scene classification of hyperspectral images described below and the method for cross-scene classification of hyperspectral images described above can correspond to each other.

[0058] Figure 7 FIG. 1 is a schematic diagram of a device for cross-scene classification of hyperspectral images provided by an exemplary embodiment of the present invention. Figure 7 As shown, an apparatus for cross-scene classification of a hyperspectral image includes: an image acquisition module 710, configured to: acquire a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be cross-scene classified; a classification prediction execution module 720, configured to: input the target domain image into a preset cross-scene classification model, and output a classification category of the target domain image through the preset cross-scene classification model; wherein the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

[0059] Figure 8 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 8As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute a method for cross-scene classification of a hyperspectral image, the method comprising: obtaining a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be cross-scene classified; inputting the target domain image into a preset cross-scene classification model, and outputting a classification category of the target domain image through the preset cross-scene classification model; wherein the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

[0060] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0061] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method provided by the above-mentioned methods for cross-scene classification of hyperspectral images, the method including: obtaining a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be cross-scene classified; inputting the target domain image into a preset cross-scene classification model, and outputting a classification category for the target domain image through the preset cross-scene classification model; wherein the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

[0062] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the method for cross-scene classification of hyperspectral images provided by the above-mentioned methods, the method comprising: obtaining a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be cross-scene classified; inputting the target domain image into a preset cross-scene classification model, and outputting a classification category for the target domain image through the preset cross-scene classification model; wherein the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

[0063] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0064] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for cross-scene classification of hyperspectral images, characterized in that: include: Acquire a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be classified across scenes; Inputting the target domain image into a preset cross-scene classification model, and outputting a classification category of the target domain image through the preset cross-scene classification model; Among them, the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

2. The method according to claim 1, characterized in that The preset cross-scenario classification model includes a cascaded feature extractor and a classifier; The feature extractor includes three first convolution blocks cascaded in sequence; wherein each of the first convolution blocks includes a cascaded first convolution layer and an activation function ReLU layer; and the convolution kernel parameter of the first convolution layer is 3×3; The classifier includes a cascade of average pooling layers, flattening layers, and linear layers.

3. The method according to claim 2, characterized in that The preset training framework includes a balanced attention consistency BAC network and a frequency transformation FT network; The balanced attention consistency BAC network includes a first BAC sub-network and a second BAC sub-network with the same structure and connected in parallel; The first BAC sub-network includes a cascaded feature extractor to be trained and an activated classification unit, the activated classification unit includes a class activation module and a classifier to be trained in parallel; the class activation module includes a 2-dimensional convolutional layer; the feature extractor to be trained in the first BAC sub-network is jump-connected with the feature extractor to be trained in the second BAC sub-network so that weight sharing between the two is achieved during the training stage; The structure of the feature extractor to be trained is the same as that of the feature extractor; the structure of the classifier to be trained is the same as that of the classifier; The frequency transform FT network includes a cascaded Fourier transform layer, a second convolution block, a pooling block, a channel splicing layer, a third convolution block, a point-to-point product layer, and an inverse Fourier transform layer; Among them, the second convolution block includes a cascaded 2D convolution layer, a normalization layer and an activation function ReLU layer; the pooling block includes a parallel 3D average pooling layer and a 3D maximum pooling layer; the third convolution block includes a cascaded 2D convolution layer and an activation function Sigmoid layer; the output end of the second convolution block is jump-connected to the point-to-point product layer; An input end of the feature extractor to be trained in the first BAC sub-network is used to receive the source domain sample image; The input end of the Fourier transform layer is used to receive the source domain sample image, and the output end of the inverse Fourier transform layer is connected to the input end of the feature extractor to be trained in the second BAC sub-network.

4. The method according to claim 3, characterized in that Based on the preset training framework, the training steps of obtaining the preset cross-scenario classification model include: Acquiring the at least one set of training data; Input the source domain sample images in each set of training data into the first BAC sub-network, and input the source domain sample images in each set of training data into the second BAC sub-network after being processed by the frequency transform FT network, and output the first prediction probability and the first type of activation atlas through the first BAC sub-network, and output the second prediction probability and the second type of activation atlas through the second BAC sub-network; Using a preset comprehensive loss function, based on the label value in each set of training data and the corresponding first prediction probability, first type activation atlas, second prediction probability and second type activation atlas, obtaining a function value of the comprehensive loss function; Based on the function value of the comprehensive loss function, the first BAC subnetwork, the second BAC subnetwork and the frequency transform FT network are trained until the preset training completion conditions are met, and the preset cross-scene classification model is obtained by the feature extractor to be trained and the classifier to be trained in the first BAC subnetwork or the second BAC subnetwork.

5. The method according to claim 4, characterized in that Using a preset comprehensive loss function, based on the label value in each set of training data and the corresponding first prediction probability, first class activation atlas, second prediction probability, and second class activation atlas, obtaining a function value of the comprehensive loss function, including: Based on the label value in each set of training data and the corresponding first predicted probability, first type activation atlas, second predicted probability and second type activation atlas, respectively calculate the function value of the cross entropy loss function, the function value of the positive attention consistency loss function and the function value of the negative attention consistency loss function; Using preset weights, the function value of the cross entropy loss function, the function value of the positive attention consistency loss function, and the function value of the negative attention consistency loss function are weightedly fused to obtain the function value of the comprehensive loss function.

6. The method according to claim 5, characterized in that Calculating a function value of a cross entropy loss function based on the label value in each set of training data and the corresponding first prediction probability and second prediction probability includes: The function value of the cross entropy loss function is calculated by the following calculation formula (1); (1) in, represents a source domain sample image in each set of training data; Indicates the corresponding The extended domain sample image; Indicates the corresponding The label value of represents the first predicted probability; represents the second predicted probability; Based on the label values ​​in each set of training data and the corresponding first-category activation atlas and second-category activation atlas, a function value of a positive attention consistency loss function is calculated, including: The function value of the forward attention consistency loss function is calculated by the following calculation formula (2); (2) in, Represents the first type of activation atlas corresponding to each set of training data; Representing the second type of activation atlas corresponding to each set of training data; Represents the first-class activation atlas of the source domain sample image with label value y; Represents the second type of activation atlas of the extended domain sample image with label value y; represents the JS divergence metric function; Indicates the corresponding The label value of Based on the first type activation atlas and the second type activation atlas corresponding to each set of training data, calculating the function value of the negative attention consistency loss function, including: The function value of the negative attention consistency loss function is calculated by the following calculation formula (3); (3) in, Represents the sample image according to the source domain The set of top k non-corresponding labels calculated by the confidence score of ; represents the KL divergence metric function; Represents the first-class activation atlas of the source domain sample image with label value n; Represents the second type of activation atlas of the extended domain sample image with label value n; Represents a uniform distribution of activation atlases in spatial locations.

7. The method according to claim 6, characterized in that The method of using preset weights to weightedly fuse the function value of the cross entropy loss function, the function value of the positive attention consistency loss function, and the function value of the negative attention consistency loss function to obtain the function value of the comprehensive loss function includes: The function value of the comprehensive loss function is calculated by the following calculation formulas (4) and (5); (4) (5) in, represents the weight of the forward attention consistency loss function; represents a hyperparameter.

8. The method according to claim 4, characterized in that Based on the function value of the comprehensive loss function, the first BAC sub-network, the second BAC sub-network and the frequency transform FT network are trained until a preset training completion condition is met, including: Passing back the function value of the comprehensive loss function to the first BAC sub-network, the second BAC sub-network and the frequency transformation FT network; The first BAC sub-network, the second BAC sub-network and the frequency transform FT network adjust network parameters of each network layer according to the function value of the comprehensive loss function; Iterate the steps of obtaining the function value of the comprehensive loss function to adjusting the network parameters of each network layer until a preset training completion condition is met.

9. A device for cross-scene classification of hyperspectral images, characterized in that: include: The image acquisition module is configured to: acquire a target domain image; wherein the target domain image is a hyperspectral image of a target area that needs to be classified across scenes; A classification prediction execution module is configured to: input the target domain image into a preset cross-scene classification model, and output a classification category of the target domain image through the preset cross-scene classification model; Among them, the preset cross-scene classification model is trained based on a preset training framework and at least one set of training data, each set of training data in the at least one set of training data includes a source domain sample image and a corresponding label value, and the preset training framework can generate a corresponding extended domain sample image based on the source domain sample image in each set of training data.

10. An electronic device comprising 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 as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Hyperspectral image classification based on twin spectral attention consistency

    CN113420798A

  • Magnetic particle imaging reconstruction method from time-frequency domain signal to two-dimensional image

    CN113628296A

  • Semi-supervised image classification method based on causal reasoning

    CN115131618A

  • Hyperspectral image classification method based on double-path convolution and double attention and storage medium

    CN115272776A

  • Small sample cross-domain hyperspectral image classification method based on comparative learning and subspace

    CN116977744A

Cited By

  • Cross-scene hyperspectral image segmentation method based on style conversion

    CN119399218A

  • Hyperspectral image cross-domain classification method and device suitable for complex ground feature scene

    CN119810516A

  • Hyperspectral image cross-domain classification method and device suitable for complex ground scenes

    CN119810516B