A small sample classification method based on fusion attribute and attribute distribution similarity

By constructing meta-training and test sets in few-shot learning, and using WordNet to obtain the intersection of attribute labels, we can calculate the similarity between category features and attribute distributions. This solves the problems of high computational resource consumption and time-consuming manual annotation in existing methods, and achieves more efficient classification results.

CN116503638BActive Publication Date: 2025-11-18UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310176826.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2025-11-18
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

Existing few-shot learning methods suffer from high computational resource consumption, time-consuming and labor-intensive reliance on manual annotation, limited room for improvement in global feature classification performance, and fail to fully utilize training set information.

Method used

By constructing a meta-training set and a meta-test set, using WordNet to obtain the intersection of attribute labels, calculating the similarity between category features and attribute distributions, and combining feature similarity for classification, we can achieve adaptive fusion of attribute information and make full use of training set information.

Benefits of technology

It improves the accuracy and efficiency of small sample classification, reduces the demand for computing resources, reduces the reliance on manual annotation, and enhances the model's classification performance on small datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116503638B_ABST
    Figure CN116503638B_ABST
Patent Text Reader

Abstract

The application provides a self-adaptive attribute distribution similarity classification method based on small sample learning, which completes the classification of images according to the similarity between image attributes. The method comprises the following steps: step 1, constructing a meta-training set and image processing; step 2, pre-training; step 3, constructing a training task from the data set according to the scene training mode and performing meta-training on the meta-training set; step 4, attribute synthesis; step 5, attribute residual removal; step 6, calculating the feature similarity and the attribute distribution similarity; and step 7, calculating the result. In the method, the attributes are obtained without expert labeling, so compared with the original attribute-based work, the application is extended to the data set without labeled attribute vectors; the application also provides a new idea for the development of small sample learning; when the attribute similarity is calculated, the application is different from the previous methods, and the application considers the data set without attribute labeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, specifically a small-sample classification method based on fusion attributes and attribute distribution similarity. Background Technology

[0002] While deep learning has achieved tremendous success in image recognition, its reliance on massive amounts of labeled data has remained a major pain point. Manually labeling large amounts of data is extremely time-consuming and labor-intensive, but without labeled data, the lack of a dataset can lead to overfitting and poor generalization. Few-shot learning has provided a revolutionary solution. Furthermore, with the continuous development of few-shot learning, many methods have emerged, such as gradient-update-based meta-learning methods, graph neural network-based methods, and attribute-based methods. However, most few-shot learning methods employ a strategy of pre-training followed by a meta-learning testing phase. The key to this approach is how to pre-train an initial model using the training set and then fine-tune the model parameters using the test set during the testing phase to obtain a model suitable for new sample sets. This also means that the meta-learning testing phase does not utilize information from the training set to optimize the model, but this does not mean that the training set cannot help optimize the model using the test set.

[0003] Based on current progress in few-shot learning, the question of how to continue utilizing the training set during the testing phase of meta-learning mainly involves fusing information from the training set with information from the testing set used for fine-tuning to enhance the representativeness of the class to be classified and to supplement image information. This approach is quite complex and has high usage requirements, but it is still adopted by many methods and engineering projects.

[0004] Attribute-based methods are one of the representative approaches. Simply put, the network continuously enhances sample information through attribute features to optimize the model. First, most of these methods rely on attributes labeled by experts. Therefore, the level of expertise of the experts, the angle and method of labeling, and even the range and number of attributes selected can lead to significant differences in classification results. Finding a simple and easily understood alternative method is a major challenge. Second, this type of approach generally utilizes two methods: one is to enhance information using attributes, as mentioned above, by fusing attributes with information about the category to be classified, thus filling in the missing information; the second is to use sensitive attributes for classification. However, this does not mean that insensitive attributes have no effect on classification performance. Therefore, utilizing insensitive attributes is also a problem that urgently needs to be solved.

[0005] Currently, numerous methods exist to address this problem through pre-training because pre-training offers powerful feature extraction capabilities, thus enhancing the performance of network models. Furthermore, pre-training our models helps us obtain more accurate attribute information.

[0006] Prior art related to this invention

[0007] Existing technical solution 1:

[0008] In 2021, Zhang et al. proposed a prototype completion method in "Prototype Completion With Primitive Knowledge for Few-Shot Learning." This method uses GloVe to obtain attribute vectors from the training set and then leverages WordNet to find the common attribute set between the training and test sets. Attributes are synthesized on the training set, and during the testing phase of meta-learning, the attributes obtained from the training set are synthesized into the classification information of the target category in the test set. This completes the prototype point information instead of relying solely on the prototype points obtained from the test set, thereby improving the model's classification accuracy.

[0009] Disadvantages of existing technical solution 1:

[0010] The above approach utilizes WordNet to find common attributes in the two training sets, and then uses information from the training sets to complete the information of the categories to be classified in the test set during the meta-learning testing phase. This method requires more computational resources; the completion process is very complex and relatively resource-intensive, and it does not consider the characteristic that classification can be performed using only the synthesized attributes. For the same category, they often have the same attribute features, or in other words, when calculating the sensitivity of attributes, the same class has similar sensitivities to the same attribute feature.

[0011] Existing technical solution two:

[0012] In 2021, Cao et al. proposed a classification method using manually labeled attribute vectors in "CONCEPT LEARNERS FOR FEW-SHOT LEARNING". This method uses manually labeled attributes for classification, selecting the most representative attribute for each class and calculating the similarity between attributes instead of using the similarity of global features. This model compares the similarity of attributes multiple times and achieves significant results.

[0013] Disadvantages of existing technical solution 2:

[0014] The attribute scheme used in this model is a very common approach, namely manually labeled attributes. This method is widely used in attribute-based few-shot learning. However, relying solely on manual labeling is highly dependent on human intervention and is not only time-consuming but also labor-intensive. Labeling also requires expert input. Secondly, the classification criterion is that classes of the same type have similar sensitivities to certain shared attributes. This method clearly fails to consider the sensitivity to attributes that none of the classes possess, resulting in insufficient reliability.

[0015] Existing technical solution three:

[0016] In 2022, the patent "A Task-Adaptive Few-Sample Image Classification Method Based on Meta-Transfer Learning" was published. This method utilizes global features of images for classification and proposes more challenging classification tasks. After multiple training iterations, the model can achieve better classification results when faced with more difficult tasks. This method enables the learner to learn faster and perform better on challenging tasks.

[0017] The disadvantages of the existing technical solution three:

[0018] The drawback of this method is that it utilizes global features for classification, which clearly underutilizes information; the data samples in the training set are merely used to help train an initial model. Furthermore, the global feature classification method has a limitation: excessive background interference restricts the improvement of classification performance, making it difficult to achieve better classification results simply by utilizing the global information of the image. Summary of the Invention

[0019] The powerful capabilities of neural networks are built upon massive datasets. However, many real-world problems lack sufficient datasets, such as those in medical research, aerospace research, and physical image analysis. In these cases, traditional neural network methods lose their effectiveness with small datasets, and few-shot learning emerged to address these problems. When the number of images is limited, fully utilizing image information becomes crucial for achieving good model performance. In real life, many images can be categorized based on their attributes. Therefore, this invention proposes an adaptive attribute distribution similarity classification method based on few-shot learning, using image attributes as a starting point to classify images according to the similarity between image attributes.

[0020] This invention is implemented as follows: a small-sample classification method based on fusion attributes and attribute distribution similarity is constructed, characterized by being carried out in the following manner;

[0021] Step 1: Constructing the meta-training set and image processing; Construct a meta-training set from more than 10,000 images, and preprocess the meta-training set; First, resize the images to 92x92px, then perform enhancement processing on the images, including random rotation and cropping; Output the processed images.

[0022] Step 2: Pre-training; Input the processed image into the deep convolutional neural network for pre-training, output the weight parameters θ of the feature extractor and the weight parameters φ of the classifier, and save the weight parameters θ of the feature extractor.

[0023] Step 3 involves constructing training tasks from the dataset using a scenario-based training approach and performing meta-training. Specifically, N classes are randomly selected from the training set, and K samples are randomly selected from each selected class as the support set, for a total of N*K samples. M samples are randomly selected from the N classes as the query set, ensuring that they do not overlap with the support set. Then, the training tasks are used to perform classic meta-training on the feature extractor and classifier in small sample scenarios to obtain the small sample basic classification network.

[0024] Step 4: Attribute Combination;

[0025] Step 5: Attribute Remainder Removal; Check the attributes after fusion calculation and remove the remainders for attributes with identical parameter values;

[0026] Step 6: Calculate feature similarity and attribute distribution similarity;

[0027] Step 7: Calculate the classification results.

[0028] According to the present invention, a few-sample classification method based on fusion attributes and attribute distribution similarity is characterized in that the meta-training process corresponding to step 3 is as follows;

[0029] 3.1 The support set from the training task is fed into the feature extractor to obtain N*K feature maps;

[0030] 3.2 Calculate the arithmetic mean of the feature maps belonging to the same category to obtain the category features, totaling N;

[0031] 3.3 Randomly select a sample from the query set and pass it into the feature extractor and classifier. The classifier calculates the cosine similarity with each category feature. After passing through the softmax function, the category similarity is normalized to obtain y(x i,j The normalization formula is:

[0032]

[0033] Where p i is the prediction result of the current query set sample for the i-th class; t is the t-th feature among N category features; e is the base of the exponentiation operation;

[0034] 3.4 Calculate the loss by combining the similarity and labels of all samples in the query set. The loss function is:

[0035]

[0036] Where L represents the loss result of the current training task; y k The true label for the sample's corresponding category is a one-hot label where each element is either 0 or 1, where 0 represents not belonging to that category and 1 represents belonging to that category; p i It is the result of softmax.

[0037] 3.5 Use gradient backpropagation to update the parameters of the network combining the feature extractor and classifier. Repeat the steps in step 3 until the network converges and the parameters are no longer updated, thus obtaining the small sample basic classification network.

[0038] According to the small sample classification method based on fused attributes and attribute distribution similarity described in this invention, the characteristic feature is that step 4 designs an attribute synthesis method, as follows:

[0039] 4.1 Constructing the meta-test set and obtaining the attribute labels of the dataset; Construct the meta-test set from the small sample image dataset to be classified, input the labels of the meta-training set and the meta-test set into WordNet, query the labels used to synthesize the attributes, and output the intersection of the labels of the two datasets. The labels obtained here are denoted as attribute labels.

[0040] 4.2 Calculate category features. The processed meta-training set is then fed back into the pre-trained feature extractor. For each class, category features are calculated using the following function:

[0041]

[0042] Where s (i) S represents the i-th feature. k For category sample data; F (θ) This represents a model with feature extractor weight parameters; x i and y i This represents the i-th sample and its label within the category;

[0043] 4.3 Calculated Attributes; Features of categories with the same attribute label are calculated using the following function:

[0044]

[0045] Where a (j) Represents the i-th attribute; F represents the set of samples that have the j-th attribute label category;(θ) This represents a model with feature extractor weight parameters; x i This represents the i-th sample and its label in the set that has attribute j.

[0046] According to the invention, a few-sample classification method based on fused attributes and attribute distribution similarity is characterized in that: step 6 calculates feature similarity and attribute distribution similarity; the meta-test set is divided into a support set and a query set, and a test task is constructed in the same way as the training task. The classification process of the test task has two steps, namely, attribute distribution similarity calculation and attribute distribution similarity calculation.

[0047] 6.1 The process of calculating feature similarity is as follows:

[0048] 6.1.1 Save the parameters of the small-sample basic classification network obtained from meta-training;

[0049] 6.1.2 Load the parameters of the few-shot basic classification network into the model. Use the support set from the test task to fine-tune the parameters of the few-shot basic classification network. The training process is the same as the meta-training in step 3. Training ends when the loss value stabilizes. After training, the feature extractor of the few-shot basic classification network is used to calculate the sample feature maps of the support set and query set for the test task. The arithmetic mean of each class feature map in the support set is calculated, resulting in N class features. The query set also contains M sample feature maps. The classifier calculates the feature similarity between each query set sample feature map and the support set class features using the similarity function:

[0050]

[0051] in s represents the similarity between the i-th query set feature and the n-th category feature; (n) It is the nth category feature of the support set; q i Let be the i-th query set sample; cosine(n,m) calculates the cosine similarity between n and m; T represents the matrix transpose operation;

[0052] 6.2 The process of calculating attribute distribution similarity is as follows:

[0053] 6.2.1: An adaptive task attribute selection mechanism is designed, which selects an attribute set E from the attribute set for each test task; after selecting H attributes, the distribution of the support set category features, query feature map, and attribute set E is calculated, and the distribution calculation function is:

[0054]

[0055] in q represents the attribute distribution of the i-th query feature map; iThe feature map representing the i-th sample in the query set; The attribute distribution representing the category feature of the nth support set; s (n) It supports the nth category feature; E is the set of H attributes;

[0056] The selection mechanism is as follows: First, calculate the similarity relationship between all attributes and each supporting class. Then, select h attributes with the highest cosine similarity for each class based on the similarity relationship. Take the intersection of all attributes, and the number of attributes in the intersection is H.

[0057] 6.2.2 Input the attribute distributions of the support set and the query samples, and calculate the attribute distribution correlation and similarity function:

[0058]

[0059] in This represents the similarity between the attribute distribution of the i-th query set and the attribute distribution of the category features of the n-th support set.

[0060] According to the present invention, a small-sample classification method based on fused attributes and attribute distribution similarity is characterized in that: step 7, calculating the classification result, involves: according to the actual classification task, inputting the training set and query set of the task into the small-sample basic classification network; calculating feature similarity and attribute distribution similarity designed in this patent based on the attribute synthesis mechanism and attribute selection mechanism designed in this patent; and using the linear fusion of attribute distribution similarity and category feature similarity as the final classification criterion, with the fusion function being:

[0061]

[0062] Here, α represents a parameter value set according to the experimental results, and the optimal range is generally between 0.35 and 0.5.

[0063] This invention has the following advantages: Taking image attributes as the starting point, it proposes an adaptive attribute distribution similarity classification method based on few-sample learning, which classifies images according to the similarity between image attributes. The innovation of this invention is as follows;

[0064] Attribute Acquisition: In traditional methods of augmenting data using attribute information, the attribute information comes from the dataset itself, with labels manually assigned. This invention takes a different approach, namely feature decoupling. This problem remains a major historical challenge in computer vision. For any category, it should have its own attributes, and the set of these attributes constitutes the category itself. This does not depend on human annotation and definition. This invention aims to acquire attribute vectors that are difficult to separate from feature vectors. In fact, similar categories within any broad class should share commonalities. For example, lions and tigers both belong to the large cat family, and they are similar in appearance and habits. This invention focuses on how to find these commonalities. How can these commonalities be obtained and standardized? More precisely, how can a fair attribute definition criterion be found without human interference? Currently, the attribute acquisition in this invention is mainly based on WordNet, a standard English data dictionary that describes the parts of each category. The acquired information is the attribute used in this invention. Since the attribute acquisition in this method does not require expert annotation, compared to previous attribute-based work, this invention extends to datasets with unlabeled attribute vectors.

[0065] Mining the content of training set data: Traditional methods utilize training sets primarily in two ways: First, they focus on training a task-sensitive model using the training set, achieving high accuracy with only a few iterations. Second, they utilize the training set to pre-train a model with good classification performance, then fine-tuning it to fit the new task. Furthermore, various classic metric learning methods mine and utilize the data in the training set, using the distance from query samples in the test set to the class to be classified during the classification phase. These methods clearly lack full utilization of the training set. This invention addresses this issue by proposing a solution, which also provides a new approach for the development of few-shot learning.

[0066] High applicability: Traditional classification methods that solely utilize attributes only consider attributes relevant to the category, neglecting attributes that are less relevant or completely unrelated. However, unrelatedness doesn't mean they're useless; the unrelatedness between attributes and features actually proves, in effect, that the feature lacks the attribute. Furthermore, it can be deduced that the same category theoretically shares the same attributes, meaning it has similar sensitivities to certain attributes. Therefore, the same category should also have similar sensitivities to attributes it lacks, differing only in the degree of sensitivity. Our method takes this into account; unlike previous methods, when calculating attribute similarity, we consider a set of attributes that are not sensitive to the feature. Attached Figure Description

[0067] Figure 1 This is a schematic diagram of stage one in the implementation of the present invention.

[0068] Figure 2 This is a schematic diagram of stage two in the implementation of the present invention.

[0069] Figure 3 This is a schematic diagram of stage three in the implementation of the present invention.

[0070] Figure 4 This is a scenario diagram used in the implementation of the present invention. Detailed Implementation

[0071] The following will be combined with the appendix Figures 1-4 This invention will be described in detail, and the technical solutions in the embodiments of this invention will be clearly and completely described. Obviously, the described embodiments are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0072] This invention provides an adaptive attribute distribution similarity classification method based on few-shot learning, which classifies images according to the similarity between image attributes. A detailed description follows.

[0073] The specific technical solution of this invention is as follows: This invention studies the small sample classification method in natural images, focusing on the technique of using training sets, and provides a detailed solution.

[0074] Few-sample classification suffers from problems such as small data volume, wide category range, and insufficient information utilization. We propose an attribute fusion method based on pre-training and a classification method based on attribute distribution similarity. Furthermore, we utilize a fusion technique of attribute distribution similarity and category feature similarity to improve the classification accuracy of small samples. The process of this invention mainly consists of the following three stages: 1. Training the original feature extractor and the basic classification network: A deep convolutional neural network is pre-trained using a meta-training set. The classifier used for classification is removed, and the original feature extractor is output. Then, the network is meta-trained to output the basic classification network. 2. The meta-training set and the meta-test set are input into WordNet to obtain the intersection of their attribute labels; the meta-training set is input into the original feature extractor to calculate its feature set; the attribute label set and feature set are calculated and duplicate attributes are removed to output the final feature set. 3. The meta-training set and meta-test set are input into the basic classification network. Based on their features, feature similarity is calculated and output. The meta-training set, meta-test set, and attribute set are input, and the attribute distributions of the meta-training set and attributes, and the attribute distributions of the meta-test set and attributes are calculated respectively. Then, the similarity between the attributes of the two sets is calculated, and the attribute distribution similarity is output. Finally, based on the attribute distribution similarity and feature similarity, the final classification result is obtained. Each step is detailed as follows... Figure 1 , Figure 2 , Figure 3 As shown.

[0075] Step 1: Constructing the Meta-Training Set and Image Processing: Construct a meta-training set from more than 10,000 images and preprocess it. First, resize all images to 92x92px. Then, perform enhancement processing on the images, including random rotation and cropping. Output the processed images.

[0076] Step 2: Pre-training: Input the processed image into the deep convolutional neural network for pre-training, output the weight parameters θ of the feature extractor and the weight parameters φ of the classifier, and save the weight parameters θ of the feature extractor.

[0077] Step 3: We construct training tasks from the dataset using a scenario-based training approach and perform meta-training. Specifically, we randomly select N classes from the training set, randomly select K samples from each selected class as the support set (a total of N*K samples), and randomly select M samples from the N classes as the query set, ensuring no overlap with the support sets. Then, we perform classic few-sample meta-training on the feature extractor and classifier using the training tasks, resulting in a few-sample basic classification network. The meta-training process is as follows:

[0078] 3.1 Input the support set from the training task into the feature extractor to obtain N*K feature maps.

[0079] 3.2 Calculate the arithmetic mean of the feature maps belonging to the same category to obtain the category features, totaling N features.

[0080] 3.3 Randomly select a sample from the query set and pass it into the feature extractor and classifier. The classifier calculates the cosine similarity with each category feature. After passing through the softmax function, the category similarity is normalized to obtain y(x i,j The normalization formula is:

[0081]

[0082] Where p i is the prediction result of the current query set sample for the i-th class; t is the t-th feature among N category features; e is the base of the exponentiation operation;

[0083] 3.4 Calculate the loss by combining the similarity and labels of all samples in the query set. The loss function is:

[0084]

[0085] Where L represents the loss result of the current training task; y i The true label for the sample's corresponding category is a one-hot label where each element is either 0 or 1, where 0 represents not belonging to that category and 1 represents belonging to that category; p i It is the result of softmax.

[0086] 3.5 Use gradient backpropagation to update the parameters of the network combining the feature extractor and classifier. Repeat the steps in step 3 until the network converges and the parameters are no longer updated, thus obtaining the small sample basic classification network.

[0087] Step 4: This patent designs an attribute synthesis method; the details are as follows:

[0088] 4.1 Constructing the meta-test set and obtaining attribute labels from the dataset: Construct the meta-test set from the small sample image dataset to be classified, input the labels of the meta-training set and the meta-test set into WordNet, query the labels used to synthesize the attributes, and output the intersection of the labels of the two datasets. The labels obtained here are denoted as attribute labels.

[0089] 4.2 Calculate category features. The processed meta-training set is then fed back into the pre-trained feature extractor. For each class, category features are calculated using the following function:

[0090]

[0091] Where s (i) S represents the i-th feature. k For category sample data; F (θ) This represents a model with feature extractor weight parameters; x iand y i This represents the i-th sample and its label within the category;

[0092] 4.3 Calculated Attributes; Features of categories with the same attribute label are calculated using the following function:

[0093]

[0094] Where a (j) Represents the i-th attribute; F represents the set of samples that have the j-th attribute label category; (θ) This represents a model with feature extractor weight parameters; x i This represents the i-th sample in the set that has attribute j.

[0095] Step 5: Attribute Remainder Removal: Check the attributes that have been calculated and remove the remainders for attributes with identical parameter values.

[0096] Step 6: Calculate feature similarity and attribute distribution similarity; Divide the meta-test set into a support set and a query set, and construct the test task in the same way as the training task. The classification process of the test task has two steps: attribute distribution similarity calculation and attribute distribution similarity calculation.

[0097] 6.1 The process of calculating feature similarity is as follows:

[0098] 6.1.1 Save the parameters of the small-sample basic classification network obtained from meta-training;

[0099] 6.1.2 Load the parameters of the few-shot basic classification network into the model. Use the support set from the test task to fine-tune the parameters of the few-shot basic classification network. The training process is the same as the meta-training in step 3. Training ends when the loss value stabilizes. After training, the feature extractor of the few-shot basic classification network is used to calculate the sample feature maps of the support set and query set for the test task. The arithmetic mean of each class feature map in the support set is calculated, resulting in N such maps, denoted as class features. The query set also contains M sample feature maps. The classifier calculates the feature similarity between each sample feature map of the query set and the class features of the support set. The similarity function is:

[0100]

[0101] in s represents the similarity between the i-th query set feature and the n-th category feature; (n) It is the nth category feature of the support set; q i Let be the i-th query set sample; cosine(n, m) calculates the cosine similarity between n and m; T represents the matrix transpose operation;

[0102] 6.2 The process of calculating attribute distribution similarity is as follows:

[0103] 6.2.1 An adaptive task attribute selection mechanism is designed, which selects an attribute set E from the attribute set for each test task; after selecting H attributes, the distribution of the support set category features, query feature map, and attribute set E is calculated, and the distribution calculation function is:

[0104]

[0105] ρ (n) support =cosine(s (n) E)

[0106] in q represents the attribute distribution of the i-th query feature map; i The feature map representing the i-th sample in the query set; The attribute distribution representing the category feature of the nth support set; s (n) It supports the nth category feature; E is the set of H attributes;

[0107] The selection mechanism is as follows: First, calculate the similarity relationship between all attributes and each supporting class. Then, select h attributes with the highest cosine similarity for each class based on the similarity relationship. Take the intersection of all attributes, and the number of attributes in the intersection is H.

[0108] 6.2.2 Input the attribute distributions of the support set and the query sample, and calculate the correlation between the attribute distribution similarities. The attribute distribution similarity function is:

[0109]

[0110] in This represents the similarity between the attribute distribution of the i-th query set and the attribute distribution of the category features of the n-th support set.

[0111] Step 7: Calculate the results; Based on the actual classification task, input the training set and query set from the task into the few-sample basic classification network. According to the attribute synthesis and selection mechanisms designed in this patent, calculate feature similarity and attribute distribution similarity designed in this patent for classification. The classification uses a linear fusion of attribute distribution similarity and category feature similarity as the final classification criterion. The fusion function is:

[0112]

[0113] Where 'a' represents a parameter value set based on the experimental results, and the optimal range is generally between 0.35 and 0.5.

[0114] Application Scenarios of this Invention: Traditional machine learning methods struggle to unleash their full potential when data is scarce. Insufficient data can easily lead to overfitting and other problems, significantly reducing the model's robustness. Few-shot learning is widely used as a solution to this problem. How to make the most of data has always been a major challenge in few-shot learning; underutilization of data leads to waste. Currently, insufficient data exists in various fields of few-shot learning. To maximize effectiveness, better data utilization has become a top priority. This invention proposes an adaptive attribute distribution similarity classification method based on few-shot learning, studying image attributes based on few-shot learning. Specifically, it utilizes WordNet or human-labeled tools to acquire image attributes, fuses them with training set information, fully utilizes the image training set information, and ultimately assists in image classification tasks. Figure 4 This is the application scenario of the present invention.

[0115] The innovativeness of this invention is as follows;

[0116] Attribute Acquisition: In traditional methods of augmenting data using attribute information, the attribute information comes from the dataset itself, with labels manually assigned. This invention takes a different approach, namely feature decoupling. This problem remains a major historical challenge in computer vision. For any category, it should have its own attributes, and the set of these attributes constitutes the category itself. This does not depend on human annotation and definition. This invention aims to acquire attribute vectors that are difficult to separate from feature vectors. In fact, similar categories within any broad class should share commonalities. For example, lions and tigers both belong to the large cat family, and they are similar in appearance and habits. This invention focuses on how to find these commonalities. How can these commonalities be obtained and standardized? More precisely, how can a fair attribute definition criterion be found without human interference? Currently, the attribute acquisition in this invention is mainly based on WordNet, a standard English data dictionary that describes the parts of each category. The acquired information is the attribute used in this invention. Since the attribute acquisition in this method does not require expert annotation, compared to previous attribute-based work, this invention extends to datasets with unlabeled attribute vectors.

[0117] Mining the content of training set data: Traditional methods utilize training sets primarily in two ways: First, they focus on training a task-sensitive model using the training set, achieving high accuracy with only a few iterations. Second, they utilize the training set to pre-train a model with good classification performance, then fine-tuning it to fit the new task. Furthermore, various classic metric learning methods mine and utilize the data in the training set, using the distance from query samples in the test set to the class to be classified during the classification phase. These methods clearly lack full utilization of the training set. This invention addresses this issue by proposing a solution, which also provides a new approach for the development of few-shot learning.

[0118] High applicability: Traditional classification methods that solely utilize attributes only consider attributes relevant to the category, neglecting attributes that are less relevant or completely unrelated. However, unrelatedness doesn't mean they are useless; the unrelatedness between attributes and features actually proves, in reverse, that the feature lacks the attribute. Furthermore, it can be deduced that the same category theoretically shares the same attributes, meaning it has similar sensitivities to certain attributes. Therefore, the same category should also have similar sensitivities to attributes it lacks, differing only in the degree of sensitivity. This invention takes this into account. When calculating attribute similarity, unlike previous methods, this invention considers a set of attributes that are not sensitive to the feature.

[0119] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A small-sample classification method based on fusion attributes and attribute distribution similarity, characterized in that; Implement as follows; Step 1: Constructing the meta-training set and image processing; Construct a meta-training set from more than 10,000 images, and preprocess the meta-training set; First, resize the images to 92x92px, then perform enhancement processing on the images, including random rotation and cropping; Output the processed images. Step 2: Pre-training; Input the processed image into the deep convolutional neural network for pre-training, output the weight parameters θ of the feature extractor and the weight parameters φ of the classifier, and save the weight parameters θ of the feature extractor. Step 3 involves constructing training tasks from the dataset using a scenario-based training approach and performing meta-training. Specifically, N classes are randomly selected from the training set, and K samples are randomly selected from each selected class as the support set, for a total of N*K samples. M samples are randomly selected from the N classes as the query set, ensuring that they do not overlap with the support set. Then, the training tasks are used to perform classic meta-training on the feature extractor and classifier in small sample scenarios to obtain the small sample basic classification network. Step 4, attribute composition, is as follows: 4.1 Construct the meta-test set and obtain the attribute labels of the dataset; Construct the meta-test set from the small sample image dataset to be classified, input the labels of the meta-training set and the meta-test set into WordNet, query the labels used to synthesize the attributes, and output the intersection of the labels of the two datasets. The labels obtained here are denoted as attribute labels. 4.2 Calculate category features. The processed meta-training set is then fed back into the pre-trained feature extractor. For each class, category features are calculated using the following function: Where s (i) S represents the i-th feature. i For the i-th category of sample data; F (θ) This represents a model with feature extractor weight parameters; x i and y i This represents the i-th sample and its label within the category; 4.3 Calculated Attributes; Features of categories with the same attribute label are calculated using the following function: Where a (j) Represents the i-th attribute; F represents the set of samples that have the j-th attribute label category; (θ) This represents a model with feature extractor weight parameters; x i This represents the i-th sample in the set that possesses attribute j; Step 5: Remove the remainder from the attributes; The attributes that have been calculated and merged are checked, and those with identical attribute parameter values ​​are removed. Step 6: Calculate feature similarity and attribute distribution similarity; Step 7: Calculate the classification results.

2. The small sample classification method based on fusion attributes and attribute distribution similarity according to claim 1, characterized in that; The meta-training process corresponding to step 3 is as follows; 3.1 The support set from the training task is fed into the feature extractor to obtain N*K feature maps; 3.2 Calculate the arithmetic mean of the feature maps belonging to the same category to obtain the category features, totaling N; 3.3 Randomly select a sample from the query set and pass it into the feature extractor and classifier. The classifier calculates the cosine similarity with each category feature. After passing through the softmax function, the category similarity is normalized to obtain p. i The normalization formula is: Where p i is the prediction result of the current query set sample for the i-th class; t is the t-th feature among N category features; e is the base of the exponentiation operation; 3.4 Calculate the loss by combining the similarity and labels of all samples in the query set. The loss function is: Where L represents the loss result of the current training task; y i The true label for the sample's category is a one-hot label where each element is either 0 or 1, where 0 represents not belonging to that category and 1 represents belonging to that category; p i It is the result of softmax. 3.5 Use gradient backpropagation to update the parameters of the network combining the feature extractor and classifier. Repeat the steps in step 3 until the network converges and the parameters are no longer updated, thus obtaining the small sample basic classification network.

3. The small sample classification method based on fusion attributes and attribute distribution similarity as described in claim 1, characterized in that; Step 6: Calculate feature similarity and attribute distribution similarity; Divide the meta-test set into a support set and a query set, and construct the test task in the same way as the training task. The classification process of the test task has two steps: attribute distribution similarity calculation and attribute distribution similarity calculation. 6.1 The process of calculating feature similarity is as follows: 6.1.1 Save the parameters of the small-sample basic classification network obtained from meta-training; 6.1.2 Load the parameters of the few-shot basic classification network into the model. Use the support set in the test task to fine-tune the parameters of the few-shot basic classification network. The training process is the same as the meta-training in step 3. When the loss value stabilizes, the training ends. After training, the feature extractor of the few-shot basic classification network is used to calculate the sample feature map of the support set query set of the test task. Calculate the arithmetic mean of the feature map of each class in the support set. There are N such features, which are denoted as class features. The query set contains M sample feature maps; the classifier calculates feature similarity between each query set's sample feature map and the support set's category features, using the following similarity function: in This represents the similarity between the i-th query set feature and the n-th category feature; s (n) It is the support set for the nth category feature; q i Let be the i-th query set sample; cosine(n, m) calculates the cosine similarity between n and m; T represents the matrix transpose operation; 6.2 The process of calculating attribute distribution similarity is as follows: 6.2.1: An adaptive task attribute selection mechanism is designed, which selects an attribute set E from the attribute set for each test task; after selecting H attributes, the distribution of the support set category features, query feature map, and attribute set E is calculated, and the distribution calculation function is: ρ i query =cosine(q i ,AND), ρ (n) support =cosine(s (n) ,E) Where ρ i query q represents the attribute distribution of the i-th query feature map; i The feature map representing the i-th sample in the query set; ρ (n) support The attribute distribution representing the category feature of the nth support set; s (n) It supports the nth category feature; E is the set of H attributes; The selection mechanism is as follows: First, calculate the similarity relationship between all attributes and each supporting class. Then, select h attributes with the highest cosine similarity for each class based on the similarity relationship. Take the intersection of all attributes, and the number of attributes in the intersection is H. 6.2.2: Input the attribute distributions of the support set and the query sample, and calculate the correlation and similarity function of the attribute distributions: in The similarity between the attribute distribution of the i-th query set and the attribute distribution of the category features of the n-th support set.

4. The small sample classification method based on fusion attributes and attribute distribution similarity according to claim 1, characterized in that; Step 7, calculating the classification result, involves inputting the training set and query set from the actual classification task into the few-sample basic classification network. Based on the attribute synthesis and selection mechanisms, feature similarity and attribute distribution similarity are calculated for classification. The classification uses a linear fusion of attribute distribution similarity and category feature similarity as the final classification criterion. The fusion function is: Where α represents a parameter value set according to the experimental results, ranging from 0.35 to 0.5; This is the result after fusion.

Citation Information

Patent Citations

  • Fine-grained image classification method based on image attribute active learning

    CN112528058A

  • Small sample medical data classification method and related equipment

    CN114239738A