Model Training Method, Model Training Device, Computer Device, and Storage Medium
By training and adjusting the initial parameters to adapt to the historical data of multiple fraud tasks, and training the target warning model with target parameters and current data, the problem of traditional models requiring a large amount of data and resource consumption is solved, and a fast and high-precision fraud warning model construction is achieved.
Patent Information
- Application Number
- CN202411086621.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-08-08
AI Technical Summary
Traditional fraud warning models require a large amount of sample data training. It is difficult to quickly adapt to new fraud scenarios and consume a lot of resources. Especially when small and medium-sized banks have insufficient data accumulation, it is difficult to quickly build an effective fraud warning model.
By training the preset model based on the initial parameters and historical data of multiple fraud tasks, adjusting the intermediate parameters to adapt to multiple fraud tasks until the comprehensive loss value is less than the threshold, and then using the target parameters and current data to train the target warning model to achieve rapid adaptation to new fraud scenarios.
Quickly build a high-precision fraud warning model under a small amount of data, reduce resource consumption, improve adaptability and identification accuracy to new fraud scenarios, and reduce model reconstruction costs.
Smart Images

Figure CN119067234B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and more particularly, to a model training method, a model training apparatus, a computer device, and a non-volatile computer-readable storage medium. Background Art
[0002] In recent years, frauds in financial institution account transaction risk early warnings have occurred frequently. The types of fraud risks are complex and changeable, and fraud routines emerge in an endless stream. Therefore, financial institutions need to establish fraud early warning models for fraud early warnings. The traditional fraud early warning model design method generally designs a model by combining expert rules with a machine learning mode. 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 scarce, resulting in the inability to quickly train a fraud early warning model with a high recognition accuracy, thus making it difficult to effectively warn against this type of fraud scenario. Summary of the Invention
[0003] Embodiments of the present application provide a model training method, a model training apparatus, a computer device, and a non-volatile computer-readable storage medium.
[0004] The model training method according to the embodiments of the present application includes: respectively 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, where the intermediate parameters are determined based on the initial parameters; in the case where 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 re-entering the step of training the preset models respectively based on the historical data and the initial parameters corresponding to multiple fraud tasks; in the case where the comprehensive loss value is less than the first preset threshold, determining target parameters according to the initial parameters corresponding to the intermediate parameters; and in the case of receiving current data corresponding to a current fraud task, training the preset model based on the target parameters and the current data to obtain a converged target early warning model.
[0005] The model training device according to 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 configured to train corresponding preset models respectively based on initial parameters and historical data corresponding to multiple fraud tasks, so as to obtain intermediate parameters corresponding to each of the fraud tasks, and the intermediate parameters are determined based on the initial parameters. The adjustment module is configured to, when the comprehensive loss value corresponding to each of the intermediate parameters is greater than a first preset threshold, adjust the initial parameters based on the output results of the preset models corresponding to each fraud task, and re-enter the step of training the preset models respectively based on the historical data and the initial parameters corresponding to multiple fraud tasks. The determination module is configured to, when the comprehensive loss value is less than the first preset threshold, determine target parameters according to the initial parameters corresponding to the intermediate parameters. The second training module is configured to, when receiving current data corresponding to a current fraud task, train the preset model based on the target parameters and the current data, so as to obtain a converged target warning model.
[0006] The computer device according to the embodiment of the present application includes a processor, a memory, and a computer program. Among them, 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 corresponding preset models respectively based on initial parameters and historical data corresponding to multiple fraud tasks, so as 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 re-entering the step of training the preset models respectively based on the historical data and the initial parameters corresponding to multiple fraud tasks; when the comprehensive loss value is less than the first preset threshold, determining target parameters according to the initial parameters corresponding to the intermediate parameters; when receiving current data corresponding to a current fraud task, training the preset model based on the target parameters and the current data, so as 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. When the computer program is executed by a processor, the processor is caused to execute a model training method. The model training method includes: respectively 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, where the intermediate parameters are determined based on the initial parameters; in the case where 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 re - entering the step of training the preset models respectively based on the historical data and initial parameters corresponding to multiple fraud tasks; in the case where the comprehensive loss value is less than the first preset threshold, determining target parameters according to the initial parameters corresponding to the intermediate parameters; in the case where current data corresponding to a 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] For the model training method, model training device, computer device, and computer - readable storage medium of the embodiment of the present application, first, corresponding preset models are respectively trained based on historical data and initial parameters corresponding to multiple fraud tasks to obtain intermediate parameters adapted to each fraud task. Then, a comprehensive loss value corresponding to the multiple intermediate parameters is obtained according to the intermediate parameters. In the case where the comprehensive loss value is greater than a first preset threshold, the initial parameters can be adjusted according to the comprehensive loss value, and the preset models are 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 target parameters. In the case where current data corresponding to a 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 adaptability of the target parameters to the current fraud task is also relatively high. Therefore, the recognition accuracy of the target warning model for the recognition type corresponding to the current fraud task is relatively high.
[0009] Therefore, when training the preset model based on the target parameters, only a small adjustment to the target parameters is required to obtain a target warning model that can effectively identify the fraud type corresponding to the current fraud task. In this way, in the case where the amount of current data is small, the present application can also quickly obtain a target warning model that can effectively identify the fraud type corresponding to the current fraud task, that is, achieve high - precision few - shot modeling, thereby avoiding the requirements for data scale and quality in the face of few - shot 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 embodiments of the present application will be given in part in the following description, become apparent in part from the following description, or 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 be readily understood from the following description of the embodiments in conjunction with the accompanying drawings, where:
[0012] Figure 1 is a schematic flowchart of a model training method according to some embodiments of the present application;
[0013] Figure 2 is a schematic diagram of a scenario of a model training method according to some embodiments of the present application;
[0014] Figure 3 is a schematic diagram of a scenario of a model training method according to some embodiments of the present application;
[0015] Figure 4 is a schematic flowchart of a model training method according to some embodiments of the present application;
[0016] Figure 5 is a schematic flowchart of a model training method according to some embodiments of the present application;
[0017] Figure 6 is a schematic flowchart of a model training method according to some embodiments of the present application;
[0018] Figure 7 is a schematic flowchart of a model training method according to some embodiments of the present application;
[0019] Figure 8 is a schematic flowchart of a model training method according to some embodiments of the present application;
[0020] Figure 9 is a schematic diagram of modules of a model training apparatus according to some embodiments of the present application;
[0021] Figure 10 is a schematic diagram of the structure of a computer device according to some embodiments of the present application;
[0022] Figure 11 is a schematic diagram of the connection state of a non - volatile computer - readable storage medium and a processor according to some embodiments of the present application. Detailed Embodiments
[0023] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be construed as a limitation to the embodiments of the present application.
[0024] In recent years, financial institution account transaction risk warning frauds have occurred frequently. The types of fraud risks are complex and variable, and fraud routines emerge in an endless stream. Fraudulent accounts have types such as abnormal transaction behaviors, suspicious transaction counterparts, irregular transaction patterns, and being closely related to fraud behaviors. For the existing fraud warning model technologies, it is very difficult to identify multiple fraud tasks, and separate modeling needs to be carried out for each type of transaction fraud task. Therefore, when a new fraud method appears, it is very difficult for traditional transaction risk monitoring methods to quickly adapt and effectively identify due to the lack of corresponding fraud warning models. For small and medium-sized banks, there is a lack of fraud samples. 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 the labels are missing. In this case, an expert rule model set by humans is often needed for fraud warning. However, the identification method of the expert rule model is relatively rigid, resulting in a high fraud identification alarm rate and a low effective warning rate, so that business verification personnel still need to conduct a large number of ineffective alarm investigations. Against the above background, risk control modeling personnel need to: build a transaction fraud warning model in the case of few samples and multiple tasks; improve the generalization ability of the warning model for new fraud behaviors.
[0025] The traditional design method of transaction fraud warning models is generally to design models by combining expert rules with machine learning (or deep learning) models. For this kind of model design method, a large amount of sample data in the target field (a certain fraud method) needs to be obtained to train a model. If the task (fraud method) changes, the model needs to be retrained. And this will bring two problems: First, from the perspective of data, the quality of machine models depends to a large extent on the scale and quality of training; Second, from the perspective of resource consumption, when training a model, training a model for a task from scratch is very time-consuming and laborious, and when the model parameters are huge, such a computing cost is unbearable.
[0026] In summary, the traditional model construction method has the following problems:
[0027] Disadvantages of the prior art:
[0028] 1. A large number of fraud data samples are required for training, and it is difficult for small and medium-sized banks to accumulate data to meet such requirements;
[0029] 2. The types of fraud behaviors are complex and diverse, the model updates, iterates, and reconstructs frequently, and the cost of each training is very large;
[0030] 3. Difficult to quickly adapt to new fraud scenarios;
[0031] 4. Not suitable for building a fraud cold start model, and it is difficult to migrate and apply different types of fraud models;
[0032] To solve the above technical problems, the embodiments of the present application provide a model training method, and the model training method of the present application will be elaborated in detail below:
[0033] Please refer to Figure 1 , the embodiments of the present application provide a model training method. The model training method is applied to a fraud warning model, and the model training method includes:
[0034] Step 011: Train the corresponding preset models based on the initial parameters and the historical data corresponding to multiple fraud tasks respectively to obtain the intermediate parameters corresponding to each fraud task, and the intermediate parameters are determined based on the initial parameters;
[0035] Specifically, traditional machine learning first adjusts the parameters manually and then directly trains the deep model under specific tasks. When facing new tasks, traditional machine learning methods usually require a large amount of training data and iteration times to achieve better performance. However, in the real world, the training data for many tasks is limited or even very little. In addition, the staff hopes that the model can adapt to new tasks in a very short time.
[0036] The 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 the model can achieve better performance with very few training samples and iteration times when facing new tasks. Therefore, assuming there is an initial parameter applicable to all tasks, in the case of a new task, only a very small adjustment to the initial parameter applicable to all tasks is required to obtain a parameter that can better adapt to the new task, and this parameter performs well in the new task.
[0037] Based on the above ideas, first, based on different fraud types, historical fraud data and historical non-fraud data can be used for type division to obtain historical data corresponding to multiple fraud tasks, and each fraud task corresponds to one fraud type. It can be understood that each fraud task corresponds to multiple historical data. Suppose each fraud task corresponds to k historical data. When k is small, fast learning can be achieved by training a small number of samples multiple times. Therefore, this application can better adapt to few-shot learning and is suitable for the scenario of transaction fraud warning (where small and medium-sized banks have little accumulated 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 model can be trained respectively based on the historical data corresponding to multiple fraud tasks and the initial parameters to obtain intermediate parameters corresponding to each fraud task, so that the adaptability of the intermediate parameters to the corresponding fraud tasks is relatively high. Among them, the preset model is the model to be trained. Other parameters in the preset model except for the hyperparameters have been set, and the network structures of the preset models corresponding to each fraud task are the same. The initial initial parameters can be determined randomly.
[0039] At this time, the initial parameters can be used as the 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 preset models corresponding to multiple fraud tasks are trained respectively based on the historical data corresponding to the 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 parameters is determined. When the loss value is less than the corresponding loss value threshold, the training parameters can be confirmed as the intermediate parameters.
[0040] For example, the historical data of each fraud task includes transaction information and the label indicating whether the transaction is fraudulent. The initial parameters can be used as the hyperparameters of the preset model. 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 according to the output result of the preset model and the label in the historical data, and the hyperparameters of the preset model can be adjusted according to 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 relatively well adapted to the corresponding fraud tasks.
[0041] Step 012: When the comprehensive loss value corresponding to each intermediate parameter is greater than the first preset threshold, adjust the initial parameters based on the output results of the preset models corresponding to each fraud task, and then re-enter the step of training the preset models respectively based on the historical data corresponding to multiple fraud tasks and the initial parameters;
[0042] Specifically, a multi-task overall loss evaluation method can be designed to obtain the optimal target parameters adapted to multiple fraud tasks through iterative optimization. At this time, based on the preset loss value functions corresponding to multiple fraud tasks and the output results of the preset model, the loss values corresponding to each fraud task can be determined, and the comprehensive loss value can be determined based on the loss values corresponding to each fraud task. For example, the loss value corresponding to each fraud task can be calculated according to the preset loss value functions, historical data, and the output results of the preset model corresponding to multiple fraud tasks, and then the average value of the loss values 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] In the case where the comprehensive loss values corresponding to each intermediate parameter are greater than the first preset threshold, the initial parameters can be adjusted based on the output results of the preset model 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 according to the output results of the preset model corresponding to each fraud task and the gradient descent method. Then, it enters again the step of training the preset model according to the historical data and the initial parameters, that is, enters step 011 again, so as to obtain the initial parameters that can be adapted to various fraud tasks through continuous training.
[0045] Step 013: In the case where the comprehensive loss value is less than the first preset threshold, determine the target parameters according to the initial parameters corresponding to the adjusted intermediate parameters;
[0046] Specifically, the intermediate parameters are adapted to the corresponding fraud tasks. In the case where the comprehensive loss values corresponding to multiple intermediate parameters are 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. Or it can be understood that based on 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 at this time.
[0047] For example Figure 2 , Let θ be the initial parameter, i let be the training parameter corresponding to the i-th fraud task, let be the intermediate parameter corresponding to the i-th fraud task, let be the loss value function corresponding to the adjusted intermediate parameter of the i-th fraud task, let be 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 parameter θ corresponding to each fraud task i can be confirmed as the initial parameter φ, and the training parameter is used as the hyperparameter of the preset model. The preset model corresponding to each fraud task is trained according to the support set, and the loss value corresponding to each fraud model is calculated. Then, the training parameter is adjusted according to the loss value until the preset model converges. In particular, at this time, multiple trainings can be performed according to the support set. Then, the training parameter corresponding to the converged preset model is used as the hyperparameter of the preset model, and the loss value corresponding to the model is calculated according to the query set. Then, the average value of the loss values corresponding to each model is used as the comprehensive loss value. When the comprehensive loss value is greater than the first preset threshold, the initial parameter φ is updated according to the comprehensive loss value, and the above steps are repeated again until the comprehensive loss value is less than the first preset threshold. At this time, the training parameter can be confirmed as the intermediate parameter
[0049] The training process of the prior art is as Figure 3 , where 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 trains the preset model according to multiple sample data of a certain fraud task, and the target parameter obtained by such training can only be applicable to that fraud task. However, the present application can be trained based on multiple tasks and adjust the initial parameter in combination with the training results of multiple tasks, so that the final target parameter can be applicable to multiple fraud tasks.
[0050] Step 014: When receiving the current data corresponding to the current fraud task, train the preset model based on the target parameter and the current data to obtain a converged target warning model.
[0051] Specifically, when a new type of fraud appears and it is necessary to construct a corresponding fraud warning model for the new type of fraud, the current data corresponding to the current fraud task can be generated according to the data corresponding to the new type of fraud. When receiving the current data corresponding to the current fraud task, the target parameter can be used as the hyperparameter of the preset model, and the preset model is trained based on the current data. Then, the target parameter can be adjusted according to the training result until the preset model converges, and the final parameter at the time of model convergence is obtained, and the preset model is confirmed as the target warning model. In this way, it can be ensured that the final parameter is 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 a 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, it can be confirmed that the model has converged, 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 , as the initial parameter, as the target parameter, θ is the parameter corresponding to the training process, l(k) is the loss value function corresponding to the adjusted intermediate parameter of the k-th fraud task, as 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 fraud, P is the output result of the model, θ k is the model corresponding to the training set, and the set parameters therein are determined according to θ k ; is the model corresponding to the test set, and the set parameters therein are determined according to ; θ is the model corresponding to the training set, and the set parameters therein are determined according to θ; fθ* is the model corresponding to the test set, and the set parameters therein are determined according to θ*.
[0054] First, training can be performed based on the historical data of multiple fraud tasks to update the initial parameter so as to obtain the optimal target parameter The training process therein can refer to Figure 2 . After obtaining the target parameter , a meta-model can be constructed according to the target parameter and the preset model. After obtaining the current data, the meta-model can be trained according to the training set of the current data to obtain the parameter θ* that performs excellently on the training set. Then, the set parameters of the meta-model can be adjusted according to the parameter θ*, and the adjusted meta-model can be tested using the test set. After the adjusted meta-model passes the test, the adjusted meta-model can be confirmed as the target warning model. Then, the financial institution can put the target warning model into use. After the target warning model obtains the transaction data, it can determine whether the transaction data is fraud, and the fraud type belongs to the fraud type corresponding to the target warning model.
[0055] Thus, when receiving the current data corresponding to the current fraud task, the target parameter can be used as the hyperparameter of the preset model, and then the preset model can be trained according to the current data to adjust the target parameter and obtain the final parameter when the model converges, so as to ensure a high adaptability of the converged target warning model to the current fraud task. Or, the target parameter is obtained by pre-training, so a meta-model can be set according to the target parameter and the preset model. When receiving the current data corresponding to the current fraud task, the meta-model can be trained according to the current data to obtain the converged target warning model.
[0056] The initial training target parameter is obtained by training according to the historical data corresponding to multiple fraud tasks and is suitable for the parameters corresponding to multiple fraud tasks. Therefore, the initial training target parameter also has a high degree of adaptability to the current fraud task, so that in the process of training the preset model based on the target parameter and the current data, only a small adjustment of the target parameter is required to obtain the final parameter that is highly adaptable to the current fraud task, enabling the target warning model to be obtained quickly. At the same time, since only a small adjustment of the target parameter is required, a small amount of data can be used to complete the training of the preset model at this time, and a target warning model that can effectively identify the fraud type corresponding to the current fraud task can be obtained. Subsequently, the target warning model can be used to predict the fraud type corresponding to the current fraud task.
[0057] Therefore, the present application can perform model training when obtaining a small amount of data. In the face of a new fraud scenario, only a few-shot fine-tuning of the model is required to quickly learn a new task, quickly use the new task domain with good samples, and obtain a target warning model that can effectively identify the new fraud scenario, thereby achieving high-precision few-shot multi-task modeling. Therefore, the present application can achieve the construction in the cold start phase and is suitable for banks with no or little accumulation of fraud data. At the same time, the update of the model only needs to be carried out based on the target parameter, without a large number of sampling and batch running, saving computational costs and being beneficial to later maintenance.
[0058] In summary, compared with the prior art, the present application provides a method for fraud cold start 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, the present application can also adjust the parameters of the model in a timely manner and generate a corresponding target warning model according to the current data to cope with the dynamic changes in the financial market.
[0059] The model training method according to the embodiments of the present application first trains a preset model based on the historical data and initial parameters corresponding to multiple fraud tasks respectively to obtain intermediate parameters adapted to each fraud task. Then, a comprehensive loss value corresponding to the multiple intermediate parameters is obtained according to the intermediate parameters. In the case where 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 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 adaptability of the target parameters to the current fraud task is also relatively high. Therefore, the recognition accuracy of the target warning model for the recognition type corresponding to the current fraud task is relatively high.
[0060] Therefore, based on the target parameters, when training the preset model, only a small adjustment to the target parameters is required to obtain a target warning model that can effectively identify the fraud type corresponding to the current fraud task. In this way, in the case where the amount of the current data is small, the present application can also quickly obtain a target warning model that can effectively identify the fraud type corresponding to the current fraud task, that is, achieve high-precision few-shot modeling, thereby avoiding the requirements for the data scale and quality in the face of few-shot 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] Please refer to Figure 5 , in some embodiments, step 012: in the case where 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, including:
[0062] Step 0121: determining a target loss value function according to the preset loss value functions corresponding to multiple fraud tasks;
[0063] Step 0122: adjusting the initial parameters based on the target loss value function and the output results of the preset models corresponding to each fraud task.
[0064] Specifically, please combine Figure 2 , the target loss value function can be determined according to 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 functions corresponding to each fraud task are Then the target loss value function
[0065] Next, an initial parameter adjustment method can be determined based on the target loss value function. For example, according to the formula the initial parameter adjustment method is determined. By inputting the output result of the preset model corresponding to the fraud task into the formula, the adjusted initial parameters can be obtained.
[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 better adapted to each fraud task, ensuring that the initial parameters with a corresponding total loss value less than the first preset threshold can be finally obtained.
[0067] Please refer to Figure 6 , in some embodiments, step 011: respectively train the corresponding preset models based on the initial parameters and the historical data corresponding to multiple fraud tasks to obtain the intermediate parameters corresponding to each fraud task. The intermediate parameters are determined based on the initial parameters, including:
[0068] Step 0111: Determine 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: 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;
[0070] Step 0113: Calculate the first loss value according to the output result of the preset model;
[0071] Step 0114: 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;
[0072] Step 0115: When the first loss value is greater than the second preset threshold, adjust the training parameters based on the output result, and then re-enter the step of 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.
[0073] Specifically, the second preset threshold is the maximum value of the loss value when the training parameters corresponding to the target fraud task can well adapt to the target fraud task, or it can also be understood as the maximum value of the loss value corresponding to the training parameters when the preset model can accurately identify the fraud type corresponding to the target fraud task. The method of gradient iteration to optimize the loss can be used to gradually obtain the optimal intermediate parameters corresponding to each fraud task.
[0074] Please combine with 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, where the target fraud task is any fraud task. Then, the setting parameters of the preset model, that is, 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. Then, 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 according to 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 that 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 adaptation to the target fraud task. Therefore, the training parameters can be adjusted based on the output result, and step 0112 is entered again to adjust the training parameters through multiple trainings until the training parameters have a high degree of adaptation to the target fraud task. In the case that 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 adaptation to the target fraud task. Therefore, 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. 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 passing the test 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 from the training. In the case that 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 from the test. In the case that 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 can be judged whether the current training parameters are adapted to the target fraud task according to the first loss value. In the case of non - adaptation, the training parameters are adjusted, and the preset model is trained again until an intermediate parameter with a first loss value less than the second preset threshold and a high degree of adaptation to the target fraud task is obtained. In this way, it can be ensured that the obtained intermediate parameters are all highly adapted to the corresponding fraud tasks.
[0077] Please refer to Figure 7 In some embodiments, step 011: training the corresponding preset models based on the initial parameters and the historical data corresponding to multiple fraud tasks respectively to obtain the intermediate parameters corresponding to each fraud task further includes:
[0078] Step 0116: randomly select target historical data from the historical data corresponding to each fraud task;
[0079] Step 0117: Train the corresponding preset models according to the target historical data and initial parameters corresponding to multiple fraud tasks to obtain the intermediate parameters corresponding to each fraud task.
[0080] Specifically, when training the preset models according to 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 the training set to train the models. The setting parameters of the preset models can be determined according to the initial parameters, and the corresponding preset models can be trained based on the target historical data corresponding to multiple fraud tasks to obtain the intermediate parameters corresponding to each fraud task. Among the historical data, the data that does not belong to the target historical data can be used as the test set to facilitate testing using the test set to ensure the finally obtained intermediate parameters
[0081] In this way, the training sets in each training process are different, ensuring the representativeness of the training sets, 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 computational burden to improve the training speed.
[0082] Please refer to Figure 8 , in some embodiments, Step 014: When receiving the current data corresponding to the current fraud task, train the preset model based on the target parameters and the current data to obtain a converged target warning model, including:
[0083] Step 0141: When receiving the current data corresponding to the current fraud task, adjust the setting parameters of the preset model according to the target parameters, and train the preset model based on the current data;
[0084] Step 0142: Calculate the 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, obtain the converged target warning model 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 re-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 receiving the current data corresponding to the current fraud task.
[0087] Specifically, the third preset threshold is the maximum value of the loss value when the target parameters can well adapt to the current fraud task, or it can also be understood as the maximum value of the loss value corresponding to the target parameters 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. Then, 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 according to the output result of the preset model, the current data corresponding to the current fraud task, and the corresponding preset loss value function. When the second loss value is greater than the third preset threshold, it can be considered that the current target parameters are still not well adapted to the current fraud task. Therefore, the target parameters can be adjusted based on the output result, and step 0142 can be entered again to adjust the target parameters through multiple trainings until the target parameters are highly adapted to the current fraud task. When the second loss value is less than the third preset threshold, it can be considered that the current target parameters are highly adapted to the current fraud task. Therefore, the setting parameters of the preset model can be adjusted according to the target parameters 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. 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 judged whether the current target parameters are adapted to the current fraud task according to the second loss value. If they are not adapted, the target parameters are adjusted, and the preset model is trained again until the second loss value is less than the third preset threshold and the target parameters with a high degree of adaptation to the current fraud task are obtained. In this way, it can be ensured that the obtained target parameters are highly adapted to the current fraud task, and the target warning model can accurately identify the fraud type corresponding to the current fraud task.
[0091] Please refer to Figure 9, To facilitate the better implementation of the model training method according to the embodiments of the present application, the embodiments of the present application further provide a model training apparatus 10. The model training apparatus 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 configured to train corresponding preset models respectively based on initial parameters and historical data corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each fraud task, and the intermediate parameters are determined based on the initial parameters. The adjustment module 12 is configured to, when the comprehensive loss value corresponding to each intermediate parameter is greater than a first preset threshold, adjust the initial parameters based on the output results of the preset models corresponding to each fraud task, and re-enter the step of training the preset models respectively based on the historical data and the initial parameters corresponding to multiple fraud tasks. The determination module 13 is configured to, when the comprehensive loss value is less than the first preset threshold, determine the target parameters according to the initial parameters corresponding to the intermediate parameters. The second training module 14 is configured to, when receiving the current data corresponding to the current fraud task, train the preset model based on the target parameters and the current data to obtain a converged target warning model.
[0092] Specifically, the adjustment module 12 is configured to determine a target loss value function according to the preset loss value functions corresponding to multiple fraud tasks; and adjust the initial parameters based on the target loss value function and the output results of the preset models corresponding to each fraud task.
[0093] The model training apparatus 10 further includes a calculation module 15. The calculation module 15 is configured to determine the loss values corresponding to each fraud task based on the preset loss value functions corresponding to multiple fraud tasks and the output results of the preset models; and determine the comprehensive loss value based on the loss values corresponding to each fraud task.
[0094] Specifically, the first training module 11 is configured to determine 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 one of the fraud tasks; 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 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, 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 re-enter the step of 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.
[0095] Specifically, the first training module 11 is configured to randomly select target historical data from the historical data corresponding to each fraud task; and train the corresponding preset models respectively based on the target historical data and the initial parameters corresponding to multiple fraud tasks to obtain intermediate parameters corresponding to each fraud task.
[0096] The second training module 14 is specifically configured to, when receiving the current data corresponding to the current fraud task, adjust the setting parameters of the preset model according to the target parameters, and train 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, 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 result, and then enter again the step of, when receiving the 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.
[0097] The model training device 10 further includes a partitioning module 16. The partitioning module 16 is configured to perform type partitioning according to historical fraud data and historical non-fraud data, so as to obtain historical data corresponding to multiple fraud tasks.
[0098] In the above, the model training device 10 has been described from the perspective of functional modules in combination with the drawings. These functional modules can be implemented in hardware form, can also 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 this application can be completed by the integrated logic circuit in the hardware in the processor and / or instructions in software form. The steps of the method disclosed in combination with the embodiments of this application can be directly embodied as being executed and completed by a hardware-encoded processor, or can be executed and completed by a combination of the hardware and software modules in the encoded processor. Optionally, the software module can be located in a mature storage medium in the art 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. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above method embodiments.
[0099] Please refer to Figure 10 , the computer device 100 of the embodiment of this application includes a processor 20, a memory 30, and a computer program. Among them, the computer program is stored in the memory 30 and is executed by the processor 20. The computer program includes instructions for executing the model training method of any one of the above embodiments.
[0100] Please refer to Figure 11 , the embodiment of this application further 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 one of the above embodiments are implemented. For the sake of brevity, it will not be elaborated here.
[0101] In the description of this specification, the descriptions referring to terms such as "certain embodiments", "in one example", "exemplarily", etc. mean that the specific features, structures, materials or characteristics described in connection 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 embodiments or examples. Moreover, the specific features, structures, materials or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples.
[0102] Any process or method description shown in a flowchart or otherwise described herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process, and the scope of the preferred embodiments of the present application includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in a reverse order according to the functions involved, not in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present application pertain.
[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 should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to 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 receiving current data corresponding to a current fraud task, training the preset model based on the target parameter and the current data to obtain a converged target early warning model, wherein the target early warning model is used to perform fraud early warning according to the operation data of the financial account; 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.
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: 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.
5. 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.
6. 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.
7. 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; A second training module is used to train the preset model based on the target parameter and the current data when receiving the current data corresponding to the current fraud task, so as to obtain a converged target warning model, wherein the target warning model is used to perform fraud warning according to the operation data of the financial account; The first training module is also 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.
8. 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 6.
9. 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-6.
Citation Information
Patent Citations
Fraud recognition model training method, fraud recognition method and device
CN109598331A
Model training and evaluation method, related device, equipment, medium and product
CN117151859A