A semi-supervised image classification method based on generative model and discriminative classification model

By combining the generative neural network and the SVM discriminant classification model, and using pseudo-label data to continuously optimize the model, it solves the problem of semi-supervised image classification under a small amount of labeled data, achieves accurate classification of digital images, and improves the generalization ability of the model.

CN115115892BActive Publication Date: 2024-09-20BEIJING GUOGUOLE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210855415.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-20
Publication Date
2024-09-20
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

It is difficult to use a small amount of labeled data to perform accurate semi-supervised image classification with existing technology, especially in fields such as image search, where there is a lot of unlabeled data but labeled data is difficult to obtain.

Method used

Combining the generative neural network model and the SVM discriminant classification model, by first training the SVM model, the generative model is used to infer the pseudo labels of the unlabeled data, and the training is repeated to improve the accuracy of the model and achieve accurate classification of digital images.

Benefits of technology

Effective use of unlabeled data enables accurate semi-supervised image classification with only a small amount of labeled data, improving the model's generalization ability and classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115115892B
    Figure CN115115892B
Patent Text Reader

Abstract

The present invention provides an image semi-supervised classification method based on a generative model and a discriminant classification model, comprising the following steps: S1, constructing an SVM discriminant classification model, and training the model using 1000 labeled data; S2, constructing a generative model, and using the generative model to infer unlabeled data to obtain pseudo-labeled data; S3, retraining the SVM discriminant classification model with the pseudo-labeled data obtained in step S2 and the labeled data obtained in step S1; S4, testing the accuracy of the retrained SVM discriminant classification model, and repeating steps S2-S3 until the accuracy of the model reaches the set target. The present invention combines a generative neural network model with an SVM discriminant classification model to perform accurate semi-supervised classification of digital images, and can accurately and efficiently perform semi-supervised classification of handwritten digital images, that is, a relatively good classification accuracy can be obtained using a small amount of labeled data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of machine learning algorithms, and in particular to an image semi-supervised classification method based on a generation model and a discriminant classification model. Background Art

[0002] As the scale of modern data sets and the difficulty of obtaining labels continue to expand, semi-supervised learning algorithms have become one of the important topics in modern data analysis. In real life, semi-supervised learning has a broad application prospect, including image search, genomics, natural language analysis, speech analysis, etc. In these fields, there is a lot of unlabeled data, but it is difficult or impossible to obtain labeled data. Usually we can only get a small amount of labeled data and a large amount of unlabeled data. Therefore, if the machine learning model wants to obtain better data analysis results with only a small amount of labeled data, it needs to use a semi-supervised learning algorithm for data learning and analysis.

[0003] Semi-supervised learning improves the generalization ability of the model by using a small part of the data set and labels, and using the learned model and a large amount of unlabeled data. At present, the image analysis model based on the neural network can perform supervised and unsupervised learning. Therefore, the present invention designs a method: first use the labeled data to first train the SVM discriminant classification model; then use the generative neural network model to estimate the pseudo-label of the unlabeled data; then use the unlabeled data and pseudo-label to calibrate the trained SVM model; finally, the SVM discriminant classification model trained with both labeled data and pseudo-label data is used to perform classification prediction of the test data. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide an image semi-supervised classification method based on a generative and discriminative model, which combines a generative neural network model with a SVM discriminative classification model to perform accurate semi-supervised classification of digital images, and can effectively utilize unlabeled data, thereby achieving the effect of accurately classifying handwritten digital images with only a small amount of labeled data.

[0005] To solve the above technical problems, an embodiment of the present invention provides an image semi-supervised classification method based on a generative and discriminative model, comprising the following steps:

[0006] S1. Build a SVM discrimination and classification model and train the model using 1000 labeled data.

[0007] S2, build a generative model, use the generative model to infer unlabeled data, and obtain pseudo-labeled data;

[0008] S3, retraining the SVM discriminant classification model using the pseudo-label data obtained in step S2 and the labeled data obtained in step S1;

[0009] S4: Test the accuracy of the retrained SVM discrimination classification model and repeat steps S2-S3 until the accuracy of the model reaches the set target.

[0010] Wherein, step S1 comprises the following steps:

[0011] S1.1. Obtain a labeled data set, use 8%-15% of the labeled data as a validation set, and 8%-15% of the labeled data as a training set;

[0012] S1.2, extract 50-dimensional latent variable features Z of 1000 labeled training set data, and import them into SVM discriminant classification model for training;

[0013] S1.3, import the labeled data in the validation set into the trained SVM discriminant classification model obtained in step S1.2 to obtain the accuracy of the validation set;

[0014] S1.4, repeat steps S1.1-S1.3 until the termination condition is met;

[0015] S1.5. Output the trained SVM discriminant classification model.

[0016] Wherein, step S2 comprises the following steps:

[0017] S2.1. Obtain unlabeled sample data, randomly select several minimum subsets mini_batch from the unlabeled sample data as set D, and set the mini_batch size to 16, 32, 64, 128, and 256 sample data respectively;

[0018] S2.2, input the set D into a multi-layer neural network with 500 hidden units to obtain the pseudo label y of the unlabeled data;

[0019] S2.3, input set D into the variational auto encoder (VAE) for iterative training, and extract the 50-dimensional latent variable feature z of the image from the middle layer of the variational auto encoder;

[0020] S2.4, using the mini_batch gradient descent method, maximize the objective function to obtain the optimized neural network parameters;

[0021] S2.5, repeat steps S2.2-S2.4 until the set D is iterated to 1000 epochs;

[0022] S2.6. Output the 50-dimensional latent variable features z and pseudo-label data y of the unlabeled sample data.

[0023] Among them, in the mini_batch gradient descent method of step S2.4, the variational lower bound objective function of the generative model is:

[0024]

[0025] in, is the variational lower bound term for the label data, is the variational lower bound of unlabeled data, E(·) represents the expectation, and p θ (x|y,z) represents the encoding network with parameter θ, p θ (y) is a multinomial distribution, p(z) represents the prior probability distribution of the latent variable z, and q φ (z|x,y) is a probability distribution similar to p(z) obtained by learning with a neural network, and the distribution q φ (y|x) represents the pseudo-label of the unlabeled data obtained by the discriminant classifier, H(q φ (y|x)) represents the parameter hypothesis.

[0026] Wherein, step S3 comprises the following steps:

[0027] S3.1, import the pseudo-labeled data and the labeled data into the SVM discriminant classification model in step S1;

[0028] S3.2, import the data of the validation set in step S1 into the trained SVM discriminant classification model to obtain the validation set accuracy, and repeat steps S3.1-S3.2 until the termination condition is met;

[0029] S3.3. Obtain the trained SVM discriminant classification model.

[0030] Wherein, step S4 comprises the following steps:

[0031] S4.1, import the test set data into the trained SVM discriminant classification model to test the accuracy of the SVM discriminant classification model;

[0032] S4.2. Repeat steps S2-S3 until the test accuracy reaches the set target, and output the trained SVM discriminant classification model.

[0033] Among them, the setting target preferably has an accuracy rate of 99.5%.

[0034] The beneficial effects of the above technical solution of the present invention are as follows:

[0035] (1) The present invention combines a generative neural network model with an SVM discriminant classification model to perform accurate semi-supervised classification of digital images. An SVM discriminant classification model trained with a small amount of labeled data sets is used as a base classifier. A generative neural network is used to label and select features of unlabeled data. The labeled data sets are repeatedly expanded and network parameters are optimized to achieve accurate semi-supervised classification of digital images.

[0036] (2) The image semi-supervised classification algorithm based on the generative and discriminative model of the present invention has the advantages of both the generative neural network and the discriminative model, and can effectively utilize unlabeled data, thereby achieving the purpose of accurately classifying images using a small number of samples. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 Schematic diagram of the semi-supervised learning framework;

[0038] Figure 2 Schematic diagram of the variational autoencoder structure;

[0039] Figure 3 Schematic diagram of mini-batch gradient descent training. DETAILED DESCRIPTION

[0040] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0041] like Figure 1 As shown, an embodiment of the present invention provides an image semi-supervised classification method based on a generative and discriminative model, comprising the following steps:

[0042] S1. Build a SVM discrimination and classification model and train the model using 1000 labeled data.

[0043] S2, build a generative model, use the generative model to infer unlabeled data, and obtain pseudo-labeled data;

[0044] S3, retraining the SVM discriminant classification model using the pseudo-label data obtained in step S2 and the labeled data obtained in step S1;

[0045] S4: Test the accuracy of the retrained SVM discrimination classification model and repeat steps S2-S3 until the accuracy of the model reaches the set target.

[0046] The step S1 comprises the following steps:

[0047] S1.1. Obtain a labeled data set, use 8%-15% of the labeled data as a validation set, and 8%-15% of the labeled data as a training set;

[0048] S1.2, extract 50-dimensional latent variable features Z of 1000 labeled training set data, and import them into SVM discriminant classification model for training;

[0049] S1.3, import the labeled data in the validation set into the trained SVM discriminant classification model obtained in step S1.2 to obtain the accuracy of the validation set;

[0050] S1.4, repeat steps S1.1-S1.3 until the termination condition is met;

[0051] S1.5. Output the trained SVM discriminant classification model.

[0052] The step S2 comprises the following steps:

[0053] S2.1. Obtain unlabeled sample data, randomly select several minimum subsets mini_batch from the unlabeled sample data as set D, and set the mini_batch size to 16, 32, 64, 128, and 256 sample data respectively;

[0054] S2.2, input the set D into a multi-layer neural network with 500 hidden units to obtain the pseudo label y of the unlabeled data;

[0055] S2.3, input set D into the variational auto encoder (VAE) for iterative training, and extract the 50-dimensional latent variable feature z of the image from the middle layer of the variational auto encoder (the structure of the variational auto encoder is as follows Figure 2 shown);

[0056] S2.4, using the mini_batch gradient descent method, maximize the objective function to obtain the optimized neural network parameters (mini_batch gradient descent method as shown in Figure 3 shown);

[0057] S2.5, repeat steps S2.2-S2.4 until the set D is iterated to 1000 epochs;

[0058] S2.6. Output the 50-dimensional latent variable features z and pseudo-label data y of the unlabeled sample data.

[0059] In this embodiment, in the mini-batch gradient descent method of step S2.4, the variational lower bound objective function of the generated model is:

[0060]

[0061] in, is the variational lower bound term for the label data, is the variational lower bound of unlabeled data, E(·) represents the expectation, and p θ (x|y,z) represents the encoding network with parameter θ, p θ (y) is a multinomial distribution, p(z) represents the prior probability distribution of the latent variable z, and q φ (z|x,y) is a probability distribution similar to p(z) obtained by learning with a neural network, and the distribution q φ (y|x) represents the pseudo-label of the unlabeled data obtained by the discriminant classifier, H(q φ (y|x)) represents the parameter hypothesis.

[0062] The step S3 comprises the following steps:

[0063] S3.1, import the pseudo-labeled data and the labeled data into the SVM discriminant classification model in step S1;

[0064] S3.2, import the data of the validation set in step S1 into the trained SVM discriminant classification model to obtain the validation set accuracy, and repeat steps S3.1-S3.2 until the termination condition is met;

[0065] S3.3, obtain the SVM discriminant classification model.

[0066] The step S4 comprises the following steps:

[0067] S4.1, import the test set data into the trained SVM discriminant classification model to test the accuracy of the SVM discriminant classification model;

[0068] S4.2. Repeat steps S2-S3 until the test accuracy reaches the set target, and output the trained SVM discriminant classification model.

[0069] In this embodiment, the set target accuracy is 99.5%.

[0070] The two key points of modeling and solving the image semi-supervised classification algorithm based on the generative and discriminative model provided by the present invention are:

[0071] (1) How to design an effective feature extraction method for the SVM discriminant classification model. The present invention constructs a model that provides data embedding and feature representation, and then uses the features of these observations to train a separate SVM model. After model optimization, the posterior probability of the approximate function is used as a feature extractor for the labeled data set, as well as a feature for training the classifier. The difference of the proposed method is that when there are only a very small number of labels y, the embedding allows the observations x to be clustered in the latent feature space, thereby achieving accurate classification. By extracting features through the trained variational inference model, rather than simple linear embedding or features obtained from a conventional autoencoder, the model can provide a more robust set of image latent variable features z, so that the SVM can obtain a more accurate decision boundary when training the observations x in the latent space.

[0072] (2) How to design a scalable generative neural network algorithm that can perform pseudo-label inference on unlabeled data. Compared with other semi-supervised models, the proposed method adopts a novel generative network strategy to assign labels to unlabeled candidate samples. The variational objective lower bound optimization process of the variational autoencoder network is cleverly used for pseudo-label unsupervised learning. During the optimization process, the pseudo labels of unlabeled data and the latent variable characteristics of the data are learned simultaneously. In addition, the proposed method can learn large-scale unlabeled data, expanding the capabilities of the generative model.

[0073] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A semi-supervised image classification method based on a generative model and a discriminative classification model, characterized in that: The following steps are involved: S1. Build a SVM discrimination and classification model and train the model using 1000 labeled data. S2, build a generative model, use the generative model to infer unlabeled data, and obtain pseudo-labeled data; S3, retraining the SVM discriminant classification model using the pseudo-label data obtained in step S2 and the labeled data obtained in step S1; S4, testing the accuracy of the retrained SVM discrimination classification model, repeating steps S2-S3 until the accuracy of the model reaches the set target; Step S2 includes the following steps: S2.

1. Obtain unlabeled sample data, randomly select several minimum subsets mini_batch from the unlabeled sample data as set D, and set the size of mini_batch to 16, 32, 64, 128, and 256 sample data respectively; S2.2, input the set D into a multi-layer neural network with 500 hidden units to obtain the pseudo label y of the unlabeled data; S2.3, input set D into the variational autoencoder for iterative training, and extract the 50-dimensional latent variable feature z of the image from the middle layer of the variational autoencoder; S2.4, using the mini_batch gradient descent method, maximize the objective function to obtain the optimized neural network parameters; S2.5, repeat steps S2.2-S2.4 until set D is iterated to 1000 periods; S2.6, output the 50-dimensional latent variable features z and pseudo-label data y of the unlabeled sample data; In the mini_batch gradient descent method of step S2.4, the variational lower bound objective function of the generative model is: in, is the variational lower bound term for the label data, is the variational lower bound of unlabeled data, E(·) represents the expectation, and p θ (x|y,z) represents the encoding network with parameter θ, p θ (y) is a multinomial distribution, p(z) represents the prior probability distribution of the latent variable z, and q φ (z|x,y) is a probability distribution similar to p(z) obtained by learning with a neural network, and the distribution q φ (y|x) represents the pseudo-label of the unlabeled data obtained by the discriminant classifier, H(q φ (y|x)) represents the parameter hypothesis.

2. The image semi-supervised classification method based on a generative model and a discriminant classification model according to claim 1, characterized in that: Step S1 includes the following steps: S1.

1. Obtain a labeled data set, use 8%-15% of the labeled data as a validation set, and 8%-15% of the labeled data as a training set; S1.2, extract 50-dimensional latent variable features Z of 1000 labeled training set data, and import them into SVM discriminant classification model for training; S1.3, import the labeled data in the validation set into the trained SVM discriminant classification model obtained in step S1.2 to obtain the accuracy of the validation set; S1.4, repeat steps S1.1-S1.3 until the termination condition is met; S1.

5. Output the trained SVM discriminant classification model.

3. The image semi-supervised classification method based on a generative model and a discriminant classification model according to claim 1, characterized in that: Step S3 includes the following steps: S3.1, import the pseudo-labeled data and the labeled data into the SVM discriminant classification model in step S1; S3.2, import the data of the validation set in step S1 into the trained SVM discriminant classification model to obtain the validation set accuracy, and repeat steps S3.1-S3.2 until the termination condition is met; S3.3, obtain the SVM discriminant classification model.

4. The image semi-supervised classification method based on a generative model and a discriminant classification model according to claim 1, characterized in that: Step S4 includes the following steps: S4.1, import the test set data into the trained SVM discriminant classification model to test the accuracy of the SVM discriminant classification model; S4.

2. Repeat steps S2-S3 until the test accuracy reaches the set target, and output the trained SVM discriminant classification model.

5. The image semi-supervised classification method based on a generative model and a discriminant classification model according to claim 1 or 4, characterized in that: The set target preferably has an accuracy rate of 99.5%.

Citation Information

Patent Citations

  • Small-sample hyperspectral image classification method based on pseudo-label learning

    CN111401426A

  • Pseudo label loss unsupervised adversarial domain adaptive picture classification method based on Gaussian uniform mixture model

    CN114492574A