Node representation method with personalized and global features in social network

By using Laplace smoothing filter in graph convolution network for multi-level feature aggregation and dynamic weight calculation, and combining encoder for community feature extraction, the problem of oversmoothing and computing resource consumption of GCN in large-scale graph data is solved. , realizes high-quality node representation.

CN119293661APending Publication Date: 2025-01-10NORTHWEST UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411196180.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing graph convolutional network (GCN) has excessive smoothing problems and high computing resource consumption when processing large-scale graph data, and traditional node representation methods are difficult to effectively capture the personalized and global features of graph structures.

Method used

By calculating the adjacency matrix of the graph, we obtain the Laplace smoothing filter, perform multi-level feature aggregation, decoupling feature aggregation and extraction operations, dynamically calculate the node weight, combine the encoder for community feature extraction, and design a reasonable loss function to guide the features. Extraction process.

Benefits of technology

Capturing global features and retaining personalized features in large-scale graph data is realized, oversmoothing problem is alleviated, the distinction between node representation and model robustness is improved, and high-quality node embedding is obtained.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293661A_ABST
    Figure CN119293661A_ABST
Patent Text Reader

Abstract

The invention relates to a node representation method with personalized and global features in a social network. The method comprises the steps of global feature capture, personalized feature reservation and community feature extraction. According to the method, a Laplacian smoothing filter is obtained through calculation according to an adjacent matrix of a graph, multi-level feature aggregation is performed on an initial node feature matrix based on the Laplacian smoothing filter, and a node feature matrix after feature aggregation of each level is obtained; calculating a weight matrix of each level based on the node feature matrix after feature aggregation of each level; according to the weight matrix of each level, calculating a combined feature which retains personalized features; and inputting the combined features into an encoder for community feature extraction to obtain a node embedding matrix. According to the method, high-quality node representation can be learned, the performance is excellent in a node clustering task, and the excellent performance can also be shown in a link prediction task; compared with an existing method, the performance of the method is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of graph representation learning technology, and in particular, to a node representation method in a social network that has both personalized and global features. Background Art

[0002] Node representation method, also known as graph representation learning, is a fundamental yet arduous task. It involves embedding the nodes or edges in a graph into a low-dimensional vector space while retaining its original structure and feature information. The node embeddings obtained by node representation method can be applied to various downstream tasks such as node clustering and link prediction.

[0003] Early node representation methods for graph-structured data include some classic techniques such as Laplacianeigenmaps, matrix factorization, and Node2vec. In recent years, Graph Convolutional Network (GCN), as a new message passing mechanism, has achieved advanced performance in many graph learning tasks. GCN can capture complex patterns and dependencies in the data through convolution operations on the graph, significantly improving the performance of node representation methods. However, this method has two main limitations:

[0004] Limitation 1: Although GCN-based technology can capture long-distance dependencies (i.e., global information) in the graph by stacking multiple neural network layers, a large number of superimposed neural network layers often leads to a gradual decrease in the distinguishability of node embeddings, ultimately leading to the over-smoothing problem. This phenomenon makes the embedding of nodes almost indistinguishable, weakening the model's representation ability in the graph structure. Therefore, most graph convolutional neural networks are limited to using two or three layers to avoid the occurrence of over-smoothing problems. However, this limitation also hinders the model's acquisition of global information, and the model's performance ability is limited to a certain extent.

[0005] Limitation 2: The GCN-based method includes two key operations in each layer, namely feature aggregation and feature extraction. Feature aggregation is responsible for obtaining information from neighboring nodes and integrating it into the target node, while feature extraction is used to update the feature representation of the node. Due to the coupling of these two operations, when multiple GCN layers are stacked, the number of model parameters increases significantly, the depth of the computational graph deepens, and the memory usage and computation time during training increase significantly, which also makes it difficult to expand the model to large-scale graph datasets.

[0006] Overall, this challenge highlights the limitations of scaling GCNs to larger neighborhoods and large-scale graphs. Overcoming these challenges is critical to improving graph data processing capabilities.

[0007] Another important aspect of node representation methods is how to reasonably design the loss function to guide the feature extraction process. For unsupervised node representation learning, related research methods can be divided into two groups according to their optimization objectives: (1) reconstructing the adjacency matrix; (2) reconstructing the feature matrix. For example, Graph Autoencoder (GAE) and Variational Graph Autoencoder (VGAE) use the reconstruction of the adjacency matrix as the loss function, and GALA and ARGAT use the reconstruction of the feature matrix as the loss function. These methods focus on different aspects of the graph structure to improve the quality of node embedding. However, the reconstruction losses of these methods may not always be consistent with real-world applications, and they ignore the connections within and between groups in the graph (or, within and between classes) to some extent. Therefore, they cannot always achieve the best results. Summary of the invention

[0008] In order to overcome at least one deficiency in the prior art, the present application provides a node representation method in a social network that has both personalized and global features.

[0009] In a first aspect, a node representation method with both personalized and global features in a social network is provided, comprising:

[0010] The Laplace smoothing filter is calculated based on the adjacency matrix of the graph, and the initial node feature matrix is ​​subjected to multi-level feature aggregation based on the Laplace smoothing filter to obtain the node feature matrix after each level of feature aggregation; the node feature matrix after the last level of feature aggregation is the global feature;

[0011] The weight matrix of each level is calculated based on the node feature matrix after the features of each level are aggregated; the combined features that retain the personalized features are calculated based on the weight matrix of each level;

[0012] The combined features are input into the encoder for community feature extraction to obtain the node embedding matrix.

[0013] In one embodiment, the Laplace smoothing filter is calculated based on the adjacency matrix of the graph using the following formula:

[0014] P=I-λL sym

[0015]

[0016] Among them, P is the Laplace smoothing filter, I is the unit matrix, λ is a real number, L sym is the symmetric normalized graph Laplacian matrix, is the adjacency matrix of a graph with self-loops, for The corresponding degree matrix, is the Laplacian matrix of a graph with self-loops.

[0017] In one embodiment, the initial node feature matrix is ​​subjected to multi-level feature aggregation based on the Laplace smoothing filter to obtain the node feature matrix after feature aggregation at each level, using the following formula:

[0018] X t =PX t-1

[0019] Among them, X t is the node feature matrix after the t-th level feature aggregation, P is the Laplace smoothing filter, X t-1 is the node feature matrix after the t-1th level feature aggregation; when t = 1, X t-1 is the initial node feature matrix.

[0020] In one embodiment, the weight matrix of each layer is expressed by the following formula:

[0021]

[0022] Among them, W t is the weight matrix of the tth level, is the weight of the i-th node at the t-th level, 1≤i≤n, n is the number of nodes in the graph, is the node feature matrix X after the t-th level feature aggregation t The feature of the i-th node in [X t ] i The feature [X] of the i-th node in the initial node feature matrix X i The cosine similarity between them, L is the number of levels, and diag represents the formation of a diagonal matrix.

[0023] In one embodiment, the combined features are:

[0024]

[0025] Among them, X ′ is the combined feature, L is the number of levels, W t is the weight matrix of the tth level, X t It is the node feature matrix after the t-th level feature aggregation.

[0026] In one embodiment, the encoder is a trained encoder, and the loss function used in the training process is:

[0027] L=L1+L2

[0028] Among them, L is the loss function, L1 is the first loss function, and L2 is the second loss function;

[0029] The first loss function L1:

[0030]

[0031] pos={(i,j)|(i,j)∈Top_α(S)}

[0032]

[0033] Among them, pos is a node pair set, i, j are two nodes in a node pair, Top_α(S) is a set of the first α node pairs with the highest similarity values ​​selected from the similarity matrix S, Z is a node embedding matrix, Z T is the transpose of Z, is the square of the 2-norm; σ is the sigmoid activation function, s ij is the similarity value of node pair (i, j);

[0034] The second loss function L2 is constructed in the following way:

[0035] Clustering the node embedding matrix Z output by the encoder during the training process, dividing all nodes in the node embedding matrix Z into multiple categories, and determining the initial clustering center of each category; the node embedding matrix Z includes the embedding features of multiple dimensions of each node;

[0036] Calculate the distance between each node in each category and the initial cluster center of the category, and select the first β% nodes with the smallest distance to form a reliable set corresponding to the category;

[0037] Calculate the mean of the embedded features of all nodes in the reliable set corresponding to each category as the new cluster center;

[0038] According to the new cluster center, construct the second loss function L2:

[0039]

[0040] Among them, k1 and k2 are the labels of different categories, K is the number of categories, and h k1 is the new cluster center corresponding to category k1, h k2 is the new cluster center corresponding to category k2, ‖‖2 is the 2-norm, <h k1 ,h k2 > for h k1 ,h k2 The inner product of .

[0041] In one embodiment, the encoder is a MLP encoder.

[0042] In a second aspect, a node representation device having both personalized and global features in a social network is provided, comprising:

[0043] The global feature extraction module is used to calculate the Laplace smoothing filter according to the adjacency matrix of the graph, and perform multi-level feature aggregation on the initial node feature matrix based on the Laplace smoothing filter to obtain the node feature matrix after each level of feature aggregation; the node feature matrix after the last level of feature aggregation is the global feature;

[0044] A personalized feature retention module is used to calculate the weight matrix of each level based on the node feature matrix after the features of each level are aggregated; and to calculate the combined features of the personalized features retained according to the weight matrix of each level;

[0045] The community feature extraction module is used to input the combined features into the encoder for community feature extraction to obtain the node embedding matrix.

[0046] In a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the node representation method having both personalized and global characteristics in the above-mentioned social network is implemented.

[0047] In a fourth aspect, a computer program product is provided, including a computer program / instruction. When the computer program / instruction is executed by a processor, the node representation method having both personalized and global characteristics in the above-mentioned social network is implemented.

[0048] Compared with the prior art, this application has the following beneficial effects:

[0049] The method of the present application includes global feature capture, personalized feature retention and community feature extraction, which can take into account the personalized features, community features and global features of the graph structure to enrich the representation of nodes. In global feature capture, the feature aggregation and feature extraction operations of GCN are decoupled, and the neighborhood feature aggregation is performed by using the Laplace smoothing filter multiple times to capture as much global information as possible. In personalized feature retention, the weight of each node in each layer is dynamically calculated according to the changes in the feature space, and then these weights are used to combine the aggregated features of the intermediate layer, which not only retains more individual information and local information related to each node, but also effectively alleviates the over-smoothing problem. In community feature extraction, using the clustering results, a reasonable loss function is designed from the perspective of the embedding space to guide the extraction process of community features by "reducing the distance between similar node pairs" and "expanding the distance between different clustering centers." The present application can ultimately obtain a high-quality node representation that retains the graph structure features and node attribute features. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The present application may be better understood by referring to the following description given in conjunction with the accompanying drawings, which together with the following detailed description are included in this specification and form a part of this specification. In the drawings:

[0051] Figure 1 A flowchart of a node representation method with both personalized and global features in a social network is shown;

[0052] Figure 2 A schematic diagram of a node representation method with both personalized and global features in a social network is shown;

[0053] Figure 3 The visualization results of node embedding at each stage are shown, where (a), (b) and (c) are the visualization results of the initial feature matrix, combined features and node embedding matrix on the Cora dataset, respectively; (d), (e) and (f) are the visualization results of the initial feature matrix, combined features and node embedding matrix on the Citeseer dataset, respectively;

[0054] Figure 4 A comparison diagram of the combined method of the present application and the traditional polymerization method is shown, wherein (a) is the traditional polymerization method and (b) is the combined method of the present application;

[0055] Figure 5 shows the combined feature X ′ The relationship between the clustering accuracy and the number of hops, where (a) is the relationship between the Cora dataset and (b) is the relationship between the Citeseer dataset.

[0056] Figure 6 The graphs showing the relationship between the clustering accuracy of the node embedding matrix Z and the number of hops are shown, where (a) is the corresponding graph of the Cora dataset, and (b) is the corresponding graph of the Citeseer dataset;

[0057] Figure 7 The graphs show the changing trend of node weight with the number of hops, where (a) is the changing trend graph corresponding to the Cora dataset, and (b) is the changing trend graph corresponding to the Citeseer dataset;

[0058] Figure 8 The comparison of clustering accuracy of different loss functions is shown, where (a) is the comparison of the Cora dataset and (b) is the comparison of the Citeseer dataset;

[0059] Fig. 9 The figure shows the influence of different embedding dimensions on node clustering performance, where (a) is the influence of the Cora dataset and (b) is the influence of the Citeseer dataset. DETAILED DESCRIPTION

[0060] The exemplary embodiments of the present application will be described below in conjunction with the accompanying drawings. For the sake of clarity and conciseness, not all features of the actual embodiments are described in the specification. However, it should be understood that many implementation-specific decisions can be made in the process of developing any such actual embodiments in order to achieve the specific goals of the developer, and these decisions may vary from embodiment to embodiment.

[0061] It is also necessary to explain here that, in order to avoid obscuring the present application due to unnecessary details, only the device structure closely related to the scheme according to the present application is shown in the drawings, while other details that are not closely related to the present application are omitted.

[0062] It should be understood that the present application is not limited to the described implementation forms due to the following description with reference to the accompanying drawings. In this article, where feasible, the embodiments can be combined with each other, features between different embodiments can be replaced or borrowed, and one or more features can be omitted in one embodiment.

[0063] The present application provides a node representation method in a social network that has both personalized and global features. Figure 1 A flowchart of a node representation method with both personalized and global features in a social network is shown. Figure 2 A schematic diagram showing a node representation method with both personalized and global features in a social network is shown in FIG. Figure 1 and Figure 2 , methods include:

[0064] Step S1, calculate the Laplace smoothing filter according to the adjacency matrix of the graph, perform multi-level feature aggregation on the initial node feature matrix based on the Laplace smoothing filter, and obtain the node feature matrix after each level feature aggregation; the node feature matrix after the last level feature aggregation is the global feature.

[0065] Here, a social network graph is obtained, and the adjacency matrix and initial node feature matrix of the graph can be obtained based on the graph.

[0066] Specifically, the Laplace smoothing filter is calculated based on the adjacency matrix of the graph, using the following formula:

[0067] P=I-λL sym

[0068]

[0069] Among them, P is the Laplace smoothing filter, I is the unit matrix, λ is a real number, L sym is the symmetric normalized graph Laplacian matrix, is the adjacency matrix of a graph with self-loops, for The corresponding degree matrix, is the Laplacian matrix of a graph with self-loops.

[0070] Here, the parameter of the Laplace smoothing filter is 2 / 3.

[0071] Based on the Laplace smoothing filter, the node feature matrix is ​​aggregated at multiple levels to obtain the node feature matrix after feature aggregation at each level, using the following formula:

[0072] X t =PX t-1

[0073] Among them, X t is the node feature matrix after the t-th level feature aggregation, P is the Laplace smoothing filter, X t-1 It is the node feature matrix after the t-1th level feature aggregation.

[0074] Here, when t = 1, X t-1 is the initial node feature matrix. When t = L, L is the number of levels, the obtained X t This is the global feature.

[0075] In this step, the Laplace smoothing filter can achieve information aggregation of neighbors of different orders through multiple iterations. The first aggregation mainly captures the information of the first-order neighbor nodes, the second aggregation can capture the information of the second-order or even third-order neighbors, and so on. Each aggregation operation integrates the information of the neighbor nodes into the current node, so that the node gradually obtains higher-order global information based on local information. This layer-by-layer progressive aggregation method helps the model capture long-distance dependencies, thereby better representing the role of nodes in the global graph structure.

[0076] As the number of layers increases to capture long-distance dependencies, the node representation of the graph tends to converge and lose its uniqueness, resulting in poor performance, that is, the problem of over-smoothing. To address this problem, this embodiment introduces the concept of personalized features, which involves the strategic integration of intermediate layer features with carefully assigned weights. These individual features are retained intermediate representations and are actively used to preserve and emphasize the different features of each node, that is, the process of step S2.

[0077] Step S2, calculating the weight matrix of each level based on the node feature matrix after the features of each level are aggregated; and calculating the combined features that retain the personalized features according to the weight matrix of each level.

[0078] In this step, each node is processed individually, taking into account the complexity of the graph structure and the different speeds at which different nodes reach the oversmoothed state. Specifically, in this step, the weight of each node in each level is calculated, and they are used to connect to obtain the weight matrix of each level.

[0079] Specifically, the weight matrix of each level is expressed by the following formula:

[0080]

[0081] Among them, W t is the weight matrix of the tth level, is the weight of the i-th node at the t-th level, 1≤i≤n, n is the number of nodes in the graph, is the node feature matrix X after the t-th level feature aggregation t The feature of the i-th node in [X t ] i The feature [X] of the i-th node in the initial node feature matrix X i The cosine similarity between them, L is the number of levels, and diag represents the formation of a diagonal matrix.

[0082] Then, the node feature matrix is ​​combined using the weight matrix to retain the node discrimination as much as possible, that is, to retain the personalized features, and the combined feature X is obtained. ′ , and its calculation formula is:

[0083]

[0084] Among them, X ′ is the combined feature, L is the number of levels, W t is the weight matrix of the tth level, X t It is the node feature matrix after the t-th level feature aggregation.

[0085] In this step, by balancing the aggregation of neighborhood information with the preservation of these personalized features, the distinguishability of node embeddings can be maintained, ensuring that nodes with different roles or positions in the graph remain distinguishable even in deeper networks. This approach helps resolve the trade-off between capturing global structure and preserving local information of specific nodes, ultimately improving the robustness and expressiveness of the method.

[0086] Step S3: Combine the features X ′ The input is sent to the encoder for community feature extraction to obtain the node embedding matrix Z.

[0087] Here, the encoder Encoder is an MLP encoder, which is expressed by the following formula:

[0088] Z=Encoder(X ′ )

[0089] Furthermore, the encoder is a trained encoder, and the loss function used in the training process is:

[0090] L=L1+L2

[0091] Among them, L is the loss function, L1 is the first loss function, and L2 is the second loss function.

[0092] Here, the first loss function L1 is used to reduce the distance between similar node pairs, and the second loss function L2 is used to expand the distance between different cluster centers.

[0093] The core idea of ​​applying the loss function is to guide the optimization of parameters in the encoder by "reducing the distance between similar node pairs" and "enlarging the distance between different cluster centers" based on the feature embedding space. Finally, the trained encoder can obtain a high-quality node embedding matrix.

[0094] Specifically, the first loss function L1:

[0095]

[0096] pos={(i,j)|(i,j)∈Top_α(S)}

[0097]

[0098] Among them, pos is a node pair set, i, j are two nodes in the node pair, Top_α(S) is a set of the first α node pairs with the highest similarity values ​​selected from the similarity matrix S, and the setting of α is selected according to the actual situation and is not specifically limited. Z is the node embedding matrix, Z T is the transpose of Z, is the square of the 2-norm; σ is the sigmoid activation function, s ij is the similarity value of the node pair (i, j).

[0099] Here, the first loss function L1 is set to optimize the parameters by bringing node pairs with high similarity close to each other. As the optimization proceeds, node pairs with higher similarity scores are further selected. Considering the large number of node pairs, batch training techniques are used in the actual calculation.

[0100] Specifically, the second loss function L2 is constructed in the following way:

[0101] The node embedding matrix Z output by the encoder during the training process is clustered, all nodes in the node embedding matrix Z are divided into multiple categories, and the initial cluster center of each category is determined; the node embedding matrix Z includes the embedding features of multiple dimensions of each node; here, the K-means clustering method can be used for clustering.

[0102] The distance between each node in each category and the initial cluster center of the category is calculated, and the first β% nodes with the smallest distance are selected according to the distance to form a reliable set corresponding to the category; the setting of β is selected according to the actual situation and is not specifically limited.

[0103] Calculate the mean of the embedded features of all nodes in the reliable set corresponding to each category as the new cluster center;

[0104] According to the new cluster center, construct the second loss function L2:

[0105]

[0106] Among them, k1 and k2 are the labels of different categories, K is the number of categories, and h k1 is the new cluster center corresponding to category k1, h k2 is the new cluster center corresponding to category k2, ‖‖2 is the 2-norm, <h k1 ,h k2 > for h k1 ,h k2 The inner product of .

[0107] Here, we first perform K-means clustering on Z to obtain preliminary classification results. Then, we calculate the average value of the embedded features of all nodes in each category as its initial cluster center. In order to obtain more reliable results, we calculate the distance between each node and its initial cluster center. Then, we sort the nodes according to the distance, and select the top β% of nodes (called highly reliable nodes) to form a reliable set corresponding to the category. We calculate the average value of the embedded features of all nodes in the reliable set corresponding to each category as the new cluster center.

[0108] Specifically, during the training process, the learning rate of the optimizer is 0.001, the number of iterations is 100, and the embedding dimension is 500 dimensions.

[0109] In this step, parameter optimization is guided from the perspective of the embedding space to extract community features. Different from capturing global features and personalized features of nodes, community features focus on the commonalities between nodes in the same class or cluster. Community features refer to features extracted to facilitate clustering nodes belonging to the same class into a single cluster. These features are designed to capture the similarities between nodes in the same group while effectively distinguishing the differences between different groups. Community features help enhance the network's ability to identify and maintain internal clusters, thereby improving the performance of tasks such as node clustering in graphs.

[0110] In order to further verify the feasibility and effectiveness of the method of this application, the following examples and performance analysis are given.

[0111] In the experiment, this application is compared with the following 7 existing algorithms:

[0112] 1. K-means: A basic node clustering method, many advanced clustering algorithms are based on it.

[0113] 2. Spectral: Spectral clustering uses the cosine similarity of node features as input for clustering. This method is widely used in node clustering tasks.

[0114] 3. GAE&VGAE: A node representation method that combines graph convolutional networks with (variational) autoencoders and optimizes the reconstruction of the adjacency matrix.

[0115] 4. AGE: A Laplace smoothing filter is designed and an adaptive encoder is used to obtain better node embeddings.

[0116] 5. DNENC: is an unsupervised node clustering method with deep neighbor-aware embedding combined with graph attention autoencoder.

[0117] 6. GALA: Introduces a symmetric graph convolutional autoencoder designed to reconstruct the feature matrix.

[0118] 7. CCGC: It is a clustering-guided contrastive learning clustering network that solves this problem from a multi-view perspective.

[0119] Among these 7 methods, the first two are basic methods.

[0120] Downstream tasks and their performance indicators:

[0121] (1) Node clustering

[0122] The node clustering task aims to discover potential communities or groups in a graph by analyzing the embedded representation of nodes, identifying the similarities between nodes, and grouping similar nodes into the same cluster.

[0123] Commonly used performance indicators include Clustering Accuracy (ACC), Normalized Mutual Information (NMI), and Adjusted Rand Index (ARI). Clustering Accuracy evaluates the degree of match between clustering results and true labels, Normalized Mutual Information measures the mutual information between clustering and true labels and standardizes the clustering results, while Adjusted Rand Index evaluates clustering performance by calculating the proportion of correctly classified samples. These indicators can fully reflect the performance of the model in node clustering tasks.

[0124] (2) Link Prediction

[0125] The link prediction task is based on the node embedding matrix to predict the potential node connection relationship in the graph, that is, to predict the probability that there are edges connecting the nodes.

[0126] Commonly used performance indicators include AUC (Area Under the ROC Curve) and AP (Average Precision). AUC measures the model's ability to distinguish between positive and negative samples. The closer the value is to 1, the better the model's prediction performance. AP evaluates the overall prediction accuracy of the model by calculating the area of ​​the precision-recall curve under different thresholds. These indicators can effectively evaluate the performance of the model in link prediction tasks.

[0127] Datasets and model structures used in the experiment:

[0128] As shown in Table 1, experiments are conducted on four widely used network datasets: Cora, Citeseer, Pubmed, and Wiki. The first three are citation networks, where nodes represent research papers and edges represent citations between papers. Wiki is a web page dataset, where nodes represent web pages and edges represent hyperlinks between them. The statistics of the datasets are shown in Table 1.

[0129] Table 1

[0130]

[0131] Main experimental results:

[0132] The node clustering results are shown in Table 2, where bold indicates the maximum value and underline indicates the second highest value. The results show that the method of this application achieves the best performance. The reason is that the aggregate features from different layers can be effectively combined and community features can be continuously extracted. This method outperforms most methods on four datasets with 3 indicators. Taking the results on the Wiki dataset as an example, the ACC, NMI and ARI indicators of the method proposed in this application are 4.5%, 3.7% and 4.2% higher than the second place.

[0133] Table 2

[0134]

[0135] The experimental results of link prediction are shown in Table 3. It can be observed that despite not explicitly utilizing the adjacency matrix reconstruction loss, our method still achieves good performance. This shows that our method effectively captures the basic structural information required for accurate link prediction, demonstrating its robustness and applicability in various graph-related tasks.

[0136] Table 3

[0137]

[0138] Ablation experiment results:

[0139] (1) Effectiveness of each module

[0140] Ablation studies were performed on the Cora and Citeseer datasets, and the results are shown in Table 4. “Raw” represents the initial node feature X; “Raw+GI” represents the combined feature X ’ , obtained by the global feature capture step and the personalized feature retention step. “Raw+GIG” represents the node embedding matrix Z, which is obtained by adding the community feature enhancement step. Compared with the initial feature, the combined feature X ’ The intermediate layer information is integrated, so the performance on node clustering is better. ’ In comparison, node embedding Z extracts more features, so it achieves the best performance. From Table 4, it can be clearly observed that each part of the proposed method contributes to the final performance, which proves their effectiveness.

[0141] This application visualizes the Cora and Citeseer datasets in two-dimensional space by applying the t-SNE algorithm. t-SNE is a widely used algorithm for projecting high-dimensional data into two-dimensional space for visualization. Figure 3The visualization results of node embedding at each stage are shown, where (a), (b) and (c) are the visualization results of the initial feature matrix, combined features and node embedding matrix on the Cora dataset, respectively; (d), (e) and (f) are the visualization results of the initial feature matrix, combined features and node embedding matrix on the Citeseer dataset, respectively. Figure 3 The combined feature X can be found in ’ A preliminary grouping structure can be obtained, and then with the introduction of the community feature enhancement step, the overlapping area is gradually reduced and the connection within the community is closer, thus obtaining a clearer and more accurate clustering result.

[0142] Table 4

[0143]

[0144] (2) Effectiveness of weight strategy

[0145] This application compares the traditional polymerization method with the combined method of this application. Figure 4 The comparison diagram of the combined method of the present application and the traditional polymerization method is shown, wherein (a) is the traditional polymerization method and (b) is the combined method of the present application. Figure 5 , Figure 6 shown. Figure 5 shows the combined feature X ′ The relationship between the clustering accuracy and the number of hops, where (a) is the change relationship diagram corresponding to the Cora dataset, and (b) is the change relationship diagram corresponding to the Citeseer dataset. Figure 6 The graphs show the relationship between the clustering accuracy of the node embedding matrix Z and the number of hops, where (a) is the corresponding graph of the Cora dataset and (b) is the corresponding graph of the Citeseer dataset. Figure 5 The orange dashed line in the middle represents the X obtained by the traditional polymerization method. ’ The blue dashed line represents the clustering accuracy of X obtained by the combined method of this application. ’ Obviously, the method of this application is more accurate in X ’ It should be noted that at this stage, X ’ The feature dimension of is the same as the initial feature dimension of the dataset. Figure 6 In the figure, the orange solid line represents the clustering accuracy of Z obtained by the traditional aggregation method, and the blue solid line represents the clustering accuracy of Z obtained by the combination method of the present application. It can be seen that the method of the present application also achieves excellent performance in the final node embedding. It should be noted that at this stage, the feature dimension of Z obtained by both methods is 500.

[0146] In addition, the personalized feature retention step of the present application can also alleviate the over-smoothing phenomenon. Figure 5 and Figure 6 It is shown that "Tradition" performs poorly because it only uses the aggregated features of the last layer. As the number of layers increases, it will learn indistinguishable node embeddings and cause over-smoothing problems, resulting in a decrease in clustering accuracy. On the other hand, the method of this application is less affected, retains the distinction between nodes, and can still maintain a high clustering accuracy as the number of layers increases. This is due to the "strategic integration of intermediate layer features with carefully assigned weights." These individual features are retained intermediate representations that are actively used to preserve and emphasize the different features of each node.

[0147] (3) Trend of weight changes

[0148] To better understand the trend of parameter changes, the parameter changes in Cora and Citeseer are visualized. Figure 7 The graphs show the changing trend of node weights with the number of hops, where (a) is the changing trend graph corresponding to the Cora dataset, and (b) is the changing trend graph corresponding to the Citeseer dataset. It should be noted that this application calculates the parameter changing trend of all nodes and randomly selects 5 nodes for display. The changes on other nodes are similar. Figure 7 As can be seen from the figure, the value of the parameter is getting smaller and smaller. This is because the deeper the number of layers, the more likely it is that there will be over-smoothing problems. Therefore, the nodes of these layers should be given lower weights. Otherwise, it will also cause over-smoothing to a certain extent.

[0149] (4) Comparison of loss functions

[0150] The loss function designed in this application consists of two components, L1 and L2. In order to verify the effectiveness of the loss function proposed in this application, comparative experiments were carried out on the Cora and Citeseer datasets, and the performance was compared with the widely used adjacency matrix reconstruction loss. All other parameters were kept consistent in the experiment. The results show that compared with the model trained based on the reconstruction loss, the model using the loss function of this application showed significant improvements in indicators such as clustering accuracy (ACC), normalized mutual information (NMI) and adjusted Rand index (ARI), which fully demonstrated the effectiveness and superiority of the loss function of this application. Figure 8 The comparison of clustering accuracy of different loss functions is shown, where (a) is the comparison of the Cora dataset and (b) is the comparison of the Citeseer dataset. Compared with the reconstruction loss, the model using the loss function of this application achieved an improvement of 2.2%, 3.4% and 3% on the Cora dataset, and an improvement of 1.8%, 2.3% and 1.9% on the Citeseer dataset.

[0151] (5) Impact of embedding dimension

[0152] In order to verify the impact of different embedding dimensions on the node clustering performance, experiments were conducted with the embedding dimensions ranging from 100 to 600. Fig. 9 The influence of different embedding dimensions on node clustering performance is shown, where (a) is the influence of the Cora dataset and (b) is the influence of the Citeseer dataset. The method of the present application shows extremely low sensitivity to changes in embedding dimension, and performance fluctuations are always kept within 1%. This shows that the choice of embedding dimension has no significant impact on model performance, further proving the effectiveness and robustness of the method in dealing with different dimensional configurations, reflecting its flexibility under various embedding sizes.

[0153] In summary, this application can significantly enrich the representation capabilities of nodes. A large number of experiments on four different data sets have demonstrated the effectiveness of the method of this application. Further supplementary experiments have also verified the key role of each step in improving model performance.

[0154] Based on the same inventive concept as the node representation method with both personalized and global features in a social network, this embodiment also provides a corresponding node representation device with both personalized and global features in a social network, including:

[0155] The global feature extraction module is used to calculate the Laplace smoothing filter according to the adjacency matrix of the graph, and perform multi-level feature aggregation on the initial node feature matrix based on the Laplace smoothing filter to obtain the node feature matrix after each level of feature aggregation; the node feature matrix after the last level of feature aggregation is the global feature;

[0156] A personalized feature retention module is used to calculate the weight matrix of each level based on the node feature matrix after the features of each level are aggregated; and to calculate the combined features of the personalized features retained according to the weight matrix of each level;

[0157] The community feature extraction module is used to input the combined features into the encoder for community feature extraction to obtain the node embedding matrix.

[0158] The node representation device with both personalized and global characteristics in a social network of this embodiment has the same inventive concept as the node representation method with both personalized and global characteristics in the above social network. Therefore, the specific implementation method of the device can be seen in the implementation example part of the node representation method with both personalized and global characteristics in a social network in the above text, and its technical effect corresponds to the technical effect of the above method, which will not be repeated here.

[0159] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the node representation method with both personalized and global characteristics in the above-mentioned social network.

[0160] An embodiment of the present application provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, the method for representing nodes in a social network having both personalized and global features is implemented.

[0161] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A node representation method with both personalized and global features in a social network, characterized in that: include: A Laplace smoothing filter is calculated based on the adjacency matrix of the graph, and multi-level feature aggregation is performed on the initial node feature matrix based on the Laplace smoothing filter to obtain a node feature matrix after each level of feature aggregation; the node feature matrix after the last level of feature aggregation is the global feature; Calculate the weight matrix of each level based on the node feature matrix after the features of each level are aggregated; calculate the combined features that retain the personalized features according to the weight matrix of each level; The combined features are input into the encoder to extract community features and obtain a node embedding matrix.

2. The method according to claim 1, characterized in that in, The Laplace smoothing filter is calculated based on the adjacency matrix of the graph using the following formula: P=I-λL sym Among them, P is the Laplace smoothing filter, I is the unit matrix, λ is a real number, L sym is the symmetric normalized graph Laplacian matrix, is the adjacency matrix of a graph with self-loops, for The corresponding degree matrix, is the Laplacian matrix of a graph with self-loops.

3. The method according to claim 1, characterized in that in, Based on the Laplace smoothing filter, the initial node feature matrix is ​​subjected to multi-level feature aggregation to obtain the node feature matrix after feature aggregation at each level, using the following formula: X t =PX t-1 Among them, x t is the node feature matrix after the t-th level feature aggregation, P is the Laplace smoothing filter, X t-1 is the node feature matrix after the t-1th level feature aggregation; when t = 1, X t-1 is the initial node feature matrix.

4. The method according to claim 1, characterized in that The weight matrix of each level is expressed by the following formula: Among them, W t is the weight matrix of the tth level, is the weight of the i-th node at the t-th level, 1≤i≤n, n is the number of nodes in the graph, is the node feature matrix X after the t-th level feature aggregation t The feature of the i-th node in [X t ] i The feature [X] of the i-th node in the initial node feature matrix X i The cosine similarity between them, L is the number of levels, and diag represents the formation of a diagonal matrix.

5. The method according to claim 1, characterized in that The combined features are: Among them, X′ is the combined feature, L is the number of levels, and W t is the weight matrix of the tth level, X t It is the node feature matrix after the t-th level feature aggregation.

6. The method according to claim 1, characterized in that The encoder is a trained encoder, and the loss function used in the training process is: L=L1+L2 Among them, L is the loss function, L1 is the first loss function, and L2 is the second loss function; The first loss function L1: pos={(i,j)|(i,j)∈Top_α(S)} Among them, pos is a node pair set, i, j are two nodes in a node pair, Top_α(S) is a set of the first α node pairs with the highest similarity values ​​selected from the similarity matrix S, Z is a node embedding matrix, Z T is the transpose of Z, is the square of the 2-norm; σ is the sigmoid activation function, s ij is the similarity value of node pair (i, j); The second loss function L2 is constructed in the following way: Clustering the node embedding matrix Z output by the encoder during the training process, dividing all nodes in the node embedding matrix Z into multiple categories, and determining the initial cluster center of each category; the node embedding matrix Z includes embedding features of multiple dimensions of each node; Calculate the distance between each node in each category and the initial cluster center of the category, and select the first β% nodes with the smallest distance according to the distance to form a reliable set corresponding to the category; Calculate the mean of the embedded features of all nodes in the reliable set corresponding to each category as the new cluster center; According to the new cluster center, the second loss function L2 is constructed: Among them, k1 and k2 are the labels of different categories, K is the number of categories, and h k1 is the new cluster center corresponding to category k1, h k2 is the new cluster center corresponding to category k2, ‖‖2 is the 2-norm, <h k1 ,h k2 > for h k1 ,h k2 The inner product of .

7. The method according to claim 1, characterized in that The encoder is an MLP encoder.

8. A node representation device with both personalized and global features in a social network, characterized in that: include: A global feature extraction module is used to calculate a Laplace smoothing filter according to the adjacency matrix of the graph, and perform multi-level feature aggregation on the initial node feature matrix based on the Laplace smoothing filter to obtain a node feature matrix after each level of feature aggregation; the node feature matrix after the last level of feature aggregation is the global feature; A personalized feature retention module, used to calculate the weight matrix of each level based on the node feature matrix after the features of each level are aggregated; and to calculate the combined features of the personalized features according to the weight matrix of each level; The community feature extraction module is used to input the combined features into the encoder to extract community features and obtain a node embedding matrix.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the node representation method with both personalized and global characteristics in a social network as described in any one of claims 1 to 7.

10. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the node representation method having both personalized and global characteristics in a social network as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Group identification method, system and device based on comparative learning and medium

    CN120929867A