Heterogeneous graph data node embedding feature extraction model training method, embedding feature extraction method, node classification method and device
By deploying cross-client samplers and local generators and discriminators in federated learning of heterogeneous graph data, combined with adversarial learning, the problem of cross-client information utilization is solved, and the learning quality and downstream task efficiency of heterogeneous graph neural networks are improved while protecting privacy.
Patent Information
- Application Number
- CN202311071070.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-23
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2043-08-23
AI Technical Summary
In federated learning of heterogeneous graph data, existing technologies cannot effectively utilize cross-client information, resulting in data silos and privacy protection difficulties. Traditional methods cannot achieve effective heterogeneous graph neural network training while ensuring data privacy.
A federated learning framework is adopted. By deploying cross-client samplers and local generators and discriminators on the client, combined with adversarial learning, the top-k random walk algorithm is used to extract sample embedding features, and model parameters are aggregated on the central server to build a heterogeneous graph data node embedding feature extraction model.
Effectively protect data privacy, reduce the impact of client data differences, improve the learning quality of heterogeneous graph neural networks, and improve the execution efficiency of downstream tasks.
Smart Images

Figure CN117272017B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a heterogeneous graph data node embedding feature extraction model training method, an embedding feature extraction method, a node classification method and a device. Background Art
[0002] With the development of information technology, graph data has become increasingly prevalent in the real world. Heterogeneous information networks, or heterogeneous graphs in particular, feature a variety of node and edge types, making them a convenient model for real-world data networks. They have garnered widespread attention in fields such as citation networks, social networks, and recommender systems. Because heterogeneous graph data carries rich semantic and structural information, heterogeneous graph mining algorithms that can fully extract these features have also garnered widespread attention. Heterogeneous graph embedding technology has become a powerful tool, and many of its research results have been successfully applied to real-world systems such as recommender systems, text analysis, and network security.
[0003] Heterogeneous graph neural networks can analyze and process heterogeneous graph data. However, due to privacy protection requirements, heterogeneous graph data held by different entities in the network is not publicly available, leading to the problem of data silos. For example, when using heterogeneous social network data from various platforms to analyze public safety emergencies, trusted third parties need to consume a large amount of storage space and transmission time to aggregate massive amounts of data from all participants. Directly transmitting sensitive information related to security incidents also poses high-risk privacy issues, making it impossible for traditional centralized and distributed computing paradigms to achieve training goals while ensuring data privacy. Unlike other forms of private data, heterogeneous graph data also has cross-client associations, which means that heterogeneous graph neural networks trained locally using traditional federated learning methods lose cross-client information. Summary of the Invention
[0004] In view of this, an embodiment of the present invention provides a heterogeneous graph data node embedding feature extraction model training method, an embedding feature extraction method, a node classification method and a device to eliminate or improve one or more defects existing in the prior art and solve the problem that the prior art cannot pay attention to cross-client information in multi-agent local training.
[0005] In one aspect, the present invention provides a method for training a node embedding feature extraction model for heterogeneous graph data. The method is performed based on multiple interconnected clients and a central server, each of the clients holds a heterogeneous subgraph of a portion of the heterogeneous graph data as private data, and each client also deploys a cross-client sampler. The method includes the following steps:
[0006] Initializing global model parameters of the global generator and the global discriminator by the central server;
[0007] In one training round, the execution steps include:
[0008] The central server sends the global model parameters to each client and constructs a local generator and a local discriminator. The local generator outputs a negative sample embedding feature of the target node based on the locally held original features and weights of the target node's intra-client neighbor nodes in the heterogeneous subgraph, as well as the original features and weights of the target node's cross-client neighbor nodes provided by the associated client, while adding noise data. The original features are feature vectors preliminarily extracted based on the data types of the intra-client neighbor nodes and the cross-client neighbor nodes.
[0009] The client's local cross-client sampler samples the target node's intra-client neighbor nodes and the cross-client neighbor nodes based on a top-k random walk algorithm, and calculates positive sample embedding features based on the sampled original features and weighted aggregation of the intra-client neighbor nodes and the cross-client neighbor nodes;
[0010] The local discriminator performs a task of discriminating the type of neighboring nodes of the target node and a task of identifying positive and negative samples based on the negative sample embedding features and the positive sample embedding features;
[0011] Based on adversarial learning, the local generator updates its parameters by minimizing the recognition success rate loss of the local discriminator on the negative sample embedding feature, and the local discriminator updates its parameters by maximizing the recognition task success rate loss of the neighbor node type and the recognition task success rate of the positive and negative samples;
[0012] Each client sends the updated parameters of the local generator and the local discriminator to the central server for parameter aggregation;
[0013] Performing a plurality of training rounds according to set conditions to update the global generator, the global discriminator, the local generator, and the local discriminator;
[0014] A target embedding feature extraction model is constructed on each client. The target embedding feature extraction model extracts the first embedding feature of the specified target node based on the local generator of the corresponding client for the heterogeneous subgraph it holds, and aggregates the first embedding feature with the original features of the client's neighbor nodes and cross-client neighbor nodes of the specified target node to obtain the embedding feature of the specified target node.
[0015] In some embodiments, the global generator and the local generator adopt multi-layer perceptrons with the same structure, and the global discriminator and the local discriminator adopt multi-layer perceptrons with the same structure.
[0016] In some embodiments, the local generator performs parameter update by minimizing the recognition success rate of the local discriminator on the negative sample embedding feature to construct a loss, wherein the constructed loss function expression is:
[0017]
[0018] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client, G i represents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client.
[0019] In some embodiments, in the method, the discriminator performs the task of identifying the type of neighbor nodes of the target node, and the probability calculation formula for the neighbor relationship between the target node v and the neighbor node v is r is:
[0020]
[0021] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; represents the transpose of the embedding feature of node u, represents the weight corresponding to the neighbor relationship r, h v represents the embedded features of the target node v, represents the parameters of the local discriminator of the i-th client;
[0022] The discriminator calculates the probability that the neighbor relationship between the target node and the neighbor node is r, and outputs a discrimination result of the neighbor node type.
[0023] In some embodiments, the local discriminator performs parameter update by constructing a loss by maximizing the success rate of the identification task of the neighbor node type and the recognition task of the positive and negative samples. The loss function of the recognition task of the positive and negative samples is:
[0024]
[0025] Where u represents a given node, u∈Vi , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, h v Represents the embedded features of the target node v, HG i represents the heterogeneous subgraph held by the i-th client, G i represents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client;
[0026] The local discriminator constructs a loss to perform parameter update by maximizing the success rate of the neighbor node type identification task and the positive and negative sample recognition task. The loss function of the neighbor node type identification task is:
[0027]
[0028] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of neighbor node, r∈R, R represents the edge set; r′ represents the error relationship between node u and target node v, R′=R / {r}, h′ v represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client;
[0029] The local discriminator constructs a loss to update parameters by maximizing the success rate of the identification task of neighbor node types and the recognition task of positive and negative samples. The joint loss used is:
[0030]
[0031] In some embodiments, in the method, the original features of the intra-client neighbor nodes and the cross-client neighbor nodes are extracted in the following manner:
[0032] If the data type is text, the bag-of-words vector is used as the original feature;
[0033] If the data type is image, the pixel value vector is directly used as the original feature, or the original feature is extracted through a pre-trained neural network.
[0034] On the other hand, the present invention provides a subgraph-level federated heterogeneous node embedding feature extraction method, which is executed based on multiple interconnected clients and a central server. Each of the clients holds a heterogeneous subgraph of a portion of heterogeneous graph data as private data. For a specified target node of a specified client, the target embedding feature extraction model in the above-mentioned heterogeneous graph data node embedding feature extraction model training method deployed on the specified client is used to extract the target embedding feature.
[0035] On the other hand, the present invention also provides a subgraph-level federated heterogeneous node classification method, which is executed based on multiple interconnected clients and a central server, each of which holds a heterogeneous subgraph of a portion of heterogeneous graph data as private data. For a specified target node of a specified client, the specified client uses the above-mentioned subgraph-level federated heterogeneous node embedding feature extraction method to obtain the target embedding feature of the specified target node;
[0036] The target embedding features are input into a pre-trained logistic regression model to perform node classification.
[0037] On the other hand, the present invention also provides a heterogeneous graph data management system, which includes multiple interconnected clients and a central server, each of which holds a heterogeneous subgraph of a portion of the heterogeneous graph data as private data, and the clients and the central server execute the steps of the above method.
[0038] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
[0039] The beneficial effects of the present invention are at least:
[0040] The heterogeneous graph data node embedding feature extraction model training method, embedding feature extraction method, node classification method, and device described in the present invention are based on federated learning. Generators and discriminators are constructed locally on each client to train local models using adversarial learning, and model parameters are aggregated on a central server, effectively ensuring data privacy. Simultaneously, during local training, each client obtains the raw features of cross-client neighbor nodes associated with the target node through cross-client communication. Based on top-k random walk sampling, each type of neighbor participates in the embedding learning process, reducing the impact of client data differences on training, improving the learning quality of the federated heterogeneous graph neural network, and increasing the execution efficiency of downstream subtasks.
[0041] Additional advantages, objects, and features of the present invention will be set forth in part in the following description and will become apparent to those skilled in the art upon examination of the following or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained by the structures particularly pointed out in the description and drawings.
[0042] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present invention are not limited to the above specific descriptions, and the above and other purposes that can be achieved by the present invention will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention. In the drawings:
[0044] Figure 1 This is an overall structural diagram of the heterogeneous graph data node embedding feature extraction model training method described in one embodiment of the present invention.
[0045] Figure 2 This is a heterogeneous graph adversarial network of a local client in the heterogeneous graph data node embedding feature extraction model training method described in one embodiment of the present invention.
[0046] Figure 3 This is a schematic diagram of a method for training a heterogeneous graph data node embedding feature extraction model according to an embodiment of the present invention, in which target node features are obtained by aggregating neighbor node features. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0048] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, the accompanying drawings only show structures and / or processing steps closely related to the solutions according to the present invention, while other details that are not closely related to the present invention are omitted.
[0049] It should be emphasized that the term "include / comprises" when used herein refers to the existence of features, elements, steps or components, but does not exclude the existence or addition of one or more other features, elements, steps or components.
[0050] It should also be noted that, unless otherwise specified, the term "connection" herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0051] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0052] Heterogeneous graph data refers to data structures that contain multiple types of nodes and edges in a graph. Traditional graph data is typically homogeneous, meaning it contains only one type of node and one type of edge. Heterogeneous graph data, however, is more complex and can represent richer relationships and information. In heterogeneous graph data, nodes and edges can be of different types, each type potentially representing a different entity or concept, while different types of edges can represent different types of relationships. For example, heterogeneous graph data in a social network might contain user nodes, post nodes, and comment nodes, as well as multiple types of edges, such as between users and posts, between users, and between users and comments.
[0053] The Heterogeneous Graph Neural Network (HGNN) is a graph neural network model capable of processing heterogeneous graph data. Compared to traditional graph neural networks, HGNN can handle the diverse node and relationship types in heterogeneous graphs, thereby better expressing the complex structure and characteristics of graph data. Specifically, HGNN integrates and transfers information between different node and relationship types to learn the feature representation of each node in different types of relationships.
[0054] In practical applications, when using heterogeneous graph neural networks to represent features of heterogeneous graph data and execute downstream tasks, the global heterogeneous graph is divided among different clients. Some connections are difficult to incorporate into any one client's training because the two endpoints are on different clients. To protect privacy, federated learning can be introduced for model training. However, these cross-client edges pose a significant challenge to subgraph-level heterogeneous graph neural networks in federated scenarios. When neighboring nodes and their corresponding edges are not local to the client, local training on the client cannot utilize this cross-client information, resulting in information loss.
[0055] Existing technologies primarily focus on the application of homogeneous graphs in federated scenarios. Some treat graph data directly as Euclidean data, disregarding the existence of cross-client information and employing common federated algorithms to process graph data. Others consider exchanging this information directly on the client side through privacy-preserving communication, enabling neural networks to utilize more comprehensive topological information. When the federated graph information to be processed is heterogeneous, using federated homogeneous graph processing methods fails to consider the impact of diverse node and edge types on federated graph neural networks, potentially losing rich structural information and negating the advantages of heterogeneous graph data.
[0056] The distributed data storage and computing environment makes it impossible for federated learning to evaluate and guarantee the data quality of each data holder. The structural heterogeneity of heterogeneous graphs makes heterogeneous graphs more vulnerable to data robustness threats than Euclidean data or even homogeneous graphs. Existing technologies either focus on the robustness of Euclidean data in federated scenarios or on the robustness of heterogeneous graphs in centralized training, ignoring the fact that the combined effect of the heterogeneity of the distributed environment and the structural heterogeneity of heterogeneous graphs will amplify the interference of noise on the model.
[0057] This paper combines federated learning with heterogeneous graph neural networks. On the one hand, it considers how to better protect the structural information of heterogeneous graphs as non-Euclidean data in federated learning; on the other hand, it considers the impact of data heterogeneity, which is the focus of federated learning, on the robustness of federated heterogeneous graph algorithms.
[0058] Specifically, the present invention provides a method for training a feature extraction model for node embedding in heterogeneous graph data. The method is executed based on multiple interconnected clients and a central server. Each client holds a heterogeneous subgraph of a portion of the heterogeneous graph data as private data. Each client also deploys a cross-client sampler. Figure 1 The method includes the following steps S101 to S104:
[0059] Step S101: The central server initializes the global model parameters of the global generator and the global discriminator.
[0060] Step S102: In one training round, the execution steps include steps S1021 to S1024:
[0061] Step S1021: The central server sends the global model parameters to each client and constructs a local generator and a local discriminator. The local generator outputs the negative sample embedding features of the target node based on the original features and weights of the target node's intra-client neighbor nodes in the locally held heterogeneous subgraph, as well as the original features and weights of the target node's cross-client neighbor nodes provided by the associated client, while adding noise data; the original features are feature vectors preliminarily extracted for the data types of the intra-client neighbor nodes and cross-client neighbor nodes.
[0062] Step S1022: The client's local cross-client sampler samples the target node's intra-client neighbor nodes and cross-client neighbor nodes based on the top-k random walk algorithm, and calculates the positive sample embedding features based on the original features and weight aggregation of the sampled intra-client neighbor nodes and cross-client neighbor nodes.
[0063] Step S1023: The local discriminator performs the task of discriminating the type of neighboring nodes of the target node and the task of identifying positive and negative samples based on the negative sample embedding features and the positive sample embedding features.
[0064] Step S1023: Based on adversarial learning, the local generator updates its parameters by minimizing the loss of the local discriminator's recognition success rate for the embedded features of negative samples, and the local discriminator updates its parameters by maximizing the loss of the recognition task of the neighbor node type and the recognition task success rate of the positive and negative samples.
[0065] Step S1024: Each client sends the updated parameters of the local generator and local discriminator to the central server for parameter aggregation.
[0066] Step S103: Perform multiple training rounds according to the set conditions to update the global generator, global discriminator, local generator and local discriminator.
[0067] Step S104: Construct a target embedding feature extraction model on each client. The target embedding feature extraction model extracts the first embedding feature of the specified target node based on the local generator of the corresponding client for the heterogeneous subgraph it holds, and aggregates the first embedding feature with the original features of the client's neighbor nodes and cross-client neighbor nodes of the specified target node to obtain the embedding feature of the specified target node.
[0068] In steps S101 and S102, adversarial learning is used to train a model that effectively captures node embedding features. The global generator and local generators use multi-layer perceptrons with the same structure, while the global discriminator and local discriminator use multi-layer perceptrons with the same structure. During initialization, the model parameters of the global generator and global discriminator are randomly deployed.
[0069] In steps S1021-S1024, based on the federated learning process, the central server distributes the initialized global generator and global discriminator to each client, forming a local generator and local discriminator. Each client then trains the local generator and local discriminator using adversarial learning, utilizing its locally stored heterogeneous subgraph. After each round of training, each client sends the parameters of its local generator and local discriminator to the central server for aggregation. Specifically, the FedAvg algorithm can be used to perform parameter aggregation.
[0070] In steps S1021 to S1022, the local generator performs the embedding feature extraction. Based on a given heterogeneous subgraph, the local generator generates a fake embedding feature of the target node as a negative sample embedding feature while adding noise data to deceive the discriminator as much as possible. The noise data can be Gaussian noise. In this process, the local generator synchronously introduces the original features and weights of the client's local neighbor nodes within the client, as well as the original features and weights of the cross-client neighbor nodes. Based on the known node association relationships in the heterogeneous graph data, the original features and weights of the neighbor nodes associated with the target node in other clients are transmitted between clients through communication.
[0071] In some embodiments, the original features of the intra-client neighbor nodes and the cross-client neighbor nodes are extracted as follows:
[0072] If the data type is text, the bag-of-words vector is used as the original feature; if the data type is image, the pixel value vector is directly used as the original feature, or the original feature is extracted through a pre-trained neural network.
[0073] At the same time, the cross-client sampler samples the target node's neighbor nodes within the client and across client nodes based on the top-k random walk algorithm, and directly aggregates and calculates the embedded features of the target node based on the corresponding original features and weights. For details, refer to Figure 3 Based on the category of the neighboring nodes, the corresponding weight matrix is used to map the feature vectors of the neighboring nodes to the space where the target node features are located and aggregate them. No noise data is added to this part, so it is embedded as a positive sample feature.
[0074] In step S1023 , the discriminator performs two tasks: one is to judge the positive and negative samples with and without noise data, and the other is to judge the type of neighbor nodes associated with the target node.
[0075] In the adversarial learning process, the local generator updates its parameters by minimizing the recognition success rate of the local discriminator on the negative sample embedding features. The constructed loss function expression is:
[0076]
[0077] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client, G irepresents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client.
[0078] The local discriminator performs the task of identifying the neighbor node type of the target node. The probability calculation formula for the neighbor relationship between the target node v and the neighbor node v is r is:
[0079]
[0080] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; represents the transpose of the embedding feature of node u, represents the weight corresponding to the neighbor relationship r, h v represents the embedded features of the target node v, represents the parameters of the local discriminator of the i-th client.
[0081] The local discriminator calculates the probability that the neighbor relationship between the target node and the neighbor node is r, and outputs the identification result of the neighbor node type.
[0082] The local discriminator constructs the loss function to update the parameters by maximizing the success rate of the identification task of the neighbor node type and the recognition task of positive and negative samples. The loss function of the recognition task of positive and negative samples is:
[0083]
[0084] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, h v Represents the embedded features of the target node v, HG i represents the heterogeneous subgraph held by the i-th client, G i represents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client.
[0085] The local discriminator constructs the loss function for parameter update by maximizing the success rate of the identification task of the neighbor node type and the recognition task of positive and negative samples. The loss function of the neighbor node type identification task is:
[0086]
[0087] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of neighbor node, r∈R, R represents the edge set; r′ represents the error relationship between node u and target node v, R′=R / {r}, h′ v represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client;
[0088] The local discriminator constructs the loss for parameter update by maximizing the success rate of the identification task of the neighbor node type and the recognition task of positive and negative samples. The joint loss used is:
[0089]
[0090] In step S1024, after each client completes training locally, the model parameters are sent to the central server for aggregation, mainly using the FedAvg algorithm.
[0091] In step S103, after the central server completes the aggregation, the central server distributes the aggregated parameters to each client for a new round of training, which is repeated multiple times. The condition for completing the training here can be reaching a set number of iterations.
[0092] In step S104, to extract embedded features for the target node, each client uses the locally trained local generator and the locally held heterogeneous subgraph to extract features for the target node. The original features of the client's neighboring nodes and cross-client neighboring nodes are then aggregated to obtain the embedded features for the target node. The aggregation here can be seen in step S1022.
[0093] On the other hand, the present invention provides a subgraph-level federated heterogeneous node embedding feature extraction method, which is executed based on multiple interconnected clients and a central server. Each client holds a heterogeneous subgraph of a portion of heterogeneous graph data as private data. For a specified target node of a specified client, the target embedding feature extraction model in the heterogeneous graph data node embedding feature extraction model training method described in steps S101 to S104 above deployed on the specified client is used to extract the target embedding feature.
[0094] On the other hand, the present invention also provides a subgraph-level federated heterogeneous node classification method, which is executed based on multiple interconnected clients and a central server. Each client holds a heterogeneous subgraph of a part of the heterogeneous graph data as private data. For the specified target node of the specified client, the specified client uses the above-mentioned subgraph-level federated heterogeneous node embedding feature extraction method to obtain the target embedding feature of the specified target node; the target embedding feature is input into a pre-trained logistic regression model to perform node classification.
[0095] On the other hand, the present invention also provides a heterogeneous graph data management system, which includes multiple interconnected clients and a central server, each of which holds a heterogeneous subgraph of a portion of the heterogeneous graph data as private data, and the clients and the central server execute the steps of the above method.
[0096] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.
[0097] The present invention will be described below in conjunction with a specific embodiment:
[0098] This embodiment provides a solution for extracting embedded features of heterogeneous graph data, and performs downstream node classification tasks based on the extracted embedded features.
[0099] First, each client independently trains the heterogeneous graph generation adversarial network based on local data to obtain a local model. Then, the client uploads the local adversarial network parameters to the central server. The central server obtains the global adversarial network through federated averaging. The central server further sends the global model to the client to guide the client to continue training the local model. The overall framework of this embodiment is as follows: Figure 1 As shown in the figure. To address data disparity between clients in federated learning, a federated robust neighbor sampling strategy was introduced. This strategy makes better use of cross-client information and increases the model's robustness to heterogeneous data from different clients. To enhance the model's robustness to noisy data, a noise relation discriminator was added. By training the federated error relation discriminator, each discriminator can improve its local discriminator's performance based on the global discriminator when local data is contaminated, thereby correctly identifying contaminated data and ensuring feature embedding accuracy.
[0100] This method constructs the minimax optimization of the generator and discriminator locally based on the known data structure. The specific structure is as follows Figure 2 As shown. The Generative Adversarial Network is a deep learning algorithm that consists of two neural networks, the Discriminator D and the Generator G, which compete with each other. The Discriminator D learns how to get the best results from the data distribution P. data(features, label distribution, data volume distribution) of real data and fake data containing noise perturbations; the generator G learns how to Z Generating fake data that is as close to real data as possible to obtain a higher discriminator score can be expressed as follows:
[0101]
[0102] Noise distribution in data refers to the fact that in real-world applications, due to data quality limitations, some node features may contain noise, such as white noise in images or garbled text. Furthermore, some originally unrelated nodes may introduce erroneous relationships during graph construction. This example simulates noisy data by adding Gaussian noise and erroneous relationships to node features. Adversarial training of the generator and discriminator continuously improves the performance of both, resulting in accurate feature embedding. A logistic regression model is then used to classify the generated features, enabling node classification in heterogeneous graphs.
[0103] 1) Federated Heterogeneous Graph Node Embedding Generator
[0104] Since the data to be processed is heterogeneous graph data, the generative adversarial network is also required to consider the topological relationship between the data. Taking client i as an example, its generator G i It is necessary to generate fake samples that are as real as possible under the condition of perceiving the topological relationship. i and r∈R, the generator Will output a hidden layer embedding h of the target node v v Make<u,r,v> As close as possible to the real existence in the subgraph HG i The data in the generator G i First, we get the neighbor embedding based on the neighbor node embedding and neighbor weight aggregation As an approximate embedding of the r-type neighbor nodes that may be node u, in order to enhance the generator’s ability to deceive the discriminator, Gaussian noise with a standard deviation of σ is added to this approximate embedding. And input it into the multi-layer perceptron (MLP) to extract features to obtain the hidden layer features of the target node v.
[0105]
[0106] Among them, f is the activation function, W i * and is the parameter of the MLP on client i, and is also the target parameter that needs to be aggregated to the global model. Generator optimization - logD(G(·;θ G );θ D) will achieve better results than constructing a normal loss function, so the local training loss function of the generator part is as follows:
[0107]
[0108] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client, G i represents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client.
[0109] 2) Federated Heterogeneous Graph Noise Relation Discriminator
[0110] For the discriminator on client i Its main purpose is to identify the potential connectivity between neighbor node u and target node v. Where u and v are both from the child node set V i , relation r from relation set R indicates the neighbor type of nodes u and v, h v is the hidden layer representation of the target node v, is the parameter to be learned by the discriminator, and is also the target parameter of the federated aggregated global discriminator. is the adjacency weight corresponding to relation r Given the target node v, the sampled neighbor relationship r, and the neighbor node u, the discriminator calculates the probability that the neighbor relationship between node v and node u is r, as follows:
[0111]
[0112] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; represents the transpose of the embedding feature of node u, represents the weight corresponding to the neighbor relationship r, h v represents the embedded features of the target node v, represents the parameters of the local discriminator of the i-th client.
[0113] when<u,r,v> Sampled from the real data subset V on the clienti When the discriminator outputs a high probability; conversely, when the triplet is a negative sample, the discriminator outputs a low probability. Therefore, in local training, the discriminator first calculates the loss of positive and negative samples as follows:
[0114]
[0115] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, h v Represents the embedded features of the target node v, HG i represents the heterogeneous subgraph held by the i-th client, G i represents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client.
[0116] To ensure that the discriminator can correctly identify positive samples even in federated scenarios where the topology of heterogeneous graph data varies between clients, and even in cases where some client data is of low quality and noisy, it is necessary to enhance the discriminator's ability to identify negative samples with incorrect relationships. Specifically, the current negative samples mainly consist of graph data containing incorrect node embedding information. It is necessary to further increase negative samples with incorrect relationships and train the discriminator accordingly to improve its ability to identify these samples. Based on the identification of positive and negative samples, the loss is constructed as:
[0117]
[0118] Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of neighbor node, r∈R, R represents the edge set; r′ represents the error relationship between node u and target node v, R′=R / {r}, h′ v represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client;
[0119] Therefore, the discriminator D i The loss function is:
[0120]
[0121] 3) Cross-client federated heterogeneous graph neighbor sampling
[0122] In each client, the heterogeneous graph neural network needs to be aggregated based on the neighbor information of the target node, and this information can be communicated in advance before training, so as to fully utilize the cross-client information. For the generator G on the i-th client i For example, the embedding h′ generated for the target node v v Mainly relies on neighbor node characteristics and G i Local neighbor weight parameter Similarly for the discriminator D i For example, to determine whether a sample is positive or negative, only as well as Therefore, client i only needs to receive and Where j = 1, 2, ..., K, and j ≠ i, u ∈ N v , N v is the neighbor of the target node v. It should be noted that although client i receives neighbor node features from other clients, due to the local training of each client, the model parameters θ={W,b,M D ,M G} are all different, and the information transmitted between clients is an aggregation of features and parameter weights, making it impossible for client i to infer node information of other clients based on its local parameters. This also satisfies the processing strategy of federated learning when processing cross-client graph information.
[0123] In order to ensure the quality of the target node embedding information, it is necessary to fairly sample heterogeneous neighbors during training to prevent the uneven distribution of node types in the local heterogeneous graph from affecting the target node embedding by a large number of node types. To this end, FedHGAN (Federated Hierarchical Generative Adversarial Network) adopts a Top-K random walk strategy to sample the target node neighbors. Specifically, the Top-K random walk strategy first samples the neighbors of node v with equal probability to obtain n s neighbor nodes, and then for each type of node a in the node type set A, intercept the first k sampled nodes. a Nodes are used as sampled neighbors of this type of node. This sampling method can firstly obtain the random sampling results of all types fairly, while at the same time ensuring that the sampled neighbors will not be affected by the data distribution and have extreme cases.
[0124] 4) Network training
[0125] This embodiment builds a set of discriminators D on each client. i and generator G i, the client first fixes in the Epoch round of local training Sampling Top-K random walk algorithm updates after positive and negative sampling To improve the performance of the discriminator, and then fix And use the discriminator that can better distinguish positive and negative samples to train the generator and update Each training round first updates n D The discriminator updates n G The generator sends local parameters to the server after completing the local training round. The server then aggregates the model parameters on each client through the FedAvg algorithm to obtain the global model θ Global , and then use the global model to guide the local model to complete the training.
[0126] Corresponding to the above method, the present invention also provides an apparatus / system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the apparatus / system implements the steps of the method described above.
[0127] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium may be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the art.
[0128] Therefore, this embodiment uses adversarial training to construct discriminators and generators on local clients to better aggregate neighbor node information for heterogeneous node embedding. The central server aggregates local models to obtain a global model that is robust to data heterogeneity and further guides local client training. This embodiment also proposes a cross-client federated heterogeneous graph data sampling algorithm to help federated heterogeneous graph models better utilize cross-client heterogeneous graph information, fairly sample various neighbors to participate in embedding learning, reduce the impact of client data differences on training, and improve the learning quality of federated heterogeneous graph neural networks.
[0129] In summary, the heterogeneous graph data node embedding feature extraction model training method, embedding feature extraction method, node classification method and device described in the present invention are based on the form of federated learning. A generator and a discriminator are constructed locally on each client to train the local model using adversarial learning, and the model parameters are aggregated on the central server to effectively ensure data privacy. At the same time, during the local training process, each client obtains the original features of the cross-client neighbor nodes associated with the target node through cross-client communication, and participates in the embedding learning of various types of neighbors based on the sampling of the top-k random walk level, thereby reducing the impact of client data differences on training, improving the learning quality of the federated heterogeneous graph neural network, and improving the execution efficiency of downstream subtasks.
[0130] It should be understood by those skilled in the art that the various exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0131] It should be understood that the present invention is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted. In the above embodiments, several specific steps are described and illustrated as examples. However, the method of the present invention is not limited to the specific steps described and illustrated. Those skilled in the art may make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present invention.
[0132] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.
[0133] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations to the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for training a heterogeneous graph data node embedding feature extraction model, characterized in that: The method is performed based on a plurality of interconnected clients and a central server, wherein each client holds a portion of a heterogeneous subgraph of heterogeneous graph data as private data, and each client further deploys a cross-client sampler. The method comprises the following steps: Initializing global model parameters of the global generator and the global discriminator by the central server; In one training round, the execution steps include: The central server sends the global model parameters to each client and constructs a local generator and a local discriminator. The local generator outputs a negative sample embedding feature of the target node based on the locally held original features and weights of the target node's intra-client neighbor nodes in the heterogeneous subgraph, as well as the original features and weights of the target node's cross-client neighbor nodes provided by the associated client, while adding noise data. The original features are feature vectors preliminarily extracted based on the data types of the intra-client neighbor nodes and the cross-client neighbor nodes. The client's local cross-client sampler samples the target node's intra-client neighbor nodes and the cross-client neighbor nodes based on a top-k random walk algorithm, and calculates positive sample embedding features based on the sampled original features and weighted aggregation of the intra-client neighbor nodes and the cross-client neighbor nodes; The local discriminator performs a task of discriminating the type of neighboring nodes of the target node and a task of identifying positive and negative samples based on the negative sample embedding features and the positive sample embedding features; Based on adversarial learning, the local generator updates its parameters by minimizing the loss of the local discriminator's recognition success rate for the negative sample embedding feature, and the local discriminator updates its parameters by maximizing the loss of the recognition task success rate for the neighbor node type and the recognition task success rate for the positive and negative samples; Each client sends the updated parameters of the local generator and the local discriminator to the central server for parameter aggregation; Performing a plurality of training rounds according to set conditions to update the global generator, the global discriminator, the local generator, and the local discriminator; A target embedding feature extraction model is constructed on each client. The target embedding feature extraction model extracts the first embedding feature of the specified target node based on the local generator of the corresponding client for the heterogeneous subgraph it holds, and aggregates the first embedding feature with the original features of the client's neighbor nodes and cross-client neighbor nodes of the specified target node to obtain the embedding feature of the specified target node.
2. The heterogeneous graph data node embedding feature extraction model training method according to claim 1 is characterized in that: The global generator and the local generator adopt multi-layer perceptrons with the same structure, and the global discriminator and the local discriminator adopt multi-layer perceptrons with the same structure.
3. The heterogeneous graph data node embedding feature extraction model training method according to claim 1 is characterized in that: The local generator updates parameters by minimizing the recognition success rate of the local discriminator on the negative sample embedding feature, wherein the constructed loss function expression is: Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client, G i represents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client.
4. The heterogeneous graph data node embedding feature extraction model training method according to claim 1 is characterized in that: In the method, the local discriminator performs the task of identifying the type of neighbor nodes of the target node. The probability calculation formula for the neighbor relationship between the target node v and the neighbor node v is r is: Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; represents the transpose of the embedding feature of node u, M i D represents the weight corresponding to the neighbor relationship r, h v represents the embedded features of the target node v, represents the parameters of the local discriminator of the i-th client; The discriminator calculates the probability that the neighbor relationship between the target node and the neighbor node is r, and outputs a discrimination result of the neighbor node type.
5. The heterogeneous graph data node embedding feature extraction model training method according to claim 4 is characterized in that: The local discriminator constructs a loss to perform parameter updates by maximizing the success rate of the identification task of the neighbor node type and the identification task of the positive and negative samples. The loss function of the identification task of the positive and negative samples is: Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of the neighbor node, r∈R, R represents the edge set; h v ′ represents the output of the i-th client generator after adding noise data, h v Represents the embedded features of the target node v, HG i represents the heterogeneous subgraph held by the i-th client, G i represents the local generator of the i-th client, Represents G i Parameters, D i represents the local discriminator of the i-th client; The local discriminator constructs a loss to perform parameter update by maximizing the success rate of the neighbor node type identification task and the positive and negative sample recognition task. The loss function of the neighbor node type identification task is: Where u represents a given node, u∈V i , V i represents the local node set of the i-th client, v represents the target node, r represents the type of neighbor node, r∈R, R represents the edge set; r′ represents the error relationship between node u and target node v, R′=R / {r}, h v ′ represents the output of the i-th client generator after adding noise data, HG i represents the heterogeneous subgraph held by the i-th client; The local discriminator constructs a loss to update parameters by maximizing the success rate of the identification task of neighbor node types and the recognition task of positive and negative samples. The joint loss used is:
6. The heterogeneous graph data node embedding feature extraction model training method according to claim 1, characterized in that: In the method, the original features of the intra-client neighbor nodes and the inter-client neighbor nodes are extracted in the following manner: If the data type is text, the bag-of-words vector is used as the original feature; If the data type is image, the pixel value vector is directly used as the original feature, or the original feature is extracted through a pre-trained neural network.
7. A method for extracting features from subgraph-level federated heterogeneous node embedding, characterized in that: The method is executed based on multiple interconnected clients and a central server, each of the clients holds a heterogeneous subgraph of a portion of heterogeneous graph data as private data, and for a specified target node of a specified client, a target embedding feature extraction model in the heterogeneous graph data node embedding feature extraction model training method according to any one of claims 1 to 6 deployed on the specified client is used to extract target embedding features.
8. A subgraph-level federated heterogeneous node classification method, characterized by: The method is performed based on a plurality of interconnected clients and a central server, wherein each client holds a heterogeneous subgraph of a portion of heterogeneous graph data as private data, and for a designated target node of a designated client, the designated client uses the subgraph-level federated heterogeneous node embedding feature extraction method according to claim 7 to obtain a target embedding feature of the designated target node; The target embedding features are input into a pre-trained logistic regression model to perform node classification.
9. A heterogeneous graph data management system, characterized in that: The system includes a plurality of clients and a central server connected to each other, each of the clients holds a heterogeneous subgraph of a portion of heterogeneous graph data as private data, and the clients and the central server execute the steps of the method as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.