Small sample image classification method based on self-paced hypergraph learning

By constructing a hypergraph for feature embedding and label propagation in small-sample image classification, the problem of feature misfit and pseudo-label noise is solved, the generalization ability and classification performance of the model are improved, and more reliable classification results are achieved.

CN118657973APending Publication Date: 2024-09-17BEIJING UNIV OF CHEM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410516192.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-27
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In existing small-sample image classification methods, the pre-trained feature extractor lacks cross-category adaptability, leading to noise problems, and false label calculation errors mislead the classifier to learn, resulting in unreliable models.

Method used

A method based on self-stepping hypergraph learning is used to construct a hypergraph for feature embedding and label propagation. The pseudo-labels of unlabeled data are inferred through hypergraph learning, and the classification reliability criterion is used to reduce the impact of noise. It is combined with a convolutional neural network for feature extraction. and classification.

Benefits of technology

It significantly improves the performance of small sample image classification and model generalization ability, enhances the reliability of the classifier, and reduces the impact of pseudo-label noise.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0004813479290000051
    Figure BDA0004813479290000051
  • Figure FDA0004813479280000024
    Figure FDA0004813479280000024
  • Figure FDA0004813479280000015
    Figure FDA0004813479280000015
Patent Text Reader

Abstract

The invention discloses a small sample image classification method based on self-paced hypergraph learning, and belongs to the field of computer vision research. According to the method, hypergraph learning is used as a classifier to deduce pseudo labels of unmarked data, and a classification reliability criterion is adopted to reduce the influence of noise with the pseudo labels. No similar literature report exists at home and abroad at present. According to the method, firstly, a Laplace operator is introduced to encode original data into a hypergraph space, dependence on features during classification is reduced, and then hypergraph representation is projected into a label space for prediction. Secondly, a self-paced learning algorithm is designed, the algorithm uses introduced hypergraph learning to infer pseudo labels of unlabeled data, and adopts a classification reliability criterion, that is, the data with the most reliable prediction is used for updating a classifier, which is mainly used for reducing the influence of the pseudo labels with noise. According to the method, the highest prediction accuracy can be achieved on a small sample data set, and the method is of great significance to a small sample image classification task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method in the field of computer vision, specifically a small sample image classification method based on self-paced hypergraph learning (SPHL) Background Art

[0002] In recent years, deep learning techniques have achieved very promising performance on various computer vision tasks. However, due to the large number of parameters, deep neural networks rely on a large amount of labeled data for model training. In industrial applications or real life, it is difficult to obtain more labeled data, and it is often expensive to label some data. Therefore, it is very important to use a small amount of labeled data to learn a classification model with good generalization performance. The purpose of few-shot learning is to learn a model with good generalization performance, which can also generalize well to new categories when each category contains only a limited number of labeled samples.

[0003] At present, small sample image classification methods can be mainly divided into four categories: (1) methods based on data enhancement; (2) methods based on meta-learning; (3) methods based on metric learning. (4) methods based on pre-training. The first type of methods improves the generalization ability of the model by expanding the diversity of training data. The second type of methods guides the model to learn faster in new tasks through meta-knowledge learned from a large number of different tasks, thereby achieving better generalization and adaptation performance. The third type of methods classify by learning the similarity or distance measurement between samples. Commonly used distance functions include Euclidean distance, Mahalanobis distance, and cosine similarity. The fourth type of methods allows the model to learn more generalized and useful feature representations by pre-training on large-scale data, and then use these features to solve small sample classification tasks.

[0004] With the rise and development of unsupervised learning, semi-supervised learning and active learning, many researchers have also applied them to the problem of few-shot image classification. After searching the literature on the existing technologies, it was found that Liu et al. first introduced transductive few-shot classification in the paper "Learning to propagate labels: Transductive propagation network for few-shot learning", which constructs a graph on the support set and the entire query set and propagates labels within the graph; Wang et al. used labeled data to train the classifier in the paper "Instance credibility inference for few-shot learning", and then used it to generate pseudo labels for unlabeled data, and finally updated the classifier with pseudo-label data. Huang et al. used ready-made unlabeled data and constructed complementary constraints to regulate the behavior of the model in the paper "Behavior regularized prototypical networks for semi-supervised few-shot image classification". Although the above semi-supervised few-shot learning methods have achieved excellent results in the field of few-shot learning, there is still a fundamental problem: the pre-trained feature extractor cannot perfectly adapt to new data due to the cross-category setting, and usually introduces a lot of noise into the new features. In addition, during the classifier training stage, incorrectly calculated pseudo-labels will mislead the learning of the classifier and make the learned classifier unreliable. Summary of the invention

[0005] The present invention is a small sample image classification method based on self-paced hypergraph learning. From the overall structure, the SPHL framework includes three structures: hypergraph construction, classification module, and self-paced hypergraph learning.

[0006] First, we give the definition of small sample learning. In small sample learning, there are two sets: a base set C base and a new set of categories C novel . The two category sets do not overlap, that is Define the basic data set and the new data set as D base , D novel In the pre-training phase, D base To train the feature extractor. Using D novel To evaluate the performance of small sample classification. The goal of the small sample learning task is to train a model that can generalize well to new tasks with very limited training data. Each small sample task has a support set S, a query set Q, and an unlabeled set U.

[0007] The specific steps of the present invention are as follows:

[0008] (1) In the hypergraph-based small sample image classification, the first step is to construct a hypergraph. Given m labeled support samples S and n unlabeled query samples Q, extract features from these support samples and query samples to obtain feature embedding where x i Represents the i-th feature embedding, d and n+m represent the size and number of samples. The hypergraph G=(V,E,w) consists of a node set V, an edge set E, and an edge weight w. Each edge e is assigned a weight w(e). Each node in V represents a sample in {S,Q}. There are n+m nodes in total. In E, the traditional nearest neighbor search method is selected to construct hyperedges. Each time a node is selected as the centroid and connected to its k nearest neighboring nodes using the corresponding hyperedge e. Other hypergraph generation methods can also be used. The hypergraph G can be represented by a |V|×|E| association matrix H, and each item in the matrix is ​​defined as

[0009]

[0010] The node degree of a node v∈V is calculated as:

[0011]

[0012] The degree of a hyperedge e∈E is calculated as:

[0013]

[0014] Then we can generate two diagonal matrices D v and D e , each item on the diagonal corresponds to the degree of the node and the degree of the hyperedge. And a diagonal matrix W can be generated, each item on the diagonal corresponds to the hyperedge weight. Among them, all hyperedges are initialized with the same weight.

[0015] (2) Use the constructed hypergraph for classification. Represents the label matrix of all training samples, where represents a real number, n+m represents the number of samples, n c is the number of categories in the dataset, y i Represents the label vector of the i-th category. For the labeled samples, each row of y i The positive samples of the i-th class are labeled as 1, and all other samples are labeled as 0. For unlabeled samples, all elements are set to 0.5, indicating that there is no prior information about the categories of these samples. represents the label projection matrix, where f i Represents the label projection vector of the i-th sample to be learned. The regularization framework of hypergraph classification is as follows:

[0016]

[0017] In the above framework, λ is the balance between the hypergraph structure regularization term Ω(F) and the empirical loss R emp (F) affects the weight parameter, and the regular term Ω(F) can be expressed as:

[0018]

[0019] In the formula, c represents the category, n c is the number of categories in the data set, e represents the hyperedge, E represents the edge set, and w e is the edge weight, H(u,e) and H(v,e) are the association matrices of nodes u and v, δ(e) is the degree of hyperedge e, F(u,c) and F(v,c) are the label projection matrices of nodes u and v, d(u) and d(v) are the degrees of nodes u and v respectively, I is the identity matrix, Among them, D v is the degree matrix composed of d(v), D e is the degree matrix composed of δ(e), H is the incidence matrix of the original hypergraph, and W is the matrix composed of w e The weight matrix composed of , F(:,c) is the label projection matrix of all nodes. Let Δ=I-Θ, then Δ can be regarded as the normalized hypergraph Laplacian operator. Therefore, there is a regularization term Ω(F):

[0020] Ω(F)=tr(F Τ ΔF)

[0021] tr represents the trace of the matrix, and the empirical loss term R emp (F) is defined as:

[0022] R emp (F)=||FY|| 2

[0023] In summary, the task of hypergraph learning becomes minimizing the sum of the following two items:

[0024] Φ(F)=tr(F Τ ΔF)+λ||FY|| 2

[0025] By taking the derivative of Φ(F) with respect to F, we get:

[0026]

[0027] We set λ to 5, and then directly solve the above equation through an iterative process according to the paper "3-D object retrieval and recognition with hypergraph analysis". The iterative process is shown in the following table. And the iterative process converges to the above equation. Finally, the learned label projection matrix F is used to obtain the predicted label.

[0028]

[0029] (3) Self-paced hypergraph learning. The query data Q and unlabeled data U are used to improve the performance of supervised learning. For the transductive setting, the query data is used to optimize the classifier, improving the classification performance of the query data. In the semi-supervised setting, the unlabeled data is used to optimize the classifier of the query data Q.

[0030] Specifically, suppose f(·) is the feature extractor trained on the database in the pre-training phase, D novel The corresponding embedding after the feature extractor can be defined as X novel =f(D novel )=[X s ,X q ,X u ], where X s =f(S),X q =f(Q),X u = f(U) denotes the feature embeddings of support, query and unlabeled data respectively. The process consists of three steps:

[0031] (i) According to the above equation, using the support feature X s Construct a classifier that classifies different categories by learning a label projection matrix F. Then, predict the labels of unlabeled data features by:

[0032]

[0033] where Y u represents the pseudo-label matrix of the predicted unlabeled data, and Y represents the initial label matrix of all training samples. Then predict U to belong to the pth class:

[0034] p=id max {Y u}

[0035] Where id max Indicates the index corresponding to the maximum value in the vector.

[0036] (ii) Sort the values ​​in the pseudo-label matrix and select the feature embedding X of the unlabeled sample with the highest confidence. select, get the corresponding label vector Y select . Expand the pseudo-labeled samples and labels to the support set. Next, generate a new hypergraph. The steps can be described as:

[0037] X s =[X s ,X select ]

[0038] Y s =[Y s ,Y select ]

[0039] Among them, Y s Represents the one-hot label matrix of the support set.

[0040] (iii) Select a sample each time to update the classifier. Repeat (i) and (ii) until all unlabeled data are selected and a reliable pseudo-label matrix is ​​output for all unlabeled data. At this point, the obtained classifier is optimal and can be used to predict the query label.

[0041] The present invention provides a small sample image classification method (SPHL) based on self-paced hypergraph learning. The present invention can effectively solve the problem of feature mismatch and pseudo-label noise in small sample image classification. The present invention uses a convolutional neural network (CNN) to train basic data, and the obtained model is used as a feature extractor, and the parameters are fixed after training. Then hypergraph learning is introduced into small sample image classification. Hypergraph learning constructs a hypergraph on labeled data and unlabeled data, which is used to propagate labels between them for joint prediction. Finally, we design a self-paced learning algorithm, which uses the introduced hypergraph learning to infer pseudo-labels of unlabeled data, and adopts a classification reliability criterion to reduce the impact of noisy pseudo-labels. The present invention can significantly improve the classification performance on four small sample benchmark data sets and enhance the generalization ability of the model. DETAILED DESCRIPTION

[0042] The present invention conducts experiments on four widely used few-shot learning benchmark image datasets: miniImageNet, tieredImageNet, CIFAR-FS, and FC100. miniImageNet is a sub-dataset of the ILSVRC2012 dataset, containing 100 classes and 600 images per class. tieredImageNet is a larger subset of the ILSVRC-2012 dataset. It contains 34 superclasses and 608 classes, with a total of 779,165 images. CIFAR-FS and FC100 are sub-datasets derived from CIFAR-100. They both have 100 classes.

[0043] All experiments were conducted in Pytorch. The same ResNet-12 backbone was used as the feature extractor. ResNet12 is a variant of the deep residual network architecture, which is widely used in small sample image classification tasks. Compared with the original ResNet model, ResNet12 reduces the number of layers but retains the core characteristics of residual connections, which effectively facilitates the training process of deep networks. The structure of ResNet12 mainly consists of four residual blocks, each of which contains three convolutional layers, hence the name "12", which refers to the total number of 12 convolutional layers. Each convolutional layer usually uses a 3x3 filter, and after each convolutional layer, a batch normalization operation is often used to enhance the stability of network training. In addition, the ReLU activation function is applied after each convolutional layer to introduce nonlinear factors. The output of each residual block is added to the input of the next residual block through a skip connection, which helps the transmission of information in the network. At the end of the network, global average pooling is used to replace the traditional fully connected layer. This improvement significantly reduces the total number of parameters of the model and effectively prevents overfitting. There is also a rotation loss. The rotation loss comes from the paper "Self-SupervisedGANs via Auxiliary Rotation Loss". This method defines geometric transformation as image rotation of 0, 90, 180, and 270 degrees. In order for a convolutional network to recognize rotation transformations in an image, it is necessary to understand the concept of the object described in the image. Although this self-supervised method is very simple, it provides a powerful alternative supervisory signal for feature learning. The entire model was trained for 120 epochs using the stochastic gradient descent (SGD) optimizer. The initial learning rate is 0.1, and the learning rate is decayed by 10 every 30 times. In the 5-way5-shot scenario, the classifier's k (the number of neighboring nodes closest to the centroid) and λ (balanced hypergraph structure regularization term Ω(F) and empirical loss R) are used. emp (F) The weight parameters of the influence) are set to 14 and 5 respectively. In the 5-way5-shot scenario, k and λ are set to 14 and 5 respectively. The values ​​of k and λ are universal in our experimental scenarios. At inference time, 15 query images are used for each class to form a query set of 75 images. 600 sets are randomly selected from each dataset. The classification accuracy calculated by averaging the accuracy of the 600 sets and the 95% confidence interval corresponding to these 600 sets are then reported.

Claims

1. A small sample image classification method based on self-paced hypergraph learning, characterized by include: Hypergraph construction, classification module, self-paced hypergraph learning; First, the definition of small sample learning is given. In small sample learning, there are two sets: a base class set C base and a new set of categories C novel ; The two category sets do not overlap, that is Define the basic data set and the new data set as D base , D novel ; In the pre-training stage, use D base To train the feature extractor; using D novel To evaluate the performance of small sample classification; each small sample task has a support set S, a query set Q and an unlabeled set U; The specific steps are as follows: (1) In the hypergraph-based small sample image classification, the first step is to construct a hypergraph; given m labeled support samples S and n unlabeled query samples Q; extract features from these support samples and query samples to obtain feature embedding where x i represents the i-th feature embedding, d and n+m represent the size and number of samples; the hypergraph G = (V, E, w) consists of a node set V, an edge set E and an edge weight w; each edge e is assigned a weight w(e); each node in V represents a sample in {S, Q}; there are n+m nodes in total; in E, the nearest neighbor search method is selected to construct hyperedges; each time a node is selected as the centroid and connected to its k nearest neighboring nodes using the corresponding hyperedge e; The hypergraph G is represented by a |V|×|E| incidence matrix H, where each entry is defined as The node degree of a node v∈V is calculated as: The degree of a hyperedge e∈E is calculated as: Then generate two diagonal matrices D v and D e , each item on the diagonal corresponds to the degree of the node and the degree of the hyperedge respectively; and a diagonal matrix W is generated, each item on the diagonal corresponds to the hyperedge weight; wherein all hyperedges are initialized with the same weight; (2) Use the constructed hypergraph for classification; Represents the label matrix of all training samples, where represents a real number, n+m represents the number of samples, n c is the number of categories in the dataset, y i Represents the label vector of the i-th category. For the labeled samples, each row of y i The positive samples of the i-th category are marked as 1, and all other samples are marked as 0; for unlabeled samples, all elements are set to 0.5, indicating that there is no prior information about the categories of these samples; let represents the label projection matrix, where f i Represents the label projection vector of the i-th sample to be learned; the regularization framework of hypergraph classification is as follows: In the above framework, λ is the balance between the hypergraph structure regularization term Ω(F) and the empirical loss R emp (F) affects the weight parameter, and the regular term Ω(F) is expressed as: In the formula, c represents the category, n c is the number of categories in the data set, e represents the hyperedge, E represents the edge set, and w e is the edge weight, H(u,e) and H(v,e) are the incidence matrices of nodes u and v, δ(e) is the degree of hyperedge e, F(u,c) and F(v,c) are the label projection matrices of nodes u and v, d(u) and d(v) are the degrees of nodes u and v respectively, and I is the identity matrix; Among them, D v is the degree matrix composed of d(v), D e is the degree matrix composed of δ(e), H is the incidence matrix of the original hypergraph, and W is the matrix composed of w e The weight matrix composed of , F(:,c) is the label projection matrix of all nodes; let Δ=I-Θ, then Δ can be regarded as the normalized hypergraph Laplacian operator; therefore, there is a regularization term Ω(F): Ω(F)=tr(F Τ ΔF) tr represents the trace of the matrix, and the empirical loss term R emp (F) is defined as: R emp (F)=||F-Y|| 2 The task of hypergraph learning becomes minimizing the sum of the following two items: Φ(F)=tr(F Τ ΔF)+λ||F-Y|| 2 By taking the derivative of Φ(F) with respect to F, we get: Set λ to 5 and solve the above equation directly through an iterative process; use the learned label projection matrix F to obtain the predicted label; (3) Self-paced hypergraph learning; using query data Q and unlabeled data U to improve the performance of supervised learning; for the transductive setting, using the query data to optimize the classifier improves the classification performance of the query data; in the semi-supervised setting, using unlabeled data to optimize the classifier of the query data Q; Assume f(·) is the feature extractor trained on the database in the pre-training phase, D novel The corresponding embedding after the feature extractor is defined as X novel =f(D novel )=[X s ,X q ,X u ], where X s =f(S),X q =f(Q),X u = f(U) denotes the feature embedding of support, query and unlabeled data respectively; the process consists of three steps: (i) Using supporting feature X s Construct a classifier that classifies different categories by learning a label projection matrix F; then, predict the labels of unlabeled data features by the following method: where Y u represents the pseudo-label matrix of the predicted unlabeled data, and Y represents the initial label matrix of all training samples; then predict U to belong to the pth class: p=id max {Y u } Where id max Represents the index corresponding to the maximum value in the vector; (ii) Sort the values ​​in the pseudo-label matrix and select the feature embedding X of the unlabeled sample with the highest confidence. select , get the corresponding label vector Y select ; Expand the pseudo-labeled samples and labels to the support set; Next, generate a new hypergraph; The steps are described as: X s =[X s ,X select ] AND s =[And s ,AND select ] Among them, Y s One-hot label matrix representing the support set; (iii) Select a sample each time to update the classifier; repeat (i) and (ii) until all unlabeled data are selected and a reliable pseudo-label matrix is ​​output for all unlabeled data. At this point, the obtained classifier is optimal and is used to predict the query label.