Cross-domain small sample multispectral image classification method, device and computer equipment
Through the combination of the joint convolution module and the dual-image information aggregation module, the problem of insufficient sample labeling and domain offset in multispectral image classification is solved, and more accurate and robust image classification is achieved. By extracting local and global features as well as feature-level and distribution-level attention extraction to generate high-order domain distribution information and improve the classification effect.
Patent Information
- Application Number
- CN202410893269.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-04
AI Technical Summary
There are problems of insufficient sample labeling and domain shift in multispectral image classification. Traditional methods cannot effectively mine global topological information and fully characterize data distribution, resulting in limited classification results.
Using a joint convolution module and a dual-graph information aggregation module, through a combination of local and global feature extraction, the instance graph and feature distribution graph of the source domain and target domain are obtained, feature-level and distribution-level attention extraction is performed, and the maximum mean difference loss is used The function performs domain alignment and generates high-order domain distribution information.
It improves the accuracy and robustness of multispectral image classification, can more fully characterize and aggregate data distribution within the domain, reduces the impact of domain offset, and improves classification performance.
Smart Images

Figure CN118411577B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of multispectral image classification, and in particular to a cross-domain small sample multispectral image classification method, device and computer equipment. Background Art
[0002] Hyperspectral imagers can capture hundreds of continuous narrow imaging bands in the wavelength range of 300-2500 nm and form three-dimensional multispectral images (multispectral) containing rich spectral and spatial information. Since different substances have different absorption / reflection characteristics for electromagnetic waves of different wavelengths, the presented spectral curves can be used to identify the type of land cover at the pixel level, which is the multispectral image classification technology. At present, multispectral classification has been proven to be an indispensable key technology in the field of multispectral remote sensing, and has been widely used in environmental monitoring, geological exploration, agricultural assessment and other fields.
[0003] However, while multispectral remote sensing images bring more application possibilities to the field of land object classification, they also derive many new technical problems and challenges. Due to the limitations of factors such as cost and resources, the lack of sample labels has gradually become the main problem facing multispectral image classification. In recent years, methods based on meta-learning combined with domain adaptation have been proposed and gradually applied to multispectral classification tasks. They extract transferable knowledge from the source domain with rich labeled samples, transfer the model trained in the source domain to the target domain, and classify it with a small number of labeled samples in the target domain. However, there are still two main problems: 1) A large amount of distinguishable local feature information is ignored in the feature extraction process; 2) The domain shift problem caused by the inconsistency of the distribution of the source domain and the target domain seriously affects the classification effect.
[0004] In order to solve the above problems, many methods have been proposed. Although these methods have achieved promising experimental results, they are all based on the local spatial information extracted by the traditional local convolutional subnetwork (CNN) to characterize and align the data feature distribution of the source domain and the target domain. Due to its inherent characteristics, there are still two urgent problems that need to be solved. First, the traditional convolution method is limited by local convolution and cannot construct effective long-range topological relationships for global targets. Therefore, it is impossible to mine more sufficient spatial topological information, resulting in limited feature representation capabilities. Secondly, most meta-learning methods based on graph networks mine distribution information by instance-level relationship modeling of samples. The main research focuses on pairwise relationships such as node labels or edge labels, while ignoring a large number of substantial distribution relationships, which leads to insufficient representation of data distribution. Summary of the invention
[0005] Based on this, it is necessary to provide a cross-domain small sample multispectral image classification method, device and computer equipment to address the above technical problems.
[0006] A cross-domain small sample multispectral image classification method, the method comprising:
[0007] Obtain source domain samples and target domain samples; the source domain samples and the target domain samples are superpixel images of corresponding multispectral images; the source domain samples and the target domain samples are respectively marked by category labels of corresponding multispectral images;
[0008] Constructing a multispectral image classification model; the multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module; the joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork;
[0009] The local feature extraction is performed on the superpixel center node of the input sample by the joint convolution module to obtain the local feature, the global feature extraction is performed according to the neighborhood of the superpixel center node to obtain the global feature, and the local feature and the global feature are weightedly combined to obtain the joint convolution feature; the input sample includes a source domain sample or a target domain sample;
[0010] The dual-image information aggregation module is used to obtain instance images of source domain samples and target domain samples and corresponding feature distribution images, and feature-level attention extraction is performed based on the instance images of source domain samples and target domain samples to obtain an attention feature image of the source domain samples, distribution-level attention extraction is performed based on the feature distribution images of the source domain samples and target domain samples to obtain an attention feature image of the target domain samples, and domain alignment is performed based on the attention feature image of the source domain samples and the attention feature image of the target domain samples; the instance image is obtained through the joint convolution features of the target pixel and the center node of the neighborhood superpixel in the input sample;
[0011] The multispectral image classification model is trained according to a pre-constructed loss function, the source domain samples, and the target domain samples to obtain a trained multispectral image classification model;
[0012] The superpixel image of the multispectral image to be classified is input into a trained multispectral image classification model to obtain a classification result corresponding to the multispectral image to be classified.
[0013] In one embodiment, the method further includes: weighted combination of the local features and the global features to obtain a joint convolution feature of the input sample:
[0014] ;
[0015] in, For the The joint convolutional features of the superpixel center nodes, represents a vector whose values are all 1, represents the inner product of elements, is a learnable attention weight parameter, , For the The local features of the superpixel center node, They represent the convolution region. Line List, represents the convolution kernel, represents the convolution kernel size, Indicates The global features of the superpixel center node, , represents the learnable weight parameter, is a nonlinear activation function, Represents a superpixel map Node Pair The aggregate weight of the node, For Node neighbor nodes.
[0016] In one of the embodiments, it also includes: constructing an instance graph based on the joint convolution features of each superpixel center node in the input sample; initializing the node features of the corresponding feature distribution graph based on the similarity between the nodes of the instance graph; aggregating the edge features of the feature distribution graph and the node features of the instance graph, and updating the node features of the instance graph based on the aggregated features.
[0017] In one embodiment, the method further includes: performing feature-level attention extraction based on the instance graphs of the source domain sample and the target domain sample, and obtaining an attention feature graph of the source domain sample as follows:
[0018] ;
[0019] in, is the attention feature map of the source domain sample, is the instance graph node of the source domain sample, is a multi-layer perceptron, It is the feature-level attention representation of the source domain to the target domain.
[0020] In one of the embodiments, it also includes: the source domain samples and the target domain samples belong to a small sample scenario training set respectively; the small sample scenario training set includes small sample tasks of multiple categories and each category has multiple samples; each small sample learning task is represented by a support set and a query set.
[0021] In one embodiment, the loss function is:
[0022] ;
[0023] in, is the loss function of the multispectral image classification model, and represents the loss function weight, It is the loss function of the dual-graph information aggregation module.
[0024] In one of the embodiments, it also includes: performing linear iterative clustering superpixel division on the source domain multispectral image and the target domain multispectral image respectively to obtain a plurality of superpixel center nodes corresponding to each of them, and connecting adjacent superpixel center nodes to obtain a corresponding superpixel map.
[0025] A cross-domain small sample multispectral image classification device, the device comprising:
[0026] A sample acquisition module, used to acquire source domain samples and target domain samples; the source domain samples and the target domain samples are superpixel images corresponding to the multispectral image respectively; the source domain samples and the target domain samples are respectively marked by the category labels corresponding to the multispectral image;
[0027] A model building module, used to build a multispectral image classification model; the multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module; the joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork;
[0028] A feature extraction module, configured to extract local features from the superpixel center node of the input sample through the joint convolution module to obtain local features, extract global features from the neighborhood of the superpixel center node to obtain global features, and weightedly combine the local features and the global features to obtain joint convolution features; the input sample includes a source domain sample or a target domain sample;
[0029] A domain alignment module, used to obtain instance graphs of source domain samples and target domain samples and corresponding feature distribution graphs through the dual-graph information aggregation module, perform feature-level attention extraction based on the instance graphs of the source domain samples and the target domain samples to obtain an attention feature graph of the source domain samples, perform distribution-level attention extraction based on the feature distribution graphs of the source domain samples and the target domain samples to obtain an attention feature graph of the target domain samples, and perform domain alignment based on the attention feature graph of the source domain samples and the attention feature graph of the target domain samples; the instance graph is obtained by the joint convolution features of the target pixel and the center node of the neighborhood superpixel in the input sample;
[0030] A model training module, used to train the multispectral image classification model according to a pre-constructed loss function, the source domain samples and the target domain samples to obtain a trained multispectral image classification model;
[0031] The result output module is used to input the super pixel image of the multispectral image to be classified into the trained multispectral image classification model to obtain the classification result corresponding to the multispectral image to be classified.
[0032] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Obtain source domain samples and target domain samples; the source domain samples and the target domain samples are superpixel images of corresponding multispectral images; the source domain samples and the target domain samples are respectively marked by category labels of corresponding multispectral images;
[0034] Constructing a multispectral image classification model; the multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module; the joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork;
[0035] The local feature extraction is performed on the superpixel center node of the input sample by the joint convolution module to obtain the local feature, the global feature extraction is performed according to the neighborhood of the superpixel center node to obtain the global feature, and the local feature and the global feature are weightedly combined to obtain the joint convolution feature; the input sample includes a source domain sample or a target domain sample;
[0036] The dual-image information aggregation module is used to obtain instance images of source domain samples and target domain samples and corresponding feature distribution images, and feature-level attention extraction is performed based on the instance images of source domain samples and target domain samples to obtain an attention feature image of the source domain samples, distribution-level attention extraction is performed based on the feature distribution images of the source domain samples and target domain samples to obtain an attention feature image of the target domain samples, and domain alignment is performed based on the attention feature image of the source domain samples and the attention feature image of the target domain samples; the instance image is obtained through the joint convolution features of the target pixel and the center node of the neighborhood superpixel in the input sample;
[0037] The multispectral image classification model is trained according to a pre-constructed loss function, the source domain samples, and the target domain samples to obtain a trained multispectral image classification model;
[0038] The superpixel image of the multispectral image to be classified is input into a trained multispectral image classification model to obtain a classification result corresponding to the multispectral image to be classified.
[0039] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0040] Obtain source domain samples and target domain samples; the source domain samples and the target domain samples are superpixel images of corresponding multispectral images; the source domain samples and the target domain samples are respectively marked by category labels of corresponding multispectral images;
[0041] Constructing a multispectral image classification model; the multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module; the joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork;
[0042] The local feature extraction is performed on the superpixel center node of the input sample by the joint convolution module to obtain the local feature, the global feature extraction is performed according to the neighborhood of the superpixel center node to obtain the global feature, and the local feature and the global feature are weightedly combined to obtain the joint convolution feature; the input sample includes a source domain sample or a target domain sample;
[0043] The dual-image information aggregation module is used to obtain instance images of source domain samples and target domain samples and corresponding feature distribution images, and feature-level attention extraction is performed based on the instance images of source domain samples and target domain samples to obtain an attention feature image of the source domain samples, distribution-level attention extraction is performed based on the feature distribution images of the source domain samples and target domain samples to obtain an attention feature image of the target domain samples, and domain alignment is performed based on the attention feature image of the source domain samples and the attention feature image of the target domain samples; the instance image is obtained through the joint convolution features of the target pixel and the center node of the neighborhood superpixel in the input sample;
[0044] The multispectral image classification model is trained according to a pre-constructed loss function, the source domain samples, and the target domain samples to obtain a trained multispectral image classification model;
[0045] The superpixel image of the multispectral image to be classified is input into a trained multispectral image classification model to obtain a classification result corresponding to the multispectral image to be classified.
[0046] The above-mentioned cross-domain small sample multispectral image classification method, device and computer equipment, by constructing a superpixel map of the multispectral image, is conducive to characterizing local and non-local neighborhood spatial information, extracting local features from the superpixel center node of the input sample through a joint convolution module to obtain local features, extracting global features according to the neighborhood of the superpixel center node to obtain global features, and weighted combination of local features and global features to obtain joint convolution features, which can mine local and non-local neighborhood information of the target, obtain instance maps of source domain samples and target domain samples and corresponding feature distribution maps through a dual-image information aggregation module, and extracting feature-level attention according to the instance maps of the source domain samples and the target domain samples to obtain the attention feature map of the source domain samples, extracting distribution-level attention according to the feature distribution maps of the source domain samples and the target domain samples to obtain the attention feature map of the target domain samples, and performing domain alignment according to the attention feature maps of the source domain samples and the attention feature maps of the target domain samples, characterizing and aggregating the data distribution in the domain from both the feature level and the distribution level, and generating high-order domain distribution information for realizing domain alignment. The embodiment of the present invention can improve the accuracy and robustness of multispectral image classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 Schematic diagram of a process of a cross-domain small sample multispectral image classification method in one embodiment;
[0048] Figure 2 A schematic diagram of the structure of a multispectral image classification model in one embodiment;
[0049] Figure 3 Schematic diagram of the structure of a joint convolution module in one embodiment;
[0050] Figure 4 A schematic diagram of the structure of a dual-image information aggregation module in one embodiment;
[0051] Figure 5 1 is a diagram showing a comparison of experimental results of a University of Pavia (UP) data set in one embodiment, wherein (a) is a GT experimental result, (b) is a SVM experimental result, (c) is a 3D-CNN experimental result, (d) is a SpectralFormer experimental result, (e) is a DCFSL experimental result, (f) is a CA-CFSL experimental result, (g) is a Gia-CFSL experimental result, and (h) is an experimental result of the method of the present invention;
[0052] Figure 61 is a graph showing the experimental comparison results of the Indian Pines (IP) dataset in one embodiment, wherein (a) is the GT experimental result, (b) is the SVM experimental result, (c) is the 3D-CNN experimental result, (d) is the SpectralFormer experimental result, (e) is the DCFSL experimental result, (f) is the CA-CFSL experimental result, (g) is the Gia-CFSL experimental result, and (h) is the experimental result of the method of the present invention;
[0053] Figure 7 1 is a graph showing a comparison of experimental results of the Salinas dataset in one embodiment, wherein (a) is the GT experimental result, (b) is the SVM experimental result, (c) is the 3D-CNN experimental result, (d) is the SpectralFormer experimental result, (e) is the DCFSL experimental result, (f) is the CA-CFSL experimental result, (g) is the Gia-CFSL experimental result, and (h) is the experimental result of the method of the present invention;
[0054] Figure 8 is a structural block diagram of a cross-domain small sample multispectral image classification device in one embodiment;
[0055] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] In one embodiment, Figure 1 As shown, a cross-domain small sample multispectral image classification method is provided, comprising the following steps:
[0058] Step 102: Acquire source domain samples and target domain samples.
[0059] The source domain samples and the target domain samples are superpixel images of the corresponding multispectral images, and the source domain samples and the target domain samples are labeled by the category labels of the corresponding multispectral images.
[0060] Constructing a composite neighborhood by building a superpixel map of a multispectral image is beneficial for extracting local and non-local neighborhood spatial information of the multispectral image.
[0061] Step 104: construct a multispectral image classification model.
[0062] The multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module. The joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork. Figure 2 The structural schematic diagram of the multispectral image classification model shown in the figure uses the node remote topological relationship and the local receptive field to construct a graph convolution subnetwork and a local convolution subnetwork, that is, to construct a joint convolution method, to perform linear convolution on the local neighborhood and obtain the mean. At the same time, the attention mechanism is applied to the central node for graph convolution on the non-local neighborhood image, and the convolution results are combined to extract the final image spectral-spatial features; the feature relationship is modeled at multiple levels from the feature level and the distribution level, and a dual-graph information aggregation module is constructed. The domain shift loss is calculated using the maximum mean difference loss function, that is, the image features are represented using the dual-graph information aggregation module, and the instance-level graph and the distribution-level graph are constructed. The distribution-level relationship of the target is initialized and the instance-level relationship is refined, and a high-order attention to the intra-domain data distribution of the source domain and the target domain is generated.
[0063] Step 106, extract local features from the superpixel center node of the input sample through a joint convolution module to obtain local features, extract global features based on the neighborhood of the superpixel center node to obtain global features, and weightedly combine the local features and the global features to obtain joint convolution features.
[0064] Input samples include source domain samples or target domain samples. Figure 3 The structural diagram of the joint convolution module shown in FIG. 1 combines the convolutional neural network (CNN) and the graph convolutional network (GCN) to extract image features in the Euclidean neighborhood and the non-Euclidean neighborhood. Taking the source domain as an example, the specific process includes:
[0065] The input and output of the joint convolution module are respectively recorded as ( )and( ). During the CNN convolution process, the convolution kernel is element-wise multiplied and summed with the local neighborhood to aggregate the information of surrounding pixels to the central node. Its basic paradigm is:
[0066] ;
[0067] in, They represent the convolution region. Line List, represents the convolution kernel, Represents the convolution kernel size. The general paradigm of GCN is expressed as:
[0068] ;
[0069] in, represents the learnable weight parameter, is a nonlinear activation function, Indicates the constructed graph Node Pair The aggregation weight of the node. The weighted combination of the two convolution modules gives the final data feature, i.e. the joint convolution feature:
[0070] ;
[0071] in, Represents a vector whose values are all 1, operator represents the inner product of elements, is a learnable attention weight parameter.
[0072] Step 108, obtain the instance graphs of the source domain samples and the target domain samples and the corresponding feature distribution graphs through the dual-graph information aggregation module, perform feature-level attention extraction based on the instance graphs of the source domain samples and the target domain samples to obtain the attention feature graph of the source domain samples, perform distribution-level attention extraction based on the feature distribution graphs of the source domain samples and the target domain samples to obtain the attention feature graph of the target domain samples, and perform domain alignment based on the attention feature graphs of the source domain samples and the attention feature graphs of the target domain samples.
[0073] The instance graph is obtained by joint convolution features of each superpixel center node in the input sample. The instance graph is constructed using the features extracted by the joint convolution module. , to generate a feature distribution map ,in, represents the source domain, Represent the target domain, capture the inter-domain distribution similarity and learn the inter-domain data distribution difference by generating high-order attention of the intra-domain data distribution of the source domain and the target domain, and use the maximum mean difference loss function to achieve domain alignment. The specific process includes:
[0074] Use the similarity between instance-level graph nodes to initialize the node features of the feature distribution graph:
[0075] ;
[0076] in, Indicates the cascade symbol, Represents the aggregation network, which consists of a fully connected layer and Relu. 0 represents the initialization node, and 1 represents the node after information propagation. and instance-level graph node features Initialization to update instance-level graph node features:
[0077] ;
[0078] in, is the instance graph of the source domain sample The node characteristics of the node, represents the aggregation network, which consists of two layers of Conv2d-BN-ReLu. is the edge feature of the feature distribution graph, It is an example diagram The node characteristics of the node, It is an example diagram Node characteristics of the node.
[0079] like Figure 4 The schematic diagram of the structure of the dual-image information aggregation module shown in the figure shows that in the feature-level attention map generation stage, the feature-level attention representation of the source domain to the target domain is obtained:
[0080] ;
[0081] in, represents the softmax function, is a learnable weight. By introducing the residual structure, we finally get the attention information output of the source domain, that is, the attention feature map of the source domain sample:
[0082] ;
[0083] The distributed attention generation process corresponding to the target domain corresponds to the above process. The attention feature map of the target domain sample is: .
[0084] Step 110 , training the multispectral image classification model according to the pre-constructed loss function, source domain samples, and target domain samples to obtain a trained multispectral image classification model.
[0085] The present invention constructs meta-learning tasks based on superpixel graphs. Specifically, a small sample scenario training set is constructed. Supported by and queryset It represents a small sample task with C categories and K samples in each category.
[0086] When constructing the loss function, the cross entropy classification loss is calculated based on the metric-based small sample learning. The specific process is:
[0087] For the target features output by the joint convolution module, the cross entropy loss is calculated with the input query set sample labels as the loss function to guide network training:
[0088] ;
[0089] in, represents the joint convolution function, represents a query set sample, represents the sample label of category c, Represents the category label of the sample. The maximum mean difference (MMD) is used as the loss function to align the data distribution of the source domain and the target domain:
[0090] ;
[0091] in, .
[0092] The query set features and support set features extracted by the joint convolution module are measured by Euclidean distance, and the measurement result and the query set label are used to obtain the cross entropy loss. Finally, the cross entropy loss and the maximum mean difference are summed as the final loss function to update the network parameter weights:
[0093] ;
[0094] in, and Represents the loss function weight.
[0095] Step 112: input the superpixel image of the multispectral image to be classified into the trained multispectral image classification model to obtain a classification result corresponding to the multispectral image to be classified.
[0096] When classifying objects, accurate object classification results can be obtained by inputting the superpixel map of the multispectral remote sensing image to be classified that is acquired in real time into the trained multispectral image classification model.
[0097] In the above cross-domain small sample multispectral image classification method, by constructing a superpixel map of the multispectral image, it is beneficial to characterize local and non-local neighborhood spatial information, extract local features from the superpixel center node of the input sample through a joint convolution module to obtain local features, extract global features according to the neighborhood of the superpixel center node to obtain global features, and obtain joint convolution features by weighted combination of local features and global features, which can mine local and non-local neighborhood information of the target, obtain instance maps of source domain samples and target domain samples and corresponding feature distribution maps through a dual-image information aggregation module, and perform feature-level attention extraction according to the instance maps of the source domain samples and the target domain samples to obtain the attention feature map of the source domain samples, perform distribution-level attention extraction according to the feature distribution maps of the source domain samples and the target domain samples to obtain the attention feature map of the target domain samples, perform domain alignment according to the attention feature maps of the source domain samples and the attention feature maps of the target domain samples, characterize and aggregate the data distribution in the domain from both the feature level and the distribution level, and generate high-order domain distribution information for realizing domain alignment. The embodiment of the present invention can improve the accuracy and robustness of multispectral image classification.
[0098] In one embodiment, weighted combination of local features and global features to obtain joint convolution features of input samples includes: weighted combination of local features and global features to obtain joint convolution features of input samples:
[0099] ;
[0100] in, For the The joint convolutional features of the superpixel center nodes, represents a vector whose values are all 1, represents the inner product of elements, is a learnable attention weight parameter, , For the The local features of the superpixel center node, They represent the convolution region. Line List, represents the convolution kernel, represents the convolution kernel size, Indicates The global features of the superpixel center nodes, , represents the learnable weight parameter, is a nonlinear activation function, Represents a superpixel map Node Pair The aggregate weight of the node, For Node neighbor nodes.
[0101] In one embodiment, the step of obtaining an instance graph and a corresponding feature distribution graph includes: constructing an instance graph based on the joint convolution features of each superpixel center node in the input sample; initializing the node features of the corresponding feature distribution graph based on the similarity between the nodes of the instance graph; aggregating the edge features of the feature distribution graph and the node features of the instance graph, and updating the node features of the instance graph based on the aggregated features.
[0102] In one embodiment, the step of performing feature-level attention extraction based on the instance graphs of the source domain sample and the target domain sample to obtain the attention feature graph of the source domain sample includes: performing feature-level attention extraction based on the instance graphs of the source domain sample and the target domain sample to obtain the attention feature graph of the source domain sample as follows:
[0103] ;
[0104] in, is the attention feature map of the source domain sample, is the instance graph node of the source domain sample, is a multi-layer perceptron, It is the feature-level attention representation of the source domain to the target domain.
[0105] In one embodiment, the method also includes: the source domain samples and the target domain samples belong to a small sample scenario training set respectively; the small sample scenario training set includes a small sample task with multiple categories and each category has multiple samples; each small sample learning task is represented by a support set and a query set.
[0106] In one embodiment, the loss function is:
[0107] ;
[0108] in, is the loss function of the multispectral image classification model, and represents the loss function weight, It is the loss function of the dual-graph information aggregation module.
[0109] In one embodiment, the step of obtaining source domain samples and target domain samples includes: performing linear iterative clustering superpixel division on the source domain multispectral image and the target domain multispectral image respectively to obtain a plurality of superpixel center nodes corresponding to each of them, and connecting adjacent superpixel center nodes to obtain a corresponding superpixel map.
[0110] In a specific embodiment, all experiments in the present invention are conducted on a desktop computer equipped with an Intel Core i7-9700K CPU, 3.6 GHz, 24GB memory and Nvidia GeForce RTX 3090. In addition, considering that the FSL setting generally requires that the number of categories in the source domain data should be as large as possible as the number of categories in the target domain data, the Chikusei dataset with more ground object categories is selected as the source scene, and the University of Pavia (UP), the Indian Pines (IP), the Salinas are selected as target scenes to verify the effectiveness of the method of the present invention. TGP-CFSL is implemented under the PyTorch framework. The feature extraction module consists of N = 3 CoConv blocks. The composite neighbors of each target contain pixel-level neighbors and superpixel neighbors, i.e. and The average size of superpixels in Simple Linear Iterative Clustering (SLIC) is set to In the training phase, the standard Adam optimizer is used to train the CNCMN with a learning rate of , the batch size is , the number of training iterations is 10 rounds of 10,000 iterations. In addition, for each meta-task in the few-shot scenario training C-wayK-shot, C is set to the number of categories in TD, for example, in the UP dataset, , K is considered to be a random selection of K labeled samples in each class to form and For a fair comparison, K is set to 1 and the number of samples per class in the query set is set to 19.
[0111] In the experiment, several domain adaptation and FSL-based classification algorithms were used as comparison algorithms, including SVM, 3-DCNN, SpectralFormer, DCFSL, CA-CFSL and Gia-CFSL. All the above methods were reproduced in the experiment and compared with the proposed method. The evaluation parameters of overall accuracy (OA), average accuracy (AA) and kappa coefficient (Kappa) were used to evaluate the classification performance of all models. In addition, in order to verify the robustness of the experiment, the average index after ten runs was used as the final result of the model test.
[0112] Table 1, Table 2 and Table 3 report the classification performance of the comparison algorithms on three test datasets. Figure 5-Figure 7 The ground truth and classification maps for four testing datasets are shown, where the classification map is retained as the best result among ten experiments.
[0113] Table 1 Classification results of different methods on IP dataset (%)
[0114]
[0115] Table 2 Classification results of different methods on UP dataset (%)
[0116]
[0117] Table 3 Classification results of different methods on the Salinas dataset (%)
[0118]
[0119] From the experimental results, the following conclusions can be drawn by comparing the results:
[0120] (1) Among the supervised non-FSL (SVM, 3D-CNN and SpectralFormer) methods, the classification accuracy of the Transformer-based method SpectralFormer is lower than that of the machine learning method SVM and the method based on deep learning network training on all three datasets. The analysis found that due to their large number of parameters and dependence on large datasets, Transformer-based models are prone to overfitting and insufficient generalization ability in small sample learning scenarios.
[0121] (2) Compared with the SVM, 3D-CNN, and SpectralFormer methods that are trained with only a small amount of target domain samples, the DCFSL, Gia-CFSL, and CA-CFSL methods have 5-11% higher classification accuracy on the three datasets. This is because the latter methods add different domain adaptation techniques, which improve the classification performance to a certain extent by reducing the impact of domain shift.
[0122] (3) Compared with the same type of multispectral FSL cross-domain classification method, the proposed TGP-CFSL method has better classification performance on the three datasets. Due to the introduction of the topological structure between samples as the input of the network, CG-Conv can adaptively extract useful information from different levels of neighbors without being disturbed by irrelevant ones, so that it can better model different land covers with complex structures, thereby producing excellent and stable classification results on various multispectral datasets. In addition, the graph structure information is further utilized in DGIP to align the domain distribution from both the feature level and the distribution level, so that the similarity between domains can be more fully perceived to reduce cross-domain differences.
[0123] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0124] In one embodiment, Figure 8 As shown, a cross-domain small sample multispectral image classification device is provided, comprising:
[0125] The sample acquisition module 802 is used to acquire source domain samples and target domain samples; the source domain samples and the target domain samples are superpixel images corresponding to the multispectral image respectively; the source domain samples and the target domain samples are respectively labeled by the category labels corresponding to the multispectral image;
[0126] A model building module 804 is used to build a multispectral image classification model; the multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module; the joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork;
[0127] The feature extraction module 806 is used to extract local features from the superpixel center node of the input sample through the joint convolution module to obtain local features, extract global features according to the neighborhood of the superpixel center node to obtain global features, and weightedly combine the local features and the global features to obtain joint convolution features; the input sample includes a source domain sample or a target domain sample;
[0128] The domain alignment module 808 is used to obtain the instance graphs of the source domain samples and the target domain samples and the corresponding feature distribution graphs through the dual-graph information aggregation module, and perform feature-level attention extraction based on the instance graphs of the source domain samples and the target domain samples to obtain the attention feature graph of the source domain samples, perform distribution-level attention extraction based on the feature distribution graphs of the source domain samples and the target domain samples to obtain the attention feature graph of the target domain samples, and perform domain alignment based on the attention feature graphs of the source domain samples and the attention feature graphs of the target domain samples; the instance graph is obtained by the joint convolution feature of each superpixel center node in the input sample;
[0129] A model training module 810 is used to train the multispectral image classification model according to a pre-constructed loss function, source domain samples, and target domain samples to obtain a trained multispectral image classification model;
[0130] The result output module 812 is used to input the super-pixel image of the multispectral image to be classified into the trained multispectral image classification model to obtain the classification result corresponding to the multispectral image to be classified.
[0131] In one embodiment, it is also used to weightedly combine local features and global features to obtain the joint convolution feature of the input sample:
[0132] ;
[0133] in, For the The joint convolutional features of the superpixel center nodes, represents a vector whose values are all 1, represents the inner product of elements, is a learnable attention weight parameter, , For the The local features of the superpixel center node, They represent the convolution region. Line List, represents the convolution kernel, represents the convolution kernel size, Indicates The global features of the superpixel center nodes, , represents the learnable weight parameter, is a nonlinear activation function, Represents a superpixel map Node Pair The aggregate weight of the node, For Node neighbor nodes.
[0134] In one of the embodiments, it is also used to construct an instance graph based on the joint convolution features of each superpixel center node in the input sample; initialize the node features of the corresponding feature distribution graph based on the similarity between the nodes of the instance graph; aggregate the edge features of the feature distribution graph and the node features of the instance graph, and update the node features of the instance graph based on the aggregated features.
[0135] In one of the embodiments, it is also used to perform feature-level attention extraction based on the instance graphs of the source domain sample and the target domain sample, and obtain the attention feature graph of the source domain sample as follows:
[0136] ;
[0137] in, is the attention feature map of the source domain sample, is the instance graph node of the source domain sample, is a multi-layer perceptron, It is the feature-level attention representation of the source domain to the target domain.
[0138] In one of the embodiments, the source domain samples and the target domain samples belong to small sample scenario training sets respectively; the small sample scenario training set includes small sample tasks with multiple categories and each category having multiple samples; each small sample learning task is represented by a support set and a query set.
[0139] In one embodiment, the loss function is:
[0140] ;
[0141] in, is the loss function of the multispectral image classification model, and represents the loss function weight, It is the loss function of the dual-graph information aggregation module.
[0142] In one of the embodiments, it is also used to perform linear iterative clustering superpixel division on the source domain multispectral image and the target domain multispectral image, respectively, to obtain a plurality of superpixel center nodes corresponding to each of them, and to connect adjacent superpixel center nodes to obtain a corresponding superpixel map.
[0143] For the specific definition of the cross-domain small sample multispectral image classification device, please refer to the definition of the cross-domain small sample multispectral image classification method above, which will not be repeated here. Each module in the above-mentioned cross-domain small sample multispectral image classification device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0144] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cross-domain small sample multispectral image classification method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0145] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0146] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.
[0147] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.
[0148] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0149] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0150] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A cross-domain small sample multispectral image classification method, characterized in that: The method comprises: Obtain source domain samples and target domain samples; the source domain samples and the target domain samples are superpixel images of corresponding multispectral images; the source domain samples and the target domain samples are respectively marked by category labels of corresponding multispectral images; Constructing a multispectral image classification model; the multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module; the joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork; The local feature extraction is performed on the superpixel center node of the input sample by the joint convolution module to obtain the local feature, the global feature extraction is performed according to the neighborhood of the superpixel center node to obtain the global feature, and the local feature and the global feature are weightedly combined to obtain the joint convolution feature; the input sample includes a source domain sample or a target domain sample; The dual-image information aggregation module is used to obtain instance images of source domain samples and target domain samples and corresponding feature distribution images, and feature-level attention extraction is performed based on the instance images of source domain samples and target domain samples to obtain an attention feature image of the source domain samples, distribution-level attention extraction is performed based on the feature distribution images of the source domain samples and target domain samples to obtain an attention feature image of the target domain samples, and domain alignment is performed based on the attention feature image of the source domain samples and the attention feature image of the target domain samples; the instance image is obtained through the joint convolution features of the target pixel and the center node of the neighborhood superpixel in the input sample; The multispectral image classification model is trained according to a pre-constructed loss function, the source domain samples, and the target domain samples to obtain a trained multispectral image classification model; Inputting the superpixel image of the multispectral image to be classified into a trained multispectral image classification model to obtain a classification result corresponding to the multispectral image to be classified; The weighted combination of the local features and the global features to obtain the joint convolution features of the input samples includes: The local features and the global features are weighted together to obtain the joint convolutional features of the input samples: ; in, For the The joint convolutional features of the superpixel center nodes, represents a vector whose values are all 1, represents the inner product of elements, is a learnable attention weight parameter, , For the The local features of the superpixel center node, They represent the convolution region. Line List, represents the convolution kernel, represents the convolution kernel size, Indicates The global features of the superpixel center nodes, , represents the learnable weight parameter, is a nonlinear activation function, Represents a superpixel map Node Pair The aggregate weight of the node, For Node Neighbor nodes of Feature-level attention extraction is performed based on the instance graphs of source domain samples and target domain samples, and the attention feature graph of the source domain samples is obtained, including: Feature-level attention extraction is performed based on the instance graphs of source domain samples and target domain samples, and the attention feature graph of the source domain samples is obtained as follows: ; in, is the attention feature map of the source domain sample, is the instance graph node of the source domain sample, is a multi-layer perceptron, It is the feature-level attention representation of the source domain to the target domain; Distribution-level attention extraction is performed based on the feature distribution maps of source domain samples and target domain samples, and the attention feature maps of target domain samples are obtained, including: According to the feature distribution maps of source domain samples and target domain samples, distribution-level attention extraction is performed, and the attention feature map of the target domain samples is obtained as follows: 。 2. The method according to claim 1, characterized in that: The steps of obtaining the instance graph and the corresponding feature distribution graph include: Constructing an instance graph according to the joint convolution features of each superpixel center node in the input sample; Initialize the node features of the corresponding feature distribution graph according to the similarity between the nodes of the instance graph; Aggregate the edge features of the feature distribution graph and the node features of the instance graph, and update the node features of the instance graph according to the aggregated features.
3. The method according to claim 1, characterized in that The method further comprises: The source domain samples and the target domain samples belong to small sample scenario training sets respectively; the small sample scenario training set includes small sample tasks of multiple categories, each category having multiple samples; each small sample learning task is represented by a support set and a query set.
4. The method according to claim 1, characterized in that: The loss function is: ; in, is the loss function of the multispectral image classification model, and represents the loss function weight, It is the loss function of the dual-graph information aggregation module.
5. The method according to claim 1, characterized in that The step of obtaining source domain samples and target domain samples includes: The source domain multispectral image and the target domain multispectral image are respectively divided into superpixels by linear iterative clustering to obtain multiple superpixel center nodes corresponding to each of them, and the adjacent superpixel center nodes are connected to obtain the corresponding superpixel map.
6. A cross-domain small sample multispectral image classification device, characterized in that: The device comprises: A sample acquisition module, used to acquire source domain samples and target domain samples; the source domain samples and the target domain samples are superpixel images corresponding to the multispectral image respectively; the source domain samples and the target domain samples are respectively marked by the category labels corresponding to the multispectral image; A model building module, used to build a multispectral image classification model; the multispectral image classification model includes a joint convolution module and a dual-graph information aggregation module; the joint convolution module includes a local convolution subnetwork and a graph convolution subnetwork; A feature extraction module, configured to extract local features from the superpixel center node of the input sample through the joint convolution module to obtain local features, extract global features from the neighborhood of the superpixel center node to obtain global features, and weightedly combine the local features and the global features to obtain joint convolution features; the input sample includes a source domain sample or a target domain sample; A domain alignment module, used to obtain instance graphs of source domain samples and target domain samples and corresponding feature distribution graphs through the dual-graph information aggregation module, perform feature-level attention extraction based on the instance graphs of the source domain samples and the target domain samples to obtain an attention feature graph of the source domain samples, perform distribution-level attention extraction based on the feature distribution graphs of the source domain samples and the target domain samples to obtain an attention feature graph of the target domain samples, and perform domain alignment based on the attention feature graph of the source domain samples and the attention feature graph of the target domain samples; the instance graph is obtained by the joint convolution features of the target pixel and the center node of the neighborhood superpixel in the input sample; A model training module, used to train the multispectral image classification model according to a pre-constructed loss function, the source domain samples and the target domain samples to obtain a trained multispectral image classification model; A result output module is used to input the super pixel map of the multispectral image to be classified into a trained multispectral image classification model to obtain a classification result corresponding to the multispectral image to be classified; The feature extraction module is also used to weightedly combine the local features and the global features to obtain the joint convolution feature of the input sample: ; in, For the The joint convolutional features of the superpixel center nodes, represents a vector whose values are all 1, represents the inner product of elements, is a learnable attention weight parameter, , For the The local features of the superpixel center node, They represent the convolution region. Line List, represents the convolution kernel, represents the convolution kernel size, Indicates The global features of the superpixel center nodes, , represents the learnable weight parameter, is a nonlinear activation function, Represents a superpixel map Node Pair The aggregate weight of the node, is the neighbor node of node 𝑖; The domain alignment module is also used to extract feature-level attention based on the instance graphs of source domain samples and target domain samples, and the attention feature graph of the source domain samples is obtained as follows: ; in, is the attention feature map of the source domain sample, is the instance graph node of the source domain sample, is a multi-layer perceptron, It is the feature-level attention representation of the source domain to the target domain; The domain alignment module is also used to perform distribution-level attention extraction based on the feature distribution maps of source domain samples and target domain samples, and the attention feature map of the target domain samples is obtained as follows: 。 7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
