CN114912549A - Training method of risk transaction identification model, and risk transaction identification method and device - Google Patents

Training method of risk transaction identification model, and risk transaction identification method and device Download PDF

Info

Publication number
CN114912549A
CN114912549A CN202210807503.4A CN202210807503A CN114912549A CN 114912549 A CN114912549 A CN 114912549A CN 202210807503 A CN202210807503 A CN 202210807503A CN 114912549 A CN114912549 A CN 114912549A
Authority
CN
China
Prior art keywords
risk
data samples
risk transaction
black
white
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210807503.4A
Other languages
Chinese (zh)
Other versions
CN114912549B (en
Inventor
王宁涛
傅幸
王维强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202210807503.4A priority Critical patent/CN114912549B/en
Publication of CN114912549A publication Critical patent/CN114912549A/en
Application granted granted Critical
Publication of CN114912549B publication Critical patent/CN114912549B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0635Risk analysis of enterprise or organisation activities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Resources & Organizations (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Evolutionary Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Development Economics (AREA)
  • Artificial Intelligence (AREA)
  • Finance (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Accounting & Taxation (AREA)
  • General Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Educational Administration (AREA)
  • Technology Law (AREA)
  • Image Analysis (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the specification describes a training method of a risk transaction identification model, a risk transaction identification method and a risk transaction identification device. According to the method of the embodiment, when the risk transaction identification model is trained, the classification labels of the acquired black data samples and white data samples are known. The data samples are identified by using the currently trained risk transaction identification model to obtain respective identification results, so that a loss function can be determined, and model training is continued by using the loss function. The determined loss function can improve the learning weight of the black data samples, so that when the black data samples used for model learning are less than the white data samples, the problem that the learning task inclines to the classification labels of the white data samples can be weakened, and the accuracy of the model for identifying the risk transactions is improved.

Description

Training method of risk transaction identification model, and risk transaction identification method and device
Technical Field
One or more embodiments of the present disclosure relate to the field of artificial intelligence, and in particular, to a method for training a risk transaction recognition model, a risk transaction recognition method, and an apparatus for the same.
Background
In the risk prevention and control field, the black samples and the white samples are subjected to learning training through a deep learning network, so that the risk identification can be performed on the account by using the trained model.
However, the ratio of black and white samples in the field of risk control is often widely different. For example, the ratio of black and white samples may be 1:1000 or 1:10000, or even higher. While black samples are generally more concerned for risk prevention and control, the model obtained based on the learning of the ratio of the black samples and the white samples is more concerned about the information of the white samples, so that the information of the black samples can be weakened or even omitted, and the accuracy of the obtained identification model is often lower when risk identification is carried out.
Disclosure of Invention
One or more embodiments of the present specification describe a training method of a risk transaction identification model, a risk transaction identification method, and an apparatus, which can improve accuracy of risk transaction identification.
According to a first aspect, there is provided a method of training a risk transaction recognition model, comprising:
acquiring a black data sample and a white data sample; the classification label of the black data sample is risk transaction, and the classification label of the white data sample is non-risk transaction;
inputting the black data samples and the white data samples into a currently trained risk transaction identification model to obtain identification results of the black data samples and the white data samples;
determining a loss function according to the recognition result of each black data sample and each white data sample; wherein the loss function is capable of increasing learning weights for the black data samples;
and continuously training the risk transaction identification model by using the loss function.
In one possible implementation, the recognition result includes: the label of the data sample is a probability value of risk transaction;
the determining a loss function according to the recognition result of each black data sample and each white data sample includes:
determining a first learning weight for the white data sample; and the number of the first and second groups,
determining a second learning weight for the black data sample; wherein the second learning weight is greater than the first learning weight, and the second learning weight satisfies: sorting the probability values of the risk transactions obtained by the risk transaction identification model from high to low to obtain N data samples corresponding to the first N probability values, wherein the ratio of the number of black data samples with classification labels as risk transactions contained in the N data samples to the number of all black data samples input into the risk transaction identification model is greater than a first preset threshold value;
determining the loss function according to the first learning weight and the second learning weight.
In one possible implementation, the determining the first learning weight of the white data sample includes:
acquiring a probability value of a risk transaction of a classification label output by a currently trained risk identification model;
determining the first learning weight according to the probability value of the risk transaction.
In one possible implementation, the determining the loss function according to the first learning weight and the second learning weight includes:
taking the first learning weight as a weight value for training the black data sample to obtain a black sample loss item;
taking the second learning weight as a weight value for training the white data sample to obtain a white sample loss item;
and calculating the sum of the black sample loss term and the white sample loss term to obtain the loss function.
In a possible implementation manner, the determining a loss function according to the recognition result of each black data sample and each white data sample includes:
the loss function is calculated using the following calculation:
Figure 294577DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 358347DEST_PATH_IMAGE002
for characterizing the loss function in such a way that,
Figure 213040DEST_PATH_IMAGE003
a label value corresponding to a classification label used to characterize the black data sample,
Figure 616339DEST_PATH_IMAGE004
the classification label used for representing the output of the currently trained risk identification model is the probability value of the risk transaction,
Figure 140862DEST_PATH_IMAGE005
a parameter for characterizing a degree of interest of a balanced risk transaction identification model for the black data sample and the white data sample.
In one possible implementation form of the method,
Figure 567295DEST_PATH_IMAGE005
is not greater than the first parameter; the first parameter is a value obtained by taking a logarithm of 10 as a proportional value of the number of the white data samples and the number of the black data samples.
In a possible implementation manner, a ratio value of the number of the black data samples to the number of the white data samples is not greater than a second preset threshold.
According to a second aspect, there is provided a risk transaction identification method comprising:
acquiring transaction data to be identified, wherein the transaction data is to be risk identified;
inputting the transaction data to be identified into the risk transaction identification model to obtain an identification result output by the risk transaction identification model; the risk transaction identification model is obtained by training by using the risk transaction identification model training method according to any embodiment of the first aspect.
According to a third aspect, there is provided a training apparatus for risk transaction recognition models, comprising: the device comprises an acquisition module, an input module, a determination module and a training module;
the acquisition module is configured to acquire black data samples and white data samples; the classification label of the black data sample is risk transaction, and the classification label of the white data sample is non-risk transaction;
the input module is configured to input the black data samples and the white data samples acquired by the acquisition module into a currently trained risk transaction identification model to obtain identification results of the black data samples and the white data samples;
the determining module is configured to determine a loss function according to the recognition result of each black data sample and each white data sample obtained by the input module; wherein the loss function is capable of increasing learning weights for the black data samples;
the training module is configured to continue training the risk transaction identification model by using the loss function determined by the determination module.
According to a fourth aspect, there is provided a risk transaction identification device comprising: the system comprises a transaction to be identified acquisition module and an identification module;
the transaction to be identified acquisition module is configured to acquire transaction data to be identified, wherein the transaction data to be identified is to be risk identified;
the identification module is configured to input the transaction data to be identified, which is acquired by the transaction to be identified acquisition module, into the risk transaction identification model to obtain an identification result output by the risk transaction identification model; wherein the risk transaction identification model is trained by using the training device of the risk transaction identification model of the third aspect.
According to a fifth aspect, there is provided a computing device comprising: a memory having executable code stored therein, and a processor that, when executing the executable code, implements the method of any of the first and second aspects described above.
According to the method and the device provided by the embodiment of the specification, when a risk transaction identification model is trained, the classification labels of the acquired black data samples and white data samples are known. The data samples are identified by using the currently trained risk transaction identification model to obtain respective identification results, so that a loss function can be determined, and model training is continued by using the loss function. The determined loss function can improve the learning weight of the black data samples, so that when the black data samples used for model learning are less than the white data samples, the problem that the learning task inclines to the classification labels of the white data samples can be weakened, and the accuracy of the model for identifying the risk transactions is improved.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present specification, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method for training a risk transaction identification model provided in one embodiment of the present description;
FIG. 2 is a flow chart of a method for determining a loss function provided in one embodiment of the present disclosure;
FIG. 3 is a flow chart of a risk transaction identification method provided by one embodiment of the present description;
FIG. 4 is a schematic diagram of a training apparatus for risk transaction identification models according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a risk transaction identification device provided in one embodiment of the present description.
Detailed Description
As previously mentioned, in the field of risk prevention and control, the ratio of black and white samples used to train a model is typically much different. This causes the estimates produced by the softmax layer in the deep learning network to be skewed towards the dominant labels in the multi-classification task. For example, the ratio of the black sample to the white sample is 1:10000, so that the label of the white sample is far larger than that of the black sample during model training. Therefore, estimates of softmax layer yield will be skewed towards the white sample label, thereby weakening and ignoring the information of the black sample. Therefore, the model cannot better learn the information of the black sample, and an accurate risk identification result cannot be obtained frequently when risk prediction is carried out.
Based on the method, the loss function capable of improving the learning weight of the black data sample is determined, the condition that the black data sample is less than the white data sample in model training is balanced, and therefore the accuracy of the model in model prediction is improved.
As shown in fig. 1, embodiments of the present specification provide a method for training a risk transaction recognition model, which may include the following steps:
step 101: acquiring a black data sample and a white data sample; the classification label of the black data sample is risk transaction, and the classification label of the white data sample is non-risk transaction;
step 103: inputting the black data samples and the white data samples into a currently trained risk transaction identification model to obtain identification results of the black data samples and the white data samples;
step 105: determining a loss function according to the recognition result of each black data sample and each white data sample; the loss function can improve the learning weight of the black data sample;
step 107: and continuously training the risk transaction recognition model by using the loss function.
In this embodiment, when the risk transaction identification model is trained, the classification labels of the obtained black data sample and white data sample are known. The data samples are identified by using the currently trained risk transaction identification model to obtain respective identification results, so that a loss function can be determined, and model training is continued by using the loss function. The determined loss function can improve the learning weight of the black data sample, so that when the black data sample learned by the model is less than the white data sample, the problem that the learning task inclines to the classification label of the white data sample can be weakened, and the accuracy of risk transaction identification of the model is improved.
The steps in FIG. 1 are described below with reference to specific examples.
First in step 101, black and white data samples are obtained.
The training samples used for training the risk transaction identification model comprise black data samples with classification labels of risk transactions and white data samples with classification labels of non-risk transactions. For example, for some transaction data, it can be determined that some transactions are illegal transactions through reporting of users, manual analysis, and the like, and the data corresponding to the transactions are black data samples with classification labels as risk transactions. Similarly, the data which does not contain the illegal transaction is determined to be a white data sample with a classification label of non-risk transaction through the report of the user, manual analysis and the like.
It is worth pointing out that in practical applications, the black data samples of risk transactions are usually much smaller than the white data samples of non-risk transactions, which on the one hand results in that the sample size of one type of label is too small to be effective for deep learning. On the other hand, the estimation of the yield of the softmax layer in the deep learning network can be inclined to the labels with more sample data volume in the multi-classification task, and the inclination can directly influence the accuracy of the multi-classification task. The scheme is intended to solve the problem of unbalanced classification labels, and therefore, in a possible implementation manner, the ratio value of the number of the black data samples and the number of the white data samples for training the risk transaction recognition model is not greater than a second preset threshold value.
For example, if the second preset threshold is 1:1000, the quantity ratio of the black data samples and the white data samples acquired for training the risk transaction identification model should not be greater than 1: 1000. For example, the ratio of the number of black data samples to the number of white data samples may be 1:5000, 1:10000, or the like.
Then, in step 103, the black data samples and the white data samples are input into the currently trained risk transaction recognition model, and recognition results of the black data samples and the white data samples are obtained.
In this step, the black data samples and the white data samples are input into the currently trained risk transaction recognition model, and the estimated values of the data samples are output from the output layer of the deep learning network for optimizing the loss function.
Further in step 105, a loss function is determined based on the recognition results of each of the black data samples and the white data samples.
In this step, the problem that the learning weight of the black data sample can be improved by determining the recognition result according to the black data sample and the white data sample is considered, so that the classification label imbalance of the black data sample and the white data sample is balanced is solved. For example, in one possible implementation, the recognition result may include a probability value that the label of the data sample is a risk transaction. Then, as shown in fig. 2, when determining the loss function according to the recognition result of each black data sample and white data sample, step 105 can be implemented by the following steps:
step 201: determining a first learning weight for the white data sample; and the number of the first and second groups,
step 203: determining a second learning weight for the black data sample; wherein the second learning weight is greater than the first learning weight, and the second learning weight satisfies: sorting the probability values of the risk transactions obtained by the risk transaction identification model from high to low to obtain N data samples corresponding to the first N probability values, wherein the ratio of the number of black data samples with classification labels as risk transactions contained in the N data samples to the number of all black data samples input into the risk transaction identification model is greater than a first preset threshold value;
step 205: a loss function is determined based on the first learning weight and the second learning weight.
In the present embodiment, in determining the loss function, first, the first learning weight of the white data sample and the second learning weight of the black data sample may be determined. And then, determining the loss function according to the first learning weight and the second learning weight. It is worth noting that the determined second learning weight of the black data sample is larger than the first learning weight of the white data sample, so that the learning attention of the black data sample in the training process can be improved, and the problem of few classification labels of the black data sample is balanced is solved.
In addition, after the probability values of the risk transactions obtained by the risk transaction identification model are ranked from high to low, and N data samples corresponding to the first N probability values are obtained, the second learning weight further satisfies that the ratio of the number of black data samples with classification labels as risk transactions included in the N data samples to the number of all black data samples input into the risk transaction identification model is greater than a first preset threshold. That is to say, when the model training is performed through the loss function determined by the scheme, when the trained model identifies each data sample, the identification result can have a higher coverage degree on the risk transaction label of the black data sample, so that the accuracy of risk prediction performed by the model can be improved.
For example, for 10000 data samples, the number of black data samples with class labels for risk trading is 80, and the number of white data samples with class labels for non-risk trading is 9920. After the 10000 data samples are identified by using the currently trained risk transaction identification model, the probability values of the classification labels obtained by the identification result for the risk transactions are sorted from high to low, and the data samples corresponding to the first 100 probability values are selected. The number of classification labels contained in the data sample with the probability value of the top 100 can be judged as the number contained in the black data sample. If the 100 data samples completely include 80 black data samples with actual classification labels of risk transactions, the coverage degree of the black data samples in the recognition result is 100%, which indicates that the recognition result has a higher coverage degree. Whereas more of the 80 black data samples labeled risk transactions were not included in the 100 data samples. For example, only 50 black data samples labeled as risk transactions are included, and the coverage degree at this time is 50/80=62.5%, obviously the coverage degree of the black data samples by the recognition result is lower. In this embodiment, by setting the first preset value, a ratio of the number of black data samples with classification labels included in the first N data samples as risk transactions to the number of all black data samples input into the risk transaction identification model is greater than a first preset threshold value, so that it is ensured that the identification result can have a higher coverage degree on the black data samples, and thus the reliability of the model for risk identification can be improved.
Step 201 is explained below.
Step 201 may consider the evaluation value according to the currently trained risk trading model to determine the first learning weight for the white data sample. For example, a probability value of a risk transaction output by the currently trained risk transaction identification model is obtained first, and then the first learning weight is determined according to the probability value of the risk transaction.
For example, a super parameter may be determined according to an empirical value based on a weight determination manner of the focal loss function, and the super parameter is used as an index of a probability value of the risk transaction, where a classification label output by the risk transaction identification model is used as the index, so as to obtain the first learning weight. Of course, in a possible implementation, the hyper-parameter may also be obtained by learning and constantly optimizing a neural network.
Step 203 is explained below.
Since the number of black data samples is less than the number of white data samples. Therefore, in this step, it is considered that the second learning weight is greater than the first learning weight, that is, a higher learning weight is given to the black data sample, so that the attention degree of the model to the black data sample is improved during model learning, and the problem of balancing the imbalance of the classification labels of the black data sample and the white data sample is solved.
Of course, in a possible implementation manner, the second learning weight may be set to 1, and is not determined according to the recognition result of the current risk transaction recognition model. That is, for the label value of the black data sample, the probability that the recognition result of the current risk transaction recognition model is the risk transaction is considered to be 100%. Therefore, the learning weight of the black data sample can be improved to the greatest extent, and the accuracy of the risk transaction identification model for risk transaction identification is improved.
Step 205 is explained below.
After determining the first learning weight for the white data sample and the second learning weight for the black data sample, a loss function is further determined based on the first learning weight and the second learning weight. For example, in one possible implementation, the first learning weight is used as a weight value of a training black data sample to obtain a black sample loss term, and the second learning weight is used as a weight value of a training white data sample to obtain a white sample loss term.
Then, the sum of the resulting black sample loss term and white sample loss term is calculated to obtain a loss function. Although the number of labels of the white data samples is larger, the second learning weight of the black data samples is larger. Therefore, when the model learns the sample data, the proportion of the black sample data in the optimization learning can be improved, so that the trained model is more reliable, and the accuracy of the model in risk identification is higher.
In one possible implementation, the value of the second learning weight may be set to 1, so that the loss function may be obtained by using the following calculation:
Figure 835465DEST_PATH_IMAGE006
wherein, the first and the second end of the pipe are connected with each other,
Figure 93271DEST_PATH_IMAGE007
for characterizing a loss function;
Figure 680373DEST_PATH_IMAGE008
the label value corresponding to the classification label for representing the black data sample, if the data sample is the black data sample, the label value
Figure 718736DEST_PATH_IMAGE009
(ii) a If the data sample is a white data sample, then the tag value
Figure 728280DEST_PATH_IMAGE010
Figure 778276DEST_PATH_IMAGE011
The classification label output by the risk identification model used for representing the current training is a probability value of risk transaction; namely, a data sample trained by a model is input into a currently trained risk identification model, and the classification label of the input data sample is judged to be the probability value of risk transaction in the identification result output by the model.
Figure 910180DEST_PATH_IMAGE012
And parameters for characterizing the attention of the balanced risk transaction identification model to the black data samples and the white data samples.
Figure 294894DEST_PATH_IMAGE012
Is a hyper-parameter and can be obtained by empirical or experimental values. In one possible implementation form of the method,
Figure 108129DEST_PATH_IMAGE012
is not greater than a first parameter which is a value obtained by taking the logarithm of 10 as a proportional value of the numbers of black data samples and white data samples. For example, if the ratio of black data samples to white data samples used to train the risk transaction identification model is 1:1000, then there are
Figure 137265DEST_PATH_IMAGE013
I.e. by
Figure 581015DEST_PATH_IMAGE012
Should be no more than 3.
In a conventional cross entropy loss function, a loss term of a black data sample and a loss term of a white data sample both determine corresponding learning weights according to the recognition result of the samples. For example, in the focal loss function, the learning weight of the black sample may be
Figure 62812DEST_PATH_IMAGE014
Figure 679739DEST_PATH_IMAGE015
For model inputThe classification label of the sample data is the probability of risk transaction, and the value of the classification label is between 0 and 1.
Figure 192409DEST_PATH_IMAGE014
Then a multiplier less than 1 will reduce the proportion of black samples in the optimization target. In this embodiment, the black sample loss term of the black data sample is considered
Figure 931695DEST_PATH_IMAGE016
The second learning weight in (1) is set to 1. Thus, for the label value of the black data sample, the probability that the identification result of the current risk transaction identification model is the risk transaction is considered to be 100%, so that the learning weight of the black data sample is improved to the maximum extent, and the accuracy of the risk transaction identification model for predicting the risk transaction is improved.
For example, for black data samples, if the conventional local loss function is used, if the recognition result of the risk transaction recognition model is 0.8, the parameter is set
Figure 104050DEST_PATH_IMAGE017
Is 2. Then the penalty based on the conventional focal loss function is
Figure 931192DEST_PATH_IMAGE018
And the loss obtained based on the loss function provided by the scheme is
Figure 200499DEST_PATH_IMAGE019
Obviously, the attention of the loss function obtained based on the scheme to the black data sample is higher, so that the problem of unbalanced label of the balanced black data sample and the balanced white data sample can be solved.
Finally, in step 107, the risk transaction recognition model continues to be trained using the loss function.
The process of training the risk transaction recognition model is aimed at minimizing the above-mentioned loss function. Specifically, on the basis of the loss function, in each iteration process, the value of the loss function is used for back propagation, and the model parameters of the risk transaction identification model are updated until an iteration stop condition is reached. Where the iteration stop condition may be, for example, a loss function convergence, a number of iterations reaching a preset number threshold, etc.
As shown in fig. 3, an embodiment of the present specification provides a risk transaction identification method, which may include the following steps:
step 301: acquiring transaction data to be identified, wherein the transaction data is to be risk identified;
step 303: inputting transaction data to be identified into a risk transaction identification model to obtain an identification result output by the risk transaction identification model; the risk transaction identification model is obtained by training by using a training method of the risk transaction identification model provided by any embodiment of the specification.
Because the risk transaction identification model is obtained by utilizing the loss function training which can improve the learning weight of the black data sample, the problem that the information learned by the model inclines to the label value of the white data sample due to the fact that the black data sample is far less than the white data sample is considered, and therefore the accuracy of identifying the risk transaction can be improved.
As shown in fig. 4, an embodiment of the present specification provides a training apparatus for a risk transaction identification model, including: an acquisition module 401, an input module 402, a determination module 403 and a training module 404;
an obtaining module 401 configured to obtain black data samples and white data samples; the classification label of the black data sample is risk transaction, and the classification label of the white data sample is non-risk transaction;
an input module 402, configured to input the black data samples and the white data samples acquired by the acquisition module 401 into the currently trained risk transaction identification model, so as to obtain identification results of the black data samples and the white data samples;
a determining module 403, configured to determine a loss function according to the recognition result of each black data sample and white data sample obtained by the input module 402; the loss function can improve the learning weight of the black data sample;
a training module 404 configured to continue training the risk transaction identification model using the loss function determined by the determination module 403.
In one possible implementation, the recognition result includes: the label of the data sample is a probability value of risk transaction;
the determining module 403, when determining the loss function according to the recognition result of each black data sample and white data sample, is configured to perform the following operations:
determining a first learning weight for the white data sample; and the number of the first and second groups,
determining a second learning weight for the black data sample; wherein the second learning weight is greater than the first learning weight, and the second learning weight satisfies: sorting the probability values of the risk transactions obtained by the risk transaction identification model from high to low to obtain N data samples corresponding to the first N probability values, wherein the ratio of the number of black data samples with classification labels as risk transactions contained in the N data samples to the number of all black data samples input into the risk transaction identification model is greater than a first preset threshold value;
a loss function is determined based on the first learning weight and the second learning weight.
In one possible implementation, the determining module 403, in determining the first learning weights for the white data samples, is configured to perform the following operations:
acquiring a probability value of a risk transaction of a classification label output by a currently trained risk identification model;
a first learning weight is determined based on the probability value of the risk transaction.
In one possible implementation, the determining module 403, when determining the loss function according to the first learning weight and the second learning weight, is configured to perform the following operations:
taking the first learning weight as a weight value of the training black data sample to obtain a black sample loss item;
taking the second learning weight as a weight value of the training white data sample to obtain a white sample loss item;
and calculating the sum of the black sample loss term and the white sample loss term to obtain a loss function.
In one possible implementation, the determining module 403, when determining the loss function according to the recognition result of each black data sample and white data sample, is configured to calculate the loss function by using the following calculation formula:
Figure 969741DEST_PATH_IMAGE020
wherein the content of the first and second substances,
Figure 629393DEST_PATH_IMAGE021
for the purpose of characterizing the loss function,
Figure 384859DEST_PATH_IMAGE022
the label value corresponding to the class label used to characterize the black data sample,
Figure 118460DEST_PATH_IMAGE023
the classification label used for representing the output of the currently trained risk identification model is the probability value of the risk transaction,
Figure 933969DEST_PATH_IMAGE024
and parameters for characterizing the attention of the balanced risk transaction identification model to the black data samples and the white data samples.
In one possible implementation, the loss function determined by the determination module 403 may include, among the loss functions,
Figure 80917DEST_PATH_IMAGE024
is not greater than the first parameter; the first parameter is a value obtained by taking the logarithm of 10 as the proportional value of the number of the white data samples and the black data samples.
In a possible implementation manner, the ratio of the number of the black data samples to the number of the white data samples acquired by the acquiring module 401 is not greater than the second preset threshold.
As shown in fig. 5, an embodiment of the present specification further provides a risk transaction identification apparatus, including: a transaction to be identified acquisition module 501 and an identification module 502;
the transaction to be identified acquisition module 501 is configured to acquire transaction data to be identified, which is to be risk identified;
the identification module 502 is configured to input the transaction data to be identified, which is acquired by the transaction to be identified acquisition module 501, into the risk transaction identification model, so as to obtain an identification result output by the risk transaction identification model; the risk transaction identification model is obtained by training by using a training device of the risk transaction identification model provided in any embodiment of the specification.
The present specification also provides a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of the embodiments of the specification.
The present specification also provides a computing device comprising a memory having stored therein executable code and a processor that, when executing the executable code, implements the method of any of the embodiments of the specification.
It is to be understood that the schematic structure of the embodiment in this specification does not constitute a specific limitation to the training device of the risk transaction identification model and the risk transaction identification device. In other embodiments of the specification, the training means of the risk transaction identification model and the risk transaction identification means may comprise more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
For the information interaction, execution process, and other contents between the units in the apparatus, the specific contents may refer to the description in the method embodiment of the present specification because the same concept is based on the method embodiment of the present specification, and are not described herein again.
Those skilled in the art will recognize that in one or more of the examples described above, the functions described in this specification can be implemented in hardware, software, hardware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
The above-mentioned embodiments, the purpose, technical solutions and advantages described in the present specification are further described in detail, it should be understood that the above-mentioned embodiments are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the present invention should be included in the scope of the present invention.

Claims (11)

1. The training method of the risk transaction identification model comprises the following steps:
acquiring a black data sample and a white data sample; the classification label of the black data sample is risk transaction, and the classification label of the white data sample is non-risk transaction;
inputting the black data samples and the white data samples into a currently trained risk transaction identification model to obtain identification results of the black data samples and the white data samples;
determining a loss function according to the recognition result of each black data sample and each white data sample; wherein the loss function is capable of increasing learning weights for the black data samples;
and continuously training the risk transaction identification model by using the loss function.
2. The method of claim 1, wherein the recognition result comprises: the label of the data sample is a probability value of risk transaction;
the determining a loss function according to the recognition result of each black data sample and each white data sample includes:
determining a first learning weight for the white data sample; and the number of the first and second groups,
determining a second learning weight for the black data sample; wherein the second learning weight is greater than the first learning weight, and the second learning weight satisfies: sorting the probability values of the risk transactions obtained by the risk transaction identification model from high to low to obtain N data samples corresponding to the first N probability values, wherein the ratio of the number of black data samples with classification labels as risk transactions contained in the N data samples to the number of all black data samples input into the risk transaction identification model is greater than a first preset threshold value;
determining the loss function according to the first learning weight and the second learning weight.
3. The method of claim 2, wherein the determining a first learning weight for the white data sample comprises:
acquiring a probability value of a risk transaction of a classification label output by a currently trained risk identification model;
determining the first learning weight according to the probability value of the risk transaction.
4. The method of claim 2, wherein the determining the loss function from the first learning weight and the second learning weight comprises:
taking the first learning weight as a weight value for training the black data sample to obtain a black sample loss item;
taking the second learning weight as a weight value for training the white data sample to obtain a white sample loss item;
and calculating the sum of the black sample loss term and the white sample loss term to obtain the loss function.
5. The method of claim 1, wherein determining a loss function based on the recognition of each black and white data sample comprises:
calculating the loss function using the following calculation:
Figure 743893DEST_PATH_IMAGE001
wherein the content of the first and second substances,
Figure 395454DEST_PATH_IMAGE002
for characterizing the loss function in a manner that is,
Figure 706350DEST_PATH_IMAGE003
a label value corresponding to a classification label used to characterize the black data sample,
Figure 773663DEST_PATH_IMAGE004
the classification label used for representing the output of the currently trained risk identification model is the probability value of the risk transaction,
Figure 119193DEST_PATH_IMAGE005
a parameter for characterizing a degree of interest of a balanced risk transaction identification model for the black data sample and the white data sample.
6. The method of claim 5, wherein the value of (d) is not greater than the first parameter; the first parameter is a value obtained by taking a logarithm of 10 as a proportional value of the number of the white data samples and the number of the black data samples.
7. The method according to any one of claims 1 to 6, wherein a value of a ratio of the number of black data samples to the number of white data samples is not greater than a second preset threshold.
8. A risk transaction identification method, comprising:
acquiring transaction data to be identified, wherein the transaction data is to be risk identified;
inputting the transaction data to be identified into the risk transaction identification model to obtain an identification result output by the risk transaction identification model; wherein the risk transaction identification model is trained using the method of any one of claims 1 to 7.
9. Training device of risk transaction recognition model, includes: the device comprises an acquisition module, an input module, a determination module and a training module;
the acquisition module is configured to acquire black data samples and white data samples; the classification label of the black data sample is risk transaction, and the classification label of the white data sample is non-risk transaction;
the input module is configured to input the black data samples and the white data samples acquired by the acquisition module into a currently trained risk transaction identification model to obtain identification results of the black data samples and the white data samples;
the determining module is configured to determine a loss function according to the recognition result of each black data sample and each white data sample obtained by the input module; wherein the loss function is capable of increasing learning weights for the black data samples;
the training module is configured to continue training the risk transaction identification model by using the loss function determined by the determination module.
10. Risk transaction identification apparatus comprising: the system comprises a transaction to be identified acquisition module and an identification module;
the transaction to be identified acquisition module is configured to acquire transaction data to be identified, wherein the transaction data to be identified is to be risk identified;
the identification module is configured to input the transaction data to be identified, which is acquired by the transaction to be identified acquisition module, into the risk transaction identification model to obtain an identification result output by the risk transaction identification model; wherein the risk transaction identification model is trained by using the training device of the risk transaction identification model according to claim 9.
11. A computing device comprising a memory having executable code stored therein and a processor that, when executing the executable code, implements the method of any of claims 1-8.
CN202210807503.4A 2022-07-11 2022-07-11 Training method of risk transaction identification model, and risk transaction identification method and device Active CN114912549B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210807503.4A CN114912549B (en) 2022-07-11 2022-07-11 Training method of risk transaction identification model, and risk transaction identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210807503.4A CN114912549B (en) 2022-07-11 2022-07-11 Training method of risk transaction identification model, and risk transaction identification method and device

Publications (2)

Publication Number Publication Date
CN114912549A true CN114912549A (en) 2022-08-16
CN114912549B CN114912549B (en) 2022-12-13

Family

ID=82772742

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210807503.4A Active CN114912549B (en) 2022-07-11 2022-07-11 Training method of risk transaction identification model, and risk transaction identification method and device

Country Status (1)

Country Link
CN (1) CN114912549B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115564577A (en) * 2022-12-02 2023-01-03 成都新希望金融信息有限公司 Abnormal user identification method and device, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569508A (en) * 2019-09-10 2019-12-13 重庆邮电大学 Method and system for classifying emotional tendencies by fusing part-of-speech and self-attention mechanism
CN110991652A (en) * 2019-12-02 2020-04-10 北京迈格威科技有限公司 Neural network model training method and device and electronic equipment
CN111582651A (en) * 2020-04-09 2020-08-25 上海淇毓信息科技有限公司 User risk analysis model training method and device and electronic equipment
CN112750038A (en) * 2021-01-14 2021-05-04 中国工商银行股份有限公司 Transaction risk determination method and device and server
WO2021178685A1 (en) * 2020-03-06 2021-09-10 Genentech, Inc. Class-disparate loss function to address missing annotations in training data
CN113850300A (en) * 2021-09-02 2021-12-28 支付宝(杭州)信息技术有限公司 Method and device for training classification model
CN114140238A (en) * 2021-12-02 2022-03-04 中国工商银行股份有限公司 Abnormal transaction data identification method and device, computer equipment and storage medium
CN114239740A (en) * 2021-12-21 2022-03-25 税友信息技术有限公司 Name learning method, system and related device
CN114612728A (en) * 2022-03-25 2022-06-10 Oppo广东移动通信有限公司 Model training method and device, computer equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569508A (en) * 2019-09-10 2019-12-13 重庆邮电大学 Method and system for classifying emotional tendencies by fusing part-of-speech and self-attention mechanism
CN110991652A (en) * 2019-12-02 2020-04-10 北京迈格威科技有限公司 Neural network model training method and device and electronic equipment
WO2021178685A1 (en) * 2020-03-06 2021-09-10 Genentech, Inc. Class-disparate loss function to address missing annotations in training data
CN111582651A (en) * 2020-04-09 2020-08-25 上海淇毓信息科技有限公司 User risk analysis model training method and device and electronic equipment
CN112750038A (en) * 2021-01-14 2021-05-04 中国工商银行股份有限公司 Transaction risk determination method and device and server
CN113850300A (en) * 2021-09-02 2021-12-28 支付宝(杭州)信息技术有限公司 Method and device for training classification model
CN114140238A (en) * 2021-12-02 2022-03-04 中国工商银行股份有限公司 Abnormal transaction data identification method and device, computer equipment and storage medium
CN114239740A (en) * 2021-12-21 2022-03-25 税友信息技术有限公司 Name learning method, system and related device
CN114612728A (en) * 2022-03-25 2022-06-10 Oppo广东移动通信有限公司 Model training method and device, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
KENTO DOI等: "The Effect of Focal Loss in Semantic Segmentation of High Resolution Aerial Image", 《IGARSS 2018 - 2018 IEEE INTERNATIONAL GEOSCIENCE AND REMOTE SENSING SYMPOSIUM》 *
孙权等: "基于数据挖掘的商户风险评分方法和系统", 《软件产业与工程》 *
杨悦: "面向不平衡数据的分类方法研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115564577A (en) * 2022-12-02 2023-01-03 成都新希望金融信息有限公司 Abnormal user identification method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114912549B (en) 2022-12-13

Similar Documents

Publication Publication Date Title
EP3767536A1 (en) Latent code for unsupervised domain adaptation
EP3582150A1 (en) Method of knowledge transferring, information processing apparatus and storage medium
CN111127364B (en) Image data enhancement strategy selection method and face recognition image data enhancement method
CN110852755A (en) User identity identification method and device for transaction scene
CN111460250A (en) Image data cleaning method, image data cleaning device, image data cleaning medium, and electronic apparatus
CN109685104B (en) Determination method and device for recognition model
CN112883990A (en) Data classification method and device, computer storage medium and electronic equipment
CN114912549B (en) Training method of risk transaction identification model, and risk transaction identification method and device
CN116263785A (en) Training method, classification method and device of cross-domain text classification model
CN116912568A (en) Noise-containing label image recognition method based on self-adaptive class equalization
CN113343123B (en) Training method and detection method for generating confrontation multiple relation graph network
CN113543117A (en) Prediction method and device for number portability user and computing equipment
CN113256335B (en) Data screening method, multimedia data delivery effect prediction method and device
JP2014085948A (en) Misclassification detection apparatus, method, and program
CN111582647A (en) User data processing method and device and electronic equipment
JP2010272004A (en) Discriminating apparatus, discrimination method, and computer program
CN110880117A (en) False service identification method, device, equipment and storage medium
CN110717037A (en) Method and device for classifying users
CN112598662B (en) Image aesthetic description generation method based on hidden information learning
CN115482084A (en) Method and device for generating wind control rule set
CN111753519B (en) Model training and identifying method and device, electronic equipment and storage medium
CN112884065A (en) Deep learning model robust boundary assessment method and device based on support vector machine and application
CN113297378A (en) Text data labeling method and system, electronic equipment and storage medium
CN111026661A (en) Method and system for comprehensively testing usability of software
CN118037738B (en) Asphalt pavement crack pouring adhesive bonding performance detection method and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant