Credit card data detection method and device, equipment and storage medium

Through iterative training and kernel function improvement technology in the support vector machine model, the problem of credit card data sample imbalance is solved, the accuracy of fraud detection is improved, the process of data resampling is avoided, and more efficient classification performance is achieved.

CN118537113APending Publication Date: 2024-08-23CHINA ELECTRONICS JINXIN DIGITAL TECH GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410592757.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing machine learning algorithms are biased towards the majority of categories in fraud detection, making it difficult to effectively identify credit card fraud when faced with an imbalanced data distribution of fraud samples. Traditional methods such as undersampling and oversampling suffer from information loss and model overfitting. problem.

Method used

By using iterative training and kernel function improvement technology in the support vector machine model, the conversion function is dynamically adjusted to amplify the distance measurement of support vectors around the classification boundary and expand the distance between large class samples and small class samples, thereby improving the accuracy of fraud detection. Rate.

Benefits of technology

It effectively solves the imbalance problem of credit card data samples, improves the accuracy of fraud detection, avoids the pre-processing process of data resampling, and improves the classification performance and efficiency of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537113A
    Figure CN118537113A
Patent Text Reader

Abstract

The invention provides a credit card data detection method and device, equipment and a storage medium, and the method comprises the steps: obtaining a credit card data sample; based on the credit card data sample and a selected initial kernel function, executing a set number of times of iterative training on the first support vector machine model to obtain a second support vector machine model corresponding to each time of iterative training; determining a target support vector machine model from the second support vector machine models corresponding to each iteration training; and obtaining credit card data to be detected, and inputting the credit card data to the target support vector machine model to determine whether the credit card data is fraud data. Therefore, after the initial kernel function is selected, the initial kernel function is further improved based on the transfer function in each iterative training, so that the distance measurement of support vectors around the classification boundary can be effectively amplified, the distance between large-class samples and small-class samples can be enlarged, and the unbalance problem of credit card data samples can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for detecting credit card data. Background Art

[0002] With the rise of digital finance and e-commerce, traditional fraud detection methods have gradually revealed their limitations. Fraud detection technology based on machine learning has become an important research direction. However, machine learning algorithms show a bias towards the majority category. This bias is because the algorithm is used to optimize and minimize the overall error, which may cause them to prioritize the majority category because the majority category dominates the data. Therefore, in the face of the unbalanced data distribution of fraud samples and complex fraud patterns, it is worth studying how to effectively solve the imbalance problem of credit card data samples while using machine learning algorithms for fraud detection. Summary of the invention

[0003] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0004] To this end, the first purpose of the present invention is to propose a method for detecting credit card data, so that after selecting the initial kernel function, the distance measurement of the support vector around the classification boundary can be effectively amplified by further improving the initial kernel function based on the transformation function in each iterative training, thereby expanding the distance between the large category samples and the small category samples, and effectively solving the imbalance problem of credit card data samples.

[0005] The second object of the present invention is to provide a device for detecting credit card data.

[0006] A third objective of the present invention is to provide an electronic device.

[0007] A fourth object of the present invention is to provide a computer-readable storage medium.

[0008] A fifth object of the present invention is to provide a computer program product.

[0009] To achieve the above-mentioned purpose, a first embodiment of the present invention provides a method for detecting credit card data, comprising:

[0010] Acquire a credit card data sample, wherein the credit card data sample includes fraud samples and normal samples, and the number of the fraud samples is less than the number of the normal samples;

[0011] Based on the credit card data sample and the selected initial kernel function, a set number of iterative trainings are performed on the first support vector machine model to obtain a second support vector machine model corresponding to each iterative training, wherein each iterative training is based on the training samples in the corresponding training sample set, the first support vector of the fraudulent sample and the second support vector of the normal sample, to determine the conversion function corresponding to the training samples in the corresponding training sample set, and based on the conversion function corresponding to the training samples in the corresponding training sample set and the initial kernel function, to determine the corresponding target kernel function, so as to train the first support vector machine model using the corresponding training sample set and the target kernel function to obtain the corresponding second support vector machine model;

[0012] Determine a target support vector machine model from the second support vector machine model corresponding to each iteration training;

[0013] The credit card data to be detected is obtained, and the credit card data is input into the target support vector machine model to determine whether the credit card data is fraudulent data.

[0014] To achieve the above-mentioned purpose, a second aspect of the present invention provides a device for detecting credit card data, comprising:

[0015] An acquisition module, used for acquiring credit card data samples, wherein the credit card data samples include fraud samples and normal samples, and the number of the fraud samples is less than the number of the normal samples;

[0016] A training module, for performing a set number of iterative trainings on the first support vector machine model based on the credit card data sample and the selected initial kernel function, so as to obtain a second support vector machine model corresponding to each iterative training, wherein each iterative training is based on the training samples in the corresponding training sample set, the first support vector of the fraudulent sample and the second support vector of the normal sample, to determine the conversion function corresponding to the training samples in the corresponding training sample set, and based on the conversion function corresponding to the training samples in the corresponding training sample set and the initial kernel function, to determine the corresponding target kernel function, so as to train the first support vector machine model using the corresponding training sample set and the target kernel function, to obtain the corresponding second support vector machine model;

[0017] A determination module, used to determine a target support vector machine model from the second support vector machine model corresponding to each iteration training;

[0018] The processing module is used to obtain the credit card data to be detected, and input the credit card data into the target support vector machine model to determine whether the credit card data is fraudulent data.

[0019] To achieve the above-mentioned purpose, the third aspect of the present invention proposes an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the credit card data detection method of the first aspect mentioned above.

[0020] In order to achieve the above-mentioned purpose, a fourth aspect of the present invention provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the credit card data detection method of the first aspect.

[0021] In order to achieve the above-mentioned purpose, a fifth aspect of the present invention provides a computer program product, including a computer program, which implements the credit card data detection method of the first aspect when executed by a processor.

[0022] The technical solution provided by the embodiment of the present invention has the following beneficial effects:

[0023] After selecting the initial kernel function, the conversion function corresponding to each training sample is determined in each iterative training based on the training samples in the corresponding training sample set and the support vectors of each type of training samples, so as to further improve the initial kernel function based on the conversion function corresponding to each training sample. In this way, the distance measurement of the support vectors around the classification boundary can be effectively amplified, the distance between large-category samples and small-category samples can be expanded, and the imbalance problem of credit card data samples can be solved.

[0024] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0026] Figure 1 A flowchart of a method for detecting credit card data provided by an embodiment of the present invention;

[0027] Figure 2 A schematic diagram of a flow chart of another credit card data detection method provided by an embodiment of the present invention;

[0028] Figure 3 A schematic diagram of a flow chart of another credit card data detection method provided by an embodiment of the present invention;

[0029] Figure 4A schematic diagram of the structure of a credit card data detection device provided by an embodiment of the present invention;

[0030] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0032] In the field of credit card fraud identification, the mainstream technologies for dealing with data imbalance are mainly divided into data-based methods and algorithm-based methods.

[0033] The data-based method is to resample the imbalanced fraud samples to balance the positive and negative samples, usually including undersampling the majority samples and oversampling the minority samples. However, undersampling often results in a waste of real data, and there is a risk of information loss and reduced model classification performance. Oversampling often makes it difficult to generate high-quality samples, and the samples lack diversity, so the trained model has limited improvement effect, and it also leads to increased model training time and overfitting of a few samples.

[0034] The algorithm-based approach is to improve the model itself to improve the classification effect of the model on imbalanced data, but how to improve the model itself is a big problem.

[0035] To this end, embodiments of the present invention provide a credit card data detection method, apparatus, device and storage medium to improve the accuracy of credit card fraud identification by applying a new kernel technique to a support vector machine model.

[0036] The following describes the credit card data detection method, device, equipment and storage medium according to the embodiments of the present invention with reference to the accompanying drawings.

[0037] Figure 1 A flowchart of a method for detecting credit card data provided by an embodiment of the present invention.

[0038] like Figure 1 As shown, the credit card data detection method includes the following steps:

[0039] Step 101, obtaining a credit card data sample.

[0040] Among them, the credit card data samples include fraud samples and normal samples, and the number of fraud samples is less than the number of normal samples.

[0041] Among them, fraud samples refer to data samples with fraudulent behavior in credit card data samples, and normal samples refer to data samples without fraudulent behavior.

[0042] Step 102: Based on the credit card data sample and the selected initial kernel function, perform a set number of iterative training on the first support vector machine model to obtain a second support vector machine model corresponding to each iterative training.

[0043] Among them, each iterative training is based on the training samples in the corresponding training sample set, the first support vector of the fraudulent sample and the second support vector of the normal sample, to determine the conversion function corresponding to the training samples in the corresponding training sample set, and based on the conversion function and the initial kernel function corresponding to the training samples in the corresponding training sample set, determine the corresponding target kernel function, so as to train the first support vector machine model with the corresponding training sample set and the target kernel function to obtain the corresponding second support vector machine model.

[0044] The set number can be any value, such as 3, 6, 10, etc.

[0045] In some embodiments, in each iterative training, the corresponding training sample set can be obtained by splitting the credit card data sample, and then the first support vector machine model is iteratively trained based on the corresponding training sample set and the selected initial kernel function to obtain the corresponding second support vector machine model.

[0046] As a possible implementation, the first support vector machine model uses a decision function to determine whether the input sample is a fraudulent sample, and the decision function is determined based on the input sample, at least one support vector, the weight and category label of each support vector, the kernel function and the bias term.

[0047] As an example, the expression of the decision function is:

[0048]

[0049] Among them, x′ represents the input sample, f(x′) represents the decision function, N represents the number of support vectors, and α i represents the weight of the corresponding support vector, y i represents the category label of the corresponding support vector, x i represents the corresponding support vector, K(x i ,x′) represents the kernel function used by the decision function, Represents the bias term.

[0050] In the problem of binary classification of fraud samples, the main goal of the support vector machine is to find an optimal hyperplane in a high-dimensional space to effectively distinguish fraud samples from normal samples. For a new sample data, it can be judged whether it is fraud data based on the decision function. The expression of the decision function is shown in formula (1). Credit card sample data is often linearly inseparable, so it is necessary to use kernel mapping technology to transform the sample points from Euclidean space to high-dimensional Hilbert feature space, so that the converted data can be linearly separable using conventional support vector machines. Among them, kernel mapping can be defined as:

[0051] K(x,y)=φ(x)·φ(y) (2)

[0052] Since the class boundary is unknown at the beginning, an initial kernel function is needed to identify an initial class boundary. As a possible implementation method, the initial kernel function uses the RBP (Radial Basis Polynomial) kernel function, which is a target exponential function, where the independent variable of the target exponential function is a polynomial.

[0053] As an example, the expression of the RBP kernel function is:

[0054]

[0055] The Riemann metric generated by the RBP kernel function in the sample input space can be defined as:

[0056]

[0057] Among them, g ij is the Riemann metric tensor of the kernel function K(x,y) at point x in the input space S, and its expression is:

[0058]

[0059] In order to improve the performance of the support vector machine in processing unbalanced data, a conversion function can be used to further improve the initial kernel function. Among them, the conversion function is a function that determines the degree of amplification of the initial kernel function, which plays a vital role in the method proposed by the present invention. By further amplifying the initial kernel function, the Riemann metric value around the class boundary, especially the support vector, can be effectively increased, thereby improving the classification performance.

[0060] Step 103: determine a target support vector machine model from the second support vector machine models corresponding to each iterative training.

[0061] In the present invention, although the second support vector machine model corresponding to each iterative training can identify whether the input data is fraudulent data, the recognition performance of the second support vector machine model corresponding to each iterative training is not the same. Therefore, in some embodiments, the target support vector machine model can be determined from the second support vector machine models corresponding to each iterative training based on the recognition performance of the second support vector machine model corresponding to each iterative training.

[0062] Optionally, the support vector machine model with the best recognition effect may be selected from the second support vector machine models corresponding to each iterative training as the target support vector machine model.

[0063] Step 104, obtaining the credit card data to be tested, and inputting the credit card data into the target support vector machine model to determine whether the credit card data is fraudulent data.

[0064] In the present invention, after determining the target support vector machine model, the target support vector machine model can be applied to the corresponding credit card data detection scenario. By inputting the credit card data to be detected into the target support vector machine model, the output based on the target support vector machine model can be used to determine whether the credit card data to be detected is fraudulent data.

[0065] The credit card data detection method provided by the embodiment of the present invention, after selecting the initial kernel function, determines the conversion function corresponding to each training sample in each iterative training based on the training samples in the corresponding training sample set and the support vectors of each type of training samples, so as to further improve the initial kernel function based on the conversion function corresponding to each training sample. In this way, the distance measurement of the support vectors around the classification boundary can be effectively amplified, the distance between the large category samples and the small category samples can be expanded, and the imbalance problem of credit card data samples can be solved.

[0066] In order to clearly illustrate how the present invention performs a set number of iterative training on the first support vector machine model based on the credit card data sample and the selected initial kernel function, this embodiment provides another credit card data detection method. Figure 2 A flowchart of another credit card data detection method provided by an embodiment of the present invention.

[0067] like Figure 2 As shown, the credit card data detection method may include the following steps:

[0068] Step 201, obtaining a credit card data sample.

[0069] For the explanation of step 201, reference may be made to the relevant description in any embodiment of the present invention, and will not be repeated here.

[0070] Step 202: In each iterative training, the credit card data sample is split to obtain a training sample set and a test sample set corresponding to each iterative training.

[0071] Among them, the training sample set is used to train the model, and the test sample set is used to evaluate the performance of the model.

[0072] It should be noted that in the present invention, each time an iterative training is performed, the credit card data sample is split once, so each iterative training will obtain a training sample set and a test sample set. Moreover, the training sample set and the test sample set obtained in each iterative training are not the same.

[0073] Optionally, each iteration of training can randomly split the credit card data sample according to a preset ratio to obtain corresponding training sample sets and test sample sets. The preset ratio can be set according to the complexity of the problem, the size of the data set, and the evaluation requirements. For example, the preset ratio can be set to 7:3 or 8:2.

[0074] Step 203, using the training sample set and the initial kernel function corresponding to each iterative training to perform initial training on the first support vector machine model, so as to determine the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iterative training based on the third support vector machine model corresponding to each iterative training obtained by the initial training.

[0075] In some embodiments, each iteration training will perform initial training on the first support vector machine model based on the training sample set corresponding to the current iteration training and the selected initial kernel function, thereby obtaining a third support vector machine model for each iteration training. Afterwards, based on the third support vector machine model corresponding to each iteration training obtained from the initial training, the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iteration training can be determined.

[0076] As an example, assuming that the credit card data sample is X, for any iterative training, the credit card data sample X can be split into a training sample set X train And the test sample set X test , and use the initial kernel function of formula (1) and formula (3) in the training sample set X train We train on this to obtain the support vectors of large-class samples (normal samples) and small-class samples (fraudulent samples), which are denoted as SV + and SV - Among them, SV + That is the training sample set X train The second support vector of the normal sample in SV - That is the training sample set X trainThe first support vector of the fraudulent samples in .

[0077] Step 204, based on the training samples in the training sample set corresponding to each iterative training, and the first support vector of the fraudulent samples and the second support vector of the normal samples in the training sample set corresponding to each iterative training, determine the conversion function corresponding to each training sample, and based on the conversion function and the initial kernel function corresponding to each training sample in the training sample set corresponding to each iterative training, determine the target kernel function corresponding to each iterative training.

[0078] In some embodiments, each iterative training will use the conversion function corresponding to each training sample in the training sample set corresponding to this iterative training to further improve the initial kernel function, thereby obtaining the corresponding target kernel function for each iterative training.

[0079] As a possible implementation method, the process of determining the conversion function corresponding to each training sample in the training sample set corresponding to each iterative training is as follows:

[0080] For any training sample in the training sample set corresponding to each iterative training, a conversion function corresponding to the training sample is determined according to whether the training sample belongs to the first support vector or the second support vector corresponding to the corresponding iterative training.

[0081] Optionally, when the training sample belongs to the first support vector corresponding to the corresponding iterative training, the conversion function corresponding to the training sample can be determined to be a first constant function, wherein the first constant function is determined based on the first support vector and the second support vector corresponding to the corresponding iterative training; or, when the training sample belongs to the second support vector corresponding to the corresponding iterative training, the conversion function corresponding to the training sample can be determined to be a second constant function, wherein the second constant function is determined based on the first support vector and the second support vector corresponding to the corresponding iterative training; or, when the training sample belongs to neither the first support vector corresponding to the corresponding iterative training nor the second support vector corresponding to the corresponding iterative training, the conversion function corresponding to the training sample can be determined to be a target linear function.

[0082] As an example, the first constant function is The second constant function is The target linear function is T(x)=x, where x represents the training sample, T(x) represents the conversion function corresponding to the training sample, and SV - Indicates the first support vector corresponding to the corresponding iteration training, SV + represents the second support vector corresponding to the corresponding iteration training. + is the training sample set X train The second support vector of the normal sample in SV - is the training sample set Xtrain An example of the first support vector of the fraudulent sample in the training sample set X train For each training sample x in , if x∈SV - , then determine If x∈SV + , then determine Otherwise, determine T(x)=x.

[0083] As a possible implementation method, the process of further improving the initial kernel function in each iterative training is as follows:

[0084] The initial kernel function is conformally transformed using the conversion function corresponding to each training sample in the training sample set corresponding to each iterative training to obtain the target kernel function corresponding to each iterative training, wherein the target kernel function corresponding to each iterative training is the product of the initial kernel function and the conversion function corresponding to the corresponding training sample.

[0085] As an example, the expression of the target kernel function corresponding to each iterative training is:

[0086]

[0087] in, represents the target kernel function corresponding to each iteration training, T(x i ) represents the training sample x in the training sample set corresponding to each iterative training i The conversion function, T(x j ) represents the training sample x in the training sample set corresponding to each iterative training j The conversion function, K(x i ,x j ) represents the initial kernel function.

[0088] In the present invention, in order to improve the performance of the support vector machine in processing unbalanced data, the kernel function is further subjected to a conformal transformation in the feature space. The transformation process does not change the geometric structure and internal relationship in the original sample, that is, the angle and relative position between the sample points remain unchanged, so as to ensure accurate capture of the potential structure of the data. From a mathematical point of view, as long as the adjusted kernel function meets the semi-positive definite condition, the adjustment is reasonable. The formula for conformal transformation of the kernel function is as follows:

[0089]

[0090] Among them, T(x) is the transformation function, K(x,y) is the initial kernel function, is the target kernel function.

[0091] Therefore, after the conformal transformation in formula (6), the Riemann metric tensor in the space transformed by the aforementioned RBP kernel function is:

[0092]

[0093] As can be seen from formula (7), the transformation function T(x) changes the metric in the feature space. Therefore, if the initial kernel function fails to achieve good classification results on the unbalanced fraud dataset, a suitable transformation function can be selected to enhance the classification performance.

[0094] Step 205 , retraining the first support vector machine model using the training sample set and target kernel function corresponding to each iterative training to obtain a second support vector machine model corresponding to each iterative training.

[0095] In some embodiments, each iterative training uses the training sample set and target kernel function corresponding to each iterative training to retrain the first support vector machine model, thereby obtaining a second support vector machine model for each iterative training.

[0096] As an example, for any iteration of training, assume that the target kernel function is Then we can use formula (1) and the target kernel function In the training sample set X train Re-train on the above to obtain the second support vector machine model corresponding to this iterative training.

[0097] Step 206: determine a target support vector machine model from the second support vector machine models corresponding to each iterative training.

[0098] Step 207, obtaining the credit card data to be tested, and inputting the credit card data into the target support vector machine model to determine whether the credit card data is fraudulent data.

[0099] For explanations of steps 206 - 207 , reference may be made to the relevant descriptions in any embodiment of the present invention, and will not be repeated here.

[0100] The credit card data detection method provided in the embodiment of the present invention can improve the classification performance of unbalanced data by improving the kernel function and obtain a more accurate classification effect for unbalanced samples. Also, by improving the training method, the preprocessing process of resampling the unbalanced data before training can be avoided, thereby obtaining a classification model more quickly.

[0101] In order to clearly explain how the target support vector machine model is determined from the second support vector machine model corresponding to each iteration training in the present invention, this embodiment provides another credit card data detection method. Figure 3 A flowchart of another credit card data detection method provided by an embodiment of the present invention.

[0102] like Figure 3 As shown, the credit card data detection method may include the following steps:

[0103] Step 301, obtaining a credit card data sample.

[0104] Step 302: In each iterative training, the credit card data sample is split to obtain a training sample set and a test sample set corresponding to each iterative training.

[0105] Step 303, using the training sample set and the initial kernel function corresponding to each iterative training to perform initial training on the first support vector machine model, so as to determine the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iterative training based on the third support vector machine model corresponding to each iterative training obtained by the initial training.

[0106] Step 304, based on the training samples in the training sample set corresponding to each iterative training, and the first support vector of the fraudulent samples and the second support vector of the normal samples in the training sample set corresponding to each iterative training, determine the conversion function corresponding to each training sample, and based on the conversion function and the initial kernel function corresponding to each training sample in the training sample set corresponding to each iterative training, determine the target kernel function corresponding to each iterative training.

[0107] Step 305 , retraining the first support vector machine model using the training sample set and target kernel function corresponding to each iterative training to obtain a second support vector machine model corresponding to each iterative training.

[0108] For explanations of steps 301 - 305 , reference may be made to the relevant descriptions in any embodiment of the present invention, and will not be repeated here.

[0109] Step 306 , using the test sample set corresponding to each iterative training to test the second support vector machine model corresponding to each iterative training respectively, so as to determine the target support vector machine model from each second support vector machine model based on the test results of each second support vector machine model.

[0110] Each iterative training will obtain a training sample set and a test sample set, so that in some embodiments, after obtaining the second support vector machine model corresponding to each iterative training, the second support vector machine model corresponding to this iterative training can be tested for any iterative training using the test sample set corresponding to this iterative training to obtain the test result of the second support vector machine model corresponding to this iterative training. Afterwards, based on the test results of each second support vector machine model, the target support vector machine model is determined from each second support vector machine model. Optionally, the test result may include at least one measurement indicator for measuring the performance of the corresponding second support vector model, such as precision, recall, F1 score, etc.

[0111] As an example, for any iterative training, the obtained second support vector machine model can be used in the test sample set X test A performance evaluation is performed on the obtained second support vector machine model to obtain the test result of the second support vector machine model, and then the best test result is selected from the obtained second support vector machine models as the target support vector machine model.

[0112] Step 307, obtaining the credit card data to be tested, and inputting the credit card data into the target support vector machine model to determine whether the credit card data is fraudulent data.

[0113] For explanation of step 307, reference may be made to the relevant description in any embodiment of the present invention, which will not be elaborated here.

[0114] The credit card data detection method provided by the embodiment of the present invention can test the second support vector machine model corresponding to each iterative training by using the test sample set corresponding to each iterative training. Based on the test results of each second support vector machine model, the model with the best test results can be selected from each second support vector machine model as the target support vector machine model.

[0115] In order to clearly illustrate the above embodiment, an example is now given for illustration.

[0116] In the present invention, the asymmetric amplification of minority samples and majority samples by the KTI algorithm can effectively solve the class imbalance problem of fraudulent samples. Among them, the KTI algorithm is an algorithm for solving the data imbalance problem in binary classification problems. The algorithm works in an iterative manner, and dynamically adjusts the transformation function for the minority class and majority class support vectors in each iteration. This customized adjustment introduces an asymmetric distance from the decision boundary, thereby directly solving the challenge of data imbalance within the algorithm framework.

[0117] For a new sample data, it can be judged whether it is fraudulent data according to the decision function. The expression of the decision function is shown in formula (1). Assume that the credit card data sample is X, the initial kernel function is the RBP kernel function shown in formula (3), the number of iterations is T, and the output is the improved SVM (Support Vector Machine), denoted as SVM′. The overall process of the KTI algorithm is as follows:

[0118] 1. Solve the support vector of large and small class samples:

[0119] Split the credit card data sample X into a training sample set X train And the test sample set X test , and use the initial kernel function of formula (1) and formula (3) in the training sample set X train We train on this to obtain the support vectors of large-class samples (normal samples) and small-class samples (fraudulent samples), which are denoted as SV + and SV - Among them, SV + That is the training sample set X train The second support vector of the normal sample in SV - That is the training sample set X train The first support vector of the fraudulent samples in .

[0120] 2. Solve the conversion function for conformal transformation of the initial kernel function:

[0121] For the training sample set X train For each training sample x in , if x∈SV - ,but If x∈SV + ,but Otherwise T(x)=x.

[0122] 3. Use the target kernel function for training and evaluation:

[0123] The target kernel function is Using formula (1) and the target kernel function In the training sample set X train The classifier is retrained on the test set and its performance is evaluated based on the obtained classifier.

[0124] The above three processes are iteratively run until the number of iterations reaches T, and the best classifier is selected from the obtained T classifiers to obtain SVM′.

[0125] Therefore, by improving the kernel function, the classification performance of imbalanced data can be improved and a more accurate classification effect of imbalanced samples can be obtained; by improving the training method, the preprocessing process of resampling the imbalanced data before training can be avoided, so that the classification model can be obtained more quickly; through repeated iterative training, the kernel function is conformally transformed and the optimal transformation function is obtained, which can effectively solve the imbalance problem of credit card data samples and improve the classification performance of this type of problem.

[0126] In order to implement the above embodiment, the present invention also provides a device for detecting credit card data.

[0127] Figure 4 A schematic diagram of the structure of a credit card data detection device provided by an embodiment of the present invention.

[0128] like Figure 4 As shown, the credit card data detection device includes: an acquisition module 41, a training module 42, a determination module 43 and a processing module 44.

[0129] An acquisition module 41 is used to acquire credit card data samples, wherein the credit card data samples include fraud samples and normal samples, and the number of fraud samples is less than the number of normal samples;

[0130] A training module 42 is used to perform a set number of iterative trainings on the first support vector machine model based on the credit card data sample and the selected initial kernel function to obtain a second support vector machine model corresponding to each iterative training, wherein each iterative training is based on the training samples in the corresponding training sample set, the first support vector of the fraudulent sample and the second support vector of the normal sample, to determine the conversion function corresponding to the training samples in the corresponding training sample set, and based on the conversion function corresponding to the training samples in the corresponding training sample set and the initial kernel function, to determine the corresponding target kernel function, so as to train the first support vector machine model using the corresponding training sample set and the target kernel function to obtain the corresponding second support vector machine model;

[0131] A determination module 43, used to determine a target support vector machine model from the second support vector machine model corresponding to each iteration training;

[0132] The processing module 44 is used to obtain the credit card data to be detected, and input the credit card data into the target support vector machine model to determine whether the credit card data is fraudulent data.

[0133] Furthermore, in a possible implementation of the embodiment of the present invention, the training module 42 further includes:

[0134] A splitting unit is used to split the credit card data sample in each iterative training to obtain a training sample set and a test sample set corresponding to each iterative training;

[0135] a processing unit, configured to perform initial training on the first support vector machine model using the training sample set and the initial kernel function corresponding to each iterative training, so as to determine the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iterative training based on the third support vector machine model corresponding to each iterative training obtained by the initial training;

[0136] a determination unit, configured to determine a conversion function corresponding to each training sample based on the training samples in the training sample set corresponding to each iterative training, and the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iterative training, and determine a target kernel function corresponding to each iterative training based on the conversion function corresponding to each training sample in the training sample set corresponding to each iterative training and the initial kernel function;

[0137] The training unit is used to retrain the first support vector machine model using the training sample set and target kernel function corresponding to each iterative training to obtain a second support vector machine model corresponding to each iterative training.

[0138] Furthermore, in a possible implementation manner of the embodiment of the present invention, the determining unit is further configured to:

[0139] For any training sample in the training sample set corresponding to each iterative training, a conversion function corresponding to the training sample is determined according to whether the training sample belongs to the first support vector or the second support vector corresponding to the corresponding iterative training.

[0140] Furthermore, in a possible implementation manner of the embodiment of the present invention, the determining unit is further configured to:

[0141] In the case where the training sample belongs to the first support vector corresponding to the corresponding iterative training, determining that the conversion function corresponding to the training sample is a first constant function, wherein the first constant function is determined based on the first support vector and the second support vector corresponding to the corresponding iterative training;

[0142] In the case where the training sample belongs to the second support vector corresponding to the corresponding iterative training, determining that the conversion function corresponding to the training sample is a second constant function, wherein the second constant function is determined based on the first support vector and the second support vector corresponding to the corresponding iterative training;

[0143] In the case that the training sample does not belong to the first support vector corresponding to the corresponding iteration training nor to the second support vector corresponding to the corresponding iteration training, it is determined that the conversion function corresponding to the training sample is the target linear function.

[0144] Furthermore, in a possible implementation manner of the embodiment of the present invention, the determining unit is further configured to:

[0145] The initial kernel function is conformally transformed using the conversion function corresponding to each training sample in the training sample set corresponding to each iterative training to obtain the target kernel function corresponding to each iterative training, wherein the target kernel function corresponding to each iterative training is the product of the initial kernel function and the conversion function corresponding to the corresponding training sample.

[0146] Furthermore, in a possible implementation of the embodiment of the present invention, the determination module 43 is further configured to:

[0147] The second support vector machine models corresponding to each iterative training are tested respectively using the test sample set corresponding to each iterative training, so as to determine the target support vector machine model from the second support vector machine models based on the test results of each second support vector machine model.

[0148] Further, in a possible implementation of the embodiment of the present invention, the first support vector machine model uses a decision function to determine whether the input sample is a fraudulent sample, and the decision function is determined based on the input sample, at least one support vector, the weight and category label of each support vector, the kernel function and the bias term;

[0149] The initial kernel function uses a radial basis polynomial kernel function, and the expression of the radial basis polynomial kernel function is a target exponential function, wherein the independent variable of the target exponential function is a polynomial.

[0150] It should be noted that the above explanation of the credit card data detection method embodiment is also applicable to the credit card data detection device of this embodiment, and will not be repeated here.

[0151] The detection device for credit card data provided by the embodiment of the present invention, after selecting the initial kernel function, determines the conversion function corresponding to each training sample in each iterative training based on the training samples in the corresponding training sample set and the support vectors of each type of training samples, so as to further improve the initial kernel function based on the conversion function corresponding to each training sample. In this way, the distance measurement of the support vectors around the classification boundary can be effectively amplified, the distance between large-category samples and small-category samples can be expanded, and the imbalance problem of credit card data samples can be solved.

[0152] In order to implement the above embodiments, the present invention also proposes an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the credit card data detection method proposed in any of the above embodiments of the present invention.

[0153] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0154] It should be noted that Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0155] like Figure 5 As shown, the electronic device includes:

[0156] A memory 51 , a processor 52 , and a computer program stored in the memory 51 and executable on the processor 52 .

[0157] When the processor 52 executes the program, the credit card data detection method provided in any of the above embodiments is implemented.

[0158] Furthermore, the electronic device further comprises:

[0159] The communication interface 53 is used for communication between the memory 51 and the processor 52 .

[0160] The memory 51 is used to store computer programs that can be executed on the processor 52 .

[0161] The memory 51 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0162] The processor 52 is used to implement the credit card data detection method described in any of the above embodiments when executing the program.

[0163] If the memory 51, the processor 52 and the communication interface 53 are implemented independently, the communication interface 53, the memory 51 and the processor 52 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0164] Optionally, in a specific implementation, if the memory 51, the processor 52 and the communication interface 53 are integrated on a chip, the memory 51, the processor 52 and the communication interface 53 can communicate with each other through an internal interface.

[0165] The processor 52 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.

[0166] In order to implement the above embodiments, the present invention further proposes a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the credit card data detection method proposed in any of the above embodiments of the present invention.

[0167] In order to implement the above embodiments, the present invention further proposes a computer program product, including a computer program, which, when executed by a processor, implements the credit card data detection method proposed in any of the above embodiments of the present invention.

[0168] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0169] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0170] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0171] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0172] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0173] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0174] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0175] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for detecting credit card data, characterized in that: include: Acquire a credit card data sample, wherein the credit card data sample includes fraud samples and normal samples, and the number of the fraud samples is less than the number of the normal samples; Based on the credit card data sample and the selected initial kernel function, a set number of iterative trainings are performed on the first support vector machine model to obtain a second support vector machine model corresponding to each iterative training, wherein each iterative training is based on the training samples in the corresponding training sample set, the first support vector of the fraudulent sample and the second support vector of the normal sample, to determine the conversion function corresponding to the training samples in the corresponding training sample set, and based on the conversion function corresponding to the training samples in the corresponding training sample set and the initial kernel function, to determine the corresponding target kernel function, so as to train the first support vector machine model using the corresponding training sample set and the target kernel function to obtain the corresponding second support vector machine model; Determine a target support vector machine model from the second support vector machine model corresponding to each iteration training; The credit card data to be detected is obtained, and the credit card data is input into the target support vector machine model to determine whether the credit card data is fraudulent data.

2. The method according to claim 1, characterized in that The process of each iterative training includes the following steps: In each iterative training, the credit card data sample is split to obtain a training sample set and a test sample set corresponding to each iterative training; Performing initial training on the first support vector machine model using the training sample set corresponding to each iterative training and the initial kernel function, so as to determine the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iterative training based on the third support vector machine model corresponding to each iterative training obtained by the initial training; Determine the conversion function corresponding to each training sample based on the training samples in the training sample set corresponding to each iterative training, and the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iterative training, and determine the target kernel function corresponding to each iterative training based on the conversion function corresponding to each training sample in the training sample set corresponding to each iterative training and the initial kernel function; The first support vector machine model is retrained using the training sample set and target kernel function corresponding to each iterative training to obtain a second support vector machine model corresponding to each iterative training.

3. The method according to claim 2, characterized in that The determining of the conversion function corresponding to each training sample based on the training samples in the training sample set corresponding to each iterative training, and the first support vector of the fraudulent sample and the second support vector of the normal sample in the training sample set corresponding to each iterative training, comprises: For any training sample in the training sample set corresponding to each iterative training, a conversion function corresponding to the training sample is determined according to whether the training sample belongs to the first support vector or the second support vector corresponding to the corresponding iterative training.

4. The method according to claim 3, characterized in that The determining, according to whether the training sample belongs to the first support vector or the second support vector corresponding to the corresponding iterative training, a conversion function corresponding to the training sample comprises: In a case where the training sample belongs to the first support vector corresponding to the corresponding iterative training, determining that the conversion function corresponding to the training sample is a first constant function, wherein the first constant function is determined based on the first support vector and the second support vector corresponding to the corresponding iterative training; In a case where the training sample belongs to the second support vector corresponding to the corresponding iterative training, determining that the conversion function corresponding to the training sample is a second constant function, wherein the second constant function is determined based on the first support vector and the second support vector corresponding to the corresponding iterative training; In the case that the training sample does not belong to the first support vector corresponding to the corresponding iteration training nor to the second support vector corresponding to the corresponding iteration training, it is determined that the conversion function corresponding to the training sample is a target linear function.

5. The method according to claim 2, characterized in that: The determining of the target kernel function corresponding to each iterative training based on the conversion function corresponding to each training sample in the training sample set corresponding to each iterative training and the initial kernel function comprises: The initial kernel function is conformally transformed using the conversion function corresponding to each training sample in the training sample set corresponding to each iterative training to obtain the target kernel function corresponding to each iterative training, wherein the target kernel function corresponding to each iterative training is the product of the initial kernel function and the conversion function corresponding to the corresponding training sample.

6. The method according to claim 2, characterized in that The step of determining the target support vector machine model from the second support vector machine model corresponding to each iteration training comprises: The second support vector machine models corresponding to each iterative training are tested respectively using the test sample sets corresponding to each iterative training, so as to determine the target support vector machine model from each of the second support vector machine models based on the test results of each of the second support vector machine models.

7. The method according to any one of claims 1 to 6, characterized in that The first support vector machine model uses a decision function to determine whether the input sample is a fraudulent sample, and the decision function is determined based on the input sample, at least one support vector, the weight and category label of each support vector, a kernel function and a bias term; The initial kernel function selects a radial basis polynomial RBP kernel function, and the RBP kernel function is a target exponential function, wherein the independent variable of the target exponential function is a polynomial.

8. A device for detecting credit card data, characterized in that: include: An acquisition module, used for acquiring credit card data samples, wherein the credit card data samples include fraud samples and normal samples, and the number of the fraud samples is less than the number of the normal samples; A training module, for performing a set number of iterative trainings on the first support vector machine model based on the credit card data sample and the selected initial kernel function, so as to obtain a second support vector machine model corresponding to each iterative training, wherein each iterative training is based on the training samples in the corresponding training sample set, the first support vector of the fraudulent sample and the second support vector of the normal sample, to determine the conversion function corresponding to the training samples in the corresponding training sample set, and based on the conversion function corresponding to the training samples in the corresponding training sample set and the initial kernel function, to determine the corresponding target kernel function, so as to train the first support vector machine model using the corresponding training sample set and the target kernel function, to obtain the corresponding second support vector machine model; A determination module, used to determine a target support vector machine model from the second support vector machine model corresponding to each iteration training; The processing module is used to obtain the credit card data to be detected, and input the credit card data into the target support vector machine model to determine whether the credit card data is fraudulent data.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.