Service risk control method, model training method, medium and electronic equipment
By constructing a risk control model to screen the top sample set and minimizing the first loss, the head identification capability of the risk identification model was optimized, the accuracy of identifying risky users in the top user group was improved, and interference with normal users was reduced.
Patent Information
- Application Number
- CN202511336757.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2026-01-02
AI Technical Summary
Existing risk identification models perform poorly in the fields of financial risk control and anti-fraud, resulting in low accuracy in intervening resources in actual risk control scenarios due to poor recall and capture rates for top user groups.
By constructing a risk control model, the model input data is built based on the user data to be detected, and the risk probability prediction value is obtained through the risk control model. The head sample set is screened out, and the first loss is calculated using the first ratio and the second ratio. The risk control model is trained to minimize the first loss and optimize the head recognition capability.
It improves the accuracy of identifying high-risk users among top user groups, reduces disturbance to normal users, and optimizes the balance between risk control efficiency and user experience.
Smart Images

Figure CN121256554A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to one or more embodiments in the field of artificial intelligence technology, and in particular to a business risk control, model training method, medium and electronic device. Background Technology
[0002] In the fields of financial risk control and anti-fraud, the top 1%, 5%, or 10% of users with the highest risk scores in model predictions are often referred to as the "head." These users represent the highest-risk individuals identified and are the most likely targets for intervention by risk control strategies (such as transaction blocking, manual review, and credit limit restrictions). Because the intervention resources available in actual risk control operations (such as manual review resources and the acceptable level of disruption to users) have strict limits, risk control strategies can typically only cover this limited group of head users. Therefore, the accuracy of head identification is crucial: it directly determines whether, with limited intervention resources, the largest proportion of real risks (such as fraudulent transactions and bad debt users) can be accurately located and captured. Improving head identification capabilities means significantly increasing the risk recall rate with the same level of disruption, or significantly reducing false positives against normal users while achieving the same risk control objectives, thereby optimizing the balance between risk control efficiency and user experience.
[0003] However, while existing risk identification models may have good overall discrimination (i.e., the ability to distinguish between normal users and fraudulent users in the entire user group), they often perform poorly in terms of recall or capture rates for the top user groups. As a result, in actual risk control scenarios where intervention resources are limited, the accuracy of intervention actions against risky users in the top user groups is low. Summary of the Invention
[0004] In view of the above, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a business risk control method is proposed, comprising:
[0006] Obtain the data of the user to be tested;
[0007] Based on the user data to be detected, model input data is constructed and transmitted to a pre-trained risk control model. During training, the risk control model predicts the risk probability of each user sample and outputs a corresponding predicted risk value. The user samples are sorted based on their predicted risk values, and a predetermined proportion of these user samples form a head sample set. Each user sample set includes both black sample and white sample user data. The proportion of black sample user data in the head sample set relative to all black sample user data is a first ratio, and the proportion of white sample user data in the head sample set relative to all white sample user data is a second ratio. The first loss during training is calculated from the first and second ratios, and the larger the first ratio is compared to the second ratio, the smaller the first loss.
[0008] Receive the risk probability prediction value of the user data to be detected returned by the risk control model, and perform business risk control based on the risk probability prediction value.
[0009] According to a second aspect of one or more embodiments of this specification, a model training method is proposed, comprising:
[0010] Acquire user data for each sample; the user data for each sample includes: black sample user data and white sample user data;
[0011] For each sample user data, sample input data is constructed based on the sample user data, the sample input data is transmitted to the risk control model to be trained, and the risk probability prediction value of the sample user data output by the risk control model to be trained is received.
[0012] Based on the predicted risk probability values, the sample user data are sorted, and a predetermined proportion of the sample user data at the top of the sorted data is selected as the head sample set. A first loss is determined based on a first ratio of black sample user data to all black sample user data in the head sample set, and a second ratio of white sample user data to all white sample user data in the head sample set. The larger the first ratio is compared to the second ratio, the smaller the first loss.
[0013] The risk control model to be trained is trained with the goal of minimizing the first loss, and the trained risk control model is obtained.
[0014] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor executes the executable instructions to implement the steps of the model training method described above.
[0015] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the model training method described above.
[0016] According to a fifth aspect of one or more embodiments of this specification, a computer program product is provided, comprising a computer program / instructions that, when executed by a processor, implement the steps of the model training method described above.
[0017] As can be seen from the above embodiments, this specification first obtains the user data to be detected, constructs model input data based on the user data to be detected, transmits the model input data to a pre-trained risk control model, receives the risk probability prediction value of the user data to be detected returned by the risk control model, and performs business risk control based on the risk probability prediction value. During training, the risk control model is used to predict the sample input data constructed from each sample user data and output the corresponding risk probability prediction value. Each sample user data is sorted based on the magnitude of the corresponding risk probability prediction value. The sample user data at the top of the sorted list constitutes a head sample set. Each sample user data set includes black sample user data and white sample user data. The proportion of black sample user data in the head sample set to all black sample user data is the first ratio, and the proportion of white sample user data in the head sample set to all white sample user data is the second ratio. The first loss of the risk control model during training is calculated from the first ratio and the second ratio, and the larger the first ratio is compared to the second ratio, the smaller the first loss.
[0018] In this method, a first loss can be determined based on the first ratio of black sample user data to all black sample user data in the head sample set, and the second ratio of white sample user data to all white sample user data in the head sample set. Then, the risk control model to be trained can be trained with minimizing the first loss as the training objective. This results in the risk control model identifying as many black sample user data as possible in the head sample set and as few white sample user data as possible. This improves the accuracy of the risk control model in identifying risky users in the head user group, thereby improving the accuracy of intervention actions applied to risky users and reducing disturbance to normal users. Attached Figure Description
[0019] Figure 1This is a flowchart illustrating a business risk control method provided in an exemplary embodiment.
[0020] Figure 2 This is a schematic diagram of a first loss determination method provided in an exemplary embodiment.
[0021] Figure 3 This is a flowchart illustrating a modeling method provided in an exemplary embodiment.
[0022] Figure 4 This is a schematic structural diagram of a device provided in an exemplary embodiment.
[0023] Figure 5 This is a schematic diagram of a business risk control device provided in an exemplary embodiment.
[0024] Figure 6 This is a schematic diagram of a model training apparatus provided in an exemplary embodiment. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0026] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0027] Currently, due to the strict upper limit on the intervention resources that can be invested in actual risk control operations, when conducting risk control on users, risk control is often only carried out on the top small group of users with the highest risk scores (e.g., the top 1%, 5%, or 10%), i.e., the "top" user group.
[0028] However, existing risk identification models often focus on distinguishing all users as a whole during training. As mentioned above, in risk identification fields such as financial risk control and anti-fraud, the ability of risk identification models to differentiate between risky and normal users within non-top user groups is relatively less important. Instead, the focus is more on the model's ability to differentiate between risky and normal users within top user groups. This allows for risk intervention based on the model's output, enabling risk control of risky users while minimizing disruption to normal users. Therefore, existing risk identification models are insufficient to meet the needs of these risk identification fields.
[0029] Based on this, this specification provides a business risk control method. The technical solutions provided by each embodiment of this specification are described in detail below with reference to the accompanying drawings.
[0030] Figure 1 This is a flowchart illustrating a business risk control method provided in an exemplary embodiment, including:
[0031] S100: Obtain data of the user to be tested.
[0032] S102: Construct model input data based on the user data to be detected, and transmit the model input data to the pre-trained risk control model; wherein, during the training process, the risk control model is used to predict the sample input data constructed from each sample user data and output the corresponding risk probability prediction value, and each sample user data is sorted based on the magnitude of the corresponding risk probability prediction value, and the sample user data at the top of the sorted list constitutes a head sample set; each sample user data includes black sample user data and white sample user data, the proportion of black sample user data in the head sample set to all black sample user data is a first ratio, the proportion of white sample user data in the head sample set to all white sample user data is a second ratio, the first loss of the risk control model during the training process is calculated from the first ratio and the second ratio, and the larger the first ratio is compared with the second ratio, the smaller the first loss is.
[0033] In this specification, the executing entity used to implement the business risk control method can refer to a designated device set up in the business platform, such as a server, or a terminal device such as a desktop computer or a laptop computer. For ease of description, the following will only use the server as the executing entity to explain the business risk control method provided in this specification.
[0034] Specifically, the server can acquire user data to be detected, construct model input data based on the user data to be detected, and then transmit the model input data to a pre-trained risk control model to obtain the risk probability prediction value of the user data to be detected through the risk control model, and perform business risk control based on the risk probability prediction value.
[0035] The user data to be tested can be determined according to actual needs, such as user attribute data (e.g., identity authentication information, device environment information, historical associated risk records, etc.) and behavioral data (e.g., current business behavior data, historical business behavior data, etc.).
[0036] There are several methods for constructing model input data based on the user data to be detected. For example, the server can preprocess the acquired user data to be detected to obtain preprocessed structured data, and then convert the preprocessed structured data into an input format that the model can directly process (such as numerical vectors, tensors, etc.) to obtain model input data.
[0037] For example, the server can also perform processing on the acquired user data to be detected, such as standardization, normalization, binning, and one-hot encoding, to obtain the model input data.
[0038] The risk probability prediction value of the user data to be detected obtained by the server through the above risk control model can be used to characterize whether the user corresponding to the user data to be detected is a risky user, or to characterize whether the business behavior corresponding to the user data to be detected is a risky business behavior, etc.
[0039] It should be noted that the above risk control model can only be deployed to the server for business risk control after it has been trained. The training method of the above risk control model is explained in detail below:
[0040] Specifically, in this specification, the server may use the collected historical user data as sample user data, which includes at least a portion of black sample user data and at least a portion of white sample user data. Here, black sample user data may refer to user data identified as high-risk.
[0041] Furthermore, the server can construct sample input data based on each sample user data, transmit the sample input data to the risk control model to be trained, and receive the risk probability prediction value of the sample user data output by the risk control model to be trained.
[0042] After obtaining the risk probability prediction value of each sample user data output by the risk control model to be trained, the server can determine the order of each sample user data according to the magnitude of the risk probability prediction value of each sample user data. Then, according to the preset ratio and the order of each sample user data, the server can select the head sample set from each sample user data.
[0043] The aforementioned preset ratio can be set according to actual needs, for example: the first 3%.
[0044] At this point, the server can select the top 3% of the sample user data based on the preset ratio and the order of the sample user data, and use this as the head sample set.
[0045] Furthermore, the server can determine the number of black sample user data points and the number of white sample user data points in the selected header sample set. Then, based on the first ratio of black sample user data points in the header sample set to the total number of black sample user data points (i.e., the ratio between the number of black sample user data points in the header sample set and the number of black sample user data points in each sample user data set), and the second ratio of white sample user data points in the header sample set to the total number of white sample user data points (i.e., the ratio between the number of white sample user data points in the header sample set and the number of white sample user data points in each sample user data set), the first loss can be determined. See the following formula for details:
[0046] -λ(CDF α (bad)-CDF α (good)
[0047] In the above formula, λ is a hyperparameter that can be set according to actual needs. CDF α (bad) represents the first ratio, where α is a preset ratio corresponding to the head sample set, such as 3%, CDF. α (good) is the second ratio.
[0048] As can be seen from the above, the larger the first ratio is compared to the second ratio, the smaller the determined first loss is.
[0049] In practical applications, there can be multiple preset ratios, and the business platform may have different levels of acceptance for the misjudgment rate of the top user groups belonging to different preset ratios. For example, the acceptance of the misjudgment rate of sample user data with the determined risk probability prediction value in the top 1% may be greater than the acceptance of the misjudgment rate of sample user data with the determined risk probability prediction value in the top 3%.
[0050] Therefore, the server can also, for each preset ratio, select a head sample set that meets the preset ratio from each sample user data according to the preset ratio and the order of each sample user data. Then, for each head sample set, the server can determine the first sub-loss corresponding to the head sample set based on the difference between the first ratio of black sample user data in the head sample set to the total black sample user data and the second ratio of white sample user data in the head sample set to the total white sample user data. Finally, the server can fuse the first sub-loss corresponding to each head sample set according to the weight coefficient corresponding to each preset ratio to obtain the first loss.
[0051] In practical applications, the aforementioned black sample user data can also include black sample user data with different risk types, such as black sample user data with identity fraud risk, black sample user data with account theft risk, and black sample user data with malicious and illegal promotional content. Furthermore, business platforms have varying levels of acceptance regarding the misjudgment rate of top user groups involving different risk types.
[0052] Based on this, the server can also determine the ratio of sample user data belonging to that risk type in the head sample set to all sample user data belonging to that risk type in the sample user data of different risk types, and the ratio of other sample user data in the head sample set to all sample user data not belonging to that risk type, for each risk type of sample user data in the black sample user data. Then, the first sub-loss corresponding to the sample user data of that risk type can be determined, and the first sub-losses can be merged to obtain the first loss.
[0053] In addition, the server can determine the ratio of sample user data belonging to that risk type in the header sample set to all sample user data belonging to that risk type within the black sample user data of different risk types. This ratio, along with the ratio of white sample user data in the header sample set to all white sample user data, determines the first sub-loss corresponding to that risk type of sample user data. These first sub-losses can then be merged to obtain the first loss. Specifically, as follows... Figure 2 As shown.
[0054] Figure 2 This is a schematic diagram of a first loss determination method provided in an exemplary embodiment.
[0055] Combination Figure 2 As can be seen, the server can determine the first sub-loss corresponding to the sample user data belonging to risk type A based on the ratio of black sample user data belonging to risk type A in the head sample set to all black sample user data belonging to risk type A, and the ratio of white sample user data in the head sample set to all white sample user data.
[0056] For user sample data belonging to risk type B, the first sub-loss is determined based on the ratio of black sample user data belonging to risk type B to all black sample user data belonging to risk type B in the head sample set, and the ratio of white sample user data to all white sample user data in the head sample set. Similarly, the server can determine the first sub-loss for black sample user data belonging to risk type A, the first sub-loss for black sample user data belonging to risk type B, and the first sub-loss for user sample data belonging to other risk types. These first sub-losses can then be merged to obtain the first loss.
[0057] The server can fuse the aforementioned first sub-losses to obtain the first loss by fusing the first sub-losses corresponding to sample user data of different risk types according to the preset weight coefficients for different risk types.
[0058] In this specification, after determining the first loss, the server can train the risk control model to be trained with minimizing the first loss as the training objective, so as to obtain the trained risk control model.
[0059] It is worth noting that the first sub-loss corresponding to different head sample sets and the first sub-loss corresponding to different risk types identified above can be used individually to obtain the first loss of the risk control model, or they can be used together to obtain the first loss of the risk control model.
[0060] Specifically, the server can also determine the first sub-loss corresponding to the sample user data of different risk types determined by the header sample set for each header sample set, based on the sample user data corresponding to different risk types contained in the header sample set. Then, based on the weight coefficients corresponding to each header sample set and the weight coefficients corresponding to each risk type, the first sub-losses can be fused to obtain the first loss.
[0061] As can be seen from the above, the server can determine the first loss based on the first ratio of black sample user data to all black sample user data in the head sample set, and the second ratio of white sample user data to all white sample user data in the head sample set. Then, the risk control model to be trained can be trained with minimizing the first loss as the training objective. This will maximize the number of black sample user data and minimize the number of white sample user data in the head sample set identified by the risk control model to be trained. This will improve the accuracy of intervention actions against risky users in the head user group and reduce the disturbance to normal users.
[0062] It should be noted that the risk control model to be trained mentioned above can be a pre-trained risk control model. Then, based on the first loss mentioned above, the pre-trained risk control model can be trained to improve the head recognition capability of the pre-trained risk control model.
[0063] In practical applications, the aforementioned risk control model to be trained can also be an untrained risk control model. In this case, to ensure the global judgment capability of the risk control model, the server can also determine a second loss based on the difference between the predicted risk probability value and the true labels of the sample user data. The training objective is then to minimize both the first and second losses, thus obtaining the trained risk control model.
[0064] The greater the difference between the predicted risk probability value and the actual label of the sample user data, the greater the determined second loss.
[0065] In the above content, the server trains the risk control model to obtain the trained risk control model by minimizing the first loss and the second loss as the training objective. There are several methods for this, such as fusing the first and second losses to obtain a comprehensive loss, and then using minimizing this comprehensive loss as the training objective to train the risk control model to obtain the trained risk control model. See the following formula for details:
[0066] loss head =loss ce -λ(CDF α (bad)-CDF α (good)
[0067] In the above formula, loss ce This is the second loss, loss head This is the total loss.
[0068] In practical applications, if a strong head constraint is imposed on the risk control model at the initial stage of training, as described above, the risk control model may have difficulty converging during training. Therefore, the server can also fuse the first loss and the second loss according to the dynamic weight coefficients corresponding to the first loss and the second loss to obtain a comprehensive loss. Then, the risk control model is trained with the goal of minimizing the comprehensive loss, and the trained risk control model is obtained.
[0069] Among them, the dynamic weight coefficient corresponding to the first loss mentioned above increases with the increase of training rounds.
[0070] S104: Receive the risk probability prediction value of the user data to be detected returned by the risk control model, and perform business risk control based on the risk probability prediction value.
[0071] Furthermore, the server can receive the risk probability prediction value of the user data to be detected returned by the risk control model, and can intervene in the business behavior of the user to be detected in accordance with the preset risk control strategy when it is determined that the risk probability prediction value exceeds the preset risk threshold.
[0072] Among these methods, the servers mentioned above can use various approaches to conduct business risk control based on risk probability predictions, such as freezing accounts, terminating transactions, two-factor authentication, and manual review.
[0073] As can be seen from the above, the server can determine the first loss based on the first ratio of black sample user data to all black sample user data in the head sample set, and the second ratio of white sample user data to all white sample user data in the head sample set. It can also determine the second loss based on the difference between the risk probability prediction value output by the risk control model and the true labels of the sample user data. Furthermore, the risk control model can be trained with the goal of minimizing both the first and second losses. This allows the risk control model to fit the global distribution of the sample user data while optimizing its head recognition ability. The trained risk control model should identify as many black sample user data points as possible and as few white sample user data points as possible in the head sample set. This improves the accuracy of intervention actions against risky users in the head user group (resulting in a 9.4% improvement in head recognition ability compared to a risk control model trained using a binary classification loss function) and reduces disturbance to normal users.
[0074] This specification also provides a model training method. The technical solutions provided by the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0075] Figure 3 This is a flowchart illustrating a modeling method provided in an exemplary embodiment, including:
[0076] S300: Obtain user data for each sample; the user data for each sample includes: black sample user data and white sample user data.
[0077] S302: For each sample user data, construct sample input data based on the sample user data, transmit the sample input data to the risk control model to be trained, and receive the risk probability prediction value of the sample user data output by the risk control model to be trained.
[0078] S304: Based on the magnitude of the predicted risk probability, sort the sample user data and select a preset proportion of the sample user data that are ranked first from the sample user data as the head sample set.
[0079] S306: Determine a first loss based on the first ratio of black sample user data in the head sample set to all black sample user data, and the second ratio of white sample user data in the head sample set to all white sample user data; wherein, the larger the first ratio is compared to the second ratio, the smaller the first loss is.
[0080] S308: The risk control model to be trained is trained with minimizing the first loss as the training objective to obtain the trained risk control model.
[0081] One method for the server to select the head sample set from each sample user data based on the predicted risk probability value is to determine the order of each sample user data according to the predicted risk probability value of each sample user data, and select the head sample set from each sample user data according to the preset ratio and the order of each sample user data.
[0082] There can be multiple preset ratios. In this case, the server can select the top-ranked head sample set that meets the preset ratio from each sample user data according to the preset ratio and the order of each sample user data. For each head sample set, the server determines the first sub-loss corresponding to the head sample set based on the difference between the first ratio of black sample user data in the head sample set to the total black sample user data and the second ratio of white sample user data in the head sample set to the total white sample user data. The server then merges the first sub-losses according to the weight coefficients corresponding to each preset ratio to obtain the first loss.
[0083] In addition to the above-mentioned black sample user data, the black sample user data also includes black sample user data of different risk types. At this time, the server can also determine the ratio of sample user data of that type in the head sample set to all sample user data of that type for each type of sample user data in the black sample user data and white sample user data of different risk types. For each type of sample user data, based on the ratio of sample user data of that type in the head sample set to all sample user data of that type, and the ratio of sample user data of other types in the head sample set to all sample user data of other types, the server determines the first sub-loss corresponding to the sample user data of that type and the sample user data of other types. The first sub-losses are then fused to obtain the first loss.
[0084] Furthermore, the server can determine a second loss based on the difference between the predicted risk probability value and the true labels of the sample user data. The training objective is to minimize the first and second losses and train the risk control model to obtain the trained risk control model.
[0085] The greater the difference between the predicted risk probability and the actual label of the sample user data, the greater the determined second loss.
[0086] Specifically, the server can fuse the first loss and the second loss according to the dynamic weight coefficients corresponding to the first loss and the second loss to obtain the comprehensive loss, and train the risk control model to be trained with minimizing the comprehensive loss as the training objective, so as to obtain the trained risk control model.
[0087] Among them, the dynamic weight coefficient corresponding to the first loss increases with the increase of training rounds.
[0088] As can be seen from the above, the server can determine the first loss based on the first ratio of black sample user data to all black sample user data in the head sample set, and the second ratio of white sample user data to all white sample user data in the head sample set. It can also determine the second loss based on the difference between the risk probability prediction value output by the risk control model and the true labels of the sample user data. Furthermore, the risk control model can be trained with the goal of minimizing both the first and second losses. This allows the risk control model to fit the global distribution of the sample user data while optimizing its head recognition ability. The trained risk control model should identify as many black sample user data points as possible and as few white sample user data points as possible in the head sample set. This improves the accuracy of intervention actions against risky users in the head user group (resulting in a 9.4% improvement in head recognition ability compared to a risk control model trained using a binary classification loss function) and reduces disturbance to normal users.
[0089] Figure 4 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 4At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, memory 408, and non-volatile memory 410, and may also include other hardware required for its functions. One or more embodiments of this specification can be implemented in software, for example, the processor 402 reads the corresponding computer program from the non-volatile memory 410 into memory 408 and then runs it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0090] Please refer to Figure 5 Business risk control devices can be applied to, for example Figure 4 The device shown is used to implement the technical solution of this specification. The model training device may include:
[0091] Module 501 is used to acquire data of the user to be detected;
[0092] Input module 502 is used to construct model input data based on the user data to be detected, and transmit the model input data to a pre-trained risk control model. During training, the risk control model predicts the sample input data constructed from each sample user data and outputs corresponding risk probability prediction values. Each sample user data is sorted based on the magnitude of its corresponding risk probability prediction value, and a predetermined proportion of the sample user data at the top of the sorted list constitutes a head sample set. Each sample user data includes black sample user data and white sample user data. The proportion of black sample user data in the head sample set to all black sample user data is a first ratio, and the proportion of white sample user data in the head sample set to all white sample user data is a second ratio. The first loss of the risk control model during training is calculated from the first ratio and the second ratio, and the larger the first ratio is compared to the second ratio, the smaller the first loss.
[0093] The risk control module 503 is used to receive the risk probability prediction value of the user data to be detected returned by the risk control model, and to perform business risk control based on the risk probability prediction value.
[0094] Optionally, when there are multiple preset ratios, there are multiple head sample sets, and different head sample sets are obtained based on different preset ratios; the first loss is obtained by fusing each first sub-loss, wherein each first sub-loss is calculated based on the first ratio and the second ratio of each head sample set.
[0095] Optionally, the second loss of the risk control model during the training process is calculated by the risk probability prediction value output by the risk control model for each sample input data during the training process and the real label of each sample user data. The greater the difference between each risk probability prediction value and each real label, the greater the second loss.
[0096] Optionally, the comprehensive loss of the risk control model during training is obtained by fusing the first loss and the second loss based on the dynamic weight coefficient corresponding to the first loss and the dynamic weight coefficient corresponding to the second loss; the dynamic weight coefficient corresponding to the first loss increases with the increase of training rounds.
[0097] Optionally, the black sample user data further includes: black sample user data of different risk types; the first loss is obtained by fusing each first sub-loss, wherein, for black sample user data of each risk type, the first sub-loss corresponding to the black sample user data of that risk type is determined based on the ratio of sample user data belonging to that risk type in the head sample set to all sample user data belonging to that risk type, and the ratio of other sample user data in the head sample set to all sample user data not belonging to that risk type.
[0098] Please refer to Figure 6 Model training devices can be applied to, for example Figure 4 The device shown is used to implement the technical solution of this specification. The model training device may include:
[0099] The sample acquisition module 601 is used to acquire user data for each sample; the user data for each sample includes: black sample user data and white sample user data.
[0100] The prediction module 602 is used to construct sample input data based on each sample user data, transmit the sample input data to the risk control model to be trained, and receive the risk probability prediction value of the sample user data output by the risk control model to be trained.
[0101] The determination module 603 is used to sort the sample user data according to the magnitude of the risk probability prediction value, and select a preset proportion of sample user data that are ranked first from the sample user data as the head sample set.
[0102] The loss determination module 604 is used to determine a first loss based on a first ratio of black sample user data in the head sample set to all black sample user data and a second ratio of white sample user data in the head sample set to all white sample user data; wherein, the larger the first ratio is compared to the second ratio, the smaller the first loss is.
[0103] The training module 605 is used to train the risk control model to be trained with minimizing the first loss as the training objective, so as to obtain the trained risk control model.
[0104] Optionally, the determining module 603 is specifically used to, when there are multiple preset ratios, select the head sample set that satisfies the preset ratio from each sample user data according to the preset ratio for each preset ratio.
[0105] The loss determination module 604 is specifically used to, for each head sample set, determine the first sub-loss corresponding to the head sample set based on the first ratio of black sample user data in the head sample set to the total black sample user data, and the second ratio of white sample user data in the head sample set to the total white sample user data; and fuse the first sub-losses according to the weight coefficients corresponding to each preset ratio to obtain the first loss.
[0106] Optionally, the loss determination module 604 is specifically used to determine a second loss based on the difference between the predicted risk probability value and the true label of the sample user data; wherein, the greater the difference between the predicted risk probability value and the true label of the sample user data, the greater the second loss; and to train the risk control model to be trained with minimizing the first loss and the second loss as the training objective, thereby obtaining the trained risk control model.
[0107] Optionally, the training module 605 is specifically used to: fuse the first loss and the second loss according to the dynamic weight coefficient corresponding to the first loss and the dynamic weight coefficient corresponding to the second loss to obtain a comprehensive loss; the dynamic weight coefficient corresponding to the first loss increases with the increase of training rounds; and train the risk control model to be trained with minimizing the comprehensive loss as the training objective to obtain the trained risk control model.
[0108] Optionally, the sample user data may further include: black sample user data of different risk types;
[0109] The loss determination module 604 is specifically used to: for each type of sample user data in the black sample user data and white sample user data of different risk types, determine the ratio of the sample user data belonging to that type in the head sample set to the total sample user data belonging to that type; for each type of sample user data, determine the first sub-loss corresponding to the sample user data of that type and the sample user data of the other types based on the ratio of the sample user data belonging to that type in the head sample set to the total sample user data of that type, and the ratio of the sample user data belonging to other types in the head sample set to the total sample user data of the other types; and fuse the first sub-losses to obtain the first loss.
[0110] Based on the same concept as the methods described above, this specification also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor performs the steps of the method as described in any of the above embodiments by executing the executable instructions.
[0111] Based on the same concept as the methods described above, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
[0112] Based on the same concept as the methods described above, this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
Claims
1. A business risk control method, comprising: Obtain the data of the user to be tested; Based on the user data to be detected, model input data is constructed and transmitted to a pre-trained risk control model. During training, the risk control model predicts the risk probability of each user sample and outputs a corresponding predicted risk value. The user samples are sorted based on their predicted risk values, and a predetermined proportion of these user samples form a head sample set. Each user sample set includes both black sample and white sample user data. The proportion of black sample user data in the head sample set relative to all black sample user data is a first ratio, and the proportion of white sample user data in the head sample set relative to all white sample user data is a second ratio. The first loss during training is calculated from the first and second ratios, and the larger the first ratio is compared to the second ratio, the smaller the first loss. Receive the risk probability prediction value of the user data to be detected returned by the risk control model, and perform business risk control based on the risk probability prediction value.
2. The method as described in claim 1, wherein when there are multiple preset ratios, there are multiple head sample sets, and different head sample sets are obtained based on different preset ratios; the first loss is obtained by fusing each first sub-loss, wherein, Different first sub-losses are calculated based on the first ratio and the second ratio determined based on different head sample sets.
3. The method as described in claim 1, wherein the second loss of the risk control model during the training process is calculated by the risk probability prediction value output by the risk control model for each sample input data during the training process and the real label of each sample user data, and the greater the difference between each risk probability prediction value and each real label, the greater the second loss.
4. The method as described in claim 3, wherein the comprehensive loss of the risk control model during training is obtained by fusing the first loss and the second loss based on the dynamic weight coefficients corresponding to the first loss and the second loss; wherein, The dynamic weight coefficient corresponding to the first loss increases with the increase of training rounds.
5. The method as described in claim 1, wherein the black sample user data further includes: Black sample user data for different risk types; The first loss is obtained by fusing the first sub-losses. For each type of black sample user data, the first sub-loss corresponding to the black sample user data of that risk type is determined based on the ratio of the sample user data belonging to that risk type in the head sample set to the total sample user data belonging to that risk type, and the ratio of other sample user data in the head sample set to the total sample user data not belonging to that risk type.
6. A model training method, comprising: Acquire user data for each sample; the user data for each sample includes: black sample user data and white sample user data; For each sample user data, sample input data is constructed based on the sample user data, the sample input data is transmitted to the risk control model to be trained, and the risk probability prediction value of the sample user data output by the risk control model to be trained is received. Based on the magnitude of the predicted risk probability, the sample user data is sorted, and a predetermined proportion of the sample user data at the top of the sorted data is selected as the head sample set. A first loss is determined based on a first ratio of black sample user data in the head sample set to all black sample user data, and a second ratio of white sample user data in the head sample set to all white sample user data; wherein, the larger the first ratio is compared to the second ratio, the smaller the first loss is. The risk control model to be trained is trained with the goal of minimizing the first loss, and the trained risk control model is obtained.
7. The method as described in claim 6, wherein selecting a head sample set from the sample user data based on the predicted risk probability value specifically includes: When there are multiple preset ratios, for each preset ratio, the head sample set that satisfies the preset ratio and is ranked first is selected from each sample user data according to the preset ratio. The first loss is determined based on the first ratio of black sample user data in the head sample set to the total black sample user data, and the second ratio of white sample user data in the head sample set to the total white sample user data, specifically including: For each head sample set, the first sub-loss corresponding to the head sample set is determined based on the first ratio of black sample user data in the head sample set to the total black sample user data, and the second ratio of white sample user data in the head sample set to the total white sample user data. Based on the weight coefficients corresponding to each preset ratio, the first sub-losses are fused together to obtain the first loss.
8. The method as described in claim 6, wherein minimizing the first loss is used as the training objective to train the risk control model to be trained, thereby obtaining the trained risk control model, specifically includes: A second loss is determined based on the difference between the predicted risk probability value and the actual labels of the sample user data; wherein, the greater the difference between the predicted risk probability value and the actual labels of the sample user data, the greater the second loss. The risk control model to be trained is trained with the goal of minimizing the first loss and the second loss, and the trained risk control model is obtained.
9. The method as described in claim 8, wherein minimizing the first loss and the second loss is used as the training objective to train the risk control model to be trained, thereby obtaining the trained risk control model, specifically includes: Based on the dynamic weight coefficients corresponding to the first loss and the second loss, the first loss and the second loss are fused together to obtain a comprehensive loss; The dynamic weight coefficient corresponding to the first loss increases with the increase of training rounds; The risk control model to be trained is trained with the goal of minimizing the overall loss, and the trained risk control model is obtained.
10. The method of claim 6, wherein the sample user data further comprises: Black sample user data for different risk types; The first loss is determined based on the first ratio of black sample user data in the head sample set to the total black sample user data, and the second ratio of white sample user data in the head sample set to the total white sample user data, specifically including: For each type of risk type of sample user data in the black sample user data of different risk types, the first sub-loss corresponding to the sample user data of that risk type is determined based on the ratio of the sample user data of that risk type in the head sample set to the total sample user data of that risk type, and the ratio of the other sample user data in the head sample set to the total sample user data of that risk type. The first sub-losses are combined to obtain the first loss.
11. An electronic device, comprising: processor; A memory for storing processor-executable instructions; wherein the processor implements the steps of the method as described in any one of claims 1-10 by executing the executable instructions.
12. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-10.
13. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-10.