Model processing method, device and equipment
By introducing a new loss function in the extreme imbalance classification task, the problem of poor generalization performance of existing loss functions in extreme imbalance environments is solved, and better model generalization and stability are achieved.
Patent Information
- Application Number
- CN202510068082.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2045-01-15
AI Technical Summary
In extremely unbalanced training environments, existing loss functions may fail in classification tasks, resulting in poor generalization performance of the model.
A new loss function is proposed by giving the weight of the small number of sample data in the positive and negative sample data that is higher than the third preset threshold, and includes the first parameter and the reduction for adjusting the proportion of the number of positive and negative sample data. The second parameter of noise data and outlier sensitivity.
The generalization performance of the model under extreme imbalance conditions is improved, the identification ability of sample data with extremely small proportions and difficult classification is enhanced, and the stability of training results is improved through noise reduction mechanism.
Smart Images

Figure CN119476972A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a model processing method, device and equipment. Background Art
[0002] Extremely unbalanced training environments dominate real-world learning tasks such as network intrusion detection, privacy leakage detection, privacy protection detection, and fraud detection. Training on extremely unbalanced datasets may lead to poor generalization performance of the model because the under-represented minority classes will bring large variance.
[0003] Although considerable efforts have been made to design many loss functions that are more suitable for imbalanced states, empirical evidence shows that most of these designs occasionally fail in classification scenarios. Therefore, it is meaningful to develop a principled framework for comparing different loss functions in imbalanced learning settings. To this end, it is necessary to provide a more effective loss function in ultra-imbalanced classification UIC, thereby improving 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, thereby improving the generalization performance of the model.
[0005] In order to implement the above technical solution, the embodiments of this specification are implemented as follows: A processing method of a model provided in an embodiment of the present specification includes: obtaining 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. The target sample data is input 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, the loss information corresponding to the target sample data is determined by 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. 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.
[0006] The embodiment of the present specification provides 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, which 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. A loss determination module, which determines the 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, 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 comprises a first parameter for adjusting the ratio of the number of positive sample data to the number of negative sample data at different degrees 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 abnormal points 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.
[0007] The embodiment of the present specification provides a model processing device, the model processing device includes: a processor; and a memory arranged to store computer executable instructions, the executable instructions when being executed make the processor: 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. 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. 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 by a preset loss function, 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 degrees 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 abnormal points 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 the risk prevention and control model.
[0008] The embodiment of the present specification also provides a storage medium, the storage medium is used to store computer executable instructions, and the executable instructions implement the following process when executed by the processor: 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. 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. 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 by a preset loss function, and 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 degrees 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 abnormal points 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 the risk prevention and control model.
[0009] The embodiment of the specification also provides a computer program product, including a computer program, which implements the following process when executed by a processor: obtaining 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. Inputting the target sample data into a risk prevention and control model for the financial transaction, and obtaining 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, the loss information corresponding to the target sample data is determined by 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. 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. Figure 1 This is an embodiment of a processing method of a model in this specification; Figure 2 This is a schematic diagram of a risk prevention and control page of this manual; Figure 3 A schematic diagram of a linear classifier for loss function learning in this specification; Figure 4 A schematic diagram of a linear classifier learned from an α loss function with different α in this specification; Figure 5 A schematic diagram of the change in AUC of a linear classifier in this specification; Figure 6 This is a schematic diagram of the changes in ACC and AUC when a parameter C moves in this specification; Figure 7 This is a processing device embodiment of a model of this specification; Figure 8 This is a processing device embodiment of a model of this specification. DETAILED DESCRIPTION
[0011] The embodiments of this specification provide a method, device and equipment for processing a model.
[0012] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0013] The embodiments of this specification provide a new learning objective of adjustable boosting loss (TBL) under ultra-imbalanced classification (UIC), which can be proven to be resistant to data imbalance under UIC. Extremely unbalanced training environments dominate real-world learning tasks, such as network intrusion detection and fraud detection. Taking fraud detection as an example, the ratio of fraud cases can be as low as 1:106. Training on extremely unbalanced datasets may lead to poor generalization performance of the model because the under-represented minority class will bring a large variance. However, even if there is a certain amount of sample data from the minority class, challenges still exist. Specifically, classifiers learned by different loss functions perform differently. For example, a dataset is generated from two normally distributed clusters, containing 200 minority class sample data and 200,000 majority class sample data. In this case, although the number of minority class sample data is sufficient to learn a linear classifier, the following situation occurs, that is, the classifier learned under the cross entropy loss function ignores the variance information captured by the minority class learned under the exponential loss function. At the same time, considerable efforts have been made to design loss functions that are better suited to imbalanced settings 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 is of interest to develop a principled framework for comparing different loss functions in imbalanced learning settings.
[0014] Currently, imbalanced classification mainly focuses on establishing theoretical guarantees of separable data for minority samples of minority classes using over-parameterized models. While these analyses are well connected to optimization and modern learning theory, this assumption may not be realistic. For example, in the field of financial risk management (FRM), the imbalance of training data sometimes manifests itself as relatively rare, and there may be a large number of sample data of minority classes. In this setting, the separability assumption is unlikely to hold. To address the above issues, the concept of ultra-imbalanced classification (UIC) is introduced as an alternative formulation of imbalanced classification from a population-level perspective, which means that the prior probability of a sample belonging to the minority class is restricted to zero. In the UIC setting, insights can be drawn from information theory, and a principled framework is developed for comparing different loss functions inspired by statistical information ideas. The behavior of commonly used loss functions and loss functions customized for imbalanced problems are deeply analyzed. The results show that learning objectives such as focal loss and Polyloss do not significantly improve the cross-entropy loss function. To this end, the embodiments of this specification introduce a new loss function as a new paradigm for studying the imbalanced learning problem, in which the concept of statistical information about certain losses is utilized, and the decay rate of the corresponding function is used as a measure of resistance to imbalance. Therefore, a systematic study is conducted on commonly used learning objectives and some variants recently proposed in the imbalanced learning setting, indicating that none of these variants provide substantial improvements to the cross entropy objective. The embodiments of this specification propose a new learning objective based on an effective loss function under the comparison framework proposed under UIC, which can improve the generalization performance of the model. For specific processing, please refer to the specific content in the following embodiments.
[0015] like Figure 1 As shown, the embodiment of this specification provides a method for processing a model, and the execution subject of the method can be a terminal device or a server, etc., wherein the terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, or a computer device such as a laptop or a desktop computer, or an IoT device (specifically such as a smart watch, a car device, etc.), etc., wherein the server can be an independent server, or a server cluster composed of multiple servers, etc., and the server can be a background server for financial services or online shopping services, or a background server for an application, etc. In this embodiment, the execution subject is taken as an example for detailed description. For the case where the execution subject is a terminal device, please refer to the following server case processing, which will not be repeated here. The method can specifically include the following steps: 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.
[0016] Among them, financial transactions can be related transactions in the financial field, such as transfers, transactions involved in online shopping, payments, etc., which can be set according to actual conditions, and the embodiments of this specification do not limit this. The target sample data can be relevant historical data involved in financial transactions. The target sample data can include account information, transaction time, transaction location, transaction amount, transaction risk information (or user complaints, etc.), transaction commodity information, etc. of both parties to the transaction, which can be set according to actual conditions, and the embodiments of this specification do not limit this. Positive sample data can be sample data without preset transaction risks, and negative sample data can be sample data with preset transaction risks, etc., wherein 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 set according to actual conditions, and the embodiments of this specification do not limit this. 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 actual conditions, such as, the first preset threshold is 100000 or 1000, and the second preset threshold can be 1 / 1000 or 1 / 10000, etc.
[0017] In implementation, in an extremely unbalanced training environment, the number of sample data of one type or multiple different types may be very small (not enough to complete the training of the corresponding model), while the number of sample data of other types may be large. In this way, the number of positive sample data in the sample data set may be much larger than the number of negative sample data, or the number of negative sample data may be much larger than the number of positive sample data, that is, the ratio of the number of positive sample data to 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 large, while the number of negative sample data is small, or the number of positive sample data is small, while the number of negative sample data may be large, etc. In order to train the risk prevention and control model for financial transactions, target sample data for risk prevention and control of financial transactions can be obtained. The target sample data can be obtained in a variety of different ways. For example, each type of sample data can be obtained separately from a designated database, and can be obtained according to a preset quantity. For example, the preset quantity of sample data of each type is 100,000. For sample data with a quantity of less than 100,000, all sample data of the type contained in the data can be obtained, or part of the sample data can be selected (such as selecting 500 from 1,000, etc.), etc. The specific setting can be based on actual conditions.
[0018] Alternatively, historical business data involving financial transactions pre-recorded therein may be obtained from a designated business server, and the recorded historical business data may be used as target sample data. The target sample data may then be analyzed to determine the positive sample data and negative sample data contained therein, but the positive sample data and the negative sample data satisfy the following relationship: 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.
[0019] Alternatively, different types of relevant data for risk prevention and control of financial transactions can be crawled from the Internet through web crawlers, and the obtained relevant data can be used as target sample data. Then, the target sample data can be analyzed according to actual conditions to determine the positive sample data and negative sample data contained therein, but the positive sample data and the negative sample data satisfy the following relationship: the ratio between the number of positive sample data and the number of negative sample data is greater than the first preset threshold or less than the second preset threshold.
[0020] It should be noted that negative sample data may be a certain type of sample data, such as sample data with a risk of fraud, etc. Negative sample data may also be sample data of multiple different types, such as sample data with a risk of fraud and sample data with a risk of illegal financial activities, etc. For the case where negative sample data is sample data of multiple different types, the ratio between the number of positive sample data and the number of negative sample data may be the ratio between the number of positive sample data and the number of sample data of a certain type among the multiple different types of sample data contained in the negative sample data, or may be the ratio between the number of positive sample data and the total number of sample data of multiple types among the multiple different types of sample data contained in the negative sample data, etc. It may be set specifically according to actual conditions, and the embodiments of this specification do not limit this.
[0021] The above is only an optional implementation method. In actual applications, target sample data for risk prevention and control of financial transactions can also be obtained in a variety of different ways, and the ratio between the number of positive sample data and the number of negative sample data is greater than the first preset threshold or less than the second preset threshold. It can be set specifically according to actual conditions, and the embodiments of this specification do not limit this.
[0022] In step S104, 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.
[0023] 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 by 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 by BERT, or the risk prevention and control model can be a model constructed by a Transformer module, etc. In addition, the specified algorithm can include clustering algorithms, feature extraction algorithms, etc., which can be set according to actual conditions. The risk prevention and control results can include multiple types, for example, the presence of a preset risk or the absence of a preset risk, or the probability corresponding to each risk, etc., where the presence of a preset risk can be the presence of a certain type of risk, or the presence of multiple different types of risks at the same time, etc., which can be set according to actual conditions.
[0024] In implementation, the initial model architecture of the risk prevention and control model can be constructed through the above-mentioned specified algorithm and / or network model, and then the acquired target sample data can be input into the risk prevention and control model constructed above, 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 results corresponding to the target sample data. In the above manner, risk prevention and control results corresponding to multiple different target sample data can be obtained.
[0025] In step S106, 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.
[0026] Among them, the loss function can give weights to sample data with a small number among positive sample data and negative sample data that are higher than a third preset threshold, and includes a first parameter for adjusting the ratio of the number of positive sample data to that of negative sample data to different orders of magnitude to different degrees, and a second parameter that can be adaptively adjusted to reduce the sensitivity to noise data and outliers of the target sample data.
[0027] In implementation, in an extremely unbalanced training environment, there are fewer sample data of one or more categories, while there are more sample data of other categories, so that the number of sample data of other categories is much larger than the number of sample data of one or more categories, thereby generating an extremely unbalanced sample data situation. 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, a higher weight can be given to the sample data with a smaller number in 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, a higher weight 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, a higher weight can be given to the positive sample data, etc. In addition, a first parameter can also be set in the loss function, and the first parameter can be adjusted according to actual conditions. By adjusting the first parameter, the ratio of the number of positive sample data to negative sample data at different degrees and different orders of magnitude can be adjusted. In addition, a second parameter can also be set in the loss function, and the second parameter can be adjusted according to actual conditions. By adjusting the second parameter, the purpose of reducing the sensitivity to noise data and abnormal points of the target sample data by adaptively adjusting can be achieved.
[0028] The risk prevention and control results and the label information corresponding to the target sample data and other relevant information can be substituted into the above-mentioned loss function and calculated using the loss function. In the calculation process, not only can the weight of the sample data with a small number among the positive sample data and the negative sample data be given to be higher than the third preset threshold, but also the first parameter and the second parameter can be adjusted to adjust the ratio of the number of positive sample data to the number of negative sample data at different degrees and different orders of magnitude, and the sensitivity to the noise data and abnormal points of the target sample data can be reduced in an adaptive manner. Finally, the corresponding result can be obtained, which can be used as the loss information corresponding to the target sample data.
[0029] 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.
[0030] During 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 the adjusted risk prevention and control model. The above steps S102 to S108 can be repeated to train the risk prevention and control model with the new target sample data. Finally, the trained risk prevention and control model can be obtained.
[0031] After the above risk prevention and control model is adopted, the risk prevention and control model can be deployed in the financial transactions in the specified business, so as to perform risk prevention and control on the 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 the classification task with extremely unbalanced characteristics. The loss function can give a higher proportion of weight to the sample data (usually negative sample data) with extremely small proportion and extremely difficult classification, and there is no longer a limit on the gradient contribution. Therefore, in the extremely unbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalance ratios of different degrees and orders of magnitude of positive and negative sample data in different tasks through the selection of hyperparameters, thereby improving the recognition effect of the model. In addition, the additional noise reduction mechanism, that is, the selection of the second parameter in the loss function, enables the above method to adjust the sensitivity to the noise data and abnormal points of the sample data in an adaptive manner, thereby improving the stability of the training results.
[0032] The 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. 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, the loss information corresponding to the target sample data is determined through a preset loss function. 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. 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. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for classification tasks with extremely unbalanced characteristics. This loss function can give a higher proportion of weight to sample data (usually negative sample data) with extremely small proportions and extremely difficult classification, without the limitation of gradient contribution. Therefore, in extremely unbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalance ratios of different degrees and 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, the additional denoising mechanism, that is, the selection of the second parameter in the loss function, enables the above method to reduce the sensitivity to noise data and outliers of sample data by adaptively adjusting, thereby improving the stability of the training results and the generalization performance of the model.
[0033] In actual applications, the specific processing methods of the above step S108 can be varied. An optional processing method is provided below, which may 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 train 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 above loss function converges to obtain the trained risk prevention and control model.
[0034] In actual applications, the risk prevention and control model can be deployed in financial transactions in a specified business to perform risk prevention and control on the financial transactions through the risk prevention and control model. For details, please refer to the processing of steps A2 and A4 below.
[0035] In step A2, a risk prevention and control request for a financial transaction is received, where the risk prevention and control request includes business data for the financial transaction.
[0036] Among them, business data may include account information of both parties to the transaction, transaction time, transaction location, transaction amount, transaction risk information (or user complaints, etc.), transaction product information, etc., which can be set according to actual conditions.
[0037] In implementation, Figure 2 As shown, when risk prevention and control is required for a certain financial transaction, the user's terminal device can obtain business data for the financial transaction, 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.
[0038] In step A4, the above 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.
[0039] In practical applications, the first preset threshold is 10000, or the second preset threshold is 1 / 10000.
[0040] In practical applications, the above loss function is a function built based on the α loss function.
[0041] Among them, the α loss function unifies the commonly used learning objectives such as cross entropy and exponential loss with the hyperparameter α. When α<1, the hyperparameter α controls the weight of the small number of sample data in the positive sample data and the negative sample data. The α loss function is as follows
[0042] in, represents the α loss function, Indicates the risk prevention and control results. Indicates the label information corresponding to the target sample data.
[0043] In the implementation, it is assumed that the ratio between the number of positive sample data and the number of negative sample data is 500:1, the number of negative sample data is 200, and the average of the two clusters in the positive sample data is set to , , the average values of the two clusters in the negative sample data are set to , , the covariances of the two clusters in the positive sample data are the same matrix, and the covariance of the negative sample data is and , then Figure 3(The linear classifiers learned by the cross entropy loss function, Focal Loss, multi-loss function and vector scaling loss function are represented by clear vertical lines in the figure, where the red dots and cyan dots represent the information of two different classification labels, respectively, the red dots are represented by 0, and the cyan dots are represented by 1. For example, the information of the two different classification labels is the presence of risk and the absence of risk, then the red dot 0 can represent the presence of risk, the cyan dot 1 can represent the absence of risk, etc.) As shown in the figure, Focal Loss and its variants do not contain the covariance information of negative sample data, similar to the cross entropy loss function, which means that although they are designed to reweight the sample data to solve the imbalance problem, they do not make real changes to the learned classifier under UIC. Specifically, Focal Loss, Poly Loss, etc. can essentially be understood as making corresponding adjustments to the weight distribution of sample data during model training based on the difficulty of classifying the sample data on the basis of the cross entropy loss function, and giving higher weights to sample data that is more difficult to train (with a lower probability of being correctly classified during training). However, the cross entropy loss function sets an upper limit on the contribution of sample data in a gradient update process during model training (i.e., the norm of the gradient of the loss function with respect to this sample data). According to the theoretical analysis of statistical information, this limitation makes it impossible for the deep neural network model to learn all the information about the distribution of negative sample data through training in extremely unbalanced training tasks, and the weight adjustment mechanisms of Focal Loss, Poly Loss, etc. cannot fundamentally solve the problems caused by extreme imbalance.
[0044] On the other hand, Figure 4 (The linear classifiers learned from the α loss function with different α (i.e., α=0.4, α=0.5, α=0.6 and α=0.7) (the solid line corresponding to α=0.4, the dotted line corresponding to α=0.5, the dense short dashed line corresponding to α=0.6, and the sparse short dashed line corresponding to α=0.7)) are shown in Figure 2. As α decreases, the linear classifier learned by the α loss function is more inclined to a smaller number of categories (i.e., negative sample data). Further analysis of the α loss function in this case is conducted. Figure 5 The change of AUC of the learned linear classifier when α moves is recorded. The curve is fitted by 12 α options. When α is around 0.4, AUC reaches the highest value, which shows that a suitable hyperparameter α can be selected to optimize the AUC value. Based on this, a suitable hyperparameter α can be selected to obtain a better α loss function, and the above loss function can be constructed by the obtained better α loss function.
[0045] In practical applications, the above loss function is a function constructed based on the α loss function and a preset bounded penalty term.
[0046] In implementation, based on the above content, under UIC, a smaller α in the α loss function will emphasize the smaller categories (i.e., negative sample data). 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. In order to further analyze the robustness problem under general α, the impact analysis framework in robust statistics can be used for further analysis. It can be found that for smaller α values, the poorly fitted sample data has a greater impact on the learning parameters, resulting in poor robustness of the risk prevention and control model. In order to solve the robustness trade-off problem of this risk prevention and control model, the above α loss function can be improved, which can be called a tunable boosting loss function (TBL), in which observations with greater influence (i.e., risk prevention and control results) can be directly penalized, so that 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.
[0047] In practical applications, the above bounded penalty term is determined by the second parameter and the class probability corresponding to the preset risk.
[0048] In implementation, the tunable boosting loss function (TBL) can be as follows
[0049] in, represents the tunable boosting loss function (TBL), represents the class probability corresponding to the preset risk, represents the label information corresponding to the target sample data, C represents the second parameter, and It represents a bounded penalty term. The second parameter C can be used to control the degree of impact of the bounded penalty term.
[0050] In order to verify the effectiveness of the above-mentioned adjustable boost loss function (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 are as follows: Image dataset: binary classification tasks are performed on CIFAR10, CIFAR-100 and Tiny ImageNet. In the main experimental comparison, for each image dataset, half of the categories are randomly selected as positive sample data and the other half as negative sample data. The "deer" and "horse" datasets in CIFAR-10 are used in the ablation study; Fraud detection dataset: two industry-scale datasets collected from an online payment platform can be used. The task is a binary classification that aims to detect fraudsters among ordinary users using a set of rich features. The classifier learned using the adjustable boost loss function (TBL) is used as a baseline for comparison with classifiers learned through the following objectives: cross entropy loss function with logit adjustment, LDAM (label distribution aware) marginal loss function, focal loss function with logit adjustment, multi-aggregation loss function with logit adjustment, VS (vector scaling) loss function. All parameters involved in the experiments of the classifiers learned using the tunable boost loss function (TBL) were optimized using grid search. For 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, AUC and two metrics that are critical to evaluating FRM domain models: one-way partial AUC (opAUC) are set with a false positive rate upper limit of 0.01 and a recall rate of 0.001.
[0051] Based on the above experimental settings, the following results can be obtained: As shown in Table 1 (Experimental results of image datasets) Table 1
[0052] Among them, the tunable boosting loss function (TBL) consistently outperforms other methods in all cases, from relatively easy tasks in CIFAR-10 to extremely difficult tasks in Tiny ImageNet. (i.e., the ratio between the number of negative sample data and the number of positive sample data) decreases, the gain of the adjustable boost loss function (TBL) over the CE loss function also increases accordingly. There is no significant improvement in the CE loss under UIC on all selected datasets. The adjustable boost loss function (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.
[0053] As shown in Table 2 (Experimental results on fraud detection dataset) Table 2
[0054] Among them, due to the strength of high-quality features, the above methods all show competitive performance under the AUC metric, and the adjustable boost loss function (TBL) is slightly improved over the Fraud 1 dataset. The performance difference of the opAUC and recall indicators becomes more obvious. Under these two indicators, the adjustable boost loss function (TBL) has better overall performance and achieves dominant performance on the Fraud 2 dataset. The necessity of introducing parameter C: An ablation study was conducted to study the parameter C that promotes robustness. We expect that there will be a trade-off when adjusting the value of C. When ρ=0.01, it is shown on the "deer" and "horse" datasets in CIFAR-10, and ACC and AUC are used as evaluation indicators, such as Figure 6 (Changes in ACC and AUC when parameter C moves, where the horizontal axis represents the denoising parameter in the adjustable boost loss function (TBL), the solid line and vertical axis on the left represent the results of average accuracy, the dotted line and secondary vertical axis on the right represent the results of AUC, and the shaded area reflects the standard error of the results) shows that when C is about 0.3, both AUC and accuracy measurements reach their maximum values, which are much better than C=0, which verifies that the denoising design is beneficial to the adjustable boost loss function (TBL).
[0055] In actual applications, the target sample data is historical data related to financial transactions, including account information and historical transaction data of both parties to the financial transaction. The historical transaction data may include transaction time, transaction location, transaction amount, transaction risk information (or user complaints, etc.), transaction commodity information, etc., which can be set according to actual conditions.
[0056] The 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. 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, the loss information corresponding to the target sample data is determined through a preset loss function. 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. 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. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for classification tasks with extremely unbalanced characteristics. This loss function can give a higher proportion of weight to sample data (usually negative sample data) with extremely small proportions and extremely difficult classification, without the limitation of gradient contribution. Therefore, in extremely unbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalance 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, the additional denoising mechanism, that is, the selection of the second parameter in the loss function, enables the above method to reduce the sensitivity to noise data and anomalies of sample data by adaptively adjusting, thereby improving the stability of the training results.
[0057] The above is a processing method for a model provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a processing device for a model, such as Figure 7 shown.
[0058] The processing device of the model includes: a sample data acquisition module 701, a prediction module 702, a loss determination module 703 and a parameter adjustment module 704, wherein: The sample data acquisition module 701 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; 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; A 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, wherein 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 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 abnormal points of the target sample data; 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 the risk prevention and control model.
[0059] In an embodiment of the present 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, thereby obtaining a trained risk prevention and control model.
[0060] In the embodiment of this specification, the device further includes: A request module, 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 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.
[0061] In the embodiment of this specification, the first preset threshold is 10000, or the second preset threshold is 1 / 10000.
[0062] In the embodiment of this specification, the loss function is based on Function for constructing loss function.
[0063] In the embodiment of this specification, the loss function is based on A function constructed by the loss function and a preset bounded penalty term.
[0064] In the embodiment of this specification, the bounded penalty term is determined by the second parameter and the class probability corresponding to the preset risk.
[0065] In the embodiment of the present specification, 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 to the financial transaction.
[0066] The embodiment of this specification provides a processing device of a model, which obtains 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. 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, the loss information corresponding to the target sample data is determined by a preset loss function, and 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. 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. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for classification tasks with extremely unbalanced characteristics. This loss function can give a higher proportion of weight to sample data (usually negative sample data) with extremely small proportions and extremely difficult classification, without the limitation of gradient contribution. Therefore, in extremely unbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalance 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, the additional denoising mechanism, that is, the selection of the second parameter in the loss function, enables the above method to reduce the sensitivity to noise data and anomalies of sample data by adaptively adjusting, thereby improving the stability of the training results.
[0067] The above is a processing device for a model provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a processing device for a model, such as Figure 8 shown.
[0068] The processing device of the model may provide a terminal device or a server, etc. for the above-mentioned embodiment.
[0069] The processing device of the model may have relatively large differences due to different configurations or performances, and may include one or more processors 801 and memory 802, and the memory 802 may store one or more storage applications or data. Among them, the memory 802 may be a short-term storage or a persistent storage. The application 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 processing device of the model. Furthermore, the processor 801 may be configured to communicate with the memory 802, and execute a series of computer executable instructions in the memory 802 on the processing device of the model. The processing device of the model may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input and output interfaces 805, and one or more keyboards 806.
[0070] Specifically in this embodiment, the processing device of the model includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions in the processing device of the model, and the one or more programs are configured to be executed by one or more processors, including computer executable instructions for performing the following: 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 result and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined by a preset loss function, wherein 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 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; 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.
[0071] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the processing device embodiment of the model, 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.
[0072] The embodiment of this specification provides a model processing device, which obtains 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. 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, the loss information corresponding to the target sample data is determined through a preset loss function. 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. 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. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for classification tasks with extremely unbalanced characteristics. This loss function can give a higher proportion of weight to sample data (usually negative sample data) with extremely small proportions and extremely difficult classification, without the limitation of gradient contribution. Therefore, in extremely unbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalance 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, the additional denoising mechanism, that is, the selection of the second parameter in the loss function, enables the above method to reduce the sensitivity to noise data and anomalies of sample data by adaptively adjusting, thereby improving the stability of the training results.
[0073] Furthermore, based on the above Figures 1 to 6 In one embodiment, the present specification further provides a storage medium for storing computer executable instruction information. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instruction information stored in the storage medium is executed by the processor, the following process can be implemented: 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 result and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined by a preset loss function, wherein 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 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; 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.
[0074] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned 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.
[0075] The embodiment of this specification provides a storage medium, which obtains 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. 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, the loss information corresponding to the target sample data is determined through a preset loss function. 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. 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. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for classification tasks with extremely unbalanced characteristics. This loss function can give a higher proportion of weight to sample data (usually negative sample data) with extremely small proportions and extremely difficult classification, without the limitation of gradient contribution. Therefore, in extremely unbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalance 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, the additional denoising mechanism, that is, the selection of the second parameter in the loss function, enables the above method to reduce the sensitivity to noise data and anomalies of sample data by adaptively adjusting, thereby improving the stability of the training results.
[0076] Furthermore, based on the above Figures 1 to 6 In one or more embodiments of the present specification, a computer program product is provided, including a computer program. When the computer program in the computer program product is executed by a processor, the following process can be implemented: 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 result and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined by a preset loss function, wherein 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 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; 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.
[0077] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned computer program product 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.
[0078] The embodiment of this specification provides a computer program product, which obtains 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. 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, the loss information corresponding to the target sample data is determined by a preset loss function, and 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. 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. In this way, a dedicated loss function that can be adjusted by hyperparameters is set for classification tasks with extremely unbalanced characteristics. This loss function can give a higher proportion of weight to sample data (usually negative sample data) with extremely small proportions and extremely difficult classification, without the limitation of gradient contribution. Therefore, in extremely unbalanced tasks, the risk prevention and control model can learn more sufficient distribution information. In addition, the loss function can adapt to the imbalance 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, the additional denoising mechanism, that is, the selection of the second parameter in the loss function, enables the above method to reduce the sensitivity to noise data and anomalies of sample data by adaptively adjusting, thereby improving the stability of the training results.
[0079] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0080] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0081] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, and the memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices for implementing various functions included therein may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.
[0082] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0083] For the convenience of description, the above devices are described in terms of functions and are divided into various units. 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.
[0084] 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 take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0085] The embodiments of this specification are described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable fraud case serial and parallel device to produce a machine, so that the instructions executed by the processor of the computer or other programmable fraud case serial and parallel device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0086] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable fraud case serial and parallel device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0087] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0088] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0089] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0090] 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.
[0091] 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.
[0092] 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.
[0093] 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.
[0094] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0095] The above description is only an embodiment of this specification and is not intended to limit this document. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in 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 result and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined by a preset loss function, wherein 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 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; 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. According to the method of claim 6, the bounded penalty term is determined by the second parameter and the class probability corresponding to the preset risk.
8. According to the method of claim 1, 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 to the financial transaction.
9. 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, based on the risk prevention and control result and the label information corresponding to the target sample data, determines the loss 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 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 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; 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.
10. 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 result and the label information corresponding to the target sample data, the loss information corresponding to the target sample data is determined by a preset loss function, wherein 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 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; 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
Data processing method and device, equipment and storage medium
CN117056723A
Model processing method, device and equipment
CN117093863A
Data processing method and device, equipment, storage medium and program product
CN117635312A
Financial risk data identification method and device, equipment and storage medium
CN118505395A
Cited By
Image-text marketing content generation method and system based on multi-modal model
CN122453459A
Image-text marketing content generation method and system based on multi-modal model
CN122453459B