Small sample image classification method based on local independent region screening graph neural network
By constructing a local irrelevant region filtering graph neural network, local features are filtered and aggregated, solving the problem of irrelevant region interference in small sample image classification and achieving higher classification accuracy and prediction effect.
Patent Information
- Application Number
- CN202211093142.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-08
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2042-09-08
AI Technical Summary
In existing few-sample image classification methods based on metric learning, interference information from irrelevant local regions affects classification accuracy, resulting in poor classification performance for few-sample images.
By constructing a graph neural network for filtering local irrelevant regions, local features are filtered and aggregated to reduce the impact of irrelevant regions on classification. A graph neural network model is used for feature updating and training. A graph structure is constructed by combining global and local features, and the model is optimized using a local feature importance loss function.
It improves the accuracy and prediction performance of small sample image classification, reduces the interference of irrelevant region information on classification, and enhances the model's discriminative ability.
Smart Images

Figure CN116310466B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision, and more specifically to a few-sample image classification method based on a graph neural network that filters locally independent regions. Background Technology
[0002] The current mainstream methods for few-shot learning are based on meta-learning, which can be divided into three main types: 1. Model-based methods; 2. Optimization-based methods; and 3. Metric-based methods.
[0003] Model-based methods, building upon traditional deep learning which relies on massive amounts of data for training, design a new model that stores the learned knowledge. When encountering new tasks with limited samples, the model's parameters can be updated using this stored knowledge. However, model-based methods require additional storage space, and the network models are relatively complex, inflexible, and unsuitable for transfer learning, thus exhibiting certain limitations.
[0004] The optimization-based approach modifies the parameter optimization function, allowing the model to quickly adapt to new tasks with only a few gradient descent operations. The goal is to obtain a model that fits new tasks with minimal optimization, addressing the problem of deep learning requiring massive amounts of data for training. In contrast, optimization-based methods require optimization operations on the base learners for each training task, resulting in high computational complexity.
[0005] Metric learning-based methods project input image data into a metric space using a network model, and then determine the probability of class similarity between images by comparing their distances in the metric space. Metric learning-based methods have relatively simple model design, use simple backpropagation for parameter updates, and outperform the previous two methods in small-sample image classification tasks. However, due to the small number of samples in new tasks, the model often cannot extract many effective features. Global features can depict the overall information of an image, and extensive training can teach the model how to distinguish useful information. However, when the number of samples is small, interference from irrelevant information in the global information is unavoidable. In this case, local features, which have strong discriminative power, can achieve better results. Summary of the Invention
[0006] This invention addresses the problem of interference from irrelevant local regions in existing technologies by providing a few-sample image classification method based on a graph neural network that filters out irrelevant local regions. The aim is to solve the technical problem of interference from irrelevant local information in existing metric learning methods, ultimately achieving accurate classification of few-sample images.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] This invention proposes a few-sample image classification method based on a graph neural network that filters locally irrelevant regions, comprising the following steps:
[0009] Step 1: Few-shot task sampling. The dataset for few-shot learning consists of a training set, a support set, and a query set. The training set, used to pre-train the image classifier, contains a large amount of image data; the support and query sets contain image data of new categories different from the training set, and these images are relatively few. Few-shot image classification involves retraining the pre-trained image classifier (trained on the training set) on the support set and validating the classification accuracy on the query set. During the testing phase, the support and query sets can be used directly as the dataset; during the training phase, a large amount of training set image data is collected multiple times according to the distribution of the support and query sets, thus forming multiple sets of few-shot learning tasks for subsequent training.
[0010] Each few-shot learning task will be trained separately, and the entire network model will be optimized through a loss function. The following is a few-shot learning task training process.
[0011] Step 2: Perform random cropping on the support set image and query set image data so that each support set image or query set image obtains multiple local sub-images;
[0012] Step 3: Input the original images (images in the dataset without any other transformations are the original images; cropping results in sub-images) from a dataset of small sample learning tasks (the support set and query set are used together as the dataset) and the corresponding local sub-images of each support set image or query set image extracted in Step 2 into an embedding network to obtain the global and local features of each support set image or query set image. Each support set image or query set image will obtain n local sub-images. Here, all the original images and all the local sub-images are input into the embedding network. The original images are processed by the embedding network to obtain global features, and the local sub-images are processed by the embedding network to obtain local features.
[0013] Step 4: Construct a graph from the global and local features obtained in Step 3 to form a graph structure for subsequent graph neural network training;
[0014] Step 5: Update the graph structure obtained in Step 4 using a local irrelevant region filtering graph neural network model to obtain an updated graph structure, which includes global node features, local node features, and edge features.
[0015] Step 6: Small Sample Image Classification. Based on the graph structure of the last layer of the local irrelevant region filtering graph neural network model output in Step 5, the global node features E of this graph structure are... G (X) The final features (referred to as features in step 6) of the support set images X or query set images X in the dataset used as a small sample learning task are used for image classification. Image classification is calculated using the distance metric between features. Each image will obtain a final feature E through the previous steps. G The system calculates the similarity between the features of the query set image (X) and the features of the support set images. It then determines which support set image has the highest similarity to the query set image, and the query set image belongs to the category of that image (where the categories of the support set images are known, and the categories of the query set images are unknown). The classification module calculates the similarity between the query set image X and the support set image (X). q The distance metric (cosine similarity between features) between the features of the query set image X and the features of each category in the support set is used to determine the query set image X. q The classification is based on which category of images in the support set has the highest similarity (a smaller distance metric indicates higher similarity, X). q The greater the probability of belonging to this category;
[0016] Step 7: Training the graph neural network model. The loss function used in the model training process consists of two parts: classification loss function L1 and local feature importance loss L2. The total loss of the model is the sum of the two: L = L1 + L2.
[0017] The training process of steps 2-7 is carried out sequentially for multiple small sample tasks. Finally, after the graph neural network model is trained, a trained graph neural network model is obtained.
[0018] During the training phase, the classification results and other data from step 6 are used to calculate the loss function, thereby optimizing the entire graph neural network model and making the graph neural network model more accurate in classification.
[0019] Step 8: Input the support set and query set to be classified into the trained graph neural network model, and process it according to steps 2-6 to obtain the classification prediction result of each image data in the query set to be classified.
[0020] This invention, based on graph neural networks, provides a few-sample image classification method that filters local features using graph neural networks. By adding constraint parameters to irrelevant regions such as the image background during local feature aggregation, the influence of these regions on classification is reduced, thus solving the technical problem of interference from irrelevant local information in existing metric learning-based methods and improving prediction performance. Attached Figure Description
[0021] Figure 1 This is a diagram showing the overall structure of the model of the present invention;
[0022] Figure 2 This is a diagram illustrating the small sample task sampling process of the present invention;
[0023] Figure 3 This is a schematic diagram of the initial structure of the present invention;
[0024] Figure 4 This is a diagram illustrating the graph neural network update steps of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings.
[0026] In this embodiment, the few-sample image classification method based on locally independent region filtering graph neural networks proposed in this invention includes two stages: meta-training and meta-testing. The meta-training stage is used to obtain a trained (i.e., fully trained) network model. After obtaining the trained network model, a few-sample task (including a support set and a query set) is input to obtain the classification prediction result for each query set image. The meta-testing stage uses the model trained in the meta-training stage to perform classification prediction on the images, and its steps are basically the same as those in the meta-training stage, such as... Figure 1 As shown, the gray box section represents the exact same steps, so only the steps of the meta-training phase will be described.
[0027] Few-shot learning datasets consist of a training set, a support set, and a query set. The training set is used to pre-train a classifier for images and contains a large amount of data; the support set and query set contain data for new categories different from the training set, and the data is relatively small. Few-shot image classification is the task of retraining the pre-trained classifier trained on the training set on the support set and validating the classification accuracy on the query set.
[0028] Meta-training mainly consists of three parts: few-sample task sampling, construction of the graph neural network for filtering locally irrelevant regions, and training of the graph neural network model for filtering locally irrelevant regions. The flowchart of the entire model is shown below. Figure 1 Specifically, the steps include the following:
[0029] Step 1: Few-shot task sampling. Few-shot task sampling mainly involves repeatedly sampling images from a large training set according to the distribution of the support set and query set, thus constructing multiple sets of few-shot learning tasks for training. For example... Figure 2As shown, during training, each time the support set and query set are obtained from the training set according to the existing n-way k-shot rules, forming a small sample learning task. Then, the support set and query set images from this small sample learning task are input into the subsequent local irrelevant region filtering map neural network model.
[0030] Among them, the supporting set of images refers to the image data used for training in few-shot learning tasks;
[0031] The query set images are: image data used to query classification results in a few-shot learning task;
[0032] The support set for a few-shot learning task contains n classes, with k samples for each class, and is called an n-way k-shot task. The query set contains several images to be queried, all of which belong to one of the n classes contained in the support set. A few-shot classification task involves training the model on the support set and then using the trained model to predict the classification of images in the query set.
[0033] Step 2: Perform random cropping on the support set images and query set images of the small sample dataset, obtaining multiple local sub-images for each image. The random cropping range is (0.08, 1.0), and the cropped images are scaled to the size of the original images.
[0034] Step 3: Input the support set images and query set images from the dataset together with the local sub-images extracted in Step 2 into an embedding network to obtain the global features (features of the original image) and local features (features of the sub-images) of the image respectively. Here, ResNet-12 is used as the embedding network.
[0035] Step 4: Construct a graph from the global and local features obtained in Step 3, ultimately forming a graph structure for subsequent graph neural network training. Specifically, the initial graph structure consists of nodes and edges. The global and local features extracted in Step 3 are used to construct nodes, with each global and local feature serving as a node in the graph structure, called a global node and a local node, respectively. The edges of the graph are constructed according to the following rules: 1. All global nodes are interconnected to form a fully connected graph; 2. All local nodes are connected to the global nodes of their corresponding images. Figure 3 This demonstrates the graph structure constructed using two samples, with two subgraphs extracted from each sample. The constructed graph structure will be used to train a graph neural network model.
[0036] Each graph structure contains nodes and edges. Nodes constructed using global features are called global nodes, and nodes constructed using local features are called local nodes (in a structural sense). Each node stores data called node features, and the node features of global nodes are called global node features (data used for computation). Global / local node features are the feature data of this graph, which are updated and transformed during the training of the graph neural network. However, before the update and transformation, the initial values are obtained from the input of global / local features. Global / local features are the output of step 3 and the input of step 4.
[0037] Step 5: Update the graph structure obtained in Step 4 using a local irrelevant region filtering graph neural network model to obtain the updated graph structure.
[0038] The local irrelevant region filtering graph neural network model consists of a graph neural network. It aggregates and updates image features (original image and sub-images) through the graph neural network, obtaining more discriminative features for image classification. When aggregating local features, it determines the probability that a local area is irrelevant and uses this probability as a coefficient to add a constraint parameter, reducing the influence of irrelevant regions on classification. The graph neural network consists of multiple layers (this invention uses a 3-layer structure), and the update steps for each layer are described below. Figure 4 The specific update steps are as follows:
[0039] Step 501: Global Feature Aggregation. Aggregate all global nodes. First, for one global node i, calculate the edge feature e between it and other global nodes j. i,j :
[0040]
[0041] Wherein, E(X) i ) is the node characteristic of global node i, E(X) j ) is the node feature of global node j (i≠j), It is a feature transformation network. Then, the features of other global nodes connected to global node i in the graph structure are multiplied and added together with their corresponding edge features to obtain the global aggregated feature A of node i. i :
[0042]
[0043] Where S G (i) represents the set of nodes surrounding node i;
[0044] Step 502: Calculate the importance of local nodes. For each local node, calculate its importance to the image by the similarity between it and the global aggregate features of its corresponding global node. For a local node i′, its importance to its corresponding global node i is λ. i′ The calculation is as follows:
[0045]
[0046] Wherein, E(x) i′ ) is the node characteristic of local node i′. It is a local node importance feature transformation network.
[0047] Step 503: Update local node features. Local node features are updated using their corresponding global nodes. Specifically, for a local node i′ and its corresponding global node i, the edge feature e between them is first calculated. i′,i :
[0048]
[0049] Here It is the same as the feature transformation network in step 501.
[0050] Then connect global node i with edge feature e i′,i The components are multiplied, then concatenated with local node features, and fed into a feature transformation network. The new local node features are obtained, and the specific calculation is as follows:
[0051]
[0052] Where E l (X i′ ) represents the local node features of the l-th layer. Indicates feature splicing, It is a feature transformation network. The l-th layer represents the graph structure input to the local irrelevant region filtering graph neural network model for the l-th time. The input graph structure of each local irrelevant region filtering graph neural network model is the graph structure output by the previous layer graph neural network.
[0053] Step 504: Update Global Node Features (After constructing the graph structure in Step 4, global features are no longer used; the graph structure only contains node features and edge features. Node features are further divided into global node features and local node features based on whether the current node is a global or local node. The update operation of the graph neural network is the process of updating node features. Due to the special nature of the graph structure (see...) Figure 2Since global and local features cannot be calculated and updated simultaneously, steps 503 and 504 respectively explain how local and global node features are updated. The global aggregated features have already been obtained in step 501; next, the local aggregated features are calculated first. Local aggregated features need to consider the classification importance of the local sub-image to the original image (i.e., whether the local image belongs to the object region classified as part of the original image or an irrelevant region). This invention compares local features with global aggregated features to obtain local importance. For the local importance I of local node i′... i′ The calculation is as follows:
[0054]
[0055] in It is a feature transformation network (feature transformation networks are distinguished by their superscripts; networks with the same superscript are the same network), E(x) i′ A represents the node characteristics of local node i′. i This represents the global aggregated feature of node i. Next, all local node information of global node i is aggregated to obtain the local aggregated feature a of i. i The calculation method is as follows:
[0056]
[0057] Where S L (i) represents the set of local nodes corresponding to global node i, e i′,i This represents the edge features between nodes i′ and i obtained in step 503. Finally, the global node features, global aggregate features, and local aggregate features are concatenated, and the updated global node features are obtained through a feature transformation network. The update calculation for global node i is as follows:
[0058]
[0059] Where E l (X i ) represents the feature of global node i in layer l. Indicates feature splicing, It is a feature transformation network.
[0060] Step 505: Determine if the loop is the last layer. The graph neural network (GNN) undergoes multi-layer updates (a GNN contains n layers, each layer's input is the graph structure output from the previous layer. The entire GNN takes an initial graph structure as input, updates it through multiple layers, and then uses the graph structure output from the last layer as the output of the entire GNN. The previous node update operations (501-505) are the update steps for one layer in the network; looping n times yields the output of the n-layer GNN). Multi-layer updates of the GNN involve inputting the graph structure multiple times to obtain the updated graph structure, with each layer's input being the graph structure output from the previous layer. When the update reaches the preset Nth layer (N is typically set to 3, 4, or 5), the loop ends, completing the GNN update, and the graph structure output from the Nth layer is used as the updated output of the entire GNN.
[0061] Step 6: Small Sample Image Classification. Based on the graph structure of the last layer of the graph neural network output in Step 5, the global node features E of this graph structure are... G (X) will be either the query set or all images X in the support set (images X in the dataset undergo a series of operations to obtain many features; this global node feature is the feature ultimately used for classification of image X). The final feature is used for image classification. For each sample (x, y) in the query set, the probability p(y = c|x) that it belongs to class c (the category of classification; there are a total of 5 categories in the 5way-1shot task) is calculated as follows:
[0062]
[0063] Where x represents the image, and y represents the category label of the image; E w (*) indicates the prototype feature corresponding to the classification label * for the image, E G (x) represents the features extracted from image x using a graph neural network model that filters local irrelevant regions, C base Let represent the set of labels, and cos(#1,#2) represent the cosine similarity between #1 and #2. The average value of the global node features extracted by the graph neural network model is the prototype feature of the class, which supports filtering of the same class through local irrelevant regions.
[0064] Step 7, Model Training. The loss function used in training the graph neural network model based on locally independent regions consists of two parts: a classification loss function L1 and a local feature importance loss L2. The total loss of the model is the sum of these two: L = L1 + L2. Where L1 and L2, which constitute the loss function, are respectively:
[0065]
[0066]
[0067] Where Q represents the query set (containing images and labels) sampled from the training set, |Q| represents the number of query set samples, (x,y) represents the sample image and classification label, and C base E represents the set of tags supported by the set. w (y) represents the prototype feature of label y (supports the average of features extracted by the model for the same class in a set as the prototype feature of the class), E G (x) represents the global node features extracted from image x by the model, N is the number of layers in the graph neural network, and S is the support set (containing images and labels). L (x) represents the set of local sub-images of image x. C represents the importance of subimage i″ in the l-th layer of the graph network. base Let p(y = c|x) represent the set of labels, and let p(y = c|x) represent the probability that the label y of image x is predicted to be of class c, which is calculated in step 6 above.
[0068] During the training phase, the classification results and other data obtained in step 6 are used to calculate the loss function, thereby optimizing the entire network model and making the graph neural network model more accurate in classification.
[0069] Step 8: Input the support set and query set to be classified into the trained graph neural network model, and process it according to steps 2-6 to obtain the classification prediction result of each image data in the query set to be classified.
[0070] The above description is merely a specific embodiment of the present invention. Any feature disclosed in this specification may be replaced by other equivalent or similar alternative features unless otherwise specified. All disclosed features, or steps in all methods or processes, except for mutually exclusive features and / or steps, may be combined in any way. All feature transformation networks used may be selected from some commonly used convolutional networks.
Claims
1. A few-sample image classification method based on a graph neural network for filtering locally independent regions, characterized in that, The method includes the following steps: Step 1: Small sample task sampling The dataset for few-shot learning consists of a training set, a support set, and a query set. The training set is used to pre-train the image classifier and contains a large amount of image data. The support set and query set contain image data of new categories that are different from those in the training set, and the number of images in the support set is less than that in the training set. The few-shot image classification task is to retrain the pre-trained image classifier trained on the training set on the support set and verify the classification accuracy on the query set. In the testing phase, the support set and query set can be used directly as the dataset. First, during the training phase, a large amount of training set image data is collected multiple times according to the distribution of the support set and query set, thus forming multiple sets of few-shot learning tasks; each set of few-shot learning tasks is trained separately, and the entire network model is optimized through the loss function. The following is a training process for a set of few-shot learning tasks. Step 2: Perform random cropping on the support set images and query set images in a set of few-sample learning tasks, so that each support set image or query set image obtains multiple local sub-images; Step 3: Input the support set images and query set images from the dataset of this small sample learning task, together with the local sub-images corresponding to each support set image or query set image extracted in Step 2, into an embedding network to obtain the global features and local features of each support set image or query set image. The support set images and query set images are processed by the embedding network to obtain global features, and the local sub-images are processed by the embedding network to obtain local features. Step 4: Construct a graph from the global and local features obtained in Step 3 to form a graph structure for subsequent graph neural network training; Step 5: Update the graph structure obtained in Step 4 using a local irrelevant region filtering graph neural network model to obtain an updated graph structure, which includes global node features, local node features, and edge features. Step 6: Small Sample Image Classification Based on the graph structure of the last layer of the local irrelevant region filtering graph neural network model output in step 5, the global node features of this graph structure are used as the final features of the support set image or query set image for image classification. Image classification is calculated by the distance metric between features, comparing the similarity between the features of the query set image and the features of the support set image, and determining which support set image the query set image has the greatest similarity to. Then the query set image belongs to the category of the support set image with the greatest similarity, thus obtaining the classification result of the query set image. The category of the support set image is known, while the category of the query set image is unknown. Step 7: Training the graph neural network model for filtering locally irrelevant regions. The loss function is calculated based on the classification results in step 6. The loss function used in the model training process consists of two parts: the classification loss function L1 and the local feature importance loss L2. The total loss function of the local irrelevant region filtering graph neural network model is the sum of the two: L = L1 + L2. The multiple small sample learning tasks obtained in step 1 are sequentially trained in steps 2-7. After the training process is completed, the trained local irrelevant region filtering graph neural network model is obtained. Step 8: Input the support set images and query set images to be classified into the trained local irrelevant region filtering neural network model, and after processing, obtain the classification prediction results for each image data in the query set to be classified.
2. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 1, characterized in that, Step 1 involves multiple samplings of a large amount of training set image data according to the distribution of the support set and query set. Each sampling is as follows: support set images and query set images are obtained from the training set according to the existing n-way k-shot rule, thus forming a set of few-shot learning tasks. The support set of the few-shot learning task contains n categories, and each category contains k samples; the query set contains several images to be queried, and these images all belong to the n categories contained in the support set.
3. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 2, characterized in that, In step 2, the random cropping range of the random cropping operation is (0.08, 1.0), and the cropped image is scaled to the size of the image before cropping.
4. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 3, characterized in that, The embedded network in step 3 is ResNet-12.
5. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 4, characterized in that, The graph structure described in step 4 consists of nodes and edges. Each global feature and local feature is a node in the graph structure, called a global node and a local node, respectively. The edges of the graph structure are constructed according to the following rules:
1. All global nodes are interconnected to form a fully connected graph; 2. All local nodes are connected to the global nodes of their corresponding images.
6. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 5, characterized in that, In step 5, the local irrelevant region filtering graph neural network model aggregates and updates global and local features in the graph structure to obtain more discriminative features for image classification. When aggregating local features, it determines the probability that a local region is irrelevant and uses this probability as a coefficient to add a constraint parameter to that region, reducing the impact of irrelevant regions on classification. The local irrelevant region filtering graph neural network model consists of N layers, and the update steps for each layer are as follows: Step 501: Global Feature Aggregation Aggregate all global nodes. First, for one global node i, calculate the edge feature e between it and other global nodes j. i,j : Wherein, E(X) i ) is the node characteristic of global node i, E(X) j ) is the node characteristic of global node j, where i ≠ j. It is a feature transformation network that multiplies the features of other global nodes connected to global node i in the graph structure with their corresponding edge features and then sums them to obtain the global aggregate feature A of node i. i : Where S G (i) represents the set of nodes surrounding node i; Step 502: Calculate the importance of local nodes For each local node, its importance to the image is calculated by the similarity between it and the global aggregate features of its corresponding global node; for local node i′, its importance to its corresponding global node i is λ. i′ The calculation is as follows: Wherein, E(X) i′ ) is the node characteristic of local node i′. It is a local node importance feature transformation network; Step 503: Update local node features Local node features are updated through their corresponding global nodes. Specifically, for a local node i′ and its corresponding global node i, the edge feature e between them is first calculated. i′,i : Then connect global node i with edge feature e i′,i The components are multiplied, then concatenated with local node features, and fed into a feature transformation network. The new local node features are obtained, and the specific calculation is as follows: Where E l (X i′ ) represents the local node features of the l-th layer, ⊕ represents feature concatenation, and the l-th layer represents the l-th input of the graph structure to the local irrelevant region filtering graph neural network model. The input graph structure of each layer of the local irrelevant region filtering graph neural network model is the graph structure output by the previous layer of the graph neural network. Step 504: Update global node features The global aggregation features have been obtained in step 501. Next, the local aggregation features are calculated first. Local aggregation features need to consider the importance of local sub-images to the classification of their corresponding original images. The local features are compared with the global aggregation features to obtain local importance. For local node i′, the local importance I... i′ The calculation is as follows: in It is a feature transformation network, E(x) i′ A represents the node characteristics of local node i′. i Let represent the global aggregated feature of node i. Then, aggregate all the local node information of global node i to obtain the local aggregated feature 'a' of i. i The calculation method is as follows: Where S L (i) represents the set of local nodes corresponding to global node i, e i′,i This represents the edge features between nodes i′ and i obtained in step 503; Finally, the global node features, global aggregate features, and local aggregate features are concatenated and passed through a feature transformation network to obtain the updated global node features. The update calculation for global node i is as follows: Where E l (X i ) represents the global node characteristics of global node i in the l-th layer; Step 505: Determine if the loop is the last level. The local irrelevant region filtering graph neural network model is updated in multiple layers. Steps 501-505 are the update steps of one layer in the network. Then, the loop is repeated N times to obtain the output of the N-layer graph neural network. The multi-layer update of the local irrelevant region filtering graph neural network model is to input the graph structure into the graph neural network multiple times to obtain the updated graph structure. The input of each layer is the graph structure output of the previous layer. When the preset Nth layer is updated, the loop ends and the update of the local irrelevant region filtering graph neural network model is completed. The graph structure output of the Nth layer is used as the updated output of the entire local irrelevant region filtering graph neural network model.
7. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 6, characterized in that, The image classification method in step 6 is specifically as follows: For each sample (x, y) in the query set, the probability p(y = c|x) that it belongs to class c is calculated as follows: Where x represents the image, and y represents the category label of the image; E w (*) indicates the prototype feature with the classification label * corresponding to the image, E G (x) represents the features extracted from image x using a graph neural network model that filters for locally irrelevant regions, C base Let represent the set of labels, and cos(#1,#2) represent the cosine similarity between #1 and #2. The average value of the global node features extracted by the graph neural network model is the prototype feature of the class, which supports filtering of the same class through local irrelevant regions.
8. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 7, characterized in that, In step 7, L1 and L2, which constitute the total loss function, are respectively: Where Q represents the query set sampled from the training set, |Q| represents the number of query set samples, x and y represent the sample images and their classification labels, respectively, and C base E represents the set of tags supported by the set. w (y) represents the prototype feature labeled y, N is the number of layers in the graph neural network, and S is the support set. L (x) represents the set of local sub-images of image x. Let represent the importance of subimage i″ in the l-th layer of the local irrelevant region filtering graph neural network model, and p(y=c|x) represent the probability that the label y of image x is predicted to be class c.
9. The few-sample image classification method based on locally independent region filtering graph neural networks according to claim 8, characterized in that, The N is 3, 4, or 5.
Citation Information
Patent Citations
Small sample image classification method and system based on semantic perception graph neural network
CN113378934A
Small sample remote sensing image scene classification method based on embedded smooth graph neural network
CN114067160A