Characterization model training method and device
By introducing multiple iterative representation model training methods into the user classification model, and adjusting model parameters using the similarity of features and label characterization data, the problem of poor performance of traditional models in complex classification tasks is solved, and the ability to continuously learn new categories and model efficiency is improved.
Patent Information
- Application Number
- CN202510243926.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-06-20
AI Technical Summary
Traditional user classification models perform poorly when dealing with complex classification tasks, especially in multi-label classification and fine-grained classification, with poor prediction results and unsustainable learning of new categories.
A training method for characterizing the model is proposed. Through multiple iteration processes, the feature characterization model and label characterization model are used to calculate the similarity between the feature characterization data and the label characterization data, and the parameters of the feature characterization model are adjusted to increase the similarity, thereby strengthening the intra-class tightness.
It significantly improves the model's ability to handle complex classification tasks, can continuously learn new categories, improves the effectiveness of the model and saves training resources.
Smart Images

Figure CN120181191A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification belong to the field of machine learning, and particularly relate to a method and device for training a representation model. Background Art
[0002] With the continuous development of computer technology and machine learning, artificial intelligence has begun to be applied to various scenarios. For example, in various scenarios, artificial intelligence technology has started to be used to divide users into groups, that is, to train some user classification models for classifying users. The classification of users can facilitate providing targeted services to users according to user groups. For example, customized user-exclusive content can be provided, different information can be pushed to users, and so on. The classification of user fraud risks can also be used to determine whether to allow specific operations of users. For example, large-amount transfer operations and high-frequency login operations requested by users with high fraud risks can be rejected. Therefore, classifying users into groups can, on the one hand, enable users to obtain more needed services or content, improving the user experience. On the other hand, it can reduce unnecessary data and information dissemination, optimize the network environment, and can also perform risk prevention and control to enhance network security.
[0003] However, the user classification models trained in traditional technologies can usually only be used to perform some simple user classification tasks, and their prediction results are poor for complex classification tasks (such as multi-label classification, fine-grained classification, etc.). In addition, traditional user classification models cannot continuously learn new categories. Therefore, it is hoped that there can be an improved solution that can more effectively predict complex classification tasks and can continuously learn new categories. Summary of the Invention
[0004] The purpose of the present invention is to provide a method and device for training a representation model, which can significantly improve the processing ability of the model for complex classification tasks and can achieve continuous learning of new categories.
[0005] The first aspect of this specification provides a method for training a representation model, including multiple rounds of iteration, where any t-th round of iteration includes:
[0006] Obtain a user sample, which includes user features and has a first user label;
[0007] Process the user features of the user sample by using a feature representation model to obtain feature representation data of the user features;
[0008] Obtain first label representation data of the first user label through a label representation model;
[0009] Calculate a first similarity between the feature representation data and the first label representation data;
[0010] Adjust the parameters of the feature representation model with the goal of at least increasing the first similarity.
[0011] The second aspect of this specification provides a method for characterizing user features, including:
[0012] Obtain the target user features of the target user;
[0013] Obtain a feature representation model, which is trained according to the method described in the first aspect;
[0014] Use the feature representation model to process the target user features to obtain target feature representation data for characterizing the target user features.
[0015] The third aspect of this specification provides a training device for a representation model, including:
[0016] An acquisition unit for acquiring a user sample, which includes user features and has a first user label;
[0017] A processing unit for using a feature representation model to process the user features of the user sample to obtain feature representation data of the user features;
[0018] An acquisition unit for obtaining first label representation data of the first user label through a label representation model;
[0019] A calculation unit for calculating a first similarity between the feature representation data and the first label representation data;
[0020] An adjustment unit for adjusting the parameters of the feature representation model with the goal of at least increasing the first similarity.
[0021] The fourth aspect of this specification provides a device for characterizing user features, including:
[0022] An acquisition unit for acquiring the target user features of the target user;
[0023] The acquisition unit is further configured to acquire a feature representation model, which is trained according to the method described in the first aspect;
[0024] A processing unit for using the feature representation model to process the target user features to obtain target feature representation data for characterizing the target user features.
[0025] The fifth aspect of this specification provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is made to execute the method described in the first aspect.
[0026] The sixth aspect of this specification provides a computing device, including a memory and a processor. An executable code is stored in the memory. When the processor executes the executable code, the method described in the first aspect is implemented.
[0027] The seventh aspect of this specification provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
[0028] The training method of the characterization model provided by one or more embodiments of this specification strengthens the within-class compactness by increasing the similarity between the feature characterization data and the label characterization data learned by the model, thereby promoting the concentration of samples of the same category in the feature space. This helps to improve the processing ability of the model for complex classification tasks (such as multi-label classification, fine-grained classification, etc.). In addition, this solution proposes a brand-new model training idea, that is, training a basic characterization model to replace training a classification model, which can break through the limitations brought by traditional classification models, that is, it can dynamically and continuously learn new classification categories, thereby greatly improving the effectiveness of the model and saving training resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0030] Figure 1 It is a schematic diagram of the implementation scenario of an embodiment disclosed in this specification;
[0031] Figure 2 It shows a flowchart of the training method of the characterization model according to an embodiment of this specification;
[0032] Figure 3 It shows a schematic diagram of the training target in an example of this specification;
[0033] Figure 4 It shows a schematic diagram of the training target in another example of this specification;
[0034] Figure 5 It shows a schematic diagram of the training method of the characterization model according to an embodiment of this specification;
[0035] Figure 6 It shows a flowchart of the user classification method according to an embodiment of this specification;
[0036] Figure 7Schematic diagram of a training device for a characterization model according to an embodiment of this specification;
[0037] Figure 8 Schematic diagram of a feature characterization device for a user according to an embodiment of this specification. Detailed implementation manners
[0038] To enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification with reference to the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.
[0039] The inventors of this solution found that in existing classification models, the sigmoid or softmax activation function in their output layer treats class labels as discrete classes, which limits the adaptability of the classification model to new classes and the ability to express the relationships between labels. In the presence of this limitation, when new classes need to be added or the labels need to be fine-tuned, it is often necessary to retrain the classification model or adopt complex methods, such as knowledge distillation or model integration, to update the original classification model, which is both time-consuming and inefficient.
[0040] To address the above problems, this solution proposes removing the sigmoid or softmax activation function in the output layer of the traditional classification model, and embedding the labels into the target characterization space (Label Embedding), and then letting the model learn the relationship between the feature characterization data and the label characterization data in the target characterization space. In other words, the original idea of training a classification model is replaced with training a basic characterization model. This solution fundamentally redefines the way of handling classification tasks, enabling the model to maintain robustness even when the number of classes is constantly changing and the data is incomplete, and being able to perform incremental learning seamlessly, which is of great significance for today's rapidly developing and constantly changing machine learning applications.
[0041] To implement the training of the above-mentioned characterization model, the inventors of this solution first studied the following several model training methods:
[0042] 1. Multi-Task Learning: That is, simultaneously optimizing the loss functions of multiple related tasks, aiming to improve the generalization ability and performance of the model by sharing representations. However, multi-task learning requires carefully designed tasks and loss weight balancing, and may lead to performance degradation when the correlation between tasks is not high.
[0043] 2. Self-Supervised Learning: It uses the intrinsic structure of unlabeled data to pre-train a model. Self-supervised learning usually involves constructing auxiliary tasks, such as predicting a part of the data or data transformation. However, although self-supervised learning can utilize a large amount of unlabeled data, its performance on specific classification tasks may depend on the quality and relevance of the pre-training tasks.
[0044] 3. Metric Learning: Aims to learn the distance metric between data points so that the distances between samples of the same class are closer and those between different classes are farther. However, the effectiveness of metric learning is limited by the selected distance metric and the sample pair sampling strategy, and it is also quite sensitive to hyperparameters.
[0045] 4. Concept Drift Adaptation: It is used to cope with the time-varying data distribution, especially when the number of classes increases in real time. However, this method requires a continuous data stream and the ability to update the model in real time, and it may not be applicable to static data sets.
[0046] In addition, in the research of deep learning and especially classification problems, loss functions play a crucial role because they directly guide the learning process and the final performance of the model. Therefore, the inventors of this solution also analyzed and studied the following several classification loss functions:
[0047] 1. Cosine Loss: Trains the model by maximizing the cosine similarity of the correct class and minimizing the cosine similarity of the incorrect class. This is very effective for forming compact class clusters in the embedding space. However, the cosine loss may encounter the problem of fuzzy boundaries and may not be able to well distinguish some overlapping or very close classes.
[0048] 2. Triplet Loss, which is a commonly used method in fields such as embedding learning and face recognition. It considers both positive and negative samples based on an anchor sample to make the positive sample closer to the anchor and the negative sample farther from the anchor. However, the triplet loss depends on an effective triplet sampling strategy. If the sampling is improper, it may lead to unstable training, and the computational cost increases sharply as the sample size increases.
[0049] 3. Center Loss, which aims to increase the intra-class compactness and maintain the inter-class distance in the feature space, and is often used in combination with the cross-entropy loss to improve feature learning. However, although the center loss helps to learn more discriminative features, its computational efficiency is limited by the update and storage of the center points.
[0050] 4. Label Smoothing, which is a regularization technique that avoids the model from being overconfident and enhances its generalization ability by transforming the target distribution from definite 0 and 1 to a soft label distribution. However, label smoothing may lead to the model's excessive tolerance for incorrect classes, affecting the model's learning of clear boundaries.
[0051] 5. Contrastive Knowledge Distillation, which transfers knowledge from the teacher model to the student model, not only focusing on the probability distribution of classes but also on the relative relationships between different classes. However, this method relies on a well-pre-trained teacher model.
[0052] 6. Cross-entropy loss function, which mainly focuses on improving the model's ability to assign correct probabilities to each class label.
[0053] Generally speaking, the design of traditional classification loss functions often aims to optimize the model to ensure the correct classification of different classes. In practical applications, these traditional classification loss functions also face the following challenges:
[0054] 1. For different classes with similar features or samples within the same class with significantly different features, traditional classification loss functions may not be able to distinguish or cluster well.
[0055] 2. In complex real-world data, the model often needs to establish robust boundaries between classes, which goes beyond the simple maximization of the probability of the correct class.
[0056] 3. When new classes need to be added to the model, many loss functions need to be redefined, which may lead to the problems of retraining the entire model and underutilization of data.
[0057] Therefore, this solution proposes an innovative loss function that strengthens the intra-class compactness by increasing the similarity between the feature representation data and the label representation data learned by the model, thereby promoting the concentration of samples of the same class in the feature space.
[0058] In addition, an innovative loss function is also proposed, which aims to increase the distance between different class representations and maintain clear boundaries between classes, enabling the model to clearly distinguish different classes even in the case of similar class features or complex data distributions.
[0059] By combining and using these two loss functions in this solution, the model's processing ability for complex classification tasks can be significantly improved. Here, the complex classification tasks include but are not limited to multi-label classification, fine-grained classification, etc. In addition, the representation model trained by this solution can continuously learn new classes, which greatly improves the effectiveness of the model.
[0060] In summary, although the existing loss function designs can improve the model performance to varying degrees, the present solution further optimizes the loss function design through unique combinations and strategies, overcomes some limitations of previous methods, and particularly demonstrates unique advantages in incremental learning.
[0061] Figure 1 It is a schematic diagram of the implementation scenario of an embodiment disclosed in this specification. Figure 1 In it, the training process of the characterization model includes two branches. In the first branch, the user features of the user samples are encoded by using the feature characterization model to obtain the feature characterization data of the user features. In the second branch, the user labels of the user samples are embedded by using the label characterization model to obtain the label characterization data of the user labels. Then, the similarity between the feature characterization data and the label characterization data is calculated, and the parameters of the feature characterization model are adjusted with the goal of increasing this similarity.
[0062] It should be understood that Figure 1 This is only an exemplary illustration. In practice, the similarity between the label characterization data of each user label under the user classification task to which the above user label belongs can also be combined to adjust the parameters of the characterization model. The specific combination method will be described later, and this specification will not elaborate on it here.
[0063] It should be noted that the feature characterization data or label characterization data described in this specification can refer to vectors or matrices.
[0064] Figure 2 Fig. shows the flowchart of the training method of the characterization model according to an embodiment of this specification. This method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. It should be noted that this method includes multiple rounds of iteration. Figure 2 Fig. shows the method steps included in the t-th (t is a positive integer) round of iteration. It can be understood that by repeatedly executing the steps shown therein, multiple rounds of iterative updates of the characterization model can be achieved, and then the characterization model updated in the last round is used as the final characterization model. As Figure 2 shown, this method can include the following steps:
[0065] Step S202, obtain user samples, where the user samples include user features and have a user label l1.
[0066] The number of the above user features can be multiple, and the multiple user features can include but are not limited to user portraits, transaction flows, scenario activity levels, historical risks, etc.
[0067] The above-mentioned user label l1 corresponds to the user classification task T1, which may include, but is not limited to, any one of the following: risk classification of users, intent classification of users, rental classification of users, etc.
[0068] In addition, the above-mentioned user classification task T1 can be a binary classification task or a multi-classification task. In the case where the user classification task T1 is a multi-classification task, it can correspond to multiple user labels, where l1 is any one of the multiple user labels. Taking the user classification task T1 as the risk classification of users as an example, the multiple user labels corresponding to it can be, for example: "low-risk users", "medium-risk users", "high-risk users". Taking the user classification task T1 as the intent classification of users as an example, the multiple user labels corresponding to it can be, for example: standard questions such as "how to open the payment function", "how to change the bound mobile phone number", "how to make a complaint", etc. Finally, taking the user classification task T1 as the rental classification of users as an example, the multiple user labels corresponding to it can be, for example: "short-term rental users", "long-term rental users", "frequent rental users", etc.
[0069] Of course, in practice, the above user samples can also have other user labels corresponding to other user classification tasks. For example, they can also have the user label l2 corresponding to the user classification task T2 and the user label l3 corresponding to the user classification task T3, etc. The definitions of the user classification tasks T2 and T3 can refer to the user classification task T1 and will not be elaborated here.
[0070] In addition, it should also be understood that to ensure the accuracy of model training, the number of user samples obtained can be multiple, and these multiple user samples constitute a training sample set for the representation model. However, since the processing methods for each user sample are similar, the training process of the representation model will be described below using one user sample as an example.
[0071] Step S204, use the feature representation model to process the user features of the user sample to obtain the feature representation data of the user features of the user sample.
[0072] Among them, the feature representation data here can be a vector or a matrix.
[0073] Taking the feature representation data as a vector as an example, the above feature representation model can be implemented as a Transformer-based encoder or a Bert model, or can also be implemented as neural networks such as Deep Neural Networks (DNN), Recurrent Neural Networks (RNN), and Convolutional Neural Networks (CNN).
[0074] Taking the implementation as a Transformer encoder or a Bert model as an example, the respective user features in the user sample can be directly input into the feature representation model, and then in the embedding layer of the feature representation model, word embedding processing is performed on each user feature to obtain the corresponding word vector. Then, based on the obtained word vectors, the overall representation data of each user feature (hereinafter referred to as feature representation data) can be obtained.
[0075] Taking the above neural network as an example again, word embedding processing can be first performed on each user feature in the user sample to obtain the corresponding word vector. Currently, there are many word embedding algorithms to implement the training of word vectors based on a large amount of text corpora. Thus, the word vectors corresponding to each user feature can be directly determined by referring to the trained word vector table. Then, the neural network can be used to further process the word vectors to obtain the overall representation data of each user feature (hereinafter referred to as feature representation data).
[0076] After obtaining the feature representation data of the above user features, normalization processing can be performed on the feature representation data. For example, L2 norm normalization is performed to ensure that the norm length of the feature representation data is 1.
[0077] Among them, the formula for L2 norm normalization is as follows:
[0078]
[0079] In Formula 1, x1, x2,... x n are the respective elements in the feature representation data, ||x||2 is the L2 norm, and X is the normalized feature representation data.
[0080] Step S206, obtain the label representation data v1 of the user label l1 through the label representation model.
[0081] The label representation data here can refer to a vector or a matrix.
[0082] Taking the case where the data v1 characterized by the label is a vector as an example, the above label characterization model can be implemented as any word embedding model, such as Word2Vec, GloVe, FastText, and so on.
[0083] Specifically, the label characterization model can be used to perform embedding processing on the identifier of the user classification task T1 and the user label l1 respectively, to obtain the characterization data e1 and the characterization data e2. Then, the characterization data e1 and the characterization data e2 are superimposed to obtain the label characterization data v1 of the user label l1.
[0084] After obtaining the label characterization data v1 of the user label l1, normalization processing can also be performed on the label characterization data v1. The specific normalization method can refer to the above formula 1 and will not be elaborated here.
[0085] It should be understood that when the user sample also has other user labels corresponding to other user classification tasks, the label characterization model can be used to determine the label characterization data of the other user labels. The specific determination method is similar to the above user label l1 and will not be elaborated here.
[0086] It should be noted that in practice, step S206 can also be executed first, then step S204, or steps S204 and S206 can be executed simultaneously. This specification does not limit this.
[0087] Step S208, calculate the similarity s1 between the feature characterization data of the user feature and the label characterization data v1 of the user label l1.
[0088] The above similarity s1 can be, for example, cosine similarity, Euclidean distance, Manhattan distance, and Pearson correlation coefficient, and so on.
[0089] Taking cosine similarity as an example, it can be the inner product of the feature characterization data and the label characterization data v1 to obtain the above similarity s1.
[0090] It should be understood that other similarities between the feature characterization data of the user feature and the label characterization data of other user labels can also be calculated here.
[0091] It should also be understood that in the case of normalizing the feature characterization data of the user feature and the label characterization data v1 of the user label l1, it can be to calculate the similarity between the normalized feature characterization data and the normalized label characterization data v1 here, which can ensure the effectiveness and stability of the loss calculated based on this similarity.
[0092] In a more specific implementation, after calculating the above similarity s1 and the above other similarities, they can be normalized, for example, mapped to the interval [0, 1] to simulate a probability distribution.
[0093] Step S210, adjust the parameters of the feature representation model with at least the goal of increasing the similarity s1.
[0094] It should be understood that when also calculating other similarities between the feature representation data and the label representation data of other user tags, the parameters of the feature representation model are adjusted with the goal of increasing the similarity s1 and other similarities.
[0095] Specifically, the first loss function can be used to calculate the loss L1 (hereinafter also referred to as the contrast loss) based on the similarity s1, and this loss L1 is negatively correlated with the similarity s1. Of course, in the case of also calculating the above other similarities, the loss L1 can be calculated based on the similarity s1 and the above other similarities.
[0096] Among them, the above first loss function can be the binary cross-entropy loss function BCEWithLogitsLoss, or it can also be the focal loss, etc.
[0097] Taking BCEWithLogitsLoss as an example, the similarity s1 can be used as the predicted probability, and 1 can be used as the true label corresponding to this predicted probability. Based on BCEWithLogitsLoss, the loss L1 is calculated. Then, the parameters of the feature representation model are adjusted based on the loss L1.
[0098] Among them, the calculation formula of BCEWithLogitsLoss is as follows:
[0099]
[0100] Since when calculating the loss L1, the true label is only 1, the calculation formula of the loss L1 can also be as follows:
[0101]
[0102] Among them, N is the number of similarities (equivalent to the number of user tags of the user sample), is the i-th similarity, that is, the i-th predicted probability, y i is the true label corresponding to the i-th predicted probability, which is always 1.
[0103] It should be understood that when the number of user samples is multiple, based on the above formula 3, the loss L1 corresponding to each user sample can be calculated. Then, the losses L1 corresponding to each user sample can be averaged, and the obtained average result can be used as the final loss.
[0104] It should be noted that in this solution, calculating the loss for adjusting the parameters of the feature representation model based on the above formula 3 can only ensure that the feature representation data of samples with the same label (or category) are close to each other, rather than simply promoting all categories to be evenly dispersed. The following will explain the training objective achieved based on the loss L1 with reference to the accompanying drawings.
[0105] Figure 3 The schematic diagram of the training objective in an example of this specification is shown. Figure 3 In it, Class1 Rep and Class2Rep are the label representation data of two user labels, and these two user labels correspond to a user classification task, or respectively correspond to two different user classification tasks. In addition, Feature1 Rep, Feature2 Rep, and Feature3 Rep are the feature representation data of three user samples respectively. Among them, the user labels of the first two user samples are Class1, and the user label of the last user sample is Class2. From Figure 3 it can be seen that the training objective of this solution is to make Feature1 Rep and Feature2 Rep approach Class1 Rep, and to make Feature3 Rep approach Class2 Rep, that is, to make the feature representation data of samples with the same label (or category) close to each other.
[0106] Of course, in actual use, before calculating the loss L1 based on the above formula 3, a Logit transformation (i.e., the inverse of the Sigmoid function) can be performed on the similarity s1 and the above other similarities, which can ensure the stability of the trained feature representation model.
[0107] It should also be noted that this solution can adopt an annealing temperature mechanism to train the feature representation model, that is, initially allowing the model to learn the feature representation with a lower accuracy (i.e., relatively fuzzy levels in the early stage), and then gradually increasing the accuracy requirement, which is specifically achieved by dynamically adjusting the importance of the similarity between samples during the learning process using a temperature parameter. This helps to reduce the difficulty of model learning, so that the model can stably approach the optimal representation.
[0108] Specifically, after calculating the above similarity s1, it can be scaled using the temperature parameter of the t-th round. For example, divide the similarity s1 by the temperature parameter of the t-th round, and then calculate the above loss L1 based on the scaled similarity s1. Similarly, the above other similarities can also be scaled. In short, the temperature parameter here is used to adjust the importance of the similarity distribution between samples.
[0109] Finally, in this solution, the parameters of the label representation model can also be adjusted based on the above final loss. That is, after calculating the final loss, using the backpropagation method, calculate the update gradients corresponding to the parameters of the feature representation model and the update gradients corresponding to the parameters of the label representation model respectively, and update the parameters of the feature representation model and the label representation model based on them to obtain the trained feature representation model and label representation model.
[0110] So far, the t-th round of iterative training for the feature representation model and the label representation model ends. Before entering the (t + 1)-th round of iteration, the temperature parameter of the t-th round can be adjusted based on the iteration round t and the preset learning rate to obtain the temperature parameter of the (t + 1)-th round, where the temperature parameter of the (t + 1)-th round is less than the temperature parameter of the t-th round.
[0111] In one example, the temperature parameter of the t-th round can be adjusted according to the following formula:
[0112] temp t+1 =temp t *(1 - rate)*step (Formula 4)
[0113] where temp t+1 is the temperature parameter of the (t + 1)-th round, temp t is the temperature parameter of the t-th round, rate is the learning rate (also known as the annealing rate or learning step size), and step is the iteration round (also known as the training step number).
[0114] It should be understood that when adjusting the temperature parameter based on Formula 4, it is possible to gradually decrease the temperature parameter according to the preset learning rate until the minimum temperature parameter limit is reached. This helps to encourage more extensive contrastive learning in the initial stage of training and then gradually focus on more difficult-to-distinguish sample pairs.
[0115] Generally speaking, training the feature representation model based on the loss L1 can achieve optimizing the model's learning of the similarity between samples through the dynamically adjusted temperature parameter in the contrastive learning framework, thereby promoting the effective extraction of features.
[0116] It should be noted that in order to further ensure the effectiveness of the above loss L1, this solution can also combine the within-task dissimilarity loss (hereinafter also referred to as loss L2) to train the above feature representation model and label representation model.
[0117] The training objective of the above loss L2 is to create a greater dissimilarity between classes (or user labels) and / or tasks. In other words, it is to ensure that the label representation data of different user labels remains independent and dissimilar to each other, so that the model can clearly distinguish different tasks or classes.
[0118] It should be understood that whether for user classification tasks or other tasks, the label representation data of user labels can be trained. Then, dissimilarity is quite important. And for a model focusing on user classification tasks, it is even more concerned. For this reason, this solution takes the dissimilarity between user labels as another training objective, which will be described below with reference to the accompanying drawings.
[0119] Figure 4 A schematic diagram of the training objective in another example of this specification is shown. Figure 4 In it, Class1 Rep and Class2 Rep are the label representation data of two user labels, and these two user labels belong to a user classification task. From Figure 4 it can be seen that the training objective of this solution is to make Class1 Rep and Class2 Rep move away from each other. That is, we will judge whether the Embeddings of user labels can be the most dissimilar. Because mainly stabilizing that these classes are dissimilar can ensure that the training process of the two models based on loss L1 is meaningful.
[0120] In short, the main purpose of the above loss L2 is to encourage different user samples corresponding to the same user classification task to be as dispersed as possible in the embedding space to enhance the discriminability of the representation.
[0121] The training process of the feature representation model will be described below based on the combination of loss L1 and loss L2.
[0122] Specifically, the label representation data corresponding to each user label under the user classification task T1 can be obtained through the label representation model. Among them, the acquisition method of the label representation data corresponding to each user label is similar to that of the label representation data of the user label l1. For each pair of the label representation data, calculate the similarity to obtain a number of similarities s2. Using the second loss function, based on the number of similarities s2, calculate the loss L2, and this loss L2 is positively correlated with each similarity s2. It should be understood that the number of similarities s2 here is used to measure the average non-dispersion degree of each user sample under the same user classification task.
[0123] More specifically, the label representation data corresponding to each user label can be normalized first. For example, perform L2 norm normalization to ensure that the norm length of each label representation data is 1. Then, calculate the similarity for each pair of the normalized label representation data.
[0124] Of course, in the case that the above user samples also have other user labels corresponding to other user classification tasks, the corresponding loss L2 can also be calculated for other user classification tasks. The specific calculation method is similar to that of the user classification task T1 and will not be elaborated here.
[0125] In addition, the similarity between the label representation data under different user classification tasks can be calculated to obtain a number of similarities s3. Then, using the above second loss function, based on the number of similarities s3, the loss L3 is calculated, and the loss L3 is positively correlated with each similarity s3.
[0126] The above second loss function can be the binary cross-entropy loss function BCEWithLogitsLoss, or it can also be the focal loss, etc.
[0127] Taking BCEWithLogitsLoss as an example, a number of similarities s2 or a number of similarities s3 can be used as a number of predicted probabilities, and 0 can be used as the true label corresponding to a single predicted probability. Based on the binary cross-entropy loss function, the loss L2 or L3 is calculated.
[0128] Since the true label is only 0 when calculating the loss L2, the calculation formula of the loss L2 can also be as follows:
[0129]
[0130] where N is the number of similarities s2 calculated for a certain user classification task, which is related to the number of user labels under this user classification task. is the i-th similarity s2, that is, the i-th predicted probability, y i is the true label corresponding to the i-th predicted probability, which is always 0.
[0131] In addition, when calculating the loss L3, since the true label is also only 0, the calculation formula of the loss L3 can also refer to the above formula 5. The difference is that when calculating the loss L3, N is the number of similarities s3 calculated for the label representation data under different user classification tasks, which is related to the number of user classification tasks and the number of user labels under each user classification task. is the i-th similarity s3.
[0132] It should be noted that in actual use, before calculating the loss L2 or L3 based on the above formula 5, a Logit transformation can be performed on the similarity s2 or the similarity s3, which can ensure the stability of the trained feature representation model.
[0133] It should also be noted that in the case where the annealing temperature mechanism is adopted in this solution to train the feature representation model, after calculating the above-mentioned several similarities s2 or several similarities s3, the t-th round of temperature parameter can be used to scale them. For example, divide each similarity s2 or each similarity s3 by the t-th round of temperature parameter, and then calculate the above-mentioned loss L2 based on the scaled similarities s2 or s3. This can reduce the sensitivity of the loss function to the dissimilarity between classes.
[0134] It should be understood that in the case where the user sample has multiple user labels corresponding to multiple user classification tasks, the loss L2 corresponding to each user classification task can be calculated based on the above formula 5. Then, the losses L2 corresponding to each user classification task can be averaged to obtain the final loss L2. In addition, the loss L3 can also be calculated based on the above formula 5. Finally, the losses L1, the final loss L2, and the loss L3 corresponding to each user sample can be combined, and the parameters of the feature representation model can be adjusted based on the obtained combined loss.
[0135] In one example, the combined loss can be calculated according to the following formula:
[0136]
[0137] where L is the combined loss, n is the number of user samples, is the average result of the n losses L1 corresponding to the n user samples, m is the number of user classification tasks, is the final loss L2 corresponding to the m user classification tasks.
[0138] Similarly, this solution can also adjust the parameters of the label representation model based on the above combined loss, and then obtain the trained label representation model.
[0139] It should be understood that adjusting the parameters of the feature representation model based on the above combined loss in this solution is actually aimed at increasing the similarity s1 and decreasing the similarity s2 to adjust the parameters of the feature representation model.
[0140] Generally speaking, when training the feature representation model in combination with the loss L2, it can encourage the user samples under the same user classification task to be dispersed in the embedding space, which helps to improve the expression ability and generalization performance of the model, especially when dealing with data containing multiple related tasks.
[0141] Thus, the t-th round of update (or training) of the feature representation model and the label representation model based on the combination of the loss L1 and the loss L2 is completed. After multiple rounds of iterative updates, the feature representation model and the label representation model updated in the last round can be used as the finally used feature representation model and label representation model.
[0142] In summary, in this solution, loss L1 and loss L2 can complement each other, aiming to enable the model to learn more detailed and accurate class boundaries, promoting the consistency of intra-class representations and the distinguishability of inter-class representations. By combining these two losses, the representation model can initially master the basic concepts of the classification task with lower difficulty and gradually increase the requirements for classification accuracy, achieving a process of gradually refining and optimizing the feature representation data, thereby effectively improving the performance in the classification task, especially in scenarios with a large number of similar classes or unclear class boundaries.
[0143] Figure 5 The figure shows a schematic diagram of a method for training a representation model according to an embodiment of this specification. Figure 5 Among them, the user sample includes user features and has multiple user labels corresponding to multiple user classification tasks. For this user sample, the user features therein can be input into the feature representation model to obtain the feature representation data of the user features. In addition, the multiple user labels can be respectively input into the label representation model to obtain multiple label representation data corresponding to the multiple user labels. Then, the similarity between the feature representation data and each label representation data can be calculated to obtain multiple similarities s1. In addition, the label representation data of each user label under each user classification task can also be obtained through the label representation model, and the similarity between each label representation data under each user classification task can be calculated to obtain multiple similarities s2 corresponding to each user classification task. After that, loss L1 can be calculated based on the multiple similarities s1, and loss L2 corresponding to each user classification task can be calculated based on the multiple similarities s2 corresponding to each user classification task. Finally, the average of each loss L2 corresponding to each user classification task can be calculated, and the obtained average result can be added to loss L1 to obtain the comprehensive loss. This comprehensive loss is used to adjust the parameters of the feature representation model and the label representation model.
[0144] Of course, in practice, the number of the above user samples is usually multiple. In the case of multiple user samples, the average of the multiple losses L1 corresponding to the multiple user samples can be calculated first, and then added to the average result of each loss L2 to obtain the comprehensive loss.
[0145] It should be understood that after the feature representation model is trained, it can be used to represent the features of the user, and then downstream tasks, such as user classification tasks, can be performed based on the obtained feature representation data.
[0146] It should also be understood that after the label representation model is trained, the final label representation data of each user label under each user classification task is actually obtained. After that, based on the final label representation data of each user label under any user classification task, the user classification task can be performed on the newly received user sample, which will be described in detail below.
[0147] Figure 6 FIG. shows a flowchart of a user classification method according to an embodiment of the present specification. As Figure 6 shown, the method may include the following steps:
[0148] Step S602, obtain the target user features of the target user.
[0149] The above-mentioned target user features may include but are not limited to user portraits, transaction records, scene activity levels, historical risks, etc.
[0150] Step S604, obtain the feature representation model.
[0151] The feature representation model may be trained according to the above Figure 2 shown method steps.
[0152] Step S606, use the feature representation model to process the target user features to obtain target feature representation data for representing the target user features.
[0153] Step S608, calculate each target similarity between the target feature representation data and each label representation data corresponding to each user label in the current classification task.
[0154] More specifically, the target feature representation data and each label representation data may be first normalized, and then, each target similarity between the normalized target feature representation data and the normalized each label representation data is calculated.
[0155] It should be understood that if the current classification task is a binary classification task, then the target similarity between the target feature representation data and the label representation data corresponding to the target user label in the current classification task is calculated here.
[0156] Step S610, determine the classification result of the target user according to the above-mentioned each target similarity.
[0157] For example, the target user label corresponding to the maximum target similarity among each user label in the current classification task is determined as the classification result of the target user. Or rather, the classification result of the target user is determined as the target label.
[0158] If the current classification task is a binary classification task, then it is determined whether the above-mentioned target similarity is greater than a preset threshold. If it is greater, the target user label is determined as the classification result for the target user.
[0159] It can be seen from this that in this solution, when performing a certain user classification task for a user, only the similarity between the user features of the user and each user label under the user classification task needs to be calculated to achieve the classification of the user, which can greatly improve the classification efficiency of the user.
[0160] The advantages of this solution are summarized as follows:
[0161] First of all, the contrastive loss proposed in this solution aims to increase the similarity between the feature representation data and the label representation data learned by the model, strengthen the within-class compactness of the model, and thus promote the concentration of samples in the same category in the feature space. Secondly, the intra-task dissimilarity loss proposed in this solution optimizes the label representation data between different categories to ensure the maximum degree of distinguishability between tasks or categories and maintain clear category boundaries, even in the case of similar category features or complex data distributions. In addition, this solution incorporates an annealing temperature strategy into both of the above two loss functions, allowing the model to adopt a relatively loose standard at the initial stage of training and gradually increasing to higher precision requirements, which helps the model to learn stably and avoid overfitting. Furthermore, by dynamically adjusting the temperature parameter, this solution can adjust the sensitivity of the model to within-class compactness and between-class distinguishability, enabling the model to more effectively learn the complex classification boundaries of specific tasks. Finally, this solution does not rely on any pre-trained teacher model, reducing the demand for training resources and simplifying the training process.
[0162] All in all, the contrastive loss and intra-task dissimilarity loss proposed in this solution combine the representation learning of the target representation space and the enhancement of the category discrimination ability, solving the problem that traditional loss functions are difficult to simultaneously consider within-class compactness and between-class distinguishability. In addition, by introducing the annealing temperature mechanism, the fluctuations and instabilities of the model at the initial stage of training are effectively handled, helping the model to learn and converge more smoothly. This solution focuses on the similarity and difference between feature and label representation data, especially providing an optimized method for dynamic category expansion. This solution provides comprehensive improvements to the limitations of existing classification models, especially in application scenarios that require highly accurate category discrimination and real-time model updates to adapt to new categories.
[0163] The above are the technical innovations of the two loss functions proposed in this solution. Further, this solution also has significant application value and economic benefits in business practice.
[0164] First, it has commercial potential: This solution provides a way to improve the accuracy and efficiency of models. By reducing the training difficulty and enhancing the discrimination ability of the model, enterprises can bring products to the market faster while providing more accurate and personalized services. Second, it can incrementally learn business strategies: This solution supports the model's rapid adaptation to newly added categories, greatly reducing the costs of data relabeling and model retraining, which is particularly valuable for business models that require continuous dataset and category updates. This enables enterprises to quickly respond to market changes and maintain a competitive edge. Third, it can improve the utilization efficiency of computing resources: In today's context where computing resources are increasingly tight and costs are rising continuously, this solution reduces the model's dependence on a large amount of computing resources by optimizing the loss function design, thereby reducing the hardware investment and operation and maintenance costs for enterprises. Fourth, it can strengthen the robustness of the model: By clearly defining the boundaries between categories, this solution can enhance the stability and generalization ability of the model in actual business, thus maintaining the high performance of the model in a dynamic and ever-changing business environment. Fifth, it can enhance the user experience: Improving the classification accuracy of the model is directly related to enhancing the user experience. In applications such as personalized recommendations, search engine optimization, and content filtering, more accurate classification capabilities can significantly improve the satisfaction and loyalty of end-users. Finally, it has market demand adaptability: This solution provides strong technical support for business scenarios that face continuously expanding datasets and rapidly changing market demands, helping enterprises quickly adapt to market development and enhance their business response capabilities.
[0165] Corresponding to the above training method of the characterization model, an embodiment of this specification also provides a training device for a characterization model, as Figure 7 shown. The device may include:
[0166] An acquisition unit 702, configured to acquire a user sample, where the user sample includes user features and has a first user label.
[0167] A processing unit 704, configured to process the user features of the user sample by using a feature characterization model to obtain feature characterization data of the user features.
[0168] The acquisition unit 702 is further configured to obtain first label characterization data of the first user label through a label characterization model.
[0169] A calculation unit 706, configured to calculate a first similarity between the feature characterization data and the first label characterization data.
[0170] An adjustment unit 708, configured to adjust the parameters of the feature characterization model with at least the goal of increasing the first similarity.
[0171] In one embodiment, the first user label corresponds to a first classification task;
[0172] The obtaining unit 702 is further configured to obtain, via the label representation model, label representation data corresponding to each user label under the first classification task;
[0173] The calculation unit 706 is further configured to calculate the similarity between each pair of the label representation data to obtain a number of second similarities;
[0174] The adjustment unit 708 is specifically configured to:
[0175] Adjust the parameters of the feature representation model and the label representation model with the goal of increasing the first similarity and decreasing the number of second similarities.
[0176] In one embodiment, the obtaining unit 702 is specifically configured to:
[0177] Use the label representation model to perform embedding processing on the identifier of the first classification task and the first user label respectively to obtain first representation data and second representation data;
[0178] Superimpose the first representation data and the second representation data to obtain the first label representation data of the first user label.
[0179] In one embodiment, the above user sample further has a second user label corresponding to the second classification task;
[0180] The obtaining unit 702 is further configured to obtain, via the label representation model, second label representation data of the second user label;
[0181] The calculation unit 706 is further configured to calculate a third similarity between the feature representation data and the second label representation data;
[0182] The adjustment unit 708 is further configured to adjust the parameters of the feature representation model with the goal of increasing the third similarity.
[0183] In one embodiment, the adjustment unit 708 is further specifically configured to:
[0184] Use the t-th round temperature parameter to perform scaling processing on the first similarity and a number of second similarities respectively;
[0185] Adjust the parameters of the feature representation model and the label representation model with the goal of increasing the first similarity after scaling processing and decreasing the number of second similarities after scaling processing.
[0186] In one embodiment, the adjustment unit 708 is further configured to adjust the t-th round temperature parameter based on the iteration round and the learning rate to obtain the (t + 1)-th round temperature parameter; wherein, the (t + 1)-th round temperature parameter is less than the t-th round temperature parameter.
[0187] In one embodiment, the adjustment unit 708 is further specifically configured to:
[0188] Using the first loss function, calculate a first loss based on the first similarity; the first loss is negatively correlated with the first similarity.
[0189] Using the second loss function, calculate a second loss based on the several second similarities; the second loss is positively correlated with each second similarity.
[0190] Based on the combined loss of the first loss and the second loss, adjust the parameters of the feature representation model and the label representation model.
[0191] In one embodiment, the obtaining unit 702 is further configured to obtain, through the label representation model, each label representation data corresponding to each user label in the second classification task, and calculate the similarity for each pair of them to obtain several fourth similarities.
[0192] The adjusting unit 708 is further specifically configured to:
[0193] Taking increasing the third similarity and decreasing the several fourth similarities as the goal, adjust the parameters of the feature representation model.
[0194] The functions of the functional units of the device in the above embodiments of this specification can be implemented by the steps of the above method embodiments. Therefore, the specific working process of the device provided in an embodiment of this specification will not be repeated here.
[0195] The training device of the representation model provided in an embodiment of this specification, and the trained representation model can be used to perform complex classification tasks.
[0196] Corresponding to the above method for characterizing the features of a user, an embodiment of this specification further provides a device for characterizing the features of a user, as Figure 8 shown, the device may include:
[0197] An obtaining unit 802, configured to obtain the user features of a target user.
[0198] The obtaining unit 802 is further configured to obtain a feature representation model, and the feature representation model is trained according to Figure 2 the method steps shown.
[0199] A processing unit 804, configured to process the target user features by using the feature representation model to obtain target feature representation data for characterizing the target user features.
[0200] In one embodiment, the device further includes:
[0201] A calculating unit 806, configured to calculate the target similarity between the target feature representation data and the label representation data corresponding to the target user label in the current classification task.
[0202] A determination unit 808, configured to determine a classification result for the target user according to the above-mentioned target similarity.
[0203] The functions of the functional units of the device in the above embodiments of this specification can be implemented by the steps of the above method embodiments. Therefore, the specific working process of the device provided in an embodiment of this specification will not be repeated here.
[0204] The user feature characterization device provided in an embodiment of this specification can effectively characterize the features of the user.
[0205] According to an embodiment of another aspect, there is also provided a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is made to execute the method in combination with Figure 2 as described.
[0206] According to an embodiment of still another aspect, there is also provided a computing device, including a memory and a processor. An executable code is stored in the memory. When the processor executes the executable code, the method in combination with Figure 2 as described is implemented.
[0207] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the medium or device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content.
[0208] The steps of the method or algorithm described in combination with the disclosure of this specification can be implemented in a hardware manner, or can be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules. The software modules can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable hard disk, a CD-ROM, or any other form of storage medium well-known in the art. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a server. Of course, the processor and the storage medium can also exist as discrete components in the server.
[0209] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many method flow improvements today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using a hardware entity module. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logical function is determined by the user programming the device. Designers can program themselves to "integrate" a digital system onto a single PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compilers used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL), and there is not just one type of HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method flow using the above-mentioned several hardware description languages and programming it into an integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.
[0210] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26k20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or the structures within the hardware component.
[0211] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude that with the development of future computer technologies, the computers for implementing the functions of the above embodiments can be, for example, personal computers, laptop computers, in-vehicle human-machine interaction devices, cellular phones, camera phones, smart phones, personal digital assistants, media players, navigation devices, email devices, game consoles, tablet computers, wearable devices, or any combination of these devices.
[0212] Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way among many execution orders of steps and does not represent the only execution order. When the actual device or terminal product is executed, it may be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in an environment of parallel processors or multi-threaded processing, or even in a distributed data processing environment). The terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, product or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or also includes elements inherent to such process, method, product or device. Without further limitation, there is no exclusion of additional identical or equivalent elements in the process, method, product or device comprising the said elements. For example, if terms such as first and second are used to denote names, they do not denote any particular order.
[0213] For convenience of description, when describing the above device, it is described by dividing it into various modules according to functions. Of course, when implementing one or more of this specification, the functions of each module may be implemented in the same or multiple software and / or hardware, or the modules implementing the same function may be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other may be through some interfaces, and the indirect coupling or communication connection of the device or unit may be in electrical, mechanical or other forms.
[0214] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate a device for realizing the function specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0215] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one or more of the acts Figure 1 and / or boxes Figure 1 specified in one or more of the acts and / or boxes.
[0216] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, thereby providing steps for implementing the functions specified in one or more of the acts Figure 1 and / or boxes Figure 1 specified in one or more of the acts and / or boxes.
[0217] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0218] The memory may include non-permanent memory in the computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
[0219] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for storing information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage, graphene storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0220] Those skilled in the art should understand that one or more embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0221] One or more embodiments of this specification can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0222] The various embodiments in this specification are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and reference can be made to the corresponding parts of the method embodiments for the relevant content. In the description of this specification, the description of reference terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0223] The above description is only for the embodiments of one or more embodiments of this specification and is not used to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims.
Claims
1. A training method for a representation model, comprising multiple rounds of iterations, wherein any t-th round of iterations comprises: Acquire a user sample, where the user sample includes user features and has a first user label; Processing the user features of the user sample using the feature characterization model to obtain feature characterization data of the user features; Acquire first tag representation data of the first user tag through a tag representation model; Calculating a first similarity between the feature representation data and the first label representation data; The parameters of the feature characterization model are adjusted with the goal of at least increasing the first similarity.
2. The method according to claim 1, wherein: The adjusting the parameters of the feature representation model with the goal of at least increasing the first similarity includes: The parameters of the feature representation model and the label representation model are adjusted with the goal of at least increasing the first similarity.
3. The method according to claim 2, wherein: The first user tag corresponds to a first classification task; the method further includes: Acquire, by means of the label representation model, label representation data corresponding to each user label under the first classification task; For each of the label representation data, similarities are calculated two by two to obtain a plurality of second similarities; The adjusting the parameters of the feature characterization model and the label characterization model includes: With the goal of increasing the first similarity and reducing the plurality of second similarities, the parameters of the feature representation model and the label representation model are adjusted.
4. The method according to claim 3, wherein: The obtaining of first tag representation data of the first user tag includes: Using the label representation model, respectively embedding the identifier of the first classification task and the first user label to obtain first representation data and second representation data; The first characterization data and the second characterization data are superimposed to obtain first tag characterization data of the first user tag.
5. The method according to claim 3, wherein: The user sample also has a second user label corresponding to a second classification task, and the method further includes: Acquire second tag representation data of the second user tag through the tag representation model; Calculating a third similarity between the feature representation data and the second label representation data; With the goal of increasing the third similarity, the parameters of the feature representation model and the label representation model are adjusted.
6. The method according to claim 3, wherein: The adjusting the parameters of the feature representation model and the label representation model with the goal of increasing the first similarity and reducing the plurality of second similarities includes: Using the t-th round temperature parameter, respectively scaling the first similarity and the plurality of second similarities; The parameters of the feature representation model and the label representation model are adjusted with the goal of increasing the first similarity after the scaling process and decreasing the plurality of second similarities after the scaling process.
7. The method according to claim 6, further comprising: Based on the iteration rounds and the learning rate, the temperature parameter of the t-th round is adjusted to obtain the temperature parameter of the t+1-th round; wherein the temperature parameter of the t+1-th round is less than the temperature parameter of the t-th round.
8. The method according to claim 3, wherein: The adjusting the parameters of the feature representation model and the label representation model with the goal of increasing the first similarity and reducing the plurality of second similarities includes: Calculating a first loss based on the first similarity using a first loss function; the first loss is negatively correlated to the first similarity; Calculating a second loss based on the plurality of second similarities using a second loss function; wherein the second loss is positively correlated to each second similarity; Based on the comprehensive loss of the first loss and the second loss, the parameters of the feature representation model and the label representation model are adjusted.
9. The method according to claim 5, further comprising: By using the label representation model, obtaining label representation data corresponding to each user label under the second classification task, and calculating similarities between them to obtain a plurality of fourth similarities; With the goal of increasing the third similarity and reducing the plurality of fourth similarities, the parameters of the feature representation model and the label representation model are adjusted.
10. The method according to claim 9, further comprising: Calculating the similarity between each label representation data under the first classification task and each label representation data under the second classification task to obtain a plurality of fifth similarities; With the goal of increasing the third similarity and reducing the plurality of fourth similarities and the plurality of fifth similarities, the parameters of the feature representation model and the label representation model are adjusted.
11. A method for characterizing user characteristics, comprising: Obtain target user characteristics of target users; Acquire a feature characterization model, wherein the feature characterization model is trained according to the method according to any one of claims 1 to 10; The target user features are processed using the feature characterization model to obtain target feature characterization data for characterizing the target user features.
12. The method according to claim 11, further comprising: Calculating the target similarity between the target feature representation data and the label representation data corresponding to the target user label under the current classification task; A classification result for the target user is determined according to the target similarity.
13. A training device for a representation model, comprising: An acquisition unit, configured to acquire a user sample, wherein the user sample includes a user feature and has a first user tag; A processing unit, configured to process the user features of the user sample using a feature characterization model to obtain feature characterization data of the user features; The acquisition unit is further configured to acquire first tag representation data of the first user tag through a tag representation model; a calculation unit, configured to calculate a first similarity between the feature representation data and the first label representation data; An adjustment unit is used to adjust the parameters of the feature representation model with the goal of at least increasing the first similarity.
14. A user feature characterization device, comprising: An acquisition unit, used for acquiring target user characteristics of a target user; The acquisition unit is further used to acquire a feature characterization model, where the feature characterization model is trained according to the method according to any one of claims 1 to 10; The processing unit is used to process the target user features by using the feature characterization model to obtain target feature characterization data used to characterize the target user features.
15. A computing device, comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 12 is implemented.