A small sample picture classification method and system based on distribution optimization

By combining a distributed optimization network with virtual generated samples, virtual abnormal samples are generated and the loss function is optimized. This solves the problem of poor model performance in few-shot learning, improves the model's discrimination ability and robustness, and significantly improves the accuracy of few-shot image classification.

CN121053471BActive Publication Date: 2026-02-10NANJING BIG DATA GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511588860.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-03
Publication Date
2026-02-10
Estimated Expiration
2045-11-03

AI Technical Summary

Technical Problem

In few-shot learning, traditional distribution optimization methods rely on a large number of training samples, which cannot provide enough data to support similarity measurement with a limited number of samples, resulting in poor model performance in few-shot scenarios.

Method used

By combining a distributed optimization network with virtual generated samples, virtual anomaly samples are generated using a preheating network. A distributed optimization loss function is constructed to enhance the model's discriminative ability and robustness. Virtual anomaly samples are generated using multivariate Gaussian distribution sampling, and their uncertainty scores are calculated to optimize feature extraction and classification.

Benefits of technology

The generated virtual anomaly samples enhance the model's training data, improve the model's discriminative ability and robustness by optimizing the loss function through distribution, enhance the discriminativeness and generalization of feature distribution, and significantly improve the classification accuracy under small sample conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121053471B_ABST
    Figure CN121053471B_ABST
Patent Text Reader

Abstract

The application discloses a small sample picture classification method and system based on distribution optimization, and the method comprises the following steps: using a task-based episode training strategy, performing a small sample picture classification task on each episode, using a neural network as a preheating network to calculate a category-related prototype, constructing a preheating loss function to train the preheating network until convergence; taking the parameters of the trained preheating network as the initial value of the distribution optimization network parameters, selecting samples located near the category decision boundary to provide a reference point for the generation of virtual abnormal samples, then generating virtual abnormal samples based on the boundary samples by using multivariate Gaussian distribution sampling, calculating the uncertainty score of the virtual abnormal samples to construct a distribution optimization loss function, training the distribution optimization network until convergence; and using the trained distribution optimization network to classify the sample pictures to be tested. The application can improve the model classification and discrimination ability and robustness under the condition of small samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to image classification technology, and more particularly to a few-sample image classification method and system based on distribution optimization. Background Technology

[0002] Image classification is a core task in computer vision, widely applied in areas such as face recognition, medical diagnosis, and autonomous driving. In recent years, machine learning methods have greatly propelled the development of image classification technology. However, machine learning methods typically rely on a large number of labeled samples during training. While this data-driven approach has achieved significant results on large datasets, it still faces many challenges in practical applications. In many real-world scenarios, labeling data requires substantial time and manpower, making high-quality labeled data relatively scarce. Therefore, few-shot learning has been proposed. Few-shot learning aims to learn quickly using a small number of labeled samples and achieve accurate classification of unseen test samples.

[0003] Distribution optimization is an important learning method in machine learning. It focuses on defining and learning similarity metrics between samples. By effectively measuring the distance or similarity between samples, it can better distinguish samples from different categories. Similarity metrics can capture the inherent structure and features of data, helping to improve the performance of tasks such as classification and clustering. However, traditional distribution optimization methods often rely on a large number of training samples, typically requiring a large amount of training data to learn the similarity metric. In few-shot learning, due to the limited number of samples in each category, it may not provide enough data to support the accurate learning of the similarity metric, leading to poor performance of distribution optimization models in few-shot scenarios. Summary of the Invention

[0004] Purpose of the invention: The present invention aims to provide a distribution-optimized small-sample image classification method and system that can improve the model's classification and discrimination ability and robustness in the case of small samples.

[0005] Technical Solution: The present invention provides a few-sample image classification method based on distribution optimization, which classifies images using a distribution optimization network and virtually generated samples, including the following steps:

[0006] (1) Using a task-based episode training strategy, perform a small sample image classification task for each episode, use a neural network as a warm-up network to calculate the category-related prototype, construct a warm-up loss function to train the warm-up network until convergence;

[0007] (2) The parameters of the preheating network are used as the initial values ​​of the parameters of the distribution optimization network. Samples located near the category decision boundary are selected to provide a reference point for the generation of virtual anomaly samples. Then, virtual anomaly samples are generated by sampling the boundary samples using a multivariate Gaussian distribution. The uncertainty score of the virtual anomaly samples is calculated to construct the distribution optimization loss function. The distribution optimization network is trained until convergence.

[0008] (3) Use the trained distribution optimization network to extract features from the test sample image, calculate the similarity between the test sample and the prototype of each category, and obtain the category with the highest similarity as the classification result of the test sample image.

[0009] Preferably, before step (1), a data preprocessing stage is included, in which the image dataset is divided into a training set and a test set, and the training set data is augmented by methods such as horizontal flipping, image jittering, and random cropping, and the test set data is cropped to a specified size using the center cropping method.

[0010] Preferably, the construction of the preheating loss function in step (1) includes:

[0011] (a) Constructing cross-entropy loss :

[0012]

[0013] in, For small sample classification tasks query set of each subtask for Number of images included. For query set The feature vector of sample q in the middle. The labels are for the corresponding samples. For category weights, For normalized classification functions;

[0014] (b) Constructing the distribution radius loss :

[0015]

[0016]

[0017] in, Indicate category Distribution radius loss; Indicate category The distribution radius; This indicates a trade-off with hyperparameters; Represents the quantile function. Indicates the specific quantile, Represents the category prototype of category c; For small sample classification tasks The support set for each subtask is a dataset with class c, where C represents the number of classes. Let t be the feature vector of sample t. The labels for the corresponding samples; Indicate category The prototype and its negative sample Euclidean distance;

[0018] (c) Constructing multi-relationship loss :

[0019]

[0020]

[0021]

[0022] in, Indicate category The multivariate relation loss function for positive samples. Indicate category The multivariate relation loss function for negative samples, and Indicates adjustable hyperparameters; Indicate category The distribution radius;

[0023] The preheating loss function L is: L = + + .

[0024] Preferably, selecting samples located near the category decision boundary in step (2) includes:

[0025] For category Assuming that positive samples of the same type constitute a category Positive sample set Negative samples constitute the category negative sample set ;

[0026] For any sample in the negative sample set The k-NN algorithm is used to find its first positive sample. nearest neighbor samples And calculate the distance:

[0027]

[0028] Reflects negative samples and categories The degree of similarity; selection A category is composed of several negative samples. Boundary sample set This provides a benchmark for generating virtual anomaly samples. Represents a constant. To optimize the network for distribution, To optimize network parameters for distribution, This represents the feature value of sample x.

[0029] Preferably, the generation of virtual anomaly samples in step (2) includes:

[0030] For any boundary sample Virtual samples are generated by sampling from a multivariate Gaussian distribution, centered on the mapping of the sample in the feature space:

[0031]

[0032] in, Indicates the first A collection of virtual anomaly samples for the class. The variance coefficient represents the breadth of control sample production. Represents the identity matrix.

[0033] Preferably, in step (2), the distributed optimization loss function L D for:

[0034]

[0035] in Represents the mean function, Indicates the first Class sampling virtual anomaly samples A set; This represents a nonlinear multilayer perceptron. Indicates the uncertainty score of the sample. In a few-sample classification task, the support set S is represented. i In a dataset of category c, x represents a subset of the set. The extracted samples, C represents the number of categories;

[0036] For virtual abnormal samples Its eigenvalues ​​are obtained through linear transformation. :

[0037]

[0038] in, This represents the network parameters of the penultimate layer in a distributed optimization network;

[0039] Based on virtual anomaly samples eigenvalues, calculate their uncertainty scores for:

[0040]

[0041] in, This represents the element corresponding to category c in the output feature value of the last layer of the distribution optimization network.

[0042] Preferably, step (3) includes: calculating the similarity between the test sample and the prototype of each category. :

[0043]

[0044] in Given an unknown sample vector, the similarity between the input sample image and each category prototype is calculated using the above formula. The label corresponding to the category with the highest similarity is the label of the input image sample.

[0045] The present invention discloses a few-sample image classification system based on distribution optimization, comprising:

[0046] The preheating network training module is used to perform a few-sample image classification task for each episode using a task-based episode training strategy. It utilizes a neural network as a prototype for calculating category correlation and constructs a preheating loss function to train the preheating network until convergence.

[0047] The distributed optimization network training module is used to take the parameters of the pre-trained warm-up network as the initial values ​​of the distributed optimization network parameters, select samples located near the category decision boundary to provide a reference point for the generation of virtual anomaly samples, and then generate virtual anomaly samples based on the boundary samples using multivariate Gaussian distribution sampling. The uncertainty score of the virtual anomaly samples is calculated to construct the distributed optimization loss function, and the distributed optimization network is trained until convergence.

[0048] The image prediction and classification module is used to extract features from the test sample image using a pre-trained distribution optimization network, calculate the similarity between the test sample and the prototype of each category, and obtain the category with the highest similarity as the classification result of the test sample image.

[0049] The present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it implements the aforementioned distribution-optimized few-sample image classification method.

[0050] The present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the aforementioned distribution-optimized few-sample image classification method.

[0051] Beneficial Effects: Compared with existing technologies, this invention has the following significant advantages: 1. The generated virtual anomaly samples can further enhance the usable training data under small sample sizes. The generated virtual anomaly samples are located at the distribution boundary of existing samples. By optimizing the distribution loss function, the model's score on existing samples is higher than that on virtual samples, further enhancing the model's discriminative ability and robustness. A better feature distribution is constructed among existing samples, enabling the model to generate more discriminative feature vectors. 2. During the preheating of network training, compared with the single cross-entropy loss, the distribution radius loss ensures that all positive samples of a certain category do not collapse to the class center. It also allows some negative samples similar to the class center to maintain a relatively small distance from the class center, which can enhance the model's generalization ability. The multivariate loss function can understand the similarity and difference within sample pairs, further refining the understanding of the internal structure of each category. At the same time, by considering the relative relationship between sample pairs, the multivariate loss function can capture a wider range of relationships between samples, thereby more comprehensively understanding the distribution information in the feature space. Attached Figure Description

[0052] Figure 1 This is a flowchart of the method of the present invention;

[0053] Figure 2 This is a flowchart of the model iterative training phase of the present invention;

[0054] Figure 3 This is a comparison chart of classification detection accuracy in embodiments of the present invention. Detailed Implementation

[0055] The technical solution of the present invention will be further described below with reference to the accompanying drawings.

[0056] like Figure 1 As shown, the small sample image classification method based on distribution optimization described in this invention includes a data preprocessing stage, a distribution optimization network model iterative training stage, and an image classification prediction stage.

[0057] (1) Data preprocessing stage

[0058] This embodiment uses the miniImageNet dataset. miniImageNet is a commonly used image classification dataset for evaluating and comparing the performance of different image classification algorithms. It is a smaller version of the ImageNet dataset, designed to provide a smaller-scale dataset, i.e., a small-sample dataset.

[0059] (1.1) The miniImageNet dataset is randomly divided into training and test sets in an 8:2 ratio.

[0060] (1.2) The training set data is augmented by horizontal flipping, image jittering, random cropping, etc., and the test set is cropped to a specified size using the center cropping method.

[0061] In this embodiment, a center-cropping method is used for the images in the training set. This involves cropping an 84×84 pixel image from the outside in, using the image center as a reference while maintaining the image center. For images smaller than the specified size, zeros are padded around the original image before center-cropping.

[0062] Data augmentation was performed on the training set. First, images were horizontally flipped with a 50% probability, changing the orientation of some parts of the image. Next, image dithering was used to randomly adjust the brightness, contrast, and saturation of the images, causing the image feature values ​​to vary randomly between 0.6 and 1.4, thus increasing the diversity of the samples. Then, image rotation was used to generate new data within the range of -10 degrees to 10 degrees, further increasing the number of samples. Finally, random cropping was used to randomly crop the images to different sizes and change the aspect ratio, then scale them to 84×84 pixels, thus randomly preserving some features of the original images and further enriching the dataset.

[0063] (2) The iterative training phase of the distributed optimization network model is mainly divided into the distributed optimization network warm-up phase and the distributed optimization network formal training phase, such as Figure 2 As shown.

[0064] (2.1) Distribution optimization network warm-up stage, pre-optimize feature extraction network.

[0065] (2.1.1) A randomly initialized ResNet12 is used as a warm-up network. A task-based episode training strategy is used to perform a small sample classification task for each episode. The class-related prototype is calculated using the warm-up network. The warm-up network is trained based on the warm-up loss function until convergence.

[0066] First, the preheating network is randomly initialized. Learnable parameters in For a small sample preheating task , For the preheating stage Sub-tasks For the first Support sets in each subtask For the first query sets in each subtask They are the same, and contain the same number of categories. .category Category prototype for:

[0067]

[0068] in, In a few-sample classification task, the first... Support set for each subtask This represents the dataset with category c. express Size, Let be the feature vector of the t-th sample. The labels are for the corresponding samples. To warm up the network;

[0069] (2.1.2) Calculate the sum of distances between the prototype in category c and other samples of the same category. :

[0070]

[0071] in, .

[0072] The weight of category c is calculated based on the distance between the category prototype and similar samples. : ,in This refers to the SoftMax function.

[0073] (2.1.3) Construct the preheating loss function of the preheating network and train the preheating network until it converges.

[0074] (a) Constructing cross-entropy loss

[0075]

[0076] in, For small sample classification tasks query set of each subtask for Number of images included. For query set The feature vector of sample q in the middle. The labels are for the corresponding samples. For category weights, For the normalized classification function, each category The normalized classification score is .

[0077] (b) Constructing the distribution radius loss :

[0078]

[0079]

[0080] in, Indicate category The distribution radius loss is calculated by estimating the distribution radius of the class through the distance between negative sample pairs. Distribution radius The smaller the better; Represents the quantile function. This indicates a trade-off with hyperparameters. Indicates the specific quantile.

[0081] The purpose of constructing the distribution radius loss is to keep the anchor point of each class and the positive sample relatively small. By Setting it to a smaller value ensures that all positive samples and their corresponding anchor points maintain a small value, and conversely, collapses to the corresponding anchor point; the anchor point refers to the class center of each class. Another purpose of constructing the distribution radius loss is to ensure that the distance between the negative samples and the anchor point is greater than the distance between the negative samples and the anchor point. To avoid overfitting, this loss is achieved by introducing a quantile function. Allow some categories Negative samples and categories The distance between anchor points is less than .

[0082] (c) Constructing multi-relationship loss :

[0083]

[0084]

[0085]

[0086] in, Indicate category The multivariate relation loss function for positive samples. Indicate category The multivariate relation loss function for negative samples, and This indicates adjustable hyperparameters.

[0087] The derivative of the loss with respect to a sample is the weight of that loss for that sample. After differentiation, the weight of a positive sample is determined not only by itself (self-relationship) but also by other positive samples (mutual relationship). Similarly, for... After differentiation, the weight of a negative sample is determined not only by itself (self-relationship) but also by other negative samples (mutual relationship).

[0088] The preheating network loss function L is constructed using the above loss function, and the preheating network is iteratively trained using this loss function. The preheating network loss function L is: L = + + .

[0089] The preheating network loss function constructed in this invention, compared to a single cross-entropy loss, uses a distribution radius loss that prevents all positive samples of a certain category from collapsing to the class center. It also allows some negative samples similar to the class center to maintain a relatively small distance from the class center, thus enhancing the model's generalization ability. Furthermore, the multivariate loss function can understand the similarities and differences within sample pairs, further refining the understanding of the internal structure of each category. Simultaneously, by considering the relative relationships between sample pairs, the multivariate loss function can capture a broader range of relationships between samples, thereby providing a more comprehensive understanding of the distribution information in the feature space.

[0090] (2.2) Formal training phase of the distributed optimization network.

[0091] (2.2.1) The trained warm-up network parameters As a distributed optimization network Medium parameters The initial value. The distributed optimization network typically uses a small network such as ResNet12, but can also use ResNet50 or VIT networks.

[0092] (2.2.2) Select boundary samples. For category Assuming that positive samples of the same type constitute a category Positive sample set Negative samples constitute the category negative sample set .

[0093] For any sample in the negative sample set The k-NN algorithm is used to find its first positive sample. nearest neighbor samples And calculate the distance:

[0094]

[0095] Reflects negative samples and categories The degree of similarity, The smaller the value, the more likely the sample belongs to a certain category. The low-likelihood (low-probability) region of the distribution. Represents the feature values ​​of sample x. Select... Smaller value ( , A class is composed of several negative samples (representing a sufficiently small constant). Boundary sample set These boundary samples and categories The distance is relatively far, and it is a sensitive location in space, providing a reference point for the generation of virtual anomaly samples.

[0096] (2.2.3) Sampling virtual anomaly samples. For any boundary sample Virtual samples are generated by sampling from a multivariate Gaussian distribution, centered on the mapping of the sample in the feature space:

[0097]

[0098] in, Indicates the first A collection of virtual anomaly samples for the class. The variance coefficient represents the breadth of control sample production. Represents the identity matrix.

[0099] By sampling virtual abnormal samples, i.e. simulating negative samples, the model gains more comparative information between positive and abnormal samples, making it more discriminative.

[0100] (2.2.4) For virtual anomaly samples Its eigenvalues It can be obtained through linear transformation:

[0101]

[0102] in, This represents the network parameters of the penultimate layer in a distributed optimization network.

[0103] Calculate the uncertainty score based on the feature values ​​of the virtual anomaly sample. for:

[0104]

[0105] in, This represents the element corresponding to category c in the output feature value of the last layer of the distribution optimization network.

[0106] The calculation of uncertainty score provides a numerical indicator for distinguishing between positive and outlier samples.

[0107] (2.2.5) Calculate the distributed optimization loss function as L D for:

[0108]

[0109] in Represents the mean function, This represents a nonlinear multilayer perceptron. Indicates sample Uncertain score, In a few-sample classification task, the support set S is represented. i Given a dataset with class c, where C represents the number of classes, train the optimization network using a distribution optimization loss function until convergence.

[0110] (3) Prediction stage:

[0111] Calculate the similarity between the unknown query sample and the prototype of each category. :

[0112]

[0113] in The input image sample is an unknown query sample vector. The similarity between the input image sample and each category prototype is calculated using the above formula. The label corresponding to the category with the highest similarity is the label of the input image sample.

[0114] The image classification method based on distribution optimization and small sample size described in this invention is verified through simulation experiments. The model training and testing methods are implemented using Python, and the results are compared with existing methods such as ProtoNet, NN, OpenMax, and PEELER. Using miniImageNet as the dataset, the classification accuracy comparison results on a 5-way 5-shot task are as follows. Figure 3 As shown. All programs were executed on a standard server equipped with an Intel Core i7-8700 CPU, 3.20GHz, 32GB RAM, and an NVIDIA TITAN RTX processor. A ResNet12 neural network with ReLU activation was used, and the optimizer was set to Adam. During the model's iterative training phase, an initial learning rate of 0.1 was used, which was gradually reduced to one-tenth of its original value during training. From Figure 3 As can be seen, the image classification method based on distribution optimization of small samples described in this invention has a classification accuracy of 83.93%, which is much higher than the classification accuracy of other existing methods. It shows that it is more suitable for the special task of small sample learning and significantly improves the accuracy of image classification.

[0115] Based on the same inventive concept, the present invention provides a small sample image classification system based on distribution optimization, comprising:

[0116] The data preprocessing module is used to divide the dataset and augment the training set images;

[0117] The preheating network training module is used to perform a few-sample image classification task for each episode using a task-based episode training strategy. It utilizes a neural network as a prototype for calculating category correlation and constructs a preheating loss function to train the preheating network until convergence.

[0118] The distributed optimization network training module is used to take the parameters of the pre-trained warm-up network as the initial values ​​of the distributed optimization network parameters, select samples located near the category decision boundary to provide a reference point for the generation of virtual anomaly samples, and then generate virtual anomaly samples based on the boundary samples using multivariate Gaussian distribution sampling. The uncertainty score of the virtual anomaly samples is calculated to construct the distributed optimization loss function, and the distributed optimization network is trained until convergence.

[0119] The image prediction and classification module is used to extract features from the test sample image using a pre-trained distribution optimization network, calculate the similarity between the test sample and the prototype of each category, and obtain the category with the highest similarity as the classification result of the test sample image.

[0120] Based on the same inventive concept, the present invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when loaded onto the processor, implements the above-described distribution-optimized few-sample image classification method.

[0121] Based on the same inventive concept, this invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned distribution-optimized few-sample image classification method. The computer-readable storage medium may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage devices, magnetic disk storage devices or other magnetic storage devices, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and is accessible by a computer.

Claims

1. A few-sample image classification method based on distribution optimization, characterized in that, Image classification using distributed optimization networks and virtual generated samples includes the following steps: (1) Using a task-based episode training strategy, a small sample image classification task is performed for each episode. The neural network is used as a warm-up network to calculate the category-related prototype. A warm-up loss function is constructed to train the warm-up network until convergence. The construction of the preheating loss function in step (1) includes: (a) Constructing cross-entropy loss : in, For small sample classification tasks query set of each subtask for Number of images included. For query set The feature vector of sample q in the middle. The labels are for the corresponding samples. For category weights, For normalized classification functions; (b) Constructing the distribution radius loss : in, Indicate category Distribution radius loss; Indicate category The distribution radius; This indicates a trade-off with hyperparameters; Represents the quantile function. Indicates the specific quantile, Represents the category prototype of category c; For small sample classification tasks The support set for each subtask is a dataset with class c, where C represents the number of classes. Let t be the feature vector of sample t. The labels for the corresponding samples; Indicate category The prototype and its negative sample Euclidean distance; (c) Constructing multi-relationship loss : in, Indicate category The multivariate relation loss function for positive samples. Indicate category The multivariate relation loss function for negative samples, and Indicates adjustable hyperparameters; Indicate category The distribution radius; The preheating loss function L is: L = + + ; (2) The parameters of the preheating network are used as the initial values ​​of the parameters of the distribution optimization network. Samples located near the category decision boundary are selected to provide a reference point for the generation of virtual anomaly samples. Then, virtual anomaly samples are generated by sampling the boundary samples using a multivariate Gaussian distribution. The uncertainty score of the virtual anomaly samples is calculated to construct the distribution optimization loss function. The distribution optimization network is trained until convergence. In step (2), the distributed optimization loss function L D for: in Represents the mean function, Indicates the first Class sampling virtual anomaly samples A set; This represents a nonlinear multilayer perceptron. Indicates the uncertainty score of the sample. In a few-sample classification task, the support set S is represented. i In a dataset of category c, x represents a subset of the set. The extracted samples, C represents the number of categories; For virtual abnormal samples Its eigenvalues ​​are obtained through linear transformation. : in, This represents the network parameters of the penultimate layer in a distributed optimization network; Based on virtual anomaly samples eigenvalues, calculate their uncertainty scores for: in, This represents the element corresponding to category c in the output feature value of the last layer of the distribution optimization network; (3) Use the trained distribution optimization network to extract features from the test sample image, calculate the similarity between the test sample and the prototype of each category, and obtain the category with the highest similarity as the classification result of the test sample image.

2. The few-sample image classification method based on distribution optimization according to claim 1, characterized in that, Before step (1), there is also a data preprocessing stage, in which the image dataset is divided into a training set and a test set, the training set data is augmented, and the test set data is cropped to a specified size using the center cropping method.

3. The few-sample image classification method based on distribution optimization according to claim 1, characterized in that, Step (2) involves selecting samples located near the class decision boundary, including: For category Assuming that positive samples of the same type constitute a category Positive sample set Negative samples constitute the category negative sample set ; For any sample in the negative sample set The k-NN algorithm is used to find its first positive sample. nearest neighbor samples And calculate the distance: in, Reflects negative samples and categories The degree of similarity; selection A category is composed of several negative samples. Boundary sample set This provides a benchmark for generating virtual anomaly samples. Represents a constant. To optimize the network for distribution, To optimize network parameters for distribution, This represents the feature value of sample x.

4. The few-sample image classification method based on distribution optimization according to claim 3, characterized in that, The generation of virtual anomaly samples in step (2) includes: For any boundary sample Virtual samples are generated by sampling from a multivariate Gaussian distribution, centered on the mapping of the sample in the feature space: in, Indicates the first A collection of virtual anomaly samples for the class. The variance coefficient represents the breadth of control sample production. Represents the identity matrix.

5. The few-sample image classification method based on distribution optimization according to claim 1, characterized in that, Step (3) includes: calculating the similarity between the test sample and the prototype of each category. : in Given an unknown sample vector, the similarity between the input sample image and each category prototype is calculated using the above formula. The label corresponding to the category with the highest similarity is the label of the input image sample.

6. A few-sample image classification system based on distribution optimization, used to implement the few-sample image classification method based on distribution optimization as described in any one of claims 1-5, characterized in that, include: The preheating network training module is used to perform a few-sample image classification task for each episode using a task-based episode training strategy. It utilizes a neural network as a prototype for calculating category correlation and constructs a preheating loss function to train the preheating network until convergence. The distributed optimization network training module is used to take the parameters of the pre-trained warm-up network as the initial values ​​of the distributed optimization network parameters, select samples located near the category decision boundary to provide a reference point for the generation of virtual anomaly samples, and then generate virtual anomaly samples based on the boundary samples using multivariate Gaussian distribution sampling. The uncertainty score of the virtual anomaly samples is calculated to construct the distributed optimization loss function, and the distributed optimization network is trained until convergence. The image prediction and classification module is used to extract features from the test sample image using a pre-trained distribution optimization network, calculate the similarity between the test sample and the prototype of each category, and obtain the category with the highest similarity as the classification result of the test sample image.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the small sample image classification method based on distribution optimization according to any one of claims 1-5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the small sample image classification method based on distribution optimization according to any one of claims 1-5.

Citation Information

Patent Citations

  • Pedestrian re-identification method and system based on circle loss measurement under meta-learning framework

    CN114120367A

  • Mineral resource classification prediction method and system based on multi-source small sample joint learning

    CN116484295A