CN110674854B - Image classification model training method, image classification method, device and equipment - Google Patents

Image classification model training method, image classification method, device and equipment Download PDF

Info

Publication number
CN110674854B
CN110674854B CN201910848857.1A CN201910848857A CN110674854B CN 110674854 B CN110674854 B CN 110674854B CN 201910848857 A CN201910848857 A CN 201910848857A CN 110674854 B CN110674854 B CN 110674854B
Authority
CN
China
Prior art keywords
image
sample set
classification model
sample
labeled
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910848857.1A
Other languages
Chinese (zh)
Other versions
CN110674854A (en
Inventor
许志浩
纪勇
黄治纲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Neusoft Corp
Original Assignee
Neusoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Neusoft Corp filed Critical Neusoft Corp
Priority to CN201910848857.1A priority Critical patent/CN110674854B/en
Publication of CN110674854A publication Critical patent/CN110674854A/en
Application granted granted Critical
Publication of CN110674854B publication Critical patent/CN110674854B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses an image classification model training method, device and equipment, wherein the method comprises the following steps: selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probability that each image sample in the labeled sample set and the unlabeled sample set belongs to each category; respectively training the vector extraction models by utilizing the T new sample sets to obtain T trained vector extraction models; respectively inputting the image samples in the labeled sample set into the T trained vector extraction models, and forming an integrated vector of each image sample by the obtained result; and training the image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain the trained image classification model. According to the method and the device, on the premise of ensuring the model precision, the training of the image classification model can be completed by using the labeled samples with relatively small quantity. The application also provides an image classification method, device and equipment.

Description

Image classification model training method, image classification method, device and equipment
Technical Field
The application relates to the field of data processing, in particular to an image classification model training method, an image classification device and image classification equipment.
Background
At present, the precision of most models depends heavily on the number of labeled training samples, and generally, the greater the number of labeled training samples, the higher the precision of the model obtained by training with the training samples. Especially for image classification models, the classification accuracy depends heavily on the number of labeled training samples.
In practical applications, labels of training samples are generally marked manually, and obviously, manually marking large-scale training samples is time-consuming and labor-consuming.
Therefore, more and more people think that how to complete the training of the image classification model by using a relatively small number of labeled training samples on the premise of ensuring the accuracy of the image classification model.
Disclosure of Invention
In view of this, the present application provides an image classification model training method, an image classification device, and an image classification model training apparatus, which can complete training of an image classification model by using a relatively small number of labeled samples on the premise of ensuring accuracy of the image classification model.
In a first aspect, to achieve the above object, the present application provides an image classification model training method, including:
selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probability that each image sample in the labeled sample set and the unlabeled sample set belongs to each category;
respectively training T vector extraction models which are constructed in advance by utilizing the T new sample sets to obtain T trained vector extraction models;
respectively inputting the image samples in the labeled sample set into the T trained vector extraction models, and forming an integrated vector of each image sample in the labeled sample set by the obtained result;
and training an image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain the trained image classification model.
In an optional embodiment, before selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on probabilities that the image samples in the labeled sample set and the unlabeled sample set belong to respective categories, the method further includes
And classifying each image sample in the pre-constructed labeled sample set and the non-labeled sample set respectively to obtain the probability that each image sample belongs to each category respectively.
In an optional implementation manner, before the classifying each image sample in the pre-constructed labeled sample set and unlabeled sample set to obtain a probability that each image sample belongs to each category, the method further includes:
randomly extracting m-dimensional features from the feature vectors of the image samples in the labeled sample set to form random feature vectors;
training a classification model through the random feature vectors and the labels of the image samples in the labeled sample set to obtain a trained classification model;
the method for classifying the image samples in the pre-constructed labeled sample set and the non-labeled sample set respectively to obtain the probability that each image sample belongs to each category respectively comprises the following steps:
and classifying each image sample in the pre-constructed labeled sample set and unlabeled sample set by using the trained classification model to obtain the probability that each image sample belongs to each class.
In an optional embodiment, the selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probability that each image sample in the labeled sample set and the unlabeled sample set belongs to each category respectively includes:
for each category, ranking the probabilities belonging to the category from large to small, and determining the image samples in the labeled sample set and the unlabeled sample set respectively corresponding to n probabilities before ranking;
a new sample set is constructed using the image samples.
In an optional embodiment, the inputting the image samples in the labeled sample set to T vector extraction models respectively, and the obtained results constitute an integrated vector of each image sample in the labeled sample set, includes:
after extracting the feature vectors of the image samples in the labeled sample set, respectively taking the feature vectors of the image samples as the input of T vector extraction models, and outputting T vectors after the T vector extraction models are processed;
integrating the T vectors into one vector as an integrated vector of the image sample; wherein the label of the integration vector is a label of the image sample.
In a second aspect, the present application further provides an image classification method, including:
extracting an integrated vector of any image to be classified by utilizing T vector extraction models obtained by the image classification model training method based on any one of the above;
and taking the integrated vector as the input of a trained image classification model obtained by the image classification model training method based on any one of the above, and outputting the classification result of the image to be classified after the classification processing of the trained image classification model.
In a third aspect, the present application further provides an image classification model training apparatus, including:
the construction module is used for selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probability that each image sample in the labeled sample set and the unlabeled sample set belongs to each category;
the first training module is used for respectively training T vector extraction models which are constructed in advance by utilizing the T new sample sets to obtain T trained vector extraction models;
the first vector extraction module is used for respectively inputting the image samples in the labeled sample set into the T trained vector extraction models, and the obtained results form an integrated vector of each image sample in the labeled sample set;
and the second training module is used for training the image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain the trained image classification model.
In an optional embodiment, the apparatus further comprises
And the first classification module is used for classifying the image samples in the pre-constructed labeled sample set and the non-labeled sample set respectively to obtain the probability that each image sample belongs to each class respectively.
In an alternative embodiment, the apparatus further comprises:
a random module, configured to form a random feature vector from m-dimensional features randomly extracted from feature vectors of image samples in the labeled sample set;
the third training module is used for training a classification model through the random feature vectors and the labels of the image samples in the labeled sample set to obtain a trained classification model;
the classification module is specifically configured to:
and classifying each image sample in the pre-constructed labeled sample set and unlabeled sample set by using the trained classification model to obtain the probability that each image sample belongs to each class.
In an alternative embodiment, the construction module comprises:
the ranking submodule is used for ranking the probability of belonging to each category from large to small according to each category, and determining the image samples in the labeled sample set and the unlabeled sample set which respectively correspond to the n probabilities before ranking;
a construction submodule for constructing a new sample set using the image samples.
In an optional implementation, the first vector extraction module includes:
the vector extraction submodule is used for respectively taking the feature vectors of the image samples in the labeled sample set as the input of T vector extraction models after extracting the feature vectors of the image samples, and outputting T vectors after the T vector extraction models are processed;
the integration submodule is used for integrating the T vectors into one vector to serve as an integrated vector of the image sample; wherein the label of the integration vector is a label of the image sample.
In a fourth aspect, the present application further provides an image classification apparatus, comprising:
the second vector extraction module is used for extracting an integrated vector of any image to be classified by utilizing T vector extraction models obtained by the image classification model training device based on any one of the above items;
and the second classification module is used for taking the integrated vector as the input of a trained image classification model obtained by the image classification model training device based on any one of the above, and outputting the classification result of the image to be classified after the classification processing of the trained image classification model.
In a fifth aspect, the present application further provides a computer-readable storage medium having stored therein instructions that, when run on a terminal device, cause the terminal device to perform any of the methods described above.
In a sixth aspect, the present application further provides an apparatus comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method as in any one of the above.
The application provides an image classification model training method, which includes the steps of firstly, constructing T new sample sets based on the probability that each image sample in a labeled sample set and an unlabeled sample set belongs to each category, secondly, training the T new sample sets respectively to obtain T vector extraction models, and processing each image sample in the labeled sample set by utilizing the T vector extraction models to obtain corresponding integrated vectors. And finally, training the image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain a trained image classification model, and finishing the training of the image classification model.
Therefore, the image classification model training method provided by the application can effectively utilize the image samples in the labeled sample set, fully excavate the information of the image samples in the unlabeled sample set, reconstruct T new sample sets, be used for training the image classification model, and ensure the diversity of the image samples.
In addition, the T vector extraction models are trained respectively based on the T new sample sets, and the accuracy of the T vector extraction models is guaranteed.
In addition, the image classification model is trained on the basis of an integrated vector obtained by processing each image sample in the labeled sample set through T vector extraction models and the label of the corresponding image sample. The integrated vectors are integrated with the features of the image samples extracted from all angles by the T vector extraction models, so that the diversity and accuracy of the image classification model obtained by training the set vectors of the samples can be guaranteed.
In conclusion, the image classification model training method provided by the application can complete model training by using a relatively small number of labeled training samples on the premise of ensuring the accuracy of the image classification model.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a flowchart of an image classification model training method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating training of a vector extraction sub-model according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a vector extraction model according to an embodiment of the present application;
fig. 4 is a flowchart of an image classification method according to an embodiment of the present application;
fig. 5 is a schematic diagram of an image classification process provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of an image classification model training apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an image classification apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an image classification model training apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an image classification device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Because the manual labeling of a large number of training samples is a time-consuming and labor-consuming task, under the application scenario of a limited number of labeled training samples, the application combines the limited number of labeled training samples and unlabeled training samples to realize the training of the image classification model.
Specifically, in the image classification model training method provided by the application, firstly, T new sample sets are constructed based on the probability that each image sample in a labeled sample set and an unlabeled sample set belongs to each category, secondly, the T new sample sets are trained respectively to obtain T vector extraction models, and each image sample in the labeled sample set is processed by using the T vector extraction models to obtain corresponding integrated vectors. And finally, training the image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain a trained image classification model, and finishing the training of the image classification model.
Therefore, the image classification model training method provided by the application can effectively utilize the image samples in the labeled sample set, fully excavate the information of the image samples in the unlabeled sample set, reconstruct T new sample sets, be used for training the image classification model, and ensure the diversity of the image samples.
In addition, the T vector extraction models are trained respectively based on the T new sample sets, and the accuracy of the T vector extraction models is guaranteed.
In addition, the image classification model is trained on the basis of an integrated vector obtained by processing each image sample in the labeled sample set through T vector extraction models and the label of the corresponding image sample. The integrated vectors are integrated with the features of the image samples extracted from all angles by the T vector extraction models, so that the diversity and accuracy of the image classification model obtained by training the set vectors of the samples can be guaranteed.
The following embodiment of the present application provides an image classification model training method, and with reference to fig. 1, is a flowchart of the image classification model training method provided in the embodiment of the present application, and the method includes:
s101: and selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probability that each image sample in the labeled sample set and the unlabeled sample set belongs to each category.
In the embodiment of the application, firstly, the image samples in the pre-constructed labeled sample set and the non-labeled sample set are classified to obtain the probability that each image sample belongs to each category. Secondly, based on the probability that each image sample belongs to each category, selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets.
In an optional implementation manner, a trained classification model is used to classify each image sample in a pre-constructed labeled sample set and unlabeled sample set respectively, so as to obtain a probability that each image sample belongs to each category respectively.
The method for training the classification model in the embodiment of the application may include: firstly, randomly extracting m-dimensional features from feature vectors of image samples in a pre-constructed labeled sample set to form random feature vectors; secondly, training the classification model through the random feature vectors and the labels of all the image samples in the labeled sample set to obtain the trained classification model.
In an alternative implementation, the feature vector extracted from each image sample in the labeled sample set includes 100-dimensional features, and the embodiment of the present application may randomly extract 20-dimensional features from the 100-dimensional features to reconstruct a vector as a random feature vector of the corresponding image sample.
In an alternative embodiment, in order to effectively utilize a limited number of labeled training samples in the labeled sample set, m-dimensional features may be randomly extracted from the feature vectors of each image sample for multiple times, so as to respectively form random feature vectors of the image samples, thereby obtaining training samples that are several times as many as the number of the image samples in the labeled sample set, so as to enrich the sample diversity for training the classification model.
In the embodiment of the application, after the training of the classification model is completed, the trained classification model is used for classifying the image samples in the labeled sample set and the unlabeled sample set again, so that the probability that the image samples belong to each category is obtained. Specifically, a random feature vector formed by randomly extracting m-dimensional features from the feature vector of each image sample is used as the input of a trained classification model, and after classification processing of the classification model, the probability that each image sample belongs to each category is obtained.
In an optional implementation manner, the classification model not only outputs the probability that each image sample belongs to each category, but also outputs the category to which each image sample belongs, and generally, the category corresponding to the maximum probability in each category is the category to which the image sample belongs. And then, constructing a new sample set based on the probability that each image sample belongs to each category, wherein the label of the image sample in the new sample set is the category to which the image sample belongs.
In an alternative implementation manner, since the greater the probability of which category the image sample belongs to is, the more accurate the classification result of the image sample belonging to the category is, in order to optimize the image samples in the new sample set, in the embodiment of the present application, the top n image samples ranked according to the probability in the image samples belonging to each category may be configured as the new sample set. Specifically, firstly, ranking the probability belonging to each category from large to small according to each category, and determining image samples in a labeled sample set and an unlabeled sample set corresponding to n probabilities before the ranking; and then constructing a new sample set by using the determined image samples.
In practical application, the trained classification model is used for carrying out classification processing on each image sample in the labeled sample set and the unlabeled sample set for T times, and the probability that each image sample in the T groups belongs to each class is obtained. And constructing T new sample sets respectively based on the probability that each image sample of the T groups belongs to each category respectively.
S102: and training the T vector extraction models by utilizing the T new sample sets respectively to obtain T trained vector extraction models.
In the embodiment of the application, after T new sample sets are obtained, the T new sample sets are utilized to respectively train T pre-established vector extraction models in a one-to-one mode, and T trained vector extraction models are obtained; wherein the output of each trained vector extraction model is a vector.
Referring to fig. 2, a schematic training diagram of a vector extraction model according to an embodiment of the present disclosure is shown. Specifically, T vector extraction models are pre-constructed, and the T new sample sets obtained are trained on the T vector extraction models in a one-to-one manner. The input of each vector extraction model is the feature vector and the label of the corresponding image sample in the new sample set; the output is a vector of the corresponding image sample, the vector is obtained by performing logistic regression on a result of a classification algorithm in a vector extraction model, the vector is used for representing the probability that the image sample belongs to each category, and specifically, a numerical value of any dimension of the vector is used for representing the probability that the image sample belongs to the category corresponding to the dimension.
In an alternative embodiment, the classification algorithm in the vector extraction model may be implemented based on a mapping function.
In practical application, for each new sample set, firstly, the feature vector of each image sample in the new sample set is extracted, and then, the feature vector and the label of each image sample in the new sample set are utilized to train the pre-established vector extraction model, so that the trained vector extraction model is obtained. Based on the mode, the T new sample sets are used for respectively training the T vector extraction models in a one-to-one mode, and T trained vector extraction models are obtained.
In an optional implementation manner, the T new sample sets may be used to train the T vector extraction models in parallel, or the training may be completed in other execution manners, which is not limited in this application.
In the embodiment of the application, the T new sample sets are used for training the T vector extraction models respectively, so that the T vector extraction models can learn the characteristics of the image samples in the labeled sample set and the unlabeled sample set provided by the application from different angles, and the integrated vector formed by the results of the T vector extraction models can maximally embody the characteristics of the image samples.
S103: and respectively inputting the image samples in the labeled sample set into the T trained vector extraction models, and forming an integrated vector of each image sample in the labeled sample set by the obtained result.
Fig. 3 is a schematic diagram of an integrated vector obtaining process according to an embodiment of the present disclosure. Specifically, for each image sample in the labeled sample set, firstly extracting a feature vector of the image sample, secondly, taking the feature vector of the image sample as input of T vector extraction models respectively, obtaining T vectors after the processing of the T vector extraction models, and obtaining an integrated vector of the image sample after the T vectors are integrated by a vector integration module; wherein the label of the integration vector is the label of the image sample.
In an optional implementation manner, T vectors are integrated into one vector, specifically, the T vectors are connected end to end into one vector, so that the obtained integrated vector maximally embodies the features of the corresponding image sample.
In the embodiment of the application, the T vector extraction models are used for respectively processing the image samples in the labeled sample set to obtain the integrated vector of each image sample, so that the integrated vector and the label of each image sample are used for forming the training sample set of the image classification model.
S104: and training an image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain the trained image classification model.
In the embodiment of the application, after the integrated vectors of all the image samples in the labeled sample set are obtained by using the trained T vector extraction models, the integrated vectors of the image samples in the labeled sample set and the corresponding labels form a training sample set of an image classification model, and the integrated vectors and the labels in the training sample set are used for training the image classification model to obtain the trained image classification model.
In the image classification model training method provided by the embodiment of the application, firstly, based on the probability that each image sample in a labeled sample set and an unlabeled sample set belongs to each category, T new sample sets are constructed, secondly, the T new sample sets are trained respectively to obtain T vector extraction models, and each image sample in the labeled sample set is processed by using the T vector extraction models to obtain corresponding integrated vectors. And finally, training the image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain a trained image classification model, and finishing the training of the image classification model.
Therefore, the image classification model training method provided by the application can effectively utilize the image samples in the labeled sample set, fully excavate the information of the image samples in the unlabeled sample set, reconstruct T new sample sets, be used for training the image classification model, and ensure the diversity of the image samples.
In addition, the T vector extraction models are trained respectively based on the T new sample sets, and the accuracy of the T vector extraction models is guaranteed.
In addition, the image classification model is trained on the basis of an integrated vector obtained by processing each image sample in the labeled sample set through T vector extraction models and the label of the corresponding image sample. The integrated vectors are integrated with the features of the image samples extracted from all angles by the T vector extraction models, so that the diversity and accuracy of the image classification model obtained by training the set vectors of the samples can be guaranteed.
In summary, the image classification model training method provided by the embodiment of the application can complete training of the image classification model by using relatively small number of labeled samples on the premise of ensuring the accuracy of the image classification model.
Based on the above image classification model training method, the present application provides an image classification method, which is a flowchart of an image classification method provided in an embodiment of the present application with reference to fig. 4, and the method includes:
s401: and extracting an integrated vector of any image to be classified by using a vector extraction model.
In the embodiment of the present application, the vector extraction model for extracting the integrated vector of the object to be classified is obtained based on the image classification model training method, and the introduction of the specific vector extraction model can be understood by referring to the image classification model training method, which is not described herein again.
S402: and taking the integrated vector as the input of a trained image classification model, and outputting the classification result of the image to be classified after the classification processing of the trained image classification model.
In the embodiment of the application, the integrated vector can embody the characteristics of the images to be classified to the maximum, and therefore, the image to be classified is classified based on the integrated vector of the images to be classified, and the accuracy of the classification result of the images to be classified can be guaranteed.
Referring to fig. 5, a schematic diagram of an image classification process provided in an embodiment of the present application is shown, where feature vectors of an image to be classified are first extracted, and then the feature vectors of the image to be classified are respectively input into T vector extraction models, the T vector extraction models respectively process the feature vectors and output vectors 1-T, and then the vectors 1-T are connected by a vector integration module to form a vector, which is used as an integrated vector of the image to be classified. And finally, inputting the integration vector of the image to be classified into the image classification model, and outputting the classification result of the image to be classified after the classification processing of the image classification model.
In the image classification method provided by the embodiment of the application, the integrated vectors extracted by the vector extraction model can show the characteristics of the images to be classified to the maximum extent, so that the images to be classified are classified based on the integrated vectors extracted by the T vector extraction models, and the accuracy of the classification result can be improved.
Corresponding to the above method embodiment, the present application further provides an image classification model training device, and referring to fig. 6, the structural schematic diagram of the image classification model training device provided in the embodiment of the present application is shown, where the device includes:
a constructing module 601, configured to select image samples from a labeled sample set and an unlabeled sample set to construct T new sample sets based on probabilities that respective image samples in the labeled sample set and the unlabeled sample set belong to respective categories;
a first training module 602, configured to train T vector extraction models that are constructed in advance respectively by using the T new sample sets, so as to obtain T trained vector extraction models;
a first vector extraction module 603, configured to input the image samples in the labeled sample set to the T trained vector extraction models, respectively, and form an integrated vector of each image sample in the labeled sample set from obtained results;
the second training module 604 is configured to train the image classification model by using the integrated vector and the label of each image sample in the labeled sample set, so as to obtain a trained image classification model.
In an optional embodiment, the apparatus further comprises
And the first classification module is used for classifying the image samples in the pre-constructed labeled sample set and the non-labeled sample set respectively to obtain the probability that each image sample belongs to each class respectively.
In an alternative embodiment, the apparatus further comprises:
a random module, configured to form a random feature vector from m-dimensional features randomly extracted from feature vectors of image samples in the labeled sample set;
the third training module is used for training a classification model through the random feature vectors and the labels of the image samples in the labeled sample set to obtain a trained classification model;
the classification module is specifically configured to:
and classifying each image sample in the pre-constructed labeled sample set and unlabeled sample set by using the trained classification model to obtain the probability that each image sample belongs to each class.
In an alternative embodiment, the construction module comprises:
the ranking submodule is used for ranking the probability of belonging to each category from large to small according to each category, and determining the image samples in the labeled sample set and the unlabeled sample set which respectively correspond to the n probabilities before ranking;
a construction submodule for constructing a new sample set using the image samples.
In an optional implementation, the first vector extraction module includes:
the vector extraction submodule is used for respectively taking the feature vectors of the image samples in the labeled sample set as the input of T vector extraction models after extracting the feature vectors of the image samples, and outputting T vectors after the T vector extraction models are processed;
the integration submodule is used for integrating the T vectors into one vector to serve as an integrated vector of the image sample; wherein the label of the integration vector is a label of the image sample.
The image classification model training device provided by the embodiment of the application firstly constructs T new sample sets based on the probability that each image sample in a labeled sample set and a non-labeled sample set belongs to each category respectively, secondly trains the T new sample sets respectively to obtain T vector extraction models, and processes each image sample in the labeled sample set by utilizing the T vector extraction models to obtain a corresponding integrated vector. And finally, training the image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain a trained image classification model, and finishing the training of the image classification model.
Therefore, the image classification model training device provided by the application can effectively utilize the image samples in the labeled sample set, fully excavate the information of the image samples in the unlabeled sample set, reconstruct T new sample sets, be used for training the image classification model and ensure the diversity of the image samples.
In addition, the T vector extraction models are trained respectively based on the T new sample sets, and the accuracy of the T vector extraction models is guaranteed.
In addition, the image classification model is trained on the basis of an integrated vector obtained by processing each image sample in the labeled sample set through T vector extraction models and the label of the corresponding image sample. The integrated vectors are integrated with the features of the image samples extracted from all angles by the T vector extraction models, so that the diversity and accuracy of the image classification model obtained by training the set vectors of the samples can be guaranteed.
In summary, the image classification model training device provided in the embodiment of the present application can complete the training of the model by using the relatively small number of labeled training samples on the premise of ensuring the accuracy of the model.
In addition, based on the above image classification model training apparatus, the present application further provides an image classification apparatus, and with reference to fig. 7, a schematic structural diagram of the image classification apparatus provided in the embodiment of the present application is shown, where the apparatus includes:
a second vector extraction module 701, configured to extract an integrated vector of any image to be classified by using a vector extraction model obtained by the image classification model training apparatus according to any one of the above descriptions;
a second classification module 702, configured to use the integrated vector as an input of a trained image classification model obtained by the image classification model training apparatus according to any one of the above descriptions, and output a classification result of the image to be classified after the classification processing of the trained image classification model.
In the image classification device provided by the embodiment of the application, the integrated vector extracted by the vector extraction model can show the characteristics of the image to be classified to the maximum extent, so that the image to be classified is classified based on the integrated vector extracted by the vector extraction model, and the accuracy of the classification result can be improved.
In addition, an embodiment of the present application further provides an image classification model training device, as shown in fig. 8, which may include:
a processor 801, a memory 802, an input device 803, and an output device 804. The number of processors 801 in the image classification model training apparatus may be one or more, and one processor is taken as an example in fig. 8. In some embodiments of the invention, the processor 801, the memory 802, the input device 803 and the output device 804 may be connected by a bus or other means, wherein the connection by the bus is exemplified in fig. 8.
The memory 802 may be used for storing software programs and modules, and the processor 801 executes various functional applications and data processing of the image classification model training apparatus by operating the software programs and modules stored in the memory 802. The memory 802 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 802 may include high speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 803 may be used to receive input numeric or character information and generate signal inputs related to user settings and functional control of the image classification model training apparatus.
Specifically, in this embodiment, the processor 801 loads an executable file corresponding to a process of one or more application programs into the memory 802 according to the following instructions, and the processor 801 runs the application programs stored in the memory 802, thereby implementing various functions in the image classification model training method.
In addition, an embodiment of the present application further provides an image classification device, as shown in fig. 9, which may include:
a processor 901, a memory 902, an input device 903, and an output device 904. The number of processors 901 in the image classification device may be one or more, and one processor is taken as an example in fig. 9. In some embodiments of the present invention, the processor 901, the memory 902, the input device 903 and the output device 904 may be connected through a bus or other means, wherein the connection through the bus is exemplified in fig. 9.
The memory 902 may be used to store software programs and modules, and the processor 901 may execute various functional applications and data processing of the image classification apparatus by running the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like. Further, the memory 902 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. The input device 903 may be used to receive input numeric or character information and generate signal inputs related to user settings and functional control of the image sorting apparatus.
Specifically, in this embodiment, the processor 901 loads an executable file corresponding to a process of one or more application programs into the memory 902 according to the following instructions, and the processor 901 runs the application programs stored in the memory 902, thereby implementing various functions in the image classification method.
In addition, the present application also provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a terminal device, the terminal device is caused to execute the above-mentioned image classification model training method or image classification method.
It is understood that for the apparatus embodiments, since they correspond substantially to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The image classification model training method, the image classification device and the image classification equipment provided by the embodiment of the application are introduced in detail, a specific example is applied in the text to explain the principle and the implementation mode of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. An image classification model training method, characterized in that the method comprises:
selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probability that each image sample in the labeled sample set and the unlabeled sample set belongs to each category;
respectively training T vector extraction models which are constructed in advance in a one-to-one mode by utilizing the T new sample sets to obtain T trained vector extraction models;
respectively inputting the image samples in the labeled sample set into the T trained vector extraction models to output T vectors, and forming an integrated vector of each image sample in the labeled sample set based on the T vectors;
and training an image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain the trained image classification model.
2. The method of claim 1, wherein before selecting image samples from the labeled exemplar set and the unlabeled exemplar set to construct T new exemplar sets based on the probabilities that the respective image samples in the labeled exemplar set and the unlabeled exemplar set belong to respective categories, the method further comprises
And classifying each image sample in the pre-constructed labeled sample set and the non-labeled sample set respectively to obtain the probability that each image sample belongs to each category respectively.
3. The method according to claim 2, wherein before the classifying the pre-constructed image samples in the labeled sample set and the unlabeled sample set to obtain the probability that each image sample belongs to each category, the method further comprises:
randomly extracting m-dimensional features from the feature vectors of the image samples in the labeled sample set to form random feature vectors;
training a classification model through the random feature vectors and the labels of the image samples in the labeled sample set to obtain a trained classification model;
the method for classifying the image samples in the pre-constructed labeled sample set and the non-labeled sample set respectively to obtain the probability that each image sample belongs to each category respectively comprises the following steps:
and classifying each image sample in the pre-constructed labeled sample set and unlabeled sample set by using the trained classification model to obtain the probability that each image sample belongs to each class.
4. The method according to any one of claims 1-3, wherein selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probabilities that the respective image samples in the labeled sample set and the unlabeled sample set belong to the respective categories comprises:
for each category, ranking the probability belonging to the category from large to small, and determining the image samples in the labeled sample set and the unlabeled sample set corresponding to the n probabilities before the ranking;
a new sample set is constructed using the image samples.
5. The method according to any one of claims 1-3, wherein the inputting the image samples in the labeled sample set into T vector extraction models respectively to output T vectors, and the forming an integrated vector of each image sample in the labeled sample set based on the T vectors comprises:
after extracting the feature vectors of the image samples in the labeled sample set, respectively taking the feature vectors of the image samples as the input of T vector extraction models, and outputting T vectors after the T vector extraction models are processed;
integrating the T vectors into one vector as an integrated vector of the image sample; wherein the label of the integration vector is a label of the image sample.
6. A method of image classification, the method comprising:
extracting an integrated vector of any image to be classified by utilizing T vector extraction models obtained by the image classification model training method based on any one of claims 1-5;
taking the integrated vector as an input of a trained image classification model obtained based on the image classification model training method of any one of claims 1 to 5, and outputting a classification result of the image to be classified after the classification processing of the trained image classification model.
7. An apparatus for training an image classification model, the apparatus comprising:
the construction module is used for selecting image samples from the labeled sample set and the unlabeled sample set to construct T new sample sets based on the probability that each image sample in the labeled sample set and the unlabeled sample set belongs to each category;
the first training module is used for respectively training T vector extraction models which are constructed in advance in a one-to-one mode by utilizing the T new sample sets to obtain T trained vector extraction models;
the first vector extraction module is used for respectively inputting the image samples in the labeled sample set into the T trained vector extraction models to output T vectors, and forming an integrated vector of each image sample in the labeled sample set based on the T vectors;
and the second training module is used for training the image classification model by using the integrated vector and the label of each image sample in the labeled sample set to obtain the trained image classification model.
8. An image classification apparatus, characterized in that the apparatus comprises:
a second vector extraction module, configured to extract an integrated vector of any image to be classified by using T vector extraction models obtained based on the image classification model training apparatus of claim 7;
a second classification module, configured to use the integrated vector as an input of a trained image classification model obtained by the image classification model training apparatus according to claim 7, and output a classification result of the image to be classified after classification processing of the trained image classification model.
9. A computer-readable storage medium having stored therein instructions that, when executed on a terminal device, cause the terminal device to perform the method of any one of claims 1-6.
10. An apparatus, comprising: memory, a processor, and a computer program stored on the memory and executable on the processor, when executing the computer program, implementing the method of any of claims 1-6.
CN201910848857.1A 2019-09-09 2019-09-09 Image classification model training method, image classification method, device and equipment Active CN110674854B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910848857.1A CN110674854B (en) 2019-09-09 2019-09-09 Image classification model training method, image classification method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910848857.1A CN110674854B (en) 2019-09-09 2019-09-09 Image classification model training method, image classification method, device and equipment

Publications (2)

Publication Number Publication Date
CN110674854A CN110674854A (en) 2020-01-10
CN110674854B true CN110674854B (en) 2022-05-17

Family

ID=69076695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910848857.1A Active CN110674854B (en) 2019-09-09 2019-09-09 Image classification model training method, image classification method, device and equipment

Country Status (1)

Country Link
CN (1) CN110674854B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111352965B (en) * 2020-02-18 2023-09-08 腾讯科技(深圳)有限公司 Training method of sequence mining model, and processing method and equipment of sequence data
CN111931865B (en) * 2020-09-17 2021-01-26 平安科技(深圳)有限公司 Training method and device of image classification model, computer equipment and storage medium
CN113065533B (en) * 2021-06-01 2021-11-02 北京达佳互联信息技术有限公司 Feature extraction model generation method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909540A (en) * 2015-12-23 2017-06-30 神州数码信息系统有限公司 A kind of smart city citizen's preference discovery technique based on Cooperative Study
CN107038252A (en) * 2017-05-04 2017-08-11 沈阳航空航天大学 A kind of generation method of the route metric based on multi-modal data
CN107644235A (en) * 2017-10-24 2018-01-30 广西师范大学 Image automatic annotation method based on semi-supervised learning
CN108881196A (en) * 2018-06-07 2018-11-23 中国民航大学 The semi-supervised intrusion detection method of model is generated based on depth
CN109886343A (en) * 2019-02-26 2019-06-14 深圳市商汤科技有限公司 Image classification method and device, equipment, storage medium
CN110163301A (en) * 2019-05-31 2019-08-23 北京金山云网络技术有限公司 A kind of classification method and device of image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10846566B2 (en) * 2016-09-14 2020-11-24 Konica Minolta Laboratory U.S.A., Inc. Method and system for multi-scale cell image segmentation using multiple parallel convolutional neural networks
CN109858505B (en) * 2017-11-30 2023-04-07 厦门大学 Classification identification method, device and equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909540A (en) * 2015-12-23 2017-06-30 神州数码信息系统有限公司 A kind of smart city citizen's preference discovery technique based on Cooperative Study
CN107038252A (en) * 2017-05-04 2017-08-11 沈阳航空航天大学 A kind of generation method of the route metric based on multi-modal data
CN107644235A (en) * 2017-10-24 2018-01-30 广西师范大学 Image automatic annotation method based on semi-supervised learning
CN108881196A (en) * 2018-06-07 2018-11-23 中国民航大学 The semi-supervised intrusion detection method of model is generated based on depth
CN109886343A (en) * 2019-02-26 2019-06-14 深圳市商汤科技有限公司 Image classification method and device, equipment, storage medium
CN110163301A (en) * 2019-05-31 2019-08-23 北京金山云网络技术有限公司 A kind of classification method and device of image

Also Published As

Publication number Publication date
CN110674854A (en) 2020-01-10

Similar Documents

Publication Publication Date Title
CN112632385B (en) Course recommendation method, course recommendation device, computer equipment and medium
CN109471915B (en) Text evaluation method, device and equipment and readable storage medium
CN110674854B (en) Image classification model training method, image classification method, device and equipment
JP6894534B2 (en) Information processing method and terminal, computer storage medium
CN110009430B (en) Cheating user detection method, electronic device and computer readable storage medium
CN111914159B (en) Information recommendation method and terminal
CN112819023A (en) Sample set acquisition method and device, computer equipment and storage medium
CN113360711B (en) Model training and executing method, device, equipment and medium for video understanding task
CN110490237B (en) Data processing method and device, storage medium and electronic equipment
CN105069129A (en) Self-adaptive multi-label prediction method
CN110232128A (en) Topic file classification method and device
CN113704623A (en) Data recommendation method, device, equipment and storage medium
CN111178196A (en) Method, device and equipment for cell classification
CN110472246A (en) Work order classification method, device and storage medium
CN105164672A (en) Content classification
CN103870563B (en) It is determined that the method and apparatus of the theme distribution of given text
CN109543114A (en) Heterogeneous Information network linking prediction technique, readable storage medium storing program for executing and terminal
CN114692889A (en) Meta-feature training model for machine learning algorithm
CN112948526A (en) User portrait generation method and device, electronic equipment and storage medium
CN110826330B (en) Name recognition method and device, computer equipment and readable storage medium
CN108875060B (en) Website identification method and identification system
CN116304155A (en) Three-dimensional member retrieval method, device, equipment and medium based on two-dimensional picture
CN103544500B (en) Multi-user natural scene mark sequencing method
CN115878891A (en) Live content generation method, device, equipment and computer storage medium
CN115658885A (en) Intelligent text labeling method and system, intelligent terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant