Model training method and device and electronic equipment
Through the combination of label conversion and feature generation model, the problem of reduced effect of credit risk model due to data distribution migration is solved, unbiased and stable credit risk model training is achieved, and the accuracy of the model is improved.
Patent Information
- Application Number
- CN202410703511.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-17
AI Technical Summary
Credit risk models have differences between model training data and application data due to data distribution migration, resulting in a serious decline in model performance indicators. A better model training solution is needed to obtain an unbiased credit risk model.
By obtaining labeled source domain data and unlabeled target domain data, use the label conversion model to convert the labels in the source domain data into labels in the target domain data, and generate simulated features through the feature generation model, based on the conversion loss The label conversion model is trained to obtain a trained label conversion model to reduce label distribution differences.
It effectively avoids the decline in performance indicators after the credit risk model goes online, improves the accuracy of the model, and ensures the unbiasedness and stability of the credit risk model.
Smart Images

Figure CN118657604A
Abstract
Description
Technical Field
[0001] This document belongs to the field of data processing technology, and specifically relates to a method, device and electronic equipment for model training. Background Art
[0002] In the credit risk management scenario of merchant entities, the core idea is to train the model using merchant-related information that does not infringe on personal privacy, and use the trained model to predict the merchant's overdue risk, thereby executing a series of decisions on merchant stratification, credit access, and credit limit increase.
[0003] Risk has a lag, that is, it takes enough time to determine the risk, which makes the credit risk modeling cycle often long. Taking the credit card business as an example, the general performance period is one year or one and a half years. In this case, with the changes in the external environment and economic cycle, it is easy for the distribution of model training data and the distribution of model online application data to differ greatly for the credit risk model.
[0004] This migration of data distribution will lead to deviations in the credit risk model trained with early historical data, which will cause a serious decline in the performance indicators of the credit risk model after it is launched. Therefore, it is necessary to provide a better model training scheme to obtain an unbiased credit risk model to determine the decision to be executed on merchants. Summary of the invention
[0005] The embodiments of this specification provide a method, device and electronic device for model training to provide a solution for model training.
[0006] In a first aspect, an embodiment of the present specification provides a method for model training, the method comprising: obtaining source domain data with labeled merchants and target domain data without labeled merchants, the target domain data and the source domain data including feature data of merchants; inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, the first merchant being a merchant included in both the target domain data and the source domain data; based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model; based on the first simulated feature and the target domain feature of the first merchant in the target domain data, determining a conversion loss corresponding to the label conversion model, and training the label conversion model according to the conversion loss to obtain a trained label conversion model.
[0007] In a second aspect, an embodiment of the present specification provides a device for model training, comprising: an acquisition module, used to acquire source domain data with labeled merchants and target domain data without labeled merchants, wherein the target domain data and the source domain data include feature data of merchants; a conversion module, used to input a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data; a generation module, used to generate a first simulated feature of the first merchant in the target domain data through a feature generation model based on the first simulated label; and a training module, used to determine a conversion loss corresponding to the label conversion model based on the first simulated feature and the target domain feature of the first merchant in the target domain data, and train the label conversion model according to the conversion loss to obtain a trained label conversion model.
[0008] In a third aspect, an embodiment of the present specification provides an electronic device, comprising: a processor, and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor is enabled to: obtain source domain data with labeled merchants and target domain data without labeled merchants, wherein the target domain data and the source domain data include feature data of merchants; input a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data; based on the first simulated label, generate a first simulated feature of the first merchant in the target domain data through a feature generation model; based on the first simulated feature and the target domain feature of the first merchant in the target domain data, determine the conversion loss corresponding to the label conversion model, and train the label conversion model according to the conversion loss to obtain a trained label conversion model.
[0009] In a fourth aspect, an embodiment of the present specification provides a storage medium for storing a computer program, which can be executed by a processor to implement the following process: obtaining source domain data with labeled merchants and target domain data without labeled merchants, wherein the target domain data and the source domain data include feature data of merchants; inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data; based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model; based on the first simulated feature and the target domain feature of the first merchant in the target domain data, determining a conversion loss corresponding to the label conversion model, and training the label conversion model according to the conversion loss to obtain a trained label conversion model.
[0010] In a fifth aspect, an embodiment of the present specification provides a computer program product, including a computer program, which implements the following process when executed by a processor: obtaining source domain data with labeled merchants and target domain data without labeled merchants, wherein the target domain data and the source domain data include feature data of merchants; inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data; based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model; based on the first simulated feature and the target domain feature of the first merchant in the target domain data, determining a conversion loss corresponding to the label conversion model, and training the label conversion model according to the conversion loss to obtain a trained label conversion model. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate one or more embodiments of this specification 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 one or more embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0012] Figure 1 It is a flowchart of a model training method provided in an embodiment of this specification;
[0013] Figure 2 It is a schematic diagram of an application example provided in the embodiments of this specification.
[0014] Figure 3 It is a schematic diagram of an application scenario of a model training method provided in an embodiment of this specification;
[0015] Figure 4 It is a schematic diagram of the reasoning process of a trained label conversion network provided in an embodiment of this specification;
[0016] Figure 5 It is a structural schematic diagram of a model training device provided in an embodiment of this specification;
[0017] Figure 6 It is a structural diagram of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this document.
[0019] The terms "first", "second", etc. in the specification and claims of this document are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of this specification can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0020] For credit risk models, input data usually includes feature data and label data. Feature data is relevant information about the merchant, such as business scale, business stability, historical repayment performance, etc. Label data is information about whether the merchant is overdue within a period of time after the credit is granted, such as whether the merchant has been overdue for more than 30 days within a period of time after the credit is granted (such as 180 days). If so, the merchant's label value can be set to 1. If not, the merchant's label value can be set to 0.
[0021] When modeling the credit risk of merchants, the core is to learn the joint probability distribution P(X,Y) of merchant characteristics and expected labels, and P(X,Y) = P(Y)*P(X|Y), where P(Y) is the distribution of the merchant's label Y, and P(X|Y) is the conditional probability distribution of merchant characteristics under a given label Y.
[0022] Although the distribution of label Y (i.e., whether it is overdue) is easily affected by the external environment (such as emergencies, macro events such as interest rates) and economic cycles, the characteristics of merchants who are overdue will basically not change. For example, overdue merchants often have characteristics such as low average monthly operating profit (such as less than 0) and multiple loans. Therefore, the scheme in this specification can assume that no matter how the distribution of label Y changes, it will not cause changes in the conditional probability distribution P(X|Y), that is, the distribution of label Y and the feature distribution X|Y under the given label Y are independent of each other.
[0023] In this way, the distribution of label Y may change in the data of the credit risk modeling training phase and the data of the model online application phase (hereinafter referred to as the target domain), but given the label Y, the conditional probability distribution P(X|Y) of the merchant characteristics will not change.
[0024] In order to better illustrate this specification and highlight the main purpose of this specification, the specific embodiments in this specification are described based on the application scenario of model training in the field of financial risk control. Those skilled in the art should understand that this specification can also be implemented in the same or similar manner for other application scenarios of model training in the fields of personalized services, precision marketing, risk management and intelligent decision-making.
[0025] The following, in conjunction with the accompanying drawings, describes in detail the model training method, device and electronic device provided in the embodiments of this specification through specific embodiments and their application scenarios.
[0026] Figure 1 A model training method provided by an embodiment of the present invention is shown. The method can be executed by an electronic device, and the electronic device may include: a server and / or a terminal device, wherein the terminal device may be, for example, a vehicle-mounted terminal or a mobile phone terminal. In other words, the method can be executed by software or hardware installed in the aforementioned electronic device, and the model training method includes the following steps:
[0027] Step S102: Acquire source domain data with business labels and target domain data without business labels.
[0028] Among them, the source domain data and the target domain data can be data from two sources that can be applied to the same model. In actual applications, the source domain data and the target domain data can be data from two different time periods in the business to which a model belongs. Moreover, the time interval between the two different time periods can be set according to actual conditions (such as a time interval of 7 days or 1 month, etc.). Specifically, the source domain data can be the data used in the model modeling training phase, and the target domain data can be the data used in the model online application phase.
[0029] The source domain data and the target domain data have a common type of target object (i.e., a merchant). The main difference between the source domain data and the target domain data is that the merchant in the source domain data has been labeled (e.g., a label indicating whether the merchant is overdue), while the merchant in the target domain data has not been labeled. The label can be manually labeled or labeled in other ways, and the embodiments of this specification do not specifically limit this, and can be determined according to actual conditions.
[0030] In addition to labels, the target domain data and source domain data may also contain characteristic information of merchants (such as business scale, business stability, historical repayment performance, etc.). The source domain data and target domain data may be obtained in a variety of different ways. For example, the source domain data and target domain data may be obtained from a specified database, or the historical business data with merchant labels used in the model building training phase may be obtained from a specified business, and the obtained historical business data may be used as the source domain data. Similarly, the historical business data without merchant labels used in the model online application phase may be obtained from a specified business, and the obtained historical business data may be used as the target domain data. Alternatively, the source domain data and target domain data may be obtained from public data sources, etc.
[0031] Step S104: inputting the first source domain label of the first merchant in the source domain data into the label conversion model to obtain the first simulated label of the first merchant in the target domain data.
[0032] Step S106: Based on the first simulated tag, generate a first simulated feature of the first merchant in the target domain data through a feature generation model.
[0033] Step S108: Based on the first simulation feature and the target domain feature of the first merchant in the target domain data, determine the conversion loss corresponding to the label conversion model, and train the label conversion model according to the conversion loss to obtain a trained label conversion model.
[0034] Among them, the label conversion model is a model that converts merchant labels in different domains. As mentioned above, the distribution of merchant labels will migrate. The trained label conversion model can convert merchant labels in the source domain data into merchant labels that conform to the label distribution in the target domain data.
[0035] In order to distinguish the merchant labels in various embodiments of this specification, the labels of the merchants marked in the source domain data are called source domain labels, the actual labels of the merchants in the target domain data are called real labels, and the labels of the merchants generated by the label conversion model are called simulated labels. It should be noted that the real labels are unknown, and the simulated labels output by the trained label conversion model should be as close to the real labels as possible.
[0036] As mentioned above, the distribution of label Y (i.e., whether it is overdue) is easily affected by the external environment (such as emergencies, macro events such as interest rates) and the economic cycle, resulting in distribution migration, which will affect the prediction effect of the credit risk model. In one example, a label conversion model can be set up. By training the label conversion model, the labels in the source domain data can be converted into labels in the target domain data, and the obtained labels conform to the merchant label distribution in the target domain. Then, the obtained labels can be used to train the credit risk model to obtain an unbiased credit risk model.
[0037] For the training process of the label conversion model, it is often easy to think of comparing the converted first simulated label with the real label and constructing a loss function. However, as mentioned above, the real label is often unknown, which makes it impossible to compare the converted simulated label with the real label and construct a loss function.
[0038] The first merchant is a randomly selected merchant included in both the target domain data and the source domain data. The number of the first merchant is not specifically limited in this specification and can be determined according to actual conditions. In the above analysis, it has been determined that the distribution of label Y and the feature distribution X|Y under the given label Y are independent of each other. Therefore, the features of the first merchant after label conversion can be used to replace the label to determine the conversion loss, and then the conversion loss can be used to train the label conversion model.
[0039] In one example, in addition to the label conversion model, a trained feature generation model can be set, and the feature generation model is used to simulate the features corresponding to the output labels according to the input labels. Similar to the aforementioned label naming method, the merchant features in the source domain data can be called source domain features, the merchant features in the target domain data can be called target domain features, and the merchant features generated by the feature generation model can be called simulated features. It should be noted that unlike the unobtainable characteristics of the real labels corresponding to the target domain data, the target domain features can be directly obtained from the target domain data.
[0040] Through the feature generation model, the first simulated feature corresponding to the first simulated label determined by the label conversion model can be obtained, and the first simulated feature can be compared with the target domain feature corresponding to the first merchant known in the target domain data to obtain the conversion loss, and the label conversion model can be trained through the conversion loss. The training process of the label conversion model can refer to the subsequent embodiments, and the comparison is not specifically limited in this specification.
[0041] Figure 2 A schematic diagram showing an application example of this specification is shown, Figure 2 As shown, the source domain label Y of the source domain data s Input the label conversion model to obtain the simulated label Y of the target domain data R, the simulated label Y R Input the feature generation model to obtain the simulated feature X of the target domain data R , according to the simulation feature X R and the target domain feature X T , construct a conversion loss, and use the conversion loss to train the label conversion model.
[0042] Through steps S102-S106, parameter learning of the label conversion model of the target domain can be completed to obtain a trained label conversion model.
[0043] In the embodiment of the present specification, the first source domain label of the first merchant in the source domain data is converted into the first simulated label of the first merchant in the target domain data through the label conversion model, and then the first simulated feature of the first merchant in the target domain data is obtained, and the label conversion model is trained through the difference between the first simulated feature and the target domain feature. This process is based on the mutual independence of the label distribution and the feature distribution, and converts the loss function of the label conversion model from the comparison between two labels (the first simulated label and the real label) to the comparison between two features (the first simulated feature and the target domain feature), which effectively reduces the difficulty of implementing the label conversion model training process and improves the accuracy of the merchant label output by the trained label conversion model, thereby effectively avoiding the serious decline in the effect indicators of the credit risk model obtained by using the merchant label after going online.
[0044] Figure 3 A schematic diagram of the application scenario of a model training method is provided, such as Figure 3 As shown, the credit risk model server 201 sends a model training command to the label conversion model training server 302. After receiving the model training command, the label conversion model training server 302 reads the source domain data and the target domain data in the first database 303, and uses the model training method in this specification to train the label conversion model. After the training is completed, the training result can be returned to the credit risk model server 301, and the trained label conversion model can be stored in the second database 304. Then, the credit risk model server 301 can read the trained label conversion model from the second database 304, use the trained label conversion model to obtain the merchant label in the target domain data, train the credit risk model through the merchant label, and use the trained credit risk model to predict the credit risk of the target merchant sent by the client 305, and return the prediction result to the client 305.
[0045] In one implementation, the model training method further includes:
[0046] Inputting a first source domain label of a first merchant into a trained label conversion model to obtain a second simulated label of the first merchant;
[0047] According to the second simulation label and the target domain feature, a credit risk model for determining whether to issue funds to a merchant is trained to obtain a trained credit risk model.
[0048] The label conversion model obtained by the above-mentioned model training method can be used for the training of the credit risk model. Specifically, the first source domain label of the first merchant in the source domain data can be input into the trained label conversion model, and the label conversion model will determine the second simulated label of the first merchant in the target domain data based on the first source domain label, and the second simulated label is closer to the first source domain label of the first merchant in the target domain data than the first simulated label.
[0049] Furthermore, the second simulated label and the target domain feature may be used to train a credit risk model. Figure 4 Figure 2 shows a schematic diagram of the reasoning process of the trained label conversion model. Figure 4 As shown, the source domain label Y s Input the trained label conversion model to obtain the simulated label Y of the target domain R , and then you can use the analog tag Y R Train the credit risk model.
[0050] Since the label conversion model can obtain labels that are closer to the real labels of merchants in the target domain data, the credit risk model trained using the second simulated labels output by the trained label conversion model is a credit risk model with smaller deviations. This can solve the problem of serious attenuation of the credit risk model after it goes online due to label distribution migration.
[0051] In one implementation, determining a conversion loss corresponding to the label conversion model based on the first simulation feature and the target domain feature of the first merchant in the target domain data includes:
[0052] For the first merchant, determining a first real distribution of the target domain feature and a first simulated distribution of the first simulated feature respectively;
[0053] Based on a difference between the first true distribution and the first simulated distribution, a conversion loss is determined.
[0054] The first real distribution is the feature distribution of the target domain feature in the first merchant, and the first simulated distribution is the feature distribution of the first simulated feature in the first merchant. Specifically, the difference between the target domain feature and the first simulated feature can be determined by the difference between the distributions corresponding to the two, that is, it can be determined by the gap between the first real distribution and the first simulated distribution. In one implementation, based on the gap between the first real distribution and the first simulated distribution, determining the conversion loss includes:
[0055] constructing a distance function between the first true distribution and the second simulated distribution;
[0056] Based on the distance function, the conversion loss is determined.
[0057] The present specification does not specifically limit the measurement method of the difference between the first real distribution and the first simulated distribution, which can be determined according to the actual situation. The distance function can be a measurement function such as JS divergence, IPM (Integral Probability Metrics) distance, MMD (Maximum mean discrepancy) distance or Wasserstein distance to measure the distance between different distributions such as the first real distribution corresponding to the target domain feature and the first simulated distribution corresponding to the first simulated feature. Figure 2 As shown, the target domain feature X R The corresponding distribution and the true characteristics of the target domain X T Corresponding to the distribution, a distribution distance function is constructed, and the label conversion model is trained by minimizing the distribution distance function.
[0058] In one implementation, the model training method further includes:
[0059] Discriminate the truth or falsity of the first simulation feature to obtain a first discrimination result, and generate a first discrimination loss according to the first discrimination result;
[0060] The label conversion model is trained according to the conversion loss to obtain the trained label conversion model, including:
[0061] According to the first discriminant loss and the conversion loss, the feature generation model and the label conversion model are jointly trained to obtain the trained feature generation model and label conversion model.
[0062] Generative Adversarial Network (GAN) is one of the hot research directions in the field of machine learning. The model usually includes at least two modules: a generative model and a discriminative model. The generative model is used to generate new data, and the new data is as real as possible. The discriminative network is used to judge whether the new data comes from a real sample set or a fake sample set. The mutual game learning between the generative model and the discriminative model can produce quite good output.
[0063] In one example, the label conversion model can be regarded as a generative model in a generative adversarial network, and the feature generation model can be regarded as a discriminative model in a generative adversarial network. Through the joint training of the feature generation model and the label conversion model, the stability and robustness of the feature generation model and the label conversion model can be improved at the same time. Specifically, in addition to the conversion loss of the label conversion model, a first discrimination result corresponding to the label conversion model can also be constructed, and the first discrimination result is obtained based on the true and false discrimination of the first simulated feature output by the feature generation model.
[0064] Furthermore, the feature generation model and the label conversion model can be jointly trained in the manner of training a generative adversarial network by using a total loss that includes the first discriminant loss and the conversion loss.
[0065] In the above distance functions, JS divergence (Jensen-Shannon divergence) conforms to symmetry and can be used to measure the difference between two different distributions. At the same time, since the target domain data and the source domain data have overlapping first merchant related data, the problem of gradient disappearance caused by using JS divergence can be effectively avoided. Therefore, in the process of joint training, JS divergence can be used as a distance function to improve the effect of joint training.
[0066] In one implementation, before using the feature generation model to obtain the first simulation feature, the model training method includes:
[0067] The feature generation model is initially trained using the second source domain label and source domain features of the second merchant in the source domain data to obtain the feature generation model after initial training.
[0068] The second merchant is part of the merchants in the source domain data. The relationship between the first merchant and the second merchant is not specifically limited in this specification and can be determined according to actual conditions. For example, the first merchant can be the same as or different from the second merchant, that is, the second merchant can be a merchant that exists in the source domain data but does not exist in the target domain data.
[0069] Before using the feature generation model, the feature generation model may be initially trained to obtain a feature generation model capable of generating features based on labels. In one implementation, the feature generation model includes a generation network and a discriminant network, and the feature generation model is initially trained using the second source domain label and source domain features of the second merchant in the source domain data to obtain the initially trained feature generation model, including:
[0070] Inputting the second source domain label and the random vector into the generation network to obtain a second simulated feature;
[0071] Inputting the second simulated feature into the discrimination network to obtain a second discrimination result for discriminating the authenticity of the second simulated feature;
[0072] The feature generation model is initially trained according to the second discrimination result and the second simulation feature to obtain the feature generation model after the initial training.
[0073] Specifically, the feature generation model can be set as an adversarial generation network, that is, a generation network and a discriminant network are set in the feature generation model, the generation network generates features corresponding to the labels, and the discriminant network discriminates the generated features. In addition to the aforementioned second source domain labels, the input data of the generation network can also include random vectors, the role of which is to introduce randomness so that the generation network can generate diversified, non-deterministic outputs (i.e., second simulated features); the loss corresponding to the discriminant network is a second discriminant loss constructed based on the second discriminant result, and the second discriminant result is the result of discriminating the authenticity of the second simulated feature output by the discriminant network.
[0074] The training process of the feature generation model includes the training of the generation network and the training of the discriminant network. Through the confrontation between the generation network and the discriminant network, the feature generation model can generate a first simulated feature with higher accuracy based on the first simulated label, so that the label conversion model trained by the first simulated feature can output a simulated label with higher accuracy.
[0075] In one implementation, initially training the feature generation model according to the second discrimination result and the second simulation feature to obtain the initially trained feature generation model includes:
[0076] According to the second discrimination result, generating a second discrimination loss;
[0077] For the second merchant, determining a second simulated distribution corresponding to the second simulated feature and a second real distribution corresponding to the source domain feature;
[0078] According to the difference between the second real distribution and the second simulated distribution, the distribution loss corresponding to the generated network is obtained;
[0079] The feature generation model is initially trained according to the second discriminant loss and the distribution loss to obtain the feature generation model after initial training.
[0080] The second real distribution is the feature distribution of the source domain features in the second merchant, and the second simulated distribution is the feature distribution of the second simulated features in the second merchant.
[0081] Since the training process of the feature generation model mainly includes the training of the generation network and the training of the discriminant network, the loss function of the feature generation model may include two parts: the loss corresponding to the generation network and the loss corresponding to the discriminant network. Similar to the aforementioned method of determining the difference between the first simulated feature and the target domain feature, a distribution loss may be constructed based on the difference between the second simulated distribution corresponding to the second simulated feature and the second true distribution corresponding to the source domain feature to train the feature generation model.
[0082] Furthermore, the initial training (i.e., adversarial training) of the feature generation model can be completed based on the total loss constructed by the second discriminant loss and the distribution loss.
[0083] In one example, the initial training and the aforementioned joint training can be combined, that is, the feature generation network is firstly initially trained to obtain a feature generation model with better performance, and then the feature generation model and the label conversion model are jointly trained to further improve the effect of the feature generation model, while also improving the effect of the label conversion model.
[0084] It should be noted that the execution subject of the model training method provided in the embodiments of this specification may be a model training device, or a control module in the model training device for executing the model training method. In the embodiments of this specification, the model training device provided in the embodiments of this specification is described by taking the model training method executed by the model training device as an example.
[0085] Figure 5 Schematic diagram of the structure of the device for model training according to an embodiment of the present invention. Figure 5 As shown, the model training device 500 includes:
[0086] An acquisition module 510 is used to acquire source domain data with business labels and target domain data without business labels, wherein the target domain data and the source domain data include feature data of the business;
[0087] A conversion module 520, configured to input a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of a first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data;
[0088] A generating module 530, configured to generate a first simulated feature of a first merchant in the target domain data through a feature generation model based on the first simulated tag;
[0089] The training module 540 is used to determine the conversion loss corresponding to the label conversion model based on the first simulation feature and the target domain feature of the first merchant in the target domain data, and train the label conversion model according to the conversion loss to obtain a trained label conversion model.
[0090] In one embodiment, the training module 540 includes:
[0091] a distribution unit, configured to determine, for a first merchant, a first real distribution of a target domain feature and a first simulated distribution of a first simulated feature;
[0092] The loss unit is used to determine the conversion loss based on the gap between the first real distribution and the first simulated distribution.
[0093] In one embodiment, the model training apparatus 500 further includes:
[0094] A discrimination module, used for discriminating the authenticity of the first simulation feature, obtaining a first discrimination result, and generating a first discrimination loss according to the first discrimination result;
[0095] The label conversion model is trained according to the conversion loss to obtain the trained label conversion model, including:
[0096] According to the first discriminant loss and the conversion loss, the feature generation model and the label conversion model are jointly trained to obtain the trained feature generation model and label conversion model.
[0097] In one embodiment, the loss unit is used to:
[0098] Constructing a distance function between the first true distribution and the first simulated distribution, the distance function at least including JS divergence;
[0099] Based on the distance function, the conversion loss is determined.
[0100] In one embodiment, the model training apparatus 500 includes:
[0101] The initial training module is used to perform initial training on the feature generation model using the second source domain label and source domain features of the second merchant in the source domain data before using the feature generation model to obtain the first simulated features, so as to obtain the feature generation model after initial training, wherein the second merchant is some of the merchants in the source domain data.
[0102] In one embodiment, the feature generation model includes a generation network and a discriminant network, and an initial training module includes:
[0103] A generation unit, used for inputting a second source domain label and a random vector into a generation network to obtain a second simulation feature;
[0104] A discrimination unit, used for inputting the second simulation feature into the discrimination network to obtain a second discrimination result for discriminating the authenticity of the second simulation feature;
[0105] The training unit is used to perform initial training on the feature generation model according to the second discrimination result and the second simulation feature to obtain the feature generation model after initial training.
[0106] In one embodiment, the training unit is used to:
[0107] According to the second discrimination result, generating a second discrimination loss;
[0108] For the second merchant, determining a second simulated distribution corresponding to the second simulated feature and a second real distribution corresponding to the source domain feature;
[0109] According to the difference between the second real distribution and the second simulated distribution, the distribution loss corresponding to the generated network is obtained;
[0110] The feature generation model is initially trained according to the second discriminant loss and the distribution loss to obtain the feature generation model after initial training.
[0111] It should be noted that the embodiments of the device for model training in this specification and the embodiments of the method for model training in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0112] Each module in the above-mentioned model training device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the terminal device or the processor on the server side in the form of hardware, or can be stored in the memory in the terminal device or the memory on the server side in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0113] Further, corresponding to the above-described model training method, based on the same technical concept, one or more embodiments of this specification also provide an electronic device, which is used to execute the above-described model training method. Figure 6 A schematic diagram of the structure of an electronic device provided for one or more embodiments of this specification.
[0114] Based on the same idea, one or more embodiments of this specification also provide an electronic device, such as Figure 6As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 601 and memory 602, and the memory 602 may store one or more storage applications or data. Among them, the memory 602 can be a temporary storage or a permanent storage. The application stored in the memory 602 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 601 can be configured to communicate with the memory 602 to execute a series of computer executable instructions in the memory 602 on the electronic device. The electronic device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input and output interfaces 605, and one or more keyboards 606.
[0115] In a specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs configured to be executed by one or more processors include the following computer executable instructions:
[0116] Acquire source domain data with merchants tagged and target domain data without merchants tagged, wherein the target domain data and the source domain data include characteristic data of the merchants;
[0117] Inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of a first merchant in the target domain data, where the first merchant is a merchant included in both the target domain data and the source domain data;
[0118] Based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model;
[0119] Based on the first simulation feature and the target domain feature of the first merchant in the target domain data, a conversion loss corresponding to the label conversion model is determined, and the label conversion model is trained according to the conversion loss to obtain a trained label conversion model.
[0120] It should be noted that the embodiments of the electronic device in this specification and the embodiments of the model training method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0121] Furthermore, corresponding to the model training method described above, based on the same technical concept, one or more embodiments of this specification further provide a storage medium for storing computer executable instructions. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instructions stored in the storage medium are executed by the processor, the following process can be implemented:
[0122] Acquire source domain data with merchants tagged and target domain data without merchants tagged, wherein the target domain data and the source domain data include characteristic data of the merchants;
[0123] Inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of a first merchant in the target domain data, where the first merchant is a merchant included in both the target domain data and the source domain data;
[0124] Based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model;
[0125] Based on the first simulation feature and the target domain feature of the first merchant in the target domain data, a conversion loss corresponding to the label conversion model is determined, and the label conversion model is trained according to the conversion loss to obtain a trained label conversion model.
[0126] It should be noted that the embodiment of the storage medium in this specification and the method of model training in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0127] Furthermore, corresponding to the above-described model training method, based on the same technical concept, one or more embodiments of this specification further provide a computer program product, which includes a computer program. When the computer program is executed by a processor, the following process can be implemented:
[0128] Acquire source domain data with merchants tagged and target domain data without merchants tagged, wherein the target domain data and the source domain data include characteristic data of the merchants;
[0129] Inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of a first merchant in the target domain data, where the first merchant is a merchant included in both the target domain data and the source domain data;
[0130] Based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model;
[0131] Based on the first simulation feature and the target domain feature of the first merchant in the target domain data, a conversion loss corresponding to the label conversion model is determined, and the label conversion model is trained according to the conversion loss to obtain a trained label conversion model.
[0132] It should be noted that the embodiment of the computer program product in this specification and the embodiment of the model training method in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the corresponding model training method mentioned above, and the repeated parts will not be repeated.
[0133] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0134] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. 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 in 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 such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, 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 are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0135] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, 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 a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0136] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0137] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing the embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0138] It should be understood by those skilled in the art that one or more embodiments of this specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may 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.) containing computer-usable program code.
[0139] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0140] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0142] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0143] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0144] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. 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 technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk 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 temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0145] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0146] One or more embodiments of the present specification may 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 the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0147] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0148] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. A model training method, comprising: Acquire source domain data with business labels marked and target domain data without business labels marked, wherein the target domain data and the source domain data include feature data of the business; Inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data; Based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model; Based on the first simulation feature and the target domain feature of the first merchant in the target domain data, a conversion loss corresponding to the label conversion model is determined, and the label conversion model is trained according to the conversion loss to obtain a trained label conversion model.
2. The method according to claim 1, wherein determining the conversion loss corresponding to the label conversion model based on the first simulation feature and the target domain feature of the first merchant in the target domain data comprises: For the first merchant, determining a first real distribution of the target domain feature and a first simulated distribution of the first simulated feature respectively; The conversion loss is determined based on a difference between the first real distribution and the first simulated distribution.
3. The method according to claim 2, further comprising: discriminating the authenticity of the first simulation feature to obtain a first discrimination result, and generating a first discrimination loss according to the first discrimination result; The step of training the label conversion model according to the conversion loss to obtain a trained label conversion model includes: The feature generation model and the label conversion model are jointly trained according to the first discriminant loss and the conversion loss to obtain a trained feature generation model and label conversion model.
4. The method according to claim 3, wherein determining the conversion loss based on the gap between the first real distribution and the first simulated distribution comprises: constructing a distance function between the first real distribution and the first simulated distribution, wherein the distance function at least includes a JS divergence; The conversion loss is determined based on the distance function.
5. The method according to claim 1, before using the feature generation model to obtain the first simulation feature, the method comprises: The feature generation model is initially trained using the second source domain label and source domain features of the second merchant in the source domain data to obtain the feature generation model after initial training, wherein the second merchant is part of the merchants in the source domain data.
6. The method according to claim 5, wherein the feature generation model comprises a generation network and a discriminant network, and the step of using the second source domain label and source domain features of the second merchant in the source domain data to initially train the feature generation model to obtain the initially trained feature generation model comprises: Inputting the second source domain label and the random vector into the generation network to obtain the second simulation feature; Inputting the second simulated feature into the discrimination network to obtain a second discrimination result for discriminating the authenticity of the second simulated feature; The feature generation model is initially trained according to the second discrimination result and the second simulation feature to obtain a feature generation model after initial training.
7. The method according to claim 6, wherein the initial training of the feature generation model is performed based on the second discrimination result and the second simulation feature to obtain the feature generation model after the initial training, comprising: According to the second discrimination result, generating a second discrimination loss; For the second merchant, determining a second simulated distribution corresponding to the second simulated feature and a second real distribution corresponding to the source domain feature; Obtaining a distribution loss corresponding to the generated network according to a difference between the second real distribution and the second simulated distribution; The feature generation model is initially trained according to the second discriminant loss and the distribution loss to obtain a feature generation model after initial training.
8. The method according to claim 1, further comprising: Inputting the first source domain label of the first merchant into the trained label conversion model to obtain a second simulated label of the first merchant; A credit risk model for determining whether to issue funds to a merchant is trained according to the second simulation label and the target domain feature to obtain a trained credit risk model.
9. A model training device, comprising: An acquisition module, used to acquire source domain data with business labels and target domain data without business labels, wherein the target domain data and the source domain data include feature data of the business; a conversion module, configured to input a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data; A generating module, configured to generate, based on the first simulated tag, a first simulated feature of the first merchant in the target domain data through a feature generation model; A training module is used to determine the conversion loss corresponding to the label conversion model based on the first simulation feature and the target domain feature of the first merchant in the target domain data, and train the label conversion model according to the conversion loss to obtain a trained label conversion model.
10. An electronic device, comprising: processor, and a memory arranged to store computer executable instructions which, when executed, cause the processor to: Acquire source domain data with business labels marked and target domain data without business labels marked, wherein the target domain data and the source domain data include feature data of the business; Inputting a first source domain label of a first merchant in the source domain data into a label conversion model to obtain a first simulated label of the first merchant in the target domain data, wherein the first merchant is a merchant included in both the target domain data and the source domain data; Based on the first simulated label, generating a first simulated feature of the first merchant in the target domain data through a feature generation model; Based on the first simulation feature and the target domain feature of the first merchant in the target domain data, a conversion loss corresponding to the label conversion model is determined, and the label conversion model is trained according to the conversion loss to obtain a trained label conversion model.
