A node prediction method, system, storage medium and device for graph structure data
By forming a local map data set on the client and performing classification training, the cross-client information loss problem in graph structure data federated learning is solved, efficient node prediction and data privacy protection is achieved, and data leakage risks and communication costs are reduced.
Patent Information
- Application Number
- CN202411183426.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-08-27
AI Technical Summary
Federated learning based on graph structure data has the problem of missing cross-client information, resulting in insufficient node representation, reducing model training accuracy, and difficult to implement data privacy protection.
By forming a local map data set on each client, classifying it to obtain the training set and test set, training based on local data and global model parameters, updating the local model parameters, and aggregating the model parameters on the server, iterating to the convergence conditions, realizing the graph Node prediction of structured data reduces the risk of data leakage.
There is no need to migrate the original graph data, and only model parameters or gradient information is transmitted, which reduces the risk of data leakage and communication costs, and improves model training accuracy and data privacy protection.
Smart Images

Figure CN118708769B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data, and in particular to a node prediction method, system, storage medium and device for graph structured data. Background Art
[0002] Graph Neural Networks (GNNs) are a deep learning method that can process graph structured data and extract more effective potential feature information. However, more and more sensitive data is now used in the training and analysis of graph data, which poses a great challenge to data privacy protection. In addition, in real environments, graph data is often not stored in a centralized manager, but is usually distributed in multiple local terminals, which further exacerbates the risk of data privacy.
[0003] Federated learning is a distributed learning approach that enables parties to collaborate on training machine learning models without sharing private data.
[0004] Currently, federated learning based on graph structured data has the problem of missing information across clients. In order to mine the structural information of the graph, the graph convolutional neural network needs to aggregate the feature information of the neighboring nodes of the target node. For graph federated learning with structured data, each client has a subgraph of the global graph. The neighbor nodes of the local node may be distributed on the subgraphs of other clients, and the neighbor node information on other clients cannot be accessed during the local training phase. Ignoring this part of information will lead to insufficient node representation and reduce the accuracy of model training. Summary of the invention
[0005] The purpose of this application is to provide a node prediction method, system, storage medium and device for graph structured data, which does not require the migration of the client's original graph data and reduces the risk of data leakage on each client.
[0006] In order to solve the above technical problems, the present application provides a node prediction method for graph structure data, and the specific technical solution is as follows:
[0007] S1: Each client forms a local graph dataset based on local data; the local graph dataset includes node features, edge information and node labels;
[0008] S2: classify the local map data set to obtain a training set and a test set;
[0009] S3: After receiving the global model parameters sent by the server, each client performs training based on the local graph data set and the initial global model parameters contained in itself to obtain local model parameters; wherein each client is used to initialize the graph embedding vector features of the node, propagate to the neighbors of the node, obtain the final graph embedding vector features, and update its own model based on the final graph embedding vector features;
[0010] S4: After the server aggregates the local model parameters uploaded by each of the clients, an updated global model parameter and gradient are obtained;
[0011] Iteratively executing step S3 to step S4 until a convergence condition is met, and receiving a global model sent by the server;
[0012] The global model is applied to perform node prediction on graph structure data.
[0013] Optionally, classifying the local map data set to obtain a training set and a test set includes:
[0014] Using a fixed neighbor partitioning method to classify the local map data set to obtain a training set and a test set;
[0015] The fixed neighbor division method comprises the following steps:
[0016] Set the average degree to the amount of neighbor data K;
[0017] For each node in the graph, a neighbor list is constructed based on the adjacency relationship of neighbor nodes;
[0018] Based on the neighbor list, a part of the nodes is randomly selected as the starting point, and the nodes and a fixed number of neighbor nodes are divided into the same set, and the nodes are expanded according to the neighbor list until the number of nodes of the training set or the test set is met to obtain the training set and the test set; and the nodes in the training set and the test set are not repeated.
[0019] Optionally, after the training set and the test set are obtained after the node quantity requirement of the training set or the test set is met, the process further includes:
[0020] The class balance and node connectivity of the training set and the test set are checked to ensure that there are no repeated nodes in the test set and the training set.
[0021] Optionally, each client performs training based on the local map data set and initial global model parameters contained in itself, and obtains local model parameters including:
[0022] For any target client, the initial global model parameters are trained using the graph neural network model to obtain local model parameters;
[0023] The target client initializes the graph embedding vector feature of the node and propagates it to the neighbors of the node to obtain the graph embedding vector feature after propagation; the propagation adopts a set neighbor propagation depth;
[0024] Calculating a loss function based on the propagated graph embedding vector features, and applying a back-propagation algorithm to calculate the gradient of model parameters;
[0025] The local model parameters are updated according to the gradient to obtain updated local model parameters; the updated local model parameters are used to be uploaded to the server in combination with the number of samples of each category on the target client.
[0026] Optionally, for the local map dataset on any of the clients, the generation process includes:
[0027] A local loss function is defined according to the number of data nodes in the client, the true labels of the data nodes and the corresponding model prediction values; the model prediction values are determined by the feature vectors of the data nodes, the adjacency matrix and the forward propagation function of the graph neural network.
[0028] Based on the local loss function, a graph neural network is applied for training to obtain a local graph dataset.
[0029] Optional, including:
[0030] Adding a regularization term to the local loss function to avoid overfitting of the local map dataset;
[0031] ;
[0032] in is the total loss function after adding regularization, is the original loss function, is the regularization term; is the regularization coefficient, which is used to control the strength of the regularization term. It is positively correlated with the regularization effect.
[0033] Optionally, when adding a regularization term to the local loss function, the following is further included:
[0034] The regularization coefficient of the regularization term is determined by cross-validation.
[0035] The present application also provides a node prediction system for graph structure data, which is provided on each client, and the system includes:
[0036] A local data set construction module, used to form a local graph data set based on local data; the local graph data set includes node features, edge information and node labels;
[0037] A data classification module, used to classify the local map data set to obtain a training set and a test set;
[0038] A local training module, configured to receive the global model parameters sent by the server, and each client performs training based on the local map data set and the initial global model parameters contained in the client to obtain local model parameters;
[0039] A local parameter updating module, configured to obtain updated global model parameters and gradients after the server aggregates the local model parameters uploaded by each client;
[0040] An iteration module, used for entering the local training module until a convergence condition is met, and then receiving a global model sent by the server;
[0041] The prediction module is used to apply the global model to perform node prediction on the graph structure data.
[0042] The present application also provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-mentioned method when executed by a processor.
[0043] The present application also provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method when calling the computer program in the memory.
[0044] The present application provides a node prediction method for graph structure data, including: S1: each client forms a local graph data set according to local data; the local graph data set includes node features, edge information and node labels; S2: the local graph data set is classified to obtain a training set and a test set; S3: after receiving the global model parameters sent by the server, each of the clients is trained based on the local graph data set and the initial global model parameters contained in itself to obtain local model parameters; S4: after the server aggregates the local model parameters uploaded by each of the clients, the updated global model parameters and gradients are obtained; iteratively execute steps S3 to S4 until the convergence condition is met, and then receive the global model sent by the server; and apply the global model to perform node prediction on the graph structure data.
[0045] The node prediction method provided in this application does not require the migration of the original graph data of each client. Only the model parameters or gradient information are transmitted to the central server, which greatly reduces the risk of leakage of graph data of each client. On this basis, the transmitted model parameters or gradient information can be homomorphically encrypted to further protect the graph data information of each client. At the same time, this application adopts a federated learning model training method. Compared with traditional centralized training, federated learning reduces the transmission of a large amount of data, and only exchanges model parameters or gradient information, thereby reducing communication costs and network bandwidth requirements.
[0046] The present application also provides a node prediction system for graph structured data, a computer-readable storage medium, and an electronic device, which have the above-mentioned beneficial effects and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0048] Figure 1 A flowchart of a node prediction method for graph structure data provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a node prediction system structure for graph structure data provided in an embodiment of the present application;
[0050] Figure 3 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] See also Figure 1 , Figure 1 A flowchart of a node prediction method for graph structure data provided by an embodiment of the present application, the method comprising:
[0053] S1: Each client forms a local graph dataset based on local data; the local graph dataset includes node features, edge information and node labels;
[0054] S2: classify the local map data set to obtain a training set and a test set;
[0055] S3: After receiving the global model parameters sent by the server, each client performs training based on the local graph data set and the initial global model parameters contained in itself to obtain local model parameters; wherein each client is used to initialize the graph embedding vector features of the node, propagate to the neighbors of the node, obtain the final graph embedding vector features, and update its own model based on the final graph embedding vector features;
[0056] S4: After the server aggregates the local model parameters uploaded by each of the clients, an updated global model parameter and gradient are obtained;
[0057] S5: Determine whether the convergence condition is met; if not, return to S3; if so, enter S6;
[0058] S6: receiving the global model sent by the server;
[0059] S7: Apply the global model to perform node prediction on the graph structure data.
[0060] Steps S5-S6 in this embodiment are equivalent to iteratively executing steps S3 to S4 until a convergence condition is met, and then receiving the global model sent by the server.
[0061] First, prepare the data set: Each client i forms a local graph data set based on its local data. , the dataset contains node features , side information and node labels , dataset composition In this example, the public data set Cora is used. The data set includes two files. The content of one file mainly includes node number, node feature vector, and node label. An example is shown in Table 1:
[0062] Table 1 Schematic table of the first category of file contents in the dataset
[0063]
[0064] The second type of file represents the connection relationship of the node numbers, and an example is shown in Table 2 below:
[0065] Table 2 Schematic diagram of the second category of files in the dataset
[0066]
[0067] Thereafter, in step S2, each client divides its own graph data set. For example, 80% of the data set can be set as a training set, and 20% can be used for local testing. Of course, those skilled in the art may also intend to adopt other setting ratios, which are not specifically limited here. Since this step classifies the nodes of the graph structure data, a fixed neighbor partitioning method may also be used in this example to classify the local graph data set to obtain a training set and a test set, which is intended to maintain the local neighborhood structure of the node. The following are the steps to implement fixed neighbor partitioning:
[0068] S11, determine the number of neighbors: set the average value of the degree to the amount of neighbor data K;
[0069] S12. Build a neighbor list: For each node in the graph, build its neighbor list based on its adjacency relationship.
[0070] S13, partitioning the data set: Based on the constructed neighbor list, start partitioning the data set. For each node, it and a fixed number of neighbor nodes are partitioned into the same set. A portion of nodes can be randomly selected as starting points, and expanded according to the neighbor list until the required training set or test set size is reached. Ensure that the nodes in the training set and the test set are not repeated throughout the process.
[0071] S14. Verify the partitioning results: Check the training and test sets after the partitioning to ensure that they meet the expected requirements, mainly by checking the category balance and the connectivity of the nodes (by checking whether the nodes in each set can reach each other through edges).
[0072] It should be noted that the degree set in step S11 originally means the number of edges directly connected to the node, and here refers to the average number of neighbors of the node. In addition, each client needs to initialize the local model. At the same time, the global model parameters are initialized on the server side. , and then distribute the initialized model parameters to each client.
[0073] S3, local model training: each client (i) uses the local graph dataset and initial model parameters Perform training to obtain local model parameters , the construction process is as follows:
[0074] For any target client, the initial global model parameters are trained using the graph neural network model to obtain local model parameters;
[0075] The target client initializes the graph embedding vector feature of the node and propagates it to the neighbors of the node to obtain the graph embedding vector feature after propagation; the propagation adopts a set neighbor propagation depth;
[0076] Calculating a loss function based on the propagated graph embedding vector features, and applying a back-propagation algorithm to calculate the gradient of model parameters;
[0077] The local model parameters are updated according to the gradient to obtain updated local model parameters; the updated local model parameters are used to upload to the server in combination with the number of samples of each category on the target client.
[0078] Each client has a local graph dataset and uses the GNN model for local training. The local loss function is defined as:
[0079] ;
[0080] in is the loss function of client i, are model parameters, is the true label of data node j in client i, is the model prediction value of data node j in client i, N is the number of data nodes in client i, where ,in represents the feature vector of data node j, Represents the adjacency matrix of data node j, reflecting the connection relationship between nodes. Function H is the forward propagation function of the graph neural network, which calculates the embedding representation or classification result of the node based on the node features and the adjacency matrix.
[0081] Client i initializes the embedding of the node, i.e. the graph embedding vector feature: , and then perform k-degree (depth of neighbor propagation) propagation on the neighbors of node v to obtain the final graph embedding vector feature as a new feature. The calculation method is as follows:
[0082] ;
[0083] in, For graph datasets Nodes, Is a node The neighbor node function of is expressed as: ,in Is a node characteristics. ,in Indicates that matrices are concatenated column by column.
[0084] According to the obtained , calculate the loss function defined , , thus obtaining the loss function: , according to the back propagation algorithm, calculate the gradient of the model parameters .
[0085] Using the calculated gradients, client i updates the parameters of the local model ,in is the learning rate.
[0086] The client will update the model parameters and (The number of samples of each category on client i) is uploaded to the server. In order to ensure the privacy of the data, during the parameter upload process, homomorphic encryption can be used to encrypt the model parameters before uploading.
[0087] After the server receives the model parameters θ uploaded by each client, it aggregates the model parameters using the FedAvg aggregation algorithm. The aggregation formula is: , where K is the number of clients, N is the total number of samples of all clients, is the number of samples of client i, are the local model parameters of client i, and θ are the global model parameters. , the number of samples for each category in the global model.
[0088] S4. The server distributes the updated global model parameters θ to each client. After receiving the global model parameters or gradients, each client updates the local model.
[0089] After that, iteration and optimization are performed: S3 to S5 are repeated to perform multiple rounds of local training, parameter aggregation, and global update until the convergence conditions are met (such as the loss function converges or the preset number of iterations is reached).
[0090] If the optimization goal of the server-side global model is: (The loss function of the global model is the smallest), where . is the loss function of client i, represents the feature vector of data node j, Represents the adjacency matrix of data nodes, reflecting the connection relationship between nodes. Function H is the predecessor of graph neural network propagation function. is the true label of data node j in client i.
[0091] After receiving the global model sent by the server, the global model is a trained model that can be directly used to predict nodes on graph structure data. That is, after the server-side model meets the convergence requirements, the global model is distributed to each client, and each client can use the received global model to predict nodes on the new graph structure data.
[0092] The node prediction method provided in the embodiment of the present application does not need to migrate the original graph data of each client. Only the model parameters or gradient information are transmitted to the central server, which greatly reduces the risk of leakage of graph data of each client. On this basis, the transmitted model parameters or gradient information can be homomorphically encrypted to further protect the graph data information of each client. At the same time, the present application adopts a federated learning model training method. Compared with traditional centralized training, federated learning reduces the transmission of a large amount of data, and only exchanges model parameters or gradient information, thereby reducing communication costs and network bandwidth requirements.
[0093] Based on the above embodiment, after each round of iteration, the performance of the global model on the validation set can be evaluated, and the learning rate, model structure or other hyperparameters can be adjusted as needed.
[0094] In addition, as a preferred implementation of the present application, in order to reduce the impact of data heterogeneity on each client, a regularization term can be introduced into the loss function, which can help prevent overfitting and improve the generalization ability of the model. The loss function after introducing regularization is as follows: ;
[0095] in is the total loss function after adding regularization, is the original loss function, is the regularization term. In this example, the L1 regularization term is introduced, so:
[0096] ;
[0097] Among them, θ is the local model parameter, N is the sample of the local graph data, j represents the jth node, is the regularization coefficient, which is used to control the strength of the regularization term. The larger it is, the stronger the regularization effect is and the simpler the model is; The smaller it is, the weaker the regularization effect will be and the more complex the model may be. The value of can find a balance between model complexity and generalization ability. A large value may make the model too simple, resulting in underfitting; a small value may make the model too complex, resulting in overfitting. Therefore, in this example, cross-validation is used to select the appropriate value.
[0098] This embodiment introduces a regularization term to help prevent the generated global model from overfitting and improve the generalization ability of the global model.
[0099] See also Figure 2 , Figure 2A schematic diagram of a node prediction system structure for graph structure data provided in an embodiment of the present application, the system is provided in each client and may include:
[0100] A local data set construction module, used to form a local graph data set based on local data; the local graph data set includes node features, edge information and node labels;
[0101] A data classification module, used to classify the local map data set to obtain a training set and a test set;
[0102] A local training module is used for receiving the global model parameters sent by the server, and each client performs training based on the local graph data set and the initial global model parameters contained in itself to obtain local model parameters; wherein each client is used to initialize the graph embedding vector features of the node, propagate to the neighbors of the node, obtain the final graph embedding vector features, and update its own model based on the final graph embedding vector features;
[0103] A local parameter updating module, configured to obtain updated global model parameters and gradients after the server aggregates the local model parameters uploaded by each client;
[0104] An iteration module, used for entering the local training module until a convergence condition is met, and then receiving a global model sent by the server;
[0105] The prediction module is used to apply the global model to perform node prediction on the graph structure data.
[0106] Based on the above embodiment, as a preferred embodiment, the data classification module is a module for performing the following steps:
[0107] Using a fixed neighbor partitioning method to classify the local map data set to obtain a training set and a test set;
[0108] The fixed neighbor division method comprises the following steps:
[0109] Set the average degree to the amount of neighbor data K;
[0110] For each node in the graph, a neighbor list is constructed based on the adjacency relationship of neighbor nodes;
[0111] Based on the neighbor list, a part of the nodes is randomly selected as the starting point, and the nodes and a fixed number of neighbor nodes are divided into the same set, and the nodes are expanded according to the neighbor list until the number of nodes of the training set or the test set is met to obtain the training set and the test set; and the nodes in the training set and the test set are not repeated.
[0112] Based on the above embodiment, as a preferred embodiment, the data classification module further includes:
[0113] The connectivity detection unit is used to check the category balance of the training set and the test set and the connectivity of the nodes to ensure that there are no repeated nodes in the test set and the training set.
[0114] Based on the above embodiment, as a preferred embodiment, the local training module on the target client is used to perform the following steps:
[0115] Using a graph neural network model to train the initial global model parameters to obtain local model parameters;
[0116] Initializing the graph embedding vector feature of the node, and propagating it to the neighbors of the node to obtain the graph embedding vector feature after propagation; the propagation adopts setting the neighbor propagation depth;
[0117] Calculating a loss function based on the propagated graph embedding vector features, and applying a back-propagation algorithm to calculate the gradient of model parameters;
[0118] The local model parameters are updated according to the gradient to obtain updated local model parameters; the updated local model parameters are used to be uploaded to the server in combination with the number of samples of each category on the target client.
[0119] Based on the above embodiments, as a preferred embodiment, for any of the above clients, it includes a local map data set generation module, which is used to perform the following steps:
[0120] A local loss function is defined according to the number of data nodes in the client, the true labels of the data nodes and the corresponding model prediction values; the model prediction values are determined by the feature vectors of the data nodes, the adjacency matrix and the forward propagation function of the graph neural network.
[0121] Based on the local loss function, a graph neural network is applied for training to obtain a local graph dataset.
[0122] Based on the above embodiment, as a preferred embodiment, the local map data set generation module includes:
[0123] A regularization processing unit, used for adding a regularization term to the local loss function to avoid overfitting of the local map data set;
[0124] The local loss function expression is:
[0125] ;
[0126] in is the total loss function after adding regularization, is the original loss function, is the regularization term; is the regularization coefficient, which is used to control the strength of the regularization term. It is positively correlated with the regularization effect.
[0127] Based on the above embodiment, as a preferred embodiment, the regularization processing unit is further used to determine the regularization coefficient of the regularization term through cross-validation.
[0128] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0129] The present application also provides an electronic device, see Figure 3 , a structural diagram of an electronic device provided in an embodiment of the present application, such as Figure 3 As shown, a processor 1410 and a memory 1420 may be included.
[0130] Among them, the processor 1410 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0131] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421, wherein, after the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the method performed by the electronic device side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1422 may include Windows, Linux, Android, etc.
[0132] In some embodiments, the electronic device may further include a display screen 1430 , an input / output interface 1440 , a communication interface 1450 , a sensor 1460 , a power source 1470 , and a communication bus 1480 .
[0133] certainly, Figure 3 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In actual applications, the electronic device may include Figure 3 More or fewer components than shown, or combinations of certain components.
[0134] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the system provided in the embodiment, since it corresponds to the method provided in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0135] Specific examples are used herein to illustrate the principles and implementation methods of the present application, and the description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.
[0136] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A node prediction method for graph structured data, It is characterized in that include: S1: Each client forms a local graph dataset based on local data; the local graph dataset includes node features, edge information and node labels; S2: classify the local map data set to obtain a training set and a test set; S3: After receiving the global model parameters sent by the server, each client performs training based on the local graph data set and the initial global model parameters contained in itself to obtain local model parameters; wherein each client is used to initialize the graph embedding vector features of the node, propagate to the neighbors of the node, obtain the final graph embedding vector features, and update its own model based on the final graph embedding vector features; S4: After the server aggregates the local model parameters uploaded by each of the clients, an updated global model parameter and gradient are obtained; Iteratively executing step S3 to step S4 until a convergence condition is met, and receiving a global model sent by the server; Applying the global model to perform node prediction on graph structure data; Each client performs training based on the local map data set and initial global model parameters contained in the client, and obtains local model parameters including: For any target client, the initial global model parameters are trained using the graph neural network model to obtain local model parameters; The target client initializes the graph embedding vector feature of the node and propagates it to the neighbors of the node to obtain the graph embedding vector feature after propagation; the propagation adopts a set neighbor propagation depth; Calculating a loss function based on the propagated graph embedding vector features, and applying a back-propagation algorithm to calculate the gradient of model parameters; The local model parameters are updated according to the gradient to obtain updated local model parameters; the updated local model parameters are used to be uploaded to the server in combination with the number of samples of each category on the target client.
2. The method according to claim 1, It is characterized in that The local map data set is classified to obtain a training set and a test set including: Using a fixed neighbor partitioning method to classify the local map data set to obtain a training set and a test set; The fixed neighbor division method comprises the following steps: Set the average degree to the amount of neighbor data K; For each node in the graph, a neighbor list is constructed based on the adjacency relationship of neighbor nodes; Based on the neighbor list, a part of the nodes is randomly selected as the starting point, and the nodes and a fixed number of neighbor nodes are divided into the same set, and the nodes are expanded according to the neighbor list until the number of nodes of the training set or the test set is met to obtain the training set and the test set; and the nodes in the training set and the test set are not repeated.
3. The method according to claim 2, It is characterized in that After the number of nodes of the training set or the test set is met and the training set and the test set are obtained, the method further includes: The class balance and node connectivity of the training set and the test set are checked to ensure that there are no repeated nodes in the test set and the training set.
4. The method according to claim 1, It is characterized in that For a local map dataset on any of the clients, the generation process includes: A local loss function is defined according to the number of data nodes in the client, the true labels of the data nodes, and the corresponding model prediction values; the model prediction values are determined by the feature vectors of the data nodes, the adjacency matrix, and the forward propagation function of the graph neural network; Based on the local loss function, a graph neural network is applied for training to obtain a local graph dataset.
5. The method according to claim 4, It is characterized in that Also includes: A regularization term is added to the local loss function to avoid overfitting of the local map data set; the local loss function expression is: ; in is the total loss function after adding regularization, is the original loss function, is the regularization term; is the regularization coefficient, which is used to control the strength of the regularization term. It is positively correlated with the regularization effect.
6. The method according to claim 5, It is characterized in that When adding a regularization term to the local loss function, it also includes: The regularization coefficient of the regularization term is determined by cross-validation.
7. A node prediction system for graph structured data, It is characterized in that Located at each client, the system includes: A local data set construction module, used to form a local graph data set based on local data; the local graph data set includes node features, edge information and node labels; A data classification module, used to classify the local map data set to obtain a training set and a test set; A local training module is used for receiving the global model parameters sent by the server, and each client performs training based on the local graph data set and the initial global model parameters contained in itself to obtain local model parameters; wherein each client is used to initialize the graph embedding vector features of the node, propagate to the neighbors of the node, obtain the final graph embedding vector features, and update its own model based on the final graph embedding vector features; A local parameter updating module, configured to obtain updated global model parameters and gradients after the server aggregates the local model parameters uploaded by each client; An iteration module, used for entering the local training module until a convergence condition is met, and then receiving a global model sent by the server; A prediction module, used for applying the global model to perform node prediction on graph structure data; The local training module on the target client is used to perform the following steps: Using a graph neural network model to train the initial global model parameters to obtain local model parameters; Initializing the graph embedding vector feature of the node, and propagating it to the neighbors of the node to obtain the graph embedding vector feature after propagation; the propagation adopts setting the neighbor propagation depth; Calculating a loss function based on the propagated graph embedding vector features, and applying a back-propagation algorithm to calculate the gradient of model parameters; The local model parameters are updated according to the gradient to obtain updated local model parameters; the updated local model parameters are used to be uploaded to the server in combination with the number of samples of each category on the target client.
8. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the node prediction method for graph structured data as described in any one of claims 1 to 6 are implemented.
9. An electronic device, It is characterized in that It comprises a memory and a processor, wherein the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the node prediction method for graph structured data as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Federal learning-based model training method and apparatus, and electronic device
CN116542296A
Graph structure data node classification method and device in heterogeneous federated environment
CN117171628A
