A blockchain account identity recognition method based on self-supervised learning
Patent Information
- Application Number
- CN202410563960.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-08
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-05-08
AI Technical Summary
[0004](1)内存占用量高,时间消耗大:节点分类任务需要引入整个图进行嵌入学习,然而,从实际区块链数据构建的交易网络庞大,应用于大规模图时,现有的图嵌入算法具有较高的内存和时间消耗;
[0042](1)本发明方法通过将区块链账户身份识别任务视为图分类任务,首先基于区块链交易记录,以账户为中心,为每个账户构建账户交易图,随后,对每个账户的账户交易图进行简化,缩小图的规模,从而降低了大规模图嵌入运算时的存储器占用量和时间消耗。
Smart Images

Figure CN118378127B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Ethereum transaction network security technology, specifically to a blockchain account identity recognition method based on self-supervised learning. Background Technology
[0002] Blockchain technology is a novel distributed framework with broad application prospects in finance, healthcare, supply chain, and other fields. Particularly in finance, due to its decentralized nature, blockchain plays a crucial role in cryptocurrencies. In a blockchain, an account refers to an entity participating in the blockchain transaction network; this can be an individual, organization, or smart contract. Each account has a unique identifier associated with a public key or account, used for cryptocurrency transactions and transfers. However, the anonymity of blockchain provides protection for fraudsters, making it easier for them to conceal their true identities and commit fraud, thus increasing the security risks of crypto assets. Phishing scams, Ponzi schemes, and other fraudulent activities occur frequently; therefore, strengthening account identity verification in blockchain is of great significance for risk assessment and market regulation.
[0003] Account identification in blockchain is a process of classifying account identities by capturing transaction pattern features. Existing account identification methods mainly focus on manual feature engineering, such as methods that infer the identities of illegitimate accounts by analyzing transaction pattern features in the blockchain network. These methods heavily rely on prior knowledge and do not fully capture the underlying information in the blockchain data, resulting in low feature utilization and weak expressive power. In recent years, deep learning on graphs has achieved significant success in various tasks. Blockchain data can be structurally represented using graph structures, where nodes represent blockchain accounts and edges represent transactions and other behaviors. Currently, many researchers view account identification in blockchain as a node classification task based on graph learning. For example, graph learning-based blockchain identity inference methods (I... 2 GL) identifies nodes through graph convolutional networks; however, despite the effectiveness of existing methods, they still have the following challenges and limitations:
[0004] (1) High memory consumption and long time consumption: The node classification task requires the entire graph to be embedded for learning. However, the transaction network built from actual blockchain data is huge. When applied to large-scale graphs, the existing graph embedding algorithms have high memory and time consumption.
[0005] (2) Inability to fully utilize transaction information leads to a decrease in the accuracy of blockchain account identity recognition: In blockchain transaction networks, blockchain transaction data contains more transaction information of blockchain account nodes, but lacks the embedded information of the nodes themselves. However, most existing graph learning methods rely on node feature engineering to solve the problem of shallow learning mechanisms, mainly focusing on the feature design and construction of nodes, while ignoring the potential value of transaction information, thus limiting the ability to accurately identify blockchain account identities.
[0006] (3) Imbalance of blockchain transaction data: At present, the publicly available blockchain transaction data is mainly released by third-party platforms. The vast majority of these are transaction data from normal nodes, while data from phishing nodes accounts for only a very small portion. This imbalance can lead to some overfitting problems in the model, that is, it performs well on the training set but has poor generalization ability on unknown data. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a blockchain account identity recognition method based on self-supervised learning.
[0008] The technical solution of this invention is:
[0009] A blockchain account identity verification method based on self-supervised learning includes the following steps:
[0010] Step 1: Obtain blockchain transaction records and construct a blockchain transaction record set A = {A1, A2, ..., A...} n}, where A i Different accounts are represented; all accounts participating in the transaction are considered as nodes, and all transaction relationships are represented by edges, including transaction direction, transaction amount, and transaction timestamp; with each account as the center, an account transaction graph is obtained based on the transaction graph structure of that account, and an account transaction graph set is constructed. For each account's transaction chart V is The set of all account nodes in the set, where E is the number of account nodes in the set. i The set of all transactions, where each edge e∈E is denoted as . Where (v i ,v j ) indicates from account node v i To account node v j For directional transactions, w represents the transaction amount, and t represents the transaction timestamp; y i ={0,1} is the central account A i The label is used to indicate the identity of the account, where 0 indicates that the account is a legitimate account and 1 indicates that the account is a phishing account;
[0011] Step 2: Simplify the account transaction charts for each account obtained in Step 1 into account transaction line charts;
[0012] Step 3: Construct a self-supervised graph embedding learning module and train it to obtain a trained self-supervised graph embedding learning module;
[0013] Step 4: Input the trained self-supervised graph embedding learning module into the trading charts of each account in sequence, perform embedding learning on the trading charts of each account, and obtain the embedding representation of the trading charts of each account;
[0014] Step 5: Input the embedded representation of each account's transaction chart into the ELM classifier to achieve embedded classification of each account's transaction chart and account identity recognition.
[0015] Furthermore, according to the self-supervised learning-based blockchain account identity recognition method, step 2 includes the following steps:
[0016] Step 2.1: Based on the corresponding blockchain transaction data, extract the transaction frequency and total transaction amount between each pair of account nodes in the account transaction graph as the embedding of the edge between the pair of nodes, and convert each account transaction graph into a lightweight graph containing the transaction frequency and total transaction amount to obtain the lightweight graph of each account.
[0017] Step 2.2: For each account lightweight graph, convert the edge embedding into node embedding, thereby converting the account lightweight graph of each account into a line graph, and obtaining the account transaction line graph of each account; each node in the account transaction line graph corresponds to an edge in the lightweight graph. There is an adjacency relationship between the nodes in the account transaction line graph if and only if two edges in the account lightweight graph share a node.
[0018] Furthermore, according to the self-supervised learning-based blockchain account identity recognition method, step 3 includes the following steps:
[0019] Step 3.1: Construct a self-supervised graph embedding learning module, which contains K graph convolutional layers;
[0020] Step 3.2: Train the self-supervised graph embedding learning module to obtain the trained self-supervised graph embedding learning module;
[0021] Step 3.2.1: Construct a training set consisting of transaction line charts for multiple accounts, and initialize the representation of each node v in each transaction line chart of each account in the training set as the node embedding of that node;
[0022] Step 3.2.2: Construct positive and negative samples: Treat the neighboring nodes of each node v in the transaction line chart of each account in the training set as positive samples, and its non-neighboring nodes as negative samples;
[0023] Step 3.2.3: Establish the objective function: maximize the similarity between the current node v and positive samples, and minimize the similarity between the current node v and negative samples;
[0024] Step 3.2.4: Input the account trading line charts from the training set into the self-supervised graph embedding learning module in sequence, and train the self-supervised graph embedding learning module using the positive and negative samples of each account trading line chart;
[0025] Step 3.2.4.1: Sample the positive and negative sample nodes corresponding to each node v in the transaction line chart of each account to obtain a subset of sampled nodes; the method is as follows:
[0026] First, identify the neighboring node set and non-neighboring node set of node v, and preset the sampling parameter m, i.e., the number of nodes sampled each time is m. Then, a random strategy is used to sample from the neighboring node set and non-neighboring node set of node v respectively. Specifically, for the set where the total number of nodes in the neighboring node set and non-neighboring node set is greater than or equal to m, m nodes are randomly selected from the set without replacement to obtain the sampled node subset; for the set where the total number of nodes in the neighboring node set and non-neighboring node set is less than m, the sampling strategy with replacement is executed on the set until a total of m nodes are sampled to form the sampled node subset.
[0027] Step 3.2.4.2: Based on the sampled node subset, perform convolutional aggregation on the features of each node in the transaction line graph of each account, and update the representation of each node, as follows:
[0028] 1) In the k=1th graph convolutional layer, the sampled node subset of node v is taken as input, and the features of all nodes in the sampled node subset of node v are aggregated, that is, the representations of all nodes in the sampled node subset of node v are summed to obtain the aggregated representation vector value; then the average value is calculated by dividing the aggregated vector value by m, and the representation of node v is updated with the average value. The updated node representation is then concatenated into the output matrix of the current convolutional layer, thereby updating the representation of each node in the current convolutional layer.
[0029] 2) In the k>=2th graph convolutional layer, the sampled node subset of node v and the representation of node v in the previous convolutional layer are taken as input. The features of all nodes in the sampled node subset of node v are aggregated, that is, the representation vectors of all nodes in the sampled node subset of node v are added together and the average value is calculated. Then, the average value is concatenated with the representation of node v in the previous convolutional layer to update the representation of node v. The updated node representation is then concatenated into the output matrix of the current convolutional layer, thereby updating the representation of each node in the current convolutional layer.
[0030] 3) Iterate through the K graph convolutional layers using methods 1) and 2) to update the representation of each node in the transaction line graph of the account in each graph convolutional layer;
[0031] Step 3.2.4.3: Add the representation of each node in each graph convolutional layer to the final output matrix of the self-supervised graph embedding learning module to obtain the embedding representation of the transaction line graph for each account;
[0032] Step 3.2.5: Calculate the loss value of the module under the current parameters according to the objective function. The loss value reflects the accuracy of the module's current ability to classify positive and negative samples.
[0033] Step 3.2.6: Calculate the gradient information of the module parameters using the objective function, and then update the module parameters using the gradient descent algorithm to improve the similarity of positive samples and reduce the similarity of negative samples;
[0034] Step 3.2.7: Repeat steps 3.2.5 and 3.2.6 until the module performance reaches the predetermined standard or the preset number of iterations is reached, and obtain the trained self-supervised graph embedding learning module.
[0035] Furthermore, according to the self-supervised learning-based blockchain account identity recognition method, step 5 includes the following steps:
[0036] Step 5.1: Input the embedded representation of each account's trading line chart into the ELM classifier. Randomly initialize the parameters of the embedded representation of each account's trading line chart through the hidden layer of the ELM classifier, that is, initialize the input weights and hidden layer biases.
[0037] Step 5.2: Using the non-linear mapping within the ELM classifier as the activation function, the embedded representation of each account's transaction line graph after random parameter initialization is mapped to the feature space between the hidden and output layers within the ELM classifier;
[0038] Step 5.3: Based on the embedded representation of each account's transaction line graph mapped into the feature space of the ELM classifier, adjust the weights connecting the hidden and output layers in the ELM classifier by minimizing the approximate variance.
[0039] Step 5.4: Take the embedded representation of each account's transaction line graph mapped to the feature space of the ELM classifier as the output of the hidden layer of the ELM classifier, and then multiply it with the weights of the output layer of the ELM classifier to obtain the final output of each account's transaction line graph.
[0040] Step 5.5: Take the maximum value in the final output of each account's transaction chart as the predicted label result of each account's transaction chart, complete the embedding classification of each account's transaction chart, and thus identify the account identity.
[0041] Compared with the shortcomings of existing technologies, the technical solution provided by the present invention has the following beneficial effects:
[0042] (1) The method of the present invention treats the blockchain account identity recognition task as a graph classification task. First, based on the blockchain transaction records, an account transaction graph is constructed for each account with the account as the center. Then, the account transaction graph of each account is simplified to reduce the size of the graph, thereby reducing the memory usage and time consumption during large-scale graph embedding operations.
[0043] (2) The method of the present invention introduces the account transaction line graph into the blockchain account identity recognition task. First, each account transaction graph is simplified into a lightweight account graph, and then each lightweight account graph is simplified into an account transaction line graph. This fully utilizes the transaction information in the transaction network, thereby effectively solving the problem of shallow learning mechanism of graph learning.
[0044] (3) The method of the present invention constructs positive and negative samples, regards the neighboring nodes of the blockchain account node v as positive samples and its non-neighboring nodes as negative samples, maximizes the similarity between the current node v and the positive samples, and minimizes the similarity between the current node v and the negative samples, thereby improving the accuracy of blockchain account identity recognition and reducing the overfitting problem caused by data imbalance. Attached Figure Description
[0045] Figure 1 This is a schematic diagram illustrating the core concept of the method of the present invention;
[0046] Figure 2 This is a flowchart illustrating the blockchain account identity recognition method based on self-supervised learning in this embodiment.
[0047] Figure 3 This is a schematic diagram of the process for training the self-supervised graph embedding learning module in this embodiment;
[0048] Figure 4 This is a schematic diagram illustrating the account transaction chart creation process in this embodiment;
[0049] Figure 5 This is a diagram of the self-supervised graph embedding learning framework of this embodiment;
[0050] Figure 6 This is a structural diagram of the ELM classifier in this embodiment;
[0051] Figure 7 This is a line graph comparing the performance of the graph classification results of the method of this invention with other methods. Detailed Implementation
[0052] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0053] The core idea of this invention is: 1) Treating blockchain account identity recognition as a graph classification task, and then... Figure 1 As shown: First, based on blockchain transaction records, a transaction graph is constructed for each account, centered on the account; then, the edge information is fully utilized to transform the original account transaction graph into a line graph; finally, the account transaction line graph is input into the self-supervised learning framework SGL-ELM (Graph self-supervised embedding learning), which consists of a self-supervised graph embedding learning module and an ELM (Extreme Learning Machine) classifier, to achieve the blockchain account identity recognition task; 2) In the self-supervised graph embedding learning module, for each input account transaction line graph, node embeddings are generated through two stages: sampling of positive and negative sample nodes and feature aggregation. Then, the generated node embeddings are input into the output layer, and finally, the embedding of the entire account transaction line graph is output; 3) In the ELM classifier, the training process of ELM is divided into two stages: random feature mapping and linear parameter solving. The ELM classifier includes an input layer, a hidden layer, and an output layer. In the random feature mapping stage, the hidden layer first randomly initializes the parameters, and then uses some nonlinear mappings as activation functions to map the graph-level embedding of the account transaction line graph obtained by the self-supervised graph embedding learning module to the feature space of ELM; in the linear parameter solving stage, based on the embedding representation mapped to the feature space, the method of minimizing approximate variance is used to adjust the weights connecting the hidden layer and the output layer to optimize the model's fitting effect; 4) In the testing stage, the embedding representation mapped to the feature space is multiplied with the weight matrix obtained in the linear solving stage to obtain the final output; finally, the maximum value in the output results of this stage is used as the predicted label of the input account transaction graph.
[0054] Figure 2 This is a flowchart illustrating the blockchain account identity recognition method based on self-supervised learning in this embodiment. Figure 2 As shown, the blockchain account identity recognition method based on self-supervised learning includes the following steps:
[0055] Step 1: Obtain blockchain transaction records. Treat all accounts involved in the transaction as nodes and all transaction relationships as edges. With each account as the center, construct a graph structure based on the account's transactions to obtain the account transaction graph for each account.
[0056] In this embodiment, second-order transaction network data related to phishing accounts is collected from the blockchain data sharing platform XBlock to construct the original dataset. The original dataset contains 1,660 verified phishing addresses (i.e., phishing accounts) reported before October 17, 2019, and 1,700 randomly selected normal addresses (i.e., normal accounts). In this embodiment, the original dataset is divided into a training set and a test set in a 7:3 ratio.
[0057] The second-order transaction network data includes first-order transaction data and second-order transaction data. Second-order transaction data refers to transactions between first-order transaction neighbors and their next-order transaction neighbors. Specific transaction records include the addresses of transaction initiation and acceptance, transaction timestamps, and transaction amounts. Based on the transaction data collected above, this implementation constructs a transaction graph for each account. Specifically, first, blockchain transaction records are obtained, and all accounts participating in the transaction are considered as nodes, and all transaction relationships are considered as edges. Centered on each account, according to the transaction graph structure of that account, an account transaction graph is obtained. Each account transaction graph contains account nodes and transaction edges, where each transaction edge represents the transaction relationship between two account nodes, including the transaction direction, transaction amount, and transaction timestamp. Each account transaction graph also contains a label to indicate the type of the account, where 1 indicates that the account is a phishing account, and 0 indicates that the account is a normal account.
[0058] In this embodiment, the blockchain transaction record set A = {A1, A2, ..., A} is obtained. n}, where A i Representing different accounts; with each account as the center, constructing a graph structure for each account based on its transactions, obtaining the account transaction graph for each account, forming a set of account transaction graphs. Each account's transaction chart V is The set of all account nodes in the set; E is the ... i The set of all transactions, where each edge e∈E can be represented as Where (v i ,v j ) indicates from account node v i To account node v j For directional transactions, w represents the transaction amount, and t represents the transaction timestamp; y i ={0,1} is the central account A i The label is used to indicate the identity of the account, where 0 indicates that the account is a normal account and 1 indicates that the account is a phishing account.
[0059] Step 2: Simplify the account transaction charts for each account obtained in Step 1: First, simplify each account transaction chart into a lightweight account chart, and then simplify each lightweight account chart into an account transaction line chart.
[0060] Step 2.1: Based on the original account transaction graph and blockchain transaction data, extract the transaction frequency and total transaction amount between each account node pair as the embedding of the edge between the node pair, and convert each original account transaction graph into a lightweight graph containing the transaction frequency and total transaction amount to obtain the lightweight graph of each account.
[0061] Analysis of blockchain transaction data revealed multiple transactions between some account nodes. Considering the vast scale of transaction networks constructed from actual blockchain data, directly using it as input for large-scale graph applications would result in high computational complexity. Therefore, [further analysis is needed]. Figure 4 The diagram shows an attempt to convert the original account transaction chart into a lightweight chart that is easier to process and analyze.
[0062] In this embodiment, by analyzing the transaction graph of each original account and blockchain transaction data, such as Figure 4 As shown, the transaction frequency and total transaction amount between each account node pair are extracted as the embeddings of the edges between that node pair. Then, the edges in each original account transaction graph, which contain the specific amount and timestamp of each transaction, are transformed into a lightweight graph containing the transaction frequency and total transaction amount, thus obtaining the lightweight graph of each account, as shown. Figure 4 The e recorded in i For the transaction edge from account node A to account node B in the lightweight graph of the transformed account, e j The transaction edge from account node B to account node C in the lightweight graph of the transformed account.
[0063] Step 2.2: For each account lightweight graph, convert the edge embedding into node embedding, thereby converting the account lightweight graph of each account into a line graph, and obtaining the account transaction line graph of each account; each node in the account transaction line graph corresponds to an edge in the lightweight graph. If and only if two edges in the account lightweight graph share a node, there is an adjacency relationship between the nodes in the account transaction line graph.
[0064] In this embodiment, to address the issue of missing node embeddings and fully utilize edge information, the lightweight graph is converted into a line graph. A line graph accurately reflects the adjacency relationships of each edge in the lightweight graph, such as... Figure 4 As shown, each node in the line graph corresponds to an edge in the lightweight graph. For example, node e in the line graph... i and e jThese correspond to the transaction edges from account node A to account node B and from account node B to account node C in the lightweight graph, respectively. Two nodes are adjacent in the linear graph if and only if their corresponding edges in the lightweight graph are adjacent, i.e., they share a common node. This transformation preserves the key information of the original graph while providing a more convenient foundation for subsequent analysis and processing.
[0065] Step 3: Construct a self-supervised graph embedding learning module and train it to obtain a trained self-supervised graph embedding learning module;
[0066] In this embodiment, a self-supervised graph embedding learning module is constructed to perform embedding learning on the account transaction line graph of each account.
[0067] Step 3.1: Construct a self-supervised graph embedding learning module, which contains K graph convolutional layers;
[0068] Step 3.2: Train the self-supervised graph embedding learning module to obtain the trained self-supervised graph embedding learning module; this step is as follows: Figure 3 As shown, it further includes the following steps:
[0069] Step 3.2.1: Construct a training set consisting of transaction line charts for multiple accounts, and initialize the representation of each node v in each transaction line chart of each account in the training set as the node embedding of that node;
[0070] Step 3.2.2: Construct positive and negative samples: Treat the neighboring nodes of each node v in the transaction line chart of each account in the training set as positive samples, and its non-neighboring nodes as negative samples;
[0071] Step 3.2.3: Establish the objective function: maximize the similarity between the current node v and positive samples, and minimize the similarity between the current node v and negative samples;
[0072] In this embodiment, the similarity is measured by the inner product of node embeddings. That is, the similarity with positive sample nodes is calculated by the inner product of the current node embedding vector and the positive sample node embedding vector, while the similarity with negative sample nodes is calculated by the inner product of the current node embedding vector and the negative sample node embedding vector.
[0073] The objective function is: Where H v Let u represent the embedding representation of node v∈V learned through the self-supervised graph embedding learning module, and let u represent the set of neighboring nodes of node v. n ~P(u) represents a negative sample, and Q represents the number of samples.
[0074] Step 3.2.4: Input the account trading line charts from the training set into the self-supervised graph embedding learning module in sequence, and use stochastic gradient descent (SGD) as the optimization algorithm to train the self-supervised graph embedding learning module using the positive and negative samples of each account trading line chart;
[0075] In this embodiment, the transaction line graph of each account in the training set is sequentially input into the self-supervised graph embedding learning module. K iterations are performed in the self-supervised graph embedding learning module. The specific process of each iteration is as follows: First, node embeddings are generated for each account's transaction line graph through two stages: node sampling and feature aggregation. In the node sampling stage, neighboring and non-neighboring nodes of each node in each account's transaction line graph are selected to capture the local structural information between nodes. In the feature aggregation stage, the features of the sampled neighboring and non-neighboring nodes of each node are aggregated to generate a node embedding. The representation of the node is then updated using the generated node embedding, such as... Figure 5 α in 11 α 12 α 13 Indicates α when k=1 11 α 12 α 13 The representation vectors of the neighboring nodes of the node pointed to by the arrow, i.e., the features of the neighboring nodes; α 21 α 22 α 23 Indicates α when k=2 21 α 22 α 23 The node embedding is represented by the neighboring nodes of the node pointed to by the arrow, which represents the features of the neighboring nodes. After K iterations, the generated node embeddings are input into the output layer of the self-supervised graph embedding learning module, and finally the embedded representation of the transaction line graph for each account is output. In this embodiment, the self-supervised graph embedding learning module performs self-supervised learning based on the similarity of the representations between adjacent nodes. In the forward propagation algorithm of the node embedding in this module, the stochastic gradient descent method is used to update k sets of parameters.
[0076] Step 3.2.4.1: Sample the positive and negative sample nodes corresponding to each node v in the transaction line chart of each account to obtain a subset of sampled nodes; the method is as follows:
[0077] First, identify the neighboring node set and non-neighboring node set of node v, and preset the sampling parameter m, i.e., the number of nodes sampled each time is m. Then, a random strategy is used to sample from the neighboring node set and non-neighboring node set of node v respectively. Specifically: for the set where the total number of nodes in the neighboring node set and non-neighboring node set is greater than or equal to m, m nodes are randomly selected from the set without replacement to obtain the sampled node subset; for the set where the total number of nodes in the neighboring node set and non-neighboring node set is less than m, a sampling with replacement strategy is executed for the set, i.e., a random sampling with replacement method is used until m nodes are sampled in total to form the sampled node subset.
[0078] Step 3.2.4.2: Based on the sampled node subset, perform convolutional aggregation on the features of each node in the transaction line graph of each account, and update the representation of each node, as follows:
[0079] 1) In the k=1th graph convolutional layer, the sampled node subset of node v is taken as input, and the features of all nodes in the sampled node subset of node v are aggregated, that is, the representations of all nodes in the sampled node subset of node v are summed to obtain the aggregated representation vector value; then the average value is calculated by dividing the aggregated vector value by m, and the representation of node v is updated with the average value. The updated node representation is then concatenated into the output matrix of the current convolutional layer, thereby updating the representation of each node in the current convolutional layer.
[0080] 2) In the k>=2th graph convolutional layer, the sampled node subset of node v and the representation of node v in the previous convolutional layer are taken as input. The features of all nodes in the sampled node subset of node v are aggregated, that is, the representation vectors of all nodes in the sampled node subset of node v are added together and the average value is calculated. Then, the average value is concatenated with the representation of node v in the previous convolutional layer to update the representation of node v. The updated node representation is then concatenated into the output matrix of the current convolutional layer, thereby updating the representation of each node in the current convolutional layer.
[0081] 3) Iterate through the K graph convolutional layers using methods 1) and 2) to update the representation of each node in the transaction line graph of the account in each graph convolutional layer;
[0082] Step 3.2.4.3: Add the representation of each node in each graph convolutional layer to the final output matrix of the self-supervised graph embedding learning module to obtain the embedding representation of the transaction line graph for each account;
[0083] Step 3.2.5: Based on the objective function, calculate the loss value of the module under the current parameters. The loss value reflects the accuracy of the module's current ability to classify positive and negative samples.
[0084] Step 3.2.6: Calculate the gradient information of the module parameters using the objective function, i.e. the loss function, and then update the module parameters using the gradient descent algorithm to reduce the value of the objective function, i.e. the loss function, thereby increasing the similarity of positive samples and reducing the similarity of negative samples;
[0085] Step 3.2.7: Repeat steps 3.2.5 and 3.2.6 until the module performance reaches the predetermined standard or the preset number of iterations is reached, and obtain the trained self-supervised graph embedding learning module.
[0086] Step 4: Input the trained self-supervised graph embedding learning module into the trading charts of each account in sequence, perform embedding learning on the trading charts of each account, and obtain the embedding representation of the trading charts of each account;
[0087] Step 5: Input the comprehensive embedded representation of each account's transaction chart into the ELM classifier to achieve embedded classification of each account's transaction chart and account identification;
[0088] Extreme Learning Machine (ELM) is a randomized algorithm for training single-hidden-layer feedforward neural networks, which randomly initializes input weights and biases to obtain corresponding output weights. In this embodiment, the ELM classifier structure is as follows: Figure 6 As shown, the ELM classifier includes an input layer, a hidden layer, and an output layer. The ELM classifier randomly initializes the weights and biases from the input layer to the hidden layer using the ELM algorithm, and then analytically solves for the weights from the hidden layer to the output layer, thereby quickly obtaining the optimal solution during training. In this implementation, the training set is defined as... Where X i ={x i1 ,x i2 ,...,x id} is the embedding of the trading chart of the i-th account, t i ={t i1 ,t i2 ,...,t im} represents the label corresponding to the trading chart of the i-th account. Figure 6 The (w) shown in L ,b L Let ) represent the input layer weights and hidden layer biases, β represent the output layer weights, and h(x) represent the embedding obtained from the hidden layer. The number of neurons in the hidden layer of the ELM classifier is L. This implementation uses an ELM classifier to classify the input transaction line graph embeddings of each account to achieve account identification. Specifically, a single-hidden-layer feedforward neural network is trained using the ELM classifier to randomly initialize the input weights and biases to obtain the corresponding output weights. The training set used by the single-hidden-layer feedforward neural network includes embeddings of several account transaction line graphs and their corresponding labels.
[0089] In this embodiment, the training process of the ELM classifier is divided into two stages: random feature mapping and linear parameter solving, based on the embedded representation of the transaction line chart of each account. In the random feature mapping stage, the parameters of the hidden layer are randomly initialized, and then some nonlinear mappings are used as activation functions to map the input data into the feature space between the hidden and output layers of the ELM classifier. In the linear parameter solving stage, since the weights and biases of the hidden layer nodes in the first stage are determined by random generation, only the weights of the output layer need to be solved. This embodiment adjusts the weights connecting the hidden and output layers by minimizing the approximate squared variance. Finally, the embedded representation mapped to the feature space is multiplied by the output layer weights to obtain the final output of the transaction line chart for each account, and the maximum value in the output result is used as the predicted label of the input account transaction line chart, completing the account identification process.
[0090] Includes the following steps:
[0091] Step 5.1: Input the embedded representation of each account's trading line chart into the input layer of the ELM classifier, and randomly initialize the parameters of the embedded representation of each account's trading line chart through the hidden layer of the ELM classifier, that is, initialize the input weights and hidden layer biases;
[0092] Step 5.2: Using some non-linear mappings within the ELM classifier as activation functions, the embedded representation of each account's transaction line chart after random parameter initialization is used as input data and mapped to the feature space between the hidden and output layers within the ELM classifier through the activation function;
[0093] Step 5.3: Based on the embedded representation of each account's transaction line graph mapped into the ELM classifier's feature space, adjust the weights connecting the hidden and output layers in the ELM classifier by minimizing the approximate variance; the method is as follows:
[0094] First, establish the objective function: Where H represents the hidden layer output matrix, i.e., the embedding representation of each account's transaction line chart mapped to the feature space of the ELM classifier, and T represents the target matrix of the training data; subsequently, the optimal solution for connecting the weights of the hidden layer and the output layer can be obtained as follows: in Let H be the inverse matrix.
[0095] Step 5.4: Take the embedded representation of each account's transaction line graph mapped to the feature space of the ELM classifier as the output of the hidden layer of the ELM classifier, and then multiply it with the weights of the output layer of the ELM classifier to obtain the final output of each account's transaction line graph.
[0096] Step 5.5: Take the maximum value in the final output of each account's transaction chart as the predicted label result of each account's transaction chart, and complete the embedding classification and account identity recognition process for each account's transaction chart.
[0097] To demonstrate the effectiveness of the method of the present invention, it is compared with the DeepWalk method, Node2Vec method, Graph2Vec method, SF method, and I. 2 The BGNN method was compared separately; the graph classification experimental results of the method of the present invention and other methods are shown in Table 1; the performance comparison of the graph classification results of the method of the present invention and other methods is as follows: Figure 7 As shown.
[0098] To evaluate the effectiveness of different graph classification methods in the comparative experiment, three commonly used evaluation metrics for graph classification tasks were selected: precision, recall, and F1 score. Precision refers to the number of accurate positive results predicted in a graph classification task; recall refers to the number of truly positive samples successfully recalled in a graph classification task; and F1 score refers to the combined effect score of precision and recall in a graph classification task.
[0099] The comparative experiments of the method of this invention and other graph classification methods were all conducted on a personal computer with a hardware environment of 2.1GHz Intel Core CPU, an NVIDIA GeForce RTX 3090Ti graphics card and 32GB of memory. The software environment code for the graph classification task was written in Python, and the neural network model was implemented using the PyTorch framework. The software environment for the graph classification task used the Adam optimizer with α=0.0001, the learning rate was set to 0.001, the number of training epochs was 1,000, the number of graph convolutional layers K was 2, the number of neurons in the hidden layer of the ELM classifier was 500, and the activation function in the ELM classifier was hardlim.
[0100] Table 1 Comparison of Classification Results by Different Methods
[0101]
[0102] Based on the comparison of graph classification results achieved using different methods shown in Table 1, Figure 7 The line graph showing the performance comparison of graph classification results obtained using different methods reveals the following:
[0103] (1) The experimental results of the Graph2Vec method show that the F1 score of the method is low in the task of this embodiment because the method cannot make full use of edge information; in contrast, the F1 score of the method of the present invention is significantly better than that of Graph2Vec in the task of this embodiment.
[0104] (2)by I 2Experimental results of the BGNN method show that it outperforms other types of methods due to the expressive power of its graph convolutional layers, but it still has certain disadvantages in terms of accuracy and F1 score compared with the performance of the method of this invention.
[0105] (3) The present invention uses a self-supervised graph embedding learning module and an ELM classifier to improve the representation ability and task performance of graph classification methods; therefore, the graph classification method provided by the present invention has significantly better performance than other types of methods.
[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.
Claims
1. A blockchain account identity recognition method based on self-supervised learning, characterized in that, Includes the following steps: Step 1: Obtain blockchain transaction records and construct a blockchain transaction record set. ,in Different accounts are represented; all accounts participating in the transaction are considered as nodes, and all transaction relationships are represented by edges, including transaction direction, transaction amount, and transaction timestamp; with each account as the center, an account transaction graph is obtained based on the transaction graph structure of that account, and an account transaction graph set is constructed. ; For each account's transaction chart , for The set of all account nodes in the middle, For account The set of all transactions, where each edge Represented as ,in Indicates from account node To account node Directional trading, Indicates the transaction amount. Indicates the transaction timestamp; It is a central account The label is used to indicate the identity of the account, where 0 indicates that the account is a legitimate account and 1 indicates that the account is a phishing account; Step 2: Simplify the account transaction charts for each account obtained in Step 1 into account transaction line charts; Step 3: Construct a self-supervised graph embedding learning module and train it to obtain a trained self-supervised graph embedding learning module; Step 4: Input the trained self-supervised graph embedding learning module into the trading charts of each account in sequence, perform embedding learning on the trading charts of each account, and obtain the embedding representation of the trading charts of each account; Step 5: Input the embedded representation of each account's transaction chart into the ELM classifier to achieve embedded classification of each account's transaction chart and account identification; Step 2 includes the following steps: Step 2.1: Based on the corresponding blockchain transaction data, extract the transaction frequency and total transaction amount between each pair of account nodes in the account transaction graph as the embedding of the edge between the pair of nodes, and convert each account transaction graph into a lightweight graph containing the transaction frequency and total transaction amount to obtain the lightweight graph of each account. Step 2.2: For each account lightweight graph, convert the edge embedding into node embedding, thereby converting the account lightweight graph of each account into a line graph, and obtaining the account transaction line graph of each account; each node in the account transaction line graph corresponds to an edge in the lightweight graph. There is an adjacency relationship between the nodes in the account transaction line graph if and only if two edges in the account lightweight graph share a node.
2. The blockchain account identity recognition method based on self-supervised learning according to claim 1, characterized in that, Step 3 includes the following steps: Step 3.1: Construct a self-supervised graph embedding learning module, which contains K graph convolutional layers; Step 3.2: Train the self-supervised graph embedding learning module to obtain the trained self-supervised graph embedding learning module; Step 3.2.1: Construct a training set consisting of transaction line charts for multiple accounts, and initialize the representation of each node v in each transaction line chart of each account in the training set as the node embedding of that node; Step 3.2.2: Construct positive and negative samples: Treat the neighboring nodes of each node v in the transaction line chart of each account in the training set as positive samples, and its non-neighboring nodes as negative samples; Step 3.2.3: Establish the objective function: maximize the similarity between the current node v and positive samples, and minimize the similarity between the current node v and negative samples; Step 3.2.4: Input the account trading line charts from the training set into the self-supervised graph embedding learning module in sequence, and train the self-supervised graph embedding learning module using the positive and negative samples of each account trading line chart; Step 3.2.4.1: Sample the positive and negative sample nodes corresponding to each node v in the transaction line chart of each account to obtain a subset of sampled nodes; the method is as follows: First, identify the neighboring node set and non-neighboring node set of node v, and preset the sampling parameter m, i.e., the number of nodes sampled each time is m. Then, a random strategy is used to sample from the neighboring node set and non-neighboring node set of node v respectively. Specifically, for the set where the total number of nodes in the neighboring node set and non-neighboring node set is greater than or equal to m, m nodes are randomly selected from the set without replacement to obtain the sampled node subset; for the set where the total number of nodes in the neighboring node set and non-neighboring node set is less than m, the sampling strategy with replacement is executed on the set until a total of m nodes are sampled to form the sampled node subset. Step 3.2.4.2: Based on the sampled node subset, perform convolutional aggregation on the features of each node in the transaction line graph of each account, and update the representation of each node, as follows: 1) In the k=1th graph convolutional layer, the sampled node subset of node v is taken as input, and the features of all nodes in the sampled node subset of node v are aggregated. That is, the representations of all nodes in the sampled node subset of node v are summed to obtain the aggregated representation vector value. Then, the average value is calculated by dividing the aggregated vector value by m. The representation of node v is updated with this average value, and the updated node representation is concatenated into the output matrix of the current convolutional layer, thereby updating the representation of each node in the current convolutional layer. 2) In the k>=2th graph convolutional layer, the sampled node subset of node v and the representation of node v in the previous convolutional layer are taken as input. The features of all nodes in the sampled node subset of node v are aggregated, that is, the representation vectors of all nodes in the sampled node subset of node v are added together and the average value is calculated. Then, the average value is concatenated with the representation of node v in the previous convolutional layer to update the representation of node v. The updated node representation is then concatenated into the output matrix of the current convolutional layer, thereby updating the representation of each node in the current convolutional layer. 3) Iterate through the K graph convolutional layers using methods 1) and 2) to update the representation of each node in the account's transaction line graph in each graph convolutional layer; Step 3.2.4.3: Add the representation of each node in each graph convolutional layer to the final output matrix of the self-supervised graph embedding learning module to obtain the embedding representation of the transaction line graph for each account; Step 3.2.5: Calculate the loss value of the module under the current parameters according to the objective function. The loss value reflects the accuracy of the module's current ability to classify positive and negative samples. Step 3.2.6: Calculate the gradient information of the module parameters using the objective function, and then update the module parameters using the gradient descent algorithm to improve the similarity of positive samples and reduce the similarity of negative samples; Step 3.2.7: Repeat steps 3.2.5 and 3.2.6 until the module performance reaches the predetermined standard or the preset number of iterations is reached, and obtain the trained self-supervised graph embedding learning module.
3. The blockchain account identity recognition method based on self-supervised learning according to claim 1, characterized in that, Step 5 includes the following steps: Step 5.1: Input the embedded representation of each account's trading line chart into the ELM classifier. Randomly initialize the parameters of the embedded representation of each account's trading line chart through the hidden layer of the ELM classifier, that is, initialize the input weights and hidden layer biases. Step 5.2: Using the non-linear mapping within the ELM classifier as the activation function, the embedded representation of each account's transaction line graph after random initialization of parameters is mapped to the feature space between the hidden and output layers within the ELM classifier; Step 5.3: Based on the embedded representation of each account's transaction line graph mapped into the feature space of the ELM classifier, adjust the weights connecting the hidden and output layers in the ELM classifier by minimizing the approximate variance. Step 5.4: Take the embedded representation of each account's transaction line graph mapped to the feature space of the ELM classifier as the output of the hidden layer of the ELM classifier, and then multiply it with the weights of the output layer of the ELM classifier to obtain the final output of each account's transaction line graph. Step 5.5: Take the maximum value in the final output of each account's transaction chart as the predicted label result of each account's transaction chart, complete the embedding classification of each account's transaction chart, and thus identify the account identity.
Citation Information
Patent Citations
Non-legal legalized account identification method and device, equipment and storage medium
CN112819175A
Ethereum phishing account detection method based on deep learning
CN113283909A