Method for processing data sets in credit card fraud transactions based on clustering down-sampling technique

By combining clustering downsampling techniques with hybrid neural networks, the problem of imbalanced datasets in credit card fraud detection is solved, achieving efficient and accurate fraud transaction detection.

CN116821688BActive Publication Date: 2025-11-18SOUTHEAST UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310892750.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-20
Publication Date
2025-11-18
Estimated Expiration
2043-07-20

AI Technical Summary

Technical Problem

Imbalanced datasets exist in credit card fraud detection, and existing technologies struggle to effectively balance the amount of data and improve the accuracy of fraud detection.

Method used

We employ clustering-based downsampling technology, using the K-Means clustering algorithm to cluster normal transactions, generating representative new nodes, constructing a balanced training dataset, and combining it with a hybrid neural network for fraud transaction detection.

Benefits of technology

It effectively reduces the amount of data, maintains group characteristics, improves the accuracy and efficiency of fraud transaction detection, reduces running time, and minimizes the influence of human subjectivity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821688B_ABST
    Figure CN116821688B_ABST
Patent Text Reader

Abstract

The application discloses a method for processing data sets in credit card fraud transactions based on clustering down-sampling technology, and relates to the application of artificial intelligence field related algorithm. According to the nature of the transaction, the credit card transaction is divided into normal transaction and fraud transaction, and the K-Means clustering algorithm is used for clustering all normal transactions. For each credit card normal transaction cluster obtained by clustering, a new node is created to represent the cluster, and the new node represents the characteristics of the normal transactions with similar characteristics. These new nodes represent the representatives of normal transaction nodes with similar characteristics, and the new nodes of all clusters constitute a new normal transaction set. Finally, the new normal transaction set and the fraud transaction set are combined into a balanced training data set. The application solves the technical problem that the existing technology cannot effectively extract the characteristics of a specific group due to the imbalance of the data set in the credit card fraud detection, resulting in slow operation efficiency and low accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and more specifically, to address the problem of imbalanced datasets commonly found in credit card fraud detection, by designing a method for processing datasets from credit card fraud transactions based on clustering downsampling technology. Background Technology

[0002] With the progress of global economic integration, credit cards are playing an increasingly important role in the daily lives of ordinary people. Through the convenient spending methods of credit cards, people can easily complete economic activities such as paying bills, online shopping, and settling consumer debt. The rapid development of the credit card business has also led to a surge in fraudulent transactions. According to EU statistics, in 2018, the total value of credit card transactions in the single euro payment zone reached €4.84 trillion, while fraudulent transactions amounted to a staggering €1.8 billion, representing 0.037% of the total credit card transaction value. This means that for every €100 spent, €3.70 was lost due to fraudulent transactions. Therefore, research on credit card fraud detection is particularly important for both the financial and academic communities. The volume of credit card transaction data is unprecedented, and manual methods for identifying credit card transactions are increasingly unable to meet the needs of practical applications. As a result, various sectors are gradually applying currently popular machine learning algorithms to credit card fraud detection.

[0003] The imbalanced dataset problem refers to a situation where, in binary or multi-class classification, one class overwhelmingly dominates in terms of data volume. In a credit card fraud detection dataset, the dataset is divided into legitimate transactions and fraudulent transactions based on whether a credit card transaction is fraudulent—this is a binary classification problem. Because fraudulent transactions constitute a very small percentage of total credit card transactions, machine learning algorithms often only remember the characteristics of legitimate transactions, defaulting to classifying fraudulent transactions as legitimate, thus affecting the practical application value of machine learning algorithms. We use a real credit card dataset as our experimental data. Figure 1 This graph shows the prediction accuracy of machine learning algorithms on the original dataset. The vertical axis represents the number of iterations of the machine learning algorithm, and the horizontal axis represents the prediction accuracy. The graph shows that the machine learning algorithm equates fraudulent transactions with legitimate transactions. Although the prediction accuracy is as high as 99.89%, it consistently misidentifies credit card fraudulent transactions, which can lead to significant economic losses for financial institutions and individuals.

[0004] In the early stages, scholars primarily used various sampling techniques to adjust the amount of transaction data of different classes in the samples to address this problem. These sampling techniques mainly achieve a balance in the amount of data between classes by adding or deleting samples of different classes. These techniques include Random Oversampling (ROS), Random Downsampling (RUS), Synthetic Minority Oversampling (SMOTE), and Adaptive Synthetic Oversampling (ADASYN). Random Oversampling simply duplicates nodes, increasing the number of minor class nodes to achieve a balance in the amount of data between the major and minor classes. Conversely, Random Downsampling achieves a balance between the two classes by deleting nodes from the major class. To address the randomness inherent in Random Oversampling and Random Downsampling, scholars proposed Synthetic Minority Oversampling, which creates new minority class nodes using improved oversampling techniques. Based on the different distributions of minor classes, scholars proposed Adaptive Synthetic Oversampling, which generates different new nodes according to the number of minor classes. Although the above methods randomly generate new samples, they also increase the possibility of overfitting of sample features. In addition, through extensive experimental evaluation of different sampling methods for imbalanced data problems, scholars have found that a hybrid approach of downsampling the majority class samples and oversampling the minority class samples to achieve inter-class balance can improve the performance of algorithms such as AdaBoost, XGBoost, and Random Forest.

[0005] In recent years, researchers have attempted to address the problem of imbalanced datasets by focusing on the costs caused by imbalanced classification, proposing new methods, including cost-sensitive algorithms and loss functions. Traditional classification algorithms do not differentiate between the costs incurred by the primary and secondary classes, meaning that the misclassification costs for the primary and minority classes are the same. In everyday applications, misclassification costs directly affect the loss function, and researchers have found that the value of the minority class is far higher than that of the primary class. By reducing the direct impact of misclassification costs caused by different classes, scholars have proposed the cost-sensitive concept to improve the efficiency of fraud transaction prediction. To address the inefficiency of labor and traditional sampling methods in solving the problem of imbalanced datasets, researchers proposed the cost-sensitive idea in 2014, which has since been applied in industry, medicine, and finance. To efficiently detect gaps in daily sewage pipes, researchers constructed cost-sensitive convolutional neural networks to analyze photos inside the pipes. In imbalanced datasets, the primary class contributes more cost value than the secondary class, playing a decisive role in the loss function. By capturing the errors of the primary and secondary classes, researchers have proposed loss functions based on average misclassification error and average squared misclassification error. While the above methods can address the imbalanced data problem to some extent, it's difficult to obtain the cost value in advance, as this value is set only based on experience. Furthermore, it may introduce greater errors and cause deviations in the loss function.

[0006] In recent years, scholars have begun to attempt to address the imbalanced dataset problem using hybrid methods combining clustering algorithms and oversampling techniques. Prachuabsupakij et al. created new nodes based on different categories of nodes using the SMOTE algorithm. Fu et al. designed a cost-sampling method to achieve inter-class balance; this scheme first divides fraudulent transactions into different clusters based on cost, and then creates new synthetic fraud samples based on the nodes in the same cluster. The imbalanced data problem also exists in software vulnerability detection; Gong et al. designed the KMFOS method. The KMFOS method first divides all defective nodes into different clusters, and then creates new nodes using nodes from two different clusters. However, the above methods may incur huge computational costs due to the creation of a large number of nodes. Simultaneously, the oversampling technique, by creating a large number of similar nodes, may lead to overfitting. Summary of the Invention

[0007] Purpose of the invention: To address the imbalanced category problem in datasets used in credit card fraud detection, this invention provides a method for processing datasets from credit card fraud transactions based on clustering downsampling technology.

[0008] Technical solution: To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0009] A method for processing datasets of credit card fraud transactions based on clustering downsampling techniques, comprising the following steps:

[0010] S1. Based on the nature of the transaction, credit card transactions are divided into normal transactions and fraudulent transactions, and all normal transactions are clustered using the K-Means clustering algorithm;

[0011] S2. For each cluster of normal credit card transactions obtained from clustering, create a new node to represent this cluster. The new node represents the characteristics of normal transactions with similar features.

[0012] S3. These new nodes represent a class of normal transaction nodes with similar characteristics, and the new nodes of all clusters constitute a new set of normal transactions;

[0013] S4. Combine the new set of normal transactions with the set of fraudulent transactions to form a training dataset in equilibrium.

[0014] Furthermore, the specific process of step S1 includes the following sub-steps:

[0015] Sub-step S1-1. Initialize cluster centers: Set the number of clusters to be divided for normal credit card transactions, k, to be equal to the number of fraudulent transactions. Randomly select k nodes of normal credit card transactions as cluster centers to complete the initialization of k cluster center information.

[0016] Sub-step S1-2. Cluster all normal transactions: Calculate the distance from each normal transaction node to all k cluster centers using the Euclidean distance formula. Assign each normal transaction node to the cluster containing the nearest cluster center, i.e., the cluster it belongs to. The normal transaction node is assigned to the cluster containing the node with the smallest Euclidean distance. This step is specifically shown in Formula ①, which means classifying the j-th credit card normal transaction node into the cluster with the shortest Euclidean distance.

[0017]

[0018] Where, x jl C represents the l-th attribute value of the j-th node. kl Let n' represent the l-th attribute value of the center point of the k-th cluster, n' represent the number of clusters, and m represent the number of attributes contained in each node.

[0019] Sub-step S1-3. Update cluster center point information according to the classification node situation: After normal transactions are classified, recalculate the cluster center points according to the new clustering situation, update the cluster center point information and generate nodes;

[0020] Sub-step S1-4. Repeat sub-steps S1-2 and S1-3 until the iteration termination condition is met, and the final clustering result is obtained.

[0021] Furthermore, in step S2, for each cluster of normal credit card transactions, a new node is created to represent this cluster. The new node represents the characteristics of normal transactions with similar features, assuming that each node consists of continuous variables and discrete variables.

[0022] For the new node x′ created by the continuous variable l , which is the average value of all nodes in the cluster for this attribute, is calculated using the following formula ②:

[0023]

[0024] Where n k This represents the number of nodes in the k-th cluster;

[0025] For the new node x″ created by the discrete variable l , which is the value with the highest frequency of occurrence among all nodes in this cluster attribute. The specific calculation formula ③ is as follows:

[0026]

[0027] The `count` function is used to count the frequency of node attributes. The pseudocode for the specific implementation of the credit card fraud monitoring dataset generation algorithm based on clustering downsampling is as follows.

[0028]

[0029] Beneficial effects: Compared with the prior art, the present invention adopts the above technical solution and has the following advantages:

[0030] (1) In response to the problem of imbalanced data in credit card fraud detection, this invention designs a clustering downsampling technique. By regenerating nodes after normal clustering, it efficiently extracts common features in normal transactions, greatly reduces the amount of data while maintaining group characteristics, thereby reducing running time and improving accuracy. Combined with the characteristics of fraudulent transactions, it achieves highly efficient prediction of fraudulent transactions.

[0031] (2) This invention addresses two unique characteristics of credit card fraud detection: making a decision to accept or reject a transaction within a very limited timeframe and processing a large amount of transaction details within a given timeframe. It fully utilizes the self-learning capabilities of machine learning algorithms and, for the first time in industry and academia, proposes a clustering-based k-means downsampling algorithm to handle continuous and discrete variables in the dataset, reducing the influence of human subjective perception and improving the accuracy of identification and screening. Attached Figure Description

[0032] Figure 1 This is a flowchart of clustering downsampling techniques;

[0033] Figure 2 This is a diagram of the credit card fraud detection process;

[0034] Figure 3 This is a diagram of a hybrid neural network architecture based on clustering downsampling technology for credit card fraud detection;

[0035] Figure 4 This is a diagram of a credit card fraud detection architecture based on a hybrid neural network. Detailed Implementation

[0036] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are merely some application scenarios of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0037] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties. For example, this system has an interface with relevant users or organizations. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving consent information from the aforementioned user or organization.

[0038] Example

[0039] According to the present invention, an embodiment of a method for predicting credit card transaction behavior is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0040] (1) Data introduction

[0041] The data in this invention comes from credit card fraud data of a branch of a certain bank. This branch has a large transaction volume, and its data indicators are relatively representative nationwide. At the end of 2020, the branch's credit card spending amounted to 5.775 billion yuan, with a non-performing loan ratio of 1.62%.

[0042] (2) Flowchart for credit card fraud detection

[0043] The credit card fraud process mainly includes: data preparation, training phase, testing phase, and scoring phase. See details for further information. Figure 2 .

[0044] 1. Data preparation: Extract credit card transaction information and related customer background information from the credit card database, extract useful features to form a dataset, and divide it into training set and test set;

[0045] 2. Training phase: Based on a comprehensive assessment of information such as credit card transaction data and customer information, the model is trained and its parameters are adjusted according to the training set.

[0046] 3. Testing phase: Evaluate the model using evaluation metrics to obtain the optimal model parameters;

[0047] 4. Scoring stage: The credit card user's transaction details are analyzed to predict whether the transaction is normal or fraudulent.

[0048] (3) Dataset preparation

[0049] The training process for different machine learning models in credit card fraud detection involves importing different input datasets, including personal customer information and credit card transaction data. This article uses a hybrid neural network (a credit card fraud detection method based on a deep hybrid neural network, patent application number: 202211582573) as an example to illustrate the process of handling imbalanced credit card data, and compares it with some cutting-edge algorithms in credit card fraud detection.

[0050] The dataset used in this invention consists of credit card transaction details from the branch from January to December 2020. Abnormal data was processed by deleting non-consumption transactions, resulting in over 6.61 million credit card transaction records at that time point. The percentage of credit card fraud at this branch from July to October 2020 was approximately 0.0139%–0.008%. Specific data is shown in the table below. To verify efficiency on an imbalanced dataset, we randomly selected 50,000 records each from November and December 2020 as the validation and test sets, respectively, requiring both sets to include all fraudulent transactions within that month.

[0051]

[0052] 1. Feature extraction of personal customer information

[0053] To improve the recognition efficiency of deep neural networks, one-hot encoding is used to convert 10 customer information data points into 134 one-hot variables, which serve as the input data for the deep neural network. The input consists of data in the range [batchsize, 134], where batchsize is the size of each batch. The specific data dictionary for individual customer information features is as follows.

[0054]

[0055]

[0056] 2. Extraction of features from credit card transaction information

[0057] A 13x8 data matrix is ​​generated for each credit card transaction, with two dimensions: time and features. Based on the attributes of the credit card transaction information, corresponding feature indicators are generated according to their feature types. The feature indicators are shown in the table below, with the time dimension T ranging from one day, two days, one week, one month, three months, six months, to one year.

[0058] Feature Name Feature meaning Attribute Category Average transaction amount Average transaction amount within the past time T Continuous variables Total transaction amount Total transaction amount within the past time T Continuous variables Transaction error amount The difference between this transaction and the average transaction amount within the past time period T. Continuous variables Number of transactions Total number of transactions within the past time T Continuous variables Most transaction methods Most frequent transaction methods within the past time period T Discrete variables Number of transaction terminals The number of transaction terminals corresponding to this card within the past time T. Continuous variables Most transaction channel types The most frequently traded channel type within the past time period T Discrete variables Entropy of Transaction Channel Types Gains of transaction channel type over past time T Continuous variables The period with the most transactions The time period with the most transactions within the past time T Discrete variables The time period with the largest transaction amount The time period containing the largest transaction within the past time T Discrete variables The ratio of average transaction volume to average daily assets The ratio of average transaction value to average daily assets over the past period T Continuous variables The ratio of total transaction volume to average daily assets The ratio of total transaction volume to average daily assets within the past time T Continuous variables The ratio of maximum transaction volume to average daily assets The ratio of the largest transaction amount to the average daily assets within the past time period T Continuous variables

[0059] (4) Model Introduction

[0060] 1. Introduction to the k-means clustering-based downsampling algorithm

[0061] During the processing of the input dataset, there are not only continuous variables (transaction amount, number of transaction terminals, ratio of average transaction amount to average daily assets), but also discrete variables (gender, occupation code, education level, etc.). To enrich the practical application, this paper proposes a downsampling algorithm based on clustering k-means.

[0062] The algorithm first classifies normal transactions using the k-means algorithm. Then, it selects representative nodes from each cluster and combines them with fraudulent transactions to form a new dataset, which serves as the input dataset for training the model. The specific flowchart is shown below. Figure 3 As shown.

[0063] The algorithm steps are as follows:

[0064] S1. Based on the nature of the transactions, credit card transactions are divided into normal transactions and fraudulent transactions. All normal transactions are then clustered using the K-Means clustering algorithm, specifically including the following sub-steps:

[0065] Sub-step S1-1. Initialize cluster centers: Set the number of clusters to be divided for normal credit card transactions, k, to be equal to the number of fraudulent transactions. Randomly select k nodes of normal credit card transactions as cluster centers to complete the initialization of k cluster center information.

[0066] Sub-step S1-2. Cluster all normal transactions: Calculate the distance from each normal transaction node to all k cluster centers using the Euclidean distance formula. Assign each normal transaction node to the cluster containing the nearest cluster center, i.e., the cluster it belongs to. The normal transaction node is assigned to the cluster containing the node with the smallest Euclidean distance. This step is specifically shown in Formula ①, which means classifying the j-th credit card normal transaction node into the cluster with the shortest Euclidean distance.

[0067]

[0068] Where, x jl C represents the l-th attribute value of the j-th node. kl Let n' represent the l-th attribute value of the center point of the k-th cluster, n' represent the number of clusters, and m represent the number of attributes contained in each node.

[0069] Sub-step S1-3. Update cluster center point information according to the classification node situation: After normal transactions are classified, recalculate the cluster center points according to the new clustering situation, update the cluster center point information and generate nodes;

[0070] Sub-step S1-4. Repeat sub-steps S1-2 and S1-3 until the iteration termination condition is met, and the final clustering result is obtained.

[0071] S2. For each cluster of normal credit card transactions obtained by clustering, create a new node to represent this cluster. The new node represents the characteristics of normal transactions with similar features. Assume that each node consists of continuous variables and discrete variables.

[0072] For the new node x′ created by the continuous variable l , which is the average value of all nodes in the cluster for this attribute, is calculated using the following formula ②:

[0073]

[0074] Where n k This represents the number of nodes in the k-th cluster;

[0075] For the new node x″ created by the discrete variable l , which is the value with the highest frequency of occurrence among all nodes in this cluster attribute. The specific calculation formula ③ is as follows:

[0076]

[0077] S3. These new nodes represent a class of normal transaction nodes with similar characteristics, and the new nodes of all clusters constitute a new set of normal transactions;

[0078] S4. Combine the new set of normal transactions with the set of fraudulent transactions to form a training dataset in equilibrium.

[0079] 2. Introduction to Credit Card Fraud Detection Algorithms

[0080] Credit card fraud detection employs a hybrid neural network (a credit card fraud detection method based on a deep hybrid neural network, patent application number: 202211582573). This hybrid neural network consists of two parts: a reverse neural network f for extracting credit card customer information. BPNN Partial and convolutional neural network f used to extract features of credit card transactions CNN Composition, specific structure as follows Figure 4 As shown.

[0081] Due to its nonlinear mapping and normalization capabilities, the inverse neural network is used to identify unique characteristics of cardholder background information and economic conditions. This inverse neural network has a four-layer structure: the input layer is based on the credit card user's personal information, the second and third layers are two hidden layers, and the final layer is an output layer composed of fully connected layers.

[0082] Because it can capture the continuity of neighboring areas and changes in two-dimensional space, convolutional neural networks (CNNs) are used to identify the dynamic relationships between transaction information, time windows, and personal economic situations, accurately reflecting the subtle differences between legitimate and fraudulent transactions. This CNN has a five-layer structure: the input layer is based on user transaction features; the middle layers contain convolutional layers, max-pooling layers, and three hidden layers; and the fifth layer is a fully connected layer that outputs the final judgment result to the user.

[0083] After training f BPNN and f CNN Next, we obtain the judgment results for user information and transaction information, then link these two together and input them into the Sigmoid algorithm to obtain the final judgment for the credit card transaction. If the judgment result exceeds a certain threshold, it is considered a fraudulent transaction; otherwise, it is considered a normal transaction.

[0084] (5) Performance evaluation indicators

[0085] To evaluate the effectiveness of cluster-based downsampling technology in credit card fraud detection, we introduce some evaluation metrics for assessing the performance of related algorithms.

[0086] 1. Confusion Matrix

[0087] To evaluate the accuracy of binary classification algorithms, a confusion matrix is ​​used to help assess their efficiency. For binary classification algorithms, a 2x2 data table is constructed to record the classifier's predictions, facilitating subsequent performance analysis, as shown in the table below.

[0088] Predicted value = 1 Predicted value = 0 Tag value = 1 True Yang Value False negative value Tag value = 0 False positive value True Negative Value

[0089] ①True positive value (TP) means that the predicted value of the sample is consistent with the label value, both of which are positive;

[0090] ② False negative (FN) means that the sample label is positive, but the predicted value is negative;

[0091] ③ False positive (FP) is when the sample label is negative, but the predicted value is negative;

[0092] ④ True negative (TN) means that the predicted value of the sample is consistent with the label value, both being negative.

[0093] 2. Accuracy

[0094] Accuracy is used to judge the model's prediction performance, meaning that the model can accurately identify a majority of instances. Generally, higher accuracy means higher performance. The specific formula is as follows:

[0095]

[0096] 3. Accuracy

[0097] Precision refers to the accuracy with which a model predicts positive samples. Generally, higher precision means better performance. The specific formula is as follows:

[0098]

[0099] 4. Recall rate

[0100] Recall rate refers to the accuracy of a model in identifying positive samples. Generally speaking, a higher recall rate means that the model is better able to identify positive samples.

[0101]

[0102] 5. F1 Score

[0103] F1-Score is an important metric that balances recall and precision.

[0104] Its value ranges between 0 and 1, where 0 means worst and 1 means best.

[0105]

[0106] (6) Experimental Results

[0107] To evaluate the clustering downsampling technique proposed in this patent for handling imbalanced credit card datasets, we compared it with some schemes proposed in other papers and random downsampling methods. To test the combination of different sampling methods and clustering techniques, we designed another clustering algorithm that combines random downsampling and random oversampling. This technique first divides the primary class into clusters, with the number of clusters being n times the number of secondary classes (here we set n to 10). New fraudulent transactions are created using the formula newfraud = a·x1 + (1-a)·x2, where a is a random value between 0 and 1, and x1 and x2 are different random samples from the secondary classes. The credit card fraud detection algorithms tested included hybrid neural networks, and the methods for handling imbalanced data included random upsampling, random downsampling, synthetic minority class oversampling, and adaptive comprehensive oversampling.

[0108] Based on the experimental results (as shown in the table below), we can see that the hybrid neural network based on clustering downsampling achieves the optimal F1-Score value, mainly by balancing the improvement of accuracy and recall.

[0109]

[0110]

Claims

1. A method for processing datasets from credit card fraud transactions based on clustering downsampling technology, characterized in that, The method includes the following steps: S1. Based on the nature of the transaction, credit card transactions are divided into normal transactions and fraudulent transactions, and all normal transactions are clustered using the K-Means clustering algorithm; S2. For each cluster of normal credit card transactions obtained from clustering, create a new node to represent this cluster. The new node represents the characteristics of normal transactions with similar features. S3. These new nodes represent a class of normal transaction nodes with similar characteristics, and the new nodes of all clusters constitute a new set of normal transactions; S4. Combine the new set of normal transactions with the set of fraudulent transactions to form a training dataset in equilibrium; The specific process of step S1 includes the following sub-steps: Sub-step S1-1. Initialize cluster centers: Set the number of clusters to be divided for normal credit card transactions. Equal to the number of fraudulent transactions, randomly selected. Each normal credit card transaction node is used as a cluster center to complete the initialization. Information on the cluster center points; Sub-step S1-2. Cluster all normal transactions: Calculate the clustering of each normal transaction node into all... The distance between cluster centers is calculated using the Euclidean distance formula. Each normal transaction node is assigned to the cluster containing the nearest cluster center, i.e., the cluster to which it belongs. The specific steps are shown in the formula. Indicates to the first Each normal credit card transaction node is categorized into the cluster with the shortest Euclidean distance. , , in, Indicates the first The node of the first Each attribute value Indicates the first The center point of each cluster Each attribute value This indicates the number of clusters, where m represents the number of attributes contained in each node; Sub-step S1-3. Update cluster center point information according to the classification node situation: After normal transactions are classified, recalculate the cluster center points according to the new clustering situation, update the cluster center point information and generate nodes; Sub-step S1-4. Repeat sub-steps S1-2 and S1-3 until the iteration termination condition is met, and the final clustering result is obtained; Step S2 describes creating a new node to represent each cluster of normal credit card transactions. The new node represents the characteristics of normal transactions with similar features. It is assumed that each node consists of continuous and discrete variables. For new nodes created by continuous variables , which is the average value of all nodes in the cluster for this attribute, calculated using the following formula. as follows: in Indicates the first The number of nodes in a cluster; For new nodes created by discrete variables , is the value with the highest frequency of occurrence among all nodes in this cluster attribute, calculated using the specific formula. as follows: in, This function is used to count the frequency of node attributes.