Graph representation learning method and device for out-of-distribution generalization, equipment and storage medium
By identifying and separating stable and noisy subgraphs in graph data, and simulating and optimizing graph structure data representation networks in multi-distribution environments, the accuracy problem of graph representation learning in inconsistent distribution environments is solved, and adaptive graph structure data prediction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TSINGHUA UNIVERSITY
- Filing Date
- 2022-03-08
- Publication Date
- 2026-04-14
AI Technical Summary
Existing graph representation learning methods cannot effectively adapt to out-of-distribution generalization when the training and testing environments are not distributed, resulting in performance degradation in real-world scenarios and an inability to accurately characterize graph structure data in the testing environment.
The first graph neural network identifies stable and noisy subgraphs in the original graph data, and the second graph neural network is used for representation processing to simulate a multi-distribution environment, optimize the graph structure data representation network, and obtain an adaptive graph structure data representation.
It improves the accuracy of predictions related to graph structure data, ensures the predictive performance of the model in multi-distribution environments, ignores noise information, focuses on stable information, and improves task execution performance.
Smart Images

Figure CN114781582B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a method, apparatus, device, and storage medium for distributed out-generalization graph representation learning. Background Technology
[0002] Graph-structured data consists of nodes and edges, such as social networks, transportation networks, and biological networks. These graph-structured data cannot be directly applied to most deep learning algorithms; a vectorized representation of the graph-structured data must first be computed before solving related tasks. To obtain this vectorized representation, deep neural networks are used for graph representation learning. Graph representation learning can be applied to recommender systems, social network analysis, biological molecular modeling, drug discovery, and financial market prediction, making it an important scientific research problem. Existing graph representation learning methods include graph neural network representation learning, which primarily uses a neighbor aggregation mechanism to iteratively update node representations. After obtaining the updated node representations, graph pooling is used to aggregate and summarize the representations of the entire graph. Another method is node-generalization graph neural networks, which can transfer models trained on small graphs to large graphs. A third method theoretically analyzes the task-solving capabilities of neural networks, providing theoretical guarantees when the training and test sets are similarly distributed.
[0003] In existing technologies, the first method's performance deteriorates when the distributions of the training and testing environments are inconsistent, thus limiting its application scenarios and making it unsuitable for real-world out-of-distribution generalization. The second method only adapts to changes in the number of nodes in the training and testing environments, failing to adapt to other types of distribution variations and thus remaining unsuitable for graph representation learning problems requiring out-of-distribution generalization in real-world scenarios. The third method cannot be applied when the training and testing environments are inconsistent, resulting in representations that fail to accurately depict graph structure data in the testing environment, impacting the performance of downstream tasks. Existing methods yield vectorized representations based on the training and testing environments, without adaptive processing for unknown, complex, and potentially changing testing environments. However, real-world graph structure data often originates from complex distributions. When training data is insufficient to reflect the true distribution, the testing data will differ from the training data in distribution. Using traditional training methods, the resulting graph structure representation may achieve good results on the training dataset, leading to training termination. However, when applied to the testing environment, distribution migration causes a significant performance degradation, resulting in poor performance in different application scenarios and a large discrepancy between the task execution results and the actual results. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for out-of-distribution graph representation learning, aiming to obtain adaptive graph structure data representations for out-of-distribution environments and improve the accuracy of graph structure data-related predictions.
[0005] A first aspect of this application provides a graph representation learning method with distributional out-generalization, the method comprising:
[0006] The original graph dataset is input into a graph structure data representation network, which includes a first graph neural network and a second graph neural network.
[0007] The first graph neural network identifies each original graph structure data in the original graph dataset, and identifies stable subgraphs and noisy subgraphs in the original graph structure data to obtain the identified graph structure data.
[0008] The identified graph structure data is represented by the second graph neural network to obtain the vectorized representation of the stable subgraph and the vectorized representation of the noisy subgraph.
[0009] Based on the vectorized representation of the noise subgraph, a multi-distribution environment is simulated. Under the multi-distribution environment, prediction is made based on the vectorized representation of the stable subgraph to obtain the corresponding prediction result.
[0010] For each original graph structure data in the original graph dataset, the prediction result and the label of the original graph structure data are used to calculate the loss function, and the parameters of the graph structure data representation network are optimized to obtain the graph structure data representation model.
[0011] By using the graph structure data representation model, graph data-related tasks are performed to obtain the target results of the graph data-related tasks.
[0012] Optionally, the first graph neural network is used to identify each original graph structure data in the original graph dataset, identifying stable subgraphs and noisy subgraphs in the original graph structure data, including:
[0013] The original graph structure data is updated with node information to obtain graph structure data with updated node representations;
[0014] The similarity between nodes is calculated on the graph structure data after the node representation is updated, so as to obtain the similarity between each node and its neighboring nodes in the graph structure data.
[0015] Based on the similarity, the nodes with similarity greater than a preset similarity threshold are selected and the edges between them form the stable subgraph, and the remaining nodes and edges form the noisy subgraph.
[0016] Optionally, the original graph structure data is updated with node information to obtain updated node representation graph structure data, including:
[0017] Obtain the node information of each node in the original graph structure data;
[0018] Based on the node information of each node, neighbor aggregation is performed on each node to obtain the graph structure data after the node is updated.
[0019] Optionally, based on the vectorized representation of the noise subgraph, a multi-distribution environment is simulated. Under this multi-distribution environment, prediction is performed based on the vectorized representation of the stable subgraph to obtain the corresponding prediction result, including:
[0020] Clustering calculations are performed on the vectorized representation of the noise subgraph to simulate the multi-distribution environment;
[0021] In the multi-distribution environment, the corresponding prediction task is performed based on the vectorized representation of the stable subgraph to obtain the corresponding prediction result.
[0022] Optionally, for each original graph structure data in the original graph dataset, a loss function is calculated between the prediction result and the label of the original graph structure data, and the parameters of the graph structure data representation network are optimized to obtain a graph structure data representation model, including:
[0023] For each original graph structure data in the original dataset, a loss function is calculated based on the prediction result and the label of the original graph structure data to obtain the corresponding loss value.
[0024] Based on the loss value, the graph structure data representation network is updated with gradients to obtain the graph structure data representation model.
[0025] Optionally, the graph data-related task is performed using the graph structure data representation model to obtain the target result of the graph data-related task, including:
[0026] The graph dataset corresponding to the graph data-related tasks is received through the graph structure data representation model.
[0027] The graph dataset is characterized to obtain a graph representation vector corresponding to each graph structure data in the graph dataset;
[0028] Based on the graph representation vector, prediction is performed in conjunction with the corresponding task objective to obtain the target result.
[0029] A second aspect of this application provides a graph representation learning device for distributional out-generalization, the device comprising:
[0030] A data input module is used to input the original graph dataset into a graph structure data representation network, wherein the graph structure data representation network includes a first graph neural network and a second graph neural network.
[0031] The data recognition module is used to recognize each original graph structure data in the original graph dataset through the first graph neural network, identify the stable subgraphs and noisy subgraphs in the original graph structure data, and obtain the recognized graph structure data.
[0032] The characterization processing module is used to perform characterization processing on the identified graph structure data through the second graph neural network to obtain the vectorized representation of the stable subgraph and the vectorized representation of the noisy subgraph.
[0033] The result prediction module is used to simulate a multi-distribution environment based on the vectorized representation of the noise subgraph, and to make predictions based on the vectorized representation of the stable subgraph under the multi-distribution environment to obtain the corresponding prediction results.
[0034] The parameter optimization module is used to calculate the loss function by combining the prediction result with the label of the original graph structure data for each original graph structure data in the original graph dataset, and to optimize the parameters of the graph structure data representation network to obtain the graph structure data representation model.
[0035] The task execution module is used to execute graph data-related tasks through the graph structure data representation model and obtain the target results of the graph data-related tasks.
[0036] Optionally, the data recognition module includes:
[0037] The node update submodule is used to update the node information of the original graph structure data to obtain graph structure data with updated node representations.
[0038] The similarity calculation submodule is used to calculate the similarity between nodes in the graph structure data after the node is updated, so as to obtain the similarity between each node and its neighboring nodes in the graph structure data.
[0039] The subgraph determination submodule is used to select nodes with similarity greater than a preset similarity threshold and the edges between those nodes to form the stable subgraph, and to form the noisy subgraph with the remaining nodes and edges.
[0040] Optionally, the node update submodule includes:
[0041] The node information acquisition submodule is used to acquire the node information of each node in the original graph structure data;
[0042] The neighbor aggregation submodule is used to perform neighbor aggregation on each node based on the node information of each node, so as to obtain the graph structure data after the updated node representation.
[0043] Optionally, the result prediction submodule includes:
[0044] The clustering calculation submodule is used to perform clustering calculations on the vectorized representation of the noise subgraph to simulate the multi-distribution environment;
[0045] The prediction task execution submodule is used to perform the corresponding prediction task based on the vectorized representation of the stable subgraph in the multi-distribution environment, and obtain the corresponding prediction result.
[0046] Optionally, the parameter optimization module includes:
[0047] The loss calculation submodule is used to calculate the corresponding loss value for each original graph structure data in the original dataset based on the prediction result and the label of the original graph structure data.
[0048] The model acquisition submodule is used to perform gradient updates on the graph structure data representation network based on the loss value to obtain the graph structure data representation model.
[0049] Optionally, the task execution module includes:
[0050] The data receiving submodule is used to receive the graph dataset corresponding to the graph data related tasks through the graph structure data representation model.
[0051] The graph representation vector acquisition submodule is used to represent the graph dataset and obtain the graph representation vector corresponding to each graph structure data in the graph dataset.
[0052] The target result acquisition submodule is used to predict the target result based on the graph representation vector and the corresponding task objective.
[0053] A third aspect of this application provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps described in the first aspect of this application.
[0054] A fourth aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the first aspect of this application.
[0055] The graph representation learning method with out-of-distribution generalization provided in this application is adopted. The original graph dataset is input into a graph structure data representation network, which includes a first graph neural network and a second graph neural network. The first graph neural network identifies each original graph structure data in the original graph dataset, identifying stable subgraphs and noisy subgraphs, thus obtaining identified graph structure data. The second graph neural network performs representational processing on the identified graph structure data, obtaining a vectorized representation containing representations of the stable and noisy subgraphs. Based on the vectorized representation, a multi-distribution environment is simulated, and predictions are made on the original graph structure data under this environment to obtain corresponding prediction results. For each original graph structure data in the original graph dataset, the graph structure data representation network is optimized based on the original graph structure data and its corresponding prediction results to obtain a graph structure data representation model. The graph structure data representation model is then used to execute graph data-related tasks to obtain the target results of these tasks. The graph representation learning method proposed in this application, which generalizes out of distribution, identifies the received graph structure data, distinguishing between stable and noisy subgraphs. This yields a vectorized representation containing both stable and noisy subgraphs. By simulating a multi-distribution environment using noisy subgraphs, the model is encouraged to make predictions based on stable subgraphs in such environments. This process distinguishes, separates, and dissociates the stable and noisy information in the graph structure representation, removing spurious correlations and preventing the model from making predictions based on noise. Ultimately, it encourages the model to make predictions based on stable information, ensuring adaptive prediction performance even when there are distributional differences between the test and training environments. Attached Figure Description
[0056] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0057] Figure 1 This is a flowchart of a graph representation learning method for distributional out-generalization proposed in an embodiment of this application;
[0058] Figure 2 This is a schematic diagram of the graph representation learning process for distributed out-generalization proposed in an embodiment of this application;
[0059] Figure 3 This is a schematic diagram of a graph representation learning device for distributed out-generalization proposed in an embodiment of this application. Detailed Implementation
[0060] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0061] refer to Figure 1 , Figure 1 This is a flowchart of a graph representation learning method for distributed out-generalization proposed in an embodiment of this application. For example... Figure 1 As shown, the method includes the following steps:
[0062] S11: Input the original graph dataset into the graph structure data representation network, which includes a first graph neural network and a second graph neural network.
[0063] In this embodiment, the original graph dataset is a dataset containing a large amount of graph structure data, and the graph structure data representation network is a deep neural network composed of a first graph neural network and a second graph neural network.
[0064] In this embodiment, after the data in the original graph dataset is input into the graph structure representation network, it is first processed by the first graph neural network, and then the result of the first graph neural network is input into the second graph neural network, which outputs the processing result.
[0065] For example, graph neural networks can take existing GNN networks.
[0066] S12: The first graph neural network is used to identify each original graph structure data in the original graph dataset, and the stable subgraphs and noisy subgraphs in the original graph structure data are identified to obtain the identified graph structure data.
[0067] In this embodiment, the graph structure data is composed of vertices and edges, where vertices represent specific things, and edges between vertices represent the relationships between things. A stable subgraph is a subgraph in the graph structure data composed of vertices and edges with strong relationships and a stable structure, while a noisy subgraph is a subgraph in the graph structure data composed of vertices and edges with weak relationships and an unstable structure. The identified graph structure data will then be marked with stable and noisy subgraphs.
[0068] For example, graph-structured data can be social network graphs, transportation network graphs, etc. In a social network graph, nodes represent each person, and edges represent the relationships between people. In a transportation network graph, nodes represent buildings or locations on the ground, and edges represent the pathways between locations.
[0069] In this embodiment, the specific steps for identifying each original graph structure data in the original graph dataset using the first graph neural network, and identifying stable subgraphs and noisy subgraphs in the original graph structure data to obtain the identified graph structure data are as follows:
[0070] S12-1: Update the node information of the original graph structure data to obtain the updated graph structure data with updated node representations.
[0071] In this embodiment, each node in the original graph structure data only contains its own node information. However, there are various hidden factors behind the graph structure data, which can be obtained through information interaction between the nodes. Updating the node information means that each node updates its own node information based on the information of its neighboring nodes. The specific steps are as follows:
[0072] S12-1-1: Obtain the node information of each node in the original graph structure data.
[0073] In this embodiment, the first neural network reads the original graph structure data and obtains the node information of each node in the original graph structure data. The node information can include any information that can be collected and stored. As long as the information is related to the node and can be queried, it can be saved as the node information of the node.
[0074] For example, social network relationship graph data is input into the network, and the first neural network reads the data of the relationship graph to obtain the node information of each node in the social network relationship graph. The node information of each node includes: person's name, gender, age, work location, and other information related to that person.
[0075] S12-1-2: Based on the node information of each node, perform neighbor aggregation on each node to obtain the graph structure data after updating the node representation.
[0076] In this embodiment, neighbor aggregation is where each node updates its own node representation based on the node information contained in its neighboring nodes.
[0077] In this embodiment, after obtaining the node information of each node, the first graph neural network updates the information of each node based on the information between the adjacent nodes of each node, and generates an updated representation based on the updated node information.
[0078] For example, in a social network, node A has the information (name: Wang Hong, gender: male, age: 30, city: Beijing) and node B has the information (name: Wang Li, gender: female, age: 28, spouse: Wang Hong). Based on the information on node A, we know that Wang Li on node B is the spouse of Wang Hong on node A. Therefore, the city of Wang Li on node B is also Beijing. Since Wang Hong's spouse on node A is Wang Li, the information is updated. Then, we perform neighbor aggregation on nodes A and B to obtain the updated information on node A as: (name: Wang Hong, gender: male, age: 30, spouse: Wang Li, city: Beijing) and the updated information on node B as: (name: Wang Li, gender: female, age: 28, spouse: Wang Hong, city: Beijing).
[0079] S12-2: Calculate the similarity between nodes in the graph structure data after the node representation is updated, and obtain the similarity between each node and its neighboring nodes in the graph structure data.
[0080] In this embodiment, the similarity between nodes represents the degree of similarity between two nodes. The greater the similarity, the higher the degree of information overlap between the two nodes, and the lower the similarity, the lower the degree of information overlap between the two nodes.
[0081] For example, in a social network graph, the information on node A is (Name: Wang Hong, Company: School A, Occupation: Teacher, Years of Service: 10), the information on node B is (Name: Zhang San, Company: School A, Occupation: Teacher, Years of Service: 9), and the information on node C is (Name: Li Si, Company: Factory A, Occupation: Worker, Years of Service: 15). After similarity calculation, node A has a high similarity to node B, while node C has a low similarity to both nodes A and B.
[0082] S12-3: Based on the similarity, select the nodes with similarity greater than a preset similarity threshold and the edges between them to form the stable subgraph, and form the noisy subgraph with the remaining nodes and edges.
[0083] In this embodiment, the similarity threshold is a pre-set threshold derived from experiments. A stable subgraph is a relatively stable part of a graph structure that does not change with scene distribution. A noisy subgraph is an unstable part of a graph structure that is prone to change with scene distribution.
[0084] In this embodiment, the first graph neural network labels the entire graph structure data based on the similarity between nodes. Edges between pairs of nodes with a similarity greater than a preset similarity threshold are labeled as edges of the stable subgraph, and the remaining edges are labeled as edges of the noisy subgraph. The labeled graph structure data consists of two parts: a stable subgraph and a noisy subgraph.
[0085] For example, in a company's employee relationship graph, each node represents an employee. The node information of each node indicates whether the employee is a permanent employee or a temporary worker. For example, the employees corresponding to nodes A, B, and C are permanent employees, while the employees corresponding to nodes D and E are temporary workers. Obviously, employees A, B, and C are relatively stable in the company, and the similarity of their information is also high. Therefore, the subgraph formed by nodes A, B, and C is a stable subgraph. Employees D and E are unstable in the company, and the similarity of their information is also very low. Therefore, the subgraph formed by nodes D and E is a noisy subgraph.
[0086] S13: The identified graph structure data is represented by the second graph neural network to obtain the vectorized representation of the stable subgraph and the vectorized representation of the noisy subgraph.
[0087] In this embodiment, after the first graph neural network labels the graph structure data, it inputs it into the second graph neural network. The second graph neural network performs representation processing on the labeled graph neural network to obtain vectorized representations of stable subgraphs and noisy subgraphs. For each graph structure data in the input dataset, after processing by the second graph neural network, the corresponding vectorized representations of stable subgraphs and noisy subgraphs can be obtained.
[0088] S14: Based on the vectorized representation of the noise subgraph, simulate a multi-distribution environment. Under the multi-distribution environment, make predictions based on the vectorized representation of the stable subgraph to obtain the corresponding prediction results.
[0089] In this embodiment, a multi-distribution environment refers to an environment with multiple different data distribution types.
[0090] In this embodiment, the noisy subgraph refers to the part of the graph data structure that may change at any time. The correlation between noise information and stable information in a graph data structure can lead to a decrease in the performance of the neural network when the distributions of the training and testing environments are inconsistent. A second graph neural network simulates a multi-distribution environment based on the vectorized representation of the noisy subgraph. Under this multi-distribution environment, predictions are made based on the vectorized representation of the stable subgraph to obtain the corresponding prediction results, thereby achieving the training of the entire graph structure data representation network.
[0091] In this embodiment, the steps for simulating a multi-distribution environment based on the vectorized representation of the noise subgraph, and for making predictions based on the graph structure data under the multi-distribution environment to obtain the corresponding prediction results are as follows:
[0092] S14-1: Perform clustering calculations on the vectorized representation of the noise subgraph to simulate the multi-distribution environment.
[0093] In this embodiment, clustering calculation involves grouping vectors that are close in distance together based on the distance between them.
[0094] In this embodiment, the vectorized representation of the noisy subgraphs of the graph structure data in the dataset is clustered. After the clustering is completed, a multi-distribution environment is simulated, in which the distribution of data is diverse.
[0095] S14-2: In the multi-distribution environment, perform the corresponding prediction task according to the vectorized representation of the stable subgraph to obtain the corresponding prediction result.
[0096] In this embodiment, under a multi-distribution environment, the corresponding prediction task is executed according to the vectorized representation of the stable subgraph. This allows the graph neural network to focus more on the information in the graph structure data that has a greater impact on the actual prediction result, while ignoring noise information. The prediction task can be any prediction task related to the graph structure data and can be set by the user.
[0097] For example, a dataset contains multiple graph-structured data, such as social network relationship graphs, company personnel relationship graphs, and school personnel relationship graphs. A second graph neural network clusters the noisy data in these graphs, simulating a multi-distribution environment. For the company personnel relationship graph, one prediction task is to predict the trend of the average age of company personnel. The stable subgraph is composed of nodes corresponding to permanent employees, while the noisy subgraph is composed of nodes corresponding to temporary workers. Because temporary workers may not be still with the company next year, this has a negative impact on predicting the trend of the company's average age. The stable subgraph provides a better prediction of the company's average age trend.
[0098] In this embodiment, in a multi-distribution environment, stable prediction is achieved by encouraging stable subgraphs, so that the information captured by the graph neural network focuses more on the real predictive information of the graph structure itself and ignores noise information, resulting in better representation and task performance of the trained model.
[0099] S15: For each original graph structure data in the original graph dataset, calculate the loss function between the prediction result and the label of the original graph structure data, optimize the parameters of the graph structure data representation network, and obtain the graph structure data representation model.
[0100] In this embodiment, when optimizing the parameters of the graph structure data representation network, the entire network is iteratively updated by using the graph structure data in the input original graph dataset and its corresponding prediction results. When the parameters are adjusted to the optimal value, the graph structure data representation model is obtained.
[0101] In this embodiment, for each original graph structure data in the original graph dataset, the specific steps for calculating the loss function between the prediction result and the label of the original graph structure data, and optimizing the parameters of the graph structure data representation network to obtain the graph structure data representation model are as follows:
[0102] S15-1: For each original graph structure data in the original dataset, calculate the loss function based on the prediction result and the label of the original graph structure data to obtain the corresponding loss value.
[0103] In this embodiment, the original graph structure data used to train the graph structure data representation network has corresponding labels, and the labels indicate the correct prediction results. When the corresponding prediction results are output from the second graph neural network, the prediction results are compared with the prediction results indicated on the labels using a loss function to obtain a loss value.
[0104] S15-2: Based on the loss value, perform gradient updates on the graph structure data representation network to obtain the graph structure data representation model.
[0105] In this embodiment, after the loss value is calculated, it is fed back into the graph structure data representation network. The graph representation network obtains the gradient value of the parameters based on the calculated loss value and performs gradient update on the graph structure data representation network. Gradient update is gradient descent update. Through gradient descent update, the loss value of the network can be minimized, thereby completing the parameter optimization of the graph structure data representation network. The graph structure data representation network after parameter optimization is called the graph structure data representation network.
[0106] S16: Using the graph structure data representation model, perform graph data-related tasks to obtain the target results of the graph data-related tasks.
[0107] In this embodiment, after obtaining the graph structure data representation model, any unlabeled graph structure data can be received to perform the prediction task. The specific steps are as follows:
[0108] S16-1: Receive the graph dataset corresponding to the graph data related task through the graph structure data representation model.
[0109] In this embodiment, the graph structure data representation model can perform predictions for various graph data-related tasks according to actual needs. For example, in drug analysis, the molecular structure diagram of the drug can be input, and in social network analysis, a social network graph can be input.
[0110] S16-2: Represent the graph dataset to obtain the graph representation vector corresponding to each graph structure data in the graph dataset.
[0111] S16-3: Based on the graph representation vector, and in conjunction with the corresponding task objective, a prediction is made to obtain the target result.
[0112] In this embodiment, the graph structure data representation model can vectorize the input graph structure data to obtain a graph representation vector. This graph representation vector contains the vectorized representation of the stable subgraphs in the graph structure data. Based on this graph representation vector, the task objective is predicted to obtain the target result.
[0113] For example, in a drug analysis task, the molecular structure diagram of a drug is used to obtain the graph representation vector of the diagram data, and then the type of the drug is predicted to obtain the prediction result.
[0114] In this embodiment of the application, taking drug analysis as an example, a model can be trained on a small number of labeled molecular graphs and then applied to a larger scale of unlabeled drugs with different data distributions and training methods for classification. In social network analysis, environment-adaptive graph representations can also complete the analysis under dynamic, evolutionary, and data distribution shifts, providing sufficiently stable and generalized results.
[0115] In this embodiment, stable subgraphs and noisy subgraphs in the graph structure data are identified. A multi-distribution environment is simulated through the vectorized representation of the noisy subgraphs. The prediction task is performed based on the vectorized representation of the stable subgraphs. This makes the neural network more focused on the stability information of the graph structure itself and will not be affected by noise information, which greatly increases the performance of the entire model in performing the task.
[0116] like Figure 2 As shown, Figure 2 This is a schematic diagram of the graph representation learning process for out-of-distribution generalization proposed in an embodiment of this application. After inputting graph structure data into the graph structure data representation network, stable subgraphs are first identified. After identification, noisy subgraphs are clustered for multi-distribution environments to simulate multi-distribution environments. Then, stable subgraphs are learned, and the task is predicted based on the stable subgraphs. Multiple batches of graph structure data are input into the graph structure data representation network for batch training and optimization. The trained graph structure data representation model can then obtain the out-of-distribution generalized vector representation.
[0117] In this embodiment, through the entire out-of-distribution generalization graph representation learning process, an out-of-distribution generalized vector representation can be obtained. This representation has generalization properties in multi-distribution environments, and the prediction results remain accurate in multi-distribution environments, thus ensuring the accuracy of the prediction.
[0118] Based on the same inventive concept, one embodiment of this application provides a graph representation learning device for distributional out-of-generalization. (Reference) Figure 3 , Figure 3This is a schematic diagram of a distributed out-of-generalization graph representation learning device 300 proposed in one embodiment of this application. Figure 3 As shown, the device includes:
[0119] Data input module 301 is used to input the original graph dataset into a graph structure data representation network, wherein the graph structure data representation network includes a first graph neural network and a second graph neural network;
[0120] The data recognition module 302 is used to recognize each original graph structure data in the original graph dataset through the first graph neural network, identify the stable subgraphs and noisy subgraphs in the original graph structure data, and obtain the recognized graph structure data.
[0121] The characterization processing module 303 is used to perform characterization processing on the identified graph structure data through the second graph neural network to obtain the vectorized representation of the stable subgraph and the vectorized representation of the noisy subgraph.
[0122] The result prediction module 304 is used to simulate a multi-distribution environment based on the vectorized representation of the noise subgraph, and to make predictions based on the vectorized representation of the stable subgraph under the multi-distribution environment to obtain the corresponding prediction results.
[0123] The parameter optimization module 305 is used to calculate the loss function by combining the prediction result with the label of the original graph structure data for each original graph structure data in the original graph dataset, and to optimize the parameters of the graph structure data representation network to obtain a graph structure data representation model.
[0124] The task execution module 306 is used to execute graph data-related tasks through the graph structure data representation model and obtain the target results of the graph data-related tasks.
[0125] Optionally, the data recognition module includes:
[0126] The node update submodule is used to update the node information of the original graph structure data to obtain graph structure data with updated node representations.
[0127] The similarity calculation submodule is used to calculate the similarity between nodes in the graph structure data after the node is updated, so as to obtain the similarity between each node and its neighboring nodes in the graph structure data.
[0128] The subgraph determination submodule is used to select nodes with similarity greater than a preset similarity threshold and the edges between those nodes to form the stable subgraph, and to form the noisy subgraph with the remaining nodes and edges.
[0129] Optionally, the node update submodule includes:
[0130] The node information acquisition submodule is used to acquire the node information of each node in the original graph structure data;
[0131] The neighbor aggregation submodule is used to perform neighbor aggregation on each node based on the node information of each node, so as to obtain the graph structure data after the updated node representation.
[0132] Optionally, the result prediction submodule includes:
[0133] The clustering calculation submodule is used to perform clustering calculations on the vectorized representation of the noise subgraph to simulate the multi-distribution environment;
[0134] The prediction task execution submodule is used to perform the corresponding prediction task based on the vectorized representation of the stable subgraph in the multi-distribution environment, and obtain the corresponding prediction result.
[0135] Optionally, the parameter optimization module includes:
[0136] The loss calculation submodule is used to calculate the corresponding loss value for each original graph structure data in the original dataset based on the prediction result and the label of the original graph structure data.
[0137] The model acquisition submodule is used to perform gradient updates on the graph structure data representation network based on the loss value to obtain the graph structure data representation model.
[0138] Optionally, the task execution module includes:
[0139] The data receiving submodule is used to receive the graph dataset corresponding to the graph data related tasks through the graph structure data representation model.
[0140] The graph representation vector acquisition submodule is used to represent the graph dataset and obtain the graph representation vector corresponding to each graph structure data in the graph dataset.
[0141] The target result acquisition submodule is used to predict the target result based on the graph representation vector and the corresponding task objective.
[0142] Based on the same inventive concept, another embodiment of this application provides a readable storage medium storing a computer program that, when executed by a processor, implements the steps in the distributed out-generalization graph representation learning method as described in any of the above embodiments of this application.
[0143] Based on the same inventive concept, another embodiment of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the graph representation learning method for distributed out-generalization described in any of the above embodiments of this application.
[0144] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0145] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0146] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0147] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0148] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0149] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0150] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0151] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0152] The above provides a detailed description of the distributed out-of-generalization graph representation learning method, apparatus, device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A graph representation learning method with distributional out-generalization, characterized in that, The method is used for social network analysis tasks; In the context of social network analysis tasks, the method includes: The original graph dataset is input into a graph structure data representation network, which includes a first graph neural network and a second graph neural network. The first graph neural network identifies each original graph structure data in the original graph dataset, identifying stable subgraphs and noisy subgraphs in the original graph structure data, and obtaining the identified graph structure data; in the case that the graph structure data is a social network relationship graph, the social network relationship graph is composed of points representing each person and edges representing the relationships between each person, and the node information of each node includes person name, gender, age, and work location; The identified graph structure data is represented by the second graph neural network to obtain the vectorized representation of the stable subgraph and the vectorized representation of the noisy subgraph. Based on the vectorized representation of the noise subgraph, a multi-distribution environment is simulated. Under this environment, prediction is made based on the vectorized representation of the stable subgraph to obtain the corresponding prediction result. In the case where the social network relationship graph is specifically a company personnel relationship graph, the prediction task is to predict the trend of the average age of company personnel. The stable subgraph is a subgraph composed of nodes corresponding to permanent staff, and the noise subgraph is a subgraph composed of nodes corresponding to temporary workers. Since temporary workers have a negative effect on predicting the trend of the company's average age, the trend of the company's average age is predicted based on the stable subgraph to obtain the corresponding prediction result. For each original graph structure data in the original graph dataset, the prediction result and the label of the original graph structure data are used to calculate the loss function, and the parameters of the graph structure data representation network are optimized to obtain the graph structure data representation model. The graph data representation model is used to perform graph data-related tasks and obtain the target results of the graph data-related tasks. In the social network analysis task, a social network relationship graph is input, and the graph data-related tasks of the social network analysis task are performed based on the graph data representation model to obtain the target results of the graph data-related tasks of the social network analysis task.
2. The method according to claim 1, characterized in that, The first graph neural network identifies each original graph structure data in the original graph dataset, identifying stable subgraphs and noisy subgraphs within the original graph structure data, including: The original graph structure data is updated with node information to obtain graph structure data with updated node representations; The similarity between nodes is calculated on the graph structure data after the node representation is updated, so as to obtain the similarity between each node and its neighboring nodes in the graph structure data. Based on the similarity, the nodes with similarity greater than a preset similarity threshold are selected and the edges between them form the stable subgraph, and the remaining nodes and edges form the noisy subgraph.
3. The method according to claim 2, characterized in that, The original graph structure data is updated with node information to obtain updated node representation graph structure data, including: Obtain the node information of each node in the original graph structure data; Based on the node information of each node, neighbor aggregation is performed on each node to obtain the graph structure data after the node is updated.
4. The method according to claim 1, characterized in that, Based on the vectorized representation of the noise subgraph, a multi-distribution environment is simulated. Under this environment, predictions are made based on the vectorized representation of the stable subgraph to obtain corresponding prediction results, including: Clustering calculations are performed on the vectorized representation of the noise subgraph to simulate the multi-distribution environment; In the multi-distribution environment, the corresponding prediction task is performed based on the vectorized representation of the stable subgraph to obtain the corresponding prediction result.
5. The method according to claim 1, characterized in that, For each original graph structure data in the original graph dataset, a loss function is calculated between the prediction result and the label of the original graph structure data, and the parameters of the graph structure data representation network are optimized to obtain a graph structure data representation model, including: For each original graph structure data in the original dataset, a loss function is calculated based on the prediction result and the label of the original graph structure data to obtain the corresponding loss value. Based on the loss value, the graph structure data representation network is updated with gradients to obtain the graph structure data representation model.
6. The method according to claim 1, characterized in that, By using the graph structure data representation model, graph data-related tasks are performed to obtain the target results of the graph data-related tasks, including: The graph dataset corresponding to the graph data-related tasks is received through the graph structure data representation model. The graph dataset is characterized to obtain a graph representation vector corresponding to each graph structure data in the graph dataset; Based on the graph representation vector, prediction is performed in conjunction with the corresponding task objective to obtain the target result.
7. A graph representation learning device with distributed out-generalization, characterized in that, For social network analysis tasks, the apparatus includes: A data input module is used to input the original graph dataset into a graph structure data representation network, wherein the graph structure data representation network includes a first graph neural network and a second graph neural network. The data recognition module is used to recognize each original graph structure data in the original graph dataset through the first graph neural network, identify the stable subgraphs and noisy subgraphs in the original graph structure data, and obtain the recognized graph structure data; when the graph structure data is a social network relationship graph, the social network relationship graph is composed of points representing each person and edges representing the relationship between each person, and the node information of each node includes person name, gender, age, and work location; The characterization processing module is used to perform characterization processing on the identified graph structure data through the second graph neural network to obtain the vectorized representation of the stable subgraph and the vectorized representation of the noisy subgraph. The result prediction module is used to simulate a multi-distribution environment based on the vectorized representation of the noise subgraph, and to make predictions based on the vectorized representation of the stable subgraph under the multi-distribution environment, thereby obtaining the corresponding prediction results. In the case where the social network relationship graph is specifically a company personnel relationship graph, the prediction task is to predict the trend of the average age of company personnel. The stable subgraph is a subgraph composed of nodes corresponding to permanent staff, and the noise subgraph is a subgraph composed of nodes corresponding to temporary workers. Since temporary workers have a negative effect on predicting the trend of the company's average age, the trend of the company's average age is predicted based on the stable subgraph, thereby obtaining the corresponding prediction results. The parameter optimization module is used to calculate the loss function by combining the prediction result with the label of the original graph structure data for each original graph structure data in the original graph dataset, and to optimize the parameters of the graph structure data representation network to obtain the graph structure data representation model. The task execution module is used to execute graph data-related tasks through the graph structure data representation model and obtain the target results of the graph data-related tasks. In the social network analysis task, a social network relationship graph is input, and the graph data-related tasks of the social network analysis task are executed based on the graph structure data representation model to obtain the target results of the graph data-related tasks of the social network analysis task.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Environment-adaptive graph representation method and device, electronic equipment and medium
CN114004332A