Model training method, model training device, computer equipment and storage medium
By adjusting the initial parameters to adapt to the model of multiple fraud tasks, forming target parameters, and training the warning model based on the target parameters, the problems of the fraud warning model in traditional methods are solved, and the problem of high difficulty in identifying new scenarios and high resource consumption is realized in small and medium-sized Fast and high-precision fraud warnings in banks.
Patent Information
- Application Number
- CN202411086621.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The traditional fraud warning model design method requires a large amount of sample data for training, which makes it difficult to quickly adapt and identify in new fraud scenarios, and is also very costly, especially in small and medium-sized banks, which makes it difficult to update and migrate models.
By training preset models based on the initial parameters and historical data of multiple fraud tasks, adjusting the initial parameters to adapt to multiple fraud tasks, forming target parameters, and then training the target warning model based on the target parameters and current data to achieve rapid adaptation and high accuracy Identify.
It realizes the rapid construction of a high-precision fraud warning model with few samples, reduces the resource consumption of model reconstruction, adapts to new fraud scenarios, improves the effective alarm rate, and reduces the pressure of fraud risk verification.
Smart Images

Figure CN119067234A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a model training method, a model training device, a computer device, and a non-volatile computer-readable storage medium. Background Art
[0002] In recent years, financial institutions have frequently encountered fraud in account transaction risk warnings. The types of fraud risks are complex and varied, and fraud routines are endless. Therefore, financial institutions need to establish fraud warning models for fraud warning. The traditional fraud warning model design method generally uses expert rules combined with machine learning models for model design. This model design method requires obtaining a large amount of sample data of a certain fraud method to train a model. If the fraud method changes, the model needs to be retrained. When a new fraud scenario appears, the sample data is often very small, which makes it impossible to quickly train a fraud warning model with high recognition accuracy, making it difficult to effectively warn of this fraud scenario. Summary of the invention
[0003] Embodiments of the present application provide a model training method, a model training device, a computer device, and a non-volatile computer-readable storage medium.
[0004] The model training method of the implementation mode of the present application includes: training corresponding preset models based on initial parameters and historical data corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each of the fraud tasks, and the intermediate parameters are determined based on the initial parameters; when the comprehensive loss value corresponding to each of the intermediate parameters is greater than a first preset threshold, adjusting the initial parameters based on the output results of the preset models corresponding to each fraud task, and entering the step of training the preset models based on the historical data and initial parameters corresponding to multiple fraud tasks again; when the comprehensive loss value is less than the first preset threshold, determining the target parameters according to the initial parameters corresponding to the intermediate parameters; when the current data corresponding to the current fraud task is received, training the preset model based on the target parameters and the current data to obtain a converged target warning model.
[0005] The model training device of the embodiment of the present application includes a first training module, an adjustment module, a determination module and a second training module. The first training module is used to train the corresponding preset models based on the initial parameters and the historical data corresponding to the multiple fraud tasks, so as to obtain the intermediate parameters corresponding to each of the fraud tasks, and the intermediate parameters are determined based on the initial parameters. The adjustment module is used to adjust the initial parameters based on the output results of the preset models corresponding to each fraud task when the comprehensive loss value corresponding to each of the intermediate parameters is greater than the first preset threshold, and enter the step of training the preset models based on the historical data and initial parameters corresponding to the multiple fraud tasks again. The determination module is used to determine the target parameters according to the initial parameters corresponding to the intermediate parameters when the comprehensive loss value is less than the first preset threshold. The second training module is used to train the preset model based on the target parameters and the current data when the current data corresponding to the current fraud task is received, so as to obtain a converged target warning model.
[0006] The computer device of the embodiment of the present application includes a processor, a memory and a computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing a model training method. The model training method includes: training the corresponding preset models based on the initial parameters and the historical data corresponding to the multiple fraud tasks to obtain the intermediate parameters corresponding to each of the fraud tasks, and the intermediate parameters are determined based on the initial parameters; when the comprehensive loss value corresponding to each of the intermediate parameters is greater than the first preset threshold, adjusting the initial parameters based on the output results of the preset models corresponding to each fraud task, and entering the step of training the preset models based on the historical data and initial parameters corresponding to the multiple fraud tasks again; when the comprehensive loss value is less than the first preset threshold, determining the target parameters according to the initial parameters corresponding to the intermediate parameters; when the current data corresponding to the current fraud task is received, training the preset model based on the target parameters and the current data to obtain a converged target warning model.
[0007] The non-volatile computer-readable storage medium of the embodiment of the present application includes a computer program, and when the computer program is executed by a processor, the processor executes a model training method. The model training method includes: training the corresponding preset models based on the initial parameters and the historical data corresponding to the multiple fraud tasks to obtain the intermediate parameters corresponding to each of the fraud tasks, and the intermediate parameters are determined based on the initial parameters; when the comprehensive loss value corresponding to each of the intermediate parameters is greater than the first preset threshold, adjusting the initial parameters based on the output results of the preset models corresponding to each fraud task, and re-entering the step of training the preset models based on the historical data and initial parameters corresponding to the multiple fraud tasks; when the comprehensive loss value is less than the first preset threshold, determining the target parameters according to the initial parameters corresponding to the intermediate parameters; when the current data corresponding to the current fraud task is received, training the preset model based on the target parameters and the current data to obtain a converged target warning model.
[0008] The model training method, model training device, computer equipment and computer-readable storage medium of the embodiment of the present application will first train the preset model based on the historical data and initial parameters corresponding to multiple fraud tasks to obtain intermediate parameters adapted to each fraud task. Then, the comprehensive loss value corresponding to the multiple intermediate parameters is obtained according to the intermediate parameters. When the comprehensive loss value is greater than the first preset threshold, the initial parameters can be adjusted according to the comprehensive loss value, and the preset model is trained again until the comprehensive loss value is less than the first preset threshold. In this way, the initial parameters adapted to multiple fraud tasks can be obtained through multiple trainings, and the initial parameters are confirmed as the target parameters. When the current data corresponding to the current fraud task is received, the preset model can be trained based on the target parameters and the current data to obtain a converged target warning model. It can be understood that since the target parameters are adapted to multiple fraud tasks, the target parameters are also highly adaptable to the current fraud task, so the target warning model has a high recognition accuracy for the recognition type corresponding to the current fraud task.
[0009] Therefore, by training the preset model based on the target parameters, only a small amount of adjustment is needed to the target parameters to obtain a target early warning model that can effectively identify the fraud type corresponding to the current fraud task. In this way, when the amount of current data is small, the present application can also quickly obtain a target early warning model that can effectively identify the fraud type corresponding to the current fraud task, that is, to achieve high-precision few-sample modeling, thereby avoiding the demand for data scale and quality in the face of few-sample modeling in the prior art, reducing the resource consumption of model reconstruction, and being able to quickly and effectively adapt to new fraud scenarios.
[0010] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0012] Figure 1 It is a flowchart of a model training method in certain embodiments of the present application;
[0013] Figure 2 It is a schematic diagram of a scenario of a model training method in certain embodiments of the present application;
[0014] Figure 3 It is a schematic diagram of a scenario of a model training method in certain embodiments of the present application;
[0015] Figure 4 It is a flowchart of a model training method in certain embodiments of the present application;
[0016] Figure 5 It is a flowchart of a model training method in certain embodiments of the present application;
[0017] Figure 6 It is a flowchart of a model training method in certain embodiments of the present application;
[0018] Figure 7 It is a flowchart of a model training method in certain embodiments of the present application;
[0019] Figure 8 It is a flowchart of a model training method in certain embodiments of the present application;
[0020] Fig. 9 It is a module schematic diagram of a model training device in certain embodiments of the present application;
[0021] Fig.10 is a schematic diagram of the structure of a computer device of certain embodiments of the present application;
[0022] Fig.11 It is a schematic diagram of the connection status of a non-volatile computer-readable storage medium and a processor in certain embodiments of the present application. DETAILED DESCRIPTION
[0023] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.
[0024] In recent years, fraud in financial institution account transaction risk warning has occurred frequently, the types of fraud risks are complex and varied, and fraud routines are endless. Fraud accounts have abnormal transaction behavior, suspicious counterparties, irregular transaction patterns, and are closely related to fraudulent behavior. The existing fraud warning model technology is difficult to identify multiple fraud tasks, and it is necessary to model each type of transaction fraud task separately. Therefore, when a new fraud method appears, the traditional transaction risk monitoring method is difficult to quickly adapt and effectively identify it because there is no corresponding fraud warning model. For small and medium-sized banks, fraud samples are missing. Often, small and medium-sized banks will develop risk models when the number of good and bad labels of fraud sample data is seriously insufficient, or even when labels are missing. In this case, an expert rule model set by humans is often required for fraud warning. However, the recognition method of the expert rule model is relatively rigid, resulting in a high fraud recognition alarm rate and a low effective warning rate, which leads to a large number of invalid alarm investigations by business auditors. In the above context, risk control modelers need to: build a transaction fraud warning model under the condition of few samples and multiple tasks; and improve the generalization ability of the warning model for new fraud behaviors.
[0025] The traditional transaction fraud warning model design method is generally to design the model by combining expert rules with machine learning (or deep learning) mode. This model design method requires obtaining a large amount of sample data in the target field (a certain fraud method) to train a model. If the task (fraud method) changes, the model needs to be retrained. This will bring two problems: first, from the data point of view, the quality of the machine model depends largely on the scale and quality of training; second, from the perspective of resource consumption, when training the model, it will be very time-consuming and labor-intensive to train a model for a task from scratch, and when the model parameters are huge, such computing costs are unbearable.
[0026] In summary, the traditional model building method has the following problems:
[0027] Disadvantages of existing technology:
[0028] 1. A large number of fraud data samples are required for training, which is difficult to achieve with the data accumulation of small and medium-sized banks;
[0029] 2. Fraudulent behaviors are complex and diverse, and models are frequently updated, iterated, and reconstructed, resulting in high cost and resources for each training.
[0030] 3. It is difficult to quickly adapt to new fraud scenarios;
[0031] 4. It is not suitable for building fraud cold start models, and it is difficult to migrate different types of fraud models;
[0032] In order to solve the above technical problems, the embodiment of the present application provides a model training method, which will be described in detail below:
[0033] See also Figure 1 The embodiment of the present application provides a model training method, which is applied to a fraud warning model. The model training method includes:
[0034] Step 011: training corresponding preset models based on the initial parameters and historical data corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each fraud task, where the intermediate parameters are determined based on the initial parameters;
[0035] Specifically, traditional machine learning is to manually adjust parameters first, and then directly train the deep model for a specific task. When facing new tasks, traditional machine learning methods usually require a large amount of training data and iterations to achieve good performance. However, in the real world, the training data for many tasks is limited or even very small. In addition, the staff hopes that the model can adapt to new tasks in a very short time.
[0036] Initial parameters are hyperparameters. In the context of machine learning, hyperparameters are parameters whose values are set before the learning process begins. Based on the above problems, the present application hopes that by learning a series of tasks, the model can automatically adjust its parameters to adapt to new tasks, so that when the model faces new tasks, it can achieve better performance with very few training samples and iterations. Therefore, assuming that there is an initial parameter that is applicable to all tasks, when a new task appears, only a few adjustments to the initial parameter that is applicable to all tasks are needed to obtain parameters that can better adapt to the new task, and the parameter performs well in the new task.
[0037] Based on the above ideas, first of all, based on different fraud types, historical fraud data and historical non-fraud data can be divided into types to obtain historical data corresponding to multiple fraud tasks, and each fraud task corresponds to a fraud type. It can be understood that each fraud task corresponds to multiple historical data, assuming that each fraud task corresponds to k historical data. When k is very small, the purpose of rapid learning can be achieved by training a small number of samples multiple times. Therefore, this application can better adapt to few-sample learning and is suitable for transaction fraud warning (small and medium-sized banks have accumulated little fraud label data). Among them, the historical data corresponding to each fraud task can also be divided into a support set and a query set. The support set can be used for training, and the query set can be used to test the training results.
[0038] The preset models can be trained based on the historical data and initial parameters corresponding to multiple fraud tasks to obtain the intermediate parameters corresponding to each fraud task, so that the intermediate parameters are more adaptable to the corresponding fraud task. Among them, the preset model is the model to be trained, and all parameters except the hyperparameters in the preset model have been set, and the network structure of the preset model corresponding to each fraud task is consistent, and the initial parameters can be randomly determined.
[0039] At this time, the initial parameters can be used as training parameters, and the setting parameters of the preset model can be adjusted according to the training parameters. The setting parameters are the hyperparameters of the preset model. Then, the corresponding preset models are trained based on the historical data corresponding to multiple fraud tasks, and the training parameters of the corresponding preset models are adjusted according to the output results of the preset models. Then, the loss value corresponding to the training parameter is determined. When the loss value is less than the corresponding loss value threshold, the training parameter can be confirmed as an intermediate parameter.
[0040] For example, the historical data of each fraud task includes transaction information and a label indicating whether the transaction is fraudulent. The initial parameters can be used as hyperparameters of the preset model, and then the transaction information is input into the preset model. After the preset model processes the transaction information based on the initial parameters, it can determine whether the transaction information is fraudulent. Then, the loss value can be calculated based on the output results of the preset model and the labels in the historical data, and the hyperparameters of the preset model can be adjusted based on the loss value, so as to obtain the intermediate parameters corresponding to each fraud task. It can be understood that the intermediate parameters can be more suitable for the corresponding fraud task.
[0041] Step 012: When the comprehensive loss value corresponding to each intermediate parameter is greater than the first preset threshold, the initial parameters are adjusted based on the output results of the preset models corresponding to each fraud task, and the step of respectively training the preset models based on the historical data and initial parameters corresponding to the plurality of fraud tasks is entered again;
[0042] Specifically, a multi-task overall loss assessment method can be designed to obtain the optimal target parameters suitable for multiple fraud tasks through iterative optimization. At this time, the loss value corresponding to each fraud task can be determined based on the preset loss value function corresponding to multiple fraud tasks and the output results of the preset model, and the comprehensive loss value can be determined based on the loss value corresponding to each fraud task. For example, the loss value corresponding to each fraud task can be calculated based on the preset loss value function corresponding to multiple fraud tasks, historical data, and the output results of the preset model, and then the average value of the loss value corresponding to each fraud task can be used as the comprehensive loss value, or the sum of the loss values corresponding to each fraud task can be used as the comprehensive loss value.
[0043] The first preset threshold is the maximum value of the comprehensive loss value when the initial parameters corresponding to the intermediate parameters can be adapted to multiple fraud tasks. It can also be understood as the maximum value of the loss value corresponding to the initial parameters of the preset model when the preset model can accurately identify the fraud types corresponding to multiple fraud tasks.
[0044] When the comprehensive loss value corresponding to each intermediate parameter is greater than the first preset threshold, the initial parameters can be adjusted based on the output results of the preset models corresponding to each fraud task and the preset adjustment rules, for example, the adjustment rules are set based on the gradient descent method, and then the initial parameters are adjusted based on the output results of the preset models corresponding to each fraud task and the gradient descent method. Then, the step of training the preset model based on historical data and initial parameters is entered again, that is, step 011 is entered again, so as to obtain initial parameters that can be adapted to various fraud tasks through continuous training.
[0045] Step 013: when the comprehensive loss value is less than the first preset threshold, determining the target parameter according to the initial parameter corresponding to the adjusted intermediate parameter;
[0046] Specifically, the intermediate parameters are adapted to the corresponding fraud tasks. When the comprehensive loss value corresponding to the multiple intermediate parameters is less than the first preset threshold, it can be confirmed that the initial parameters corresponding to the intermediate parameters can be adapted to multiple fraud tasks, and the initial parameters at this time are the best parameter settings. Alternatively, it can be understood that on the basis of the initial parameters, after a small adjustment of the initial parameters, the intermediate parameters adapted to the corresponding fraud tasks can be obtained. Therefore, the target parameters can be determined according to the initial parameters corresponding to the intermediate parameters.
[0047] For example Figure 2 , is the initial parameter, θ i is the training parameter corresponding to the i-th fraud task, is the intermediate parameter of the i-th fraud task, is the loss value function corresponding to the intermediate parameters adjusted for the i-th fraud task, Is the loss value function corresponding to the comprehensive loss value.
[0048] The historical data corresponding to each fraud task includes a support set and a query set. First, the training parameters θ corresponding to each fraud task can be i Confirm it as the initial parameter φ, and use the training parameter as the hyperparameter of the preset model. Train the preset model corresponding to each fraud task according to the support set, and calculate the loss value corresponding to each fraud model. Then adjust the training parameters according to the loss value until the preset model converges. In particular, multiple trainings can be performed based on the support set at this time. Then, use the training parameters corresponding to the converged preset model as the hyperparameter of the preset model, and calculate the loss value corresponding to the model according to the query set. Then take the average of the loss values corresponding to each model as the comprehensive loss value. When the comprehensive loss value is greater than the first preset threshold, update the initial parameter φ according to the comprehensive loss value, and repeat the above steps again until the comprehensive loss value is less than the first preset threshold. At this time, the training parameters can be confirmed as intermediate parameters.
[0049] The training process of the existing technology is as follows Figure 3 ,in is the initial parameter, X i , Y i is the i-th sample data in a certain fraud task. It can be found that the prior art will train the preset model based on multiple sample data of a certain fraud task, and the target parameters obtained by such training can only be applicable to the fraud task. However, the present application can be trained based on multiple tasks, and the initial parameters can be adjusted in combination with the training results of multiple tasks, so that the final target parameters can be applicable to multiple fraud tasks.
[0050] Step 014: When current data corresponding to the current fraud task is received, the preset model is trained based on the target parameters and the current data to obtain a converged target warning model.
[0051] Specifically, when a new type of fraud appears and a corresponding fraud warning model needs to be built for the new type of fraud, the current data corresponding to the current fraud task can be generated based on the data corresponding to the new type of fraud. When the current data corresponding to the current fraud task is received, the target parameters can be used as hyperparameters of the preset model, and the preset model can be trained based on the current data. Then, the target parameters can be adjusted according to the training results until the preset model converges, and the final parameters when the model converges are obtained, and the preset model is confirmed as the target warning model, so that the final parameters can be highly adapted to the current fraud task, and the target warning model can accurately identify the fraud type corresponding to the current fraud task.
[0052] For example, the current data can be divided into a training set and a test set. The training set can be used to train the preset model, and then the loss value can be calculated based on the test set. When the loss value is greater than the corresponding loss value threshold, the target parameter can be adjusted according to the loss value and training can be performed again. When the loss value is less than the corresponding loss value threshold, the model convergence can be confirmed, and the target parameter corresponding to the loss value can be used as the final parameter, and a converged target warning model can be generated based on the final parameter.
[0053] Please combine Figure 4 , is the initial parameter, is the target parameter, θ is the parameter corresponding to the training process, l(k) is the loss value function corresponding to the intermediate parameter adjusted for the kth fraud task, is the loss value function corresponding to the comprehensive loss value, X i is the transaction data, Y i is the label of whether it is fraudulent, P is the output result of the model, θ k is the model corresponding to the training set, in which the setting parameters are based on θ k Sure; is the model corresponding to the test set, in which the setting parameters are based on Sure, θ is the model corresponding to the training set, and the setting parameters are determined according to θ; fθ* is the model corresponding to the test set, and the setting parameters are determined according to θ*.
[0054] First, training can be performed based on historical data from multiple fraud tasks to update the initial parameters. So as to obtain the best target parameters The training process can be found in Figure 2 . After getting the target parameters After that, according to the target parameters The metamodel is constructed based on the preset model. After obtaining the current data, the metamodel can be trained according to the training set of the current data to obtain the parameter θ* that performs well on the training set. Then, the setting parameters of the metamodel can be adjusted according to the parameter θ*, and the adjusted metamodel can be tested using the test set. After the adjusted metamodel is tested, the adjusted metamodel can be confirmed as the target early warning model. Then, the financial institution can put the target early warning model into use. After obtaining the transaction data, the target early warning model can determine whether the transaction data is fraudulent, and the fraud type belongs to the fraud type corresponding to the target early warning model.
[0055] In this way, when the current data corresponding to the current fraud task is received, the target parameters can be used as the hyperparameters of the preset model, and then the preset model can be trained according to the current data to adjust the target parameters and obtain the final parameters when the model converges, thereby ensuring that the converged target warning model is highly compatible with the current fraud task. Alternatively, the target parameters are obtained by pre-training, so a meta-model can be set according to the target parameters and the preset model. When the current data corresponding to the current fraud task is received, the meta-model can be trained according to the current data to obtain a converged target warning model.
[0056] The target parameters at the beginning of the training are obtained by training based on the historical data corresponding to multiple fraud tasks, and are adapted to the parameters corresponding to multiple fraud tasks. Therefore, the initial target parameters of the training are also highly adaptable to the current fraud task, so that in the process of training the preset model based on the target parameters and the current data, only a few adjustments to the target parameters are needed to obtain the final parameters that are highly adapted to the current fraud task, so that the target early warning model can be obtained quickly. At the same time, since only a few adjustments to the target parameters are needed, the training of the preset model can be completed using a small amount of data at this time, and a target early warning model that can effectively identify the fraud type corresponding to the current fraud task can be obtained. The target early warning model can then be used to predict the fraud type corresponding to the current fraud task.
[0057] Therefore, this application can perform model training with a small amount of data. In the face of new fraud scenarios, it only needs to fine-tune the model with a few samples to quickly learn new tasks and quickly use new task domains with good samples to obtain target warning models that can effectively identify new fraud scenarios, thereby achieving high-precision multi-task few-sample modeling. Therefore, this application can achieve cold start phase construction and is suitable for banks with no or little fraud data accumulation. At the same time, the model update only needs to be performed on the basis of the target parameters, without the need for a large number of sampling batches, saving computing costs and facilitating later maintenance.
[0058] In summary, compared with the existing technology, this application can provide a fraud cold start method for small and medium-sized banks, has a strong adaptability to new fraud types, improves the effective alarm rate, and reduces the pressure of fraud risk verification. At the same time, this application can also adjust the parameters of the model in a timely manner and generate a corresponding target early warning model based on the current data to cope with the dynamic changes in the financial market.
[0059] The model training method of the embodiment of the present application will first train the preset model based on the historical data and initial parameters corresponding to multiple fraud tasks to obtain intermediate parameters adapted to each fraud task. Then, the comprehensive loss values corresponding to the multiple intermediate parameters are obtained according to the intermediate parameters. When the comprehensive loss value is greater than the first preset threshold, the initial parameters can be adjusted according to the comprehensive loss value, and the preset model can be trained again until the comprehensive loss value is less than the first preset threshold. In this way, the initial parameters adapted to multiple fraud tasks can be obtained through multiple trainings, and the initial parameters can be confirmed as the target parameters. When the current data corresponding to the current fraud task is received, the preset model can be trained based on the target parameters and the current data to obtain a converged target warning model. It can be understood that since the target parameters are adapted to multiple fraud tasks, the target parameters are also highly adaptable to the current fraud task, so the target warning model has a high recognition accuracy for the recognition type corresponding to the current fraud task.
[0060] Therefore, by training the preset model based on the target parameters, only a small amount of adjustment is needed to the target parameters to obtain a target early warning model that can effectively identify the fraud type corresponding to the current fraud task. In this way, when the amount of current data is small, the present application can also quickly obtain a target early warning model that can effectively identify the fraud type corresponding to the current fraud task, that is, to achieve high-precision few-sample modeling, thereby avoiding the demand for data scale and quality in the face of few-sample modeling in the prior art, reducing the resource consumption of model reconstruction, and being able to quickly and effectively adapt to new fraud scenarios.
[0061] See also Figure 5 In some embodiments, step 012: when the comprehensive loss value corresponding to each intermediate parameter is greater than the first preset threshold, adjusting the initial parameters based on the output results of the preset models corresponding to each fraud task includes:
[0062] Step 0121: determining a target loss value function according to preset loss value functions corresponding to a plurality of fraud tasks;
[0063] Step 0122: Adjust the initial parameters based on the target loss value function and the output results of the preset model corresponding to each fraud task.
[0064] Specifically, please combine Figure 2 , the target loss value function can be determined based on the preset loss value functions corresponding to multiple fraud tasks. For example, the preset loss value functions corresponding to all fraud tasks can be integrated, and the target loss value function is the integrated function divided by the number of fraud tasks. That is, assuming that the loss value function corresponding to each fraud task is Then the target loss function
[0065] Then, the initial parameter adjustment method can be determined based on the target loss value function, for example, according to the formula Determine the initial parameter adjustment method. Input the output of the preset model corresponding to the fraud task into the formula to obtain the adjusted initial parameters.
[0066] In this way, when adjusting the initial parameters, the output results of the preset models corresponding to each fraud task can be comprehensively considered, so that the adjusted initial parameters can be more suitable for each fraud task, ensuring that the final corresponding total loss value is less than the first preset threshold initial parameters.
[0067] See also Figure 6 In some implementations, step 011: training corresponding preset models based on initial parameters and historical data corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each fraud task, wherein the intermediate parameters are determined based on the initial parameters, including:
[0068] Step 0111: determining the training parameters of the preset model corresponding to the target fraud task based on the initial parameters, where the target fraud task is any fraud task;
[0069] Step 0112: adjusting the setting parameters of the preset model according to the training parameters, and training the corresponding preset model based on the historical data corresponding to the target fraud task;
[0070] Step 0113: Calculate a first loss value according to an output result of a preset model;
[0071] Step 0114: when the first loss value is less than the second preset threshold, confirming the training parameter as an intermediate parameter corresponding to the target fraud task;
[0072] Step 0115: When the first loss value is greater than the second preset threshold, the training parameters are adjusted based on the output result, and the step of adjusting the setting parameters of the preset model according to the training parameters is entered again, and the corresponding preset model is trained based on the historical data corresponding to the target fraud task.
[0073] Specifically, the second preset threshold is the maximum loss value when the training parameters corresponding to the target fraud task can well adapt to the target fraud task, which can also be understood as the maximum loss value corresponding to the training parameters when the preset model can accurately identify the fraud type corresponding to the target fraud task. The gradient iterative optimization loss method can be used to gradually obtain the optimal intermediate parameters corresponding to each fraud task.
[0074] Please combine Figure 2. After obtaining the initial parameters, the training parameters of the preset model corresponding to the target fraud task can be determined based on the initial parameters, wherein the target fraud task is any fraud task. Then, the setting parameters of the preset model, i.e., the hyperparameters of the preset model, are adjusted according to the training parameters, so that the preset model can be trained based on the training parameters next. Next, the corresponding preset model can be trained based on the historical data corresponding to the target fraud task to obtain the output result of the preset model. Then, the first loss value can be calculated based on the output result of the preset model, the historical data of the target fraud task, and the corresponding preset loss value function. In the case where the first loss value is greater than the second preset threshold, it can be considered that the current training parameters have a low degree of adaptability to the target fraud task, so the training parameters can be adjusted based on the output result, and step 0112 is entered again to adjust the training parameters using multiple trainings until the training parameters have a high degree of adaptability to the target fraud task. In the case where the first loss value is less than the second preset threshold, it can be considered that the current training parameters have a high degree of adaptability to the target fraud task, so the training parameters can be confirmed as the intermediate parameters corresponding to the target fraud task.
[0075] Alternatively, the historical data of the target fraud task may include a training set and a test set, wherein the training set is used to train the preset model, and the test set is used to test the trained preset model. The training parameters corresponding to the preset model after the test passes can be confirmed as intermediate parameters. Specifically, the preset model can be trained according to the training set, and the first loss value can be calculated based on the output result obtained by the training. When the first loss value is greater than the second preset threshold, the preset model is tested using the test set, and the loss value is calculated based on the output result obtained by the test. When the loss value corresponding to the test is also less than the second preset threshold, the training parameters are confirmed as the intermediate parameters corresponding to the target fraud task.
[0076] In this way, it is possible to determine whether the current training parameters are compatible with the target fraud task based on the first loss value. If not, the training parameters are adjusted and the preset model is trained again until the first loss value is less than the second preset threshold and the intermediate parameters with a high degree of adaptability to the target fraud task are obtained. In this way, it can be ensured that the intermediate parameters obtained are highly compatible with the corresponding fraud task.
[0077] See also Figure 7 In some embodiments, step 011: training corresponding preset models based on initial parameters and historical data corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each fraud task, further comprising:
[0078] Step 0116: Randomly select target historical data from the historical data corresponding to each fraud task;
[0079] Step 0117: Train corresponding preset models according to target historical data and initial parameters corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each fraud task.
[0080] Specifically, when training a preset model based on multiple fraud tasks, target historical data can be randomly selected from the historical data corresponding to each fraud task, and then the target historical data can be used as a training set to train the model. The setting parameters of the preset model can be determined based on the initial parameters, and the corresponding preset model can be trained based on the target historical data corresponding to multiple fraud tasks to obtain the intermediate parameters corresponding to each fraud task. The data in the historical data that does not belong to the target historical data can be used as a test set to facilitate testing using the test set to ensure that the intermediate parameters finally obtained are correct.
[0081] In this way, the training set is different in each training process, ensuring the representativeness of the training set, making the model training more comprehensive and effective. At the same time, training the model based on only part of the historical data each time can also reduce the training time and computing burden, thereby increasing the training speed.
[0082] See also Figure 8 In some embodiments, step 014: upon receiving current data corresponding to the current fraud task, training the preset model based on the target parameters and the current data to obtain a converged target warning model includes:
[0083] Step 0141: when receiving current data corresponding to the current fraud task, adjusting the setting parameters of the preset model according to the target parameters, and training the preset model based on the current data;
[0084] Step 0142: Calculate a second loss value according to the output result of the preset model;
[0085] Step 0143: when the second loss value is less than the third preset threshold, a converged target warning model is obtained according to the current target parameters and the preset model;
[0086] Step 0144: When the second loss value is greater than the third preset threshold, adjust the target parameters based on the output result, and again enter the step of adjusting the setting parameters of the preset model according to the target parameters when receiving the current data corresponding to the current fraud task, and train the preset model based on the current data.
[0087] Specifically, the third preset threshold is the maximum loss value when the target parameter can adapt well to the current fraud task. It can also be understood as the maximum loss value corresponding to the target parameter of the preset model when the preset model can accurately identify the fraud type corresponding to the current fraud task.
[0088] When the current data corresponding to the current fraud task is received, the setting parameters of the preset model, that is, the hyperparameters of the preset model, can be adjusted according to the target parameters, so that the preset model can be trained based on the target parameters next. Next, the preset model can be trained based on the current data corresponding to the current fraud task to obtain the output result of the preset model. Then, the second loss value can be calculated based on the output result of the preset model, the current data corresponding to the current fraud task, and the corresponding preset loss value function. In the case where the second loss value is greater than the third preset threshold, it can be considered that the current target parameter is still not sufficiently compatible with the current fraud task, so the target parameter can be adjusted based on the output result, and step 0142 is entered again to adjust the target parameter using multiple trainings until the target parameter is highly compatible with the current fraud task. In the case where the second loss value is less than the third preset threshold, it can be considered that the current target parameter is highly compatible with the current fraud task, so the setting parameters of the preset model can be adjusted according to the target parameter to obtain a converged target warning model.
[0089] Alternatively, the current data of the current fraud task may include a training set and a test set, wherein the training set is used to train the preset model, and the test set is used to test the trained preset model. Only after the preset model passes the test can it be confirmed as the target warning model. Specifically, the preset model can be trained according to the training set, and the second loss value can be calculated based on the output result obtained from the training. When the second loss value is greater than the third preset threshold, the preset model is tested using the test set, and the loss value is calculated based on the output result obtained from the test. When the loss value corresponding to the test is also less than the third preset threshold, the setting parameters of the preset model are adjusted according to the target parameters to obtain a converged target warning model.
[0090] In this way, it can be determined whether the current target parameter is compatible with the current fraud task based on the second loss value. If it is not compatible, the target parameter is adjusted and the preset model is trained again until the second loss value is less than the third preset threshold and the target parameter with a high degree of adaptability to the current fraud task is obtained. In this way, it can be ensured that the obtained target parameter is highly compatible with the current fraud task, and the target warning model can accurately identify the fraud type corresponding to the current fraud task.
[0091] See also Fig. 9In order to better implement the model training method of the embodiment of the present application, the embodiment of the present application also provides a model training device 10. The model training device 10 may include a first training module 11, an adjustment module 12, a determination module 13 and a second training module 14. The first training module 11 is used to train the corresponding preset models based on the initial parameters and the historical data corresponding to the multiple fraud tasks, so as to obtain the intermediate parameters corresponding to each fraud task, and the intermediate parameters are determined based on the initial parameters. The adjustment module 12 is used to adjust the initial parameters based on the output results of the preset models corresponding to each fraud task when the comprehensive loss value corresponding to each intermediate parameter is greater than the first preset threshold, and enter the step of training the preset models based on the historical data and initial parameters corresponding to the multiple fraud tasks again. The determination module 13 is used to determine the target parameters according to the initial parameters corresponding to the intermediate parameters when the comprehensive loss value is less than the first preset threshold. The second training module 14 is used to train the preset model based on the target parameters and the current data when the current data corresponding to the current fraud task is received, so as to obtain a converged target warning model.
[0092] The adjustment module 12 is specifically used to determine a target loss value function according to preset loss value functions corresponding to a plurality of fraud tasks; and adjust initial parameters based on the output results of the target loss value function and preset models corresponding to each fraud task.
[0093] The model training device 10 also includes a calculation module 15, which is used to determine the loss value corresponding to each fraud task based on the preset loss value function corresponding to multiple fraud tasks and the output results of the preset model; and determine the comprehensive loss value based on the loss value corresponding to each fraud task.
[0094] The first training module 11 is specifically used to determine the training parameters of the preset model corresponding to the target fraud task based on the initial parameters, and the target fraud task is any fraud task; adjust the setting parameters of the preset model according to the training parameters, and train the corresponding preset model based on the historical data corresponding to the target fraud task; calculate the first loss value according to the output result of the preset model; when the first loss value is less than the second preset threshold, confirm the training parameters as the intermediate parameters corresponding to the target fraud task; when the first loss value is greater than the second preset threshold, adjust the training parameters based on the output result, and enter the step of adjusting the setting parameters of the preset model according to the training parameters again, and training the corresponding preset model based on the historical data corresponding to the target fraud task.
[0095] The first training module 11 is specifically used to randomly select target historical data from the historical data corresponding to each fraud task; and train corresponding preset models according to the target historical data and initial parameters corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each fraud task.
[0096] The second training module 14 is specifically used to adjust the setting parameters of the preset model according to the target parameters and train the preset model based on the current data when the current data corresponding to the current fraud task is received; calculate the second loss value according to the output result of the preset model; when the second loss value is less than the third preset threshold, obtain a converged target warning model according to the current target parameters and the preset model; when the second loss value is greater than the third preset threshold, adjust the target parameters based on the output results, and enter the step of adjusting the setting parameters of the preset model according to the target parameters and training the preset model based on the current data when the current data corresponding to the current fraud task is received again.
[0097] The model training device 10 further includes a classification module 16. The classification module 16 is used to classify the historical fraud data and the historical non-fraud data into types to obtain historical data corresponding to a plurality of fraud tasks.
[0098] The above text describes the model training device 10 from the perspective of functional modules in conjunction with the accompanying drawings. The functional modules can be implemented in hardware form, can be implemented by instructions in software form, or can be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiments in the embodiments of the present application can be completed by hardware integrated logic circuits in the processor and / or instructions in software form. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware coding processor for execution, or can be completed by a combination of hardware and software modules in the coding processor. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps in the above method embodiments in conjunction with its hardware.
[0099] See also Fig.10 The computer device 100 of an embodiment of the present application includes a processor 20, a memory 30 and a computer program, wherein the computer program is stored in the memory 30 and executed by the processor 20, and the computer program includes instructions for executing the model training method of any of the above embodiments.
[0100] See also Fig.11 The embodiment of the present application also provides a computer-readable storage medium 300 on which a computer program 310 is stored. When the computer program 310 is executed by a processor 320, the steps of the model training method of any of the above-mentioned embodiments are implemented. For the sake of brevity, they are not repeated here.
[0101] In the description of this specification, the descriptions with reference to the terms "certain embodiments", "in an example", "exemplarily", etc., mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0102] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0103] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A model training method, characterized in that: The method comprises: Based on the initial parameters and the historical data corresponding to the plurality of fraud tasks, the corresponding preset models are trained respectively to obtain the intermediate parameters corresponding to the respective fraud tasks, wherein the intermediate parameters are determined based on the initial parameters; When the comprehensive loss value corresponding to each of the intermediate parameters is greater than the first preset threshold, adjusting the initial parameters based on the output results of the preset models corresponding to each fraud task, and entering again the step of respectively training the preset models based on the historical data and initial parameters corresponding to the plurality of fraud tasks; When the comprehensive loss value is less than a first preset threshold, determining a target parameter according to the initial parameter corresponding to the intermediate parameter; When current data corresponding to the current fraud task is received, the preset model is trained based on the target parameters and the current data to obtain a converged target early warning model.
2. The model training method according to claim 1, characterized in that: When the comprehensive loss value corresponding to each of the intermediate parameters is greater than a first preset threshold, adjusting the initial parameters based on the output results of the preset models corresponding to each of the fraud tasks includes: Determine a target loss value function according to preset loss value functions corresponding to a plurality of fraud tasks; The initial parameters are adjusted based on the target loss value function and the output results of the preset models corresponding to each fraud task.
3. The model training method according to claim 2, characterized in that: The method further comprises: Determine the loss value corresponding to each fraud task based on the preset loss value functions corresponding to the multiple fraud tasks and the output results of the preset model; The comprehensive loss value is determined based on the loss values corresponding to the various fraud tasks.
4. The model training method according to claim 1, characterized in that: The corresponding preset models are trained based on the initial parameters and the historical data corresponding to the plurality of fraud tasks to obtain the intermediate parameters corresponding to each of the fraud tasks, including: Determining training parameters of a preset model corresponding to a target fraud task based on the initial parameters, wherein the target fraud task is any fraud task; Adjusting the setting parameters of the preset model according to the training parameters, and training the corresponding preset model based on the historical data corresponding to the target fraud task; Calculate a first loss value according to the output result of the preset model; When the first loss value is less than a second preset threshold, confirming the training parameter as the intermediate parameter corresponding to the target fraud task; When the first loss value is greater than the second preset threshold, the training parameters are adjusted based on the output result, and the step of adjusting the setting parameters of the preset model according to the training parameters is entered again, and the corresponding preset model is trained based on the historical data corresponding to the target fraud task.
5. The model training method according to claim 1 or 4, characterized in that: The corresponding preset models are trained based on the initial parameters and the historical data corresponding to the plurality of fraud tasks to obtain the intermediate parameters corresponding to each of the fraud tasks, including: Randomly selecting target historical data from the historical data corresponding to each of the fraud tasks; The corresponding preset models are trained respectively according to the target historical data and the initial parameters corresponding to the plurality of fraud tasks to obtain the intermediate parameters corresponding to the respective fraud tasks.
6. The model training method according to claim 1, characterized in that: When receiving the current data corresponding to the current fraud task, training the preset model based on the target parameter and the current data to obtain a converged target early warning model includes: When receiving current data corresponding to the current fraud task, adjusting the setting parameters of the preset model according to the target parameters, and training the preset model based on the current data; Calculate a second loss value according to the output result of the preset model; When the second loss value is less than a third preset threshold, a converged target warning model is obtained according to the current target parameter and the preset model; When the second loss value is greater than the third preset threshold, the target parameter is adjusted based on the output result, and the step of adjusting the setting parameters of the preset model according to the target parameter and training the preset model based on the current data is entered again when the current data corresponding to the current fraud task is received.
7. The model training method according to claim 1, characterized in that: Also includes; The historical fraud data and the historical non-fraud data are divided into types to obtain historical data corresponding to the plurality of fraud tasks.
8. A model training device, characterized in that: The device comprises: A first training module, used for respectively training corresponding preset models based on initial parameters and historical data corresponding to a plurality of fraud tasks, so as to obtain intermediate parameters corresponding to each of the fraud tasks, wherein the intermediate parameters are determined based on the initial parameters; An adjustment module, configured to adjust the initial parameters based on the output results of the preset models corresponding to the respective fraud tasks when the comprehensive loss values corresponding to the respective intermediate parameters are greater than the first preset threshold value, and to re-enter the step of respectively training the preset models based on the historical data and initial parameters corresponding to the plurality of fraud tasks; A determination module, configured to determine a target parameter according to the initial parameter corresponding to the intermediate parameter when the comprehensive loss value is less than a first preset threshold value; The second training module is used to train the preset model based on the target parameters and the current data when receiving the current data corresponding to the current fraud task, so as to obtain a converged target early warning model.
9. A computer device, characterized in that: include: Processor, memory; and A computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the model training method described in any one of claims 1 to 7.
10. A non-volatile computer-readable storage medium containing a computer program, characterized in that: When the computer program is executed by a processor, the processor executes the model training method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Fraud recognition model training method, fraud recognition method and device
CN109598331A
Fraud behavior detection method and device, computer equipment and storage medium
CN113988867A
Artificial intelligence-based fraud identification method and device, equipment and storage medium
CN116611941A
Medical insurance fraud behavior identification method and device and electronic equipment
CN116912007A
Model training and evaluation method, related device, equipment, medium and product
CN117151859A
