A distributed training method and device of a heterogeneous graph neural network and electronic equipment
Patent Information
- Application Number
- CN202410369566.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2044-03-28
AI Technical Summary
但是,上述现有技术中,每个参与方需要与其它参与方都进行通信,且需要等待其他参与方的信息到达,通信量大,延迟高,并且每个参与方都需要处理其它参与方的融合计算,计算量大,进一步增加了分布式训练的延迟
[0018]本公开提出的异构图神经网络的分布式训练方法、装置及电子设备中,获取各参与方的本地数据,并基于各参与方的本地数据构建异构图,其中,异构图包括各参与方的本地图和参与方之间的外部图,外部图中的节点为各参与方与其它参与方存在关联的枢纽节点对应的镜像节点,枢纽节点与镜像节点的镜像边为外部图与本地图之间的关联边;构建异构图神经网络模型,其中,异构图神经网络模型包括各参与方的本地图神经网络和外部图神经网络,外部图神经网络在第三方可信环境中;基于异构图对异构图神经网络模型进行分布式训练,得到训练完成的异构图神经网络模型。由此,本公开提出的分布式训练方法中,每个参与方需要在枢纽节点和镜像节点之间进行通信和信息融合计算,简化了信息交互流程,减少了通信量和计算量,降低了延迟。
Smart Images

Figure CN118446284B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of data processing, financial technology, and information technology industries, and in particular to a distributed training method, apparatus, and electronic device for heterogeneous graph neural networks. Background Technology
[0002] In many scenarios, joint modeling using data from multiple institutions or organizations is necessary. For example, in the financial industry, anti-fraud and anti-money laundering efforts require the use of behavioral data from multiple banks and telecommunications operators to accurately identify criminals and criminal groups. In this context, heterogeneous graphs can be used to mine and analyze related users to obtain predictive results.
[0003] Specifically, heterogeneous graphs typically contain different types of nodes and paths, and can be used to represent complex social network relationship data. Nodes in a heterogeneous graph can represent entities such as individual users. Typically, a heterogeneous graph containing entity data can be input into a graph neural network to predict the nodes, for example, predicting users to determine their category, risk level, or preferences. Due to the differences in node and path types, heterogeneous graphs exhibit high complexity; therefore, predicting entity data within heterogeneous graphs is crucial.
[0004] In existing technologies, heterogeneous graph neural networks can be trained based on federated learning, and the trained heterogeneous graph neural networks can be used for prediction. However, in the above-mentioned existing technologies, each participant needs to communicate with other participants and wait for information from other participants to arrive. This results in high communication volume and high latency. In addition, each participant needs to handle the fusion calculations of other participants, which is computationally intensive and further increases the latency of distributed training. Summary of the Invention
[0005] This disclosure provides a distributed training method, apparatus, and electronic device for heterogeneous graph neural networks, to at least solve the technical problems of high communication volume, high latency, and high computational load in related technologies.
[0006] According to a first aspect of this disclosure, a distributed training method for heterogeneous graph neural networks is provided, the method comprising:
[0007] Acquire local data of each participant and construct a heterogeneous graph based on the local data of each participant. The heterogeneous graph includes the local graph of each participant and the external graph between the participants. The nodes in the external graph are the mirror nodes corresponding to the hub nodes that are associated with each participant and other participants. The mirror edges between the hub nodes and the mirror nodes are the association edges between the external graph and the local graph.
[0008] Construct a heterogeneous graph neural network model, wherein the heterogeneous graph neural network model includes local graph neural networks and external graph neural networks of each participant, and the external graph neural network is in a trusted third-party environment;
[0009] The heterogeneous graph neural network model is trained in a distributed manner based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model.
[0010] According to a second aspect of this disclosure, a distributed training apparatus for heterogeneous graph neural networks is provided, the apparatus comprising:
[0011] The first construction module is used to obtain the local data of each participant and construct a heterogeneous graph based on the local data of each participant. The heterogeneous graph includes the local graph of each participant and the external graph between the participants. The nodes in the external graph are the mirror nodes corresponding to the hub nodes that are associated with each participant and other participants. The mirror edges between the hub nodes and the mirror nodes are the association edges between the external graph and the local graph.
[0012] The second construction module is used to construct a heterogeneous graph neural network model, wherein the heterogeneous graph neural network model includes local graph neural networks and external graph neural networks of each participant, and the external graph neural network is in a trusted third-party environment;
[0013] The training module is used to perform distributed training on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model.
[0014] According to a third aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement a distributed training method for a heterogeneous graph neural network as described in the first aspect embodiment above.
[0015] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided that, when instructions in the computer-readable storage medium are executed by a processor of a data management device / electronic device / server, enables the data management device / electronic device / server to perform a distributed training method for a heterogeneous graph neural network as described in the first aspect embodiment above.
[0016] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program / instructions, characterized in that, when the computer program / instructions are executed by a processor, they implement a distributed training method for heterogeneous graph neural networks as described in the first aspect embodiment above.
[0017] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:
[0018] The distributed training method, apparatus, and electronic device for heterogeneous graph neural networks proposed in this disclosure acquire local data from each participant and construct a heterogeneous graph based on the local data of each participant. The heterogeneous graph includes the local graph of each participant and an external graph connecting the participants. Nodes in the external graph are mirror nodes corresponding to hub nodes that are associated with other participants, and mirror edges between hub nodes and mirror nodes are the association edges between the external graph and the local graph. A heterogeneous graph neural network model is constructed, comprising the local graph neural network of each participant and the external graph neural network, with the external graph neural network operating in a trusted third-party environment. The heterogeneous graph neural network model is then distributedly trained based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model. Therefore, in the distributed training method proposed in this disclosure, each participant needs to communicate and perform information fusion calculations between the hub node and the mirror node, simplifying the information interaction process, reducing communication and computational load, and lowering latency.
[0019] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0021] Figure 1a This is a flowchart illustrating a distributed training method for a heterogeneous graph neural network according to an embodiment of the present disclosure;
[0022] Figure 1b This is a schematic diagram of a heterogeneous diagram provided according to an embodiment of the present disclosure;
[0023] Figure 2a This is a flowchart illustrating a distributed training method for a heterogeneous graph neural network according to another embodiment of the present disclosure;
[0024] Figure 2b This is a schematic diagram of a first graph convolution computation of a local graph neural network according to another embodiment of the present disclosure;
[0025] Figure 2c This is a schematic diagram of a second graph convolution computation of an external graph neural network according to another embodiment of the present disclosure;
[0026] Figure 3 This is a flowchart illustrating a distributed training method for a heterogeneous graph neural network according to another embodiment of the present disclosure;
[0027] Figure 4This is a flowchart illustrating a distributed training method for a heterogeneous graph neural network according to another embodiment of the present disclosure;
[0028] Figure 5 This is a schematic diagram of the structure of a distributed training device for a heterogeneous graph neural network according to an embodiment of the present disclosure;
[0029] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0030] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.
[0031] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, data stored, data displayed, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0032] The following describes a distributed training method and apparatus for heterogeneous graph neural networks according to embodiments of the present disclosure, with reference to the accompanying drawings.
[0033] Figure 1a This is a flowchart illustrating a distributed training method for heterogeneous graph neural networks according to another embodiment of the present disclosure, as shown below. Figure 1a As shown, it may include:
[0034] Step 101a: Obtain the local data of each participant and construct a heterogeneous graph based on the local data of each participant.
[0035] In this embodiment, the main body executing the distributed training method of heterogeneous graph neural networks is a distributed training device for heterogeneous graph neural networks. This device can be implemented by software and / or hardware and can be configured in an electronic device.
[0036] In this embodiment, the participants can be different institutions or organizations, and each participant's local data is stored in its own local environment. For security and privacy reasons, it cannot be directly shared. Therefore, a heterogeneous graph needs to be constructed based on the local data of each participant to enable data sharing among them.
[0037] In this embodiment, the heterogeneous graph includes local graphs for each participant and an external graph connecting the participants. Nodes in the external graph are mirror nodes corresponding to hub nodes that are associated with other participants. Mirror edges between hub nodes and mirror nodes are the association edges between the external graph and the local graph. In this embodiment, the external graph resides in a trusted third-party environment, such as a secure room.
[0038] Specifically, in this embodiment of the disclosure, the method for constructing a heterogeneous graph based on the local data of each participant may include the following steps:
[0039] Step 1011a: Each participant uses local data to construct a corresponding local graph and marks the nodes associated with other participants as hub nodes;
[0040] Step 1012a: Each participant sends the hub node and external association information in the local graph to a third-party trusted environment via an encrypted channel;
[0041] Step 1013a: In a trusted third-party environment, use external association information from each participant to form an external graph of the hub nodes of each participant, wherein the nodes in the external graph are mirror nodes of the hub nodes.
[0042] Step 1014a: The hub node of each participant's local graph corresponds one-to-one with the mirror node of the external graph in the third-party trusted environment. A mirror edge is constructed between the two for message passing between the hub node and the mirror node.
[0043] For example, in an embodiment of this disclosure, Figure 1b This is a schematic diagram of a heterogeneous diagram according to an embodiment of this disclosure. Figure 1b As shown, each participant generates a corresponding local graph. A2 is the node where participant A is associated with other participants. That is, A2 is the hub node of participant A, and A'2 is the mirror node of A2. Solid lines represent real nodes and edges, and dashed lines represent mirror nodes and mirror edges. External messages are transmitted along the mirror edges through an encrypted channel. All local graphs and external graphs form a heterogeneous graph.
[0044] Step 102a: Construct a heterogeneous graph neural network model.
[0045] In this embodiment of the disclosure, the heterogeneous graph neural network model includes local graph neural networks and external graph neural networks of each participant, wherein the external graph neural network is in a trusted third-party environment, and the local graph neural networks of each participant are in their respective local environments.
[0046] Furthermore, in this disclosed embodiment, the internal associated data of the participating parties is stored locally, while the external associated data of other participating parties is stored in a trusted third-party environment, and the data is transmitted using an encrypted channel, thereby protecting the data security and privacy of all participating parties.
[0047] Step 103a: Perform distributed training on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model.
[0048] In this embodiment of the disclosure, the external graph of the heterogeneous graph includes the external relationships of each participant. Based on this, the relationship between the local graph neural network and the external graph neural network can be obtained using the heterogeneous graph and the external graph neural network.
[0049] Specifically, in this embodiment of the disclosure, the method for distributively training a heterogeneous graph neural network model based on a heterogeneous graph to obtain a trained heterogeneous graph neural network model may include: initializing the parameters of the local graph neural network of each participant; each participant obtaining the target representation vector of all nodes through convolution calculation of the first graph of the local graph neural network and the second graph of the external graph neural network; each participant obtaining the corresponding predicted value through the local graph neural network based on the heterogeneous graph data / heterogeneous graph data and labels, and obtaining the corresponding loss value through a loss function based on the predicted value and the true value; each participant updating the parameters of the local graph neural network through the local graph neural network and the external graph neural network using the backpropagation algorithm based on the corresponding loss value, and repeating the above process until the local graph neural network of each participant is trained, thus obtaining a trained heterogeneous graph neural network model. This part will be described in detail in subsequent embodiments, and will not be elaborated upon here.
[0050] The distributed training method for heterogeneous graph neural networks proposed in this disclosure involves acquiring local data from each participant and constructing a heterogeneous graph based on this data. The heterogeneous graph includes the local graphs of each participant and an external graph connecting the participants. Nodes in the external graph are mirror nodes corresponding to hub nodes that are associated with other participants, and mirror edges between hub nodes and mirror nodes are the association edges between the external graph and the local graph. A heterogeneous graph neural network model is then constructed, comprising the local graph neural networks of each participant and the external graph neural network, with the external graph neural network operating in a trusted third-party environment. Distributed training is performed on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model. Therefore, in the distributed training method proposed in this disclosure, each participant needs to communicate and perform information fusion calculations between the hub node and the mirror node, simplifying the information interaction process, reducing communication and computational load, and lowering latency.
[0051] Figure 2aThis is a flowchart illustrating a distributed training method for heterogeneous graph neural networks according to another embodiment of the present disclosure, as shown below. Figure 2a As shown, it may include:
[0052] Step 201a: Obtain the local data of each participant and construct a heterogeneous graph based on the local data of each participant.
[0053] Step 202a: Construct a heterogeneous graph neural network model.
[0054] For a detailed description of steps 201a-202a, please refer to the relevant descriptions in the above embodiments. This disclosure will not repeat the details here.
[0055] Step 203a: Initialize the parameters of the local graph neural network of each participant.
[0056] In this embodiment of the disclosure, the mirror node is initialized as a zero vector. Furthermore, in this embodiment of the disclosure, other parameters of the local graph neural network can be initialized randomly, or initialized using other methods, such as a Gaussian random distribution.
[0057] Step 204a: Each participant obtains the target representation vector of all nodes by performing first graph convolution calculation of the local graph neural network and second graph convolution calculation of the external graph neural network.
[0058] In this embodiment of the disclosure, the method by which each participant obtains the target representation vector of all nodes through the first graph convolution calculation of the local graph neural network and the second graph convolution calculation of the external graph neural network may include the following steps:
[0059] Step 2041a: Each participant performs the first graph convolution calculation of the local graph neural network to obtain the first representation vector of all nodes, and sends the first representation vector of the hub node to the external graph neural network.
[0060] In this embodiment of the disclosure, the method by which each participant performs a first graph convolution calculation on the local graph neural network to obtain the first representation vector of all nodes may include the following steps:
[0061] Step a: Obtain the neighbor node vectors of the nth layer node corresponding to the (n-1)th layer node and the first representation vector of the node at the (n-1)th layer;
[0062] Step b: Perform the first vector transformation on the neighbor node vectors of the (n-1)th layer, and then normalize and sum all the neighbor node vectors after the first vector transformation to obtain the first sub-representation vector;
[0063] Step c: Perform a second vector transformation on the first representation vector of the (n-1)th layer of the node to obtain the second sub-representation vector;
[0064] Step d: Based on the first sub-representation vector and the second sub-representation vector, obtain the first representation vector of the nth layer node. Repeat the above steps to obtain the first representation vector of all nodes.
[0065] For example, in this embodiment of the disclosure, assume that P = [A, B, C…] represents the set of participants, p ∈ P represents a certain participant, and the local graph neural network of participant p has N layers, let… This represents the first representation vector of the nth layer of node i in the graph. Indicates the neighboring nodes of node i. It represents the vector of its (n-1)th neighbor node j.
[0066] And, the neighbor node vector of the (n-1)th layer The parameter matrix of the graph neural network at layer n is: Multiply the vectors to perform the first vector transformation, then normalize and sum all the transformed neighbor node vectors to obtain the first sub-representation vector. Where C is the normalization parameter (such as the number of neighbors).
[0067] Furthermore, the first representation vector of the node at the (n-1)th layer... The parameter matrix of the self-loop network is Multiplication is performed to perform a second vector transformation, resulting in a second sub-representation vector.
[0068] Furthermore, in this embodiment of the disclosure, the first representation vector of the nth layer node is obtained through a first formula based on the first sub-representation vector and the second sub-representation vector. The first formula is: σ is the activation function (such as Sigmoid or ReLU).
[0069] Furthermore, in this embodiment of the disclosure, in order to obtain the Nth layer vector representation of node i, it is necessary to start the calculation from the first layer of the graph neural network. The input of the first layer is the node vector of the Nth hop neighbor of node i, using... It indicates. Among them, It can be based on the self-vector v of node i p,i and mirror node vector u p,i The calculation is obtained using the second formula, which is:
[0070]
[0071] Among them, U p The transformation matrix parameters are the mirror node vectors; if no mirror vector u exists... p,i =0.
[0072] For example, in an embodiment of this disclosure, Figure 2b This is a schematic diagram illustrating the first graph convolution computation of a local graph neural network according to an embodiment of this disclosure. Figure 2b As shown, left a) is a 2-layer subgraph with as the target node, and right b) is the computational principle of a 2-layer graph neural network. A1, A2, A3, and A4 can be obtained using the second formula mentioned above. The corresponding values of A1, A2, and A3 are obtained through the first formula mentioned above. The boxes represent neural network layers. Let n be the parameter matrix of the nth layer of the graph neural network. Let n be the parameter matrix of the nth layer self-loop network. Let be the first representation vector of the nth layer of node i.
[0073] Step 2042a: After the external graph neural network receives the first representation vector of the hub node in the same round from all participants, it performs a second graph convolution calculation based on the first representation vector of all participants to obtain the second representation vector of all mirror nodes, and sends it to the corresponding participants.
[0074] In this embodiment of the disclosure, the method for obtaining the second representation vector of all mirror nodes by performing a second graph convolution calculation based on the first representation vector of all participants may include the following steps:
[0075] Step 1: Obtain the first representation vector of the neighboring nodes of other participants in the (n-1)th layer corresponding to the mirror node of the target participant p in the nth layer, and the first representation vector of the node in the (n-1)th layer;
[0076] Step 2: Perform a third vector transformation on the first representation vectors of the other participating neighbor nodes in the (n-1)th layer, and then normalize and sum all the first representation vectors after the third vector transformation to obtain the third sub-representation vector.
[0077] Step 3: Perform a fourth vector transformation on the first representation vector of the (n-1)th layer of the node to obtain the fourth sub-representation vector;
[0078] Step 4: Based on the third and fourth sub-representation vectors, obtain the second representation vector of the target participant node p in the nth layer. Repeat the above steps to obtain the second representation vectors of all participant nodes.
[0079] For example, in this embodiment of the disclosure, assume that P = [A, B, C...] represents the set of participants, p, q ∈ P represents any two different participants, the external graph neural network has N layers, each layer consists of multiple sub-layers, let the target participant of the sub-layer be p, and the source participant be q. Let represent the first representation vector of node i at the nth layer of participant p in the external graph. This represents the neighboring nodes of node i of participant p and participant q. It represents the first representation vector of its (n-1)th layer neighbor node j.
[0080] And, the neighbor node vector of the (n-1)th layer The parameter matrix of the nth sublayer is Multiply the vectors to perform a third vector transformation, then normalize and sum all the transformed neighbor node vectors to obtain the third sub-representation vector. Where C is the normalization parameter (such as the number of neighbors).
[0081] Furthermore, the first representation vector of the node at the (n-1)th layer... The parameter matrix of the self-loop network is Multiplication is performed to perform a fourth vector transformation, resulting in a fourth sub-representation vector.
[0082] Furthermore, in this embodiment of the disclosure, the second representation vector of the nth layer node is obtained through a third formula based on the third sub-representation vector and the fourth sub-representation vector. The third formula is σ is the activation function (such as Sigmoid or ReLU).
[0083] Furthermore, in this embodiment of the disclosure, in order to obtain the Nth layer vector representation of node i of participant p in the external graph neural network, it is necessary to start the calculation from the first layer of the graph neural network. The input of the first layer is the node vector of the target node and the Nth hop neighbors of each participant q∈P,q≠p. It indicates. Among them, It can be based on the mirror node vector u p,i and hub node vector v p,i It is calculated using the fourth formula, which is:
[0084]
[0085] Among them, V p Let v be the transformation matrix parameter of the hub node vector of participant p. p,i The data is passed from the local graph neural network of participant p to the external graph neural network.
[0086] For example, in an embodiment of this disclosure, Figure 2c This is a schematic diagram illustrating the second graph convolution computation of an external graph neural network according to an embodiment of this disclosure. Figure 2c As shown, the left side a) is a two-layer subgraph where the node of participant A is the target node, and the right side b) is the computational principle of a two-layer heterogeneous graph neural network. The values corresponding to A1, B1, C1, and C2 can be obtained through the fourth formula mentioned above. The corresponding values for A1, B1, and C1 are obtained through the second formula described above. The boxes represent neural network layers. Let n be the parameter matrix of the nth layer of the graph neural network from participant A to participant B. Let A be the parameter matrix of the nth layer self-loop network of participant A. Let be the second representation vector of node i of participant A.
[0087] Step 2043a: Each participating party determines the second representation vector of the hub node as the target representation vector of the hub node, and determines the first representation vector of the remaining nodes as the target representation vector of the remaining nodes.
[0088] Step 205a: Each participant obtains the corresponding predicted value through a local graph neural network based on the graph data / graph data and labels, and obtains the corresponding loss value through a loss function based on the predicted value and the true value.
[0089] In this embodiment of the disclosure, in a multi-party heterogeneous graph neural network model, some participants can train their local graph neural network using graph data and labels, while the remaining participants can train their local graph neural network using semi-supervised learning. Specifically, for the participant providing labels, after calculating their first representation vector through a first graph convolution, the first representation vector is passed through a classifier to obtain the predicted label value. Furthermore, the predicted and true label values are used to calculate the loss function, resulting in the loss value for this iteration.
[0090] Step 206a: Based on the corresponding loss value, each participant updates the parameters of the local graph neural network through the local graph neural network and the external graph neural network using the backpropagation algorithm. The above process is repeated until the local graph neural network of each participant is trained, and a trained heterogeneous graph neural network model is obtained.
[0091] In this embodiment of the disclosure, the method by which the aforementioned participants update the parameters of the local graph neural network based on their respective loss values using the backpropagation algorithm through the local graph neural network and the external graph neural network may include the following steps:
[0092] Step 2061a: Based on the corresponding loss value, each participant uses the backpropagation algorithm to obtain the first gradient value of all nodes of each participant, and sends the first gradient value of the hub node to the external graph neural network.
[0093] Step 2062a: After the external graph neural network receives the first gradient value of the hub node in the same round from all participants, it calculates the second gradient value of the mirror node, updates the parameters of the external graph neural network using gradient descent, and sends the second gradient value of the mirror node to the local graph neural network of the corresponding participant.
[0094] Step 2063a: After each participant receives the second gradient value of the mirror node, it continues to calculate the gradient values of other parameters that depend on the mirror node, and uses the gradient descent algorithm to update the parameters of the local graph neural network.
[0095] Furthermore, in this embodiment of the disclosure, the method for obtaining a trained heterogeneous graph neural network model after the local graph neural networks of each participant have completed training may include: the local graph neural networks of each participant satisfy the training termination condition, and the local graph neural networks of each participant have completed training; when the local graph neural networks of all participants have completed training, the external neural network has also completed training, resulting in a trained heterogeneous graph neural network model. In this embodiment of the disclosure, if the local graph neural network has not reached the training termination condition, the next iteration continues.
[0096] In this embodiment of the disclosure, the training termination condition may include: the local graph neural network converges, or the number of iterations of the network parameters of the local graph neural network reaches a preset number.
[0097] Furthermore, in this embodiment of the disclosure, the third-party environment stores the training state of each participant and forwards it to other participants. When all participants are in the end state, the external neural network also enters the training end state.
[0098] The distributed training method for heterogeneous graph neural networks proposed in this disclosure involves acquiring local data from each participant and constructing a heterogeneous graph based on this data. The heterogeneous graph includes the local graphs of each participant and an external graph connecting the participants. Nodes in the external graph are mirror nodes corresponding to hub nodes that are associated with other participants, and mirror edges between hub nodes and mirror nodes are the association edges between the external graph and the local graph. A heterogeneous graph neural network model is then constructed, comprising the local graph neural networks of each participant and the external graph neural network, with the external graph neural network operating in a trusted third-party environment. Distributed training is performed on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model. Therefore, in the distributed training method proposed in this disclosure, each participant needs to communicate and perform information fusion calculations between the hub node and the mirror node, simplifying the information interaction process, reducing communication and computational load, and lowering latency.
[0099] Figure 3 This is a flowchart illustrating a distributed training method for heterogeneous graph neural networks according to another embodiment of the present disclosure, as shown below. Figure 3 As shown, it may include:
[0100] Step 301: Obtain the local data of each participant and construct a heterogeneous graph based on the local data of each participant.
[0101] Step 302: Construct a heterogeneous graph neural network model.
[0102] Step 303: Perform distributed training on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model.
[0103] For a detailed description of steps 301 to 303, please refer to the relevant descriptions in the above embodiments. The embodiments disclosed herein will not be repeated here.
[0104] Step 304: Obtain heterogeneous graph data related to the prediction content, input the heterogeneous graph data into the trained heterogeneous graph neural network model for prediction, and obtain the prediction result.
[0105] In this embodiment of the disclosure, the graph neural network of each participant calculates the vector of the hub node and sends it to the external graph neural network; after receiving the hub node vector of each participant, the external graph neural network calculates the mirror node vector and sends it to the corresponding participant; finally, the participant uses the new mirror node vector to re-predict the vector of the local graph node.
[0106] The distributed training method for heterogeneous graph neural networks proposed in this disclosure involves acquiring local data from each participant and constructing a heterogeneous graph based on this data. The heterogeneous graph includes the local graphs of each participant and an external graph connecting the participants. Nodes in the external graph are mirror nodes corresponding to hub nodes that are associated with other participants, and mirror edges between hub nodes and mirror nodes are the association edges between the external graph and the local graph. A heterogeneous graph neural network model is then constructed, comprising the local graph neural networks of each participant and the external graph neural network, with the external graph neural network operating in a trusted third-party environment. Distributed training is performed on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model. Therefore, in the distributed training method proposed in this disclosure, each participant needs to communicate and perform information fusion calculations between the hub node and the mirror node, simplifying the information interaction process, reducing communication and computational load, and lowering latency.
[0107] Based on the above, the distributed training method of the heterogeneous graph neural network in the embodiments is illustrated by example.
[0108] Figure 4 This is a flowchart illustrating the distributed training method for heterogeneous graph neural networks in this embodiment of the present disclosure. The process may include:
[0109] Step 401: Initialize the parameters of each graph neural network;
[0110] The mirror node vector is initialized to a zero vector, and other parameters are initialized using a common method (such as a Gaussian random distribution).
[0111] Step 402: Enter the first round of iterative training. Each participant performs local graph convolution calculation (the first graph convolution calculation mentioned above) to obtain the representation vector of all nodes (i.e., the first representation vector mentioned above), and sends the hub node vector to the external graph in the third-party environment.
[0112] Step 403: After the external graph neural network receives the hub node vectors of all participants in the same round of iteration, it performs graph convolution calculation of the heterogeneous graph (the second graph convolution calculation mentioned above) to obtain the representation vectors of all mirror nodes (i.e. the second representation vectors mentioned above), and sends them to the corresponding participants for the graph convolution calculation of the next round of participants.
[0113] Step 404: A heterogeneous graph model with multiple participants. Some participants provide graph data and labels, while others only provide graph data. The model is trained using semi-supervised learning. For participants that provide labels, after obtaining their own node vectors through graph convolution, the node vectors are passed through a classifier to obtain the predicted label values.
[0114] Step 405: The predicted and true values of the labels are used to calculate the loss function, and the loss value of this iteration is obtained. The gradient value of the local neural network is calculated using the backpropagation algorithm, and the gradient value of the hub node vector is sent to the external graph neural network of the third party.
[0115] Step 406: After receiving the gradient values of the hub node vectors from all participants in this iteration, the third-party external graph neural network calculates the gradient values of the mirror node vectors, updates the graph neural network parameters using gradient descent, and then sends the gradient values of the mirror node vectors to the corresponding participant graph neural networks.
[0116] Step 407: After receiving the gradient value of its own mirror node vector, the participating graph neural network continues to calculate the gradient values of other parameters that depend on the gradient value of the mirror node vector, and uses gradient descent to update the parameters of the local graph neural network.
[0117] Step 408: After the participating graph neural network completes the parameter update for this round of iteration, it determines whether the training termination condition has been met (reaching the maximum number of iterations or other participants have finished, etc.). If the training termination condition has not been met, the next round of iteration will continue; if the training termination condition has been met, the training will end and information will be sent to the third-party environment.
[0118] Step 409: The third-party environment stores the training status of each participant and forwards it to other participants. When all participants are in the end state, the external neural network also enters the training end state.
[0119] Figure 5 This is a block diagram illustrating a distributed training apparatus for a heterogeneous graph neural network according to an exemplary embodiment.
[0120] like Figure 5 As shown, the distributed training device 500 of the heterogeneous graph neural network includes: a first building module 501, a second building module 502, and a training module 503.
[0121] The first construction module 501 is used to obtain the local data of each participant and construct a heterogeneous graph based on the local data of each participant. The heterogeneous graph includes the local graph of each participant and the external graph between the participants. The nodes in the external graph are the mirror nodes corresponding to the hub nodes that are associated with each participant and other participants. The mirror edges between the hub nodes and the mirror nodes are the association edges between the external graph and the local graph.
[0122] The second construction module 502 is used to construct a heterogeneous graph neural network model, wherein the heterogeneous graph neural network model includes local graph neural networks and external graph neural networks of each participant, and the external graph neural network is in a trusted third-party environment;
[0123] Training module 503 is used to perform distributed training on the heterogeneous graph neural network model based on the heterogeneous graph, so as to obtain the trained heterogeneous graph neural network model.
[0124] In the distributed training device for heterogeneous graph neural networks proposed in this disclosure, local data of each participant is acquired, and a heterogeneous graph is constructed based on the local data of each participant. The heterogeneous graph includes the local graph of each participant and an external graph connecting the participants. Nodes in the external graph are mirror nodes corresponding to hub nodes that are associated with other participants, and mirror edges between hub nodes and mirror nodes are the association edges between the external graph and the local graph. A heterogeneous graph neural network model is constructed, comprising the local graph neural network of each participant and the external graph neural network, with the external graph neural network operating in a trusted third-party environment. The heterogeneous graph neural network model is then trained in a distributed manner based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model. Therefore, in the distributed training method proposed in this disclosure, each participant needs to communicate and perform information fusion calculations between the hub node and the mirror node, simplifying the information interaction process, reducing communication and computational load, and lowering latency.
[0125] In the embodiments of this disclosure, the training module is specifically used for:
[0126] Each participant initializes the parameters of its local graph neural network;
[0127] Each participant obtains the target representation vector of all nodes by performing first graph convolution calculation of the local graph neural network and second graph convolution calculation of the external graph neural network;
[0128] Each participant obtains the corresponding predicted value through a local graph neural network based on graph data / graph data and labels, and obtains the corresponding loss value through a loss function based on the predicted value and the true value;
[0129] Based on their respective loss values, each participant uses the backpropagation algorithm to update the parameters of their local graph neural network through both the local and external graph neural networks. This process is repeated until each participant's local graph neural network is trained, resulting in a trained heterogeneous graph neural network model.
[0130] Optionally, in embodiments of this disclosure, the training module 503 is further configured to:
[0131] Each participant performs the first graph convolution calculation of the local graph neural network to obtain the first representation vector of all nodes, and sends the first representation vector of the hub node to the external graph neural network.
[0132] After receiving the first representation vector of the hub node in the same round from all participants, the external graph neural network performs a second graph convolution based on the first representation vector of all participants to obtain the second representation vector of all mirror nodes, and sends it to the corresponding participants.
[0133] Each participant determines the second representation vector of the hub node as the target representation vector of the hub node, and determines the first representation vector of the remaining nodes as the target representation vector of the remaining nodes.
[0134] Optionally, in embodiments of this disclosure, the training module 503 is further configured to:
[0135] Obtain the neighbor node vectors of the nth layer node corresponding to the (n-1)th layer node and the first representation vector of the node at the (n-1)th layer;
[0136] Perform the first vector transformation on the neighbor node vectors of the (n-1)th layer, and then normalize and sum all the neighbor node vectors after the first vector transformation to obtain the first sub-representation vector.
[0137] The first representation vector of the node at the (n-1)th layer is transformed by the second vector to obtain the second sub-representation vector;
[0138] Based on the first sub-representation vector and the second sub-representation vector, the first representation vector of the nth layer node is obtained. The above steps are repeated to obtain the first representation vector of all nodes.
[0139] Optionally, in embodiments of this disclosure, the training module 503 is further configured to:
[0140] Obtain the first representation vector of the neighboring nodes of other participants in the (n-1)th layer corresponding to the mirror node of the target participant p in the nth layer, and the first representation vector of the node in the (n-1)th layer.
[0141] The first representation vectors of the other participating neighbor nodes in the (n-1)th layer are transformed into third vectors, and the first representation vectors after all the third vector transformations are normalized and summed to obtain the third sub-representation vector.
[0142] The first representation vector of the (n-1)th layer of the node is transformed by the fourth vector to obtain the fourth sub-representation vector;
[0143] Based on the third and fourth sub-representation vectors, the second representation vector of the target participant node p in the nth layer is obtained. The above steps are repeated to obtain the second representation vectors of all participant nodes.
[0144] Optionally, in embodiments of this disclosure, the training module 503 is further configured to:
[0145] Based on their respective loss values, each participant uses the backpropagation algorithm to obtain the first gradient value of all nodes of each participant, and sends the first gradient value of the hub node to the external graph neural network.
[0146] After receiving the first gradient value of the hub node in the same round from all participants, the external graph neural network calculates the second gradient value of the mirror node, updates the parameters of the external graph neural network using gradient descent, and sends the second gradient value of the mirror node to the local graph neural network of the corresponding participant.
[0147] After receiving the second gradient value of the mirror node, each participant continues to calculate the gradient values of other parameters that depend on the mirror node, and uses the gradient descent algorithm to update the parameters of the local graph neural network.
[0148] Optionally, in embodiments of this disclosure, the training module 503 is further configured to:
[0149] The local graph neural networks of each participant meet the training termination conditions, and the training of the local graph neural networks of each participant is complete.
[0150] When all participants' local graph neural networks have been trained, the external neural network has also been trained, resulting in a trained heterogeneous graph neural network model.
[0151] Optionally, in embodiments of this disclosure, the above-described apparatus is further used for:
[0152] Obtain heterogeneous graph data related to the prediction content, input the heterogeneous graph data into a trained heterogeneous graph neural network model for prediction, and obtain the prediction result.
[0153] Figure 6 This is a block diagram illustrating an electronic device according to an exemplary embodiment.
[0154] like Figure 6 As shown, the above-mentioned electronic device 600 includes:
[0155] The components include a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 616.
[0156] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0157] Memory 604 is configured to store various types of data to support the operation of electronic device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0158] Power supply component 606 provides power to various components of electronic device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.
[0159] Multimedia component 608 includes a touch display screen that provides an output interface between electronic device 600 and user. In some embodiments, the touch display screen may include a liquid crystal display (LCD) and a touch panel (TP). The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When electronic device 600 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0160] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 616.
[0161] In some embodiments, the audio component 610 further includes a speaker for outputting audio signals.
[0162] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0163] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 may detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0164] Communication component 616 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 616 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0165] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the data preheating and caching method described above.
[0166] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of an electronic device 600 to perform the above-described method. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0167] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0168] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
[0169] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the distributed training method for heterogeneous graph neural networks in this disclosure, and will not be repeated here.
[0170] To implement the above embodiments, this disclosure also proposes a computer-readable storage medium.
[0171] When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device is able to perform the distributed training method for heterogeneous graph neural networks according to the first, second, or third aspects of the above embodiments. Optionally, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.
[0172] To implement the above embodiments, this disclosure also provides a computer program product, including a computer program, characterized in that, when the computer program is executed by a processor, it implements the distributed training method of heterogeneous graph neural networks of the first, second, or third aspects of the above embodiments.
[0173] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0174] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
[0175] In an exemplary embodiment, a computer program product is also provided, comprising a computer program, characterized in that, when the computer program is executed by a processor, it implements the distributed training method for heterogeneous graph neural networks of the first, second, or third aspects of the above embodiments.
[0176] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0177] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A distributed training method for heterogeneous graph neural networks, characterized in that, The method includes: Acquire local data of each participant and construct a heterogeneous graph based on the local data of each participant. The heterogeneous graph includes the local graph of each participant and the external graph between the participants. The nodes in the external graph are the mirror nodes corresponding to the hub nodes that are associated with each participant and other participants. The mirror edges between the hub nodes and the mirror nodes are the association edges between the external graph and the local graph. Construct a heterogeneous graph neural network model, wherein the heterogeneous graph neural network model includes local graph neural networks and external graph neural networks of each participant, the external graph neural network is in a third-party trusted environment, the internal association data of each participant is stored in the local environment, and the external association data related to other participants is stored in the third-party trusted environment; The heterogeneous graph neural network model is trained in a distributed manner based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model. The step of acquiring local data from each participant and constructing a heterogeneous graph based on the local data from each participant includes: Each participant uses local data to construct a corresponding local graph and marks nodes associated with other participants as hub nodes; Each participating party will send the hub node and external association information in the local graph to a third-party trusted environment via an encrypted channel; In the trusted third-party environment, external association information from each participant is used to form the external graph of the hub nodes of each participant, wherein the nodes in the external graph are mirror nodes of the hub nodes; The hub nodes of each participant's local graph correspond one-to-one with the mirror nodes of the external graph in the third-party trusted environment. Mirror edges are constructed between the two for message passing between the hub nodes and the mirror nodes. The step of performing distributed training on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model includes: The local graph neural networks of each participant are initialized with parameters, wherein the mirror node is initialized as a zero vector; Each participant obtains the target representation vector of all nodes by performing a first graph convolution calculation of the local graph neural network and a second graph convolution calculation of the external graph neural network. Each participant obtains a corresponding predicted value based on graph data / graph data and labels through the local graph neural network, and obtains a corresponding loss value based on the predicted value and the true value through a loss function. For the participant that provides the label, after the first representation vector of the participant is obtained by the first graph convolution calculation, the first representation vector is passed through a classifier to obtain the predicted value of the label. Based on their respective loss values, each participant uses the backpropagation algorithm to update the parameters of the local graph neural network through the local graph neural network and the external graph neural network. The above process is repeated until the local graph neural networks of each participant are trained, resulting in a trained heterogeneous graph neural network model. The process until the local graph neural network training of each participant is completed includes: The third-party trusted environment stores the training status of each participant and forwards it to other participants. When all participants are in the end state, the external graph neural network enters the training end state. Each participant obtains the target representation vector of all nodes through the first graph convolution calculation of the local graph neural network and the second graph convolution calculation of the external graph neural network, including: Each participant performs a first graph convolution calculation on the local graph neural network to obtain the first representation vector of all nodes, and sends the first representation vector of the hub node to the external graph neural network. After receiving the first representation vector of the hub node in the same round from all participants, the external graph neural network performs a second graph convolution calculation based on the first representation vector of all participants to obtain the second representation vector of all mirror nodes, and sends it to the corresponding participants. Each participating party determines the second representation vector of the hub node as the target representation vector of the hub node, and determines the first representation vector of the remaining nodes as the target representation vector of the remaining nodes.
2. The method as described in claim 1, characterized in that, Each participant performs the first graph convolution calculation of the local graph neural network to obtain the first representation vector of all nodes, including: Get the Layer node corresponds to the first The neighbor node vector of the layer and the first node of the node The first representation vector of the layer; The first The neighbor node vectors of the layer are subjected to the first vector transformation, and all the neighbor node vectors after the first vector transformation are normalized and summed to obtain the first sub-representation vector; The node's first The first representation vector of the layer is transformed into a second vector to obtain the second sub-representation vector; Based on the first sub-representation vector and the second sub-representation vector, the first sub-representation vector is obtained. The first representation vector of the layer node is obtained by repeating the above steps to obtain the first representation vector of all nodes.
3. The method as described in claim 1, characterized in that, The process of calculating the second representation vector of all mirror nodes by performing a second graph convolution based on the first representation vector of all participants includes: Get the Layer Target Participants Mirror node corresponds to the The first representation vector of the neighboring nodes of the other participating parties in the layer and the first representation vector of the node The first representation vector of the layer; The first The first representation vectors of the other participating neighbor nodes in the layer are transformed into third vectors, and the first representation vectors after all the third vector transformations are normalized and summed to obtain the third sub-representation vector. The node's first The first representation vector of the layer is transformed into a fourth vector to obtain the fourth sub-representation vector; Based on the third sub-representation vector and the fourth sub-representation vector, the first... Layer Target Participants The second representation vector of the node is obtained by repeating the above steps to obtain the second representation vectors of all participating nodes.
4. The method as described in claim 1, characterized in that, Each participant updates the parameters of the local graph neural network based on its corresponding loss value using a backpropagation algorithm through the local graph neural network and the external graph neural network, including: Based on their respective loss values, each participant uses the backpropagation algorithm to obtain the first gradient value of all nodes of each participant, and sends the first gradient value of the hub node to the external graph neural network. After receiving the first gradient value of the hub node of all participants in the same round, the external graph neural network calculates the second gradient value of the mirror node, updates the parameters of the external graph neural network using gradient descent, and sends the second gradient value of the mirror node to the local graph neural network of the corresponding participant. After receiving the second gradient value of the mirror node, each participant continues to calculate the gradient values of other parameters dependent on the mirror node, and uses the gradient descent algorithm to update the parameters of the local graph neural network.
5. The method as described in claim 1, characterized in that, The local graph neural networks of each participating party are trained, resulting in a trained heterogeneous graph neural network model, including: The local graph neural networks of each participant meet the training termination condition, and the training of the local graph neural networks of each participant is completed. When all participants' local graph neural networks have been trained, the external neural network has also been trained. The trained heterogeneous graph neural network model is obtained.
6. The method as described in claim 1, characterized in that, The method further includes: Obtain heterogeneous graph data related to the predicted content, input the heterogeneous graph data into a trained heterogeneous graph neural network model for prediction, and obtain the prediction result.
7. A distributed training device for heterogeneous graph neural networks, characterized in that, The device includes: The first construction module is used to obtain the local data of each participant and construct a heterogeneous graph based on the local data of each participant. The heterogeneous graph includes the local graph of each participant and the external graph between the participants. The nodes in the external graph are the mirror nodes corresponding to the hub nodes that are associated with each participant and other participants. The mirror edges between the hub nodes and the mirror nodes are the association edges between the external graph and the local graph. The second construction module is used to construct a heterogeneous graph neural network model, wherein the heterogeneous graph neural network model includes local graph neural networks and external graph neural networks of each participant, the external graph neural network is in a third-party trusted environment, the internal association data of each participant is stored in the local environment, and the external association data related to other participants is stored in the third-party trusted environment. The training module is used to perform distributed training on the heterogeneous graph neural network model based on the heterogeneous graph to obtain the trained heterogeneous graph neural network model. The first construction module is specifically used by each participant to construct a corresponding local graph using local data, and to mark nodes associated with other participants as hub nodes; Each participating party will send the hub node and external association information in the local graph to a third-party trusted environment via an encrypted channel; In the trusted third-party environment, external association information from each participant is used to form the external graph of the hub nodes of each participant, wherein the nodes in the external graph are mirror nodes of the hub nodes; The hub nodes of each participant's local graph correspond one-to-one with the mirror nodes of the external graph in the third-party trusted environment. Mirror edges are constructed between the two for message passing between the hub nodes and the mirror nodes. The training module is specifically used to initialize the parameters of the local graph neural networks of each participant, wherein the mirror node is initialized as a zero vector; Each participant obtains the target representation vector of all nodes by performing a first graph convolution calculation of the local graph neural network and a second graph convolution calculation of the external graph neural network. Each participant obtains a corresponding predicted value based on graph data / graph data and labels through the local graph neural network, and obtains a corresponding loss value based on the predicted value and the true value through a loss function. For the participant that provides the label, after the first representation vector of the participant is obtained by the first graph convolution calculation, the first representation vector is passed through a classifier to obtain the predicted value of the label. Based on their respective loss values, each participant uses the backpropagation algorithm to update the parameters of the local graph neural network through the local graph neural network and the external graph neural network. The above process is repeated until the local graph neural networks of each participant are trained, resulting in a trained heterogeneous graph neural network model. The training module is specifically used to store the training status of each participant in the third-party trusted environment and forward it to other participants. When all participants are in the end state, the external graph neural network enters the training end state. The training module is also used for each participant to perform the first graph convolution calculation of the local graph neural network, obtain the first representation vector of all nodes, and send the first representation vector of the hub node to the external graph neural network. After receiving the first representation vector of the hub node in the same round from all participants, the external graph neural network performs a second graph convolution calculation based on the first representation vector of all participants to obtain the second representation vector of all mirror nodes, and sends it to the corresponding participants. Each participating party determines the second representation vector of the hub node as the target representation vector of the hub node, and determines the first representation vector of the remaining nodes as the target representation vector of the remaining nodes.
8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-6.
Citation Information
Patent Citations
Gradient boosting tree model prediction method, device and system
CN111242385A
Method and system for generating gradient boosting tree model
CN111309848A