Community-aware graph masked autoencoding learning method, system and storage medium

By introducing community structure information and multi-task decoding strategies into the graph masked autoencoder, the problem of ignoring community structure in the existing technology is solved, achieving higher quality and efficient graph representation learning and reconstruction, and is suitable for a variety of graph analysis Task.

CN117973445BActive Publication Date: 2024-10-18HUBEI UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410249285.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-05
Publication Date
2024-10-18
Estimated Expiration
2044-03-05

AI Technical Summary

Technical Problem

Existing graph masked autoencoders ignore the rich semantic information in community structures when learning graph representations, resulting in models lacking interpretability and accuracy when processing complex graph data.

Method used

By introducing community structure information into the GAE framework, adopting community-guided edge masking and node feature masking, and using GNN in the autoencoder for multi-task decoding, supplemented by a dynamic loss function, additional valuable information is extracted to enhance graph reconstruction , and preserve graph topology and semantic information in tasks such as node classification, link prediction, and graph classification.

Benefits of technology

It significantly improves the quality and efficiency of graph representation learning, can better understand and retain community structure information in graphs, enhances graph reconstruction capabilities and model generalization performance, and is suitable for a variety of graph analysis tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117973445B_ABST
    Figure CN117973445B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of neural network models, and discloses a community-aware graph masked autoencoding learning method, system and storage medium, wherein the community-aware graph masked autoencoding learning method introduces community structure information into the GAE framework and maintains the influence of the community during the learning process; adopts community-guided edge masking and node feature masking; uses GNN in the autoencoder for multi-task decoding, and supplemented by a dynamic loss function, extracts additional valuable information from the original data for enhanced graph reconstruction; on multiple downstream tasks such as node classification, link prediction and graph classification, ComMGAE retains graph topology and semantic information when learning graph representation. The goal of the present invention is to identify the weaknesses of existing GAE designs and improve related work in graph representation learning for application to downstream tasks such as link prediction and node or graph classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of neural network models, and in particular relates to a community-awareness-based graph masked autoencoding learning method, system and storage medium. Background Art

[0002] At present, the Graph Masked Autoencoder (GAE) is an advanced graph neural network model specifically designed to solve the automatic encoding task of graph data. Compared with traditional autoencoders, GAE pays more attention to processing complex graph structure data, such as graph data commonly found in social networks, bioinformatics, and recommendation systems. Its core goal is to learn the potential representation of nodes in the graph in order to capture the relationship between nodes and the global characteristics of the entire graph. GAE has a wide range of application areas, including social network analysis, protein interaction prediction in bioinformatics, and modeling of relationships between users and items in recommendation systems. By capturing the hidden patterns of graphs, GAE provides researchers and engineers with a powerful tool to more deeply understand and fully utilize the information in graph structured data. The use of a masking mechanism to perform the encoding process of graph data enables the model to effectively process graphs with complex topological structures. The model can also selectively focus on specific relationships in the graph, thereby learning the representations between nodes more accurately. This flexible approach enables GAE to adapt to graph data of various sizes and complexities, providing a powerful and adjustable solution for graph learning tasks.

[0003] Recently, some GAE-based techniques have been explored in graph learning. For example, MGAE sets a high masking rate on edges and adopts a cross-correlation decoder, which is a new type of competitor to graph contrastive learning. GraphMAE proposes a more complex decoder and re-masking mechanism to outperform graph contrastive learning. In addition, MaskGAE is the first method to adopt path masks to learn long-range dependencies to achieve high accuracy in downstream tasks such as link prediction and node or graph classification. Although these models have demonstrated strong performance, they have largely ignored the impact of community structure on graph learning.

[0004] Communities are widely used in social networks and various large-scale complex networks. This is because they can greatly improve the interpretability of the model due to the rich information mined from the graph data. Communities represent the high-order structure of the graph, which is characterized by a set of densely connected nodes. The edge density within the community is usually much greater than the edge density outside the community. Since the structure of the community is a concrete manifestation of semantics, its underlying structure has a high amount of information. For example, in social networks, communities can represent different groups of friends; in shopping networks, communities can show customers' common interests in multiple categories. Some other models try to integrate the influence of communities in graph representation learning to improve accuracy, but the community information is not fully protected during the learning process, and the models are still mainly involved in localized learning.

[0005] Through the above analysis, the problems and defects of the existing technology are as follows: Self-supervised learning technology, especially in the field of graph analysis, has witnessed significant progress driven by the emergence of graph autoencoders (GAE). These models show significant efficacy even without using graph enhancement methods. However, the main focus of existing GAE architectures on attribute reconstruction and decoding strategies often ignores the rich semantic information encapsulated in the community structure of the graph. This critical supervision emphasizes the necessity of new methods that seamlessly integrate community semantics into the self-supervised learning paradigm of graphs. Summary of the invention

[0006] In view of the problems existing in the prior art, the present invention provides a graph masked self-encoding learning method, system and storage medium based on community awareness.

[0007] The present invention is implemented as follows: a community-aware graph masked autoencoding learning method comprises the following steps:

[0008] The first step is to introduce community structure information into the GAE framework and maintain the influence of the community during the learning process; community-guided edge masking and node feature masking are used;

[0009] In the second step, GNN is used in the autoencoder for multi-task decoding, supplemented by a dynamic loss function, to extract additional valuable information from the original data for enhanced image reconstruction.

[0010] In the third step, on multiple downstream tasks such as node classification, link prediction, and graph classification, ComMGAE retains graph topology and semantic information when learning graph representation.

[0011] Furthermore, the community-aware graph masked autoencoding learning method uses a community detection algorithm to divide the community structure and calculate the community strength; by effectively mining community information from graph data, the interpretability of the model is improved.

[0012] Furthermore, the community-aware graph masked autoencoder learning method adopts a community-aware masked graph autoencoder ComMGAE, a new masking strategy that destroys the links and attributes of the community, and simultaneously masks and reconstructs the edge and node attributes; uses a graph neural network GNN; and utilizes scaled cosine error SCE as the loss function for feature reconstruction.

[0013] Furthermore, the ComMGAE model based on the community-aware graph masked autoencoding learning method incorporates the influence of community structure into graph representation learning, preserves the community structure, and improves related work in graph representation learning for application to downstream tasks, link prediction, and node or graph classification.

[0014] Furthermore, the ComMGAE model of the community-aware graph masked autoencoding learning method consists of four components;

[0015] Masking: Calculate the community strength through the results of community detection and guide the attributes and structure of the graph to be masked;

[0016] Encoding: Encode the masked attributes and graphs into low-level vectors;

[0017] Decoding: includes attribute decoding and structure decoding. The attribute decoder decodes the encoded vector back to the original attribute. The structure decoder decodes the original image through the masked image and attribute information. Both use the encoder output as input.

[0018] Reconstruction: Compare the decoded attributes and structure with the original information and calculate the loss, continuously updating the encoder and decoder until the masked information can be restored to the greatest extent.

[0019] Furthermore, the mask module comprises:

[0020] Community Detection,Community structures are ubiquitous in graph data. Community detection algorithms,evaluate the degree of clustering or division of node groups,and their cohesion or separation tendencies.,The modularity H is selected to evaluate the effect of,community division, which is defined as follows:

[0021]

[0022] Among them, E c is the set of edges belonging to community c, η>0 is the resolution parameter, the larger η is, the more communities are obtained, and combo is used to detect communities according to the modularity. to divide the community;

[0023] Community connectivity strength, community connectivity strength S of community c c Defined as:

[0024]

[0025] It is composed of the ratio of edges of community c in the whole graph and the ratio of degree of community c;

[0026] Graph data masking calculates the edge weights and node weights of the entire graph based on community connectivity, as shown below:

[0027] W n =Φ(norm(XIS),τ),

[0028]

[0029] W e =norm(II T S),

[0030] Where norm(x)=(x min ) / (x max -x min ) is the maximum and minimum normalization operation, I is the indicator matrix, if Then I (i,c) =1, otherwise I (i,c) = 0, τ is the threshold for node shielding, and the shielding strategy is to sample a part of the edges from the original graph according to the Bernoulli distribution. and nodes

[0031]

[0032] The sampled edges will be removed from the original graph And construct a new graph using the remaining edges At the same time, the sampled node attributes are set to zero or overwritten with the attributes of other nodes, resulting in the masked node attributes. Masked image

[0033] Coding module, including:

[0034] The encoder maps the masked graph structure and node attributes to a low-dimensional representation containing more compressed information through a GNN network, as shown below:

[0035]

[0036] At the same time, the encoder uses a multi-head attention mechanism to capture more semantic information;

[0037] Decoding module, including:

[0038] Attribute Decoder,The attribute decoder attempts to map the latent codes back to the original attributes,,and its formula is:

[0039]

[0040] A single-layer GNN was selected as the attribute decoder;

[0041] structure decoder, structure decoder Try to reconstruct the edge of the mask through the potential feature Z, use link prediction as a proxy task to perform edge prediction, and there are also many types of structural decoders to choose from. Defined as:

[0042]

[0043] Where MLP represents a multi-layer perceptron;

[0044] After randomly sampling the edges, we obtain the positive edge set E in the graph. + and the negative edge set E that is not in the graph - ,Then find the two feature vectors corresponding to the nodes of each edge in the learned node feature Z, input the paired features into the structure decoder for learning, and the learned results will be used to calculate the loss of the model;

[0045] Refactoring modules, including:

[0046] Reconstruction is divided into attribute reconstruction and structure reconstruction. The learning goal of attribute reconstruction is to make the reconstructed attribute X′ and the original attribute X as similar as possible. MSE loss is used as the loss function, and the improved reconstruction loss SCE is selected as the loss function. The formula is:

[0047]

[0048] Where γ is the training scaling factor, and different scaling sizes are adjusted for different data sets. The learning objectives of the structure reconstruction are as follows:

[0049]

[0050] Where E + and E - are the sampled positive and negative edges, v is the nodes at both ends of the edge, Z is the representation learned by the encoder, and the total loss of the model is:

[0051]

[0052] Among them, α is the reconstruction adjustment parameter, in order to better balance the structural information and attribute information in the entire training process.

[0053] Another object of the present invention is to provide a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the community-aware graph masked self-encoding learning method.

[0054] Another object of the present invention is to provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the community-aware graph masked self-encoding learning method.

[0055] Another object of the present invention is to provide an information data processing terminal, which is used to implement the community-awareness-based graph masked self-encoding learning method.

[0056] Another object of the present invention is to provide a community-aware graph masked self-encoding learning system for implementing the community-aware graph masked self-encoding learning method, wherein the community-aware graph masked self-encoding learning system comprises:

[0057] The framework introduction module is responsible for introducing community structure information into the GAE framework and maintaining the influence of the community during the learning process; it adopts community-guided edge masking and node feature masking;

[0058] The task decoding module is responsible for multi-task decoding using GNN in the autoencoder, supplemented by a dynamic loss function to effectively extract additional valuable information from the original data for enhanced graph reconstruction;

[0059] The information preservation module is responsible for retaining the graph topology and semantic information when learning graph representation in multiple downstream tasks such as node classification, link prediction, and graph classification.

[0060] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0061] First, the graph representation learning (GRL) of the present invention is a field of computer science that studies the mapping of graph data into low-dimensional continuous vector space. Its goal is to transform the complex topological structure and association relationship of graph data into a vector form with mathematical expression by learning the embedded representation of nodes and edges in the graph structure.

[0062] In real-world graphs, node label information may be incomplete or missing. In this case, how to effectively learn the representation of nodes without relying on complete label information is a challenging problem. Unsupervised GRL learning methods can capture the structural information of the graph by optimizing algorithms and finding patterns between known data to change the positions of nodes in the graph in the embedding space. As a representative of them, GAE can effectively preserve the topological structure of the graph, so that the similarities and differences in the embedded vectors can reflect the intrinsic characteristics of the graph, providing more meaningful features for subsequent graph analysis and machine learning tasks.

[0063] Second, the present invention introduces community structure information into the GAE framework and maintains the influence of the community during the learning process; a new masking strategy is proposed, called community-guided edge masking and node feature masking. The idea of ​​masking is mainly to fill in the masked data in the original data so that the model can learn the masked information. The traditional method usually randomly masks part of the content to let the model learn the overall semantics of the original data, while masking the data at a specific position can force the model to learn the semantics or rules of the specified position. Similar to a cloze test, the mask module can be used to randomly remove a certain proportion of words in an article and then let the encoder restore the original text to learn the original text semantics. We can also use the mask module to remove words in key positions to enable the decoder to learn the key semantics more efficiently. The community just contains this kind of key semantics, so we can force the model to learn more original community semantics by setting a higher mask rate on key positions with stronger connectivity; GNN is used in the autoencoder for multi-task decoding, assisted by a dynamic loss function to effectively extract additional valuable information from the original data for enhanced graph reconstruction; rich experience in multiple downstream tasks such as node classification, link prediction, and graph classification shows that ComMGAE effectively retains the graph topology and semantic information when learning graph representation.

[0064] Third, the expected benefits and commercial value of the technical solution of the present invention after transformation are as follows: The expected benefits and commercial value of the present invention are mainly reflected in the following aspects:

[0065] Personalized recommendations and targeted advertising: The present invention can more accurately understand the user's behavior and interests, thereby achieving personalized recommendations and targeted advertising. This can improve user satisfaction and click-through rate, thereby increasing advertising revenue and sales.

[0066] Knowledge graph and intelligent search: The present invention can better understand the entities and relationships in the knowledge graph, thereby supporting intelligent search and question-answering systems. This can improve the accuracy of search engines and user experience, increase user stickiness and search advertising revenue.

[0067] Social network analysis and influence inference: This invention can analyze user behaviors and relationships in social networks to identify influential users and communities. This can help companies better understand user needs and market trends, and improve the effectiveness of social media marketing and user engagement.

[0068] Bioinformatics and drug discovery: The present invention can be used to analyze protein interactions and gene regulatory relationships in biological networks, thereby identifying potential drug targets and treatment methods. This can accelerate the drug development process, reduce R&D costs, and increase the success rate of new drugs on the market.

[0069] Network security and threat detection: Through the present invention, abnormal patterns and behaviors in the network can be analyzed to identify potential security threats and attacks. This can improve the effectiveness and response speed of network security and reduce data leakage and loss.

[0070] In summary, the present invention has wide commercial applications and value, and can help enterprises improve operational efficiency, reduce costs, increase revenue, and gain competitive advantages in various fields.

[0071] The technical solution of the present invention fills the technical gap in the industry at home and abroad: Since the existing graph autoencoder methods lack consideration of community semantics, the present invention proposes a ComMGAE framework that integrates community information into the graph autoencoder. Specifically, the framework first partitions the community structure and calculates the community strength. Subsequently, a masking strategy is designed based on the community strength, and the encoding and decoding processes are performed. Modularity is used as a weight to guide the mask. The proposed method can be applied to different downstream tasks, such as node classification, link prediction, and graph classification. At the same time, sufficient cases are provided to demonstrate the effectiveness of the proposed method. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 is a flow chart of a community-aware graph masked self-encoding learning method provided by an embodiment of the present invention;

[0073] Figure 2 It is a community detection and community calculation graph provided by an embodiment of the present invention;

[0074] Figure 3 is a complete system architecture diagram provided by an embodiment of the present invention;

[0075] Figure 4 It is a structural decoding module diagram provided by an embodiment of the present invention;

[0076] Figure 5 It is a schematic diagram of the structure of a community-aware graph masked autoencoding learning system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0077] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0078] like Figure 1 As shown, the community-aware graph masked self-encoding learning method provided by an embodiment of the present invention includes the following steps:

[0079] S101: Introduce community structure information into the GAE framework and maintain the influence of the community during the learning process; adopt community-guided edge masking and node feature masking;

[0080] S102: Use GNN for multi-task decoding in autoencoders, supplemented by dynamic loss functions, to effectively extract additional valuable information from raw data for enhanced graph reconstruction;

[0081] S103: On multiple downstream tasks such as node classification, link prediction, and graph classification, ComMGAE preserves graph topology and semantic information when learning graph representations.

[0082] The proposed community-aware graph masked autoencoder learning method (ComMGAE) achieves efficient learning and representation of graph data by introducing community structure information into the graph autoencoder (GAE) framework. The following is the detailed working principle of the method and its significant technical progress:

[0083] 1) Introduction of community structure information (S101):

[0084] Community-guided edge masking: By identifying the community structures in the graph and masking the edges based on these community structures, the model is able to focus on the connection patterns within the community while maintaining the influence between communities during the learning process. This approach helps the model understand and preserve the community structure characteristics in the graph.

[0085] Node feature masking: At the same time, by masking the features of the nodes, the model is forced to learn to recover the node features from other nodes and edge information, further enhancing the model's ability to understand the graph structure.

[0086] 2) Multi-task decoding of GNN (S102):

[0087] Using a graph neural network (GNN) as a decoder in the autoencoder can effectively process graph structure data and preserve the topological relationship between nodes. By training GNN on multiple tasks, it can not only extract the topological structure of the graph from the original data, but also capture additional valuable information for graph reconstruction tasks.

[0088] Dynamic loss function: A dynamic loss function is used to balance the task weights in the multi-task learning process, ensuring that the model can effectively learn on different tasks, enhancing the model's generalization ability and performance on multiple downstream tasks.

[0089] 3) Application on multiple downstream tasks (S103):

[0090] Applications on tasks such as node classification, link prediction, and graph classification show that ComMGAE performs well in preserving graph topology and semantic information, which indicates that the method is capable of generating high-quality graph representations that are useful for a variety of graph analysis tasks.

[0091] Significant technological advancements:

[0092] 1) Effective use of community structure information:

[0093] By introducing community information into the GAE framework, ComMGAE is able to better understand and preserve the community structure in the graph, which is difficult to achieve with traditional graph learning methods. This approach improves the quality of graph representation, especially in representing community relationships in the graph.

[0094] 2) Enhanced image reconstruction capabilities:

[0095] Through community-guided edge masking and node feature masking, combined with GNN's multi-task decoding, ComMGAE can effectively enhance graph reconstruction capabilities. This not only helps to generate more accurate graph representations, but also extracts more valuable information from raw data.

[0096] 3) Innovative application of dynamic loss function:

[0097] A dynamic loss function is used to balance the task weights in multi-task learning, which effectively improves the performance of the model on multiple downstream tasks. This method provides a flexible and effective way to deal with the challenges of multi-task learning.

[0098] 4) Generalization ability of multi-task learning:

[0099] ComMGAE performs well on multiple downstream tasks such as node classification, link prediction, and graph classification, demonstrating its strong generalization ability. This proves that ComMGAE can not only provide high-quality graph representation, but also be widely used in a variety of graph analysis tasks.

[0100] In summary, the ComMGAE method of the present invention significantly improves the learning efficiency and representation quality of graph data by innovatively integrating community structure information, multi-task GNN decoding and dynamic loss function, providing an efficient and general solution for graph data analysis.

[0101] Graph Representation Learning (GRL) is a field of computer science that studies the mapping of graph data into low-dimensional continuous vector space. Its goal is to transform the complex topological structure and association relationship of graph data into a vector form with mathematical expression by learning the embedded representation of nodes and edges in the graph structure.

[0102] In real-world graphs, node label information may be incomplete or missing. In this case, how to effectively learn the representation of nodes without relying on complete label information is a challenging problem. Unsupervised GRL learning methods can capture the structural information of the graph by optimizing algorithms and finding patterns between known data to change the positions of nodes in the graph in the embedding space. As a representative of them, GAE can effectively preserve the topological structure of the graph, so that the similarities and differences in the embedded vectors can reflect the intrinsic characteristics of the graph, providing more meaningful features for subsequent graph analysis and machine learning tasks.

[0103] like Figure 2 As shown, the present invention can use a community detection algorithm to divide the community structure and calculate the community strength. By effectively mining community information from graph data, the interpretability of the model can be improved. However, many existing GAE methods tend to focus mainly on the node level and generally ignore the impact of community structure information and community strength on graph structure data.

[0104] The present invention proposes a new learning framework, called Community-Aware Masked Graph Autoencoder (ComMGAE). Typically, GAE covers random parts of edges or nodes on the original graph data during pre-training, and uses the uncovered graph structure and its attribute information to reconstruct the missing parts to learn graph representation. In particular, the present invention develops a new masking strategy that destroys the links and attributes of the community to learn more structural information in the graph. Since existing GAEs often reconstruct edges as over-emphasized links of the graph, it leads to over-emphasis on the connectivity of the graph and suboptimal performance in downstream classification tasks. To avoid this limitation, the present invention simultaneously masks and reconstructs edge and node attributes, thereby overcoming the limitations of existing GAE methods by learning two new losses. However, this approach also brings challenges to graph reconstruction. In addition, the present invention uses a more complex graph neural network (GNN), rather than the lightweight multi-layer perception (MLP) mainly used by existing GAEs, as the decoder in the ComMGAE model. In addition, considering that the mean square error (MSE) is often too optimistic and easily affected by changes in vector norm and feature dimension, thus causing instability during training, the present invention utilizes scaled cosine error (SCE) as the loss function for feature reconstruction.

[0105] The ComMGAE model proposed in this paper incorporates the influence of community structure into graph representation learning and preserves the community structure by protecting the influence of the retained community throughout the learning process. Therefore, the goal of this paper is to identify the weaknesses of existing GAE designs and improve related work in graph representation learning for application to downstream tasks such as link prediction and node or graph classification.

[0106] The main contributions of the present invention are as follows:

[0107] 1. Introduce community structure information into the GAE framework and maintain the influence of the community during the learning process.

[0108] 2. A new masking strategy, called community-guided edge masking and node feature masking, is proposed.

[0109] 3. Use GNN in the autoencoder for multi-task decoding, supplemented by a dynamic loss function, to effectively extract additional valuable information from the original data for enhanced graph reconstruction.

[0110] 4. Extensive experience on multiple downstream tasks such as node classification, link prediction, and graph classification shows that ComMGAE effectively preserves graph topology and semantic information when learning graph representation.

[0111] like Figure 3 As shown, the ComMGAE model proposed in the present invention consists of four components, and the functions of each part are as follows.

[0112] 1) Masking: The community strength is calculated based on the results of community detection, and the attributes and structures of the graph are guided to be masked.

[0113] 2) Encoding: Encode the masked attributes and graphs into low-level vectors.

[0114] 3) Decoding: It includes attribute decoding and structure decoding. The attribute decoder decodes the encoded vector back to the original attribute, and the structure decoder decodes the original image through the masked image and attribute information. They both take the output of the encoder as input.

[0115] 4) Reconstruction: Compare the decoded attributes and structure with the original information and calculate the loss, continuously updating the encoder and decoder until the masked information can be restored to the greatest extent.

[0116] The model architecture proposed in this invention is as follows Figure 3 As shown, the following will be elaborated in detail according to each part of the model architecture.

[0117] Table 1 lists the symbols and their meanings that may be used later.

[0118] Table 1: Common symbols and their meanings

[0119]

[0120]

[0121] 1Mask module

[0122] A commonly used masking method is to randomly mask the nodes and edges of the data, so the present invention adjusts the probability of nodes and edges being masked through a community strength matrix.

[0123] Community detection. Community structures are ubiquitous in graph data. Community detection algorithms can evaluate the degree of clustering or partitioning of node groups, as well as their cohesion or separation tendencies. Therefore, they can be used to mine useful information from the network. The network structure of community partitioning is usually unknown, so the present invention selects modularity To evaluate the effect of community division, it is defined as follows:

[0124]

[0125] Among them, E c is the set of edges belonging to community c, η>0 is the resolution parameter, the larger η is, the more communities the present invention obtains. In order to ensure the connectivity of the community, the present invention uses combo to detect the community, which can be based on the modularity To divide the community.

[0126] Community connectivity strength. There are always denser edges inside the community, which means there is stronger connectivity and more semantic information between them. The community connectivity strength S of community c c Defined as:

[0127]

[0128] It consists of the ratio of edges of community c and the ratio of degree of community c in the whole graph, which indicates that communities with more edges and nodes have better connectivity.

[0129] Graph data masking. First, the present invention can calculate the edge weight and node weight of the entire graph based on community connectivity, as shown below:

[0130] W n =Φ(norm(XIS),τ),

[0131]

[0132] W e =norm(II T S),

[0133] Where norm(x)=(x min ) / (x max -x min ) is the maximum and minimum normalization operation, I is the indicator matrix, if Then I (i,c) =1, otherwise I (i,c)= 0, τ is the threshold set by the present invention for node shielding. In order to preserve the influence of the original community semantics, the present invention sets a higher shielding rate for edges and nodes in communities with better connectivity. The shielding strategy of the present invention is to sample a portion of edges from the original graph according to the Bernoulli distribution. and nodes

[0134]

[0135] The present invention will remove the sampled edges from the original graph And construct a new graph using the remaining edges At the same time, the present invention sets the sampled node attributes to zero or covers them with the attributes of other nodes. In this way, the present invention completes the masking work and obtains the masked node attributes Masked image Masked node positions and masked edges For subsequent work.

[0136] Encoding module

[0137] Encoder. Specifically, the encoder of ComMGAE can be any type of graph neural network, such as GCN, GAT or GIN. The present invention can select different GNN networks according to different tasks. The encoder maps the masked graph structure and node attributes to a low-dimensional representation containing more compressed information through the GNN network, as shown below:

[0138]

[0139] At the same time, the encoder uses a multi-head attention mechanism to capture more semantic information.

[0140] Decoding module

[0141] Attribute Decoder. The attribute decoder attempts to map the latent codes back to the original attributes, and its formula is:

[0142]

[0143] During the training process, the present invention will optimize Make X′ and X as similar as possible, and discard the decoder after pre-training. The decoder and encoder are usually asymmetric, so the present invention can choose any GNN as the decoder. In previous studies, most of the work used simpler decoder structures, such as MLP, to reduce computational overhead. However, overly simple reconstruction decoding will cause the learned representation Z to be too similar to the reconstructed node attribute X′, that is, returning to the original attribute X instead of a high-level representation rich in graph structure information. In order to avoid the decoder being penetrated, the present invention selects a single-layer GNN as the attribute decoder. While avoiding the above problems, node attributes can be reconstructed from neighboring node information through a message passing mechanism. In addition, in order to enable the encoder to capture more information, the present invention re-masks the latent code before decoding to ensure that the decoder only uses unmasked node features for reconstruction.

[0144] Structure Decoder. Structure Decoder Try to reconstruct the edge of the mask through the latent feature Z. The specific process is as follows Figure 4 As shown. The present invention generally uses link prediction as a proxy task for edge prediction. There are also many types of structural decoders to choose from. The present invention uses structural decoders Defined as:

[0145]

[0146] Where MLP represents a multi-layer perceptron.

[0147] After randomly sampling the edges, we obtain the positive edge set E in the graph. + and the negative edge set E that is not in the graph - ,Then find the two feature vectors corresponding to the nodes of each edge in the learned node feature Z, and input the paired features into the structure decoder for learning. The learned results will be used to calculate the loss of the model.

[0148] Refactoring Modules

[0149] Reconstruction is divided into attribute reconstruction and structure reconstruction. The learning goal of attribute reconstruction is to make the reconstructed attribute X′ and the original attribute X as similar as possible, and MSE loss is usually used as the loss function. However, recent experiments have shown that MSE may fall into the dilemma of being unable to distinguish between difficult and easy samples because it always gives a very low error value. The present invention selects the improved reconstruction loss SCE as the loss function, and its formula is:

[0150]

[0151] Where γ is the training scaling factor. It can adjust different scaling sizes for different datasets. The learning objectives of the structure reconstruction are as follows:

[0152]

[0153] Where E + and E - is the sampled positive and negative edges, v is the nodes at both ends of the edge, and Z is the representation learned by the encoder. So far, the total loss of the model is:

[0154]

[0155] Wherein α is a reconstruction adjustment parameter. In order to better balance the structural information and the attribute information in the entire training process, the present invention sets different values ​​for α so as to learn these two kinds of information simultaneously during the learning process.

[0156] like Figure 5 As shown, the community-aware graph masked self-encoding learning system provided by an embodiment of the present invention includes:

[0157] The framework introduction module is responsible for introducing community structure information into the GAE framework and maintaining the influence of the community during the learning process; it adopts community-guided edge masking and node feature masking;

[0158] The task decoding module is responsible for multi-task decoding using GNN in the autoencoder, supplemented by a dynamic loss function to effectively extract additional valuable information from the original data for enhanced graph reconstruction;

[0159] The information preservation module is responsible for retaining the graph topology and semantic information when learning graph representation in multiple downstream tasks such as node classification, link prediction, and graph classification.

[0160] In order to prove the creativity and technical value of the technical solution of the present invention, this section provides application examples of the claimed technical solution on specific products or related technologies.

[0161] Social network analysis: Social networks are typical examples of graph structures. The present invention can be used for tasks such as node classification and link prediction in social networks.

[0162] Recommendation system: In a recommendation system, users and items can be represented as nodes in a graph, and their interactions can be represented as edges. The present invention can be used to learn the representation of users and items, thereby achieving personalized recommendations.

[0163] Bioinformatics: Biological networks (such as protein interaction networks, gene regulatory networks, etc.) can be modeled as graphs. The present invention can be used to analyze patterns and relationships in biological networks, predict protein functions, etc.

[0164] Knowledge graph: A knowledge graph is a large graph structure used to represent the relationships between entities. The present invention can be used to learn embedded representations of entities and relationships from knowledge graphs, thereby supporting applications such as knowledge reasoning and question-answering systems.

[0165] Text analysis: Text data can be modeled by constructing graph structures such as word co-occurrence networks or grammatical analysis trees. The present invention can be used to learn the representation of text data, thereby supporting tasks such as text classification, sentiment analysis, and named entity recognition.

[0166] Recommendation system: In a recommendation system, users and items can be represented by nodes of a graph, and their interactions can be represented by edges of the graph. The present invention can be used to learn the representation of users and items to achieve more accurate and personalized recommendations.

[0167] Network security: Tasks such as intrusion detection and malware analysis in the field of network security can be used by the present invention to identify abnormal patterns and behaviors in the network.

[0168] Traffic flow prediction: Traffic networks can be represented as graphs, and the present invention can be used to predict tasks such as traffic flow, road conditions, and path planning.

[0169] In summary, the present invention has wide applications in various fields and has achieved satisfactory results in many tasks.

[0170] In order to demonstrate the effectiveness of the proposed method, the learned representations are tested on three downstream tasks, including node classification, link prediction, and graph classification. The specific settings are as follows:

[0171] Node classification: aims to predict the category of nodes in the graph based on the attributes of the nodes and the structure of the graph. The node classification task is usually used to test the performance of different models. The present invention uses a two-layer GCN as the backbone network of the encoder. After obtaining the node embedding, the present invention trains a linear classifier to assign labels to the nodes in the graph. The data sets are shown in Tables 2 and 3. The specific experiment uses accuracy to evaluate the results.

[0172] Link prediction: In this task, we try to predict whether there is a link between two entities in a network, such as a social network, citation network, or biological network. We use cosine similarity to predict whether there is a link between two nodes without additional training. Experiments on link prediction use ROC-AUC to evaluate the results.

[0173] Graph classification: The goal of graph classification is to classify graph structured data into different categories, which is usually applied to molecular property prediction. This paper adopts graph isomorphism network (GIN) as the backbone network of the encoder, which is a commonly used model in the context of graph classification. After obtaining the node embedding, this paper trains a LIBSVM classifier to predict the category of the graph. The experiment uses accuracy to evaluate the results

[0174] The present invention conducted experiments on 9 public data sets, as follows:

[0175] Cora and CiteSeer are citation datasets provided by Planetoid, where each node corresponds to an academic paper and the edge represents the citation relationship between papers. Each element of the node feature is a 0-1 binary variable, which is used to indicate whether the corresponding word exists in the paper.

[0176] Amazon-Computers(Computers) and Amazon-Photo(photo) are components of the Amazon co-purchase graph, where nodes represent products and edges represent two products that are often purchased together. They have high-dimensional sparse features and unbalanced class distribution characteristics.

[0177] Ogbn-Arxiv (Arxiv) is a directed graph representing the citation network between all Arxiv papers in the field of computer science. Each node is an Arxiv paper, and each directed edge represents a paper citing another paper. The data set is divided based on the publication date of the paper.

[0178] IMDB-BINARY (IMDB-B) and IMDB-MULTI (IMDB-M) are two movie collaboration datasets in TUDataset, where nodes represent actors and edges represent connected entities appearing in the same movie. These graphs are derived from two movie genres: action and romance.

[0179] PROTEINS and NCI1 are molecular datasets where each graph represents a molecule. PROTEINS includes protein molecules, while NCI1 contains small molecules. They are often used in molecular prediction models.

[0180] Table 2: Statistics and hyperparameters of node classification and link prediction datasets

[0181]

[0182] Table 3: Statistics and hyperparameters of graph classification datasets

[0183]

[0184]

[0185] All experiments were performed on a 32G Linux server and an NVIDIA GeForceRTX 3070 GPU with 8G video memory. The project was built with PyTorch 11.6 and Deep Graph Library 1.1.1, and all datasets were derived from the DGL and TUDataset libraries. The community detection algorithm was provided by CDLib 0.2.6, and the present invention accepted all default parameters to obtain the detection results. The specific hyperparameters and datasets are shown in Tables 1 and 2.

[0186] In order to prove the effectiveness of the method proposed in the present invention, the present invention is compared with the following methods.

[0187] (1) Supervised learning model:

[0188] GNN is a type of deep learning model based on graph structured data. Through node embedding and information transmission mechanism, it can effectively capture the complex topological structure and relationships in the graph. It is widely used in social networks, bioinformatics, recommendation systems and other fields to improve the representation learning and task performance of graph data.

[0189] GAT

[10] adopts the self-attention mechanism to dynamically adjust the degree of attention a node pays to its neighbors, showing flexibility and performance advantages in node representation learning.

[0190] GIN is a graph neural network model that adopts the concept of graph isomorphism. Through an iterative graph isomorphic network structure, it fuses the information of node neighborhood to generate node representation. It has the characteristics of achieving good performance in graph classification and node-level tasks.

[0191] (2) Graph Contrast Learning Model:

[0192] DGI is a self-supervised learning framework that emphasizes learning the global features of nodes in the graph by randomly masking nodes, and achieves unsupervised learning of graph data through the task of reconstructing local and global information of nodes.

[0193] GRACE improves the analytical capabilities of graph-structured data through contrastive learning. It generates two related graph views by randomly destroying the original graph, and then uses a graph neural network encoder and a contrastive loss function to maximize the consistency of the node embedding vectors in the two views.

[0194] GCA generates two related graph views through an adaptive data augmentation scheme and improves the analytical ability of graph-structured data through contrastive learning. It adjusts the enhancement strength according to the centrality of edge and node features to retain important connections and semantic information while perturbing unimportant parts.

[0195] The Infograph model is an unsupervised graph representation learning method that uses the principle of maximizing mutual information and considers both the overall representation of the graph and the substructure representation of different granularities. The model can effectively capture the complexity and diversity of graphs and improve the performance of downstream tasks such as graph classification and graph regression.

[0196] SimGRACE is a contrastive learning method that does not require graph data augmentation. It uses different encoders as generators of contrastive views and maintains the analysis and discovery of graph data semantics through the perturbed encoder.

[0197] GraphCL is a graph contrastive learning method based on data augmentation, which learns the representation of graphs by maximizing the consistency between different views. Different graph neural networks can be used as encoders, and different data augmentation strategies can be used to generate different views.

[0198] MVGRL is a graph-based contrastive multi-view representation learning method that learns node and graph representations by maximizing the mutual information between different structural views of the same graph. The method uses a graph convolutional network as an encoder and an adjacency matrix and a diffusion matrix as two contracted views.

[0199] The CCA-SSG model is a graph self-supervised learning framework based on Canonical Correlation Analysis (CCA), which learns robust node representations by maximizing the correlation between two augmented views while minimizing feature redundancy within a single view. The CCA-SSG model does not require negative samples, mutual information estimators, projection heads, or asymmetric structures, thus simplifying the design of graph contrastive learning.

[0200] (3) Graph Autoencoder Model:

[0201] GAE uses encoders and decoders to learn low-dimensional representations of nodes in the graph and reconstruct the adjacency matrix of the graph. GAE's encoder uses a graph convolutional network (GCN) and the decoder uses an inner product form. It can be used for tasks such as graph generation, link prediction, and node clustering.

[0202] VGAE, an unsupervised learning framework for graph-structured data based on variational autoencoders (VAE). VGAE uses a graph convolutional network as an encoder to learn the latent variable distribution of nodes in the graph, and then uses the inner product form as a decoder to reconstruct the adjacency matrix of the graph.

[0203] MaskGAE is a self-supervised learning framework based on masked graph modeling (MGM). It randomly masks some edges in the graph, and then uses encoders and decoders to reconstruct the masked edges, thereby learning the low-dimensional representation of nodes in the graph. The advantage of MaskGAE is that it does not require negative sampling or mutual information estimation, and has theoretical guarantees.

[0204] GraphMAE is a generative graph self-supervised learning method that aims to reconstruct masked node features rather than graph structural information. It uses a graph neural network with a quadratic masking strategy as a decoder and a scaled cosine error as a loss function.

[0205] Experimental Results and Analysis: Node Classification: For node classification, the present invention evaluates ComMGAE with state-of-the-art models, including supervised models such as GCN and GAT, graph contrastive learning models such as DGI, GRACE, GCA, and CCA-SSG, and generative autoencoder models GAE, VGAE, MaskGAE, and GraphMAE. The present invention tests these models on Cora, CiteSeer, Arxiv, Computers, and Photo, and the results are shown in Table 4. It can be seen that the present invention's model exceeds other state-of-the-art models in terms of accuracy.

[0206] Table 4: Results of the node classification task measured by accuracy (%). The best result is highlighted in bold and the second best result is underlined (excluding supervised methods).

[0207]

[0208] Table 5: Link prediction task results measured by AUC-ROC (%)

[0209]

[0210]

[0211] Table 6: Results of the image classification task measured by accuracy (%)

[0212]

[0213] OOM stands for out-of-memory.

[0214] Link Prediction: To verify the performance of ComMGAE on the link prediction task, the present invention compares it with the current state-of-the-art supervised baselines GCN and GAT, as well as graph contrastive learning models DGI, GRACE, GCA and MVGRL. In addition, the present invention also tests the results of previously generated self-supervised models GAE, VGAE, MaskGAE and GraphMAE. In addition, the present invention conducts experiments on four datasets, including Cora, CiteSeer, Computers and Photo, as shown in Table 5. The results show that the performance of the ComMGAE model on the two datasets of Computers and Photo is better than all baselines. The ComMGAE model did not achieve the best results on the Cora and CiteSeer datasets, and the maximum difference in its results was about 0.7% to 2.74%. In addition, as shown in Table 5, the GraphMAE model performs poorly in the link prediction task. This is because it only reconstructs node attributes and ignores the structure of the graph. Unlike the GraphMAE model, the proposed ComMGAE model reconstructs node attributes and graph structure based on the community to achieve better performance on the link prediction task.

[0215] Graph classification: The present invention uses four different datasets for graph classification, and the experimental results are shown in Table 6. Compared with the self-supervised model, it is easy to find that among the four datasets, the supervised method performs better than ComMGAE on three datasets, where the accuracy of ComMGAE decreases by at most 0.4% to 1.28%. The present invention believes that the reason may be that in the above-mentioned benchmarks, the node features are all unique hot vectors representing node labels or node degrees, so the information in graph classification is relatively less and not as rich as the information in node classification. However, the present invention found that ComMGAE performs well among all models based on graph contrastive learning, and has competitive results compared with other state-of-the-art GAE models. The results show that ComMGAE has potential in graph-level classification tasks.

[0216] According to the above analysis, the proposed ComMGAE model has achieved satisfactory performance in the field of GRL, including downstream tasks such as node classification, link prediction, and graph classification. The results of downstream tasks show that ComMGAE is an effective and general self-supervised graph representation learning framework suitable for various application scenarios of GRL.

[0217] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. It can be understood by a person of ordinary skill in the art that the above-mentioned devices and methods can be implemented using computer executable instructions and / or contained in a processor control code, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. Such code is provided on the carrier medium. The device and its modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0218] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.

Claims

1. A community-aware graph masked autoencoding learning method, characterized in that: The following steps are involved: The first step is to introduce community structure information into the GAE framework and maintain the influence of the community during the learning process; community-guided edge masking and node feature masking are used; In the second step, GNN is used in the autoencoder for multi-task decoding, supplemented by a dynamic loss function, to extract additional valuable information from the original data for enhanced image reconstruction. In the third step, ComMGAE retains the graph topology and semantic information when learning graph representation in multiple downstream tasks such as node classification, link prediction, and graph classification. In the recommendation system, users and items are represented as nodes in the graph, and their interactions are represented as edges, which are used to learn the representation of users and items, thereby achieving personalized recommendations; The ComMGAE model of the community-aware graph masked autoencoder learning method consists of four components; Masking: Calculate the community strength through the results of community detection and guide the properties and structure of the graph to be masked; Encoding: Encode the masked attributes and graphs into low-dimensional vectors; Decoding: includes attribute decoding and structure decoding. The attribute decoder decodes the encoded vector back to the original attribute. The structure decoder decodes the original image through the masked image and attribute information. Both use the encoder output as input. Reconstruction: Compare the decoded attributes and structure with the original information and calculate the loss, and continuously update the encoder and decoder until the masked information can be restored to the greatest extent; Mask module, including: Community detection,Community structures are ubiquitous in graph data. Community detection algorithms evaluate the degree of clustering or partitioning of node groups, as well as their cohesion or separation tendencies; select modularity To evaluate the effect of community division, the definition is as follows: Among them, E c is the set of edges belonging to community c, η>0 is the resolution parameter, the larger η is, the more communities are obtained, and combo is used to detect communities according to the modularity. to divide the community; Community connectivity strength, community connectivity strength S of community c c Defined as: It is composed of the ratio of edges of community c in the whole graph and the ratio of degree of community c; Graph data masking calculates the edge weights and node weights of the entire graph based on community connectivity, as shown below: W n =Φ(norm(XIS c ),t), W e =norm(II T S c ), Where norm(x)=(x min ) / (x max -x min ) is the maximum and minimum normalization operation, I is the indicator matrix, if Then I (i,c) =1, otherwise I (i,c) = 0, τ is the threshold for node shielding, and the shielding strategy is to sample a part of the edges from the original graph according to the Bernoulli distribution. and nodes The sampled edges will be removed from the original graph And construct a new graph using the remaining edges At the same time, the sampled node attributes are set to zero or overwritten with the attributes of other nodes, resulting in the masked node attributes. Masked image Coding module, including: The encoder maps the masked graph structure and node attributes to a low-dimensional representation containing more compressed information through a GNN network, as shown below: At the same time, the encoder uses a multi-head attention mechanism to capture more semantic information; Decoding module, including: Attribute Decoder,The attribute decoder attempts to map the latent codes back to the original attributes,,and its formula is: A single-layer GNN was selected as the attribute decoder; structure decoder, structure decoder Try to reconstruct the edge of the mask through the potential feature Z, use link prediction as a proxy task to perform edge prediction, and there are also many types of structural decoders to choose from. Defined as: Where MLP represents a multi-layer perceptron; After randomly sampling the edges, we obtain the positive edge set E in the graph. + and the negative edge set E that is not in the graph - ,Then find the two feature vectors corresponding to the nodes of each edge in the learned node feature Z, input the paired features into the structure decoder for learning, and the learned results will be used to calculate the loss of the model; Refactoring modules, including: Reconstruction is divided into attribute reconstruction and structure reconstruction. The learning goal of attribute reconstruction is to make the reconstructed attribute X′ and the original attribute X as similar as possible. The improved reconstruction loss SCE is selected as the loss function, and its formula is: Where γ is the training scaling factor, and different scaling sizes are adjusted for different data sets. The learning objectives of the structure reconstruction are as follows: Where E + and E - are the sampled positive and negative edges, v is the nodes at both ends of the edge, Z is the representation learned by the encoder, and the total loss of the model is: Among them, α is the reconstruction adjustment parameter, in order to better balance the structural information and attribute information in the entire training process.

2. A computer device, characterized in that: The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the community-aware graph masked self-encoding learning method according to claim 1.

3. A computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to execute the community-aware graph masked self-encoding learning method according to claim 1.

4. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the community-aware graph masked self-encoding learning method described in claim 1.

5. A community-aware graph masked self-encoding learning system implementing the community-aware graph masked self-encoding learning method according to claim 1, characterized in that: The community-aware graph masked self-encoding learning system includes: The framework introduction module is responsible for introducing community structure information into the GAE framework and maintaining the influence of the community during the learning process; it adopts community-guided edge masking and node feature masking; The task decoding module is responsible for multi-task decoding using GNN in the autoencoder, supplemented by a dynamic loss function to effectively extract additional valuable information from the original data for enhanced graph reconstruction; The information preservation module is responsible for retaining the graph topology and semantic information when learning graph representation in multiple downstream tasks such as node classification, link prediction and graph classification.

Citation Information

Patent Citations

  • Interactive community search method and device based on graph neural network

    CN112966165A

  • Force-oriented graph layout method based on community discovery and clustering optimization

    CN114357311A