Credit card fraud detection method based on anti-fact graph convolutional neural network
Based on the anti -factual diagram convolutional neural network, the credit card trading network and optimizing causal relationships were constructed, and the problems of difficulty in capturing causality and optimizing network structures in existing technologies were solved, and more efficient credit card fraud detection was achieved.
Patent Information
- Application Number
- CN202411874300.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-12-19
AI Technical Summary
The existing credit card fraud detection methods are difficult to dynamically capture the causal relationships and network structure changes between transaction nodes, and cannot accurately optimize the node status and network structure, resulting in limited fraud detection performance.
A method based on counterfactual graph convolutional neural network is used to construct a credit card transaction network through transaction feature difference quantification strategy, graph convolutional neural network is used for feature enhancement learning, and the causal difference between the real world and the hypothetical world is constructed through copy gates. The causal relationship is optimized in a loop, and the fraud detection result is finally output through causal consistency determination.
It improves the accuracy of credit card transaction feature extraction, enhances the ability to capture transaction relationships, simulates and optimizes causal relationships, and significantly improves the accuracy and stability of fraud detection results.
Smart Images

Figure CN119338470A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of fraud detection of artificial intelligence, and specifically relates to a credit card fraud detection method based on counterfactual graph convolutional neural network. Background Art
[0002] There are a large number of transaction features in credit card transaction records, including transaction amounts, consumption preferences, consumption dates, and other categories. These transaction features contain complex transaction information, which is crucial to the identification of fraudulent behavior and is a key to the problem of credit card fraud detection. Some existing studies use machine learning methods to achieve deep mining of transaction features through feature engineering, which can detect new and changing fraud patterns. However, these methods require the construction of classifiers and consume a lot of resources for feature engineering, and are unable to autonomously detect the interactive relationship in transaction behavior.
[0003] Learning the behavior patterns in credit card transactions helps improve the ability of credit card fraud detection models to identify fraudulent behaviors, and is another key to the problem of credit card fraud detection. Some existing studies regard credit card fraud detection as a sequence prediction task, using sequence learning models such as recurrent neural networks (RNNs) and long short-term memory (LSTM) to learn the behavior patterns between transactions by capturing the sequential dependencies in transaction data, thereby capturing the behavioral interaction relationship in credit card transactions. However, these sequence learning models rely on the sequence order to learn historical transactions, and need to assume that all historical transactions have an equal impact on the current transaction, and fail to consider the changes in the impact of different transactions on the current transaction at different interval sequence orders.
[0004] Graph convolutional neural networks (GCNs) have powerful feature extraction capabilities, can deeply mine the intrinsic features of transactions, and enhance the ability to extract transaction features and learn behavioral patterns. Unlike fraud detection models that rely on sequential sequences, fraud detection models based on graph convolutional neural networks can construct credit card transactions into topological transaction networks, effectively capture the behavioral interaction relationship in credit card transaction patterns through neighborhood aggregation, and learn the behavioral patterns of credit card transactions while effectively extracting transaction features. However, existing credit card fraud detection methods based on graph convolutional neural networks mainly use static modeling, which makes it difficult to dynamically capture the causal relationship between transaction nodes and changes in network structure. In addition, these methods usually ignore the importance of connections between transaction nodes, and cannot accurately optimize node status and network structure, thereby limiting the improvement of fraud detection performance. At the same time, there are problems such as feature deviation and noise in real credit card transactions, and graph convolutional neural networks are very sensitive to noise and abnormal structures in topological structures. These factors will cause graph convolutional neural networks to establish incorrect connections in the process of learning transaction behaviors, which in turn affects the inability of graph convolutional neural networks to accurately reflect the real interactive relationship between transaction users, reducing the classification ability of credit card fraud detection patterns. Therefore, designing a credit card fraud detection model with strong classification ability is still a challenge. Summary of the invention
[0005] In order to solve the above problems, the present invention proposes a credit card fraud detection method based on counterfactual graph convolutional neural network. First, a transaction feature difference quantification strategy is designed to extract credit card transaction features, and the discrimination between transaction features is weightedly calculated to construct a credit card transaction network. Then, a graph convolutional neural network is used for feature enhancement learning to capture the relationship between credit card transactions, and the real world is constructed through a replication gate. The node relationship enhanced by the graph convolutional neural network is passed to the real world, and a hypothetical world is generated through counterfactual assumptions. The causal difference between the two worlds is cyclically optimized to enhance the causal interaction relationship between credit card transactions. Finally, the node status of the credit card transaction is output through causal consistency judgment, thereby obtaining the best fraud detection result.
[0006] The technical solution of the present invention is as follows: A credit card fraud detection method based on counterfactual graph convolutional neural network includes the following steps: Step 1: Obtain the original credit card transaction data set, and use the transaction feature difference quantification strategy to preprocess and quantify the data set; Step 2: Build a credit card transaction network; Step 3: Construct a graph convolutional neural network to perform feature enhancement learning on the credit card transaction network; Step 4: Construct a counterfactual hypothesis network optimization mechanism; Step 5: Perform causal consistency judgment to predict the legitimacy or fraud of the current credit card transaction.
[0007] Furthermore, in step 1, the original credit card transaction data set obtained is , the dimension is , Indicates the number of transactions, Indicates the number of features of each transaction; each transaction includes three features: non-numerical, numerical, and time. The process of preprocessing and difference quantification is as follows: Step 1.1: The difference quantification formula of non-numerical features is as follows: ; ; in, Indicates The first transaction non-numerical features; Indicates The first transaction non-numerical features; Quantify the difference results for non-numerical features; , These are two different transaction numbers; Indicates The value of a non-numeric feature; Indicates the values of other non-numerical features; Indicates the number of values of other non-numerical features; Indicates a given value and The conditional probability difference when Indicated in The conditional probability of non-numerical features; and for two different subsets of corresponding maximum conditional probabilities; Step 1.2: Split the numerical features into The quantitative formula for the difference of numerical features is: ; in, Indicates The first transaction Numerical features; Indicates The first transaction Numerical features; Quantify the results for differences in numerical features; , Respectively represent , intervals; express and The difference quantification result is calculated in the same way as the difference quantification calculation method of non-numerical features; Step 1.3: The quantitative formula for the difference of time characteristics is: ; in, Indicates The first transaction time characteristics; Indicates The first transaction time characteristics; Quantify the results for differences in temporal characteristics; Represents the weight of the time feature; Step 1.4: Perform weighted aggregation on the quantified results of the differences in non-numerical, numerical, and time features to calculate the overall feature difference between the two transactions. The calculation formula is: ; in, for overall characteristic differences; For the transactions; Indicates transactions; is the number of numerical features; is the number of non-numerical features; is the number of time features.
[0008] Furthermore, the specific process of step 2 is as follows: Step 2.1: In the credit card transaction dataset, each transaction is regarded as a transaction node. In order to measure the similarity between all transaction pairs, the average value of the overall feature difference is calculated. The formula is as follows: ; in, is the average value of the overall characteristic difference; Step 2.2: Determine the connection relationship between transaction nodes based on the average value of overall feature differences to form a credit card transaction network ,in Represents a node set, one transaction is one node, Transactions In the credit card transaction network nodes, Represents an edge set, an edge represents a transaction relationship, and the edge set is in the form of an adjacency matrix. The specific construction formula is as follows: ; in, is the adjacency matrix Line The elements of the column represent and Whether connected; The row corresponds to Transaction No. Column corresponds to transactions; if and The difference between , then it is believed that there is a correlation between them, that is, , otherwise, it is considered that there is no correlation between them, that is, ; Step 2.3: In the credit card transaction network, the node degree and neighborhood set are defined as follows: ; ; in, Indicates The node degree of the transaction; express The neighborhood set of ; Step 2.4: In the credit card transaction network, the edge weights are expressed as follows: ; in, for and The edge weights between ; is an exponential function with base e; is a smoothing parameter.
[0009] Furthermore, in step 3, the graph convolutional neural network includes several hidden layers, and the transaction nodes perform feature enhancement learning in the propagation of the hidden layers; the specific process is: Step 3.1: Use the credit card transaction network as the input of the graph convolutional neural network. The formula is as follows: ; in, Represents the feature embedding generated by the graph convolutional neural network; is the mapping function of the graph convolutional neural network; Step 3.2: Train the parameters in the credit card transaction network in the hidden layer and continuously update the feature representation. The mapping operation formula for each hidden layer is: ; in, For the The feature matrix of hidden layers; is the adjacency matrix; is the activation function; for The degree matrix of Represents the adjacency matrix Add the identity matrix The normalized form of ; Indicates The weight matrix of the hidden layers; Step 3.2.2, introduce positive samples and design the mixed weight matrix. The formula is as follows: ; in, is the mixing weight matrix; Represents the original weight matrix Perform L2 normalization; , Respectively Transaction, The feature matrix of each transaction; is a hyperparameter; Step 3.3, in There are hidden layers, and the update formula of node features is as follows: ; in, Indicates hidden layers; is a nonlinear activation function; is a hyperparameter; Indicates The node degree of the transaction; Indicates The transaction was The node features of the hidden layer.
[0010] Furthermore, the specific process of step 4 is as follows: Step 4.1. Create a blank network, name it the real world, design a copy gate mechanism, and pass the parameters and node states in the graph convolutional neural network to the real world. The formula is as follows: ; ; in, is the output of the replication gate; is the activation function; Indicates The weight matrix of the iteration; Indicates In iteration The hidden state of Indicates The bias of the iteration; For the real world; for The replication gate updates the state output; Step 4.2: Based on the counterfactual hypothesis, disconnect the nodes with low similarity in the real world to generate a hypothetical world. The disconnection operation is defined as follows: ; in, For the hypothetical world; It is an assignment operation; Indicates disconnection and The connection between Assume that the node status in the world is updated as follows: ; in, , In the hypothetical world In the sequence The state at the iteration; express The number of neighboring nodes; for The neighborhood set of ; express In the The node degree in the iteration; represents the feature transformation function; Step 4.3: In order to quantify the causal difference between the real world and the hypothetical world, the causal difference between nodes is calculated. For any two credit card transaction nodes, the causal difference is defined as: ; in, for causal differences; is the expected value; Indicated in In case of occurrence Expected value; Indicated in If it does not happen Expected value; Step 4.4: Set a difference threshold to determine whether to remove node connections with weak causal differences. The judgment conditions are as follows: ; ; in, is the causal effect between transaction nodes; To remove the operation; , Respectively , transaction nodes; Step 4.5: Re-input the adjusted hypothetical world into the graph convolutional neural network for a new round of training. The node state update formula is as follows: ; in, In the hypothetical world hidden layers; In the hypothetical world hidden layers; is the optimized hypothetical world adjacency matrix; Step 4.6: After a new round of training, the final output of the new hypothetical world is : ; in, represents the normalization of causal differences.
[0011] Furthermore, the specific process of step 5 is as follows: Step 5.1: The causal consistency between the real world and the hypothetical world is determined by calculating the norm of the causal difference, specifically: When , it is determined that the causal relationship between the real world and the hypothetical world is consistent, and step 5.2 is performed; otherwise, return to step 4 and continue to optimize the real world and the hypothetical world; Step 5.2: Predict the legitimacy and fraud of credit card transactions. The prediction formula is as follows: ; in, To predict the results; is the ReLU nonlinear activation function; , are the weight matrices of the 0th hidden layer and the 1st hidden layer respectively; represents the input features, Through , Multiply to perform linear transformation; is the softmax activation function; Step 5.3: Pre-set a threshold ,like , then the current credit card transaction is a fraudulent transaction, otherwise, it is a legal transaction.
[0012] The beneficial technical effects brought about by the present invention are as follows.
[0013] Improve the accuracy of credit card transaction feature extraction: By designing a transaction feature difference quantification strategy, it is possible to effectively extract and weight the distinction between credit card transaction features, build a more accurate credit card transaction network, and thus improve the feature expression capability and data quality.
[0014] Enhance the ability to capture credit card transaction relationships: Use graph convolutional neural networks for feature enhancement learning to effectively capture the complex relationships between credit card transactions, especially the interaction information between different transaction nodes, and improve the model's ability to identify fraudulent behavior.
[0015] Simulate and optimize causal relationships: By introducing a replication gate to construct the causal difference between the real world and the hypothetical world, using counterfactual assumptions to generate hypothetical worlds and performing loop optimization, the causal interaction of credit card transactions is effectively simulated. This process can more accurately capture the key nodes in the causal chain and avoid the risk of unclear or ignored causal relationships in traditional methods.
[0016] Improve the accuracy and stability of fraud detection results: Outputting the transaction node status through the causal consistency judgment mechanism can provide more robust and accurate fraud detection results while ensuring causal consistency. This not only improves the accuracy of fraud detection, but also effectively reduces the probability of false positives and false negatives. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a process diagram of the credit card fraud detection method based on the counterfactual graph convolutional neural network of the present invention.
[0018] Figure 2 It is a bar chart comparing the four evaluation indicators of the method of the present invention and the GCN method.
[0019] Figure 3 1 is a comparison diagram of the visualization results of the method of the present invention and the GCN method; wherein (a) is the visualization result of the GCN method, and (b) is the visualization result of the method of the present invention. DETAILED DESCRIPTION
[0020] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments: like Figure 1 As shown, the present invention is based on graph convolutional neural network (GCN) technology, combined with causal relationship modeling and counterfactual assumptions, to dynamically analyze and optimize the credit card transaction network. The specific steps include transaction feature difference quantification strategy, credit card transaction network construction, feature enhancement learning of graph convolutional neural network, counterfactual assumption network optimization mechanism, and causal consistency determination. The specific implementation is as follows: Step 1: Obtain the original credit card transaction data set, and use the transaction feature difference quantification strategy to preprocess and quantify the data set.
[0021] The original credit card transaction dataset obtained is , which is a dimensional dataset, where Indicates the number of transactions, Indicates the number of features for each transaction. Since the feature types in the credit card transaction data set are different, and the types and importance of numerical features, non-numerical features, and time features are different, the present invention designs a transaction feature difference quantification strategy to achieve feature preprocessing and difference quantification. The specific process is as follows: Step 1.1: Non-numerical features (such as consumption habits, preferences, etc.) can indirectly reflect the behavior patterns of credit card users. They are complexly distributed in the feature space and difficult to process directly. The present invention introduces conditional probability to normalize non-numerical features to quantify the differences between non-numerical features. The normalization formula is as follows: ; ; in, Indicates The first transaction non-numerical features; Indicates The first transaction non-numerical features; Quantify the difference results for non-numerical features; , These are two different transaction numbers; is the normalization factor, normalized to the range of [0,1]; Indicates The value of a non-numeric feature; Indicates the values of other non-numerical features; Indicates the number of values of other non-numerical features; Indicates a given value and The conditional probability difference when Indicated in The conditional probability of non-numerical features; and for The two different subsets of the corresponding maximum conditional probabilities. Through the above formula, the differences between non-numerical features can be effectively quantified and normalized.
[0022] Step 1.2: Numerical features (such as transaction amount, transaction merchant type, etc.) can directly reflect credit card transaction behavior. When processing numerical features, the present invention divides them into Equally spaced intervals , For the The quantitative formula for the difference of numerical features is: ; in, Indicates The first transaction Numerical features; Indicates The first transaction Numerical features; Quantify the results for differences in numerical features; , Respectively represent , intervals; is the normalization factor; express and The calculation method of the difference quantization result is the same as that of the difference quantization of non-numerical features. Through discretization and normalization operations, the expression ability of numerical features in different intervals is improved.
[0023] Step 1.3: Time features (such as transaction time, periodicity, and seasonality) can reflect the time series pattern of credit card transactions. Based on the numerical features, feature weights are assigned to time features, and the expression of transaction features is enhanced through time sensitivity. The processing formula for time features is: ; in, Indicates The first transaction time characteristics; Indicates The cth time feature of a transaction; Quantify the results for differences in temporal characteristics; The weight of the time feature can be adjusted dynamically according to the importance of the time feature. The introduction of time features enhances the model's ability to capture time series.
[0024] Step 1.4: Perform weighted aggregation on the quantified results of the differences in non-numerical, numerical, and time features to calculate the overall feature difference between the two transactions. The calculation formula is: ; in, for overall characteristic differences; For the transactions; Indicates transactions; is the number of numerical features; is the number of non-numerical features; is the number of time features.
[0025] Through the above-mentioned transaction feature difference quantification strategy, the numerical, non-numerical and time features in the credit card transaction data are synchronously processed and differentially quantified. Furthermore, different weights are assigned to the three types of features according to their importance, thus building a stronger credit card transaction feature representation capability.
[0026] Step 2: Build a credit card transaction network. After completing the feature extraction and difference calculation of the credit card transaction data, build a credit card transaction network based on the similarity of transaction features. The credit card transaction network provides topological structure support for subsequent graph convolution training. The specific construction process is as follows: Step 2.1: In the credit card transaction data set, each credit card transaction is regarded as a transaction node. In order to measure the similarity between all transaction pairs, the average value of their overall feature differences is first calculated. The formula is as follows: ; in, is the average value of the overall characteristic difference; is the total number of credit card transaction pairs, used for normalization.
[0027] Step 2.2: Based on the feature differences between credit card transactions, determine the connection relationship between transaction nodes according to the average value of the overall feature differences to form a credit card transaction network ,in Represents a node set, one transaction is one node, Transactions In the credit card transaction network nodes, Represents an edge set, where an edge represents a transaction relationship. The weight of each edge is determined by the overall feature difference. The edge set is in the form of an adjacency matrix, and the specific construction formula is as follows: ; in, is the adjacency matrix Line The elements of the column represent and Whether connected; The row corresponds to Transaction No. Column corresponds to transactions. and The difference between , then it is believed that there is a correlation between them, that is, , otherwise, it is considered that there is no correlation between them, that is, .
[0028] Step 2.3: In the credit card transaction network, the node degree and neighborhood set are defined as follows: ; ; in, Indicates The node degree of the transaction, that is, The number of connected transaction nodes; express The neighborhood set of The set of directly connected nodes.
[0029] Step 2.4: In the credit card transaction network, the edge weights are expressed as follows: ; in, for and The edge weights between ; is an exponential function with base e; is a smoothing parameter used to control the decay rate of the weight. When setting By assigning edge weights, the strength of the association between transaction nodes can be captured more clearly, providing better input for subsequent graph convolutional neural network training.
[0030] Step 3: Construct a graph convolutional neural network to perform feature enhancement learning on the credit card transaction network. In order to perform deep feature enhancement learning on the credit card transaction network, the present invention designs a graph convolutional neural network containing several hidden layers, and the transaction nodes perform enhanced learning in the propagation of the hidden layers. The specific process is as follows: Step 3.1: Use the credit card transaction network as the input of the graph convolutional neural network. The formula is as follows: ; in, Represents the feature embedding generated by the graph convolutional neural network; is the mapping function of the graph convolutional neural network. Through this process, the graph convolutional neural network can effectively generate feature embeddings suitable for fraud detection from the credit card transaction network.
[0031] Step 3.2: Train the parameters in the credit card transaction network in the hidden layer and continuously update the feature representation. The mapping operation formula for each hidden layer is: ; in, For the The feature matrix of hidden layers; is the adjacency matrix; is the activation function; for The degree matrix of Represents the adjacency matrix Add the identity matrix The normalized form of ; Represents the symmetric normalization of the adjacency matrix; Indicates Through this operation, the hidden layer can effectively update the node feature representation, thereby better capturing the potential patterns in the credit card transaction network.
[0032] Step 3.2.2: In order to further improve the learning ability of the graph convolutional neural network on credit card transaction data, the present invention designs a mixed weight matrix and introduces positive samples to contribute to the weight of feature extraction. The formula of the mixed weight matrix is as follows: ; in, is the mixing weight matrix; Represents the original weight Perform L2 normalization; , Respectively Transaction, The feature matrix of each transaction; is a hyperparameter used to control the degree of weight adjustment. The weighted feature ratio of the positive sample Used to distinguish positive and negative samples and improve feature differentiation ability.
[0033] Step 3.3, in There are hidden layers, and the update formula of node features is as follows: ; in, Indicates hidden layers; is a nonlinear activation function; is a hyperparameter; Indicates The node degree of the transaction; Indicates The transaction was The node features of the hidden layer.
[0034] By stacking multiple layers, high-level features in the credit card transaction network are extracted to achieve optimized learning for the credit card fraud detection task.
[0035] Step 4: Construct a counterfactual hypothesis network optimization mechanism. First, create a blank network and name it the real world. Pass the node state of the enhanced transaction network to the real world. At the same time, generate a hypothetical world based on the counterfactual hypothesis, and cyclically calculate the causal difference of credit card transactions between the real world and the hypothetical world. According to the causal difference, adjust the causal relationship of credit card transactions in the real world and the hypothetical world. The specific steps are as follows: Step 4.1. Design a copy gate mechanism to pass the parameters and node states in the graph convolutional neural network to the real world by comprehensively considering the node neighborhood characteristics and weights. The formula is as follows: ; ; in, To replicate the output of the gate, the update degree of the transaction node is controlled; is the activation function; Indicates The weight matrix of the iteration; Indicates In iteration The hidden state of Indicates The bias of the iteration; is the node status of the real world; for The replication gate updates the state output.
[0036] Step 4.2: Based on the counterfactual hypothesis, disconnect the connections between nodes with low similarity in the real world to generate a hypothetical world. The disconnection operation is defined as follows: ; in, For the hypothetical world; It is an assignment operation; Indicates disconnection and The connection between.
[0037] Assume that the node status in the world is updated as follows: ; in, , In the hypothetical world In the sequence The state at the iteration; express The number of neighboring nodes; for The neighborhood set of The set of directly connected nodes; express In the The node degree in the iteration; Represents the feature transformation function.
[0038] Step 4.3: In order to quantify the causal difference between the real world and the hypothetical world, the causal difference between nodes is calculated. For any two credit card transaction nodes, the causal difference is defined as: ; in, for causal differences; is the expected value; Whether the situation occurs; Indicated in In case of occurrence Expected value; Indicated in If it does not happen expected value.
[0039] Step 4.4: According to the calculated causal difference, a difference threshold is set to determine whether to remove the node connection with weak causal difference. The judgment conditions are as follows: ; ; in, is the causal difference between transaction nodes; To remove the operation; , Respectively , transaction nodes; is the difference threshold representing the real world. In the above formula, when the judgment result is 1, the and Otherwise, keep the connection.
[0040] Step 4.5: Re-input the adjusted hypothetical world into the graph convolutional neural network for a new round of training. The node state update formula is as follows: ; in, In the hypothetical world hidden layers; In the hypothetical world hidden layers; is the optimized hypothetical world adjacency matrix.
[0041] Step 4.6: After a new round of training, the final output of the new hypothetical world network is : ; in, Represents the node relationship of credit card transactions in the real world; represents the normalization of causal differences.
[0042] Step 5: Perform causal consistency judgment to predict the legitimacy and fraud of the current credit card transaction. Perform causal difference judgment on the hypothetical world after loop optimization and the real world. If the causal judgment is consistent, lock the node state of the real world and enter the output layer for classification output; the specific process is as follows: Step 5.1: The causal consistency between the real world and the hypothetical world is determined by calculating the norm of the causal difference, specifically: , it is determined that the causal relationship between the real world and the hypothetical world is consistent, and step 5.2 is performed; otherwise, return to step 4 and continue to optimize the real world and the hypothetical world.
[0043] Step 5.2: If the causal relationship is consistent, the final real-world network is output and the legitimacy and fraud of the credit card transaction are predicted by the classifier. The prediction formula is as follows: ; in, To predict the results; is the ReLU nonlinear activation function; , are the weight matrices of the 0th hidden layer and the 1st hidden layer respectively; represents the input features, Through , Multiply to perform linear transformation; is the softmax activation function, which is used to normalize the probability distribution.
[0044] Step 5.3: Pre-set a threshold (usually 0.5), if , then the current credit card transaction is a fraudulent transaction, otherwise, it is a legal transaction.
[0045] The credit card fraud detection method based on causal graph convolutional neural network provided by the present invention realizes high-precision identification of credit card fraud transactions by designing transaction feature difference quantification strategy, credit card transaction network construction, feature enhancement learning of graph convolutional neural network, counterfactual hypothesis network optimization mechanism, causal consistency judgment and other steps. The performance results are compared with the graph convolutional neural network as the baseline, and the evaluation indicators are: accuracy (ACC), recall rate, F1 score and area under the sensitivity curve (AUC score).
[0046] The AUC score evaluates the performance of the model through the area under the ROC curve. The larger the area, the better the performance. It is created through the relationship between the true positive rate (TPR) and the false positive rate (FPR).
[0047] The performance of the present invention is evaluated on the Credit Card Fraud Detection dataset (CCFD dataset for short), which consists of credit card transaction records within two days in September 2013, including 492 fraudulent transactions, and the transaction imbalance ratio reaches 0.172%. Fraud labels are marked by professional investigators of the company, 1 represents fraudulent transactions, and 0 represents normal transactions. First, in data preprocessing, oversampling and undersampling are used to solve the problem of fraudulent transaction imbalance. Since the training of graph convolutional neural networks requires a lot of computing resources, 100,000 data are randomly selected as small data sets for small batch detection.
[0048] In the experiment of the present invention, the GCN method is selected as the comparison method. The comparison results of the accuracy, precision, F1 score, and AUC score between the method of the present invention (referred to as the HC-GCN method) and the GCN method are shown in Table 1 below: Table 1 Comparison results of different methods .
[0049] As shown in Table 1 and Figure 2 As shown in the figure, the accuracy, precision, F1 score, and AUC score of the proposed method are better than those of the proposed method. The accuracy is improved by 0.99%, the precision is improved by 3.85%, the F1 score is improved by 3.12%, and the AUC score is improved by 5%, showing good classification performance for credit card transactions. All four evaluation indicators are improved. In the data set with Gaussian noise, the performance of the proposed method is also better than that of the GCN method. In addition, the GCN method and the proposed method are visualized, and the comparison results are shown in the figure below. Figure 3 As shown, (a) is the visualization result of the GCN method, and (b) is the visualization result of the method of the present invention. In the visualization results, it can be seen that the method of the present invention has better classification ability, more accurate identification of fraud and legal transactions, and effectively improves the model's detection performance for credit card fraud transactions.
[0050] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A credit card fraud detection method based on counterfactual graph convolutional neural network, characterized in that: The steps include: Step 1: Obtain the original credit card transaction data set, and use the transaction feature difference quantification strategy to preprocess and quantify the data set; Step 2: Build a credit card transaction network; Step 3: Construct a graph convolutional neural network to perform feature enhancement learning on the credit card transaction network; Step 4: Construct a counterfactual hypothesis network optimization mechanism; Step 5: Perform causal consistency judgment to predict the legitimacy or fraud of the current credit card transaction.
2. The credit card fraud detection method based on counterfactual graph convolutional neural network according to claim 1, characterized in that: In step 1, the original credit card transaction dataset obtained is , the dimension is , Indicates the number of transactions, Indicates the number of features of each transaction; each transaction includes three features: non-numerical, numerical, and time. The process of preprocessing and difference quantification is as follows: Step 1.1: The difference quantification formula of non-numerical features is as follows: ; ; in, Indicates The first transaction non-numerical features; Indicates The first transaction non-numerical features; Quantify the differences of non-numerical features; , These are two different transaction numbers; Indicates The value of a non-numeric feature; Indicates the values of other non-numerical features; Indicates the number of values of other non-numerical features; Indicates a given value and The conditional probability difference when Indicated in The conditional probability of non-numerical features; and for two different subsets of corresponding maximum conditional probabilities; Step 1.2: Split the numerical features into The quantitative formula for the difference of numerical features is: ; in, Indicates The first transaction Numerical features; Indicates The first transaction Numerical features; Quantify the results for differences in numerical features; , Respectively represent , intervals; express and The difference quantification result is calculated in the same way as the difference quantification calculation method of non-numerical features; Step 1.3: The quantitative formula for the difference of time characteristics is: ; in, Indicates The first transaction time characteristics; Indicates The first transaction time characteristics; Quantify the results for differences in temporal characteristics; Represents the weight of the time feature; Step 1.4: Perform weighted aggregation on the quantified results of the differences in non-numerical, numerical, and time features to calculate the overall feature difference between the two transactions. The calculation formula is: ; in, for overall characteristic differences; For the transactions; Indicates transactions; is the number of numerical features; is the number of non-numerical features; is the number of time features.
3. The credit card fraud detection method based on counterfactual graph convolutional neural network according to claim 2 is characterized in that: The specific process of step 2 is: Step 2.1: In the credit card transaction dataset, each transaction is regarded as a transaction node. In order to measure the similarity between all transaction pairs, the average value of the overall feature difference is calculated. The formula is as follows: ; in, is the average value of the overall characteristic difference; Step 2.2: Determine the connection relationship between transaction nodes based on the average value of overall feature differences to form a credit card transaction network ,in Represents a node set, one transaction is one node, Transactions In the credit card transaction network nodes, Represents an edge set, an edge represents a transaction relationship, and the edge set is in the form of an adjacency matrix. The specific construction formula is as follows: ; in, is the adjacency matrix Line The elements of the column represent and Whether connected; The row corresponds to Transaction No. Column corresponds to transactions; if and The difference between , then it is believed that there is a correlation between them, that is, , otherwise, it is considered that there is no correlation between them, that is, ; Step 2.3: In the credit card transaction network, the node degree and neighborhood set are defined as follows: ; ; in, Indicates The node degree of the transaction; express The neighborhood set of ; Step 2.4: In the credit card transaction network, the edge weights are expressed as follows: ; in, for and The edge weights between is an exponential function with base e; is a smoothing parameter.
4. The credit card fraud detection method based on counterfactual graph convolutional neural network according to claim 3 is characterized in that: In step 3, the graph convolutional neural network includes several hidden layers, and the transaction nodes perform feature enhancement learning during the propagation of the hidden layers; The specific process is: Step 3.1: Use the credit card transaction network as the input of the graph convolutional neural network. The formula is as follows: ; in, Represents the feature embedding generated by the graph convolutional neural network; is the mapping function of the graph convolutional neural network; Step 3.2: Train the parameters in the credit card transaction network in the hidden layer and continuously update the feature representation. The mapping operation formula for each hidden layer is: ; in, For the The feature matrix of hidden layers; is the adjacency matrix; is the activation function; for The degree matrix of Represents the adjacency matrix Add the identity matrix The normalized form of ; Indicates The weight matrix of the hidden layers; Step 3.2.2, introduce positive samples and design the mixed weight matrix. The formula is as follows: ; in, is the mixing weight matrix; Represents the original weight matrix Perform L2 normalization; , Respectively Transaction, The feature matrix of each transaction; is a hyperparameter; Step 3.3, in There are hidden layers, and the update formula of node features is as follows: ; in, Indicates hidden layers; is a nonlinear activation function; is a hyperparameter; Indicates The node degree of the transaction; Indicates The transaction was The node features of the hidden layer.
5. The credit card fraud detection method based on counterfactual graph convolutional neural network according to claim 4 is characterized in that: The specific process of step 4 is as follows: Step 4.
1. Create a blank network, name it the real world, and design a copy gate mechanism to pass the parameters and node states in the graph convolutional neural network to the real world. The formula is as follows: ; ; in, is the output of the replication gate; is the activation function; Indicates The weight matrix of the iteration; Indicates In iteration The hidden state of Indicates The bias of the iteration; For the real world; for The replication gate updates the state output; Step 4.2: Based on the counterfactual hypothesis, disconnect the nodes with low similarity in the real world to generate a hypothetical world. The disconnection operation is defined as follows: ; in, For the hypothetical world; It is an assignment operation; Indicates disconnection and The connection between Assume that the node status in the world is updated as follows: ; in, , In the hypothetical world In the sequence The state at the iteration; express The number of neighboring nodes; for The neighborhood set of ; express In the The node degree in the iteration; represents the feature transformation function; Step 4.3: In order to quantify the causal difference between the real world and the hypothetical world, the causal difference between nodes is calculated. For any two credit card transaction nodes, the causal difference is defined as: ; in, for causal differences; is the expected value; Indicated in In case of occurrence Expected value; Indicated in If it does not happen Expected value; Step 4.4: Set a difference threshold to determine whether to remove node connections with weak causal differences. The judgment conditions are as follows: ; ; in, is the causal effect between transaction nodes; To remove the operation; , Respectively , transaction nodes; Step 4.5: Re-input the adjusted hypothetical world into the graph convolutional neural network for a new round of training. The node state update formula is as follows: ; in, In the hypothetical world hidden layers; In the hypothetical world hidden layers; is the optimized hypothetical world adjacency matrix; Step 4.6: After a new round of training, the final output of the new hypothetical world is : ; in, represents the normalization of causal differences.
6. The credit card fraud detection method based on counterfactual graph convolutional neural network according to claim 5, characterized in that: The specific process of step 5 is as follows: Step 5.1: The causal consistency between the real world and the hypothetical world is determined by calculating the norm of the causal difference, specifically: When , it is determined that the causal relationship between the real world and the hypothetical world is consistent, and step 5.2 is performed; otherwise, return to step 4 and continue to optimize the real world and the hypothetical world; Step 5.2: Predict the legitimacy and fraud of credit card transactions. The prediction formula is as follows: ; in, To predict the results; is the ReLU nonlinear activation function; , are the weight matrices of the 0th hidden layer and the 1st hidden layer respectively; represents the input features, Through , Multiply to perform linear transformation; is the softmax activation function; Step 5.3: Pre-set a threshold ,like , then the current credit card transaction is a fraudulent transaction, otherwise, it is a legal transaction.
Citation Information
Patent Citations
Sample generation method, model training method, storage medium and program product
CN115018150A
Causal-based model double inspection method, system and equipment and storage medium
CN115700546A
Dynamic graph fraud detection method based on Transform causal chain
CN116579848A
Transformer fault diagnosis model construction method and device based on anti-fact analysis
CN118797477A
Credit card fraud detection method based on density-driven integrated hybrid sampling
CN118982421A
Cited By
Payment risk assessment method, model training method, related device and equipment
CN121190064A