Risk assessment model training method and device
Through multiple rounds of iteration and score distance adjustment methods, the prediction accuracy of the risk assessment model in the high-score part samples is improved, and the problem of difficulty in effectively intercepting high-risk users in the prior art is solved.
Patent Information
- Application Number
- CN202411972370.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The prior art is difficult to effectively improve the prediction accuracy of risk assessment models in high-score parts of samples, especially in key areas such as insurance fraud detection and bank withdrawal detection.
Through multiple iteration methods, the target sample set is obtained, the risk assessment model is used to process positive and negative example samples, the score distance between samples is calculated, and the model parameters are adjusted according to the score distance to improve the prediction accuracy of high-score partial samples.
It significantly improves the prediction accuracy of the model in high-score parts of the samples, effectively intercepts high-risk users, and reduces the problem of model overfitting and sparse positive samples.
Smart Images

Figure CN119904237A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of machine learning technology, and more particularly, to a method and device for training a risk assessment model. Background Art
[0002] As network technology becomes more and more popular, the risks in online transactions are also increasing. In order to effectively reduce high-risk transactions and strengthen market control, it is extremely important to conduct risk assessment on users.
[0003] In traditional technology, the goal of training risk assessment models is usually to improve the prediction accuracy of samples in all score segments predicted by the model. However, in key areas such as insurance fraud detection and bank withdrawal detection, it is usually necessary to focus on the samples with high scores predicted by the model (also called head samples), which correspond to high-risk users that need to be intercepted. In other words, it is necessary to improve the prediction accuracy of samples with high scores predicted by the model. Summary of the invention
[0004] One or more embodiments of this specification describe a method and device for training a risk assessment model, which can improve the prediction accuracy of samples with high scores predicted by the model.
[0005] In a first aspect, a method for training a risk assessment model is provided, comprising multiple rounds of iterations, wherein any t-th round of iterations comprises:
[0006] Obtain a target sample set, which includes a number of positive samples corresponding to risky users and a number of negative samples corresponding to normal users;
[0007] Using the risk assessment model to process each positive sample and each negative sample respectively, to obtain a predicted risk score for each positive sample and each negative sample;
[0008] For any target positive sample, based on the predicted risk scores of the target positive sample and the negative samples, and the interval parameters between the target positive sample and the negative samples, a target score distance between the target positive sample and the negative samples is obtained; the target score distance is negatively correlated with the interval parameters;
[0009] The parameters of the risk assessment model are adjusted according to the predicted risk scores and risk labels of the positive samples and the negative samples, and the score distances corresponding to the positive samples.
[0010] In a second aspect, a risk assessment model training device is provided, comprising:
[0011] An acquisition unit, used for acquiring a target sample set, which includes a number of positive samples corresponding to risky users and a number of negative samples corresponding to normal users;
[0012] A processing unit, used to process each positive sample and each negative sample respectively using the risk assessment model to obtain a predicted risk score for each positive sample and each negative sample;
[0013] The acquisition unit is further configured to acquire, for any target positive sample, a target score distance between the target positive sample and each negative sample based on the predicted risk scores of the target positive sample and each negative sample, and each interval parameter between the target positive sample and each negative sample; the target score distance is negatively correlated with each interval parameter;
[0014] The adjustment unit is used to adjust the parameters of the risk assessment model according to the predicted risk scores and risk labels of the positive samples and the negative samples, and the score distances corresponding to the positive samples.
[0015] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
[0016] In a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.
[0017] The training method and device of the risk assessment model provided by one or more embodiments of the present specification sets an interval parameter between positive and negative samples, and determines the score distance between the positive sample and each negative sample based on the interval parameter and the predicted risk score of each positive and negative sample. Then, the parameters of the risk assessment model are adjusted according to the score distance, thereby improving the prediction accuracy of the samples with high scores predicted by the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;
[0020] Figure 2A flow chart showing a method for training a risk assessment model according to an embodiment of the present specification is shown;
[0021] Figure 3 A schematic diagram showing a method for updating a supplementary sample set in an example of this specification;
[0022] Figure 4 A schematic diagram showing a method for updating a supplementary sample set in another example of the present specification;
[0023] Figure 5 A schematic diagram of a training device for a risk assessment model according to an embodiment of the present specification is shown. DETAILED DESCRIPTION
[0024] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0025] As mentioned above, in many scenarios, it is necessary to improve the prediction accuracy of the high-scoring samples predicted by the model (for example, the samples with the top k% risk scores, where k can be 1). However, these scenarios are usually characterized by extreme data imbalance, that is, the number of positive samples of interest is small, which makes it difficult to learn an effective model. In addition, excessive attention to a small number of positive samples may lead to overfitting.
[0026] At present, there are mainly two solutions to solve the problem of model training in sample imbalance scenarios.
[0027] First, the solution based on imbalanced learning: that is, to address the problem of imbalanced distribution of positive and negative samples, weight or sample the positive samples belonging to the minority class, or add corresponding regularization terms to the loss function by drawing on the ideas of ALM or RankReg. However, this solution is more focused on solving the problem of decreased global model effect caused by the imbalanced distribution of positive and negative samples. It does not optimize the prediction accuracy of the high-scoring samples predicted by the model, but mainly optimizes the global accuracy.
[0028] Second, the solution based on Partial-AUC optimization: PAUC defines the AUC within a certain false positive rate (FPR) range, and approximates the prediction accuracy of the high-scoring samples predicted by the model by limiting the higher FPR. However, since the actual calculation principle of FPR is to calculate the AUC for the k negative samples with the highest predicted risk scores, it may lead to over-penalization of the prediction results of some samples with good global rankings.
[0029] In view of the fact that the existing solutions cannot optimize the prediction accuracy of head samples well, the inventor of this solution proposes that the head optimization problem (i.e., improving the prediction accuracy of head samples) can be regarded as a constrained optimization problem (referred to as the constraint problem), in which the design of the constraint term ensures the effect of head optimization, and the objective function of the constraint problem is the classification loss function under the binary classification task. Then, the constraint term is multiplied to the objective function of the source constraint problem using the augmented Lagrange multiplier method to convert the constrained optimization problem into an unconstrained optimization problem. Finally, based on the unconstrained optimization problem, the risk assessment model is trained.
[0030] In order to determine the specific representation of the above constraints, the inventor of this solution analyzed several commonly used optimization indicators in binary classification tasks: Area Under Curve (AUC), Normalized Discounted Cumulative Gain (NDCG), etc.
[0031] Regarding the AUC indicator, its calculation formula is as follows:
[0032]
[0033] in, is the predicted risk score of the positive sample, is the predicted risk score of the negative sample, |N| is the number of negative samples, and |P| is the number of positive samples.
[0034] As can be seen from Formula 1, in the process of calculating the AUC indicator, equal attention will be paid to samples of all score segments predicted by the model, thereby improving the rankings of low-score positive samples and high-score positive samples, which will cause the loss function to decrease to the same extent. This is inconsistent with the head optimization goal of this solution.
[0035] Regarding the NDCG indicator, its calculation formula is as follows:
[0036]
[0037] Among them, rel(i) is the predicted risk score of the sample ranked in the i-th position.
[0038] It can be seen from Formula 2 that in the process of calculating the NDCG index, only the top k samples are considered, which is consistent with the head optimization goal of this scheme. For this reason, this scheme considers the NDCG index as a constraint item in the constraint problem.
[0039] It should be understood that in the binary classification task scenario, user samples are divided into positive samples and negative samples, where positive samples correspond to risky users. Therefore, in order to effectively intercept high-risk users, the optimization goal of this solution can be further limited to improving the prediction accuracy of head positive samples. In other words, this solution only needs to focus on the ranking of positive samples during the prediction process. However, the existing NDCG indicator may be affected by the ranking of all head samples (including positive samples and negative samples). Therefore, the existing NDCG indicator can be modified to the following form:
[0040]
[0041] Among them, P is the set of positive samples, rank(x + ) is the ranking of positive samples.
[0042] After determining the representation form of the constraint term (i.e., the modified NDCG shown in Formula 3), the constrained optimization problem of this scheme can be expressed as:
[0043] argminF(θ)
[0044]
[0045] Among them, F(θ) is the classification loss function, is the predicted risk score of the positive sample, is the predicted risk score of the negative sample, δ ij is the interval parameter of positive and negative samples, which is an adjustable hyperparameter that is adjusted accordingly with the difference of positive and negative samples.
[0046] It should be understood that the constraints in Formula 4 are equivalent expressions of the modified NDCG index, that is, satisfying the constraints in Formula 4 is equivalent to optimizing the modified NDCG index.
[0047] For the above constrained optimization problem, this solution can convert it into an unconstrained optimization problem based on the augmented Lagrange multiplier method, which can be specifically expressed as follows:
[0048]
[0049] Among them, F(θ) is the classification loss function, the second and third terms are two penalty terms. |N| is the number of negative samples, |P| is the number of positive samples, μ and λ i are predefined parameters, which are used to control the influence of the second and third terms on the overall loss function. i It can be expressed as the following formula:
[0050]
[0051] It should be noted that for the loss function shown in Formula 5, due to L i The calculation formula (i.e., Formula 6) contains the max operation, which makes the loss function a non-smooth non-convex function that cannot be directly optimized using the traditional stochastic gradient descent method. Therefore, this scheme uses the log(exp(sum(.))) function to approximate the max function, so that L i It can be expressed as:
[0052]
[0053] The following is an explanation of the proof process that Formula 7 can be used to replace Formula 6:
[0054]
[0055] Since the above formula 6 is an equivalent substitute for the modified NDCG, and formula 7 is derived based on formula 6, optimizing the above formula 7 is equivalent to optimizing the modified NDCG.
[0056] In summary, the above formula 5 is the final loss function obtained by adding the constraint term designed for the head optimization problem to the classification loss function under the binary classification task using the augmented Lagrange multiplier method. Therefore, by training the risk assessment model based on the final loss function shown in formula 5, it is possible to improve the prediction accuracy of the high-scoring samples predicted by the model.
[0057] In addition, since there is an imbalance problem of positive and negative samples in the risk user prediction scenario, that is, the number of positive samples corresponding to risky users is small, this solution proposes to pre-cache the target positive samples and target negative samples (this will be explained in detail later), and then in each round of training, the pre-cached samples are also added to the training to accelerate the convergence of the model.
[0058] The above is the inventive concept provided in this specification. Based on the inventive concept, the present solution can be implemented. The present solution is described in detail below.
[0059] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification. Figure 1In the target sample set, a number of positive samples corresponding to risky users and a number of negative samples corresponding to normal users are included. Specifically, each positive sample and each negative sample can be input into the risk assessment model respectively, so as to obtain the predicted risk score of each positive sample and each negative sample. In addition, each positive and negative sample pair can be input into the target prediction network to obtain the interval parameter between the positive sample and the negative sample in each positive and negative sample pair. Finally, the total loss can be calculated based on the predicted risk score of each positive sample and each negative sample, and the interval parameter between the positive sample and the negative sample in each positive and negative sample pair, and the parameters of the risk assessment model can be adjusted with the goal of minimizing the total loss.
[0060] It should be understood that Figure 1 This is just an exemplary description. In practice, the interval parameter between positive samples and negative samples can also be directly predicted by the risk assessment model without the need to add an additional target prediction network. This specification does not limit this.
[0061] Figure 2 The following is a flow chart of a method for training a risk assessment model according to an embodiment of the present specification. The method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. It should be noted that the method includes multiple rounds of iterations. Figure 2 The method steps included in the tth (t is a positive integer) iteration are shown. It can be understood that by repeatedly executing the steps shown therein, multiple rounds of iterative updates of the risk assessment model can be achieved, and then the risk assessment model updated in the last round can be used as the final risk assessment model. Figure 2 As shown, the method may include the following steps:
[0062] Step S202: obtaining a target sample set, which includes a number of positive samples corresponding to risky users and a number of negative samples corresponding to normal users.
[0063] Here, any user sample in the target sample set can be expressed as (x i ,y i ), where x i User characteristics of user samples, which may include but are not limited to interests, places of residence, network behavior preferences, etc. i is the risk label of the user sample, which is 0 or 1. Specifically, y i =1, it means that the user sample is a positive sample, and the corresponding risk label is a positive label. i =0, it means that the user sample is a negative sample, and the corresponding risk label is a negative label.
[0064] In this solution, the positive sample corresponds to the risk user, and the negative sample corresponds to the normal user. The risk user and the normal user here may refer to the insured users in various insurance scenarios (for example, health insurance, accident insurance, and travel insurance, etc.).
[0065] It should be understood that since the risk labels of the above user samples only include 0 and 1, the risk assessment model trained in this solution is a binary classification model, which is used to perform binary classification tasks.
[0066] In addition, as mentioned above, the number of positive samples in the risk user prediction scenario is small. In order to solve the problem of sparse positive samples, in each round of iteration, the supplementary sample set in the cache will be used to supplement the sample set of this round of iteration, so as to obtain the target sample set. Among them, the number of positive samples in the sample set of each round of iteration is less than the number of negative samples.
[0067] Each supplementary sample in the above-mentioned supplementary sample set can be determined based on the predicted risk score of the user sample in the previous round of sample set. For example, each supplementary sample includes, in the previous round of iteration, q positive samples with a low ranking in the corresponding predicted risk score. For another example, each supplementary sample includes, in the previous round of iteration, a number of positive samples with a corresponding predicted risk score less than a preset threshold, and a number of negative samples with a high ranking in the corresponding predicted risk score. In a more specific embodiment, the several negative samples are obtained by sampling, and the specific sampling method is described later.
[0068] Step S204: Use the risk assessment model to process each positive sample and each negative sample respectively to obtain a predicted risk score for each positive sample and each negative sample.
[0069] In one embodiment, the risk assessment model can be implemented as a tree model, a deep learning (DL) model or a Bayesian network model, etc. In a specific embodiment, the tree model can be a gradient boosting decision tree (GBDT), an ID3 classification tree or a C4.5 classification tree, etc.
[0070] In addition, each positive and negative sample pair in the target sample set can also be input into a target prediction network (e.g., a multi-layer perceptron MLP) to obtain an interval parameter between the positive sample and the negative sample in each positive and negative sample pair. In a specific embodiment, the interval parameter is a probability value between 0 and 1.
[0071] Of course, in practice, the interval parameters between the positive samples and the negative samples can also be directly predicted by the risk assessment model without the need to add an additional target prediction network, and this specification does not limit this.
[0072] Step S206, for any target positive sample, based on the predicted risk scores of the target positive sample and each negative sample, and each interval parameter between the target positive sample and each negative sample, obtain the target score distance between the target positive sample and each negative sample.
[0073] Among them, the target score distance is negatively correlated with each interval parameter.
[0074] Specifically, we can use the interval parameter δ between any negative sample j and the target positive sample i ij , determine the weight coefficient η of any negative sample j relative to the target positive sample i ij , the weight coefficient η ij With the interval parameter δ ij Positive correlation. Then, according to the weight coefficients of each negative sample relative to the target positive sample, the calculated values of the predicted risk score for each negative sample are weighted and summed to obtain the target sum value. Finally, the target score distance is determined according to the ratio of the target calculated value of the target predicted risk score for the target positive sample to the target sum value.
[0075] For any of the above negative sample j corresponding to the weight coefficient η ij , the calculation method may include, taking e as the base, and taking the interval parameter δ ij As power, perform power operation and get the operation value The calculated value Divide by the number of negative samples |N|, and use it as the weight coefficient η ij , which can be expressed as the following formula:
[0076]
[0077] Of course, in practice, Formula 8 may be modified in many ways, such as adding a constant term to the denominator, etc., and this specification does not limit this.
[0078] In addition, the fractional distance between the positive sample i and each negative sample can be determined according to the following formula:
[0079]
[0080] Among them, d i is the fractional distance between the positive sample i and each negative sample, is the predicted risk score of positive sample i, is the calculated value of the predicted risk score for the positive sample i; is the predicted risk score of negative sample j, is the calculated value of the predicted risk score for negative sample j, and |N| is the number of negative samples.
[0081] Of course, in practice, Formula 9 may be modified in many ways, for example, |N| may be replaced with other values, etc. This specification does not limit this.
[0082] It should be understood that the fractional distances corresponding to the positive samples can be obtained according to Formula 9.
[0083] Step S208, adjusting the parameters of the risk assessment model according to the predicted risk scores and risk labels of each positive sample and each negative sample, and the score distances corresponding to each positive sample.
[0084] Specifically, the first loss term can be calculated based on the predicted risk scores and risk labels of each positive sample and each negative sample; the first and second penalty terms can be determined based on the score distances corresponding to each positive sample. The first penalty term is determined based on the weighted sum of the opposite numbers of the score distances, and the second penalty term is determined based on the sum of the squares of the score distances. The first loss term, the first and second penalty terms are superimposed to obtain the total loss, and the parameters of the risk assessment model are adjusted with the goal of minimizing the total loss.
[0085] Regarding the above-mentioned first loss item, it can be calculated using the cross entropy loss function BCE based on the predicted risk score and positive label of each positive sample, and the predicted risk score and negative label of each negative sample.
[0086] Of course, in practical applications, the above cross entropy loss function can also be replaced by weighted binary cross entropy loss function WBCE, LDAM, etc.
[0087] In addition, taking any positive sample as an example, the inverse of the fractional distance corresponding to the positive sample can be expressed as Formula 7, and the above total loss can be expressed as Formula 5. Here, the total loss can be expressed as Formula 5 because d i =-L i ,and
[0088] It should be noted that in practice, Formula 5 can be modified in many ways. For example, other penalty terms can be added to the total loss. For another example, the constant term of the first penalty term can be removed. and the constant term of the second penalty term This specification does not limit this.
[0089] After the total loss is calculated, the back propagation method is used based on the total loss to calculate the update gradient of the parameters of the risk assessment model, and then the parameters of the risk assessment model are updated.
[0090] Of course, when the interval parameter between the positive sample and the negative sample is predicted by the target prediction network, the parameters of the target prediction network can also be adjusted with the goal of maximizing the total loss.
[0091] At this point, a round of iterative training of the risk assessment model has been completed.
[0092] It should be noted that in this solution, after completing a round (ie, the tth round) of iterative training and before entering the next round (ie, the t+1th round) of iteration, the supplementary sample set in the cache can be updated. The update process is described below.
[0093] Figure 3 A schematic diagram of a method for updating a supplementary sample set in an example of this specification is shown. Figure 3 In the example, each positive sample (indicated by a white box) in the target sample set can be ranked from high to low according to the predicted risk score, and q positive samples with the lowest predicted risk scores are selected from them, and the q positive samples are used to update the supplementary sample set. The predicted risk scores of the q positive samples here are usually less than 0.5.
[0094] That is to say, in this example, each supplementary sample in the supplementary sample set is a positive sample that is predicted incorrectly in each round of training. Therefore, on the one hand, the model can strengthen the learning of these misclassified positive samples, and on the other hand, it can alleviate the problem that the above two penalty items are ineffective due to the sparsity of positive samples.
[0095] It should be understood that in the first round of iterations, each supplementary sample in the supplementary sample set may be randomly sampled from all global positive samples.
[0096] Figure 4 A schematic diagram of a method for updating a supplementary sample set in another example of the present specification is shown. Figure 4 In the example, each positive sample whose corresponding predicted risk score is greater than a preset threshold (e.g., 0.5) can be removed from the supplementary sample set (i.e., the predicted correct positive sample is removed). Assume that the number of removed positive samples is the first number. Then, the negative samples (shown by the gray boxes) in the target sample set can be ranked from high to low according to the predicted risk score, and the first number of target negative samples can be sampled from the negative samples with the top ranking of the corresponding predicted risk score (e.g., the top k%, where k can be 1), and used to replace the removed positive samples.
[0097] Among them, the target sampling probability of any target negative sample among the top-ranked negative samples is the sum of the difficulties of distinguishing between the target negative sample and each positive sample, and the difficulty of distinguishing between the target negative sample and any positive sample is determined according to the interval parameter between the target negative sample and any positive sample, and the difficulty of distinguishing is negatively correlated with the interval parameter.
[0098] In a specific embodiment, the difficulty of distinguishing between positive samples and negative samples can be calculated according to the following formula:
[0099]
[0100] Among them, T ij is the difficulty of distinguishing between positive sample i and negative sample j, δ ij is the interval parameter between positive sample i and negative sample j, and |N| is the number of negative samples.
[0101] Of course, in practice, the first number of target negative samples may also be randomly sampled from the top-ranked negative samples, and this specification does not limit this.
[0102] It can be seen that in this example, each supplementary sample in the supplementary sample set is a positive sample and a difficult negative sample that are incorrectly predicted in each round of training. The reason why they are called difficult negative samples here is that the prediction risk score of the negative sample is high and it is difficult to distinguish it from the positive sample.
[0103] It should be understood that when the supplementary sample set in this example is used to supplement the sample set of each round, the predicted risk score of the negative sample can be suppressed and the problem of model overfitting can be prevented.
[0104] After updating and supplementing the sample set, the next round of iteration can be entered. In this way, after multiple rounds of iterations, the final risk assessment model can be obtained.
[0105] It should be noted that since the supplementary sample set in the cache is updated after each round of iteration, this solution actually adopts a dynamic cache mechanism.
[0106] It should also be noted that the risk assessment model trained by this solution can be applied to a variety of scenarios. For example, the risk assessment model can be used to predict risky users in insurance scenarios such as health insurance (including critical illness insurance and medical insurance) so that the predicted risky users can be intercepted and intervened.
[0107] In summary, the training method of the risk assessment model provided in the embodiment of this specification selects the modified NDCG indicator as the constraint item, and uses the augmented Lagrange multiplier method to convert it into a penalty item and add it to the classification loss function, thereby realizing explicit modeling of the head optimization problem in the binary classification task. In addition, the dynamic caching mechanism adopted in this scheme can ensure that there are sufficient positive samples to participate in the training during the model training process, alleviate the problem of excessive sparsity of positive samples, and prevent the problem of model overfitting. Finally, it has been proved by experiments that under the condition of setting the same head interception rate as the existing scheme, this scheme can identify more high-risk users.
[0108] Corresponding to the above-mentioned risk assessment model training method, an embodiment of the present specification also provides a risk assessment model training device, such as Figure 5 As shown, the device may include:
[0109] The acquisition unit 502 is used to acquire a target sample set, which includes a number of positive samples corresponding to risky users and a number of negative samples corresponding to normal users.
[0110] The processing unit 504 is used to process each positive sample and each negative sample respectively using the risk assessment model to obtain a predicted risk score for each positive sample and each negative sample.
[0111] The acquisition unit 502 is also used to obtain, for any target positive sample, a target score distance between the target positive sample and each negative sample based on the predicted risk scores of the target positive sample and each negative sample, and each interval parameter between the target positive sample and each negative sample, wherein the target score distance is negatively correlated with each interval parameter.
[0112] The adjustment unit 506 is used to adjust the parameters of the risk assessment model according to the predicted risk scores and risk labels of each positive sample and each negative sample, and the score distances corresponding to each positive sample.
[0113] In one embodiment, the acquisition unit 502 includes:
[0114] A determination submodule 5022 is used to determine, for any first negative sample, a first weight coefficient of the first negative sample according to a first interval parameter between the first negative sample and the target positive sample, wherein the first weight coefficient is positively correlated with the first interval parameter;
[0115] A summing submodule 5024 is used to perform weighted summation on the calculated values of the predicted risk scores of the negative samples according to the respective weight coefficients of the negative samples to obtain a target sum value;
[0116] The determination submodule 5022 is further configured to determine the target score distance according to the ratio of the target calculated value of the target predicted risk score for the target positive sample to the target sum value.
[0117] In a specific embodiment, the determination submodule 5022 is specifically used to:
[0118] Taking e as the base and the first interval parameter as the power, perform a power operation to obtain a first operation value;
[0119] The quotient of dividing the first operation value by the number of negative example samples is used as the first weight coefficient.
[0120] In one embodiment, the adjustment unit 506 includes:
[0121] A calculation submodule 5062, configured to calculate a first loss item based on the predicted risk scores and risk labels of each positive sample and each negative sample;
[0122] The calculation submodule 5062 is further used to determine the first and second penalty items based on the fractional distances corresponding to the positive samples; wherein the first penalty item is determined based on the weighted sum of the opposite numbers of the fractional distances, and the second penalty item is determined based on the sum of the squares of the fractional distances;
[0123] The superposition submodule 5064 is used to superimpose the first loss term, the first and second penalty terms to obtain a total loss, and adjust the parameters of the risk assessment model with the goal of minimizing the total loss.
[0124] In one embodiment, there is an interval parameter between each positive sample and each negative sample in the target sample set, and the interval parameter is predicted by a target prediction network;
[0125] The adjustment unit 506 is further used to adjust the parameters of the target prediction network with the goal of maximizing the total loss.
[0126] In one embodiment, the target sample set is obtained by merging the t-th round sample set with the supplementary sample set in the cache, and the above-mentioned apparatus further includes:
[0127] A selection unit 508 is used to select q positive samples with the lowest corresponding predicted risk scores from each positive sample in the target sample set;
[0128] The updating unit 510 is used to update the supplementary sample set using q positive samples for the next round of iteration.
[0129] In one embodiment, the target sample set is obtained by merging the t-th round sample set with the supplementary sample set in the cache; the device further comprises:
[0130] A removal unit 512 is used to remove each positive sample whose corresponding predicted risk score is greater than a preset threshold from the supplementary sample set, and replace it with each target negative sample in the target sample set to obtain an updated supplementary sample set for the next round of iteration;
[0131] Among them, each target negative sample is sampled from the negative samples with the highest predicted risk score.
[0132] In one embodiment, the target sampling probability of any target negative sample among the top-ranked negative samples is the sum of the difficulties of distinguishing between the target negative sample and each positive sample; the first difficulty of distinguishing between the target negative sample and any first positive sample is determined based on a first interval parameter between the target negative sample and the first positive sample; the first difficulty of distinguishing is negatively correlated with the first interval parameter.
[0133] In one embodiment, the number of positive samples in the t-th round sample set is less than the number of negative samples.
[0134] The functions of the functional modules of the device in the above-mentioned embodiment of this specification can be implemented through the steps of the above-mentioned method embodiment. Therefore, the specific working process of the device provided by one embodiment of this specification will not be repeated here.
[0135] A risk assessment model training device provided in one embodiment of the present specification can improve the prediction accuracy of samples with high scores predicted by the model.
[0136] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.
[0137] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described.
[0138] 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 medium or device 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.
[0139] 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.
[0140] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of this specification. It should be understood that the above description is only the specific implementation method of this specification and is not intended to limit the protection scope of this specification. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of this specification should be included in the protection scope of this specification.
Claims
1. A method for training a risk assessment model, comprising multiple rounds of iterations, wherein any t-th round of iterations comprises: Obtain a target sample set, which includes a number of positive samples corresponding to risky users and a number of negative samples corresponding to normal users; Using the risk assessment model to process each positive sample and each negative sample respectively, to obtain a predicted risk score for each positive sample and each negative sample; For any target positive sample, based on the predicted risk scores of the target positive sample and the negative samples, and the interval parameters between the target positive sample and the negative samples, a target score distance between the target positive sample and the negative samples is obtained; the target score distance is negatively correlated with the interval parameters; The parameters of the risk assessment model are adjusted according to the predicted risk scores and risk labels of the positive samples and the negative samples, and the score distances corresponding to the positive samples.
2. The method according to claim 1, wherein: The obtaining of a target score distance between the target positive sample and each of the negative samples includes: For any first negative sample, determining a first weight coefficient of the first negative sample according to a first interval parameter between the first negative sample and the target positive sample; the first weight coefficient is positively correlated with the first interval parameter; According to each weight coefficient of each negative example sample, weighted summation is performed on each calculated value of the predicted risk score for each negative example sample to obtain a target sum value; The target score distance is determined according to a ratio of a target calculated value of the target predicted risk score for the target positive sample to the target sum value.
3. The method according to claim 2, wherein: The determining of a first weight coefficient of the first negative example sample includes: Taking e as base and the first interval parameter as power, perform a power operation to obtain a first operation value; The quotient of dividing the first operation value by the number of the negative example samples is used as the first weight coefficient.
4. The method according to claim 1, wherein: The adjusting the parameters of the risk assessment model includes: Calculating a first loss item based on the predicted risk scores and risk labels of the positive samples and the negative samples; Based on the fractional distances corresponding to the positive samples, determining the first and second penalty items; wherein the first penalty item is determined based on the weighted sum of the opposite numbers of the fractional distances, and the second penalty item is determined based on the sum of the squares of the fractional distances; The first loss term, the first and second penalty terms are superimposed to obtain a total loss, and the parameters of the risk assessment model are adjusted with the goal of minimizing the total loss.
5. The method according to claim 4, wherein: There is an interval parameter between each positive sample and each negative sample in the target sample set, and the interval parameter is predicted by a target prediction network; the method further includes: The parameters of the target prediction network are adjusted with the goal of maximizing the total loss.
6. The method according to claim 1, wherein: The target sample set is obtained by merging the t-th round sample set with the supplementary sample set in the cache; the method further includes: From each positive sample in the target sample set, select q positive samples with the lowest corresponding predicted risk scores; The q positive samples are used to update the supplementary sample set for the next round of iteration.
7. The method according to claim 1, wherein: The target sample set is obtained by merging the t-th round sample set with the supplementary sample set in the cache; the method further includes: Removing each positive sample whose corresponding predicted risk score is greater than a preset threshold from the supplementary sample set, and replacing it with each target negative sample in the target sample set, to obtain an updated supplementary sample set for the next round of iteration; The target negative samples are obtained by sampling from the negative samples with the highest predicted risk scores.
8. The method according to claim 7, wherein: The target sampling probability of any target negative sample among the top-ranked negative samples is the sum of the difficulties of distinguishing between the target negative sample and the positive samples respectively; the first difficulty of distinguishing between the target negative sample and any first positive sample is determined according to a first interval parameter between the target negative sample and the first positive sample; the first difficulty of distinguishing is negatively correlated with the first interval parameter.
9. The method according to claim 6 or 7, wherein: The number of positive samples in the t-th round sample set is less than the number of negative samples.
10. A training device for a risk assessment model, comprising: An acquisition unit, used for acquiring a target sample set, which includes a number of positive samples corresponding to risky users and a number of negative samples corresponding to normal users; A processing unit, used to process each positive sample and each negative sample respectively using the risk assessment model to obtain a predicted risk score for each positive sample and each negative sample; The acquisition unit is further configured to acquire, for any target positive sample, a target score distance between the target positive sample and each negative sample based on the predicted risk scores of the target positive sample and each negative sample, and each interval parameter between the target positive sample and each negative sample; the target score distance is negatively correlated with each interval parameter; The adjustment unit is used to adjust the parameters of the risk assessment model according to the predicted risk scores and risk labels of the positive samples and the negative samples, and the score distances corresponding to the positive samples.
11. The device according to claim 10, wherein: The acquisition unit comprises: A determination submodule, configured to determine, for any first negative sample, a first weight coefficient of the first negative sample according to a first interval parameter between the first negative sample and the target positive sample; the first weight coefficient is positively correlated with the first interval parameter; A summing submodule, configured to perform weighted summation on the calculated values of the predicted risk scores of the negative samples according to the respective weight coefficients of the negative samples to obtain a target sum value; The determination submodule is further configured to determine the target score distance according to a ratio of a target calculated value of the target predicted risk score for the target positive sample to the target sum value.
12. The device according to claim 11, wherein The determination submodule is specifically used for: Taking e as base and the first interval parameter as power, perform a power operation to obtain a first operation value; The quotient of dividing the first operation value by the number of the negative example samples is used as the first weight coefficient.
13. The device according to claim 10, wherein: The adjustment unit comprises: A calculation submodule, configured to calculate a first loss item based on the predicted risk scores and risk labels of the positive samples and the negative samples; The calculation submodule is further used to determine a first and a second penalty term based on the fractional distances corresponding to the positive samples; wherein the first penalty term is determined based on a weighted sum of the opposite numbers of the fractional distances, and the second penalty term is determined based on a sum of the squares of the fractional distances; The superposition submodule is used to superimpose the first loss term and the first and second penalty terms to obtain a total loss, and adjust the parameters of the risk assessment model with the goal of minimizing the total loss.
14. The device according to claim 13, wherein: There is an interval parameter between each positive sample and each negative sample in the target sample set, and the interval parameter is predicted by a target prediction network; The adjustment unit is further used to adjust the parameters of the target prediction network with the goal of maximizing the total loss.
15. The device according to claim 10, wherein: The target sample set is obtained by merging the t-th round sample set with the supplementary sample set in the cache; the device also includes: A selection unit, configured to select, from each positive sample in the target sample set, q positive samples with the lowest corresponding predicted risk scores; An updating unit is used to update the supplementary sample set using the q positive samples for the next round of iteration.
16. The device according to claim 10, wherein: The target sample set is obtained by merging the t-th round sample set with the supplementary sample set in the cache; the device also includes: A removal unit, used to remove each positive sample whose corresponding predicted risk score is greater than a preset threshold from the supplementary sample set, and replace it with each target negative sample in the target sample set, to obtain an updated supplementary sample set for the next round of iteration; The target negative samples are obtained by sampling from the negative samples with the highest predicted risk scores.
17. The device according to claim 16, wherein: The target sampling probability of any target negative sample among the top-ranked negative samples is the sum of the difficulties of distinguishing between the target negative sample and the positive samples respectively; the first difficulty of distinguishing between the target negative sample and any first positive sample is determined according to a first interval parameter between the target negative sample and the first positive sample; the first difficulty of distinguishing is negatively correlated with the first interval parameter.
18. The device according to claim 15 or 16, wherein: The number of positive samples in the t-th round sample set is less than the number of negative samples.
19. A computer-readable storage medium having a computer program stored thereon, wherein: When the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 9.
20. 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 9 is implemented.
Citation Information
Patent Citations
Risk identification model training method and device for business object
CN112200488A
Method and device for training risk identification model
CN113191434A
Address matching model training method based on comparative learning
CN115455315A
Organization comprehensive risk evaluation method, electronic equipment and storage medium
CN116933274A
Method and device for training and predicting risk prediction model for multiple mechanisms
CN118822711A