Small sample image classification method and device, electronic equipment and storage medium

The prototype embedding graph neural network is constructed through the multi-scale feature fusion module and the prototype measurement module, which solves the global problems of feature extraction and similarity measurement in small sample image classification and improves the classification accuracy.

CN118570518APending Publication Date: 2024-08-30GUIZHOU MINZU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410401415.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-03
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing small-sample image classification methods have single context information, limited receptive field, and lack of global edge feature similarity measurement during feature extraction, which results in low accuracy of node similarity measurement and affects the accuracy of classification prediction.

Method used

The multi-scale feature fusion module is used to extract the embedded features of the supporting samples, and the prototype node in the graph neural network is constructed through the prototype measurement module, the similarity between the node and the prototype node is obtained, and the fusion feature and node similarity are combined to perform a dual-graph structure cycle Update to form a prototype embedding graph neural network to perform classification predictions on query samples.

Benefits of technology

It improves the globality and richness of feature extraction, enhances the accuracy of node similarity measurement, and improves the classification accuracy of small sample images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570518A
    Figure CN118570518A
Patent Text Reader

Abstract

The invention discloses a small sample image classification method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining a support sample and a query sample of a small sample image; extracting an embedded feature of the support sample, and obtaining a fusion feature based on the embedded feature by using a preset multi-scale feature fusion module; using a preset prototype measurement module to construct prototype nodes in the graph neural network based on the support sample, and obtaining node similarities between each node in the graph neural network and the prototype nodes; and taking the fusion feature and the node similarity as a node embedding feature and an edge feature of a graph neural network respectively, carrying out double-graph structure circulation updating for preset times, carrying out classification prediction on a query sample by utilizing the obtained prototype embedding graph neural network, obtaining an image category label of the query sample, and mapping the image category label to the query sample. The problem of low similarity measurement accuracy is solved through the multi-scale feature fusion module and the prototype measurement module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image classification, and in particular to a classification method and device for small sample images, an electronic device, and a storage medium. Background Art

[0002] Few-Shot Learning (FSL) aims to learn an effective model for new classes through a small number of labeled samples (i.e., support samples (S)), so as to classify unlabeled samples (i.e., query samples (Q)). In order to use regularity to make up for the scarcity of labeled data, meta-learning came into being. Meta-learning aims to train a meta-learner to propagate labels from support samples to query samples.

[0003] When existing small sample image classification methods perform feature extraction through traditional backbone convolutional networks, there are problems such as single context information and limited perception, as well as lack of globality in edge feature similarity measurement. Although the edge feature similarity measurement takes into account the similarity between paired nodes, the calculation of node similarity is too dependent on the quality of node feature embedding, and also ignores the correlation construction between the global features of the graph neural network and each node feature, resulting in low accuracy of node similarity measurement, which ultimately affects the accuracy of classification prediction.

[0004] Therefore, how to improve the classification accuracy of small sample images is an urgent problem to be solved. Summary of the invention

[0005] In order to improve the classification accuracy of small sample images, embodiments of the present application provide a small sample image classification method and device, electronic device, computer-readable storage medium, and computer program product.

[0006] In the first aspect, in order to solve the above technical problems, the present application provides a classification method for small sample images, comprising:

[0007] Obtain support samples and query samples of small sample images;

[0008] Extracting the embedded features of the support sample, and obtaining fused features based on the embedded features using a preset multi-scale feature fusion module;

[0009] Using a preset prototype measurement module to construct a prototype node in the graph neural network based on the support sample, and obtaining the node similarity between each node in the graph neural network and the prototype node;

[0010] The fusion feature and the node similarity are used as the node embedding feature and the edge feature of the graph neural network respectively, and a dual-graph structure is cyclically updated for a preset number of times based on the node embedding feature and the edge feature to obtain a prototype embedded graph neural network;

[0011] The prototype embedded graph neural network is used to perform classification prediction on the query sample to obtain the image category label of the query sample, and the image category label is mapped to the query sample.

[0012] The beneficial effects are:

[0013] In the technical solution provided in the embodiments of the present application, after the embedded features of the supporting samples are extracted, the fused features are obtained based on the embedded features through a preset multi-scale feature fusion module; at the same time, the prototype nodes in the graph neural network are constructed based on the supporting samples using a preset prototype measurement module, and the node similarity between each node in the graph neural network and the prototype nodes is obtained; and then the fused features and the node similarity are used as the node embedding features and edge features of the graph neural network respectively, and the dual-graph structure is updated cyclically for a preset number of times to obtain the prototype embedded graph neural network, so as to use the prototype embedded graph neural network to perform classification prediction on the query sample and obtain the image category label of the query sample.

[0014] By utilizing the context perception and feature fusion capabilities of the multi-scale feature fusion module, the obtained fusion features are global and rich. In addition, the preset prototype measurement module is used to transform the similarity calculation between paired nodes into the similarity calculation between two nodes and the prototype node, which solves the problem of low accuracy of node similarity measurement in the graph neural network due to the pairwise node measurement and the neglect of the correlation construction between nodes. In this way, the prototype embedded graph neural network obtained based on the fusion features and node similarity can predict the category of the query sample with high accuracy.

[0015] In a second aspect, the present invention provides a classification device for small sample images, including a sampling unit, a fusion feature unit, a similarity unit, a neural network construction unit and a classification prediction unit;

[0016] A sampling unit, used to obtain support samples and query samples of small sample images;

[0017] A fusion feature unit, used for extracting the embedded features of the support sample, and obtaining fusion features based on the embedded features using a preset multi-scale feature fusion module;

[0018] A similarity unit is used to construct a prototype node in the graph neural network based on the support sample using a preset prototype measurement module, and obtain the node similarity between each node in the graph neural network and the prototype node;

[0019] A neural network construction unit, used to use the fusion feature and the node similarity as the node embedding feature and the edge feature of the graph neural network respectively, and perform a preset number of dual-graph structure cyclic updates based on the node embedding feature and the edge feature to obtain a prototype embedded graph neural network;

[0020] A classification prediction unit is used to use the prototype embedded graph neural network to perform classification prediction on the query sample, obtain the image category label of the query sample, and map the image category label to the query sample.

[0021] In a third aspect, the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the small sample image classification method as described above.

[0022] In a fourth aspect, the present application further provides a computer-readable storage medium having computer-readable instructions stored thereon, which, when executed by a processor of a computer, enables the computer to execute the small sample image classification method as described above.

[0023] In a fifth aspect, the present application further provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the classification method of the small sample image provided in the above various optional embodiments.

[0024] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0026] Figure 1 is a flow chart of a method for classifying small sample images shown in an exemplary embodiment of the present application;

[0027] Figure 2 It is a schematic diagram of a framework of a prototype embedded graph neural network in an exemplary embodiment of the present application;

[0028] Figure 3 is a schematic diagram of the structure of a multi-scale feature fusion module in an exemplary embodiment of the present application;

[0029] Figure 4 It is a grid structure corresponding to the transformation between the point map and the distribution map when implementing a classification task with a meta-task paradigm of 2-way 1-shot in an exemplary embodiment of the present application;

[0030] Figure 5 It is the accuracy and convergence diagram of the miniImageNet dataset model in the 5-way 1-shot classification task;

[0031] Figure 6 It is the convergence graph and loss graph of the miniImageNet dataset model in the 5-way 5-shot classification task;

[0032] Figure 7 is a block diagram of a small sample image classification device shown in an exemplary embodiment of the present application;

[0033] Figure 8 It is a structural diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application. DETAILED DESCRIPTION

[0034] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0037] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0038] In order to solve the above problems, the embodiments of the present application propose a small sample image classification method and device, electronic device, and computer-readable storage medium, which mainly involve small sample image classification technology included in small sample learning technology. These embodiments will be described in detail below.

[0039] First see Figure 1 , Figure 1 This is a flowchart of a classification method for small sample images shown in an exemplary embodiment of the present application. The method can be specifically executed by a server, which can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc., and is not limited here.

[0040] like Figure 1 As shown, in an exemplary embodiment, the classification method of the small sample image may include steps S101 to S105, which are described in detail as follows:

[0041] Step S101, obtaining support samples and query samples of a small sample image.

[0042] The small sample learning used in small sample image classification methods is usually trained and evaluated in the form of meta-tasks. The most common paradigm for constructing meta-tasks is the N-way K-shot task, which is to sample N categories from the new class, extract K labeled images from each category as training samples, that is, support samples with label information, and then extract K labeled images from the remaining images of each category. samples as prediction images, i.e. unlabeled query samples. In this way, each small sample image task has a support set S of support samples and a query set Q of query samples.

[0043] For example, the sample data of the small sample image obtained is D train , where the support set Contains N classes, each class has K support samples, denoted as S = {(x1,y1),(x2,y2),…,(x N×K ,y N×K )}. Query Set Contains N classes, each class has query samples, denoted as

[0044] Step S102: extracting embedded features of supporting samples, and obtaining fused features based on the embedded features using a preset multi-scale feature fusion module.

[0045] Step S103, using the preset prototype measurement module to construct a prototype node in the graph neural network based on the supporting samples, and obtaining the node similarity between each node in the graph neural network and the prototype node.

[0046] For small sample image classification, traditional backbone convolutional networks have problems such as single context information, limited receptive field, and lack of globality in edge feature similarity measurement when performing feature extraction.

[0047] Therefore, in this embodiment, the multi-scale feature fusion module is added to the backbone convolutional network f emb , the embedded features of the support samples are extracted through the multi-scale feature fusion module, and the embedded features are fused to obtain the corresponding fusion features. And there is a preset prototype measurement module, which is used to construct the prototype node in the graph neural network based on the support samples, convert the similarity calculation between paired nodes into the similarity calculation between a single node and the prototype node, and obtain the node similarity between each node in the graph neural network and the prototype node.

[0048] In step S104, the fusion features and node similarity are used as node embedding features and edge features of the graph neural network respectively, and the dual graph structure is cyclically updated a preset number of times based on the node embedding features and edge features to obtain a prototype embedded graph neural network.

[0049] In this embodiment, after obtaining the fusion features and node similarities, the fusion features are used as the node embedding features of the graph neural network, and the node similarities are used as the edge features of the graph neural network. Then, the dual graph structure is cyclically updated a preset number of times based on the node embedding features and the edge features to obtain the Prototype Embedding Graph Network (PEGN).

[0050] Step S105, using the prototype embedding graph neural network to perform classification prediction on the query sample, obtain the image category label of the query sample, and map the image category label to the query sample.

[0051] After completing the construction of the prototype embedding graph neural network, the prototype embedding graph neural network is used to classify and predict the query samples to obtain the image category labels of the query samples, and then map the image category labels to the query samples, thereby realizing the process of propagating the category label information from the support samples carrying the category label information to the unlabeled query samples.

[0052] As can be seen from the above, in the method provided in this embodiment, starting from the embedding optimization of the node features of the graph neural network and the node similarity measurement, the multi-scale feature fusion module is embedded into the backbone convolutional network to enhance the feature extraction ability of the network, and by utilizing the context perception ability and feature fusion ability of the multi-scale feature fusion module, the feature extraction network can capture more global and richer image information. In order to solve the problem of low accuracy of node similarity measurement caused by ignoring the correlation construction between nodes in the paired node measurement in the graph neural network. In this embodiment, the prototype node is constructed based on the supporting sample through the prototype measurement module, and the similarity calculation between the paired nodes is transformed into the similarity calculation between the two nodes and the prototype node, thereby improving the measurement accuracy of the node similarity. Then, the dual-graph structure is cyclically updated for a preset number of times according to the fusion features and the node similarity, and the prototype embedded graph neural network is obtained to improve the accuracy of the prototype embedded graph neural network in predicting the category of the query sample.

[0053] In an exemplary embodiment of the present application, the preset number of dual-graph structure cyclic updates refers to performing a preset number of mutual propagation updates on the point graph and the distribution graph to obtain a prototype embedded graph neural network, and the specific steps may include:

[0054] Based on the node embedding features and edge features, the point graph and the distribution graph are updated with a preset number of mutual propagation;

[0055] Obtaining each updated point graph and each updated distribution graph, and obtaining a preset number of offspring based on the updated point graph and the updated distribution graph, wherein the value of the preset number is equal to the value of the preset number of times;

[0056] A prototype embedding graph neural network is obtained based on a preset number of offspring.

[0057] If the value of the preset number is l, the prototype embedded graph neural network obtained based on the preset number of children consists of l children, each of which consists of a point graph and distribution map composition.

[0058] The process of mutual propagation update of the point graph and distribution graph for a preset number of times based on the node embedding features and edge features: First, the embedding features of the supporting samples are extracted through the multi-scale feature fusion module of the backbone convolutional network. These embedded features are used to calculate the instance similarity Second, passing instance relationships Build a distribution map Node feature V l d Depend on According to Position order aggregation initialization in edge features Represents the node feature Vl d Finally, we will get Pass to To construct node V l p A more discriminative representation of , and repeat the above propagation process generation by generation until l propagation updates are completed. l p , V l d and It can be expressed as Where i, j = 1,…T. Indicates the total number of samples. The backbone convolutional network f emb Extract. in, m is the feature embedding dimension.

[0059] See also Figure 2 , Figure 2 is a schematic diagram of a framework of a prototype embedded graph neural network in an exemplary embodiment of the present application, such as Figure 2 As shown in the figure, the circles represent the features obtained after the samples pass through the backbone convolutional network, and the circles in different positions represent different categories.

[0060] When embedding nodes in point graph (PG) and distribution graph (DG), a multi-scale feature fusion module and a prototype measurement module are designed to be used in the backbone convolutional network f emb The supporting samples and query samples of the small sample image are obtained, so as to obtain the node embedding features and edge features, which are applied to the preset number of mutual propagation updates of the point graph and the distribution graph. The arrow from the point graph to the distribution graph is the edge-to-node transformation (PG→DG, PD), which aggregates the instance similarity to construct the distribution representation, and the arrow from the distribution graph to the point graph is another edge-to-node transformation (DG→PG, DP), which aggregates the distribution similarity and instance features. After performing l generations (generation 1 to generation 1), the point graph after each update and the distribution graph after each update are obtained, and a preset number of l children are obtained based on the point graph after each update and the updated distribution graph, forming a prototype embedded graph neural network to output the classification prediction (Predlction) for the query sample.

[0061] Label propagation is performed through the edge feature similarity between nodes of the last generation of point graphs of the prototype embedding graph neural network, so as to predict the category of each node, that is, output the category probability of the query sample, and determine the image category label of the query sample according to the category probability. The calculation method is as follows:

[0062]

[0063] in Given a sample x i The probability distribution over the categories, yj is the label of the jth sample in the support set. Represents the edge features in the last generation of point graph.

[0064] In one embodiment provided by the present application, among the node embedding features and edge features used for mutual propagation updates of a preset number of time for a point graph and a distribution graph, the node embedding features are fusion features obtained based on the embedding features using a preset multi-scale feature fusion module, and the edge features are the node similarities between each node in the graph neural network and the prototype nodes constructed by a preset prototype measurement module.

[0065] In an exemplary embodiment of the present application, the multi-scale feature fusion module includes a dilated spatial convolutional pooling pyramid submodule and a convolutional attention mechanism submodule, so the step of obtaining the fusion feature may specifically include:

[0066] Using the dilated spatial convolutional pooling pyramid submodule, the support samples are sampled in parallel using dilated convolutions at a preset sampling rate to obtain the embedded features of the support samples.

[0067] The weight value of the embedded feature is obtained through the convolutional attention mechanism sub-module, and the fused feature is obtained based on the embedded feature and the weight value.

[0068] In this embodiment, a multi-scale feature fusion module is added to the backbone convolutional network f emb , and use the extracted features as node embedding features of graph neural network.

[0069] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a multi-scale feature fusion module in an exemplary embodiment of the present application. Figure 3As shown in the figure, the multi-scale feature fusion module includes an atrous spatial convolutional pooling pyramid sub-module (Atrous Spatial Pyramid Pooling, ASPP) and a convolutional block attention module (Convolutional Block Attention Module, CBAM), and the convolutional attention mechanism sub-module includes a channel attention mechanism (Channel Attention Mechanism, CAM) and a spatial attention mechanism (Spatial Attention Mechanism, SAM).

[0070] Considering that the traditional backbone convolutional network has the problem of single context information and limited receptive field when performing feature extraction, this embodiment uses ASPP for feature fusion, uses dilated convolutions with different sampling rates to sample feature maps in parallel, and splices the obtained features together to expand the number of channels, and finally obtains the desired number of channels through 1×1 convolution. ASPP uses dilated convolution to expand the receptive field, and at the same time captures richer context information at different sampling rates, so that multi-scale fusion features are obtained when extracting features.

[0071] CBAM includes channel attention mechanism and spatial attention mechanism, which can add attention mechanism on channel and space respectively, so as to focus on important features and suppress unnecessary features. CBAM is used to generate weight values ​​of corresponding feature maps and multiply them with different scale features generated by ASPP to generate new node features.

[0072] Therefore, through the above embodiments, the present application adds a multi-scale feature fusion module into the backbone convolutional network, which not only enables the network to obtain the CBAM ability to save parameters and computing power, but also obtains better global image features and obtains richer node features, thereby improving the representation ability of the graph neural network, so that the prototype embedded graph neural network obtained based on the node embedding features and edge features of the graph neural network can predict the category of the query sample with high accuracy.

[0073] In another exemplary embodiment, a prototype node in a graph neural network is obtained by constructing a preset prototype metric module based on supporting samples. The specific steps may include:

[0074] Construct prototype representations of support samples in dot plots and distribution plots respectively;

[0075] Obtain the target prototype representation corresponding to the preset base class support sample, and integrate the target prototype representation to obtain the target prototype vector;

[0076] Embed the target prototype vector into the node of the graph neural network to obtain the prototype node.

[0077] In order to transform and measure the calculation of paired node affinity through the prototype measurement module, the embodiment provided by the present application takes into account the affinity traction between nodes, and uses the prototype measurement module to construct a virtual node as a prototype node, and transforms the similarity calculation between paired nodes into the node similarity calculation between the node and the prototype node.

[0078] Construct prototype representations of samples in the dot graph and distribution graph respectively, and use f emb The extracted image features are embedded in the graph neural network nodes as node features. For the construction of the prototype node, the base class support sample is used to integrate the prototype representation of the sample of this class, and this prototype vector is embedded in the graph network node as the prototype node.

[0079] In this embodiment, after the prototype node is constructed, the node similarity between each node in the graph neural network and the prototype node is obtained, so as to input the obtained node similarity into the graph neural network as an edge feature. The specific steps may include:

[0080] Get the Euclidean distance between each node in the graph neural network and the prototype node;

[0081] The node similarity between each corresponding node in the graph neural network and the prototype node is calculated based on the Euclidean distance.

[0082] In this embodiment, the node similarity between each node in the graph neural network and the prototype node is obtained by calculating the Euclidean distance between each node in the graph neural network and the prototype node, and the node similarity is used as an edge feature to construct a prototype embedded graph neural network.

[0083] See also Figure 4 , Figure 4 It is an exemplary embodiment of the present application to implement the meta-task paradigm of 2-way1-shot classification task, the grid structure corresponding to the transformation between the point map and the distribution map, such as Figure 4 As shown in the figure, in the 2-way 1-shot classification task, MLP-1 is the FC-ReLU block mentioned in the point graph to distribution graph aggregation, and MLP-2 is the Conv-BN-ReLU block in the distribution graph to point graph aggregation.

[0084] The prototype measurement module uses Euclidean distance to calculate the similarity between nodes and calculates node similarity based on the L2 norm (Euclidean norm) between the node and the prototype node. The smaller the L2 norm, the higher the similarity of the node features, and the greater the probability that the samples corresponding to the two nodes belong to the same category.

[0085] The prototype node feature initialization formula is as follows:

[0086]

[0087] Where |S k | is a set with label k, is the embedded function.

[0088] By building a prototype node, we can calculate the edge features of each node in the point graph, that is, the similarity of the point graph nodes. Initialization is as follows:

[0089] in It is a method to convert instance similarity into a certain scale. Contains two parameter sets: A Conv-BN-ReLU block and a Sigmoid layer.

[0090] When offspring l>0, given and The updated l-generation edge features can be calculated as follows:

[0091] To use The global information operation side information update is Perform normalization operation.

[0092] Based on the prototype node in the point diagram Create or update edge features After that, the next step is to construct a distribution map Utilize distribution map Can integrate point graph The instance relations in are embedded into the distribution graph, thus handling the distribution hierarchical relations. The characteristic of each node in is the distribution characteristic is a NK-dimensional feature vector. The jth item represents the sample x i With sample x j The distribution relationship, NK represents the total number of support set samples in the task, and the node features in the distribution graph are initialized for the first time as:

[0093]

[0094] in || is a cascade operator, δ(.) is the Kronecker function, when y i =y j The output is 1, otherwise the output is 0.

[0095] When the offspring l>0, the distribution node The update method is as follows: Where PD: (R NK ,R NK) → R NK is the aggregation network of the distribution graph, and the parameter set is

[0096] After the prototype node is constructed in the point graph, the prototype node is constructed in the same way in the distribution graph in this embodiment, and its prototype distribution is: Each line in the distribution graph represents the similarity between the distribution characteristics of different samples, so the initial distribution similarity The construction is as follows:

[0097] in Two Conv-BN-ReLU blocks are used to transform the distribution similarity. Contains a parameter set of And a Sigmoid layer.

[0098] For offspring l>0, the distribution diagram The update rule is: To use The global information operation side information update is Perform normalization operation.

[0099] exist The obtained encoding distribution information is returned as a dot plot at the end of each generation. In the meantime Node features use All node features and edge features in The aggregation acquisition distribution relationship is as follows:

[0100]

[0101] in, And DP: (R m ,R m ) → R m It is a dot graph An aggregate network in which the parameter set is

[0102] DP concatenates the features calculated from the current generation with the node features of the previous generation, and updates the concatenated features using two Conv-BN-ReLU blocks. Through this process, the node features can integrate the information at the distribution level into the features at the instance level, preparing for the next generation of instance similarity calculations.

[0103] In this way, this embodiment constructs a prototype node based on supporting samples through the prototype measurement module, and transforms the similarity calculation between paired nodes into the similarity calculation between two nodes and the prototype node, thereby improving the measurement accuracy of node similarity.

[0104] In an exemplary embodiment provided by the present application, after obtaining a prototype embedded graph neural network based on a preset number of offspring, a loss function is calculated based on the offspring in the prototype embedded graph neural network to correct the prototype embedded graph neural network. The specific steps may include:

[0105] Get the point loss corresponding to the point graph of the last child in the prototype embedding graph neural network, and the distribution loss corresponding to the distribution graph of the last child;

[0106] Perform weighted summation of point loss and distribution loss to obtain the target loss function;

[0107] The prototype embedding graph neural network is subjected to loss processing based on the target loss function, so as to utilize the processed prototype embedding graph neural network to perform classification prediction on the query samples.

[0108] Preferably, this embodiment performs classification prediction on each sample in the point graph. Therefore, the point loss of the first generation is defined as follows: Among them, L CE is the cross entropy loss function, T represents (S,Q)∈D in each task train The number of samples, and i Represent the model's probability prediction value and true value respectively.

[0109] The node features of the distribution graph can be obtained by constructing the prototype node of the point graph and concatenating the node features and edge features in the point graph into the PD aggregation network, and then the edge features can be calculated. This embodiment also calculates the distribution loss to facilitate the training process and learn the discriminative distribution features. The distribution loss plays an important role in faster and better convergence. The distribution loss of the first generation is defined as follows:

[0110]

[0111] in Represents the edge features in the l-th generation distribution graph.

[0112] The total objective function is the weighted sum of all the above losses, and the calculation formula is defined as follows:

[0113]

[0114] in, represents the total number of offspring of DPGN, λ p and λd represents the weight of each loss to balance their importance. In most of our experiments, λ p and λ d Set to 1.0 and 0.1 respectively.

[0115] It can be seen that this embodiment further improves the accuracy of category prediction by correcting the prototype embedding graph neural network through the loss function.

[0116] In an exemplary embodiment of the present application, the classification method of small sample images provided by the present application is applied to 4 standard small sample learning data sets to verify the effectiveness of the classification method of small sample images provided by the present application, and the data sets are miniImageNet, tieredImageNet, CUB-200-2011 and CIFAR-FS. Among them, miniImageNet and tieredImageNet are subsets of ImageNet. CUB-200-2011 was originally designed for fine-grained classification, and CIFAR-FS is a subset of CIFAR-100 for small sample classification. As shown in Table 1, the standard lists the detailed information of the number of images, number of categories, image resolution and train / val / test segmentation.

[0117] Table 1:

[0118]

[0119]

[0120] This embodiment is implemented based on PyTorch code under the Ubantu16.04 operating system. The graphics card is NVIDIA GeForce RTX 3090, CUDA version 11.2, memory 40GB, and the CPU is Intel (R) Xeon (R) Silver 4210 CPU @ 2.20GHz. Common data enhancements such as horizontal flipping, random cropping, and color jitter (brightness, contrast, and saturation) are performed before training. The backbone convolutional networks are ResNet-12 and Conv-4, and the final output dimension of the network is 128. 28 episodes are randomly selected for meta-training in each iteration. All experiments use the Adam optimizer with batch sizes of 40, 25, and 28, respectively, and an initial learning rate of 10-3. At the same time, the learning rate is decayed to the original 0.1 every 15,000 iterations, and the weight decay is set to 10-5. PEGN in the 5-way 1-shot / 5-shot setting is evaluated on standard small sample learning datasets miniImageNet, tieredImageNet, CUB-200-2011, and CIFAR-FS. In the test phase, 10,000 tasks are randomly selected, and the model evaluation indicator is the average accuracy at 95% confidence level.

[0121] Based on the above operating environment, this embodiment compares the PEGN model constructed by this application with the existing models, and the comparison methods include graph methods and non-graph methods. In order to ensure the validity of the comparison results, PEGN is used on miniImageNet, tieredImageNet, CIFAR-FS and CUB-200-2011 datasets, and compared with other methods on the same backbone convolutional network. As shown in Tables 2, 3, 4 and 5, the proposed PEGN outperforms other existing methods and achieves state-of-the-art performance, especially compared with graph-based methods.

[0122] This example evaluates the 5-way 1-shot and 5-way 5-shot classification tasks. The accuracy and loss curves of the model in different classification tasks on the miniImageNet dataset are shown in Figure 2. Figure 5 and Figure 6 As shown, Figure 5 It is the accuracy graph and convergence graph of the miniImageNet dataset model in the 5-way 1-shot classification task. Figure 6 It is the convergence graph and loss graph of the miniImageNet dataset model in the 5-way 5-shot classification task.

[0123] exist Figure 5 (a) and Figure 6The upper curve in (a) is the accuracy curve of the model training in this embodiment, and Figure 5 (b) and Figure 6 The curve at the bottom in (b) is the loss curve of the model training in this embodiment. Figure 5 As shown in the figure, PEGN converges faster and has significantly higher accuracy than DPGN in the 5-way 1-shot classification task. The experiment shows that PEGN converges faster in 18,000 rounds, while DPGN needs 22,000 rounds to converge and reduce the learning rate. The experiment tried to reduce the learning rate of DPGN after 18,000 rounds, but the experimental results showed that the accuracy of DPGN decreased by about 2%. At the same time, Figure 6 It can be seen that the convergence speed of PEGN in the 5-way 5-shot classification task is significantly faster than that of DPGN, and the accuracy is also significantly improved compared to DPGN. PEGN began to converge around 12,000 rounds, while DPGN began to converge after 18,000 rounds. The PEGN model surpassed the DPGN model in terms of convergence speed and accuracy, proving that it has a promising future in practical applications.

[0124] Table 2 shows the experimental results of PEGN on the miniImageNet dataset. As can be seen from the table, in the 5way-1shot task, the network classification accuracy of this embodiment is 3.7%, 5.02%, 1.28%, 3.64% and 3.87% higher than that of DPGN, FRN, CL, DeepBDC and RENet using ResNet-12 respectively; in the 5way-5shot task, the algorithm accuracy of this embodiment is 2.07%, 3.84%, 2.01%, 1.22% and 4.09% higher than that of DPGN, FRN, CL, DeepBDC and RENet using ResNet-12 respectively. It should be noted that the algorithm using Conv-4 as the backbone convolutional network outperforms the existing graph network methods in both tasks.

[0125] Table 2:

[0126]

[0127] Table 3 is the experimental results of PEGN on the tieredImageNet dataset. It can be seen from the table that in the 5way-1shot task, the network classification accuracy of this embodiment is 2.96%, 3.35%, 2.79%, 1.59% and 3.8% higher than that of DPGN, FRN, CL, DeepBDC, RENet and LPN using ResNet-12, respectively. In the 5way-5shot task, the algorithm accuracy of this embodiment is 2.6%, 2.95%, 3.22%, 0.84% ​​and 4.56% higher than that of DPGN, FRN, CL, DeepBDC and RENet using ResNet-12, respectively. It should be noted that the algorithm using Conv-4 as the backbone convolutional network outperforms the existing graph network methods in both tasks.

[0128] Table 3:

[0129]

[0130] Table 4 shows the experimental results of PEGN on the CUB-200-2011 dataset. As can be seen from the table, in the 5way-1shot task, the network classification accuracy of this embodiment is 10.5%, 7.63%, 6.72% and 1% higher than that of DPGN, HGNN, RENet and ELMOS using ResNet-12, respectively, and is slightly lower than CPN by 1.08%. In the 5way-5shot task, the algorithm accuracy of this embodiment is 2.6%, 4.06%, 2.97% and 1.54% higher than that of DPGN, HGNN, RENet and CPN using ResNet-12, respectively, and is slightly lower than ELMOS by 0.94%. It should be noted that both CPN and ELMOS achieve the improvement of small sample classification effect based on data enhancement methods rather than optimization methods. This embodiment focuses on improving the small sample image classification performance of the graph network neural network, and completes the sample label propagation by constructing a graph network with stronger inference ability. Compared with the existing graph network small sample learning method, if Conv-4 is used as the backbone convolutional network algorithm, it is better than the existing graph network method in both tasks.

[0131] Table 4:

[0132]

[0133]

[0134] Table 5 shows the experimental results of PEGN on the CIFAR-FS dataset. As can be seen from the table, in the 5way-1shot task, the network classification accuracy of this embodiment is 1.94%, 2.28%, 5.33% and 1.66% higher than that of DPGN, CL, RENet and ELMOS using ResNet-12 respectively; in the 5way-5shot task, the algorithm accuracy of this embodiment is 2.05%, 3.61%, 5.65% and 2.38% higher than that of DPGN, CL, RENet and ELMOS using ResNet-12 respectively. Similarly, if Conv-4 is used as the backbone convolutional network algorithm, it outperforms the existing control methods in both tasks.

[0135] Table 5:

[0136]

[0137] Preferably, this embodiment conducts four groups of ablation experiments on the miniImageNet dataset to verify the effectiveness of PEGN. The first group of experiments is based on the original distribution propagation graph network; the second group of experiments is based on the dual-graph network experiment for feature optimization of node embedding based on the multi-scale feature fusion module; the third group of experiments is based on the dual-graph network experiment of the new metric module designed for constructing virtual nodes based on prototype representation; the fourth group of experiments is based on the dual-graph network experiment of the metric module for constructing virtual nodes based on the multi-scale feature fusion module and the prototype representation. The experimental results are shown in Table 6.

[0138] Table 6:

[0139]

[0140] The experimental results show that in the 5-way 1-shot task, embedding the multi-scale feature fusion module into the feature extraction network of ResNet-12 improves the classification accuracy by 1.44%. In the 5-way 5-shot task, the classification accuracy is improved by 0.71%. In this embodiment, adding a multi-scale feature fusion module to the ResNet-12 network can better capture the contextual information in the image and extract multi-scale features as node embedding features of the graph network. In the 5-way 1-shot task, the classification accuracy of the edge feature similarity measurement using the L2 norm metric and the metric of constructing the prototype node is 2.41% higher than that using the L2 norm metric alone. In the 5-way 5-shot task, the classification accuracy of the edge feature measurement using the L2 norm metric and the metric of constructing the prototype node is 1.01% higher than that using the L2 norm metric alone. The edge feature measurement method of constructing the prototype node is more effective than the distance function similarity measurement method of the traditional edge feature. The design of the prototype node can transform the similarity calculation between paired nodes into the similarity calculation between two nodes and the prototype node, and improve the classification accuracy. The construction of prototype nodes enables the model to capture the similarity information between samples more comprehensively, enhances the model's ability to model the relationship between images, and further improves performance.

[0141] Figure 7 FIG. 7 is a block diagram of a small sample image classification device 700 shown in an exemplary embodiment of the present application. Figure 7 As shown, the device comprises:

[0142] A sampling unit 701 is used to obtain a support sample and a query sample of a small sample image;

[0143] A fusion feature unit 702 is used to extract embedded features of the support sample and obtain fusion features based on the embedded features using a preset multi-scale feature fusion module;

[0144] A similarity unit 703 is used to construct a prototype node in the graph neural network based on the support sample using a preset prototype measurement module, and obtain the node similarity between each node in the graph neural network and the prototype node;

[0145] A neural network construction unit 704 is used to use the fusion feature and the node similarity as the node embedding feature and the edge feature of the graph neural network respectively, and perform a preset number of dual-graph structure cyclic updates based on the node embedding feature and the edge feature to obtain a prototype embedded graph neural network;

[0146] The classification prediction unit 705 is used to perform classification prediction on the query sample using the prototype embedded graph neural network, obtain the image category label of the query sample, and map the image category label to the query sample.

[0147] The device applies the classification method of small sample images provided by the present application, and embeds the multi-scale feature fusion module into the backbone convolutional network to enhance the feature extraction ability of the network by fusing the feature unit 702 and the similarity unit 703, starting from the embedding optimization of the node features of the graph neural network and the node similarity measurement. By utilizing the context perception ability and feature fusion ability of the multi-scale feature fusion module, the feature extraction network can capture more global and richer image information. In order to solve the problem of low accuracy of node similarity measurement caused by ignoring the association construction between nodes in the paired node measurement in the graph neural network. In this embodiment, the prototype node is constructed based on the supporting sample by the prototype measurement module, and the similarity calculation between the paired nodes is converted into the similarity calculation between the two nodes and the prototype node, thereby improving the measurement accuracy of the node similarity. Therefore, the neural network construction unit 704 performs a preset number of dual-graph structure cycle updates according to the fusion features and the node similarity, and obtains the prototype embedded graph neural network, so as to improve the accuracy of the category prediction of the query sample by the classification prediction unit 705 using the prototype embedded graph neural network.

[0148] In another exemplary embodiment, the multi-scale feature fusion module includes a dilated spatial convolution pooling pyramid sub-module and a convolutional attention mechanism sub-module; the fusion feature unit 702 is also used to utilize the dilated spatial convolution pooling pyramid sub-module to perform dilated convolution and parallel sampling on the support samples at a preset sampling rate to obtain embedded features of the support samples; the weight value of the embedded feature is obtained through the convolutional attention mechanism sub-module, and the fusion feature is obtained based on the embedded feature and the weight value.

[0149] In another exemplary embodiment, the convolutional attention mechanism submodule includes a channel attention mechanism and a spatial attention mechanism; the fusion feature unit 702 is also used to obtain the weight value of the embedded feature through the channel attention mechanism and the spatial attention mechanism; the embedded feature and the weight value are multiplied to obtain the result feature, and the result feature is used as the fusion feature.

[0150] In another exemplary embodiment, the similarity unit 703 is also used to construct prototype representations of support samples in the point graph and the distribution graph respectively; obtain the target prototype representation corresponding to the preset base class support sample, integrate the target prototype representation to obtain the target prototype vector; embed the target prototype vector into the node in the graph neural network to obtain the prototype node.

[0151] In another exemplary embodiment, the similarity unit 703 is also used to obtain the Euclidean distance between each node in the graph neural network and the prototype node; and obtain the node similarity between the corresponding each node in the graph neural network and the prototype node based on the Euclidean distance calculation.

[0152] In another exemplary embodiment, the neural network construction unit 704 is also used to perform a preset number of mutual propagation updates on the point graph and the distribution graph based on the node embedding features and the edge features; obtain the point graph after each update and the distribution graph after each update, and obtain a preset number of offspring based on the updated point graph and the updated distribution graph, and the value of the preset number is equal to the value of the preset number of times; and obtain a prototype embedded graph neural network based on the preset number of offspring.

[0153] In another exemplary embodiment, the apparatus further comprises:

[0154] The loss unit is used to obtain the point loss corresponding to the point map of the last child in the prototype embedded graph neural network, and the distribution loss corresponding to the distribution map of the last child; perform weighted summation of the point loss and the distribution loss to obtain the target loss function; perform loss processing on the prototype embedded graph neural network based on the target loss function, so as to use the processed prototype embedded graph neural network to perform classification prediction on the query sample.

[0155] It should be noted that the classification device for small sample images provided in the above embodiment and the classification method for small sample images provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here. In practical applications, the classification device for small sample images provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0156] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the small sample image classification method provided in the above-mentioned embodiments.

[0157] Figure 8 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0158] like Figure 8As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0159] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.

[0160] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.

[0161] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0162] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the above-mentioned module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0163] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0164] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the classification method of the small sample image as described above is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0165] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the classification method of the small sample image provided in each of the above embodiments.

[0166] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A classification method for small sample images, characterized in that: The method comprises: Obtain support samples and query samples of small sample images; Extracting the embedded features of the support sample, and obtaining fused features based on the embedded features using a preset multi-scale feature fusion module; Using a preset prototype measurement module to construct a prototype node in the graph neural network based on the support sample, and obtaining the node similarity between each node in the graph neural network and the prototype node; The fusion feature and the node similarity are used as the node embedding feature and the edge feature of the graph neural network respectively, and a dual-graph structure is cyclically updated for a preset number of times based on the node embedding feature and the edge feature to obtain a prototype embedded graph neural network; The prototype embedded graph neural network is used to perform classification prediction on the query sample to obtain the image category label of the query sample, and the image category label is mapped to the query sample.

2. The method according to claim 1, characterized in that The multi-scale feature fusion module includes a dilated spatial convolutional pooling pyramid submodule and a convolutional attention mechanism submodule; The step of extracting the embedded features of the support samples and obtaining fused features based on the embedded features using a preset multi-scale feature fusion module includes: Using the dilated spatial convolution pooling pyramid submodule, performing dilated convolution parallel sampling on the support samples according to a preset sampling rate to obtain embedded features of the support samples; The weight value of the embedded feature is obtained through the convolutional attention mechanism submodule, and a fusion feature is obtained based on the embedded feature and the weight value.

3. The method according to claim 2, characterized in that The convolutional attention mechanism submodule includes a channel attention mechanism and a spatial attention mechanism; The step of obtaining the weight value of the embedded feature through the convolutional attention mechanism submodule, and obtaining a fusion feature based on the embedded feature and the weight value, includes: Obtaining a weight value of the embedded feature through the channel attention mechanism and the spatial attention mechanism; The embedded feature and the weight value are multiplied to obtain a result feature, and the result feature is used as a fusion feature.

4. The method according to claim 1, characterized in that: The method of using a preset prototype measurement module to construct a prototype node in the graph neural network based on the supporting samples includes: Construct prototype representations of support samples in dot plots and distribution plots respectively; Obtaining a target prototype representation corresponding to a preset base class support sample, and integrating the target prototype representation to obtain a target prototype vector; The target prototype vector is embedded into a node in the graph neural network to obtain a prototype node.

5. The method according to claim 1, characterized in that The obtaining of the node similarity between each node in the graph neural network and the prototype node includes: Obtaining the Euclidean distance between each node in the graph neural network and the prototype node; The node similarity between each corresponding node in the graph neural network and the prototype node is calculated based on the Euclidean distance.

6. The method according to any one of claims 1 to 5, characterized in that: The step of performing a preset number of dual-graph structure cyclic updates based on the node embedding features and the edge features to obtain a prototype embedded graph neural network includes: Based on the node embedding features and the edge features, the point graph and the distribution graph are mutually propagated and updated a preset number of times; Obtaining each updated point graph and each updated distribution graph, and obtaining a preset number of offspring based on the updated point graph and the updated distribution graph, wherein the value of the preset number is equal to the value of the preset number of times; A prototype embedding graph neural network is obtained based on the preset number of offspring.

7. The method according to claim 6, characterized in that The method further comprises: Obtaining the point loss corresponding to the point graph of the last child in the prototype embedding graph neural network and the distribution loss corresponding to the distribution graph of the last child; Performing a weighted summation on the point loss and the distribution loss to obtain a target loss function; The prototype embedding graph neural network is subjected to loss processing based on the target loss function, so as to utilize the processed prototype embedding graph neural network to perform classification prediction on the query sample.

8. A classification device for small sample images, characterized in that: include: A sampling unit, used to obtain support samples and query samples of small sample images; A fusion feature unit, used for extracting the embedded features of the support sample, and obtaining fusion features based on the embedded features using a preset multi-scale feature fusion module; A similarity unit is used to construct a prototype node in the graph neural network based on the support sample using a preset prototype measurement module, and obtain the node similarity between each node in the graph neural network and the prototype node; A neural network construction unit, used to use the fusion feature and the node similarity as the node embedding feature and the edge feature of the graph neural network respectively, and perform a preset number of dual-graph structure cyclic updates based on the node embedding feature and the edge feature to obtain a prototype embedded graph neural network; A classification prediction unit is used to use the prototype embedded graph neural network to perform classification prediction on the query sample, obtain the image category label of the query sample, and map the image category label to the query sample.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the small sample image classification method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the small sample image classification method according to any one of claims 1 to 7.