Deep semi-supervised image classification method based on discriminative feature learning and entropy
By constructing discriminative feature learning and entropy objective functions, and combining the mini-batch stochastic gradient descent method to train a deep convolutional neural network model, it solves the problems of high computational complexity and high labeling cost of existing deep semi-supervised learning methods, and achieves remarkable results. Improved accuracy and reduced costs.
Patent Information
- Application Number
- CN202210446055.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-04-26
AI Technical Summary
Existing deep semi-supervised learning methods have high computational complexity during the training process and need to add random perturbations to each image for data expansion, resulting in high annotation costs and low classification accuracy.
A deep semi-supervised image classification method based on discriminant feature learning and entropy is adopted. By constructing a discriminant feature learning objective function and an entropy objective function, combined with the mini-batch stochastic gradient descent method, the deep convolutional neural network model is trained to reduce the need for deep convolutional network structures. dependence, significantly reducing the cost of labeling training data and improving image classification accuracy.
It significantly reduces the cost of labeling training data, improves image classification accuracy, does not depend on the deep convolutional network structure, and can be applied on any deep convolutional neural network.
Smart Images

Figure CN114781526B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision image classification, and in particular relates to a deep semi-supervised image classification method based on discriminant feature learning and entropy. Background Art
[0002] Semi-supervised learning means that only a small part of the training samples used in the training process have labels, while the rest of the training samples are unlabeled. In recent years, more and more research works have been devoted to proposing semi-supervised learning methods for deep convolutional neural network model training. Some research works use adversarial generative networks to generate additional training samples for deep convolutional neural network training. Generating training samples by adversarial generative networks can be regarded as a way of data expansion.
[0003] Currently, the more popular deep semi-supervised learning method is to perform consistency regularization on the features learned by the deep convolutional neural network, that is, to add perturbations (random noise, data augmentation or Dropout) to the image to learn robust features. For example, the ∏-model method generates two perturbed images by adding random perturbations to each image independently, and then uses a consistency loss function to constrain the network to make the label predictions of the corresponding two perturbed images as consistent as possible. The time integration method ensures the stability of the training process by maintaining the consistency between the label predictions of the exponential smoothing during training and the label predictions of the current network output. The Mean Teacher method ensures the stability of the training process by maintaining the consistency between the model parameters of the exponential smoothing during training and the model parameters of the current network.
[0004] The above method based on consistency regularization has high computational complexity during training and requires adding random perturbations to each image for data expansion. Summary of the invention
[0005] The purpose of the present invention is to provide a deep semi-supervised image classification method based on discriminative feature learning and entropy, which is independent of the deep convolutional network structure and can be applied to any deep convolutional neural network. It can significantly reduce the annotation cost of training data and significantly improve the image classification accuracy.
[0006] The technical solution adopted by the present invention is a deep semi-supervised image classification method based on discriminative feature learning and entropy, comprising the following steps:
[0007] 1) Prepare an image training sample set and divide the training sample set into a labeled training sample set and an unlabeled training sample set;
[0008] 2) Building a deep convolutional neural network model suitable for the image training sample set classification task in step 1);
[0009] 3) Construct discriminative feature learning objective function;
[0010] 4) Construct entropy objective function;
[0011] 5) Combine the discriminative feature learning objective function and the entropy objective function to construct the overall objective function;
[0012] 6) Set the current round training number to 0;
[0013] 7) According to the overall objective function, the current labeled training sample set and the unlabeled training sample set, the deep convolutional neural network model constructed in step 2) is trained using a mini-batch-based stochastic gradient descent method until the deep convolutional neural network model converges;
[0014] 8) Based on the converged deep convolutional neural network model, the probability that each unlabeled sample in the current unlabeled training sample set belongs to a different class is calculated respectively;
[0015] 9) Set a threshold. If the maximum value of the probability that an unlabeled sample belongs to different classes is greater than the threshold, assign the class label corresponding to the maximum probability value to the corresponding unlabeled sample, add the unlabeled sample to the labeled training sample set, and remove the unlabeled sample from the unlabeled training sample set;
[0016] 10) The value of the current round of training number is increased by 1;
[0017] 11) Repeat steps 7), 8), 9) and 10) until the current round of training number reaches the preset maximum round of training number, and obtain a trained deep convolutional neural network model;
[0018] 12) Input the image to be classified into the trained deep convolutional neural network model and obtain the predicted category of the image in the classification layer.
[0019] The present invention is also characterized in that
[0020] The specific implementation method of step 1) is as follows:
[0021] Given an image training sample set in, and They represent the labeled training sample set and the unlabeled training sample set respectively; X i represents the i-th training sample image; if Then c i =[c i1 ,c i2 ,…,c iC ] T ∈{0,1} C is the corresponding class label vector, c iThere is only one element in it that is 1, and the rest are all 0; if X i Contains the jth class, then c ij =1, otherwise c ij =0; C represents the total number of categories, L and U represent the number of labeled and unlabeled training samples, respectively.
[0022] The specific implementation method of step 2) is as follows:
[0023] Arbitrarily select a deep convolutional neural network model, and set the number of neurons in the final classification layer of the deep convolutional neural network model to the total number of categories in the image training sample set; the penultimate layer of the constructed network model is called the feature layer, that is, an image is input into the network, and the output of the penultimate layer is the feature vector of the image.
[0024] The specific implementation method of step 3) is as follows:
[0025] Define x i (t) represents the sample X at the tth iteration i The feature vector of the cth class in the tth iteration of the mini-batch. It is expressed as:
[0026]
[0027] Among them, π c (t) represents the set of subscript indices of samples belonging to the cth class in the mini-batch of the tth iteration; m c (t) represents the mean vector of the cth class obtained by exponential smoothing update at the tth iteration, that is,
[0028]
[0029] Among them, α represents the exponential smoothing coefficient, and its value range is 0<α<1, n c (t)=|π c (t)|, that is, n c (t) represents the set π c (t); in particular, when t = 0,
[0030] The total intra-class distance It is expressed as:
[0031]
[0032] minimize It is equivalent to enhancing the compactness within a class;
[0033] Accordingly, the total inter-class distance It is expressed as:
[0034]
[0035] maximize It is equivalent to increasing the distance between classes;
[0036] According to the above description, the discriminative feature learning objective function constructed for:
[0037]
[0038] Obviously, minimizing the above discriminative feature learning objective function is equivalent to making the features learned by the network model have good intra-class compactness and inter-class separation. It should be noted that during the network model training process, the discriminative feature learning objective function is only used on the labeled sample set.
[0039] The specific implementation method of step 4) is as follows:
[0040] For the samples in the unlabeled training sample set, although there is no class label for the sample, it must belong to a certain class. (j=1,2,…,U), the probability that it belongs to the cth class It is expressed as:
[0041]
[0042] in, express , exp(·) represents the exponential function, ‖·‖2 represents the l2 norm, m c Represents the mean vector of the cth class after exponential smoothing update; sample image Entropy of probability vectors belonging to different classes for:
[0043]
[0044] Wherein, log(·) represents the logarithm with constant e as base;
[0045] According to the above description, the constructed entropy objective function ε is:
[0046]
[0047] It should be noted that during the network model training process, the entropy objective function is only used on the unlabeled training sample set.
[0048] In step 5), the overall objective function is constructed by combining the discriminant feature learning objective function and the entropy objective function Specifically:
[0049]
[0050] in, represents the layer parameter set of the network model, softmax(·,·,·) represents the softmax classification loss function, and ε are the discriminative feature learning objective function and the entropy objective function respectively, and the parameters λ1 and λ2 are used to adjust the balance between the three terms on the right side of the above formula.
[0051] The specific implementation method of step 9) is as follows:
[0052] Set the threshold to 0.7, for the jth unlabeled sample image j=1,2,…,U, the probability of belonging to the cth class is make c=1,2,…,C, if Then give the unlabeled sample image Assign a class label to the kth class, add the unlabeled sample to the labeled training sample set, and remove the unlabeled sample from the unlabeled training sample set.
[0053] The beneficial effects of the present invention are:
[0054] (1) The deep semi-supervised image classification method based on discriminative feature learning and entropy proposed in the present invention does not depend on the network structure.
[0055] (2) The deep semi-supervised image classification method based on discriminative feature learning and entropy proposed in this invention can significantly reduce the annotation cost of training data.
[0056] (3) The deep semi-supervised image classification method based on discriminative feature learning and entropy proposed in this invention can significantly improve the image classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of a deep convolutional neural network model of the deep semi-supervised image classification method based on discriminative feature learning and entropy of the present invention. DETAILED DESCRIPTION
[0058] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0059] The present invention provides a deep semi-supervised image classification method based on discriminative feature learning and entropy, such as Figure 1 As shown, the following steps are included:
[0060] 1) Prepare an image training sample set and divide the training sample set into a labeled training sample set and an unlabeled training sample set;
[0061] The specific implementation method of step 1) is as follows:
[0062] Given an image training sample set in, and They represent the labeled training sample set and the unlabeled training sample set respectively; X i represents the i-th training sample image; if Then c i =[c i1 ,c i2 ,…,c iC ] T ∈{0,1} C is the corresponding class label vector, c i There is only one element in it that is 1, and the rest are all 0; if X i Contains the jth class, then c ij =1, otherwise c ij =0; C represents the total number of categories, L and U represent the number of labeled and unlabeled training samples, respectively.
[0063] 2) Building a deep convolutional neural network model suitable for the image training sample set classification task in step 1);
[0064] The specific implementation method of step 2) is as follows:
[0065] A deep convolutional neural network model is randomly selected, and the number of neurons in the final classification layer of the deep convolutional neural network model is set to the total number of categories of the image training sample set to obtain the deep convolutional neural network model of the deep semi-supervised image classification method based on discriminative feature learning and entropy of the present invention. Figure 1 As shown: the number of neurons in the classification layer is the total number of categories in the image training sample set, the penultimate layer of the constructed network model is called the feature layer, and the feature layer is preceded by several convolutional layers. The discriminant feature learning objective function and entropy objective function adopted by the present invention are directly applied to the feature layer during the network model training process, and an image is input into the network, and the output of the feature layer is the feature vector of the image.
[0066] 3) Construct discriminative feature learning objective function;
[0067] The specific implementation method of step 3) is as follows:
[0068] Define x i (t) represents the sample X at the tth iteration i The feature vector of the cth class in the tth iteration of the mini-batch. It is expressed as:
[0069]
[0070] Among them, π c (t) represents the set of subscript indices of samples belonging to the cth class in the mini-batch of the tth iteration; m c (t) represents the mean vector of the cth class obtained by exponential smoothing update at the tth iteration, that is,
[0071]
[0072] Among them, α represents the exponential smoothing coefficient, and its value range is 0<α<1, n c (t)=|π c (t)|, that is, n c (t) represents the set π c (t); in particular, when t = 0,
[0073] The total intra-class distance It is expressed as:
[0074]
[0075] minimize It is equivalent to enhancing the compactness within a class;
[0076] Accordingly, the total inter-class distance It is expressed as:
[0077]
[0078] maximize It is equivalent to increasing the distance between classes;
[0079] According to the above description, the discriminative feature learning objective function constructed for:
[0080]
[0081] Obviously, minimizing the above discriminative feature learning objective function is equivalent to making the features learned by the network model have good intra-class compactness and inter-class separation. It should be noted that during the network model training process, the discriminative feature learning objective function is only used on the labeled sample set.
[0082] 4) Construct entropy objective function;
[0083] The specific implementation method of step 4) is as follows:
[0084] For the samples in the unlabeled training sample set, although there is no class label for the sample, it must belong to a certain class. (j=1,2,…,U), the probability that it belongs to the cth class It is expressed as:
[0085]
[0086] in, express , exp(·) represents the exponential function, ‖·‖2 represents the l2 norm, m c Represents the mean vector of the cth class after exponential smoothing update; sample image Entropy of probability vectors belonging to different classes for:
[0087]
[0088] Wherein, log(·) represents the logarithm with constant e as base;
[0089] According to the above description, the constructed entropy objective function ε is:
[0090]
[0091] It should be noted that during the network model training process, the entropy objective function is only used on the unlabeled training sample set.
[0092] 5) Combine the discriminative feature learning objective function and the entropy objective function to construct the overall objective function;
[0093] In step 5), the overall objective function is constructed by combining the discriminant feature learning objective function and the entropy objective function Specifically:
[0094]
[0095] in, represents the layer parameter set of the network model, softmax(·,·,·) represents the softmax classification loss function, and ε are the discriminative feature learning objective function and entropy objective function respectively, and the parameters λ1 and λ2 are used to adjust the balance between the three terms on the right side of the above formula.
[0096] 6) Set the current round training number to 0;
[0097] 7) According to the overall objective function, the current labeled training sample set and the unlabeled training sample set, the deep convolutional neural network model constructed in step 2) is trained using a mini-batch-based stochastic gradient descent method until the deep convolutional neural network model converges;
[0098] 8) Based on the converged deep convolutional neural network model, the probability that each unlabeled sample in the current unlabeled training sample set belongs to a different class is calculated respectively;
[0099] 9) Set a threshold. If the maximum value of the probability that an unlabeled sample belongs to different classes is greater than the threshold, assign the class label corresponding to the maximum probability value to the corresponding unlabeled sample, add the unlabeled sample to the labeled training sample set, and remove the unlabeled sample from the unlabeled training sample set;
[0100] The specific implementation method of step 9) is as follows:
[0101] Set the threshold to 0.7, for the jth unlabeled sample image j=1,2,…,U, the probability of belonging to the cth class is make c=1,2,…,C, if Then give the unlabeled sample image Assign a class label to the kth class, add the unlabeled sample to the labeled training sample set, and remove the unlabeled sample from the unlabeled training sample set.
[0102] 10) The value of the current round of training number is increased by 1;
[0103] 11) Repeat steps 7), 8), 9) and 10) until the current round of training number reaches the preset maximum round of training number, and obtain a trained deep convolutional neural network model;
[0104] 12) Input the image to be classified into the trained deep convolutional neural network model and obtain the predicted category of the image in the classification layer.
[0105] Example
[0106] At present, the most representative image classification methods based on semi-supervised deep learning are Π-model, TempEns and Mean Teacher. In order to make a fair comparison, the present invention uses the deep convolutional neural network model adopted by these methods for experiments. The experimental data sets are CIFAR10 and SVHN. In the experiments on these two data sets, the parameter λ1 in the overall objective function of the present invention is set to 0.01, and the parameter λ2 is set to 0.001. The maximum number of training rounds is set to 4.
[0107] The CIFAR10 dataset includes 60,000 natural images in 10 categories, of which 50,000 are training images and 10,000 are test images. According to the experimental settings of the ∏-model, TempEns, and Mean Teacher methods, 1,000, 2,000, 4,000, and 50,000 images are selected from the 50,000 training images as labeled training images, and the remaining training images are used as unlabeled training images.
[0108] The SVHN dataset includes 73,257 training images and 26,032 test images. Following the experimental settings of the ∏-model, TempEns, and Mean Teacher methods, 250, 500, 1,000, and 73,257 images are selected from the training set as labeled training images, and the remaining training images are unlabeled training images.
[0109] Table 1 and Table 2 list the corresponding experimental results respectively. For a fairer comparison, the values in the tables are the average values of 10 repeated experiments. In these two tables, the experimental results of the Fully Supervised method are also given, that is, the results of training the network model using only labeled training samples. It can be seen from these two tables that the method proposed in the present invention is significantly better than other semi-supervised deep learning methods and the Fully Supervised method in the table, which fully proves the effectiveness of the method proposed in the present invention.
[0110] Table 1 Comparison results of classification accuracy (%) on the CIFAR10 test set
[0111]
[0112] Table 2 Comparison results of classification accuracy (%) on the SVHN test set
[0113]
Claims
1. A deep semi-supervised image classification method based on discriminative feature learning and entropy, characterized in that: The following steps are involved: 1) Prepare an image training sample set and divide the training sample set into a labeled training sample set and an unlabeled training sample set; 2) Building a deep convolutional neural network model suitable for the image training sample set classification task in step 1); 3) Construct discriminative feature learning objective function; 4) Construct entropy objective function; 5) Combine the discriminative feature learning objective function and the entropy objective function to construct the overall objective function; 6) Set the current round training number to 0; 7) According to the overall objective function, the current labeled training sample set and the unlabeled training sample set, the deep convolutional neural network model constructed in step 2) is trained using a mini-batch-based stochastic gradient descent method until the deep convolutional neural network model converges; 8) Based on the converged deep convolutional neural network model, the probability that each unlabeled sample in the current unlabeled training sample set belongs to a different class is calculated respectively; 9) Set a threshold. If the maximum value of the probability that an unlabeled sample belongs to different classes is greater than the threshold, assign the class label corresponding to the maximum probability value to the corresponding unlabeled sample, add the unlabeled sample to the labeled training sample set, and remove the unlabeled sample from the unlabeled training sample set; 10) The value of the current round of training number is increased by 1; 11) Repeat steps 7), 8), 9) and 10) until the current round of training number reaches the preset maximum round of training number, and obtain a trained deep convolutional neural network model; 12) Input the image to be classified into the trained deep convolutional neural network model and obtain the predicted category of the image in the classification layer.
2. The deep semi-supervised image classification method based on discriminative feature learning and entropy according to claim 1, characterized in that: The specific implementation method of step 1) is as follows: Given an image training sample set in, and They represent the labeled training sample set and the unlabeled training sample set respectively; X i represents the i-th training sample image; if So is the corresponding class label vector, c i There is only one element in it that is 1, and the rest are all 0; if X i Contains the jth class, then c ij =1, otherwise c ij =0; C represents the total number of categories, L and U represent the number of labeled and unlabeled training samples, respectively.
3. The deep semi-supervised image classification method based on discriminative feature learning and entropy according to claim 2, characterized in that: The specific implementation method of step 2) is as follows: Arbitrarily select a deep convolutional neural network model, and set the number of neurons in the final classification layer of the deep convolutional neural network model to the total number of categories in the image training sample set; the penultimate layer of the constructed network model is called the feature layer, that is, an image is input into the network, and the output of the penultimate layer is the feature vector of the image.
4. The deep semi-supervised image classification method based on discriminative feature learning and entropy according to claim 3, characterized in that: The specific implementation method of step 3) is as follows: Define x i (t) represents the sample X at the tth iteration i The feature vector of the cth class in the tth iteration of the mini-batch. It is expressed as: Among them, π c (t) represents the set of subscript indices of samples belonging to the cth class in the mini-batch of the tth iteration; m c (t) represents the mean vector of the cth class obtained by exponential smoothing update at the tth iteration, that is, Among them, α represents the exponential smoothing coefficient, and its value range is 0<α<1, n c (t)=|π c (t)|, that is, n c (t) represents the set π c (t); in particular, when t = 0, The total intra-class distance It is expressed as: minimize It is equivalent to enhancing the compactness within a class; Accordingly, the total inter-class distance It is expressed as: maximize It is equivalent to increasing the distance between classes; According to the above description, the discriminative feature learning objective function constructed for:
5. The deep semi-supervised image classification method based on discriminative feature learning and entropy according to claim 4, characterized in that: The specific implementation method of step 4) is as follows: For the jth unlabeled sample image The probability that it belongs to class c is It is expressed as: in, express , exp(·) represents the exponential function, ‖·‖2 represents the l2 norm, m c Represents the mean vector of the cth class after exponential smoothing update; sample image Entropy of probability vectors belonging to different classes for: Wherein, log(·) represents the logarithm with constant e as base; According to the above description, the constructed entropy objective function ε is:
6. The deep semi-supervised image classification method based on discriminative feature learning and entropy according to claim 5, characterized in that: In step 5), the overall objective function is constructed by combining the discriminant feature learning objective function and the entropy objective function Specifically: in, represents the layer parameter set of the network model, softmax(·,·,·) represents the softmax classification loss function, and ε are the discriminative feature learning objective function and the entropy objective function, respectively.
7. The deep semi-supervised image classification method based on discriminative feature learning and entropy according to claim 6, characterized in that: The specific implementation method of step 9) is as follows: Set the threshold to 0.7, for the jth unlabeled sample image The probability that it belongs to class c is make if Then give the unlabeled sample image Assign a class label to the kth class, add the unlabeled sample to the labeled training sample set, and remove the unlabeled sample from the unlabeled training sample set.
