Bank card fraud prediction method based on Stacking fusion algorithm

By using a method based on the Stacking fusion algorithm in bank card fraud prediction, multiple base models and meta-models are constructed, and parameters are optimized, which solves the problem of declining prediction effects of traditional algorithms in a big data environment and achieves higher predictions. Accuracy and generalization ability.

CN117934139BActive Publication Date: 2024-08-30PEOPLES POLICE UNIV OF CHINA (INT LAW ENFORCEMENT COOP INST OF THE MINISTRY OF PUBLIC SECURITY CHINA PEACEKEEPING POLICE TRAINING CENT)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410119601.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2024-08-30
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

Existing machine learning algorithms have limitations in predicting bank card fraud. Especially when faced with large amounts of data, traditional machine algorithms cannot effectively cope with the huge data dimensions, resulting in a decline in prediction effects, and the traditional Stacking integration algorithm fails in the basic model. The fusion and matching effect with the meta-model is uncertain, and it is difficult to determine the best combination, resulting in a decrease in accuracy.

Method used

A bank card fraud prediction method based on the Stacking fusion algorithm is adopted, by constructing multiple base models and meta-models, using grid search and Bayesian optimization to select the best parameters, and combining the SMOTE oversampling method to equalize the data. Logistic regression, Naive Bayes, KNN neighbor algorithm and SVC algorithm are used for model construction to form a Stacking fusion algorithm model to improve prediction performance and generalization capabilities.

Benefits of technology

The accuracy and generalization ability of bank card fraud prediction are improved. The model accuracy is increased by about 2%, the accuracy can reach more than 96%, and the classification ability and data quality are significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117934139B
    Figure CN117934139B
Patent Text Reader

Abstract

The present invention discloses a bank card fraud prediction method based on Stacking fusion algorithm, which belongs to the field of big data prediction and includes the following steps: S1, obtaining a desensitized bank card fraud original data set, and preprocessing it to obtain an input data set; S2, constructing a bank card crime prediction model based on the Stacking fusion algorithm model; S3, predicting using the bank card crime prediction model based on the Stacking fusion algorithm model. The present invention adopts the bank card fraud prediction method based on the Stacking fusion algorithm, and improves the prediction performance and generalization ability of the traditional Stacking model by fusing different base models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of big data prediction, and in particular to a bank card fraud prediction method based on a Stacking fusion algorithm. Background Art

[0002] The popularity of bank cards and the rapid development of bank card business have also brought about a continuous increase in bank card fraud crimes, disrupted the bank card management order, and endangered the property safety of the general public.

[0003] To address this problem, existing technologies generally use machine learning algorithms based on big data technology, which build an accurate prediction system and framework for bank card fraud based on big data technology, and increase the pre-emptive prevention and early warning of bank card fraud crimes. Further analysis and research on how to predict and discover bank card fraud crimes can provide early warnings before criminals cause losses to citizens' personal property and the financial system, solving the problem that traditional crime prediction relies on a large number of police forces and is not very accurate, and saving grassroots police resources.

[0004] The main existing research is as follows:

[0005] In "Construction of a Monitoring and Early Warning System for Telecom Network Fraud Crimes", Wang Hailin summarizes the behavioral patterns of telecom network fraud crimes in the preparatory stage and the stage of committing the crime, extracts the characteristic points and risk factor indicators of telecom network fraud crimes, and uses data mining, data collision and artificial intelligence technology to build a monitoring and early warning system that integrates identification, early warning, stop loss and investigation. The system is used to evaluate the degree to which the behavior deviates from normal behavior, and to achieve pre-fraud personnel interception, in-process early warning and dissuasion, and post-fraud tracking and tracing.

[0006] In "New Changes in Crime under the Background of Big Data and the Construction of Smart Investigation Thinking System", Liu Changling studied the new situation and changes of crime under the background of big data, and the smart police model has undergone tremendous changes. On the basis of inheriting the traditional investigation thinking, smart investigation thinking proposes crime prediction thinking based on data modeling and mining, investigation decision-making thinking that deeply deconstructs and reshapes using scientific methods, synthetic combat investigation thinking that uses intelligent technology to launch all-police linkage, data fusion thinking that promotes the integration of investigation resources, police data analysis thinking that uses information technology, and data security and privacy protection. The systematic assembly of thinking patterns together empowers smart policing.

[0007] In the article "Early Warning and Prevention Mechanism for Telecom Network Fraud Crimes under the Background of Big Data - Taking the "Pig Killing" Fraud Crime as an Example", Fu Lin, Xue Nan and Song Xiaohui used big data technology to establish an early warning and prevention mechanism for telecommunications network fraud crimes, starting from multiple aspects, such as cultivating professional big data police talents, establishing a diversified early warning and prevention system, improving laws and industry norms, etc., to achieve prevention and emergency response, and solve the problem of network fraud crimes represented by "pig killing".

[0008] Zhuang Hua proposed a big data early warning model for telecommunications network fraud crimes in "Big Data Early Warning of Telecommunications Network Fraud Crimes", based on the constructed crime model. The model can start from the two aspects of criminal information flow and criminal capital flow, and use big data technology to discover false information from the source, identify it from the propagation process, and intercept it from the terminal equipment; at the same time, establish a monitoring model for the suspected victim's capital account that adapts to the dynamic changes of fraud methods, and realize capital flow data early warning, so as to achieve the purpose of preventing telecommunications network fraud crimes.

[0009] In "Research on the Governance of Telecom Network Fraud Crimes in the Big Data Era - From the Perspective of the "Fengqiao Experience" in the New Era", Wang Ge proposed to use the "Fengqiao Experience" concept and methods of the new era to govern telecom network fraud crimes. In terms of governance subjects, a multi-faceted collaborative governance model can be adopted to achieve joint efforts in combating and preventing. At the same time, it is necessary to strengthen the construction of professional teams and increase the intensity of crackdowns on related crimes. In terms of governance methods, the focus is on improving the ability of accurate early warning in advance and effectively preventing crimes; and building a full-scale publicity and prevention model, improving publicity effectiveness, and forming an integrated governance system for combating and preventing.

[0010] In "Early Warning and Countermeasures of Cross-border Telecom Network Fraud Crimes under the Background of Big Data - Taking Fraud by Impersonating Public Security, Procuratorate and Law as an Example", Wu Yuewen analyzed the characteristics of the detection of a large number of cross-border telecommunications network fraud crimes. Due to the constraints of national boundaries and laws, it is difficult to give early warnings in advance and conduct comprehensive investigations and evidence collection afterwards. In order to solve this dilemma, it is proposed to use big data technology in investigative thinking, propose innovative case-handling model thinking of police-enterprise cooperation, connect internal data with external technology, and explore the use of technology in solving cases. The new smart investigative direction of precise prevention and control and precise interception is carried out in the form of regional units.

[0011] Chen Xinyi, Ge Gaojing and Yuan Zeyuan believed in the study of prevention and control countermeasures of telecommunication fraud crimes under the background of "intelligence-led policing" that in order to effectively deal with telecommunication network fraud crimes, it is necessary to establish a scientific early warning and prevention mechanism. A telecommunication network fraud crime early warning model based on big data technology was proposed. The model aims to achieve pre-warning monitoring and emergency disposal during the event, and focuses on the governance of network fraud crimes represented by "pig killing". At the same time, a monitoring model for the suspected victim's fund account is established to adapt to the dynamic changes of fraud methods.

[0012] Hitesh Kumar Reddy ToppiReddy et al. proposed in "Crime Prediction & Monitoring Framework Based on Spatial Analysis" that the occurrence of crime depends on many complex factors. For example, the area where the crime is distributed is predicted, and the results are presented to police officers using visualization technology to help them better understand and use crime data. This method can help law enforcement agencies better understand the patterns and trends of criminal activities so as to prevent and combat crime more effectively. At the same time, this method can also provide scholars and researchers with a deeper understanding of criminal activities so as to further study and explore the nature and root causes of criminal phenomena.

[0013] Shu Wei Tao, Ooi Chong Yan, et al., in A Proposed Bi-layer Crime Prevention Framework Using Big Data Analytics, provide a two-layer crime prevention framework by studying multiple areas including crime data collection and preprocessing, crime data analysis, crime prediction, and crime prevention. The first layer is intended to support the daily operations of law enforcement agencies, while the second layer provides countermeasures for the first layer. Both layers aim to reduce crime rates by effectively utilizing various big data technologies and engaging law enforcement agencies. The proposed crime prevention framework will gradually and continuously collect crime data to further understand criminal behavior.

[0014] Cristina Kadar, Rudolf Maculan, et al. develop a machine learning model for spatio-temporal prediction in "Public decision support for low population density areas: An imbalance-aware hyper-ensemble for spatio-temporal crime prediction" that is specifically adjusted for the imbalanced distribution of class labels and tested in a real-world setting with state-of-the-art predictors (i.e., fine resolution of socioeconomic, geographic, temporal, meteorological, and crime variables). The proposed imbalance-aware hyper-ensemble significantly improves the hit rate from 18.1% to 24.6% when targeting the top 5% of hotspots and from 53.1% to 60.4% when targeting the top 20% of hotspots. As a direct impact, the findings help law enforcement decision makers and can help provide public decision support in areas with low population density.

[0015] Matthew S. Gerber, in Predicting crime using Twitter and kernel density estimation, uses Twitter-specific language analysis and statistical topic modeling to automatically identify discussion topics in major U.S. cities. These topics are then incorporated into a crime prediction model and show that for 19 of the 25 crime types studied, the addition of Twitter data improves crime prediction performance compared to standard methods based on kernel density estimation. Several performance bottlenecks are identified that may affect the use of Twitter in practical decision support systems. Important areas for future work in this study are also pointed out, including deeper semantic analysis of message content, temporal modeling, and incorporation of auxiliary data sources. This research has particular significance for criminal justice decision makers responsible for the allocation of crime prevention resources.

[0016] Michail Misyrlis, Chung Ming Cheung and others studied the application of traditional regression methods in predicting crime incidents in Portland in "Spatio-Temporal Modeling of Criminal Activity". First, the region was divided into equally spaced units, and the spatial autocorrelation of crime rates between adjacent units was studied. Then, multiple time series were introduced into the regression model, including the time series of the current unit and adjacent units. The idea of ​​fuzzy algorithm was used to further increase the accuracy of the algorithm, achieving higher accuracy and efficiency than the moving window average method.

[0017] In summary, the various mature machine learning algorithms at this stage rely on mathematical ideas with different principles and show great differences in practical applications. However, since a single machine learning method often has limitations in solving some complex crime prediction problems, and when faced with some large-scale tasks, traditional machine algorithms cannot cope with the huge data dimensions, the effect of crime prediction is greatly reduced, which limits the role of big data technology in crime prediction.

[0018] In view of this, although there is a precedent of using the Stacking algorithm (the Stacking algorithm is an integration algorithm, which belongs to heterogeneous integration. It has two cores: base model and meta-model. The basic idea is to use the prediction results of the base model as the input features of the meta-model.), the traditional Stacking integration algorithm can fuse multiple models and improve the generalization and accuracy of the model to a certain extent, but it still has the following shortcomings: the fusion matching effect of the base model and the meta-model is uncertain, and the best matching combination cannot be directly determined for specific data, and a lot of calculation verification is required. And when there are defects in the combination of the base model and the meta-model when processing the characteristics of the data set, the model result of the fusion strategy may have a decrease in accuracy. Summary of the invention

[0019] To solve the above problems, the present invention provides a bank card fraud prediction method based on the Stacking fusion algorithm, which improves the prediction performance and generalization ability of the traditional Stacking model by fusing different base models.

[0020] To achieve the above object, the present invention provides a bank card fraud prediction method based on the Stacking fusion algorithm, comprising the following steps:

[0021] S1. Obtain the desensitized bank card fraud original data set and preprocess it to obtain the input data set;

[0022] S2. Construct a bank card crime prediction model based on the Stacking fusion algorithm model;

[0023] S3. Use the bank card crime prediction model based on the Stacking fusion algorithm model to make predictions.

[0024] Preferably, the data in the desensitized bank card fraud original data set described in step S1 contains transaction feature descriptions;

[0025] The pre-processing described in step S1 comprises the following steps:

[0026] S11. Use the SMOTE oversampling method to perform data oversampling and balancing processing on the desensitized bank card fraud original data set;

[0027] S12. Feature analysis: Draw a data distribution diagram of different transaction feature descriptions, and select transaction feature descriptions with continuous values ​​as feature variables as the basis for determining whether the relationship with the target feature is the relationship between bank card fraud data.

[0028] Preferably, the transaction feature description includes continuous values ​​and binomial distribution values, and the continuous values ​​include the distance between the bank card transaction location and the home, the distance from the last transaction, and the ratio of the median price of the most recent transaction to the median price of previous transactions;

[0029] The binomial distribution values ​​include whether the transaction occurred at the same merchant, whether the transaction was conducted through a bank card, whether a PIN code was used during the transaction, and whether it was an online transaction order.

[0030] Preferably, step S3 specifically includes the following steps:

[0031] S31. Build base model:

[0032] S311, construct four base models based on logistic regression, naive Bayes, KNN neighbor algorithm and SVC algorithm respectively;

[0033] S312, using grid search and Bayesian optimization to select the best parameters of four base models respectively, to obtain four best base models;

[0034] S313, fitting four optimal base models using a 3-fold cross validation method, and evaluating the fitting results using a classification algorithm, and selecting the optimal base model according to the fitting results;

[0035] S32. Constructing the meta-model:

[0036] S321, construct four meta-models based on logistic regression, naive Bayes, KNN neighbor algorithm and SVC algorithm respectively;

[0037] S322, using grid search and Bayesian optimization to select the best parameters of four base models respectively, and obtain four best meta-models;

[0038] S323, fitting four optimal meta-models using a 3-fold cross validation method, and evaluating the fitting results using a classification algorithm, and selecting the optimal meta-model according to the fitting results;

[0039] S33. The optimal base model is used as feature input and imported into the optimal meta-model to obtain the Stacking fusion algorithm model.

[0040] Preferably, the logistic regression expression described in S311 and S321 is as follows:

[0041]

[0042] In the formula, x represents the input variable; y represents the output variable; ω T represents weight; g represents Sigmoid function;

[0043] The Naive Ye algorithm is based on Bayes' theorem, which is expressed as follows:

[0044]

[0045] In the formula, p(c i |w) means that condition c occurs when condition w occurs i The probability of occurrence; p(w|c i ) means that under condition c i The probability of condition w occurring when the condition occurs; p(c i ) represents the condition c i The probability of occurrence; p(w) represents the probability of condition w occurring;

[0046] Coordinate Euclidean distance of KNN neighbor algorithm:

[0047]

[0048] In the formula, x1 and y1 represent the horizontal and vertical coordinates of the first sample respectively; x2 and y2 represent the horizontal and vertical coordinates of the second sample respectively; n represents the number of samples.

[0049] Preferably, the evaluation indicators of the classification algorithm described in S313 and S323 include accuracy, recall, precision, AUC, Log loss function, and f1-score used to represent the harmonic mean of precision and recall.

[0050] Preferably, the 3-fold cross-validation method described in S313 and S323 divides the input data set into a training set, a test set and a validation set, and divides the training set into a first training set and a second training set in proportion, wherein the first training set is used to fit the best base model, and the second training set is used to fit the best meta-model;

[0051] In S33, the output matrix of the optimal base model is combined with the test set matrix and input into the meta-model as the extended prediction matrix.

[0052] Preferably, the input features described in S33 also include a probability matrix of each feature variable predicted by the base model.

[0053] Preferably, the probability values ​​in the probability matrix are sorted from high to low, and weights are assigned to the sorted probability values ​​from high to low, and then the probability matrix after weight assignment is used as the feature input of the meta-model.

[0054] The present invention has the following beneficial effects:

[0055] 1. Combined with the grid search strategy, the parameters of the base model, meta-model and different model groups are searched. In addition, the Bayesian optimization strategy is introduced to further improve the adjustment efficiency of model parameters. The Stacking fusion algorithm model is formed based on the demand for improving the accuracy of the fusion algorithm and combining the advantages and disadvantages of each machine learning algorithm. The prediction performance and generalization ability are stronger, which can improve the accuracy of the traditional Stacking fusion algorithm by about 2%, thereby further improving the prediction accuracy of the bank card fraud data set, and the accuracy rate can be increased to more than 96%;

[0056] 2. After using SMOTE oversampling to expand the original data set, the quality of the synthesized data is improved, thereby improving the classification ability of the model.

[0057] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 It is a principle diagram of the bank card fraud prediction method based on the Stacking fusion algorithm of the present invention;

[0059] Figure 2It is a principle diagram of an extended prediction matrix of a bank card fraud prediction method based on a Stacking fusion algorithm of the present invention;

[0060] Figure 3 This is a comparison chart of the accuracy improvement of the simulation experiment of the present invention;

[0061] Figure 4 This is a comparison chart of the recall rate improvement of the simulation experiment of the present invention;

[0062] Figure 5 This is a comparison chart of LOG loss improvement in the simulation experiment of the present invention;

[0063] Figure 6 It is a trend diagram of the accuracy of the logistic regression meta-model of the simulation experiment of the present invention as a function of the weight;

[0064] Figure 7 This is a trend chart of the SVC metamodel accuracy versus weight variation in the simulation experiment of the present invention. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical scheme and advantages disclosed in the embodiments of the present invention clearer, the embodiments of the present invention are further described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention and are not intended to limit the embodiments of the present invention. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions.

[0066] It should be noted that the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products or devices.

[0067] Like reference numerals and letters denote similar items in the following drawings, and thus, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0068] like Figure 1 As shown, the bank card fraud prediction method based on the Stacking fusion algorithm includes the following steps:

[0069] S1. Obtain the desensitized bank card fraud original data set and preprocess it to obtain the input data set;

[0070] The data in the desensitized bank card fraud original data set described in step S1 contains transaction feature descriptions;

[0071] The pre-processing described in step S1 comprises the following steps:

[0072] S11. Use the SMOTE oversampling method to perform data oversampling and balancing processing on the desensitized bank card fraud original data set;

[0073] S12. Feature analysis: Draw a data distribution diagram of different transaction feature descriptions, and select transaction feature descriptions with continuous values ​​as feature variables as the basis for determining whether the relationship with the target feature is the relationship between bank card fraud data.

[0074] The transaction characteristics description includes continuous values ​​and binomial distribution values. The continuous values ​​include the distance between the bank card transaction location and home, the distance from the last transaction, and the ratio of the median price of the most recent transaction to the median price of previous transactions.

[0075] The binomial distribution values ​​include whether the transaction occurred at the same merchant, whether the transaction was conducted through a bank card, whether a PIN code was used during the transaction, and whether it was an online transaction order.

[0076] S2. Construct a bank card crime prediction model based on the Stacking fusion algorithm model;

[0077] S3. Use the bank card crime prediction model based on the Stacking fusion algorithm model to make predictions.

[0078] Step S3 specifically includes the following steps:

[0079] S31. Build base model:

[0080] S311, construct four base models based on logistic regression, naive Bayes, KNN neighbor algorithm and SVC algorithm respectively;

[0081] S312, using grid search and Bayesian optimization to select the best parameters of four base models respectively, to obtain four best base models;

[0082] S313, fitting four optimal base models using a 3-fold cross validation method, and evaluating the fitting results using a classification algorithm, and selecting the optimal base model according to the fitting results;

[0083] Table 1 Evaluation results of base model construction

[0084]

[0085] S32. Constructing the meta-model:

[0086] S321, construct four meta-models based on logistic regression, naive Bayes, KNN neighbor algorithm and SVC algorithm respectively;

[0087] S322, using grid search and Bayesian optimization to select the best parameters of four base models respectively, and obtain four best meta-models;

[0088] S323, fitting four optimal meta-models using a 3-fold cross validation method, and evaluating the fitting results using a classification algorithm, and selecting the optimal meta-model according to the fitting results;

[0089] Table 2 Metamodel construction evaluation results

[0090]

[0091] S33. The optimal base model is used as feature input and imported into the optimal meta-model to obtain the Stacking fusion algorithm model.

[0092] The evaluation indicators of the Stacking fusion algorithm model formed after the meta-model is constructed are compared with the evaluation indicators of the single machine learning algorithm without fusion strategy, and the accuracy, precision, recall rate, F1-score, AUC value and LOG loss value are continued to be used for comprehensive evaluation.

[0093] Table 3 Stacking fusion model construction improvement effect

[0094]

[0095] It can be seen that the Staking fusion model has certain improvements in multiple evaluation indicators compared to the single model, and can achieve certain improvements in accuracy, precision, recall rate, F1-score and AUC evaluation.

[0096] Logistic Regression (LR) is a very classic linear classification algorithm. It is also the most frequently used and widely used model. The LR model is popular because the model has strong interpretability and the output results have probabilistic meaning. At the same time, the training speed is fast and the space occupied is small. When solving the binary classification problem, the model does not need to scale the input features.

[0097] The LR model uses the Sigmoid function on the basis of linear regression. With the monotonically differentiable characteristics of the Sigmoid function, the predicted value output of the linear regression is controlled between 0 and 1, and the threshold is set so that the logistic regression can handle the binary classification problem. The Sigmoid function is continuously and monotonically increasing within the definition domain and its value range is (0, 1). Logistic regression uses the Sigmoid function to map the value range to the probability interval (0, 1).

[0098] The logistic regression expressions described in S311 and S321 are as follows:

[0099]

[0100] In the formula, x represents the input variable; y represents the output variable; ω T represents weight; g represents Sigmoid function;

[0101] The Naive Bayesian algorithm is based on the Bayesian theorem. The Naive Bayesian algorithm uses a naive assumption, that is, it assumes that each feature in the data set is conditionally independent. The probability of the target feature variable appearing in the data set is used as the calculation result of the Bayesian theorem. In model training and prediction, the training set is first used to calculate the prior probabilities of different feature categories. Then, for the new test set data, the probability of each data belonging to a different feature category is calculated. Finally, the category with the highest probability among multiple feature categories is selected as the prediction result.

[0102] The Naive Ye algorithm is based on Bayes' theorem, which is expressed as follows:

[0103]

[0104] In the formula, p(c i |w) means that condition c occurs when condition w occurs i The probability of occurrence; p(w|c i ) means that under condition c i The probability of condition w occurring when the condition occurs; p(c i ) represents the condition c i The probability of occurrence; p(w) represents the probability of condition w occurring;

[0105] The K-nearest neighbor algorithm is a typical algorithm in machine learning. Its principle is: assume that there is a set of labeled data samples, that is, the type of each sample is known, and use this set as a training set; to predict the type of new data with an unknown label, establish an N-dimensional coordinate system for the data samples with known labels according to their feature dimensions, and put the data samples with known labels into the N-dimensional space. For the unknown label samples to be predicted, they are also put into the coordinate system according to the N-dimensional coordinates, and the K samples closest to them are circled.

[0106] Coordinate Euclidean distance of KNN neighbor algorithm:

[0107]

[0108] In the formula, x1 and y1 represent the horizontal and vertical coordinates of the first sample respectively; x2 and y2 represent the horizontal and vertical coordinates of the second sample respectively; n represents the number of samples.

[0109] The evaluation indicators of the classification algorithm described in S313 and S323 include accuracy, recall, precision, AUC, Log loss function, and f1-score used to represent the harmonic mean of precision and recall.

[0110] Table 4 Classification algorithm evaluation indicators

[0111]

[0112]

[0113] In the table, TP is a true positive example, which indicates the proportion of the predicted value of the result that is yes; TN is a true negative example, which indicates the proportion of the predicted value of the result that is not yes; FP is a false positive example, which indicates the proportion of the predicted value of the result that is not yes; FN is a false negative example, which indicates the proportion of the predicted value of the result that is no; TPR indicates the true positive rate; FPR indicates the false negative rate.

[0114] It is difficult to improve both the precision and recall of the evaluation indicators at the same time. If the classification algorithm model only judges samples with a higher probability as positive samples, it may cause the loss of some positive samples with a lower probability, thus resulting in a relatively ideal accuracy rate, but a low recall rate, which cannot well evaluate the prediction of positive samples. In order to avoid this situation affecting the judgment results of the model, the f1-score is introduced to balance the two.

[0115] The 3-fold cross validation method described in S313 and S323 divides the input data set into a training set, a test set and a validation set, and divides the training set into a first training set and a second training set in proportion, wherein the first training set is used to fit the best base model, and the second training set is used to fit the best meta-model;

[0116] like Figure 2 As shown, in S33, the output matrix of the optimal base model is merged with the test set matrix and then input into the meta-model as an extended prediction matrix. Since the original Stacking fusion algorithm model only inputs the prediction matrix output by the base model into the meta-model as a new feature, although such a strategy can better play the prediction advantages of the base model and compensate for the prediction deviations between models, when there are correlation features in the original data, the prediction results of the base model are less than ideal, resulting in unsatisfactory prediction effects of the meta-model. In order to solve the dependence of the meta-model on the quality of the base model, this embodiment proposes to merge the original data matrix (test set matrix) with the base model output matrix to form a new extended prediction matrix input into the meta-model, so that the original data can be directly input into the meta-model to solve the excessive dependence of the meta-model on the base model.

[0117] The input features described in S33 also include the probability matrix of each feature variable predicted by the base model. The meta-model input feature matrix used by the traditional Stacking fusion algorithm is the classification variable matrix predicted by the base model. As a prediction scenario for certain crime risks that emphasizes the prediction probability, if the prediction accuracy of the base model is low, when the credibility and accuracy of the predicted classification results are not high, relying solely on the predicted classification results of the base model will reduce the meta-model's evaluation of the final predicted probability. For this reason, this embodiment proposes to use the base model to predict the probability values ​​of each category of samples, and use the predicted probability matrix as the input feature of the meta-model. In this way, when the meta-model uses probability as an input feature, it can not only compare, match, and complement the predicted probability values ​​between the base models, but also enable the meta-model to calculate each feature more accurately, which reduces the deviation caused by the insufficient accuracy of the base model to a certain extent, and is more suitable for classification probability prediction evaluation.

[0118] The probability values ​​in the probability matrix are sorted from high to low, and weights are assigned to the sorted probability values ​​from high to low, and then the probability matrix after weight assignment is used as the feature input of the meta-model. In the traditional Stacking fusion algorithm, since its base model output is the predicted classification label feature, the meta-model cannot distinguish the accuracy of each base model's prediction result by itself, and each base model has the same status in the meta-model calculation, which weakens the complementary advantages between the base models to a certain extent, and may cause a certain high-precision base model to contribute insufficiently, or a low-precision base model to contribute too much, thereby reducing the prediction effect of the Stacking fusion algorithm. Combined with the improvement idea of ​​the base model prediction probability matrix, this embodiment proposes to use the weighted fusion idea, while using the classification probability as the meta-model feature, weights are assigned to each base model prediction probability value, and a higher weight is given to the prediction probability of the higher-precision model, while reducing the prediction contribution of the low-precision model, further increasing the fusion effect between the base model prediction probability matrices, improving the meta-model feature quality, and thus improving the final prediction accuracy.

[0119] Simulation experiment

[0120] The desensitized bank card fraud data set provided by a provincial innovative education society and the innovative education resource development institute was used as the original data set, of which fraud data accounted for 8.7% of the total data, non-fraud data accounted for 91.3% of the total data, and the ratio of fraud to non-fraud data was about 1:10. 40% of the total data was extracted as the base model training set, and the processed data volume was 511053, with bank card fraud and normal bank card user data each accounting for 50%, so that the algorithm construction has a more impressive effect. The remaining 60% of the data was used as the fusion algorithm construction data and the final evaluation.

[0121] Although there are certain outliers in the feature distribution of the original data set, for the vast majority of features, their distribution roughly follows the Bernoulli distribution, and some features show great differences under different target classifications. This can provide a better calculation basis for the classification machine learning algorithm to enhance the prediction accuracy of bank card fraud.

[0122] The original dataset has the following feature description:

[0123] Table 5. Dataset feature description

[0124]

[0125] It can be seen that three features in the sample are continuous values: the distance between the bank card transaction location and home (distance_from_home), the distance from the last transaction (distance_from_last_transaction), and the ratio of the median price of the most recent transaction to the median price of previous transactions (ratio_to_median_purchase_price). Four features are binomial distribution values: whether the transaction occurred at the same merchant (repeat_retailer), whether the transaction was conducted through a chip (bank card) (used_chip), whether a PIN code was used during the transaction (used_pin_number), and whether it was an online transaction order (online_order).

[0126] like Figure 3-Figure 5 As shown in the figure, the improved strategies of using matrix expansion, prediction probability matrix, and simultaneous use of matrix expansion and prediction probability matrix can bring certain improvements to the Stacking fusion model in terms of accuracy, recall, and LOG loss. It has a relatively stable and good improvement effect when using logistic regression as a meta-model. On the one hand, it is due to the fact that the dimension of the input feature matrix of the meta-model is greatly increased through the matrix expansion strategy, and the normalization principle used by logistic regression can better overcome the high computational complexity caused by high latitude; on the other hand, logistic regression has stronger pertinence when dealing with binary classification problems, while other classification algorithms are often inferior to logistic regression in specific situations of binary classification problems in order to cope with multi-classification situations. Especially when the meta-model needs to deal with a large amount of predicted value data from the base model, the logistic regression algorithm has good performance as a commonly used meta-model classifier in Stacking.

[0127] However, the effects of some boosting strategies are not obvious, and even when Naive Bayes and SVC are used as meta-models, the prediction accuracy is reduced to a certain extent. In general, the boosting strategies have different effects on different meta-models, and the difference in the boosting effect is quite large. It is necessary to use appropriate boosting fusion strategies for the data set.

[0128] like Figure 6 and Figure 7 As shown, based on the use of the prediction probability matrix, the output probabilities of different base models are used as the characteristic variable input of the meta-model with certain weights. At the same time, the original data features are integrated as an expansion method, and an improvement strategy based on weighted fusion is proposed to solve the problem that the meta-model cannot distinguish the accuracy by itself, and the possible contribution of a certain high-precision base model is different, thereby reducing the accuracy of the Stacking fusion algorithm.

[0129] Therefore, the present invention adopts the bank card fraud prediction method based on the Stacking fusion algorithm, and improves the prediction performance and generalization ability of the traditional Stacking model by fusing different base models.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A bank card fraud prediction method based on Stacking fusion algorithm, Features: The following steps are involved: S1. Obtain the desensitized bank card fraud original data set and preprocess it to obtain the input data set; The data in the desensitized bank card fraud original data set described in step S1 contains transaction feature descriptions; The pre-processing described in step S1 comprises the following steps: S11. Use the SMOTE oversampling method to perform data oversampling and balancing processing on the desensitized bank card fraud original data set; S12. Feature analysis: draw a data distribution diagram of different transaction feature descriptions, and select the transaction feature descriptions with continuous values ​​as feature variables, which are used as the basis for judging whether the relationship with the target feature is the relationship between bank card fraud data; The transaction characteristics description includes continuous values ​​and binomial distribution values. The continuous values ​​include the distance between the bank card transaction location and home, the distance from the last transaction, and the ratio of the median price of the most recent transaction to the median price of previous transactions. Binomial distribution values ​​include whether the transaction occurred at the same merchant, whether the transaction was conducted through a bank card, whether a PIN code was used during the transaction, and whether it was an online transaction order; S2. Construct a bank card crime prediction model based on the Stacking fusion algorithm model; S3, prediction using the bank card crime prediction model based on the Stacking fusion algorithm model; Step S3 specifically includes the following steps: S31. Build base model: S311, construct four base models based on logistic regression, naive Bayes, KNN neighbor algorithm and SVC algorithm respectively; S312, using grid search and Bayesian optimization to select the best parameters of four base models respectively, to obtain four best base models; S313, fitting four optimal base models using a 3-fold cross validation method, and evaluating the fitting results using a classification algorithm, and selecting the optimal base model according to the fitting results; S32. Constructing the meta-model: S321, construct four meta-models based on logistic regression, naive Bayes, KNN neighbor algorithm and SVC algorithm respectively; S322, using grid search and Bayesian optimization to select the best parameters of four base models respectively, and obtain four best meta-models; S323, fitting four optimal meta-models using a 3-fold cross validation method, and evaluating the fitting results using a classification algorithm, and selecting the optimal meta-model according to the fitting results; S33. The optimal base model is used as feature input and imported into the optimal meta-model to obtain the Stacking fusion algorithm model.

2. According to claim 1, the bank card fraud prediction method based on the Stacking fusion algorithm, Features: The logistic regression expressions described in S311 and S321 are as follows: In the formula, x represents the input variable; y represents the output variable; ω T represents weight; g represents Sigmoid function; The Naive Ye algorithm is based on Bayes' theorem, which is expressed as follows: In the formula, p(c i |w) means that condition c occurs when condition w occurs i The probability of occurrence; p(w|c i ) means that under condition c i The probability of condition w occurring when the condition occurs; p(c i ) represents the condition c i The probability of occurrence; p(w) represents the probability of condition w occurring; Coordinate Euclidean distance of KNN neighbor algorithm: In the formula, x 1 ,y 1 Respectively represent the horizontal and vertical coordinates of the first sample; x 2 ,y 2 They represent the horizontal and vertical coordinates of the second sample respectively; b represents the number of samples.

3. The bank card fraud prediction method based on the Stacking fusion algorithm according to claim 1, Features: The evaluation indicators of the classification algorithm described in S313 and S323 include accuracy, recall, precision, AUC, Log loss function, and f1-score used to represent the harmonic mean of precision and recall.

4. The bank card fraud prediction method based on the Stacking fusion algorithm according to claim 1, Features: The 3-fold cross validation method described in S313 and S323 divides the input data set into a training set, a test set and a validation set, and divides the training set into a first training set and a second training set in proportion, wherein the first training set is used to fit the best base model, and the second training set is used to fit the best meta-model; In S33, the output matrix of the optimal base model is combined with the test set matrix and input into the meta-model as the extended prediction matrix.

5. According to claim 4, the bank card fraud prediction method based on the Stacking fusion algorithm, Features: The feature input described in S33 also includes a probability matrix of each feature variable predicted using the base model.

6. The bank card fraud prediction method based on the Stacking fusion algorithm according to claim 5, Features: The probability values ​​in the probability matrix are sorted from high to low, and weights are assigned to the sorted probability values ​​from high to low. The probability matrix after weight assignment is then used as the feature input of the meta-model.

Citation Information

Patent Citations

  • Method and device realizing credit investigation data treatment

    CN108230137A

  • Credit card fraud identification method

    CN110321950A