Model generation method, object classification method, device, electronic device and medium
By determining the pseudo-classification results of unlabeled objects online and in real time and adjusting the model parameters, the problem of long iteration period of image classification model and fixed pseudo-labels in semi-supervised learning is solved, and the classification performance and iteration speed of the model are improved.
Patent Information
- Application Number
- CN202110099168.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-25
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-01-25
AI Technical Summary
The image classification model generated by semi-supervised learning in the field of image classification has a long iteration cycle, high time cost, and the pseudo-labels of unlabeled samples are fixed, which can easily affect the classification performance of the model.
By determining the pseudo-classification results of unlabeled objects online and in real time, input them into the loss function determination module to adjust the network parameters of the classification model to generate the object classification model.
The iteration speed of model is accelerated, the classification performance of the model is improved, and the rapid generation of object classification models with good classification performance is achieved.
Smart Images

Figure CN112861935B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer application technology, and in particular to a model generation method, an object classification method, a device, an electronic device, and a medium. Background Art
[0002] Semi-Supervised Learning (SSL) has a good application in the field of image classification. Its specific implementation process is: based on the labeled sample set, the original classification model is trained to obtain an image classification model; based on the image classification model, the unlabeled sample set is predicted, and the prediction result of the unlabeled sample with a relatively high confidence in each prediction result is used as the pseudo label of the unlabeled sample, and the unlabeled sample and its pseudo label are added as labeled samples to the labeled sample set; based on the updated labeled sample set, the above process is iteratively executed.
[0003] However, there are the following disadvantages in generating image classification models based on SSL: each update of the labeled sample set will lead to the re-iteration of the image classification model, and the entire process cycle is long and the time cost is high; and, during the iteration process, the pseudo-labels of unlabeled samples will never change, which means that if the pseudo-label prediction is wrong, it will seriously affect the classification performance of the generated image classification model. Summary of the invention
[0004] The embodiments of the present disclosure provide a model generation method, an object classification method, an apparatus, an electronic device, and a medium to achieve the effect of quickly generating an object classification model with good classification performance.
[0005] In a first aspect, an embodiment of the present disclosure provides a model generation method, which may include:
[0006] Obtaining a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module;
[0007] Input each unlabeled object into the classification prediction module, and determine the pseudo classification results of each unlabeled object according to each unlabeled prediction result output by the classification prediction module;
[0008] Each unlabeled prediction result and the corresponding pseudo classification result are input into the loss function determination module, and the network parameters in the classification prediction module are adjusted according to the output result of the loss function determination module to generate an object classification model.
[0009] In a second aspect, the present disclosure also provides an object classification method, which may include:
[0010] Obtain an object to be classified and an object classification model generated according to the model generation method provided in any embodiment of the present disclosure;
[0011] The object to be classified is input into the object classification model, and the target classification result of the object to be classified is obtained according to the output result of the object classification model.
[0012] In a third aspect, the embodiments of the present disclosure further provide a model generation device, which may include:
[0013] An object acquisition module, used to acquire a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module;
[0014] A result determination module is used to input each unlabeled object into the classification prediction module, and determine the pseudo classification result of the unlabeled object according to the unlabeled prediction result output by the classification prediction module;
[0015] The model generation module is used to input the unlabeled prediction results and pseudo classification results into the loss function determination module, adjust the network parameters in the classification prediction module according to the output results of the loss function determination module, and generate an object classification model.
[0016] In a fourth aspect, the present disclosure also provides an object classification device, which may include:
[0017] A model acquisition module, used to acquire an object to be classified and an object classification model generated according to the model generation method provided in any embodiment of the present disclosure;
[0018] The object classification module is used to input the object to be classified into the object classification model, and obtain the target classification result of the object to be classified according to the output result of the object classification model.
[0019] In a fifth aspect, an embodiment of the present disclosure further provides an electronic device, which may include:
[0020] one or more processors;
[0021] a memory for storing one or more programs,
[0022] When one or more programs are executed by one or more processors, the one or more processors implement the model generation method or object classification method provided by any embodiment of the present disclosure.
[0023] In a sixth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the model generation method or object classification method provided by any embodiment of the present disclosure is implemented.
[0024] The technical solution of the disclosed embodiment can obtain the unlabeled prediction results of each unlabeled object output by the classification prediction module by inputting the obtained multiple unlabeled objects into the classification prediction module of the classification model to be trained, and then determine the pseudo-classification result of each unlabeled object according to the unlabeled prediction result. This method of determining the pseudo-classification result online and in real time speeds up the model iteration speed and improves the model classification performance; then the unlabeled prediction results of each unlabeled object and the corresponding pseudo-classification results are input into the loss function determination module of the classification model to be trained, and the network parameters in the classification prediction module are adjusted according to the output result of the loss function determination module to generate an object classification model. The above technical solution can speed up the model iteration speed and improve the model classification performance by determining the pseudo-classification results of unlabeled objects online and in real time during the model iteration process, thereby achieving the effect of quickly generating an object classification model with good classification performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0026] Figure 1 is a flow chart of a model generation method in Embodiment 1 of the present disclosure;
[0027] Figure 2 is a flow chart of a model generation method in Embodiment 2 of the present disclosure;
[0028] Figure 3 is a schematic diagram of an optional example of a model generation method in Embodiment 2 of the present disclosure;
[0029] Figure 4 is a flow chart of an object classification method in Embodiment 3 of the present disclosure;
[0030] Figure 5 is a structural block diagram of a model generation device in Embodiment 4 of the present disclosure;
[0031] Figure 6 is a structural block diagram of an object classification device in Embodiment 5 of the present disclosure;
[0032] Figure 7 It is a structural diagram of an electronic device in Embodiment 6 of the present disclosure. DETAILED DESCRIPTION
[0033] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0034] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0035] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0036] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0037] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0038] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0039] In the following embodiments, each embodiment provides both optional features and examples. The various features recorded in the embodiments can be combined to form multiple optional solutions. Each numbered embodiment should not be regarded as only one technical solution.
[0040] Embodiment 1
[0041] Figure 1This is a flow chart of a model generation method provided in the first embodiment of the present disclosure. This embodiment can be applied to the case of generating an object classification model, and in particular, can be applied to the case of quickly generating an object classification model with good classification performance. The method can be executed by the model generation device provided in the embodiment of the present disclosure, and the device can be implemented by software and / or hardware, and the device can be integrated in an electronic device, and the electronic device can be various user terminal devices or servers.
[0042] See also Figure 1 The method of the embodiment of the present disclosure specifically includes the following steps:
[0043] S110, obtaining a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module.
[0044] Among them, the classification model to be trained can be a model that can realize the classification function but has not been trained completely, such as an original classification model, an intermediate classification model, etc. The original classification model can be a model that can realize the classification function but has not undergone any training; the intermediate classification model can be a model that can realize the classification function but has undergone some training but has not been trained completely, and its training samples can be labeled training samples and / or unlabeled objects. Each group of labeled training samples can include labeled objects and the true classification results of the labeled objects. In practical applications, the true classification results can be understood as the true labels of the labeled objects. Further, the classification model to be trained can include a classification prediction module and a loss function determination module. The classification prediction module can be used to predict the classification category of the unlabeled object, and the loss function determination module can be used to calculate the loss of the unlabeled prediction results and pseudo-classification results of the unlabeled object.
[0045] It should be noted that the reason for the existence of the intermediate classification model is that the model generation process is usually a model iteration process. In practical applications, all training samples are usually not input into the classification model to be trained at one time, but are input in batches. The training samples input into the classification model to be trained each time can be called a batch. The total number of training samples in each batch is batchsize, that is, an intermediate classification model will be obtained after each batch of training. In addition, in order to learn to obtain better classification performance, all training samples can be passed back and forth in the classification model to be trained for many times, that is, when all training samples are passed back and forth in the classification model to be trained, an intermediate classification model can be obtained, where the number of times all training samples are passed back and forth in the classification model to be trained can be represented by the number of iterations epoch.
[0046] The unlabeled object may be an object that is not labeled in the actual classification result. In practical applications, the unlabeled object may optionally be an object in any scene where there is a classification requirement, such as an object in a classification scene such as image content, video action, text style, speech emotion, etc., which is not specifically limited here.
[0047] S120 , inputting each unlabeled object into a classification prediction module, and determining a pseudo classification result of each unlabeled object according to each unlabeled prediction result output by the classification prediction module.
[0048] Among them, for each unlabeled object, the unlabeled object is input into the classification prediction module, and the classification prediction module can process the unlabeled object, predict the classification category to which the unlabeled object belongs according to the processing result, and output the prediction result (i.e., the unlabeled prediction result), thereby obtaining the unlabeled prediction result of each unlabeled object. In practical applications, optionally, the unlabeled prediction result can be represented in a variety of ways, such as a certain classification category to which the unlabeled object belongs, the probability of the category to which it may belong to each classification category, the classification category to which it may belong and the probability of the category to which it belongs, etc., which are not specifically limited here. Of course, the above classification categories can be categories pre-set according to actual needs. Exemplarily, taking the binary classification "yes" and "no" as an example, the unlabeled prediction result can be 1 (i.e., "yes") The category probability is 0.6 and the category probability of 0 (i.e., "no") is 0.4.
[0049] Further, for each unlabeled object, since the true classification result of the unlabeled object is unknown, but the model generation process requires this information, the classification category to which it belongs can be determined according to the unlabeled prediction result of the unlabeled object, and the pseudo classification result can be determined according to the classification category. In practical applications, optionally, the pseudo classification result can be understood as a pseudo label of the unlabeled object, which can be an automatically determined label that may hit the real label or may not hit the real label. It should be noted that there are many ways to implement the determination process of the pseudo classification result, such as directly using the classification category in the unlabeled prediction result as a pseudo classification result, and then determining the pseudo classification result according to the category probability of belonging to each classification category in the unlabeled prediction result, etc., which is not specifically limited here. In addition, the pseudo classification result can also be represented in a variety of ways, such as it can be a certain classification category to which the unlabeled object belongs, the category probability that it may belong to each classification category, the classification category that it may belong to and the category probability that it belongs to the classification category, etc., which are not specifically limited here. Exemplarily, continuing with the above example, the pseudo classification result may be 1 (ie, "yes") 0 (ie, "no"), or 0 (ie, "yes") 1 (ie, "no").
[0050] S130, inputting each unlabeled prediction result and the corresponding pseudo classification result into a loss function determination module, adjusting the network parameters in the classification prediction module according to the output result of the loss function determination module, and generating an object classification model.
[0051] Among them, the prediction result of each unlabeled object and the corresponding pseudo classification result are input into the loss function determination module, so that the loss function determination module calculates the loss between the two according to the preset loss function, and outputs the calculation result. Furthermore, the network parameters in the classification module can be adjusted according to the output result of the loss function determination module, and the object classification model is generated according to the adjustment result. Exemplarily, taking the loss function determination module as an example of calculating the loss of the two by cross entropy, assuming that the category probability of the unlabeled prediction result of 1 is 0.6 and the category probability of 0 is 0.4, and the pseudo classification results are 1 and 0, then the cross entropy can be calculated according to 1, 0 and 0.6, 0.4. In practical applications, optionally, after calculating the loss gradient of each unlabeled image, the loss function determination module can process all the loss gradients and then transmit them back, such as transmitting the mean of all the loss gradients; it can also filter out the loss gradients that meet the preset gradient threshold from all the loss gradients, and process these filtered loss gradients and then transmit them back, etc., which are not specifically limited here.
[0052] It should be noted that, as described above, the object classification model generation process may require each training sample to be transferred back and forth in the classification model to be trained multiple times, and a back and forth transfer process can be performed in batches, so the above steps can be a batch training process, or an epoch training process, etc., which are not specifically limited here. In addition, the above pseudo-classification results are determined according to the unlabeled prediction results during the model training process, rather than being determined based on the intermediate classification model completed after the initial training of the model. This method of determining the pseudo-classification results online effectively solves the problem of high time cost caused by the need to re-train the intermediate classification model completed by the initial training multiple times, thereby speeding up the model iteration speed; moreover, for each unlabeled object, when it is trained again, the previous pseudo-classification results will not be directly applied, but the pseudo-classification results will be re-determined. This method of updating the pseudo-classification results in real time during the model iteration process effectively solves the problem that if there are errors in the fixed pseudo-classification results, the classification performance of the generated object classification model will be greatly affected, thereby improving the classification performance of the object classification model.
[0053] The technical solution of the disclosed embodiment can obtain the unlabeled prediction results of each unlabeled object output by the classification prediction module by inputting the obtained multiple unlabeled objects into the classification prediction module of the classification model to be trained, and then determine the pseudo-classification result of each unlabeled object according to the unlabeled prediction result. This method of determining the pseudo-classification result online and in real time speeds up the model iteration speed and improves the model classification performance; then the unlabeled prediction results of each unlabeled object and the corresponding pseudo-classification results are input into the loss function determination module of the classification model to be trained, and the network parameters in the classification prediction module are adjusted according to the output result of the loss function determination module to generate an object classification model. The above technical solution can speed up the model iteration speed and improve the model classification performance by determining the pseudo-classification results of unlabeled objects online and in real time during the model iteration process, thereby achieving the effect of quickly generating an object classification model with good classification performance.
[0054] An optional technical solution, based on the first embodiment, determines the pseudo classification results of each unlabeled object according to each unlabeled prediction result output by the classification prediction module, which may specifically include: obtaining each unlabeled prediction result output by the classification prediction module and a pre-set classification category; for each unlabeled prediction result, determining the category probability that the unlabeled object corresponding to the unlabeled result belongs to each classification category according to the unlabeled prediction result, and determining the pseudo classification result of the unlabeled object corresponding to the unlabeled result according to each category probability. Among them, since the unlabeled prediction result of the unlabeled object can indicate the category probability that the unlabeled object belongs to each pre-set classification category, the category probability that the unlabeled object belongs to each classification category can be determined according to the unlabeled prediction result, and then the pseudo classification result of the unlabeled object corresponding to the unlabeled result can be determined according to each category probability.
[0055] Exemplarily, each category probability may include a first category probability and a second category probability, the first category probability is the probability that the unlabeled object belongs to the first category, and the second category probability is the probability that the unlabeled object belongs to the second category, then the pseudo-classification result has a first category probability of the first category, and a second category probability of the second category. Figuratively, taking the two categories of "yes" and "no" as an example, according to the unlabeled prediction results, the category probability of "yes" is 0.6 and the category probability of "no" is 0.4, then it can be determined that the pseudo-classification result with a 60% probability is 1, 0, and the pseudo-classification result with a 40% probability is 0, 1, that is, only one of the two categories is 1 and the rest are 0. In practical applications, for the visualization database imagenet, the top5 accuracy is almost 100%, that is, assuming that the probabilities of each category are sorted from large to small, the classification categories corresponding to the category probabilities ranked in the top 5 can almost 100% hit the real classification results. Therefore, the real classification results can be assumed to be the classification categories corresponding to the category probabilities ranked at the head, or the pseudo-classification results that can hit the real classification results are usually the classification categories corresponding to the category probabilities ranked at the head.
[0056] In the above technical solution, as the number of model iterations increases, the accuracy of the category probability of the unlabeled objects belonging to each classification category is also continuously improved. Furthermore, when the pseudo-classification result is determined by the category probability, the possibility that the pseudo-classification result hits the true classification result of the unlabeled object is also getting higher and higher. This is one of the important influencing factors for the subsequent generation of an object classification model with better classification performance.
[0057] Embodiment 2
[0058] Figure 2 It is a flow chart of a model generation method provided in the second embodiment of the present disclosure. This embodiment is optimized based on the various optional schemes in the above embodiments. In this embodiment, optionally, the model generation method may also include: obtaining labeled objects and true value classification results of the labeled objects, and using the labeled objects and the true value classification results as a group of labeled training samples; inputting multiple groups of labeled training samples into the classification prediction module, and obtaining the labeled prediction results of each labeled object output by the classification prediction module; inputting each labeled prediction result and the corresponding true value classification result into the loss function determination module. Among them, the explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0059] Correspondingly, such as Figure 2 As shown, the method of this embodiment may specifically include the following steps:
[0060] S210, obtaining a classification model to be trained, multiple unlabeled objects, labeled objects, and true value classification results of the labeled objects, and using the labeled objects and the true value classification results as a group of labeled training samples, wherein the classification model to be trained includes a classification prediction module and a loss function determination module.
[0061] The labeled object may be an object whose real classification result has been labeled, and the object and the unlabeled object are objects in the same classification scene; the true classification result is the real classification result of the labeled object.
[0062] S220: Input each labeled training sample and each unlabeled object into a classification prediction module, and obtain an unlabeled prediction result of each unlabeled object and a labeled prediction result of each labeled object outputted by the classification prediction module.
[0063] Among them, each labeled training sample and each unlabeled object are simultaneously input into the classification prediction module. The classification prediction module and the subsequent loss function determination module cooperate with each other to learn features that are helpful for object classification from the labeled training samples. This learning result helps the classification prediction module to extract features that are helpful for object classification from the unlabeled objects, and then predict the unlabeled prediction results of the unlabeled objects based on the features, thereby improving the prediction accuracy of the unlabeled prediction results.
[0064] S230 , determining pseudo classification results of each unlabeled object according to each unlabeled prediction result.
[0065] S240, input each labeled prediction result and the corresponding true value classification result, and each unlabeled prediction result and the corresponding pseudo classification result into the loss function determination module, and adjust the network parameters in the classification prediction module according to the output result of the loss function determination module to generate an object classification model.
[0066] Among them, the labeled prediction results and the corresponding true value classification results of each labeled object, as well as the unlabeled prediction results and the corresponding pseudo classification results of each unlabeled object are input into the loss function determination module, and then the network parameters in the classification prediction module are adjusted according to the loss gradient between the labeled prediction results of each labeled object and the corresponding true value classification results output by the loss function determination module. Since the true value classification result is the true classification result of the manually labeled labeled object, the above scheme improves the adjustment accuracy of the network parameters, thereby improving the classification performance of the object classification model generated thereby.
[0067] According to the technical solution of the disclosed embodiment, during the model iteration process, the classification prediction module and the loss function determination module cooperate with each other, and the addition of labeled training samples enables the classification prediction module to learn features that are helpful for object classification, and the features help the classification prediction module to extract features that are helpful for object classification from each unlabeled object, and then accurately predict the unlabeled prediction results of the unlabeled objects based on the features; and the addition of labeled training samples can also enable the loss function determination module to obtain a loss gradient that helps to improve the adjustment accuracy of network parameters, thereby improving the classification performance of the object classification model generated thereby.
[0068] An optional technical solution, based on the second embodiment, during the model iteration process, considering that in the early stage of model iteration, the classification model to be trained may not have well learned the features of the labeled objects that are helpful for object classification, the features may be visual features and / or high-level features, wherein the visual features may be visual features, such as local features, texture features, color features, etc. of the labeled objects, and the high-level features may be features that can represent semantic information. In order to ensure the classification performance of the object classification model generated subsequently, the proportion of the labeled number of labeled training samples can be increased in the early stage of model iteration and the proportion of the unlabeled number of unlabeled objects can be reduced accordingly. In addition, considering that in the later stage of model iteration, the classification model to be trained may be overfitted on each labeled training sample, the proportion of the labeled number can be reduced and the proportion of the unlabeled number can be increased accordingly in the later stage of model iteration, so that the classification model to be trained can learn new data.
[0069] For the above considerations, the object classification method may further include: obtaining the number of iterations of each unlabeled object in the classification prediction module at the current moment, and determining the unlabeled number ratio of the unlabeled object according to the number of iterations; determining the unlabeled number of unlabeled objects and the labeled number of labeled training samples according to the unlabeled number ratio and the total number of pre-set training samples, wherein each training sample may include a labeled training sample or an unlabeled object. The number of iterations may be the number of times each unlabeled object has been transmitted back and forth in the classification prediction module at the current moment, which may be represented by epoch. As the epoch increases, the classification model to be trained learns more and more features that are helpful for object classification from the labeled objects, so the unlabeled number ratio of the unlabeled objects may be increased as the epoch increases, and the unlabeled number ratio is the ratio of the unlabeled number of unlabeled objects to the total number of pre-set training samples, and the total number may be understood as the batchsize described above. In practical applications, optionally, the unlabeled number ratio and the number of iterations may be positively correlated, for example, the unlabeled number ratio may increase linearly with the increase in the number of iterations. Furthermore, the unlabeled number of unlabeled objects and the labeled number of labeled training samples can be determined based on the proportion of unlabeled numbers and the total number. Then, correspondingly, inputting multiple groups of labeled training samples into the classification prediction module may include: inputting a labeled number of labeled training samples into the classification prediction module; correspondingly, inputting each unlabeled object into the classification prediction module may include: inputting an unlabeled number of unlabeled objects into the classification prediction module. The above technical scheme, by effectively controlling the input ratio of unlabeled objects and labeled objects, enables the classification prediction module to learn features that are helpful for object classification at all stages of model iteration, thereby further improving the classification performance of the subsequently generated object classification model.
[0070] An optional technical solution, based on the above technical solution, usually, the loss function determination module is for all training samples in a batch to perform loss calculation, combined with the application scenarios that may be involved in the embodiment of the present disclosure, the whole training sample can include each labeled training sample and each unlabeled object. On this basis, considering that the pseudo classification result of the unlabeled object may not hit the real classification result, when the loss gradient is returned based on the pseudo classification result that does not hit the real classification result, this will have a greater impact on the classification performance of the object classification model generated thereby. On this basis, considering that the size of the unlabeled number ratio can indirectly reflect the prediction accuracy of the unlabeled prediction result, and the prediction accuracy of the unlabeled prediction result will directly affect the determination accuracy of the pseudo classification result, the return number ratio can be determined according to the unlabeled number ratio, and the return number ratio is for the unlabeled prediction results and the corresponding pseudo classification results of all unlabeled objects input to the loss function determination module. The return number ratio of the unlabeled object that can perform loss gradient return in the unlabeled number of all unlabeled objects. In practical applications, optionally, the return number ratio and the unlabeled number ratio can be positively correlated.
[0071] Based on the above considerations, the above object classification method may further include: determining the proportion of the number of returns according to the proportion of the unlabeled number, and determining the number of returns according to the proportion of the number of returns and the number of unlabeled objects; accordingly, the loss function determination module obtains the output result through the following steps: for each unlabeled object, the loss gradient of the unlabeled object is determined according to the unlabeled prediction result and the pseudo-classification result of the unlabeled object. The loss gradient can be the loss function determination module calculating the loss between the two according to a preset loss function, and the gradient value obtained after deriving the loss calculation result, and its size can reflect whether the corresponding pseudo-classification result can hit the true The possibility of a real classification result; then, according to the loss gradient, the target objects with the number of returns are screened out from each unlabeled object, such as taking the unlabeled object corresponding to the loss gradient with the smaller number of returns in each loss gradient as the target object, and sorting each unlabeled object based on the loss gradient, and screening the target objects with the number of returns from each unlabeled object according to the sorting position of each unlabeled object in the sorting result, etc., which are not specifically limited here; thus, according to the unlabeled prediction results and pseudo-classification results of each target object, and the labeled prediction results and true classification results of each labeled object, the output result can be obtained. The above technical scheme controls the target objects that can be gradient returned in each unlabeled object, or controls the loss gradient that can be gradient returned in each loss gradient, thereby ensuring that the loss gradient that can be gradient returned is basically the gradient value determined according to the pseudo-classification result that can hit the real classification result, thereby improving the classification performance of the subsequently generated object classification model.
[0072] The technical solution of this embodiment takes the exemplary description in the first embodiment as an example, and its possible application scenarios are: taking the classification scenario as whether the image to be classified includes a car as an example, Figure 3 As shown in the figure, assuming that the batchsize is N, the input ratio of unlabeled images and labeled images is controlled by the proportion of unlabeled images p, that is, during the model iteration process, the batchsize of unlabeled images is p*N, and the batchsize of labeled images is (1-p)*N. p can linearly increase from 0 to max_p as the epoch increases. max_p is a value greater than 0 and less than 1, such as 0.2, 0.3, 0.4, etc. Each unlabeled image and each labeled image is input into the classification prediction module, and the unlabeled prediction results of each unlabeled image and the labeled prediction results of each labeled image are obtained respectively, and then the corresponding pseudo labels are determined online according to each unlabeled prediction result. Further, the labeled prediction results and true value labels of each labeled image, and the unlabeled prediction results and pseudo labels of each unlabeled image are input into the loss function determination module, so that the loss function determination module determines the number of unlabeled images that can be returned for loss gradient return according to the return number ratio q and p*N, and then selects q*p*N target images from each unlabeled image according to the loss gradient of each unlabeled image, and returns the loss gradient of each target image and the loss gradient of each labeled image. In practical applications, optionally, q can be calculated according to a preset return number ratio determination function, the input parameter of the function can be p, and the specific setting of the function can be determined according to the expected numerical range of p and the expected numerical range of q. For example, assuming that the expected numerical range of p is [0,0.3] and the expected numerical range of q is [0.5,1), the function can be set to q=1 / (1+e**(-10*p)) so that [0,0.3] is mapped to [0.5,1). The image classification model generated based on the above technical solution can increase the Top 1 accuracy by more than 5% compared to the image classification model generated only based on labeled images.
[0073] Embodiment 3
[0074] Figure 4 is a flow chart of an object classification method provided in the third embodiment of the present disclosure. This embodiment is applicable to the case where a target classification result of an object to be classified is determined based on a generated object classification model. The method can be executed by an object classification device provided in the embodiment of the present disclosure, and the device can be implemented by software and / or hardware. The device can be integrated in an electronic device, and the electronic device can be various user terminal devices or servers.
[0075] See also Figure 4The method of the embodiment of the present disclosure specifically includes the following steps:
[0076] S310: Obtain an object to be classified and an object classification model generated by the model generation method provided by any embodiment of the present disclosure.
[0077] The object to be classified may be an object with classification requirements in a classification scenario, and the classification scenario may be the same as the classification scenario where the unlabeled object in the model generation process is located. The object classification model is a model with good classification performance generated based on the above model generation method.
[0078] S320: Input the object to be classified into the object classification model, and obtain the target classification result of the object to be classified according to the output result of the object classification model.
[0079] The output result of the object classification model can be represented in a variety of ways, which can be the classification category to which the object to be classified belongs, the probability of each classification category to which it may belong, the classification category to which it may belong and the probability of the classification category to which it may belong, etc., which are not specifically limited here. Then, the target classification result of the object to be classified can be obtained according to the output result.
[0080] The technical solution of the embodiment of the present disclosure can obtain the accurate target classification result of the object to be classified by inputting the object to be classified into an object classification model with good classification performance according to the output result of the object classification model. The above technical solution achieves the effect of accurately determining the target classification result of the object to be classified.
[0081] Embodiment 4
[0082] Figure 5 This is a structural block diagram of a model generation device provided in Embodiment 4 of the present disclosure, and the device is used to execute the model generation method provided in any of the above embodiments. The device and the model generation method of the above embodiments belong to the same concept, and the details not described in detail in the embodiment of the model generation device can refer to the embodiment of the above model generation method. Figure 5 The device may specifically include: an object acquisition module 410, a result determination module 420 and a model generation module 430.
[0083] The object acquisition module 410 is used to acquire a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module;
[0084] A result determination module 420 is used to input each unlabeled object into the classification prediction module, and determine the pseudo classification result of the unlabeled object according to the unlabeled prediction result output by the classification prediction module;
[0085] The model generation module 430 is used to input the unlabeled prediction results and the pseudo classification results into the loss function determination module, and adjust the network parameters in the classification prediction module according to the output results of the loss function determination module to generate an object classification model.
[0086] Optionally, the result determination module 420 may specifically include:
[0087] A classification category acquisition unit, used to acquire each unlabeled prediction result output by the classification prediction module and a preset classification category;
[0088] The pseudo classification result determination unit is used to determine, for each unlabeled prediction result, the category probability that the unlabeled object corresponding to the unlabeled result belongs to each classification category according to the unlabeled prediction result, and determine the pseudo classification result of the unlabeled object corresponding to the unlabeled result according to each category probability.
[0089] Optionally, based on the above device, the device may further include:
[0090] A training sample acquisition module is used to obtain labeled objects and true value classification results of the labeled objects, and use the labeled objects and the true value classification results as a set of labeled training samples;
[0091] A prediction result acquisition module, used to input multiple groups of labeled training samples into the classification prediction module, and obtain the labeled prediction results of each labeled object output by the classification prediction module;
[0092] The result input module is used to input each labeled prediction result and the corresponding true value classification result into the loss function determination module.
[0093] Optionally, based on the above device, the device may further include:
[0094] A quantity ratio determination module is used to obtain the number of iterations of each unlabeled object in the classification prediction module at the current moment, and determine the unlabeled quantity ratio of the unlabeled object according to the number of iterations;
[0095] A labeling quantity determination module, used to determine the unlabeled quantity of unlabeled objects and the labeled quantity of labeled training samples according to the unlabeled quantity ratio and the total number of preset training samples, wherein each training sample includes a labeled training sample or an unlabeled object;
[0096] Accordingly, the prediction result acquisition module may specifically include: a sample input unit, which is used to input a labeled number of labeled training samples into the classification prediction module;
[0097] Correspondingly, the result determination module 420 may specifically include: an object input unit, configured to input an unlabeled number of unlabeled objects into the classification prediction module.
[0098] Optionally, based on the above device, the device may further include:
[0099] A return quantity determination module, used to determine the return quantity ratio according to the unlabeled quantity ratio, and determine the return quantity according to the return quantity ratio and the unlabeled quantity;
[0100] Correspondingly, the loss function determination module obtains the output result through the following units:
[0101] A loss gradient determination unit, used for determining, for each unlabeled object, a loss gradient of the unlabeled object according to an unlabeled prediction result and a pseudo classification result of the unlabeled object;
[0102] A target object screening unit, used to screen out the target objects of the returned quantity from each unlabeled object according to the loss gradient;
[0103] The output result obtaining unit is used to obtain the output result according to the unlabeled prediction result and pseudo classification result of each target object, and the labeled prediction result and true value classification result of each labeled object.
[0104] On this basis, the target object screening unit can be optionally used to
[0105] Sort the unlabeled objects based on the loss gradient;
[0106] According to the ranking position of each unlabeled object in the ranking result, the target objects of the returned quantity are filtered out from each unlabeled object.
[0107] On this basis, optionally, the proportion of unlabeled quantities is positively correlated with the number of iterations; and / or, the proportion of returned quantities is positively correlated with the proportion of unlabeled quantities.
[0108] The model generation device provided in the fourth embodiment of the present disclosure inputs the acquired multiple unlabeled objects into the classification prediction module of the classification model to be trained through the object acquisition module and the result determination module, and obtains the unlabeled prediction results of each unlabeled object output by the classification prediction module, and then determines its pseudo-classification result according to the unlabeled prediction result of each unlabeled object. This method of determining the pseudo-classification result online and in real time accelerates the model iteration speed and improves the model classification performance; then, the model generation module inputs the unlabeled prediction results of each unlabeled object and the corresponding pseudo-classification results into the loss function determination module of the classification model to be trained, and adjusts the network parameters in the classification prediction module according to the output result of the loss function determination module to generate an object classification model. The above device can accelerate the model iteration speed and improve the model classification performance by determining the pseudo-classification results of unlabeled objects online and in real time during the model iteration process, thereby achieving the effect of quickly generating an object classification model with good classification performance.
[0109] The model generation device provided in the embodiments of the present disclosure can execute the model generation method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0110] It is worth noting that in the embodiment of the above-mentioned model generation device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present disclosure.
[0111] Embodiment 5
[0112] Figure 6 This is a block diagram of the structure of the object classification device provided in the fifth embodiment of the present disclosure. The device is used to execute the object classification method provided in any of the above embodiments. The device and the object classification method of the above embodiments belong to the same concept. For details not described in detail in the embodiment of the object classification device, please refer to the embodiment of the above object classification method. Figure 6 , the device may specifically include: a model acquisition module 510 and an object classification module 520.
[0113] The model acquisition module 510 is used to acquire the object to be classified and the object classification model generated by the model generation method provided by any embodiment of the present disclosure;
[0114] The object classification module 520 is used to input the object to be classified into the object classification model, and obtain the target classification result of the object to be classified according to the output result of the object classification model.
[0115] The object classification device provided in the fifth embodiment of the present disclosure inputs the object to be classified into the object classification model with good classification performance through the cooperation between the model acquisition module and the object classification module, and obtains the accurate target classification result of the object to be classified according to the output result of the object classification model. The above device achieves the effect of accurately determining the target classification result of the object to be classified.
[0116] The object classification device provided in the embodiments of the present disclosure can execute the object classification method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0117] It is worth noting that in the embodiment of the above-mentioned object classification device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present disclosure.
[0118] Embodiment 6
[0119] Reference below Figure 7 , which shows an electronic device (eg, Figure 7 The electronic device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG7 is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.
[0120] like Figure 7 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0121] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0122] Embodiment 7
[0123] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0124] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0125] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0126] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0127] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a classification model to be trained and multiple unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module; inputs each unlabeled object into the classification prediction module, and determines a pseudo-classification result of each unlabeled object according to each unlabeled prediction result output by the classification prediction module; inputs each unlabeled prediction result and the corresponding pseudo-classification result into the loss function determination module, adjusts the network parameters in the classification prediction module according to the output result of the loss function determination module, and generates an object classification model.
[0128] Alternatively, the computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device: obtains the object to be classified and the object classification model generated by the model generation method provided by any embodiment of the present disclosure; inputs the object to be classified into the object classification model, and obtains the target classification result of the object to be classified based on the output result of the object classification model.
[0129] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0130] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0131] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, an object acquisition module may also be described as "acquiring a classification model to be trained and multiple unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module".
[0132] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0133] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0134] According to one or more embodiments of the present disclosure, [Example 1] provides a model generation method, which may include:
[0135] Obtaining a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module;
[0136] Input each unlabeled object into the classification prediction module, and determine the pseudo classification results of each unlabeled object according to each unlabeled prediction result output by the classification prediction module;
[0137] Each unlabeled prediction result and the corresponding pseudo classification result are input into the loss function determination module, and the network parameters in the classification prediction module are adjusted according to the output result of the loss function determination module to generate an object classification model.
[0138] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1, and determining the pseudo classification results of each unlabeled object according to each unlabeled prediction result output by the classification prediction module may include:
[0139] Obtain each unlabeled prediction result and pre-set classification category output by the classification prediction module;
[0140] For each unlabeled prediction result, the category probability that the unlabeled object corresponding to the unlabeled result belongs to each classification category is determined according to the unlabeled prediction result, and the pseudo classification result of the unlabeled object corresponding to the unlabeled result is determined according to each category probability.
[0141] According to one or more embodiments of the present disclosure, [Example 3] provides the method of Example 1, and the above-mentioned model generation method may also include:
[0142] Obtaining the labeled objects and the true value classification results of the labeled objects, and using the labeled objects and the true value classification results as a set of labeled training samples;
[0143] Input multiple groups of labeled training samples into the classification prediction module, and obtain the labeled prediction results of each labeled object output by the classification prediction module;
[0144] Each labeled prediction result and the corresponding true value classification result are input into the loss function determination module.
[0145] According to one or more embodiments of the present disclosure, [Example 4] provides the method of Example 3, and the above-mentioned model generation method may also include:
[0146] Obtain the number of iterations of each unlabeled object in the classification prediction module at the current moment, and determine the unlabeled quantity ratio of the unlabeled objects according to the number of iterations;
[0147] Determine the unlabeled number of unlabeled objects and the labeled number of labeled training samples according to the unlabeled number ratio and the total number of preset training samples, wherein each training sample includes a labeled training sample or an unlabeled object;
[0148] Accordingly, inputting the plurality of groups of labeled training samples into the classification prediction module may include: inputting a labeled number of labeled training samples into the classification prediction module;
[0149] Inputting each unlabeled object into the classification prediction module may include: inputting an unlabeled number of unlabeled objects into the classification prediction module.
[0150] According to one or more embodiments of the present disclosure, [Example 5] provides the method of Example 4, and the above-mentioned model generation method may also include:
[0151] Determine the proportion of the number of returns based on the proportion of the number of unmarked items, and determine the number of returns based on the proportion of the number of returns and the number of unmarked items;
[0152] Correspondingly, the loss function determination module can obtain the output result through the following steps:
[0153] For each unlabeled object, determine the loss gradient of the unlabeled object according to the unlabeled prediction result and the pseudo classification result of the unlabeled object;
[0154] Filter the target objects of the returned quantity from each unlabeled object according to the loss gradient;
[0155] The output result is obtained based on the unlabeled prediction results and pseudo classification results of each target object, and the labeled prediction results and true value classification results of each labeled object.
[0156] According to one or more embodiments of the present disclosure, [Example 6] provides the method of Example 5, which may include:
[0157] Sort the unlabeled objects based on the loss gradient;
[0158] According to the ranking position of each unlabeled object in the ranking result, the target objects of the returned quantity are filtered out from each unlabeled object.
[0159] According to one or more embodiments of the present disclosure, [Example 7] provides the method of Example 5, wherein the proportion of unlabeled quantities is positively correlated with the number of iterations; and / or the proportion of returned quantities is positively correlated with the proportion of unlabeled quantities.
[0160] According to one or more embodiments of the present disclosure, [Example 8] provides an object classification method, which may include:
[0161] Obtain an object to be classified and an object classification model generated according to the model generation method provided in any embodiment of the present disclosure;
[0162] The object to be classified is input into the object classification model, and the target classification result of the object to be classified is obtained according to the output result of the object classification model.
[0163] According to one or more embodiments of the present disclosure, [Example 9] provides a model generation device, which may include:
[0164] An object acquisition module, used to acquire a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module;
[0165] A result determination module is used to input each unlabeled object into the classification prediction module, and determine the pseudo classification result of the unlabeled object according to the unlabeled prediction result output by the classification prediction module;
[0166] The model generation module is used to input the unlabeled prediction results and pseudo classification results into the loss function determination module, adjust the network parameters in the classification prediction module according to the output results of the loss function determination module, and generate an object classification model.
[0167] According to one or more embodiments of the present disclosure, [Example 10] provides an object classification device, which may include:
[0168] A model acquisition module, used to acquire an object to be classified and an object classification model generated according to the model generation method provided in any embodiment of the present disclosure;
[0169] The object classification module is used to input the object to be classified into the object classification model, and obtain the target classification result of the object to be classified according to the output result of the object classification model.
[0170] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0171] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0172] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A model generation method, characterized in that: include: Acquire a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module, and the unlabeled objects include unlabeled images, unlabeled videos, unlabeled texts, or unlabeled voices; Inputting each of the unlabeled objects into the classification prediction module, and determining pseudo classification results of each of the unlabeled objects according to each of the unlabeled prediction results output by the classification prediction module; Determine the proportion of the number of returns according to the proportion of the unlabeled number of the unlabeled objects, and determine the number of returns according to the proportion of the number of returns and the unlabeled number of the unlabeled objects, wherein the number of returns is the number of the unlabeled objects in the unlabeled number used for gradient return, and the proportion of the number of returns is the proportion of the number of returns in the unlabeled number; Each of the unlabeled prediction results and the corresponding pseudo-classification results are input into the loss function determination module, so that the loss function determination module determines the loss gradient of the unlabeled object according to the unlabeled prediction results and the pseudo-classification results of the unlabeled object, and screens out the return quantity of target objects from each of the unlabeled objects according to the obtained loss gradients, and obtains an output result according to the unlabeled prediction results and the pseudo-classification results of each of the target objects, wherein the output result is used to adjust the network parameters in the classification prediction module to generate an object classification model.
2. The method according to claim 1, characterized in that: The step of respectively determining the pseudo classification results of each of the unlabeled objects according to each of the unlabeled prediction results output by the classification prediction module comprises: Obtaining each unlabeled prediction result and pre-set classification category output by the classification prediction module; For each of the unlabeled prediction results, the category probability that the unlabeled object corresponding to the unlabeled result belongs to each of the classification categories is determined respectively according to the unlabeled prediction results, and the pseudo classification result of the unlabeled object corresponding to the unlabeled result is determined according to each of the category probabilities.
3. The method according to claim 1, characterized in that Also includes: Obtaining labeled objects and true value classification results of the labeled objects, and using the labeled objects and the true value classification results as a set of labeled training samples; Inputting a plurality of groups of the labeled training samples into the classification prediction module, and obtaining the labeled prediction results of each of the labeled objects output by the classification prediction module; Each of the labeled prediction results and the corresponding true value classification results are input into the loss function determination module.
4. The method according to claim 3, characterized in that Also includes: Obtaining the number of iterations of each of the unlabeled objects in the classification prediction module at the current moment, and determining the unlabeled quantity ratio of the unlabeled objects according to the number of iterations; Determine the unlabeled number of the unlabeled objects and the labeled number of the labeled training samples according to the unlabeled number ratio and the total number of preset training samples, wherein each of the training samples includes the labeled training samples or the unlabeled objects; Accordingly, the step of inputting the plurality of groups of the labeled training samples into the classification prediction module includes: inputting the labeled number of the labeled training samples into the classification prediction module; Inputting each of the unlabeled objects into the classification prediction module includes: inputting the unlabeled number of the unlabeled objects into the classification prediction module.
5. The method according to claim 4, characterized in that The loss function determination module obtains the output result through the following steps: For each of the unlabeled objects, determining a loss gradient of the unlabeled object according to the unlabeled prediction result and the pseudo classification result of the unlabeled object; Filtering the returned number of target objects from the unlabeled objects according to the loss gradient; The output result is obtained according to the unlabeled prediction result and the pseudo classification result of each target object, and the labeled prediction result and the true value classification result of each labeled object.
6. The method according to claim 5, characterized in that The step of selecting the returned number of target objects from the unlabeled objects according to the loss gradient includes: Sorting the unlabeled objects based on the loss gradient; According to the ranking position of each of the unlabeled objects in the ranking result, the target objects of the returned quantity are screened out from the unlabeled objects.
7. The method according to claim 5, characterized in that The proportion of the unlabeled quantity is positively correlated with the number of iterations; and / or the proportion of the returned quantity is positively correlated with the proportion of the unlabeled quantity.
8. A method for object classification, characterized in that: include: Obtaining an object to be classified and an object classification model generated according to the method of any one of claims 1 to 7; The object to be classified is input into the object classification model, and a target classification result of the object to be classified is obtained according to an output result of the object classification model.
9. A model generation device, characterized in that: include: An object acquisition module, used to acquire a classification model to be trained and a plurality of unlabeled objects, wherein the classification model to be trained includes a classification prediction module and a loss function determination module, and the unlabeled objects include unlabeled images, unlabeled videos, unlabeled texts or unlabeled voices; A result determination module, used for inputting each of the unlabeled objects into the classification prediction module, and determining the pseudo classification results of each of the unlabeled objects according to each of the unlabeled prediction results output by the classification prediction module; A return quantity determination module, configured to determine a return quantity ratio according to the unlabeled quantity ratio of the unlabeled objects, and determine the return quantity according to the return quantity ratio and the unlabeled quantity of the unlabeled objects, wherein the return quantity is the number of the unlabeled objects in the unlabeled quantity used for gradient return, and the return quantity ratio is the ratio of the return quantity to the unlabeled quantity; A model generation module is used to input each of the unlabeled prediction results and the corresponding pseudo-classification results into the loss function determination module, so that the loss function determination module determines the loss gradient of the unlabeled object according to the unlabeled prediction results and the pseudo-classification results of the unlabeled object, and screens out the return quantity of target objects from each of the unlabeled objects according to the obtained loss gradients, and obtains an output result according to the unlabeled prediction results and the pseudo-classification results of each of the target objects, wherein the output result is used to adjust the network parameters in the classification prediction module to generate an object classification model.
10. An object classification device, characterized in that: include: A model acquisition module, used to acquire an object to be classified and an object classification model generated according to any one of the methods of claims 1 to 7; The object classification module is used to input the object to be classified into the object classification model, and obtain the target classification result of the object to be classified according to the output result of the object classification model.
11. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the model generation method as described in any one of claims 1 to 7, or the object classification method as described in claim 8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: Place When the computer program is executed by a processor, the model generation method according to any one of claims 1 to 7 is implemented. Or an object classification method as claimed in claim 8.
