Directed graph node updating method and device

By introducing directed graph node update method in the graph neural network for financial fraud risk detection, obtaining and updating the feature representation of nodes and edges, the problem of inaccurate representation of node transaction risk characteristics in the prior art is solved, and more accurate financial fraud risk detection is achieved.

CN113836156BActive Publication Date: 2025-04-01ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111081583.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2025-04-01
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

In the prior art, in the detection of financial fraud risk, the transaction risk characteristics of users corresponding to nodes are not accurately characterized, especially in directed graphs, the directional characteristics of edges cannot be effectively utilized.

Method used

By introducing a directed graph node update method into the graph neural network, the source and target features of each node, as well as the source and target features of each edge, and the feature representation of the node is updated based on these features. This method considers the dual identity of the node (the payer and the payer) and the directional characteristics of the edge.

Benefits of technology

Through the updated feature representation, financial fraud risks can be more accurately identified, improving the accuracy of transaction risk detection. This method not only considers the relationship between nodes, but also makes full use of the directional characteristics of edges to enhance the accuracy of feature representation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113836156B_ABST
    Figure CN113836156B_ABST
Patent Text Reader

Abstract

One or more embodiments of the present specification provide a directed graph node update method and device, which obtains the source characteristics and target characteristics of each node, and the source characteristics and target characteristics of each edge, and for each node, updates the target characteristics of the node according to the source characteristics of the nodes in the neighborhood of the node and the target characteristics of the edges in the neighborhood; updates the source characteristics of the node according to the target characteristics of the nodes in the neighborhood of the node and the source characteristics of the edges. The updated source characteristics of the node are used to characterize the transaction risk characteristics of the user corresponding to the node as the payee, and the updated target characteristics of the node are used to characterize the transaction risk characteristics of the user corresponding to the node as the payee. The update of the transaction risk characteristic representation takes into account the characteristics of the edges, and separates the dual identities of each user for separate transaction risk characteristic representation, making the characteristic representation more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of computer application technology, and in particular, to a directed graph node updating method and device. Background Art

[0002] In financial risk control scenarios, in order to better identify financial fraud risks, each transaction data is usually characterized based on machine learning, and then the features are classified through trained classifiers to determine whether there is a financial fraud risk. In order to better detect financial fraud risks, related technologies usually use graph neural networks that can reflect the relationship information between multiple transaction data for feature characterization. The graph in the graph neural network refers to a graph with a topological structure composed of several nodes and edges connecting the nodes. In a graph neural network, each node generally represents one party to the transaction, and the edge is generally used to represent the relationship between two nodes, that is, the transaction relationship or community relationship between the two parties to the transaction.

[0003] However, the current characterization of transaction risk characteristics of users corresponding to the nodes is not accurate enough. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a directed graph node updating method and device.

[0005] According to a first aspect of one or more embodiments of the present specification, a directed graph node updating method is proposed, which is used to update the transaction risk feature characterization of the user corresponding to the node, characterize a node by the source feature and target feature of the node, and characterize an edge by the source feature and target feature of the edge; wherein: the source feature of the node is used to characterize the feature of the node as the node starting the edge, the target feature of the node is used to characterize the feature of the node as the node pointed to by the edge, the source feature of the edge is used to characterize the effect of the edge on the node starting the edge, and the target feature of the edge is used to characterize the effect of the edge on the node pointed to by the edge; the method comprises:

[0006] For each node in the graph data, the source feature and target feature of the node are obtained; the source feature of the node is obtained according to the initial feature of the node and the preset source node weight, and the target feature of the node is obtained according to the initial feature of the node and the preset target node weight;

[0007] For each edge in the graph data, the source feature and the target feature of the edge are obtained; the source feature of the edge is obtained according to the initial feature of the edge and the preset source edge weight, and the target feature of the edge is obtained according to the initial feature of the edge and the preset target edge weight;

[0008] For each node, the target feature of the node is updated according to the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; the source feature of the node is updated according to the target features of the nodes in the neighborhood of the node and the source features of the edges.

[0009] According to a second aspect of one or more embodiments of this specification, a graph neural network training method is proposed, wherein the graph neural network is used to classify transaction risks of users corresponding to each node; the method comprises:

[0010] Iterate the following steps until the output loss is less than the preset loss threshold, or the number of iterations is greater than the preset number threshold:

[0011] According to the directed graph node updating method described above, the target feature of each updated node is obtained;

[0012] Taking the target feature of each updated node as input and the transaction risk classification of each node as output, the output loss is obtained according to the transaction risk classification label and classification weight of each node;

[0013] According to the output loss, the classification weight, the source node weight, the target node weight, the source edge weight and the target edge weight are updated;

[0014] The graph neural network is determined based on the current classification weight, source node weight, target node weight, source edge weight and target edge weight.

[0015] According to a third aspect of an embodiment of this specification, a node classification method is provided for obtaining a transaction risk classification of each node; the method comprises:

[0016] According to the directed graph node updating method described above, the target feature of each updated node is obtained;

[0017] Taking the target features of each updated node as input, the risk classification of each node is obtained according to the pre-trained classification weights and graph neural network.

[0018] According to a fourth aspect of the embodiments of this specification, a directed graph node updating device is provided, which is used to update the transaction risk feature characterization of the user corresponding to the node, characterize a node by the source feature and target feature of the node, and characterize an edge by the source feature and target feature of the edge; wherein: the source feature of the node is used to characterize the feature of the node as the node starting the edge, the target feature of the node is used to characterize the feature of the node as the node pointed to by the edge, the source feature of the edge is used to characterize the effect of the edge on the node starting the edge, and the target feature of the edge is used to characterize the effect of the edge on the node pointed to by the edge; the device comprises:

[0019] The node feature acquisition module is used to acquire the source feature and target feature of each node in the graph data; the source feature of the node is obtained according to the initial feature of the node and the preset source node weight, and the target feature of the node is obtained according to the initial feature of the node and the preset target node weight;

[0020] The edge feature acquisition module is used to obtain the source feature and target feature of each edge in the graph data; the source feature of the edge is obtained according to the initial feature of the edge and the preset source edge weight, and the target feature of the edge is obtained according to the initial feature of the edge and the preset target edge weight;

[0021] The node update module is used to update the target feature of each node according to the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; and to update the source feature of the node according to the target features of the nodes in the neighborhood of the node and the source features of the edges.

[0022] According to a fifth aspect of an embodiment of this specification, a graph neural network training device is provided, wherein the graph neural network is used to classify transaction risks of users corresponding to each node; the device comprises:

[0023] The iterative training module is used to iteratively perform the following steps until the output loss is less than a preset loss threshold, or the number of iterations is greater than a preset number threshold:

[0024] According to the directed graph node updating method described above, the target feature of each updated node is obtained;

[0025] Taking the target feature of each updated node as input and the transaction risk classification of each node as output, the output loss is obtained according to the transaction risk classification label and classification weight of each node;

[0026] According to the output loss, the classification weight, the source node weight, the target node weight, the source edge weight and the target edge weight are updated;

[0027] The graph neural network determination module is used to determine the graph neural network based on the current classification weight, source node weight, target node weight, source edge weight and target edge weight.

[0028] According to a sixth aspect of an embodiment of this specification, a node classification device is provided for obtaining a transaction risk classification of each node; the device comprises:

[0029] A target feature acquisition module, used to acquire the target feature of each updated node according to the directed graph node update method described above;

[0030] The risk classification module is used to take the target features of each updated node as input and obtain the risk classification of each node based on the pre-trained classification weights and graph neural network.

[0031] According to a seventh aspect of the embodiments of this specification, there is provided an electronic device, including:

[0032] processor;

[0033] a memory for storing processor-executable instructions;

[0034] The processor executes the executable instructions to implement the directed graph node update, graph neural network training method or node classification method as described above.

[0035] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the directed graph node update, graph neural network training method or node classification method as described above is implemented.

[0036] In one or more embodiments of the present specification, the source characteristics and target characteristics of each node, and the source characteristics and target characteristics of each edge are obtained, and for each node, the target characteristics of the node are updated according to the source characteristics of the nodes in the neighborhood of the node and the target characteristics of the edges in the neighborhood; the source characteristics of the node are updated according to the target characteristics of the nodes in the neighborhood of the node and the source characteristics of the edges. The updated source characteristics of the node are used to characterize the transaction risk characteristics of the user corresponding to the node as the payee, and the updated target characteristics of the node are used to characterize the transaction risk characteristics of the user corresponding to the node as the payee. The update of the transaction risk characteristic characterization takes into account the characteristics of the edges, and separates the dual identities of each user for separate transaction risk characteristic characterization, making the characteristic characterization more accurate.

[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.

[0039] Figure 1 The flowchart of a directed graph node updating method is shown in this specification according to an exemplary embodiment.

[0040] Figure 2 It is a schematic diagram of a directed graph node updating method shown in this specification according to a specific embodiment.

[0041] Figure 3It is a flowchart of a graph neural network training method shown in this specification according to an exemplary embodiment.

[0042] Figure 4 The flowchart of a node classification method is shown in this specification according to an exemplary embodiment.

[0043] Figure 5 It is a block diagram of a directed graph node updating device shown in this specification according to an exemplary embodiment.

[0044] Figure 6 It is a block diagram of a graph neural network training device shown in this specification according to an exemplary embodiment.

[0045] Figure 7 It is a block diagram of a node classification device shown in this specification according to an exemplary embodiment.

[0046] Figure 8 It is a hardware structure diagram of an electronic device where a device is located according to an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0047] Here, the exemplary embodiments will be described in detail. In other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0048] In the era of big data, in order to prevent financial fraud, it is generally based on machine learning. A network that can identify financial fraud is trained through a large amount of labeled transaction data, and transaction data that may be risky is found through the network. In order to more effectively find transaction data with risks, it is necessary to effectively characterize the characteristics of financial fraud (such as credit card theft, transaction fraud, cheating, illegal activities, etc.) in transaction data. There are many feature characterization methods in the relevant technology, and these feature characterization methods and their shortcomings will be explained one by one below.

[0049] The first is the traditional risk control modeling method, such as XGBoost and MLP. In this traditional risk control modeling method, each sample is only treated as an independent individual, and there is no design for the mutual influence between users. As a result, the feature representation is prone to lose the relationship data between users, making the user's transaction risk representation inaccurate.

[0050] Secondly, in the risk control scenario, in addition to the transaction data itself, transaction relationships, community relationships (whether two users are friends, whether they have joined the same group, etc.) and device relationships (whether two user accounts use the same device, etc.), etc., will all contribute to the characterization of the financial fraud characteristics of the transaction data. In order to learn these relationships, the relevant technology first converts the transaction data and other business data (such as the user's risk profile, operation behavior and relationship data, etc.) into a graph, uses each node to represent a user (one party to the transaction), and uses the edge to represent the relationship between two users, and then uses the graph neural network method to perform high-order hidden layer feature characterization of the characteristics of financial fraud. In addition, it should be noted that after the feature characterization, the nodes must be classified according to their characteristics, so that it can be known whether the transaction of the user corresponding to each node has a financial fraud risk.

[0051] In the graph neural network method, in order to learn high-order features, the nodes are generally updated through a specific algorithm first, so that the feature representation of the node can represent the high-order features. Since each node in the graph data is affected by other nodes in the graph, the closer the relationship with the node to be updated, the greater the impact on the node. Therefore, during the update process, the update is generally performed through other nodes in the graph. After explaining the basic update method of the graph neural network, the common graph neural networks in related technologies will be explained in detail.

[0052] Graph Convolutional Networks (GCN) can characterize financial fraud risks. GCN learns low-dimensional representations of nodes based on the Laplace matrix on the graph. Using the convolution theorem, the graph and convolution kernel are first mapped to the Fourier domain, the two are multiplied in the Fourier domain, and then the inverse Fourier transform is performed to achieve the convolution of the two in the original domain. In GCN, due to the Fourier domain multiplication, the node feature matrix, adjacency matrix, and degree matrix of the entire graph are generally used, without special design of edge attributes, which makes it easy for the feature representation to lose the characteristics of the edges in the directed graph.

[0053] Graph Attention Network (GAT) can also characterize financial fraud risks. GAT performs weighted summation of the features of the first-order neighborhood nodes of a node based on the attention mechanism, and uses a multi-head attention mechanism to learn the feature vectors of the nodes in the graph. The attention mechanism can learn the influence of different nodes on the nodes that need to be updated within the first-order neighborhood nodes, and assign different weights to different nodes based on the learned influence. However, in GAT, the attention calculation of directed graphs is not considered when calculating attention. In financial fraud scenarios, the directionality of transactions plays a big role in the characteristic characterization of nodes, which makes GAT's transaction risk characteristic characterization less accurate.

[0054] From the above description, it can be seen that in the related art, there is no design for directed graphs, which makes it easy to lose the directional characteristics of the edges of directed graphs during the node update process. Considering that in the financial fraud scenario, each user has the dual identities of the payee and the payee, when the edge represents the transaction relationship, the node pointed to by the edge is generally the payee, and the node where the edge starts is generally the payee. The edge has different effects on the payee and the payee. In other words, for each node, when it is a payee, there may be financial fraud, but when it is a payee, there may not be financial fraud. Therefore, for each node, the characteristics of the two identities need to be used to characterize the node. For each edge, its impact on the payee and the payee is different, and the edge should also be described by the effect of the edge on the payee and the effect of the edge on the payee.

[0055] Furthermore, when a node is updated, what should have an effect on the node are the nodes and edges in the neighborhood. For the payee, what should have an effect on the node are the payees in the neighborhood and the effect of the edges on the source node. For the payee, what should have an effect on the node update are the payees in the neighborhood and the effect of the edges on the target node.

[0056] In addition, since different nodes in the neighborhood have different effects on the node that needs to be updated, and the same is true for the edges, in order to distinguish this size relationship, the nodes can be updated based on the attention mechanism.

[0057] Based on the above analysis, this specification provides a directed graph node update method, which obtains the source characteristics and target characteristics of each node, and the source characteristics and target characteristics of each edge, and for each node, updates the target characteristics of the node according to the source characteristics of the nodes in the neighborhood of the node and the target characteristics of the edges in the neighborhood; updates the source characteristics of the node according to the target characteristics of the nodes in the neighborhood of the node and the source characteristics of the edges. The updated source characteristics of the node are used to characterize the transaction risk characteristics of the user corresponding to the node as the payee, and the updated target characteristics of the node are used to characterize the transaction risk characteristics of the user corresponding to the node as the payee. The update of the transaction risk characteristic representation takes into account the characteristics of the edges, and separates the dual identities of each user for separate transaction risk characteristic representation, making the characteristic representation more accurate.

[0058] Next, the directed graph node updating method provided in this specification will be described in detail.

[0059] The present specification provides a directed graph node updating method for updating the transaction risk feature representation of the user corresponding to the node, characterizing a node through the source feature and target feature of the node, and characterizing an edge through the source feature and target feature of the edge; wherein: the source feature of the node is used to characterize the feature of the node as the starting node of the edge, the target feature of the node is used to characterize the feature of the node as the node to which the edge points, the source feature of the edge is used to characterize the effect of the edge on the node from which the edge starts, and the target feature of the edge is used to characterize the effect of the edge on the node to which the edge points.

[0060] As mentioned above, in order to accurately describe the dual identities of each user (payer and payee), a node is characterized by the source feature and target feature of the node. Since the edge represents the transfer relationship between two users, when the nodes corresponding to the two users are connected by a directed edge, the node where the edge starts indicates that the user corresponding to the node is the payer, that is, the node where the edge starts is the source node, and the node to which the edge points indicates that the user corresponding to the node is the payee, that is, the node to which the edge points is the target node. When a node is a source node, the feature of the source node is represented by the source feature of the node, and when a node is a target node, the feature of the target node is represented by the target feature of the node.

[0061] Similar to nodes, edges represent the transaction relationship between two users, such as transaction amount, transaction time, transaction location, etc. An edge can represent one transaction or multiple transactions in the same direction. The transaction relationship between two users has different effects on the two users. For example, in a transaction involving financial fraud, for the payee, this transaction indicates that the user is the fraudulent party, while for the payee, this transaction indicates that the user is the defrauded party. Therefore, considering that an edge has different effects on the feature representation of the node where the edge starts (payee) and the node to which the edge points (payee), an edge is represented by the source feature of the edge and the target feature of the edge. Among them, the source feature of the edge represents the impact of the transaction relationship corresponding to the edge on the feature representation of the payee of the transaction relationship; the target feature of the edge represents the impact of changing the corresponding transaction relationship on the feature representation of the payee of the transaction relationship.

[0062] like Figure 1 As shown, Figure 1 This is a flowchart of a directed graph node updating method according to an exemplary embodiment of the present specification, comprising the following steps:

[0063] Step 101, for each node in the graph data, obtain the source feature and target feature of the node; the source feature of the node is obtained according to the initial feature of the node and the preset source node weight, and the target feature of the node is obtained according to the initial feature of the node and the preset target node weight.

[0064] Step 103, for each edge in the graph data, obtain the source feature and the target feature of the edge; the source feature of the edge is obtained according to the initial feature of the edge and the preset source edge weight, and the target feature of the edge is obtained according to the initial feature of the edge and the preset target edge weight.

[0065] Next, step 101 and step 103 will be described collectively.

[0066] As mentioned above, each node needs to be characterized by the source feature and target feature of the node, and each edge needs to be characterized by the source feature and target feature of the edge. In order to obtain these, different weight coefficients and initial features are required.

[0067] The initial feature of a node refers to the feature of the node before the update. The initial feature can be obtained by converting the business features of the user such as transaction data, user risk profile and operation behavior according to the preset conversion rules. The risk profile of the user can include information such as the user's attributes, the device's attributes and whether there is fraud in the transaction history. The operation behavior can include the transaction behavior within a period of time (such as 7 days) before and after the transaction data corresponding to the node occurs. Since these are converted by artificial rules and do not contain high-order features, it is necessary to update these nodes through neural networks so that the feature representation of the nodes can represent high-order features.

[0068] In addition, because the method may refer to the structure of a layer of a network for updating a node, and the network for updating a node may include multiple layers, the initial features of the node refer to the source features and target features of the node output by the previous layer of the method.

[0069] Among them, the preset source edge weights, target edge weights, source node weights, and target node weights can be obtained through pre-training. If the update method is applied to the network training process, these weights will be updated through continuous iterations, then these weights are the values ​​updated after the last iteration. In addition, this method only represents one layer of the network used to update the node. When the network used for updating has multiple layers, the weights of each layer are different; however, in the same layer and the same iteration, these weights are the same for different graph data and different nodes.

[0070] Among them, for the specific updating method, it can be obtained by directly multiplying the weight with the initial feature, of course, it can also be obtained by other methods, and this specification does not limit it here. If the weight is directly multiplied with the initial feature, then step 101 specifically includes: for each node in the graph data, multiply the feature vector of the node with the source node weight and the target node weight respectively to obtain the source feature and target feature of the node; step 103 specifically includes: for each edge in the graph data, multiply the feature vector of the edge with the source edge weight and the target edge weight respectively to obtain the source feature and target feature of the edge.

[0071] The purpose of doing this is, firstly, to convert the initial feature into two features when there is only one initial feature; secondly, to prevent the situation where the source feature, target feature of each node, and the source feature and target feature of each edge are all zero during the node update process; thirdly, to increase these weights so that after the network training is completed, these weights can assist the directed graph node update method and characterize the transaction risk characteristics of each node more accurately.

[0072] Step 105, for each node, update the target feature of the node according to the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; update the source feature of the node according to the target features of the nodes in the neighborhood of the node and the source features of the edges.

[0073] Specifically, for the user corresponding to each node, considering that for the payee, what actually affects it is the payee who conducts transactions with it and the effect of these transactions on the payee, in other words, it is necessary to update the target feature of the node through the source features of the nodes in the first-order neighborhood (nodes connected to the node through edges) and the target features of the edges directly connected to the node. For the payee, what actually affects it is the payee who conducts transactions with it and the effect of these transactions on the payee, in other words, it is necessary to update the source feature of the node through the target features of the nodes in the first-order neighborhood nodes of the node and the target features of the edges directly connected to the node.

[0074] A specific updating method may be to add up all the features used to update the node, then input the added value into a convolution function, and use the output as the updated node.

[0075] In addition, considering that some nodes in the first-order neighborhood nodes have a large influence on the nodes that need to be updated, and some nodes have a small influence on the nodes that need to be updated, the node update can be performed based on the attention mechanism. Specifically, the method also includes: based on the attention mechanism, for each node, calculating the source attention and target attention of each node in the neighborhood of the node, and calculating the source attention and target attention of the edges in the neighborhood of the node. In this case, step 105 specifically includes: using the source attention of the nodes in the neighborhood of the node and the target attention of the edges in the neighborhood as weights, calculating the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood, using the calculated weighted sum as the input of the target feature convolution function, and obtaining the updated target feature of the node; using the target attention of the nodes in the neighborhood of the node and the source attention of the edges in the neighborhood as weights, calculating the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood, using the calculated weighted sum as the input of the source feature convolution function, and obtaining the updated source feature of the node.

[0076] By calculating attention, we take into account the different influences of different nodes and edges in the neighborhood, so that updates can be performed more targeted. By calculating bilateral attention (source attention and target attention) at the same time, we also take into account that for the node that needs to be updated, different identities of the same node in the neighborhood have different influences on the node, and the same edge has different influences on the node where the edge starts and the node to which the edge points. Through the above method, information in all directions in the neighborhood can be used more effectively.

[0077] Taking into account that the different attentions calculated may have different orders of magnitude, it is necessary to normalize the calculated attentions. Specifically, it also includes: normalizing the source attention and target attention of each node, and the source attention and target attention of each edge. In this case, step 105 specifically includes: taking the normalized source attention of the nodes in the neighborhood of the node and the normalized target attention of the edges in the neighborhood as weights, and calculating the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; taking the normalized target attention of the nodes in the neighborhood of the node and the normalized source attention of the edges in the neighborhood as weights, and calculating the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood.

[0078] Through the above update method, the nodes are updated. First, the attention mechanism is used to adaptively learn the weights of the neighborhood to the nodes that need to be updated (the source attention and target attention of the node, the source attention and target attention of the edge). Secondly, a node is represented by the source feature and target feature of the node, and an edge is represented by the source feature and target feature of the edge. The representation of the node is updated through these, effectively utilizing information in two directions.

[0079] Next, a directed graph node updating method will be described in detail through a specific embodiment.

[0080] like Figure 2 As shown, Figure 2 This is a schematic diagram of a directed graph node update method according to a specific embodiment of this specification, showing the structure of the node update method, including three parts, from left to right: linear transformation of nodes and edges, neighborhood attention calculation and node update. These three parts will be described in detail below.

[0081] First, for the linear change nodes of nodes and edges, in the figure, each node consists of two parts, namely the source node and the target node. The circle represents the source feature of the node (that is, the feature of the node as the source node), and the triangle represents the target node (that is, the feature of the node as the target node). This part is the step in step 101 and step 103. The specific update method is shown in the following formulas (1)-(4):

[0082]

[0083]

[0084]

[0085]

[0086] in, represents the source feature of node i, represents the target feature of node i, where l represents the lth layer of the graph neural network. In other words, the method is applied to the lth layer of the node update module of the graph neural network. and Together they constitute the initial features of node i. (l) and W (l) Represent the source node weight and target node weight respectively. Similarly, represents the source feature of the edge between node i and node h, represents the target feature of the edge between node i and node h, and Together they form the initial features of the edge between node i and node h.

[0087] Secondly, for the neighborhood attention calculation, such as Figure 2As shown, it includes two parts, one is the neighborhood node information aggregation, that is, calculating the source attention and target attention of the nodes in the neighborhood of the node that needs to be updated, and the other is the neighborhood edge information aggregation, that is, calculating the source attention and target attention of the edges in the neighborhood of the node that needs to be updated. Among them, for each node in the neighborhood of the node that needs to be updated, only the source attention of the node is calculated or only the target attention is calculated, and which attention is calculated depends on the direction of the edge between the two points; similarly, for each edge in the neighborhood of the node that needs to be updated, only the source attention and target attention of the edge are calculated, and which attention is calculated depends on whether the node that needs to be updated is the node pointed to by the edge or the node where the edge starts.

[0088] Specifically for each node, the calculation method of the source attention and target attention of the nodes in its first-order neighborhood is as follows:

[0089]

[0090]

[0091]

[0092] in, represents the source attention of the source node h in its neighborhood for the target node i, represents the transpose of the source attention output of layer l-1, which is The transpose of Indicates that node i is the first-order neighbor of the target node. Similarly, represents the target attention of the source node i and the target node h in its neighborhood, represents the transpose of the target attention output of layer l-1, which is The transpose of represents node i as the first-order neighbor of the source node. is the source attention of node h after normalization, It represents the target attention of node h after normalization. The symbols with the same marks as those in formulas (1)-(4) are not repeated here.

[0093] For each node, the specific method for calculating the source attention and target attention of each edge in the neighborhood of the node is shown in the following formulas (8)-(10):

[0094]

[0095]

[0096] in, represents the target attention of edge h in the neighborhood of target node i, Denotes the source attention of edge h in the neighborhood of source node i. represents the transpose of the target attention output of layer l-1, which is The transpose of represents the transpose of the source attention output of layer l-1, which is The transpose of . represents the edge directly connected to the target node i, represents the edge directly connected to the source node i. Formula (10) is to normalize the calculated attention, that is, is the target attention of edge h in the neighborhood of target node i after normalization, is the normalized source attention of edge h in the neighborhood of source node i. Symbols with the same meanings as in formulas (1)-(4) are not repeated here.

[0097] Finally, for node update, the specific node update formulas refer to the following formulas (11) and (12):

[0098]

[0099]

[0100] The meanings of the symbols in the above formulas are the same as those in formulas (1)-(10) and will not be repeated here.

[0101] In the above method, the spatial domain convolution method is adopted. Compared with the spectral domain convolution of the related technology GCN, it is more convenient to calculate when targeting large graph data.

[0102] The above directed graph node update method can be applied to graph neural network training methods and node classification methods. Next, the application of nodes in these two methods will be explained in detail.

[0103] First, this specification also provides a graph neural network training method, wherein the graph neural network is used to classify the transaction risk of the user corresponding to each node. Figure 3 As shown, Figure 3 This specification is a graph neural network training method according to an exemplary embodiment, comprising the following steps:

[0104] Iterate the following steps until the output loss is less than the preset loss threshold, or the number of iterations is greater than the preset number threshold:

[0105] Step 301, according to the directed graph node updating method, obtain the target feature of each updated node.

[0106] The preset loss threshold and the preset number of times threshold can be determined according to the training requirements. As described above, the directed graph node update method of the first aspect of the embodiment of this specification can be a layer of a network used for node update, then step 301 can specifically be to execute the directed graph node update method of the first aspect of the embodiment of this specification multiple times to update the node, and finally obtain the target feature of the updated node according to the output of the last layer. The directed graph node update method refers to Figure 1 or Figure 2 The directed graph node update method shown.

[0107] Among them, the final output does not require the source features of the node, but the source features of the node still need to be updated, because the update of the target features of other nodes in the next layer requires the source features of the updated node in the previous layer. If the source features of the node are not updated, the target features of other updated nodes will be inaccurate.

[0108] Step 303, taking the target feature of each updated node as input and the transaction risk classification of each node as output, and obtaining the output loss according to the transaction risk classification label and classification weight of each node.

[0109] The specific training method may use a convolution algorithm or other algorithms.

[0110] Step 305: Update the classification weight, the source node weight, the target node weight, the source edge weight, and the target edge weight according to the output loss.

[0111] The specific weight updating method can use methods such as gradient descent method.

[0112] Step 307, determine the graph neural network based on the current classification weight, source node weight, target node weight, source edge weight and target edge weight.

[0113] This specification also provides a node classification method for obtaining the transaction risk classification of each node; Figure 4 As shown, Figure 4 A node classification method according to an exemplary embodiment of the present specification includes the following steps:

[0114] Step 401, according to the directed graph node updating method, obtain the target feature of each updated node.

[0115] Among them, the directed graph node update method refers to Figure 1 or Figure 2 As described above, step 401 may also be to execute the directed graph node updating method described above multiple times, and use the target features of the nodes in the last layer after updating as output.

[0116] Step 403, using the target feature of each updated node as input, and obtaining the risk classification of each node according to the pre-trained classification weights and graph neural network.

[0117] The graph neural network mentioned in step 403 can be Figure 3 The graph neural network trained in .

[0118] By using the directed graph node classification method of the first aspect of the embodiment of this specification, the training of the graph neural network can be made more accurate and the node classification can also be made more accurate.

[0119] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of the device and the electronic device to which it is applied.

[0120] like Figure 5 As shown, Figure 5 This is a block diagram of a directed graph node updating device according to an exemplary embodiment of the present specification, which is used to update the transaction risk feature representation of the user corresponding to the node, and to represent a node by the source feature and target feature of the node, and to represent an edge by the source feature and target feature of the edge; wherein: the source feature of the node is used to represent the feature of the node as the node starting the edge, the target feature of the node is used to represent the feature of the node as the node pointed to by the edge, the source feature of the edge is used to represent the effect of the edge on the node starting the edge, and the target feature of the edge is used to represent the effect of the edge on the node pointed to by the edge; the device includes:

[0121] The node feature acquisition module 510 is used to obtain the source feature and target feature of each node in the graph data; the source feature of the node is obtained based on the initial feature of the node and the preset source node weight, and the target feature of the node is obtained based on the initial feature of the node and the preset target node weight.

[0122] The edge feature acquisition module 520 is used to acquire the source feature and the target feature of each edge in the graph data; the source feature of the edge is obtained according to the initial feature of the edge and the preset source edge weight, and the target feature of the edge is obtained according to the initial feature of the edge and the preset target edge weight.

[0123] The node updating module 540 is used to update the target feature of each node according to the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; and to update the source feature of the node according to the target features of the nodes in the neighborhood of the node and the source features of the edges.

[0124] The device also includes: an attention calculation module 530, which is used to calculate the source attention and target attention of each node in the neighborhood of each node, and calculate the source attention and target attention of the edges in the neighborhood of the node based on the attention mechanism.

[0125] In the case where the device also includes an attention calculation module 530, the node update module 540 is specifically used to: use the source attention of the nodes in the neighborhood of the node and the target attention of the edges in the neighborhood as weights, calculate the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood, use the calculated weighted sum as the input of the target feature convolution function, and obtain the updated target feature of the node; use the target attention of the nodes in the neighborhood of the node and the source attention of the edges in the neighborhood as weights, calculate the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood, use the calculated weighted sum as the input of the source feature convolution function, and obtain the updated source feature of the node.

[0126] The device also includes: a normalization module 531, which is used to normalize the source attention and target attention of each node, and the source attention and target attention of each edge.

[0127] In the case where the device also includes a normalization module 531, the node update module 540 is specifically used to: use the normalized source attention of the nodes in the neighborhood of the node and the normalized target attention of the edges in the neighborhood as weights, and calculate the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; use the normalized target attention of the nodes in the neighborhood of the node and the normalized source attention of the edges in the neighborhood as weights, and calculate the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood.

[0128] The node feature acquisition module 510 is specifically used for: for each node in the graph data, multiplying the feature vector of the node by the source node weight and the target node weight respectively, to obtain the source feature and target feature of the node. The edge feature acquisition module 520 is specifically used for: for each edge in the graph data, multiplying the feature vector of the edge by the source edge weight and the target edge weight respectively, to obtain the source feature and target feature of the edge.

[0129] like Figure 6 As shown, Figure 6 This is a block diagram of a graph neural network training device according to an exemplary embodiment of the present specification, wherein the graph neural network is used to classify transaction risks of users corresponding to each node; the device includes:

[0130] The iterative training module 610 is used to iteratively execute the following steps until the output loss is less than a preset loss threshold, or the number of iterations is greater than a preset number threshold: according to the above-mentioned directed graph node update method, the target feature of each updated node is obtained; the target feature of each updated node is used as input, and the transaction risk classification of each node is used as output, and the output loss is obtained according to the transaction risk classification label and classification weight of each node; according to the output loss, the classification weight, the source node weight, the target node weight, the source edge weight and the target edge weight are updated.

[0131] The graph neural network determination module 620 is used to determine the graph neural network based on the current classification weight, source node weight, target node weight, source edge weight and target edge weight.

[0132] like Figure 7 As shown, Figure 7 This is a block diagram of a node classification device according to an exemplary embodiment of the present specification, which is used to obtain the transaction risk classification of each node. The device includes:

[0133] The target feature acquisition module 710 is used to acquire the target feature of each updated node according to the directed graph node update method described above;

[0134] The risk classification module 720 is used to obtain the risk classification of each node based on the target features of each updated node as input and the pre-trained classification weights and graph neural network.

[0135] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0136] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0137] like Figure 8 As shown, Figure 8A hardware structure diagram of an electronic device in which a directed graph node updating device, a graph neural network training device, or a node classification device is located is shown. The device may include any one of the devices, or any multiple of the devices. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other in communication within the device through the bus 1050.

[0138] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0139] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0140] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0141] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0142] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0143] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0144] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the directed graph node update method, graph neural network training method, or node classification method described above is implemented. In other words, the computer-readable storage medium may store a computer program for executing any one or more of the above methods.

[0145] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0146] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0147] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims

1. A directed graph node updating method, used to update the transaction risk feature representation of the user corresponding to the node, a node is represented by the source feature and target feature of the node, and an edge is represented by the source feature and target feature of the edge; wherein: The source feature of a node is used to characterize the feature of the node as the node starting the edge, the target feature of the node is used to characterize the feature of the node as the node pointed to by the edge, the source feature of the edge is used to characterize the effect of the edge on the node starting the edge, and the target feature of the edge is used to characterize the effect of the edge on the node pointed to by the edge; the method includes: For each node in the graph data, the source feature and target feature of the node are obtained; the source feature of the node is obtained according to the initial feature of the node and the preset source node weight, and the target feature of the node is obtained according to the initial feature of the node and the preset target node weight; For each edge in the graph data, the source feature and the target feature of the edge are obtained; the source feature of the edge is obtained according to the initial feature of the edge and the preset source edge weight, and the target feature of the edge is obtained according to the initial feature of the edge and the preset target edge weight; For each node, the target feature of the node is updated according to the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; the source feature of the node is updated according to the target features of the nodes in the neighborhood of the node and the source features of the edges; the updated target feature of the node is determined according to the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood, and the updated source feature of the node is determined according to the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood.

2. The method according to claim 1, further comprising: Based on the attention mechanism, for each node, the source attention and target attention of each node in the neighborhood of the node are calculated, and the source attention and target attention of the edges in the neighborhood of the node are calculated; The target feature of the node is updated according to the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; According to the target features of the nodes in the neighborhood of the node and the source features of the edges, the source features of the node are updated, including: The source attention of the nodes in the neighborhood of the node and the target attention of the edges in the neighborhood are used as weights, and the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood are calculated. The calculated weighted sum is used as the input of the target feature convolution function to obtain the updated target feature of the node; The target attention of the nodes in the neighborhood of the node and the source attention of the edges in the neighborhood are used as weights, the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood are calculated, and the calculated weighted sum is used as the input of the source feature convolution function to obtain the updated source features of the node.

3. The method according to claim 2, further comprising: Normalize the source attention and target attention of each node, and the source attention and target attention of each edge; The method of taking the source attention of the nodes in the neighborhood of the node and the target attention of the edges in the neighborhood as weights and calculating the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood includes: The normalized source attention of the nodes in the neighborhood of the node and the normalized target attention of the edges in the neighborhood are used as weights to calculate the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; The method of taking the target attention of the nodes in the neighborhood of the node and the source attention of the edges in the neighborhood as weights and calculating the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood includes: The normalized target attention of the nodes in the neighborhood of the node and the normalized source attention of the edges in the neighborhood are used as weights to calculate the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood.

4. According to the method of claim 1, the step of obtaining the source feature and the target feature of the node comprises: Multiply the feature vector of the node by the source node weight and the target node weight respectively to obtain the source feature and target feature of the node; The obtaining of the source feature and the target feature of the edge includes: The feature vector of the edge is multiplied by the source edge weight and the target edge weight respectively to obtain the source feature and target feature of the edge.

5. A graph neural network training method, wherein the graph neural network is used to classify transaction risks of users corresponding to each node; the method comprises: Iterate the following steps until the output loss is less than the preset loss threshold, or the number of iterations is greater than the preset number threshold: According to the method according to any one of claims 1 to 4, obtaining the target feature of each updated node; Taking the target feature of each updated node as input and the transaction risk classification of each node as output, the output loss is obtained according to the transaction risk classification label and classification weight of each node; According to the output loss, the classification weight, the source node weight, the target node weight, the source edge weight and the target edge weight are updated; The graph neural network is determined based on the current classification weight, source node weight, target node weight, source edge weight and target edge weight.

6. A node classification method for obtaining a transaction risk classification of each node; the method comprising: According to the method according to any one of claims 1 to 4, obtaining the target feature of each updated node; Taking the target features of each updated node as input, the risk classification of each node is obtained according to the pre-trained classification weights and graph neural network.

7. A directed graph node updating device, used to update the transaction risk feature representation of the user corresponding to the node, characterizing a node by the source feature and target feature of the node, and characterizing an edge by the source feature and target feature of the edge; wherein: The source feature of a node is used to characterize the feature of the node as the node starting the edge, the target feature of the node is used to characterize the feature of the node as the node pointed to by the edge, the source feature of the edge is used to characterize the effect of the edge on the node starting the edge, and the target feature of the edge is used to characterize the effect of the edge on the node pointed to by the edge; the device comprises: The node feature acquisition module is used to acquire the source feature and target feature of each node in the graph data; the source feature of the node is obtained according to the initial feature of the node and the preset source node weight, and the target feature of the node is obtained according to the initial feature of the node and the preset target node weight; The edge feature acquisition module is used to acquire the source feature and target feature of each edge in the graph data; the source feature of the edge is obtained according to the initial feature of the edge and the preset source edge weight, and the target feature of the edge is obtained according to the initial feature of the edge and the preset target edge weight; The node updating module is used to update the target feature of each node according to the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood; update the source feature of the node according to the target features of the nodes in the neighborhood of the node and the source features of the edges; the updated target feature of the node is determined according to the weighted sum of the source features of the nodes in the neighborhood of the node and the target features of the edges in the neighborhood, and the updated source feature of the node is determined according to the weighted sum of the target features of the nodes in the neighborhood of the node and the source features of the edges in the neighborhood.

8. A graph neural network training device, the graph neural network is used to classify transaction risks of users corresponding to each node; the device comprises: The iterative training module is used to iteratively perform the following steps until the output loss is less than a preset loss threshold, or the number of iterations is greater than a preset number threshold: According to the method according to any one of claims 1 to 4, obtaining the target feature of each updated node; Taking the target feature of each updated node as input and the transaction risk classification of each node as output, the output loss is obtained according to the transaction risk classification label and classification weight of each node; According to the output loss, the classification weight, the source node weight, the target node weight, the source edge weight and the target edge weight are updated; The graph neural network determination module is used to determine the graph neural network based on the current classification weight, source node weight, target node weight, source edge weight and target edge weight.

9. A node classification device, used to obtain the transaction risk classification of each node; the device comprises: A target feature acquisition module, configured to acquire the target feature of each updated node according to the method described in any one of claims 1 to 4; The risk classification module is used to take the target features of each updated node as input and obtain the risk classification of each node based on the pre-trained classification weights and graph neural network.

10. An electronic device, comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 6 by running the executable instructions.

11. A computer-readable storage medium storing computer instructions, wherein the computer instructions, when executed by a processor, implement the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Credit risk assessment method and device and electronic device

    CN110009474A

  • System and method for facilitating computational analysis of a health condition

    IN201947028063A