Graph Transform-based role discovery method

Through the graph Transformer and RoleFormer methods, combined with the self-supervised channel and anchor point relative distance methods, it solves the limitations of long-distance dependence between nodes and global feature fusion in the existing technology, achieves high-quality characterization and feature fusion of node representation, and improves Role-oriented network representation learning for expressiveness.

CN118733835APending Publication Date: 2024-10-01HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410978748.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing role-oriented network representation learning models have limitations in capturing long-distance dependencies between nodes and global feature fusion, resulting in node preferences being connected to nodes of different categories, and the lack of a unified feature fusion paradigm, which limits the expressiveness of the model. .

Method used

The self-supervised channel and RoleFormer method based on graph Transformer are used to capture local, high-order and global features through reconstructed features and contrastive learning, and use the anchor point relative distance method to extract global features, construct node token sequences for feature fusion, and realize node Precise portrayal of representation.

Benefits of technology

It effectively captures long-distance dependencies between nodes, improves the expressiveness of node representation, provides a simple and easily scalable global feature encoding method, comprehensively integrates local, high-order and global features, and enhances the accuracy of node role characterization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733835A_ABST
    Figure CN118733835A_ABST
Patent Text Reader

Abstract

The invention discloses a role discovery method based on a graph Transform, and the method comprises the steps: firstly obtaining a data source, extracting the local features and high-order features of all nodes in the data source through recursive feature extraction and sub-graph degree vectors, and extracting the global features of all nodes through the relative distance of anchor points; secondly, on the basis of local, high-order and global features, each node generates three node token sequences corresponding to different features; then three independent graph Transform channels are constructed, three corresponding node representations are obtained according to the three node token sequences, the three node representations are spliced, and the role of each node is obtained through classification; and finally, constructing three multi-layer perceptron as a decoder, decoding the three node representations, extracting local, high-order and global features, and training by a loss function. According to the invention, information irrelevant to the target node is reduced, and accurate role discovery is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network representation learning in graph deep learning, and specifically is a role discovery method for real networks based on graph Transformer. Background Art

[0002] Role is a different but complementary concept from community in complex networks. It holds that nodes with similar connection patterns in the network often show some similarity in function or behavior. For example, central nodes usually show high characteristics, while bridge nodes play the role of connecting different areas of the network. By revealing the roles of nodes, we can better understand the evolution of the network and the potential characteristics of the nodes. Therefore, for network analysis and mining, it is crucial to identify the roles of nodes.

[0003] In recent years, role-oriented network representation learning has played a unique role in multiple tasks such as node classification, link prediction, and network alignment. Role-oriented network representation learning emphasizes encoding structural similarities in node representations so that nodes that play the same role can have similar vector representations. Role discovery, as a form of node classification, poses new challenges to network representation learning. The effectiveness of role-oriented network representation learning often depends on the extraction of structural features. Different types of structural features contain complex information of nodes of different scales, so how to effectively capture and utilize these structural features to generate high-quality representations remains a challenge to be solved.

[0004] Existing advanced role-oriented network representation learning models pre-extract the structural features of nodes, and then aggregate node neighbor information through the Graph Neural Network (GNN) model to reconstruct the structural features to learn node representations. In order to generate more expressive node representations, some role-oriented network representation learning methods increase degree constraints so that the learned node representations can reflect the original degree features, and some methods enhance the flexibility and discrimination of node representations through graph variational autoencoders (VAE), generative adversarial networks (GAN), and normalizing flows. Different from the model enhancement based on GNN, some role-oriented network representation learning begins to focus on fusing different types of features into node representations, so that the generated node representations can express more rich information. For example, Generating structural node representations via higher-order features and adversarial learning (SHOAL) and Role-oriented representation learning via fusioning local and higher-order feature (RFLH) both fuse local and high-order features into node representations in a specific way.

[0005] However, there are still two problems that need to be solved in the existing models: (1) The local heterogeneity of the role network causes nodes to prefer to connect to nodes of different categories, while nodes of the same category are often far apart. The long-distance dependencies brought about by this pose a challenge to GNN. The over-smoothing and over-squeezing of GNNs limit the model's ability to capture these long-distance dependencies. (2) There is a lack of a unified paradigm for feature fusion with a comprehensive perspective. Although local and high-order features have been applied to feature fusion, since the complexity of extracting global features increases rapidly with the increase of network size, there has been no research on fusing global features with other features. Global features can not only more accurately model the global role information of nodes, but also reveal the connection between different nodes on a global scale. In addition, the existing feature fusion methods are not easy to expand and lack a general unified paradigm for feature fusion.

[0006] The local heterogeneity of role networks has been ignored in previous work. Previous methods simply aggregated neighbor information and lost the capture of structural differences between neighbors, and could not capture long-distance dependencies between nodes of the same category. Therefore, we use the ability of graph transformers to exchange node information globally to capture long-distance dependencies between nodes to address the problem of local heterogeneity. Different from the ability of local features to identify local relationships and high-order features to identify complex structures, global features model node roles from a global perspective and reveal connections between nodes, which is particularly important for analyzing complex long-distance dependencies between nodes. However, simple addition or concatenation operations will lose the complex dependency interactions between different types of features. However, most work ignores the correlation between different types of features. Therefore, in role-oriented network representation learning, how to capture long-distance dependencies between nodes and effectively integrate different types of structural features to improve the expressiveness of node representation is a problem worth studying. Summary of the invention

[0007] In view of the above problems, the present invention proposes a role discovery method for real networks based on graph transformers. In view of the existing problems of role-oriented network representation learning, the present invention proposes a new self-supervised graph transformer channel. This channel constructs a node sequence suitable for the role network, and uses the ability of transformer to capture long-distance dependencies to mine the connections between the same role nodes with long distances in the role network. On this basis, a unified paradigm RoleFormer that simultaneously considers local, high-order and global features is proposed. It builds three self-supervised graph transformer channels, learns node representations from pre-extracted node structure features based on reconstruction features and contrastive learning, and is used to accurately characterize node roles. In addition, a simple and easily scalable global feature encoding method, anchor relative distance (ARD), is proposed to solve the problem of lack of attention to global features and high complexity of existing models. Specifically, RoleFormer pre-extracts local, high-order and global features of nodes, and constructs node token sequences for each channel based on feature similarity. Each channel generates a node representation by reconstructing the node features after feature normalization. Relying on contrastive learning between different channels, RoleFormer is able to learn the commonalities between different features from learning node representations of different node features to achieve feature fusion from a comprehensive perspective.

[0008] The present invention RoleFormer: a role discovery method for real networks based on graph transformer is implemented by the following steps:

[0009] Step 1: Obtain the data source, where the data requires to include nodes in the network and the edges between nodes.

[0010] Step 2: Based on the acquired data source, the local features and high-order features of all nodes in the data source are extracted through the existing recursive feature extraction (Recursive FeatureeXtraction, ReFeX) and subgraph degree vector (Graphlet Degree Vector, GDV) methods.

[0011] Step 3: Based on the acquired data source, the Anchor Relative Distance (ARD) method is proposed to extract the global features of all nodes.

[0012] Step 4: Combine all nodes in the data source into node pairs. Based on the extracted local features, high-order features, and global features, calculate the cosine similarity of the local, high-order, and global features of all node pairs. For three different features, each node selects the K nodes with the highest cosine similarity to itself to construct a node token sequence, so each node will generate three node token sequences corresponding to different features.

[0013] Step 5: After generating the three corresponding node token sequences for all nodes, three independent graph Transformer channels are constructed. Each graph Transformer channel encodes a node token sequence to obtain the node representation of the node sequence, and then reads the node representation of the node sequence into the node representation of a single node through the graph readout function. Finally, the three independent graph Transformer channels will generate three corresponding node representations. The three node representations obtained are concatenated to obtain the final node representation, and the node representations are classified to obtain the role of each node.

[0014] Step 6: After the graph Transformer generates three corresponding node representations, three multi-layer perceptrons (MLPs) are constructed as decoders to decode the three generated node representations to extract the local features, high-order features, and global features extracted in step 2.

[0015] Step 7: Constrain the three node representations generated in step 5 through the loss function. Constrain the local features, high-order features and global features extracted from the node representation in step 6 and the local features, high-order features and global features extracted from the data source in step 2 through the loss function.

[0016] Preferably, betweenness centrality is used as the node centrality of ARD in step 3.

[0017] Preferably, the specific process of extracting global features by ARD is as follows: calculating the centrality of all nodes in the data source, selecting M nodes with the largest centrality as anchor nodes, and calculating the shortest path distances from all nodes to the M anchor nodes as the global features of the nodes.

[0018] Preferably, a graph readout function based on an attention mechanism is used as the graph readout function in step 5.

[0019] The present invention has the beneficial effects:

[0020] The present invention fuses features from a comprehensive perspective so that the generated node representation can more accurately characterize the node role. We pay equal attention to the local features, high-order features, and global features of the node to more comprehensively reflect the true characteristics of the node, and fuse these features into the node representation through the constructed multi-channel graph transformer paradigm. Considering the local heterogeneity of the role network, the present invention designs a labeling sequence based on feature similarity, aiming to reduce information irrelevant to the target node while maintaining the long-range dependencies captured by the graph transformer. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is the framework diagram of the role discovery method for real networks based on Pytorch's RoleFormer: graph transformer;

[0022] Figure 2 It is a comparison chart of Macro-F1 and Micro-F1 values ​​of different training models with different datasets at training ratios ranging from 10% to 90%;

[0023] Figure 3 This is a comparison of the 2D visualization results of node classification of different training models under the Brazilian airport dataset;

[0024] Figure 4 It is a comparison chart of the effects of different parameters on model performance in the present invention;

[0025] Figure 5 is a comparative diagram of the effects of different feature variants of the present invention on model performance;

[0026] Figure 6 It is a comparison chart of the impact of different module variants of the present invention on model performance. DETAILED DESCRIPTION

[0027] The following figure further illustrates the present invention in combination with the accompanying drawings and specific embodiments.

[0028] like Figure 1As shown, the present invention RoleFormer: a role discovery method for real networks based on graph Transformer, the specific steps are as follows:

[0029] Step 1: Obtain the data source, where the graph data G = {V, E} is required to include nodes V in the network and edges E between nodes.

[0030] Step 2: According to the acquired data source, the local features and high-order features of all nodes in the data source are extracted through the existing ReFeX and GDV methods.

[0031] like Figure 1 As shown, the present invention uses the ReFeX method to extract six types of local features of all nodes in the input graph: 1. The number of edges where the node is located; 2. The degree of all nodes; 3. The ratio of the edge where the node is located to all edges; 4. The ratio of the edge that does not include the node to all edges; 5. The degree of the node; 6. The clustering coefficient of the node. The ReFeX method obtains local features by aggregating the features of the neighborhood in each iteration, and then calculates their sum and the mean of each dimension. The present invention uses the GDV method to obtain the high-order features of the node by counting the substructure where the node is located, wherein the GDV method counts all 73 possible point track types that 2-5 nodes may constitute.

[0032] Step 3: Based on the acquired data source, the global features of all nodes are extracted according to the proposed ARD method.

[0033] like Figure 1 As shown, the present invention uses the ARD method to calculate the betweenness centrality of all nodes, selects appropriate M nodes as anchor points in the network according to different network scales, and calculates the shortest path distance (SPD) from all nodes to these M nodes as the global feature of the node.

[0034] ARD i =[SPD1,SPD2,...,SPD M ]

[0035] Among them, ARD i Represents node v i The global features of SPD1, SPD2, ..., SPD M Represents node v i To the SPD of the selected M anchor points.

[0036] Step 4: Combine all nodes in the data source into node pairs. Based on the extracted local, high-order and global features, for each node v i Compute the local differences between pairs of nodes Advanced and global features The cosine similarity Sim(·,·)} of , and select the K nodes with the highest similarity Top K (·,·) build node token sequence Node sequence is the node's initialization vector.

[0037]

[0038] Step 5: After generating the three corresponding node token sequences for all nodes, three independent graph Transformer channels are constructed. Each graph Transformer channel encodes a node token sequence to obtain the node representation of the node sequence, and then reads the node representation of the node sequence into the node representation of a single node through the graph readout function. Finally, the three independent graph Transformer channels will generate three corresponding node representations. i Take the local feature channel as an example:

[0039] First, the node token sequence Map the node representation to the hidden layer dimension through linear mapping:

[0040]

[0041] Where W L is a trainable weight matrix. Represents node v i Its own initialization vector, Represents node v i The initialization vectors of the selected K nodes. Then the nodes are represented After the Encoder layer of the Transformer:

[0042]

[0043] MSA stands for multi-head self-attention mechanism, FFN stands for fully connected network, and LN stands for layer normalization operation. Finally, the node x is obtained through the attention-based graph readout function i Node representation assumed

[0044]

[0045] Where W a is a trainable weight matrix.

[0046] Step 6: After the graph Transformer generates three corresponding node representations, three MLPs are constructed as decoders to decode the three generated node representations to extract the local, high-order, and global features extracted in step 2. i As an example, the local feature channel of the node is represented by MLP as a decoder. Refactored to

[0047]

[0048] The three node representations are concatenated and classified to obtain the role of each node.

[0049] Step 7: Based on steps 5 and 6, use the loss function to constrain the three node representations:

[0050]

[0051] in is the local, high-order, and global node representation of all nodes, Represents the Frobenius paradigm. Use the loss function to constrain the node representation to learn the original node features:

[0052]

[0053] in represents the local, high-order, and global features of all nodes extracted from the node representation in step 6, X L ,X H ,X G Represents the original local, high-order, and global features extracted from the data source in steps 2 and 3.

[0054] Conduct joint training:

[0055] L=L re +βL cons ,

[0056] Where β is a hyperparameter that controls the weight. The three node representations obtained in step 5 are concatenated to obtain the final node representation, and the node representations are classified to obtain the role of each node.

[0057] Figure 2 This is a comparison chart of the Macro-F1 and Micro-F1 values ​​of different training models with different data sets and training ratios ranging from 10% to 90%. Figure 2It can be seen that in the Brazilian network with the least number of nodes, the RoleFormer of the present invention achieved the best results in all dataset partitions. As the training set expands, the advantage of RoleFormer over other baseline models becomes more obvious. This is thanks to RoleFormer's use of the Transformer framework, which allows RoleFormer to construct input sequences based on feature similarity, thereby effectively reducing the erroneous information received by the target node. In contrast, several other baseline models rely on collecting information from neighbors, which may cause the target node to receive erroneous features from the wrong category because of the local heterogeneity of the role network. Compared with the Brazilian network, RoleFormer performs well in Micro-F1 scores on the Enron network, but performs poorly in Macro-F1. The reason for this difference is that Macro-F1 does not consider the amount of data, but treats each category equally. In the Enron network, the limited number of nodes and a large number of categories lead to sparse distribution of nodes in some categories. This poses a challenge to RoleFormer's sequence construction, because shorter sequences lead to insufficient information acquisition, while longer sequences may capture incorrect information. The present invention also achieved the best results on all other networks. As the number of network nodes increases, RoleFormer's strategy of simultaneously considering local, high-order and global features shows more obvious advantages.

[0058] Figure 3 This is a comparison of the two-dimensional visualization results of node classification of different training models under the Brazilian airport dataset. Figure 3 As can be seen, it describes the spatial distribution of various roles in the Brazilian airport network. We note that although the RolX method presents a clear clustering pattern, it cannot effectively distinguish different node roles because it relies only on local features without additional constraints. Methods such as struc2vec, RESD, and GAS use local or high-order features and show certain role differentiation capabilities, but they cannot fully restrict nodes sharing the same role to a reasonable range. In contrast, GraphWave, which relies on global features to distinguish nodes, is able to restrict nodes to similar spatial regions, but lacks the ability to distinguish different roles. SHOAL and RFLH combine local features and high-order features and show different capabilities in node differentiation. SHOAL focuses on restricting nodes with the same role to similar spatial regions, while the large overlap of many nodes complicates its differentiation. In contrast, although RFLH's restrictions appear to be looser, it can effectively distinguish nodes with the same role. Matching our RoleFormer model, we achieve the expected results: different role regions are separated, nodes with the same role are assigned to a narrower similarity space, and excessive overlap is minimized while maintaining a certain degree of distinguishability.

[0059] Figure 4 It is a comparison chart of the impact of different parameters on model performance in the present invention. We first analyzed the impact of the number of anchor nodes M in ARD on the performance of extracting global features. Given that the Brazilian network consists of 131 nodes, we explored the optimal number of anchor nodes M for each network, up to 128. Obviously, the optimal number of anchor nodes M is different for networks of different sizes. Similar to the change in M, the number of nodes K used in sequence construction is also sensitive to the size of the network. The experimental results show that each network has an optimal K that enables each node to obtain as much similar feature information as possible while avoiding feature information from unexpected classes. We also analyzed the impact of different proportions of contrastive learning rate β on the model. Contrastive learning is a key component of feature fusion, and the contrastive learning weight is affected by the complexity of network features. In the European network, a value of β = 0.5 is sufficient to achieve effective feature fusion, while the Brazilian and American networks need to pay more attention to contrastive learning.

[0060] Figure 5 is a comparison chart of the effects of different feature variants of the present invention on model performance. Figure 5 In this paper, we present comparative results of variants of RoleFormer features. Our results show that in small networks like the Brazilian network, local and high-order features have a large impact on the model, while global features have a relatively small impact. However, as the network size increases, the impact of global features on the model increases, while the importance of local features gradually decreases. High-order features, as the key factor in identifying the local connection patterns of nodes, always maintain their importance. These results show that our strategy can effectively comprehensively consider structural features on datasets of different sizes.

[0061] Figure 6 This is a comparison chart of the impact of different module variants on model performance. We analyzed the module variants of RoleFormer to ensure that each module has its reason for existence. Figure 6 As shown in Figure 3, selecting node construction sequences from neighbors is the most destructive to the model, which strongly proves the rationality of RoleFormer's selection of node construction sequences based on feature similarity. We also removed the feature normalization module and the readout module based on the attention mechanism respectively, among which the feature normalization module has a greater impact on the model. The readout module based on the attention mechanism improves the expressiveness of the node representation generated by the model to a certain extent. Finally, we removed the contrast loss because the contrast loss causes the model to lose the ability to fuse features, resulting in a significant drop in performance. These ablation experiments effectively demonstrate that RoleFormer is able to generate node representations that accurately depict node roles through its components.

Claims

1. A role discovery method based on graph transformer, It is characterized in that The following steps are involved: Step 1: Obtain the data source, where the data includes nodes in the network and the edges between nodes; Step 2: According to the data source, extract the local features and high-order features of all nodes in the data source through recursive feature extraction and subgraph degree vector method; Step 3: According to the data source, the global features of all nodes are extracted by the anchor relative distance ARD method; Step 4: Based on local features, high-order features, and global features, each node will generate three node token sequences corresponding to different features; Step 5: Construct three independent graph Transformer channels, obtain three corresponding node representations according to the three node token sequences, concatenate the three node representations, and classify them to obtain the role of each node; Step 6: Construct three multi-layer perceptrons as decoders to decode the three generated node representations to extract the local features, high-order features, and global features extracted in step 2; Step 7: Use the loss function to constrain the three node representations generated in step 5, the local features, high-order features, and global features extracted in step 6 and step 2 for training.

2. The graph transformer-based role discovery method according to claim 1, It is characterized in that The betweenness centrality is used as the node centrality of ARD in step 3.

3. The graph transformer-based role discovery method according to claim 2, It is characterized in that The specific process of ARD extracting global features is: calculating the centrality of all nodes in the data source, selecting M nodes with the largest centrality as anchor nodes; calculating the shortest path distances from all nodes to the M anchor nodes as the global features of the nodes.

4. The graph transformer-based role discovery method according to claim 1, It is characterized in that The specific implementation process of step 4 is as follows: all nodes in the data source are combined in pairs to form node pairs, and the cosine similarity of local features, high-order features and global features of all node pairs is calculated; for three different features, each node selects the K nodes with the highest cosine similarity with itself to construct a node token sequence, and each node will generate three node token sequences corresponding to different features.

5. The graph transformer-based role discovery method according to claim 4, It is characterized in that The specific implementation process of obtaining three corresponding node representations based on three node token sequences is as follows: after generating the corresponding three node token sequences for all nodes, three independent graph Transformer channels are constructed, each of which encodes a node token sequence to obtain a node representation of the node sequence, and then reads the node representation of the node sequence into a node representation of a single node through a graph read function; finally, the three independent graph Transformer channels will generate three corresponding node representations.

6. The graph transformer-based role discovery method according to claim 5, It is characterized in that The graph readout function is a graph readout function based on an attention mechanism.