A method, apparatus, and device for processing a model

By introducing a new loss function in the risk prevention and control of financial transactions, the problem of poor generalization performance of model under extreme imbalanced data sets is solved, and higher recognition effect and training stability are achieved.

CN119476972BActive Publication Date: 2025-06-27ANT ZHIXIN HANGZHOU INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510068082.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-06-27
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

In an extremely unbalanced training environment, existing loss functions may fail in classification scenarios, resulting in poor generalization performance of the model. Especially in the prevention and control of financial transaction risk, the imbalance between the number of positive sample data and negative sample data makes it difficult to train the model.

Method used

A new loss function is proposed to improve the generalization performance of the model by giving a small number of sample data high weight and including parameters for adjusting the proportion of the number of positive and negative sample data, and adaptively reducing the sensitivity of noise data and outliers to improve the generalization performance of the model.

Benefits of technology

This loss function can enable the model to learn more fully distributed information in extremely unbalanced tasks, improve the recognition effect, and improve the stability of the training results and the generalization performance of the model through the noise reduction mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476972B_ABST
    Figure CN119476972B_ABST
Patent Text Reader

Abstract

An embodiment of this specification discloses a method, apparatus, and device for processing a model. The method includes: obtaining target sample data for risk prevention and control of financial transactions, where the ratio between the number of positive sample data and the number of negative sample data in the target sample data is greater than a first preset threshold or less than a second preset threshold; inputting the target sample data into a risk prevention and control model for financial transactions to obtain a corresponding risk prevention and control result; based on the risk prevention and control result and the label information corresponding to the target sample data, determining the loss information corresponding to the target sample data through a preset loss function, the loss function being able to assign higher weights to sample data with a smaller quantity and including a first parameter for adjusting the ratio of the number of positive and negative sample data, and a second parameter for reducing the sensitivity to noise data and outliers; adjusting the model parameters in the risk prevention and control model based on the loss information corresponding to the target sample data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and in particular, to a method, apparatus, and device for processing a model. Background Art

[0002] Extremely imbalanced training environments dominate real-world learning tasks such as network intrusion detection, privacy leakage detection, privacy protection detection, and fraud detection. Training on extremely imbalanced datasets may lead to poor generalization performance of the model because the underrepresented minority classes introduce large variances.

[0003] Despite significant efforts to design many loss functions that are more suitable for imbalanced states, empirical evidence shows that most such designs occasionally fail in classification scenarios. Therefore, it makes sense to develop a principled framework for comparing different loss functions in imbalanced learning settings. To this end, there is a need to provide a more effective loss function under ultra-imbalanced classification (UIC) to improve the generalization performance of the model. Summary of the Invention

[0004] The purpose of the embodiments of this specification is to provide a more effective loss function under ultra-imbalanced classification (UIC) to improve the generalization performance of the model.

[0005] To achieve the above technical solution, the embodiments of this specification are implemented as follows:

[0006] A method for processing a model provided by the embodiments of this specification, the method includes: obtaining target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, through a preset loss function, determine the loss information corresponding to the target sample data, the loss function can give a weight higher than a third preset threshold to the sample data with a smaller number in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data and negative sample data at different orders of magnitude in different degrees, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model.

[0007] A processing device for a model provided by an embodiment of this specification, the device includes: a sample data acquisition module, which acquires target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. A prediction module, which inputs the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data. A loss determination module, which determines loss information corresponding to the target sample data through a preset loss function based on the risk prevention and control result and the label information corresponding to the target sample data, the loss function can give a weight higher than a third preset threshold to the sample data with a smaller number in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data and negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. A parameter adjustment module, which adjusts the model parameters in the risk prevention and control model based on the loss information corresponding to the target sample data to obtain a risk prevention and control model.

[0008] A processing device for a model provided by an embodiment of this specification, the model processing device includes: a processor; and a memory arranged to store computer-executable instructions, the executable instructions, when executed, cause the processor to: acquire target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data. Determine loss information corresponding to the target sample data through a preset loss function based on the risk prevention and control result and the label information corresponding to the target sample data, the loss function can give a weight higher than a third preset threshold to the sample data with a smaller number in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data and negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Adjust the model parameters in the risk prevention and control model based on the loss information corresponding to the target sample data to obtain a risk prevention and control model.

[0009] An embodiment of this specification also provides a storage medium for storing computer-executable instructions, and when the executable instructions are executed by a processor, the following process is implemented: Obtain target sample data for risk prevention and control of financial transactions, where the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller number among the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data to the number of negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model.

[0010] An embodiment of this specification also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the following process is implemented: Obtain target sample data for risk prevention and control of financial transactions, where the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller number among the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data to the number of negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model. Description of the Drawings

[0011] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings;

[0012] Figure 1 This is an embodiment of a method for processing a model in this specification;

[0013] Figure 2 This is a schematic diagram of a risk prevention and control page in this specification;

[0014] Figure 3 This is a schematic diagram of a linear classifier for loss function learning in this specification;

[0015] Figure 4 This is a schematic diagram of a linear classifier that learns from α-loss functions with different α in this specification;

[0016] Figure 5 This is a schematic diagram of the change in the AUC of a linear classifier in this specification;

[0017] Figure 6 This is a schematic diagram of the changes in ACC and AUC when the parameter C moves in this specification;

[0018] Figure 7 This is an embodiment of a device for processing a model in this specification;

[0019] Figure 8 This is an embodiment of a device for processing a model in this specification. Detailed implementation manners

[0020] The embodiments of this specification provide a method, device, and equipment for processing a model.

[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification in conjunction with the accompanying drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this specification.

[0022] Embodiments of this specification provide a new learning objective for Tunable Boosting Loss (TBL) under Ultra-Imbalanced Classification (UIC), which can prove to be resistant to data imbalance under UIC. Extremely imbalanced training environments dominate real-world learning tasks, such as network intrusion detection and fraud detection. Taking fraud detection as an example, the proportion of fraud cases can be as low as 1:106. Training on extremely imbalanced datasets may lead to poor generalization performance of the model because the underrepresented minority classes introduce large variances. However, even with a certain amount of sample data from the minority classes, challenges still exist. Specifically, classifiers learned through different loss functions perform differently. For example, generate a dataset from two normally distributed clusters, which contains 200 sample data of the minority class and 200,000 sample data of the majority class. In this case, although the number of sample data of the minority class is sufficient to learn a linear classifier, the following situation will occur: the classifier learned under the cross-entropy loss function ignores the variance information captured by the minority classes learned under the exponential loss function. At the same time, considerable efforts have been made to design loss functions that are more suitable for the imbalanced state than standard choices such as the cross-entropy loss function. Nevertheless, empirical evidence shows that most such designs occasionally fail in classification scenarios. Therefore, it makes sense to develop a principled framework for comparing different loss functions in imbalanced learning settings.

[0023] Currently, imbalanced classification mainly focuses on establishing theoretical guarantees for separable data for a small number of samples in a small class using parametric models. Although these analyses are well-connected with optimization and modern learning theory, this assumption may not conform to reality. For example, in the field of financial risk management (FRM), the imbalance of training data sometimes manifests as relatively rare, and there may be a large number of sample data in a small class. In this setting, the separability assumption is unlikely to hold. To address the above problems, the concept of ultra-imbalanced classification (UIC) is introduced from an overall perspective as an alternative formulation of imbalanced classification, which means that the prior probability that a sample belongs to a small class is restricted to zero. Under the UIC setting, insights can be drawn from information theory, and a principled framework is developed to compare different loss functions inspired by the idea of statistical information. An in-depth analysis of the behavior of common loss functions and loss functions customized for imbalanced problems is carried out. The results show that learning objectives such as focal loss and Polyloss do not significantly improve the cross-entropy loss function. For this reason, the embodiments of this specification introduce a new loss function as a new paradigm for studying imbalanced learning problems, where the concept of statistical information about certain losses is utilized, and the decay rate of the corresponding function is used as a measure to resist imbalance. Therefore, a systematic study of common learning objectives and some variants recently proposed in the imbalanced learning setting is carried out, showing that none of these variants provide substantial improvement to the cross-entropy objective. The embodiments of this specification propose a new learning objective based on a loss function that is effective under the comparison framework proposed under UIC, thereby improving the generalization performance of the model. The specific processing can refer to the specific content in the following embodiments.

[0024] As Figure 1 shown, the embodiments of this specification provide a processing method for a model. The execution subject of this method can be a terminal device or a server, etc. The terminal device can be a mobile terminal device such as a mobile phone or a tablet computer, or a computer device such as a laptop or a desktop computer, or it can also be an IoT device (specifically such as a smart watch or a vehicle-mounted device), etc. The server can be an independent server or a server cluster composed of multiple servers. The server can be a background server for financial services or online shopping services, etc., or it can also be a background server for a certain application program, etc. In this embodiment, the case where the execution subject is a server is taken as an example for detailed description. For the case where the execution subject is a terminal device, reference can be made to the case of the server described below, and details will not be repeated here. The method can specifically include the following steps:

[0025] In step S102, target sample data for risk prevention and control of financial transactions is obtained. The target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold.

[0026] Among them, the financial transaction can be a related transaction in the financial field. For example, it can be transactions involved in fund transfers, online shopping, payments, etc., which can be specifically set according to the actual situation and are not limited in the embodiments of this specification. The target sample data can be relevant historical data involved in financial transactions. The target sample data can include account information of both trading parties, transaction time, transaction location, transaction amount, transaction risk information (such as user complaint situations, etc.), commodity information of the transaction, etc., which can be specifically set according to the actual situation and are not limited in the embodiments of this specification. The positive sample data can be sample data without preset transaction risks, and the negative sample data can be sample data with preset transaction risks, etc. The preset transaction risks can be any one or more risks, such as fraud risk, illegal financial activity risk, privacy leakage risk, etc., which can be specifically set according to the actual situation and are not limited in the embodiments of this specification. The first preset threshold can be greater than the second preset threshold, and the first preset threshold and the second preset threshold can be set according to the actual situation. Specifically, for example, the first preset threshold is 100,000 or 1,000, and the second preset threshold can be 1 / 1,000 or 1 / 10,000, etc.

[0027] In implementation, in an extremely imbalanced training environment, the number of a certain type or multiple different types of sample data may be very small (insufficient to complete the training of the corresponding model), while the number of other types of sample data can be very large. In this way, there will be a situation where the number of positive sample data in the sample data set is much larger than the number of negative sample data or the number of negative sample data is much larger than the number of positive sample data, that is, the ratio between the number of positive sample data and the number of negative sample data in the sample data set is greater than the first preset threshold or less than the second preset threshold. That is, the number of positive sample data may be very large while the number of negative sample data is very small, or the number of positive sample data is very small while the number of negative sample data may be very large, etc. In order to train the risk prevention and control model for financial transactions, the target sample data for risk prevention and control of financial transactions can be obtained. The target sample data can be obtained through a variety of different methods. For example, each type of sample data can be obtained separately from a specified database, and it can be obtained according to a preset quantity. For example, the preset quantity of each type of sample data is 100,000. For sample data with a quantity less than 100,000, all sample data of this type included in the data can be obtained, or some sample data can also be selected (such as selecting 500 from 1,000, etc.), etc., which can be specifically set according to the actual situation.

[0028] Alternatively, it is also possible to obtain the historical business data related to financial transactions pre-recorded in the specified business server, and the recorded historical business data can be used as the target sample data. Then, the target sample data can be analyzed to determine the positive sample data and negative sample data contained therein, provided that the following relationship is satisfied between the positive sample data and the negative sample data: the ratio between the quantity of the positive sample data and the quantity of the negative sample data is greater than the first preset threshold or less than the second preset threshold.

[0029] Alternatively, it is also possible to crawl different types of relevant data for risk prevention and control of financial transactions from the Internet, and the obtained relevant data can be used as the target sample data. Then, the target sample data can be analyzed according to the actual situation to determine the positive sample data and negative sample data contained therein, provided that the following relationship is satisfied between the positive sample data and the negative sample data: the ratio between the quantity of the positive sample data and the quantity of the negative sample data is greater than the first preset threshold or less than the second preset threshold.

[0030] It should be noted that the negative sample data can be a certain type of sample data. Specifically, it can be sample data with fraud risk, etc. The negative sample data can also be multiple different types of sample data. Specifically, it can be sample data with fraud risk and sample data with illegal financial activity risk, etc. For the case where the negative sample data is multiple different types of sample data, the ratio between the quantity of the positive sample data and the quantity of the negative sample data can be the ratio between the quantity of the positive sample data and the quantity of a certain type of sample data among the multiple different types of sample data contained in the negative sample data, or the ratio between the quantity of the positive sample data and the total quantity of the multiple different types of sample data contained in the negative sample data, etc. It can be specifically set according to the actual situation, and the embodiments of this specification do not make any limitations in this regard.

[0031] The above are only optional implementation manners. In actual applications, it is also possible to obtain the target sample data for risk prevention and control of financial transactions through various different methods, and the ratio between the quantity of the positive sample data and the quantity of the negative sample data is greater than the first preset threshold or less than the second preset threshold. It can be specifically set according to the actual situation, and the embodiments of this specification do not make any limitations in this regard.

[0032] In step S104, the target sample data is input into the risk prevention and control model for financial transactions to obtain the risk prevention and control result corresponding to the target sample data.

[0033] Among them, the risk prevention and control model can be a model constructed according to a specified algorithm and / or network model. For example, the risk prevention and control model can be a model constructed through a specified neural network (such as a convolutional neural network, a recurrent neural network, etc.), or the risk prevention and control model can be a model constructed through BERT, or the risk prevention and control model can be a model constructed through a Transformer module, etc. In addition, the specified algorithm can include, for example, a clustering algorithm, a feature extraction algorithm, etc., and can be specifically set according to the actual situation. The risk prevention and control results can include various types. For example, there is a preset risk or there is no preset risk, or it can be the probability corresponding to each risk. The existence of a preset risk can be the existence of a certain type of risk, or the simultaneous existence of multiple different types of risks, etc., and can be specifically set according to the actual situation.

[0034] In implementation, an initial model architecture of the risk prevention and control model can be constructed through the above-mentioned specified algorithm and / or network model. Then, the obtained target sample data can be input into the constructed risk prevention and control model, and the target sample data can be processed through the specified algorithm and / or network in the risk prevention and control model to obtain the risk prevention and control result corresponding to the target sample data. Through the above method, risk prevention and control results corresponding to multiple different target sample data can be obtained.

[0035] In step S106, based on the risk prevention and control result and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined through a preset loss function.

[0036] Among them, the loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity among the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of the positive sample data and the negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to the noise data and outliers of the target sample data.

[0037] In implementation, in an extremely imbalanced training environment, the number of sample data of one or more categories is small, while the number of sample data of other categories is large, such that the number of sample data of other categories is much larger than the number of sample data of one or more categories, thereby resulting in an extremely imbalanced situation of sample data. For this reason, an adjustable boosting loss function under ultra-imbalanced classification (UIC) can be set, that is, the above-mentioned preset loss function. Through this loss function, higher weights can be given to the sample data with a smaller number among the positive sample data and the negative sample data. For example, if the number of positive sample data is much larger than the number of negative sample data, higher weights can be given to the negative sample data; if the number of negative sample data is much larger than the number of positive sample data, higher weights can be given to the positive sample data, etc. In addition, a first parameter can also be set in this loss function, and the first parameter can be adjusted according to the actual situation. By adjusting the first parameter, the ratio of the number of positive sample data to the number of negative sample data at different levels and different orders of magnitude can be adjusted. Additionally, a second parameter can also be set in this loss function, and the second parameter can be adjusted according to the actual situation. By adjusting the second parameter, the purpose of adaptively adjusting and reducing the sensitivity to the noise data and outliers of the target sample data can be achieved.

[0038] The risk prevention and control results and relevant information such as the label information corresponding to the target sample data can be substituted into the above-mentioned loss function, and calculations are performed through this loss function. During the calculation process, not only can higher weights than the third preset threshold be given to the sample data with a smaller number among the positive sample data and the negative sample data, but also by adjusting the first parameter and the second parameter, the ratio of the number of positive sample data to the number of negative sample data at different levels and different orders of magnitude can be adjusted respectively, and the sensitivity to the noise data and outliers of the target sample data can be adaptively adjusted and reduced. Finally, corresponding results can be obtained, and these results can be used as the loss information corresponding to the target sample data.

[0039] In step S108, based on the loss information corresponding to the target sample data, the model parameters in the risk prevention and control model are adjusted to obtain the risk prevention and control model.

[0040] In implementation, the model parameters in the risk prevention and control model can be adjusted according to the loss information corresponding to the target sample data to obtain an adjusted risk prevention and control model. The processing of the above steps S102 to step S108 can be repeated to train the risk prevention and control model with new target sample data. Finally, a trained risk prevention and control model can be obtained.

[0041] After passing through the above risk prevention and control model, the risk prevention and control model can be deployed in financial transactions in a specified business to perform risk prevention and control processing on financial transactions through the risk prevention and control model. In this way, through the above processing, a dedicated loss function that can be adjusted by hyperparameters is set for classification tasks with extremely imbalanced characteristics. This loss function can give a higher proportion of weights to sample data with extremely small proportions and extremely difficult classification (usually negative sample data), and there is no longer a limit on gradient contribution. Therefore, in extremely imbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to different degrees of imbalance ratios of positive and negative sample data in different tasks through hyperparameter selection, thereby improving the recognition effect of the model. Additionally, an additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adaptively adjust and reduce the sensitivity to noise data and outliers in sample data, improving the stability of training results.

[0042] An embodiment of this specification provides a method for processing a model. By obtaining target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for financial transactions to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, through a preset loss function, determine the loss information corresponding to the target sample data. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of the positive sample data and the negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model. In this way, a dedicated, hyperparameter-adjustable loss function is set for a classification task with extremely imbalanced characteristics. This loss function can give a higher proportion of weight to sample data with extremely small proportions and extremely difficult classification (usually negative sample data), and there is no longer a limit on gradient contribution. Therefore, in an extremely imbalanced task, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to different levels of different orders of magnitude of imbalance ratios between positive and negative sample data in different tasks through hyperparameter selection, thereby improving the recognition effect of the model. In addition, an additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adaptively adjust and reduce the sensitivity to noise data and outliers of the sample data, and improve the stability of the training result and the generalization performance of the model.

[0043] In practical applications, the specific processing method of the above step S108 can be various. Here is another optional processing method, which can specifically include the following: Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model, and based on the model parameters of the adjusted risk prevention and control model and the next target sample data, train the risk prevention and control model to continue to adjust the model parameters of the risk prevention and control model until the above loss function converges, and obtain a trained risk prevention and control model.

[0044] In practical applications, the risk prevention and control model can be deployed in financial transactions in a specified business to perform risk prevention and control processing on financial transactions through the risk prevention and control model. For specific details, refer to the processing of step A2 and step A4 below.

[0045] In step A2, a risk prevention and control request for a financial transaction is received, and the risk prevention and control request includes business data for the financial transaction.

[0046] Among them, the business data may include, for example, account information of both parties to the transaction, transaction time, transaction location, transaction amount, transaction risk information (or user complaint situation, etc.), commodity information of the transaction, etc., and can be specifically set according to the actual situation.

[0047] In implementation, as Figure 2 shown, when risk prevention and control needs to be carried out for a certain financial transaction, the user's terminal device can obtain the business data for the financial transaction, can generate a risk prevention and control request based on the business data, and send the risk prevention and control request to the server. At this time, the server can receive the risk prevention and control request for the financial transaction.

[0048] In step A4, the above-mentioned business data is input into the trained risk prevention and control model to obtain the risk prevention and control result corresponding to the risk prevention and control request.

[0049] In practical applications, the first preset threshold is 10000, or the second preset threshold is 1 / 10000.

[0050] In practical applications, the above loss function is a function constructed based on the α loss function.

[0051] Among them, the α loss function unifies common learning objectives such as cross-entropy and exponential loss with the hyperparameter α. When α < 1, the hyperparameter α controls the weight of the sample data with a smaller quantity in the positive sample data and the negative sample data. The α loss function is as follows

[0052]

[0053] Among them, represents the α loss function, represents the risk prevention and control result, represents the label information corresponding to the target sample data.

[0054] In implementation, assume that the ratio between the quantity of positive sample data and the quantity of negative sample data is 500:1, the quantity of negative sample data is 200, and the average value of two clusters in the positive sample data is set to , ,the average value of two clusters in the negative sample data is set to , ,the covariance of two clusters in the positive sample data is an identity matrix, and the covariance of the negative sample data is and ,then as Figure 3As shown (where the linear classifiers learned by the cross-entropy loss function, Focal Loss, multi-loss function, and vector-scaling loss function are represented by distinct vertical lines in the figure, with the red dots and cyan dots representing information of two different classification labels respectively, the red dots represented by 0 and the cyan dots represented by 1. For example, if the information of the two different classification labels is the presence of risk and the absence of risk respectively, then the red dot 0 can represent the presence of risk and the cyan dot 1 can represent the absence of risk, etc.), Focal Loss and its variants do not incorporate the covariance information of negative sample data. Similar to the cross-entropy loss function, this means that although they aim to re-weight the sample data to address the imbalance problem, they do not truly change the learned classifier under UIC. Specifically, Focal Loss, Poly Loss, etc. can essentially be understood as, based on the cross-entropy loss function, adjusting the weight distribution of sample data during model training according to the classification difficulty of the sample data, and giving higher weights to the more difficult-to-train sample data (with a lower probability of being correctly classified during training). However, the cross-entropy loss function sets an upper limit on the contribution (i.e., the norm of the gradient of the loss function with respect to this sample data) provided to the sample data during one gradient update process in model training. According to the theoretical analysis of statistical information, this limitation causes the deep neural network model to be unable to learn all the information of the negative sample data distribution through training in an extremely imbalanced training task, and the weight adjustment mechanisms of Focal Loss, Poly Loss, etc. cannot essentially solve the problems brought about by extreme imbalance.

[0055] On the other hand, as Figure 4 shown (by the linear classifiers learned from the α-loss functions with different α (i.e., α = 0.4, α = 0.5, α = 0.6, and α = 0.7), namely the linear classifier corresponding to the solid line with α = 0.4, the linear classifier corresponding to the dashed line with α = 0.5, the linear classifier corresponding to the thick short dashed line with α = 0.6, and the linear classifier corresponding to the sparse short dashed line with α = 0.7)), as α decreases, the linear classifier learned by the α-loss function is more inclined to the category with a smaller number (i.e., negative sample data). Further analyzing the α-loss function in this case, Figure 5 records the change in the AUC of the learned linear classifier when α moves. This curve is fitted by 12 α options. Among them, when α is around 0.4, the AUC reaches the highest value, indicating that a suitable hyperparameter α can be selected to optimize the AUC value. Based on this, a suitable hyperparameter α can be selected, and then a better α-loss function can be obtained. The above loss function can be constructed through the obtained better α-loss function.

[0056] In practical applications, the above loss function is a function constructed based on the α-loss function and a preset bounded penalty term.

[0057] In implementation, based on the above, under UIC, a smaller α in the α-loss function will emphasize the less numerous classes (i.e., negative sample data) more. However, the above processing comes at the cost of poor robustness to outliers. In particular, when α = 0.5, the α-loss function is the same as the exponential loss function, and its sensitivity to outliers has been fully discussed. To further analyze the robustness issue under general α, the influence analysis framework in robust statistics can be used for further analysis. It can be obtained that for smaller α values, the sample data with poor fitting has a greater impact on the learning parameters, resulting in the risk prevention and control model showing poor robustness. To solve this robustness trade-off problem of the risk prevention and control model, the above α-loss function can be improved, which can be called the Tunable Boosting Loss function (TBL). Among them, the observations with greater influence (i.e., the risk prevention and control results) can be directly penalized, and thus the corresponding bounded penalty term can be obtained. Based on this, the above loss function can be constructed based on the α-loss function and the preset bounded penalty term.

[0058] In practical applications, the above bounded penalty term is determined by the second parameter and the class probability corresponding to the preset risk.

[0059] In implementation, the Tunable Boosting Loss function (TBL) can be as follows

[0060]

[0061] where, denotes the Tunable Boosting Loss function (TBL), denotes the class probability corresponding to the preset risk, denotes the label information corresponding to the target sample data, C denotes the second parameter, and denotes the bounded penalty term, and the influence penalty degree of the bounded penalty term can be controlled by the second parameter C.

[0062] To verify the effectiveness of the above-mentioned Tunable Boosting Loss (TBL), the basic classification task can be regarded as a UIC problem for empirical evaluation: Two dataset sources can be used, and their summary statistics: Image datasets: For the binary classification tasks of CIFAR10, CIFAR-100, and Tiny ImageNet, in the main experimental comparison, for each image dataset, randomly select half of the classes as positive sample data and the other half as negative sample data. In the ablation study, use the datasets of "deer" and "horse" in CIFAR-10; Fraud detection datasets: Two industry-scale datasets collected from an online payment platform can be used. This task is a binary classification aiming to detect fraudsters among ordinary users using a rich set of features. The classifier learned using the Tunable Boosting Loss (TBL) is used as a benchmark and compared with the classifiers learned through the following objectives: Cross-entropy loss function with logit adjustment, LDAM (Label Distribution-Aware Margin) loss function, Focal loss function with logit adjustment, Poly loss function with logit adjustment, VS (Vector Scaling) loss function. All parameters involved in the experiment of the classifier learned using the Tunable Boosting Loss (TBL) were optimized using grid search. For the CIFAR-10, CIFAR-100, and Tiny ImageNet datasets, since their test sets are balanced, accuracy (ACC) and AUC can be used as evaluation metrics. For these two industrial datasets, set AUC and two metrics crucial for evaluating the FRM domain model: One-way partial AUC (opAUC), with a false positive rate upper bound of 0.01 and a recall rate of 0.001.

[0063] Based on the above experimental settings, the following results can be obtained:

[0064] As shown in Table 1 (experimental results of image datasets)

[0065] Table 1

[0066]

[0067] Among them, the Tunable Boosting Loss (TBL) always outperforms other methods in all cases, that is, from the relatively simple tasks in CIFAR-10 to the extremely difficult tasks in Tiny ImageNet. As the imbalance ratio (i.e., the ratio of the number of negative sample data to the number of positive sample data) decreases, the gain of the Tunable Boosting Loss (TBL) over the CE loss function also increases. There is no significant improvement in the CE loss under UIC on all selected datasets. The Tunable Boosting Loss (TBL) provides the ability to resist imbalance in the sense of a slower decay rate. Therefore, the empirical results are consistent with the theoretical framework we proposed.

[0068] As shown in Table 2 (Experimental results of the fraud detection dataset)

[0069] Table 2

[0070]

[0071] Among them, due to the strength of high-quality features, the above various methods all showed competitive performance under the AUC metric. The tunable boosting loss function (TBL) was slightly improved compared to the Fraud1 dataset. The performance difference between opAUC and the recall metric became more obvious. Under these two metrics, the tunable boosting loss function (TBL) had better overall performance and achieved dominant performance on the Fraud2 dataset. Necessity of introducing parameter C: An ablation study was conducted to study the parameter C that promotes robustness. We expected a trade-off phenomenon when adjusting the value of C. When ρ = 0.01, it was shown on the datasets of "deer" and "horse" in CIFAR-10, and ACC and AUC were used as evaluation metrics, as Figure 6 (Changes in ACC and AUC when parameter C moves. Among them, the horizontal axis represents the denoising parameter in the tunable boosting loss function (TBL), the solid line on the left and the vertical axis represent the results of the average precision, the dashed line on the right and the secondary vertical axis represent the results of AUC, and the shaded area reflects the standard error of the results). When C is approximately 0.3, both AUC and precision measurements reach the maximum value, far better than C = 0, which verifies that the denoising design is beneficial to the tunable boosting loss function (TBL).

[0072] In practical applications, the target sample data is historical data related to financial transactions. The target sample data includes the account information of both parties in the financial transaction and historical transaction data. Among them, the historical transaction data can include, for example, transaction time, transaction location, transaction amount, transaction risk information (or user complaint situation, etc.), transaction commodity information, etc., which can be specifically set according to the actual situation.

[0073] An embodiment of this specification provides a method for processing a model. By obtaining target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for financial transactions to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, through a preset loss function, determine the loss information corresponding to the target sample data. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of the positive sample data and the negative sample data at different orders of magnitude in different degrees, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for a classification task with extremely imbalanced characteristics. This loss function can give a higher proportion of weight to sample data with an extremely small proportion and extremely difficult classification (usually negative sample data), and there is no longer a limitation on gradient contribution. Therefore, in an extremely imbalanced task, the risk prevention and control model can learn more sufficient distribution information. In addition, this loss function can adapt to the imbalanced ratios of different orders of magnitude of positive and negative sample data in different tasks through hyperparameter selection, thereby improving the recognition effect of the model. In addition, an additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adaptively adjust and reduce the sensitivity to noise data and outliers of the sample data, and improve the stability of the training result.

[0074] The above is the method for processing a model provided by the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a model processing device, as Figure 7 shown.

[0075] The model processing device includes: a sample data acquisition module 701, a prediction module 702, a loss determination module 703, and a parameter adjustment module 704, where:

[0076] The sample data acquisition module 701 acquires target sample data for risk prevention and control of financial transactions. The target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold;

[0077] The prediction module 702 inputs the target sample data into the risk prevention and control model for the financial transaction to obtain the risk prevention and control result corresponding to the target sample data;

[0078] The loss determination module 703 determines the loss information corresponding to the target sample data based on the risk prevention and control result and the label information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of the positive sample data and the negative sample data at different orders of magnitude in different degrees, and a second parameter capable of adaptively adjusting and reducing the sensitivity to the noise data and outliers of the target sample data;

[0079] The parameter adjustment module 704 adjusts the model parameters in the risk prevention and control model based on the loss information corresponding to the target sample data to obtain a risk prevention and control model.

[0080] In the embodiments of this specification, the parameter adjustment module 704 adjusts the model parameters in the risk prevention and control model based on the loss information corresponding to the target sample data, and trains the risk prevention and control model based on the adjusted model parameters of the risk prevention and control model and the next target sample data to continue adjusting the model parameters of the risk prevention and control model until the loss function converges, and obtains a trained risk prevention and control model.

[0081] In the embodiments of this specification, the apparatus further includes:

[0082] The request module receives a risk prevention and control request for a financial transaction, and the risk prevention and control request includes business data for the financial transaction;

[0083] The risk prediction module inputs the business data into the trained risk prevention and control model to obtain the risk prevention and control result corresponding to the risk prevention and control request.

[0084] In the embodiments of this specification, the first preset threshold is 10000, or the second preset threshold is 1 / 10000.

[0085] In the embodiments of this specification, the loss function is based on a loss function constructed function.

[0086] In the embodiments of this specification, the loss function is based on a loss function and a preset bounded penalty term constructed function.

[0087] In the embodiments of this specification, the bounded penalty term is determined by the second parameter and the class probability corresponding to the preset risk.

[0088] In the embodiments of this specification, the target sample data is historical data related to financial transactions, and the target sample data includes account information of both parties to the financial transaction and historical transaction data.

[0089] The embodiments of this specification provide a processing device for a model. By obtaining target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for financial transactions to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity among the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of positive sample data and negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers in the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model. In this way, a dedicated, hyperparameter-adjustable loss function is set for a classification task with extremely imbalanced characteristics. This loss function can give a higher proportion of weight to sample data with extremely small proportions and extremely difficult classification (usually negative sample data), and there is no longer a limit on gradient contribution. Therefore, in an extremely imbalanced task, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalanced ratios of different orders of magnitude of positive and negative sample data in different tasks through hyperparameter selection, thereby improving the recognition effect of the model. Additionally, an additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adaptively adjust and reduce the sensitivity to noise data and outliers in the sample data, improving the stability of the training result.

[0090] The above is the processing device for the model provided by the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide a processing device for the model, as Figure 8 shown.

[0091] The processing device for the model may be a terminal device or a server provided in the above embodiments, etc.

[0092] The processing devices of the model can vary significantly due to different configurations or performances, and may include one or more processors 801 and a memory 802. One or more application programs or data may be stored in the memory 802. Among them, the memory 802 can be short-term storage or persistent storage. The application programs stored in the memory 802 may include one or more modules (not shown in the figure), and each module may include a series of computer-executable instructions in the model's processing device. Further, the processor 801 can be set to communicate with the memory 802 and execute a series of computer-executable instructions in the memory 802 on the model's processing device. The model's processing device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input / output interfaces 805, and one or more keyboards 806.

[0093] Specifically, in this embodiment, the model's processing device includes a memory and one or more programs, where one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions in the model's processing device, and is configured to be executed by one or more processors. The one or more programs include the following computer-executable instructions:

[0094] Obtain target sample data for risk prevention and control of financial transactions. The target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold;

[0095] Input the target sample data into the risk prevention and control model for the financial transaction to obtain the risk prevention and control result corresponding to the target sample data;

[0096] Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller number in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data and negative sample data at different levels of different orders of magnitude, and a second parameter for adaptively adjusting and reducing the sensitivity to noise data and outliers of the target sample data;

[0097] Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain the risk prevention and control model.

[0098] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the embodiment of the processing device of the model, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the corresponding description in the method embodiment.

[0099] An embodiment of this specification provides a processing device for a model. By obtaining target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. The target sample data is input into a risk prevention and control model for financial transactions to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, through a preset loss function, the loss information corresponding to the target sample data is determined. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of the positive sample data and the negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, the model parameters in the risk prevention and control model are adjusted to obtain a risk prevention and control model. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for a classification task with extremely imbalanced characteristics. This loss function can give a higher proportion of weight to the sample data with an extremely small proportion and extremely difficult classification (usually negative sample data), and there is no longer a limit on the gradient contribution. Therefore, in an extremely imbalanced task, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the different degrees of imbalance ratios of positive and negative sample data at different orders of magnitude in different tasks through hyperparameter selection, thereby improving the recognition effect of the model. In addition, an additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adaptively adjust and reduce the sensitivity to noise data and outliers of the sample data, and improve the stability of the training result.

[0100] Further, based on the above Figures 1 to 6 method shown, one or more embodiments of this specification also provide a storage medium for storing computer-executable instruction information. In a specific embodiment, the storage medium can be a USB flash drive, an optical disc, a hard disk, etc. When the computer-executable instruction information stored in the storage medium is executed by a processor, the following process can be implemented:

[0101] Obtain target sample data for risk prevention and control of financial transactions, where the target sample data includes positive sample data and negative sample data, and the ratio between the quantity of positive sample data and the quantity of negative sample data is greater than a first preset threshold or less than a second preset threshold;

[0102] Input the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data;

[0103] Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity among the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of positive sample data and negative sample data at different levels of different orders of magnitude, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data;

[0104] Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model.

[0105] Each embodiment in this specification is described in a progressive manner. The same or similar parts among the embodiments can be referred to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the above storage medium 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.

[0106] An embodiment of this specification provides a storage medium. By obtaining target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for financial transactions to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of the positive sample data and the negative sample data at different orders of magnitude in different degrees, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for a classification task with extremely imbalanced characteristics. This loss function can give a higher proportion of weight to sample data with an extremely small proportion and extremely difficult classification (usually negative sample data), and there is no longer a limit on gradient contribution. Therefore, in an extremely imbalanced task, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalanced ratios of different orders of magnitude of positive and negative sample data in different tasks through hyperparameter selection, thereby improving the recognition effect of the model. Additionally, an additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adaptively adjust and reduce the sensitivity to noise data and outliers of the sample data, and improve the stability of the training result.

[0107] Further, based on the above Figures 1 to 6 method shown, one or more embodiments of this specification also provide a computer program product, including a computer program. When the computer program in this computer program product is executed by a processor, the following processes can be implemented:

[0108] Obtain target sample data for risk prevention and control of financial transactions, where the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold;

[0109] Input the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data;

[0110] Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller quantity among the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the quantities of the positive sample data and the negative sample data at different orders of magnitude in different degrees, and a second parameter capable of adaptively adjusting and reducing the sensitivity to the noise data and outliers of the target sample data;

[0111] Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model.

[0112] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned embodiment of a computer program product, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiment.

[0113] An embodiment of this specification provides a computer program product. By obtaining target sample data for risk prevention and control of financial transactions, the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold. Input the target sample data into a risk prevention and control model for financial transactions to obtain a risk prevention and control result corresponding to the target sample data. Based on the risk prevention and control result and the label information corresponding to the target sample data, determine the loss information corresponding to the target sample data through a preset loss function. The loss function can give a weight higher than a third preset threshold to the sample data with a smaller number in the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data and negative sample data at different orders of magnitude in different degrees, and a second parameter that can adaptively adjust and reduce the sensitivity to noise data and outliers of the target sample data. Based on the loss information corresponding to the target sample data, adjust the model parameters in the risk prevention and control model to obtain a risk prevention and control model. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for a classification task with extremely imbalanced characteristics. This loss function can give a higher proportion of weight to sample data with an extremely small proportion and extremely difficult classification (usually negative sample data), and there is no longer a limit on gradient contribution. Therefore, in an extremely imbalanced task, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalanced ratio of different orders of magnitude of positive and negative sample data in different tasks through hyperparameter selection, thereby improving the recognition effect of the model. Additionally, an additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adaptively adjust and reduce the sensitivity to noise data and outliers of the sample data, and improve the stability of the training result.

[0114] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0115] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many method flow improvements today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using a hardware entity module. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logical function is determined by the user programming the device. Designers can program themselves to "integrate" a digital system onto a single PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compilers used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL), and there is not just one type of HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method flow using the above-mentioned several hardware description languages and programming it into the integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.

[0116] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.

[0117] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0118] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0119] Those skilled in the art should understand that the embodiments of this specification can be provided as a method, a system, or a computer program product. Therefore, one or more embodiments of this specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of this specification can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.

[0120] Embodiments of this specification are described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of this specification. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable serial-parallel devices for fraud cases to generate a machine, such that the instructions executed by the processors of the computer or other programmable serial-parallel devices for fraud cases generate means for implementing the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.

[0121] These computer program instructions can also be stored in a computer-readable memory capable of guiding a computer or other programmable serial-parallel devices for fraud cases to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implement the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.

[0122] These computer program instructions can also be loaded onto a computer or other programmable serial-parallel devices for fraud cases, such that a series of operation steps are executed on the computer or other programmable devices to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable devices provide steps for implementing the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 or means for implementing the functions specified in one block or multiple blocks.

[0123] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.

[0124] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.

[0125] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0126] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0127] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may be in the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0129] The various embodiments in this specification are described in a progressive manner. For the parts that are the same or similar among the various embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the partial description of the method embodiments.

[0130] The above description is only for the embodiments of this specification and is not intended to limit this document. For those skilled in the art, various changes and modifications can be made to this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this specification.

Claims

1. A method for processing a model, the method comprising: Acquire target sample data for risk prevention and control of financial transactions, wherein the target sample data includes positive sample data and negative sample data, and a ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold; Inputting the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data; Based on the risk prevention and control results and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined through a preset loss function, wherein the loss function can give a weight to the sample data with a small number among the positive sample data and the negative sample data that is higher than a third preset threshold, and includes a first parameter for adjusting the ratio of the number of positive sample data to the number of negative sample data at different levels and different orders of magnitude, and a second parameter that can be adjusted in an adaptive manner to reduce the sensitivity to noise data and outliers of the target sample data, and the loss function also includes a bounded penalty term and , and the bounded penalty term The coefficient of , bounded penalty term The coefficient of , the loss function consists of a bounded penalty term and , and its corresponding coefficients, are obtained by adding, where Indicates the label information corresponding to the target sample data, represents the hyperparameter, C is the second parameter, The class probability corresponding to the preset risk is used to control the degree of influence of the bounded penalty term in the loss function by using the second parameter; Based on the loss information corresponding to the target sample data, the model parameters in the risk prevention and control model are adjusted to obtain a risk prevention and control model.

2. The method according to claim 1, wherein adjusting the model parameters in the risk prevention and control model based on the loss information corresponding to the target sample data to obtain the risk prevention and control model comprises: Based on the loss information corresponding to the target sample data, the model parameters in the risk prevention and control model are adjusted, and the risk prevention and control model is trained based on the adjusted model parameters of the risk prevention and control model and the next target sample data to continue adjusting the model parameters of the risk prevention and control model until the loss function converges, thereby obtaining a trained risk prevention and control model.

3. The method according to claim 2, further comprising: receiving a risk prevention and control request for a financial transaction, wherein the risk prevention and control request includes business data for the financial transaction; The business data is input into the trained risk prevention and control model to obtain a risk prevention and control result corresponding to the risk prevention and control request.

4. According to the method of claim 1, the first preset threshold is 10000, or the second preset threshold is 1 / 10000.

5. The method according to claim 4, wherein the loss function is based on Function for constructing loss function.

6. The method according to claim 5, wherein the loss function is based on A function constructed by the loss function and a preset bounded penalty term. 7 . The method according to claim 1 , wherein the target sample data is historical data related to financial transactions, and the target sample data includes account information and historical transaction data of both parties of the financial transaction.

8. A model processing device, the device comprising: A sample data acquisition module, which acquires target sample data for risk prevention and control of financial transactions, wherein the target sample data includes positive sample data and negative sample data, and the ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold; A prediction module, inputting the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data; A loss determination module determines the loss information corresponding to the target sample data based on the risk prevention and control results and the label information corresponding to the target sample data through a preset loss function, wherein the loss function can give a weight higher than a third preset threshold to the sample data with a small number among the positive sample data and the negative sample data, and includes a first parameter for adjusting the ratio of the number of positive sample data to the number of negative sample data at different levels and different orders of magnitude, and a second parameter that can be adjusted in an adaptive manner to reduce the sensitivity to noise data and outliers of the target sample data, and the loss function also includes a bounded penalty term and , and the bounded penalty term The coefficient of , bounded penalty term The coefficient of , the loss function consists of a bounded penalty term and , and its corresponding coefficients, are obtained by adding, where Indicates the label information corresponding to the target sample data, represents the hyperparameter, C is the second parameter, The class probability corresponding to the preset risk is used to control the degree of influence of the bounded penalty term in the loss function by using the second parameter; The parameter adjustment module adjusts the model parameters in the risk prevention and control model based on the loss information corresponding to the target sample data to obtain the risk prevention and control model.

9. A model processing device, the model processing device comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Acquire target sample data for risk prevention and control of financial transactions, wherein the target sample data includes positive sample data and negative sample data, and a ratio between the number of positive sample data and the number of negative sample data is greater than a first preset threshold or less than a second preset threshold; Inputting the target sample data into a risk prevention and control model for the financial transaction to obtain a risk prevention and control result corresponding to the target sample data; Based on the risk prevention and control results and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined through a preset loss function, wherein the loss function can give a weight to the sample data with a small number among the positive sample data and the negative sample data that is higher than a third preset threshold, and includes a first parameter for adjusting the ratio of the number of positive sample data to the number of negative sample data at different levels and different orders of magnitude, and a second parameter that can be adjusted in an adaptive manner to reduce the sensitivity to noise data and outliers of the target sample data, and the loss function also includes a bounded penalty term and , and the bounded penalty term The coefficient of , bounded penalty term The coefficient of ,in, Indicates the label information corresponding to the target sample data, represents the hyperparameter, and the loss function consists of a bounded penalty term and , and its corresponding coefficients, are obtained by adding, C is the second parameter, The class probability corresponding to the preset risk is used to control the degree of influence of the bounded penalty term in the loss function by using the second parameter; Based on the loss information corresponding to the target sample data, the model parameters in the risk prevention and control model are adjusted to obtain a risk prevention and control model.

Citation Information

Patent Citations

  • User risk analysis model training method and device and electronic equipment

    CN111582651A