Model training method, device, electronic device and storage medium

By using the shared prediction labels of unlabeled samples and enhanced samples in deep learning models for semi-supervised training, non-consistent samples are extracted, which solves the problem of insufficient labeled samples and improves model performance and labeling efficiency.

CN114925773BActive Publication Date: 2024-12-03ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210597247.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-30
Publication Date
2024-12-03
Estimated Expiration
2042-05-30

AI Technical Summary

Technical Problem

In deep learning models, the problem of insufficient labeling samples still needs to be improved, and existing active learning and semi-supervised learning methods have limitations in alleviating this problem.

Method used

By determining the common prediction labels of unlabeled samples and enhanced samples, semi-supervised training is performed, non-consistent samples are extracted to improve model performance, and optimize the annotation of samples to be marked through weighting processing and similarity calculations of different enhanced granularity sizes. process.

Benefits of technology

It improves the performance of the classification model and the reliability of labeling information, enhances the efficiency of active learning, and overall alleviates the problem of insufficient labeling samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114925773B_ABST
    Figure CN114925773B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide a model training method, device, electronic device and storage medium. The model training method includes: determining the prediction label of the unlabeled sample and the prediction label of the enhanced sample of the unlabeled sample based on the classification model; determining the common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample; performing semi-supervised training on the classification model at least based on the common prediction label; determining the inconsistency between the unlabeled sample and its enhanced sample based on the semi-supervised training classification model; extracting the samples to be labeled from the unlabeled samples based on the inconsistency. The scheme of the embodiments of the present invention can effectively alleviate the problem of insufficient labeled samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a model training method, device, electronic device, and storage medium. Background Art

[0002] Active learning (AL) is a method of obtaining relatively difficult-to-classify sample data through machine learning methods, giving it to humans for labeling, and then adding the manually labeled data to the training set to retrain the machine learning classification model. This process is repeated over and over again to gradually improve the model's effectiveness. In other words, active learning incorporates human experience into the machine learning model.

[0003] Semi-supervised learning (SSL) is a learning method that combines supervised learning with unsupervised learning. Semi-supervised learning uses a large number of unlabeled samples and labeled samples at the same time for classification and recognition.

[0004] In many cases, it is too expensive to annotate large amounts of data to meet the performance requirements of complex deep learning models. Active learning (AL) and semi-supervised learning (SSL) are two different approaches to alleviate the problem of insufficient labeled samples. In some techniques, AL and SSL are combined to better alleviate the problem of insufficient labeled samples, but there is still room for improvement. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a model training method, device, electronic device and storage medium to at least partially solve the above problems.

[0006] According to a first aspect of an embodiment of the present invention, a model training method is provided, comprising: determining, based on a classification model, a prediction label of the unlabeled sample and a prediction label of an enhanced sample of the unlabeled sample; determining a common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample; performing semi-supervised training on the classification model at least based on the common prediction label; determining, based on the semi-supervised trained classification model, an inconsistency between the unlabeled sample and its enhanced sample; and extracting a sample to be labeled from the unlabeled sample based on the inconsistency.

[0007] In another implementation of the present invention, determining the common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample includes: determining a first label vector of the prediction label of the unlabeled sample and a second label vector of the prediction label of the enhanced sample; and weighting the first label vector and the second label vector to obtain a weighted vector indicating the common prediction label.

[0008] In another implementation of the present invention, the method further includes: obtaining a training sample set, the sample including annotated samples annotated based on the annotation label, the unlabeled sample and the enhanced sample. The semi-supervised training of the classification model based at least on the common prediction label includes: fusing at least two samples in the training sample set to obtain a fused sample; fusing the labels corresponding to the at least two samples to obtain a fused label; and training the classification model based on the fused sample and the fused label.

[0009] In another implementation of the present invention, the fusing of at least two samples in the training sample set to obtain a fused sample includes: performing word embedding processing on at least two text samples in the training sample set to obtain at least two text vectors respectively; and concatenating or weighting the at least two text vectors to obtain a text vector indicating the fused text sample.

[0010] In another implementation of the present invention, at least two samples in the training sample set are fused to obtain a fused sample, including: performing image data processing on at least two image samples in the training sample set to obtain at least two image original vectors respectively; splicing or weighting the at least two image original vectors to obtain a fused image vector indicating the fused image sample.

[0011] In another implementation of the present invention, based on a classification model of semi-supervised training, the inconsistency between the unlabeled sample and its enhanced sample is determined, including: inputting the unlabeled sample and its enhanced sample into the classification model of semi-supervised training to obtain a first prediction value of the unlabeled sample and each second prediction value of the enhanced sample; determining the similarity between the first prediction value and each second prediction value; based on the similarity, determining the inconsistency between the unlabeled sample and its enhanced sample.

[0012] In another implementation of the present invention, the enhanced sample is obtained by performing a first enhancement process and a second enhancement process on the unlabeled sample, and the enhancement granularity of the first enhancement process is different from that of the second enhancement process. The determining of the similarity between the first prediction value and each of the second prediction values ​​includes: determining a first similarity and a second similarity between the first prediction value and each of the second prediction values, the first similarity corresponding to the first enhancement process, and the second similarity corresponding to the second enhancement process. The determining of the inconsistency between the unlabeled sample and its enhanced sample based on the similarity includes: performing weighting based on the first similarity and the second similarity to obtain a weighted similarity; and determining the inconsistency between the unlabeled sample and its enhanced sample based on the weighted similarity.

[0013] In another implementation of the present invention, the enhancement granularity of the first enhancement processing is greater than the granularity of the second enhancement processing, the first similarity is determined based on the sum of KL divergence differences between the first prediction value and the respective second prediction values, and the second similarity is based on the sum of variances of the first prediction value and the respective second prediction values.

[0014] In another implementation of the present invention, extracting the samples to be labeled from the unlabeled samples based on the inconsistency includes: extracting each initial sample to be labeled that meets the inconsistency from the unlabeled samples; determining the uncertainty of each initial sample to be labeled; and extracting the samples to be labeled that meet the uncertainty from the initial samples to be labeled.

[0015] According to a second aspect of an embodiment of the present invention, a model training device is provided, comprising: a prediction module, which determines the prediction label of the unlabeled sample and the prediction label of the enhanced sample of the unlabeled sample based on a classification model; a first determination module, which determines the common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample; a training module, which performs semi-supervised training on the classification model at least based on the common prediction label; a second determination module, which determines the inconsistency between the unlabeled sample and the enhanced sample based on the semi-supervised training classification model; and an extraction module, which extracts the sample to be labeled from the unlabeled sample based on the inconsistency.

[0016] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.

[0017] According to a fourth aspect of an embodiment of the present invention, there is provided a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.

[0018] In the solution of the embodiment of the present invention, the predicted labels of the unlabeled samples and the predicted labels of the enhanced samples have a very high similarity. Semi-supervised training is performed based on the common predicted labels of the two predicted labels, and reliable labeling information other than the labeled samples is obtained, so that the performance of the trained classification model is improved. In addition, the inconsistency predicted by the trained classification model is more accurate, and the samples to be labeled extracted based on the inconsistency are conducive to more efficient execution of active learning, thereby effectively alleviating the problem of insufficient labeled samples as a whole. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0020] Figure 1 A schematic block diagram of a collaborative learning process according to an example.

[0021] Figure 2 The present invention is a flowchart of the steps of a model training method according to an embodiment of the present invention.

[0022] Figure 3 for Figure 2 A schematic block diagram of the model training process of an embodiment.

[0023] Figure 4 4 is a structural block diagram of a model training device according to another embodiment of the present invention.

[0024] Figure 5 FIG. 4 is a schematic structural diagram of an electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be described clearly and in detail below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.

[0026] The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.

[0027] Figure 1 FIG. 1 is a schematic block diagram of a collaborative learning process according to an example. In this example, in the module 110 for semi-supervised learning, a classification model is trained based on labeled samples.

[0028] The trained classification model predicts labels for unlabeled samples, and labels samples in the module 130 for active learning based on the predicted labels with lower reliability or confidence, and updates the previously labeled samples based on the labeled samples.

[0029] Furthermore, based on the prediction labels with higher reliability or confidence, the confidence is further optimized to obtain optimized prediction labels, and then, based on the optimized prediction labels, the classification model is further trained in the module 120 for semi-supervised learning as the labels of the unlabeled samples.

[0030] Figure 2 It is a flowchart of the steps of the model training method according to one embodiment of the present invention. The scheme of this embodiment can be applied to any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, PADs, etc.) and PCs, etc. For example, in the model training stage, a computing device (for example, a data center) configured with a CPU (an example of a processing unit) + GPU (an example of an acceleration unit) architecture can be used to train the encoder-decoder model based on training samples. Computing devices such as data centers can be deployed in cloud servers such as proprietary clouds, private clouds, or hybrid clouds. Accordingly, in the inference stage, a computing device configured with a CPU (an example of a processing unit) + GPU (an example of an acceleration unit) architecture can also be used to perform inference operations. Figure 2 The model training method can be applied to Figure 1 collaborative learning process.

[0031] The model training method of this embodiment includes:

[0032] S210: Determine the predicted labels of the unlabeled samples and the predicted labels of the enhanced samples of the unlabeled samples based on the classification model.

[0033] It should be understood that the classification model can be a model of a neural network after training. For example, the classification model can be a model such as a multi-layer perceptron (MLP), or a model based on an encoder-decoder structure, such as a transformer model or a BERT model.

[0034] It should also be understood that before the classification model determines the predicted label, it can undergo supervised training, for example, training based on labeled samples, where the labeled samples together with the unlabeled samples and / or enhanced samples constitute the training samples for semi-supervised training of the classification model.

[0035] S220: Determine a common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample.

[0036] It should be understood that the shared prediction label may be a weighted combination of the prediction label of the unlabeled sample and the prediction label of the enhanced sample, or may be one of the prediction label of the unlabeled sample and the prediction label of the enhanced sample.

[0037] S230: Perform semi-supervised training on the classification model based at least on the shared prediction label.

[0038] It should be understood that the semi-supervised training here refers to adjusting the prediction labels of unlabeled samples and the prediction labels of enhanced samples based on the common prediction labels, and training the classification model based on the common prediction labels as output and the unlabeled samples and enhanced samples as input. The classification model can be trained using part of the unlabeled samples and / or part of the enhanced samples.

[0039] S240: Determine the inconsistency between the unlabeled samples and their enhanced samples based on the semi-supervised training classification model.

[0040] It should be understood that the inconsistency can be characterized by similarity, that is, the higher the similarity between the predicted labels of the unlabeled sample and its enhanced sample, the lower the inconsistency. The similarity can be characterized by the distance between the unlabeled sample and its enhanced sample in the sample space, for example, the similarity includes but is not limited to cosine similarity, Pearson similarity, Jaccard similarity, etc. In addition, the inconsistency can also be characterized by KL divergence between different predicted labels.

[0041] S250: Extracting samples to be labeled from unlabeled samples based on inconsistency.

[0042] It should be understood that the similarity threshold or KL divergence threshold can be set to determine whether the unlabeled samples are smooth enough, and the unlabeled samples that are not smooth enough are extracted as samples to be labeled. After the samples to be labeled are labeled, the classification model can be further trained.

[0043] In the solution of the embodiment of the present invention, the predicted labels of the unlabeled samples and the predicted labels of the enhanced samples have a very high similarity. Semi-supervised training is performed based on the common predicted labels of the two predicted labels, and reliable labeling information other than the labeled samples is obtained, so that the performance of the trained classification model is improved. In addition, the inconsistency predicted by the trained classification model is more accurate, and the samples to be labeled extracted based on the inconsistency are conducive to more efficient execution of active learning, thereby effectively alleviating the problem of insufficient labeled samples as a whole.

[0044] Figure 3 for Figure 2Schematic block diagram of the model training process of an embodiment. In the model training of this example, the semi-supervised training propagation module 310, the inconsistent sorting module 320, the uncertainty sorting module 330, and the sample annotation module 340 perform model training and corresponding sample annotation. It should be understood that the sample annotation 340 can be performed by the user in any type of database that records sample data (for example, unlabeled samples) to perform the addition, deletion, modification, and query operations required for sample annotation. The semi-supervised training propagation module 310 includes a sample enhancement submodule, a sample mixing submodule, and a semi-supervised training submodule. The inconsistent sorting module 320 includes a sample enhancement submodule, a prediction label submodule, and an inconsistent sorting submodule.

[0045] In other examples, determining a common prediction label of a predicted label of an unlabeled sample and a predicted label of an enhanced sample includes: determining a first label vector of the predicted label of the unlabeled sample and a second label vector of the predicted label of the enhanced sample; weighting the first label vector and the second label vector to obtain a weighted vector indicating the common prediction label. There is a difference between the predicted label of the enhanced sample and the predicted label of the unlabeled sample. Weighting the first label vector and the second label vector improves the confidence of the common prediction label, smoothes the distribution of the unlabeled samples, and further improves the training effect of the classification model. It should be understood that the above operations can be performed in the semi-supervised training propagation module 310.

[0046] More specifically, the unlabeled sample and its enhanced sample can be input into the classification model to obtain their respective prediction labels. The enhanced sample of the text sample can be the back-translated text of the text sample. In this case, the weighted coefficient indicates the translation quality of different back-translated languages. For image samples, the weighted coefficients can be the same, that is, the mean processing is performed. The role of weighted averaging is to enable the classification model to output consistent or identical prediction results (i.e., prediction labels) for different enhanced samples of the same sample.

[0047] A labeled sample set, an unlabeled sample set, and an enhanced sample set may be constructed for the labeled samples, the unlabeled samples, and the enhanced samples. The unlabeled sample set and the enhanced sample set may share sample labels (i.e., prediction labels). A mixed sample may be used to perform semi-supervised training on the classification model, for example, in the sample mixing submodule in the semi-supervised training propagation module 310. Specifically, when mixing samples, samples of two sets may be randomly selected from the above three sets for mixing, and accordingly, three mixed samples are generated: Situation 1: The mixed sample contains only labeled samples; Situation 2: The mixed sample contains only unlabeled samples; Situation 3: The mixed sample contains both labeled samples and unlabeled samples.

[0048] In some other examples, the model training method further includes: obtaining a training sample set, the samples including labeled samples based on the labeled labels, unlabeled samples and enhanced samples. Based at least on the shared prediction label, semi-supervised training of the classification model is performed, including: fusing at least two samples in the training sample set to obtain a fused sample; fusing the labels corresponding to at least two samples to obtain a fused label; and training the classification model based on the fused sample and the fused label. By mixing the labeled samples, unlabeled samples and enhanced samples, the diversity of samples is improved, the training effect of the classification model is improved, and the generalization ability of the classification model is enhanced.

[0049] In other examples, fusing at least two samples in the training sample set to obtain a fused sample includes: performing word embedding processing on at least two text samples in the training sample set to obtain at least two text vectors respectively; and concatenating or weighting the at least two text vectors to obtain a text vector indicating the fused text sample. By concatenating or weighting the at least two text vectors, the distribution of unlabeled samples is smoothed, further improving the training effect of the classification model.

[0050] More specifically, at least two text vectors may be hidden states of a text sample. For example, after the text sample is processed by a word embedding layer, a word vector (word embedding) is obtained. The at least two text vectors may be fused by concatenating the at least two text vectors, or by weighting the corresponding elements in the at least two text vectors to obtain a text vector indicating the fused text sample. Accordingly, the labels corresponding to the at least two text vectors may also be fused, where the labels (for example, confidence vectors or probability vectors) are labeled labels for labeled samples and predicted labels for unlabeled samples or enhanced samples. The labels corresponding to the at least two text vectors may be fused by concatenating the labels corresponding to the at least two text vectors, or by weighting the elements in the label vectors corresponding to the at least two text vectors, and the weighting coefficients may be completely consistent with the corresponding text vectors or may be different.

[0051] Alternatively, the fusing of at least two samples in the training sample set to obtain a fused sample includes: performing image data processing on at least two image samples in the training sample set to obtain at least two image original vectors respectively; splicing or weighting the at least two image original vectors to obtain a fused original vector indicating the fused image sample. By splicing or weighting the at least two image original vectors, the distribution of unlabeled samples is smoothed, and the training effect of the classification model is further improved. That is, for image samples, the original vectors of the image samples can be directly channel-fused, for example, based on the three monochrome channels of RGB, they are fused separately.

[0052] It should be understood that when semi-supervised training is performed, it can be performed in a semi-supervised training submodule. Specifically, the parameters of the classification model can be optimized based on the cross entropy function. In addition, the classification model can be constrained to output consistent prediction labels for different enhanced samples of the same sample based on the consistency function. In other words, for semi-supervised training, the loss function can be a weighted sum of the cross entropy function and the consistency function, for example, the sum of the cross entropy function and the consistency function.

[0053] In other examples, based on a classification model trained by semi-supervised training, determining the inconsistency between an unlabeled sample and its enhanced sample includes: inputting the unlabeled sample and its enhanced sample into the classification model trained by semi-supervised training to obtain a first prediction value of the unlabeled sample and each second prediction value of the enhanced sample; determining the similarity between the first prediction value and each second prediction value; and determining the inconsistency between the unlabeled sample and its enhanced sample based on the similarity. Through the determination of inconsistency, a non-smoothed unlabeled sample is determined, and the inconsistency of the sample to be labeled is improved. In other words, the efficiency of sample labeling is improved.

[0054] In other examples, the enhanced samples are obtained by performing a first enhancement process and a second enhancement process on the unlabeled samples, and the enhancement granularities of the first enhancement process and the second enhancement process are different. Determining the similarity between the first prediction value and each second prediction value includes: determining a first similarity and a second similarity between the first prediction value and each second prediction value, the first similarity corresponds to the first enhancement process, and the second similarity corresponds to the second enhancement process. Based on the similarity, determining the inconsistency between the unlabeled sample and its enhanced sample includes: performing weighting based on the first similarity and the second similarity to obtain a weighted similarity; determining the inconsistency between the unlabeled sample and its enhanced sample based on the weighted similarity. For enhancement processes with different enhancement granularities, different similarities are used, and the inconsistency obtained based on different types of similarities improves the reliability of the inconsistency.

[0055] In other words, in semi-supervised training, the classification model's predictions for unlabeled samples before and after enhancement tend to be consistent. In other words, unlabeled samples that tend to be consistent belong to smooth samples. In active learning, unlabeled samples with poor consistency are selected from unlabeled samples for further annotation. Samples with poor consistency belong to non-smooth samples. Non-smooth samples do not obtain enough label information. Therefore, the classification model has a vague understanding of the local distribution of such samples. Therefore, it is more valuable to select non-smooth samples for further annotation, so that the classification model can better smooth the unlabeled samples to output more stable predictions. Before inputting the semi-supervised training classification model to determine the inconsistency, the sample enhancement submodule in the inconsistency sorting module 320 can also be used to enhance the sample. Its operation is the same as the sample enhancement submodule of the semi-supervised training propagation module 310, and this example will not be repeated. Then, in the inconsistency sorting module 320, the prediction label submodule is used to perform label prediction to obtain the inconsistency of each sample.

[0056] The non-consistency sorting module 320 may be used to select these non-smoothed samples, and then estimate the prediction inconsistency of the enhanced samples generated by the first enhancement process and the second enhancement process for the unlabeled samples. Specifically, the enhancement granularity of the first enhancement process is greater than the granularity of the second enhancement process. For example, the first enhancement process is a coarse-grained enhancement process, and the second enhancement process is a fine-grained enhancement process.

[0057] More specifically, sample enhancement can be performed in the sample enhancement submodule in the semi-supervised training propagation module 310, and a sample after coarse-grained enhancement can be generated for each unlabeled sample. It should be understood that coarse-grained enhancement means that after the sample is enhanced, humans can intuitively perceive the changes before and after the sample enhancement. For example, the coarse-grained enhancement processing of the text sample is a sentence-level change, for example, the text sentence is rewritten by back translation, but the original meaning of the sentence is retained. Without changing the semantic consistency of the context, the text sample represented by the first context is subjected to character changes to obtain a text sample represented by the second context. Alternatively, for image samples, a coarse-grained enhanced sample can be generated by rotating and / or translating the image sample.

[0058] In addition, fine-grained sample enhancement can also be performed. It should be understood that fine-grained enhancement means that humans cannot intuitively perceive the changes before and after sample enhancement after sample enhancement. Enhanced samples are generated by adding disturbances to the latent space representation of text samples or image samples to add certain disturbances so that the classification model can learn the continuous local distribution of text samples or image samples. For example, the elements of the vector represented by the first context are perturbed to obtain the vector represented by the second context. It should be understood that the disturbance here is a change at the vector level, not a change at the sentence level like coarse-grained enhancement. The final enhanced sample can be obtained through the above-mentioned sample enhancement processing of different granularities.

[0059] The first similarity is determined based on the sum of KL divergence differences between the first prediction value and each second prediction value, and the second similarity is determined based on the sum of variances of the first prediction value and each second prediction value.

[0060] More specifically, the inconsistency sorting module 320 can be used to estimate the sum of the KL divergence differences of all enhanced samples of each unlabeled sample before and after the disturbance as a basis for evaluating fine-grained inconsistency. In addition, the inconsistency sorting module 320 can also be used to estimate the sum of the variances of the predicted values ​​of unlabeled samples and all enhanced samples as a basis for evaluating coarse-grained inconsistency. Then, the inconsistency indicators of the above two granularities can be normalized and weighted added to obtain the final total inconsistency value. It should be understood that the role of normalization is to eliminate the impact of the different orders of magnitude of the two indicators, and the role of weighted addition is to balance the role of the two indicators in sample selection. For example, based on the inconsistency sorting submodule in the inconsistency sorting module 320, M samples with the largest total inconsistency can be selected from the unlabeled samples as the initial labeling candidate set.

[0061] In other examples, based on inconsistency, extracting samples to be labeled from unlabeled samples includes: extracting initial samples to be labeled that meet the inconsistency from the unlabeled samples; determining the uncertainty of each initial sample to be labeled; and extracting samples to be labeled that meet the uncertainty from each initial sample to be labeled.

[0062] More specifically, further ensuring higher uncertainty under the premise that the samples have higher inconsistency will greatly reduce the uncertainty of the classification model for sample prediction. The entropy of the sample prediction label can be used to evaluate uncertainty. In one example, the uncertainty sorting module 330 uses a representative factor to re-weight the calculation of the uncertainty index to explicitly consider the distribution structure of the sample. The sum of the cosine similarity values ​​of each unlabeled sample in the initial labeling candidate set with other unlabeled samples in the feature space can be calculated as a representative factor. Therefore, both the uncertainty information of the sample and the distribution relationship of the sample in the feature space are considered, avoiding the selection of some outliers or non-representative samples in the feature space. Figure 4 It is a structural block diagram of a model training device according to another embodiment of the present invention. The solution of this embodiment can be applied to any appropriate electronic device with data processing capabilities, including but not limited to: servers, mobile terminals (such as mobile phones, PADs, etc.) and PCs, etc. For example, in the model training stage, a computing device (for example, a data center) configured with a CPU (an example of a processing unit) + GPU (an example of an acceleration unit) architecture can be used to train the encoder-decoder model based on training samples. Computing devices such as data centers can be deployed in cloud servers such as proprietary clouds, private clouds, or hybrid clouds. Accordingly, in the inference stage, a computing device configured with a CPU (an example of a processing unit) + GPU (an example of an acceleration unit) architecture can also be used to perform inference operations.

[0063] The model training device of this embodiment is Figure 2 The model training method corresponds to:

[0064] The prediction module 410 determines the predicted labels of the unlabeled samples and the predicted labels of the enhanced samples of the unlabeled samples based on the classification model.

[0065] The first determination module 420 determines a common prediction label between the prediction label of the unlabeled sample and the prediction label of the enhanced sample.

[0066] The training module 430 performs semi-supervised training on the classification model based at least on the common prediction label.

[0067] The second determination module 440 determines the inconsistency between the unlabeled sample and the enhanced sample based on the classification model of semi-supervised training.

[0068] The extraction module 450 extracts the samples to be labeled from the unlabeled samples based on the inconsistency.

[0069] In the solution of the embodiment of the present invention, the predicted labels of the unlabeled samples and the predicted labels of the enhanced samples have a very high similarity. Semi-supervised training is performed based on the common predicted labels of the two predicted labels, and reliable labeling information other than the labeled samples is obtained, so that the performance of the trained classification model is improved. In addition, the inconsistency predicted by the trained classification model is more accurate, and the samples to be labeled extracted based on the inconsistency are conducive to more efficient execution of active learning, thereby effectively alleviating the problem of insufficient labeled samples as a whole.

[0070] In other examples, the first determination module is specifically used to: determine a first label vector of the predicted label of the unlabeled sample and a second label vector of the predicted label of the enhanced sample; and weight the first label vector and the second label vector to obtain a weighted vector indicating a common predicted label.

[0071] In some other examples, the model training device further includes: an acquisition module, which acquires a training sample set, wherein the sample includes a labeled sample labeled based on a labeled label, the unlabeled sample, and the enhanced sample. The training module is specifically used to: fuse at least two samples in the training sample set to obtain a fused sample; fuse the labels corresponding to the at least two samples to obtain a fused label; and train the classification model based on the fused sample and the fused label.

[0072] In some other examples, the training module is specifically used to: perform word embedding processing on at least two text samples in the training sample set to obtain at least two text vectors respectively; concatenate or weight the at least two text vectors to obtain a text vector indicating the fused text sample. Alternatively, the training module is specifically used to: perform image data processing on at least two image samples in the training sample set to obtain at least two original image vectors respectively; concatenate or weight the at least two original image vectors to obtain a fused image vector indicating the fused image sample.

[0073] In other examples, the second determination module is specifically used to: input the unlabeled samples and their enhanced samples into a semi-supervised training classification model to obtain a first prediction value of the unlabeled samples and each second prediction value of the enhanced samples; determine the similarity between the first prediction value and each second prediction value; and based on the similarity, determine the inconsistency between the unlabeled samples and their enhanced samples.

[0074] In some other examples, the enhanced sample is obtained by performing a first enhancement process and a second enhancement process on the unlabeled sample, and the enhancement granularity of the first enhancement process is different from that of the second enhancement process. The second determination module is specifically used to: determine a first similarity and a second similarity between the first prediction value and each of the second prediction values, the first similarity corresponding to the first enhancement process, the second similarity corresponding to the second enhancement process, weighting the first similarity and the second similarity to obtain a weighted similarity; based on the weighted similarity, determine the inconsistency between the unlabeled sample and its enhanced sample.

[0075] In other examples, the enhancement granularity of the first enhancement processing is greater than the granularity of the second enhancement processing, the first similarity is determined based on the sum of KL divergence differences between the first prediction value and the respective second prediction values, and the second similarity is based on the sum of variances of the first prediction value and the respective second prediction values.

[0076] In other examples, the extraction module is specifically used to: extract each initial sample to be labeled that meets the inconsistency from the unlabeled samples; determine the uncertainty of each initial sample to be labeled; and extract the sample to be labeled that meets the uncertainty from the initial samples to be labeled.

[0077] The device of this embodiment is used to implement the corresponding methods in the aforementioned multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here. In addition, the functional implementation of each module in the device of this embodiment can refer to the description of the corresponding parts in the aforementioned method embodiments, which will not be repeated here.

[0078] Reference Figure 5 , shows a schematic structural diagram of an electronic device according to another embodiment of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.

[0079] like Figure 5 As shown, the electronic device may include: a processor (processor) 502 , a communication interface (Communications Interface) 504 , a memory (memory) 506 storing a program 510 , and a communication bus 508 .

[0080] The processor, the communication interface, and the memory communicate with each other via a communication bus.

[0081] Communication interface, used to communicate with other electronic devices or servers.

[0082] The processor is used to execute the program, and specifically can execute the relevant steps in the above method embodiment.

[0083] Specifically, the program may include program codes including computer operation instructions.

[0084] The processor may be a CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0085] The memory is used to store programs. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0086] The program can be specifically used to enable the processor to perform the following operations: based on the classification model, determine the predicted label of the unlabeled sample and the predicted label of the enhanced sample of the unlabeled sample; determine the common predicted label of the predicted label of the unlabeled sample and the predicted label of the enhanced sample; at least based on the common predicted label, perform semi-supervised training on the classification model; based on the semi-supervised training classification model, determine the inconsistency between the unlabeled sample and its enhanced sample; based on the inconsistency, extract the sample to be labeled from the unlabeled sample.

[0087] In addition, the specific implementation of each step in the program can refer to the corresponding description of the corresponding steps and units in the above method embodiment, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.

[0088] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.

[0089] The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code that may be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded over a network and will be stored in a local recording medium, so that the method described herein may be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, processor, or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown herein.

[0090] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.

[0091] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not limitations of the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention should be defined by the claims.

Claims

1. A model training method, comprising: Based on the classification model, determining predicted labels of unlabeled samples and predicted labels of enhanced samples of the unlabeled samples, wherein the unlabeled samples include text samples and image samples; Determine a common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample, wherein the common prediction label is obtained by weighting the prediction label of the unlabeled sample and the prediction label of the enhanced sample; Based at least on the common prediction label, performing semi-supervised training on the classification model; Determine the inconsistency between the unlabeled sample and the enhanced sample based on the semi-supervised training classification model; Based on the inconsistency, extracting samples to be labeled from the unlabeled samples, wherein the samples to be labeled are used for sample labeling in active learning; The method further includes: determining a similarity between the predicted label of the unlabeled sample and the predicted label of the enhanced sample; and determining the inconsistency based on the similarity.

2. The method according to claim 1, wherein: The determining a common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample includes: Determine a first label vector of the predicted label of the unlabeled sample and a second label vector of the predicted label of the enhanced sample; The first label vector and the second label vector are weighted to obtain a weighted vector indicating a common prediction label.

3. The method according to claim 1, wherein: The method further includes: obtaining a training sample set, wherein the samples include labeled samples labeled based on the labeled labels, the unlabeled samples, and the enhanced samples; The performing semi-supervised training on the classification model based at least on the common prediction label comprises: Fusing at least two samples in the training sample set to obtain a fused sample; Fusion of labels corresponding to the at least two samples to obtain a fusion label; The classification model is trained based on the fusion samples and the fusion labels.

4. The method according to claim 3, wherein: The fusing at least two samples in the training sample set to obtain a fused sample includes: Performing word embedding processing on at least two of the text samples in the training sample set to obtain at least two text vectors respectively; The at least two text vectors are concatenated or weighted to obtain a text vector indicating a fused text sample.

5. The method according to claim 3, wherein: The fusing at least two samples in the training sample set to obtain a fused sample includes: Performing image data processing on at least two of the image samples in the training sample set to obtain at least two original image vectors respectively; The at least two original image vectors are concatenated or weighted to obtain a fused image vector indicating a fused image sample.

6. The method according to claim 1, wherein: Based on the classification model of semi-supervised training, determining the inconsistency between the unlabeled sample and the enhanced sample includes: Inputting the unlabeled sample and the enhanced sample thereof into a classification model of semi-supervised training to obtain a first prediction value of the unlabeled sample and each second prediction value of the enhanced sample; Determining a similarity between the first predicted value and each of the second predicted values; Based on the similarity, an inconsistency between the unlabeled sample and the enhanced sample is determined.

7. The method according to claim 6, wherein: The enhanced sample is obtained by performing a first enhancement process and a second enhancement process on the unlabeled sample, and the enhancement granularity of the first enhancement process and the second enhancement process is different. The determining the similarity between the first prediction value and each of the second prediction values ​​includes: determining a first similarity and a second similarity between the first prediction value and each of the second prediction values, the first similarity corresponding to the first enhancement processing, and the second similarity corresponding to the second enhancement processing, The determining, based on the similarity, the inconsistency between the unlabeled sample and the enhanced sample includes: performing weighting based on the first similarity and the second similarity to obtain a weighted similarity; Based on the weighted similarity, an inconsistency between the unlabeled sample and the enhanced sample is determined.

8. The method according to claim 7, wherein: The enhancement granularity of the first enhancement processing is greater than that of the second enhancement processing, the first similarity is determined based on the sum of KL divergence differences between the first prediction value and the second prediction values, and the second similarity is determined based on the sum of variances of the first prediction value and the second prediction values.

9. The method according to any one of claims 1 to 8, wherein: The extracting the samples to be labeled from the unlabeled samples based on the inconsistency includes: Extracting each initial sample to be labeled that meets the inconsistency from the unlabeled samples; Determining the uncertainty of each of the initial samples to be labeled; Extract the samples to be labeled that meet the uncertainty from the initial samples to be labeled.

10. A model training device, comprising: A prediction module, based on a classification model, determines a prediction label of an unlabeled sample and a prediction label of an enhanced sample of the unlabeled sample, wherein the unlabeled sample includes a text sample and an image sample; A first determination module determines a common prediction label of the prediction label of the unlabeled sample and the prediction label of the enhanced sample, wherein the common prediction label is obtained by weighting the prediction label of the unlabeled sample and the prediction label of the enhanced sample; A training module, performing semi-supervised training on the classification model based at least on the common prediction label; A second determination module determines the inconsistency between the unlabeled sample and the enhanced sample based on a classification model trained by semi-supervised training; An extraction module, based on the inconsistency, extracts samples to be labeled from the unlabeled samples, wherein the samples to be labeled are used for sample labeling in active learning; The device is further used to: determine the similarity between the predicted label of the unlabeled sample and the predicted label of the enhanced sample; and determine the inconsistency based on the similarity.

11. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1 to 9.

12. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.