Mask-masked transverse federal heterogeneous graph learning method and device
By adopting masking technology and cluster coefficient weight allocation strategy in federated learning, dynamically adapting to heterogeneous graph features is solved, and the problems of low aggregation efficiency, poor robustness and semantic inconsistency in traditional federated learning are improved, and the generalization ability and aggregation efficiency of the model are improved.
Patent Information
- Application Number
- CN202510272823.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-04-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional federated learning faces problems of low aggregation efficiency, poor robustness and semantic inconsistency when processing heterogeneous graph data, especially in an environment where client graph structures change dynamically.
Using the horizontal federated heterogeneous graph learning method of mask mask, the client trains the graph neural network locally, randomly selectively masks the feature embeddings by dynamically generating mask masks, mining high-order topological structures, and updating parameters in combination with edge reconstruction loss, consistency semantic loss and classification loss. The global server calculates the aggregate weight based on the clustering coefficient and the number of nodes, and optimizes the global model.
By dynamically adapting to the structural differences and non-independent distribution characteristics of heterogeneous graphs, the aggregation efficiency and generalization ability of the global model are improved, and the semantic inconsistency problem is solved.
Smart Images

Figure CN119761410A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of federated learning, and in particular to a masked lateral federated heterogeneous graph learning method and device. Background Art
[0002] In recent years, Federated Learning (FL), as a distributed machine learning framework, has achieved multi-party collaborative modeling while protecting data privacy, and has been widely used in data-sensitive fields such as finance and healthcare. Its core idea is to train model parameters locally on the client and upload them to the server for aggregation through encryption to avoid sharing of original data. However, with the expansion of graph data applications, traditional federated learning faces significant challenges in processing non-Euclidean data structures. Horizontal Federated Learning (HFL), as an important branch of FL, requires each client to collaborate in the same feature space, but its limitations in heterogeneous graph (HG) scenarios are gradually emerging.
[0003] Federated Graph Learning (FGL) combines the advantages of graph neural networks (GNNs) and federated learning to solve the problem of joint modeling of distributed graph data. However, in actual scenarios, graph data between clients often presents high heterogeneity, which is manifested in significant differences in node types, edge attributes, and topological structures. Traditional FGL methods assume that the distribution of client graph structures is consistent and adopt fixed aggregation weights or static model update strategies, which are difficult to adapt to complex heterogeneous graph features. For example, the first existing technology directly aggregates the graph model updates of each client, ignoring the dynamic changes of the graph structure, resulting in the inability of the global model to capture client-specific information; the second existing technology allocates fixed weights based on data volume or device resources, but does not consider data quality and graph structure heterogeneity, which may amplify the negative impact of low-quality clients on the model. In addition, the high-order topological relationships (such as multi-hop connections) and semantic consistency of heterogeneous graphs are insufficiently modeled, further limiting the generalization ability and robustness of the model. In a dynamic environment, the client graph structure evolves over time. Traditional methods are prone to model lag due to the lack of adaptive mechanisms, exacerbating the aggregation bias of non-independent and identically distributed (Non-IID) data. These problems seriously restrict the practical application effectiveness of federated heterogeneous graph learning in scenarios such as financial risk control and social network analysis. There is an urgent need for an innovative method that can dynamically adapt to heterogeneous graph characteristics and optimize aggregation strategies. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a masked horizontal federated heterogeneous graph learning method and device to eliminate or improve one or more defects existing in the prior art, and solve the problems of low global model aggregation efficiency, poor robustness and semantic inconsistency caused by structural differences, dynamic changes and non-independent distribution of heterogeneous graph data in horizontal federated learning.
[0005] One aspect of the present invention provides a masked horizontal federated heterogeneous graph learning method, the method is executed based on a client, the client maintains local independent heterogeneous graph data, and multiple clients and a global server collaborate to perform horizontal federated learning, the method comprising the following steps: The local graph neural network is deployed based on the initial parameters of the global graph neural network distributed by the global server, and the local graph neural network is trained using the local independent heterogeneous graph data. The local graph neural network dynamically generates a mask to randomly and selectively mask the feature embedding of each layer input to mine the high-order topological structure; the local graph neural network calculates the similarity between nodes under a given meta-path and uses this to determine whether there is a high-order topological relationship, and establishes an edge reconstruction loss; randomly masks some attributes of the nodes in the independent heterogeneous graph data, and dynamically adjusts the masking ratio, and the local graph neural network restores the masked attributes to establish a consistent semantic loss; the local graph neural network combines with a node classifier to classify the nodes in the independent heterogeneous graph data to establish a first classification loss; the local graph neural network is updated with the edge reconstruction loss, the consistent semantic loss and the first classification loss; The local parameters of the trained local graph neural network are sent to the global server, so that the global server calculates the number of triangles and triplets along the specified meta-path according to the edge set under the meta-path specified by each client, calculates the clustering coefficient of each client, calculates the aggregation weight according to the clustering coefficient and the number of nodes in the local independent heterogeneous graph data of the corresponding client, aggregates each local parameter to update the parameters of the global graph neural network, and iterates multiple rounds until the set stop condition is reached.
[0006] In some embodiments, in the method, the client further performs the following steps: Deploy an active learning agent, construct a first state space, and construct a local active state based on the node centrality, information entropy, and information density of each node in the independent heterogeneous graph data; construct a first action space, collect data samples in the independent heterogeneous graph data with a fixed batch size and calculate the active scores of the data samples, and select a set number of data samples with higher active scores to participate in local training, and calculate the statistical characteristics of the active scores of the data samples participating in the training; during the local training process, the results of node classification are combined with the labels in the data samples to form a second classification loss; and also calculate the hidden layer representation of the local independent heterogeneous graph data based on the local graph neural network as a local data prototype; Correspondingly, the global server obtains the local data prototypes of the clients currently participating in the training to obtain a global prototype set, and redistributes the global prototype set to the clients currently participating in the training; at the same time, the statistical features corresponding to the clients currently participating in the training are obtained and combined as the global state to construct a second state space; and the second action space is constructed with the selection of the clients participating in the next round of training as the action; The client identifies a target client that is closest to the local data prototype, introduces a regularization term by minimizing the distance between the local data prototype of the target client and the target client, adds the second classification loss, and updates the parameters of the local training of the client by combining the edge reconstruction loss, the consistency semantic loss and the first classification loss; A first reward is calculated by combining the local training performance index of the client and the global model performance index of the global server; a second reward value is calculated by combining the global model performance index and the target accuracy; based on the form of reinforcement learning, the client participating in the next round of training and its local data samples participating in the training are selected with maximizing the first reward and the second reward value as the optimization direction.
[0007] In some embodiments, the local graph neural network dynamically generates a mask to randomly and selectively mask the feature embedding of each layer input to mine a high-order topological structure, including: Selectively hiding the side information of the independent heterogeneous graph data input into the local graph neural network is expressed as: ; in, is the mask matrix, represents element-wise multiplication, and A represents the original independent heterogeneous graph data; The feature embedding of the Lth layer in the local graph neural network is expressed as: ; in, , is the adjacency matrix The corresponding degree matrix, is the activation function, I represents the identity matrix, represents the weight of the Lth layer; The local graph neural network calculates the similarity between nodes under a given meta-path and uses this to determine whether there is a high-order topological relationship, and establishes an edge reconstruction loss, including: For two nodes v and u connected by a meta-path p, the following formula is used to predict the existence of the edge; ; in, It is the high-order topological index between nodes u and v under the meta-path p, and f represents the cosine similarity function; is the feature representation of node v under meta-path p, and the calculation formula is: ; in, is the attention weight between nodes uv under meta-path p; Calculate the edge reconstruction loss, the calculation formula is: ; in, Indicates the actual existence, 1 means existence, 0 means non-existence.
[0008] In some embodiments, randomly masking some attributes of nodes in the independent heterogeneous graph data, and dynamically adjusting the masking ratio, restoring the masked attributes by the local graph neural network, and establishing a consistent semantic loss, including: During the heterogeneous graph convolution process of the local graph neural network, the node feature representation after random masking is updated as follows: ; in, , is the initial masking rate, is the rate at which the mask ratio changes during training, 𝑟 is the current global training round; before introducing the random mask, each node uses the first probability Retain its characteristics, with the second probability Replaced by the unmasked features of neighboring nodes; The local graph neural network performs attribute recovery based on the node feature representation after random masking, and the calculation formula is: ; in, is the characteristic after the node is restored, is the final representation generated by multi-layer aggregation, 𝑔(·) is the decoding function responsible for mapping the high-dimensional node representation back to the attribute space; The consistency semantic loss is calculated as follows: ; in, Represents the set of obscured nodes; The edge reconstruction loss, the consistency semantic loss and the first classification loss are combined to update the parameters of the local graph neural network. The loss calculation formula after the kth client is combined is: ; in, represents the first classification loss, represents the edge reconstruction loss, represents the consistency semantic loss, and is the weight coefficient.
[0009] In some embodiments, the global server calculates the number of triangles and triples along the specified meta-path according to the edge set under the meta-path specified by each client, and calculates the clustering coefficient of each client, and the calculation formula is: ; Wherein, p represents the meta-path, v and w represent the nodes under the meta-path, represents the set of neighbor nodes, represents the edge set; The aggregation weight is calculated according to the clustering coefficient and the number of nodes in the independent heterogeneous graph data of the corresponding client. The aggregation weight calculation formula of the kth client is: ; in, Represents the number of nodes in the independent heterogeneous graph data locally on the kth client.
[0010] In some embodiments, the first reward is calculated by combining the local training performance index of the client and the global model performance index of the global server, and the calculation formula is: ; in, represents the first reward, represents the first exponent base, represents the global model performance index at time step t, wherein the global model performance index is the classification accuracy based on the global test data set, The local training performance indicator representing the t time step, wherein the local training performance indicator is the classification accuracy based on the local test data set; The second reward value is calculated by combining the global model performance index and the target accuracy, and the calculation formula is: ; in, represents the second reward, represents the second exponent base, represents the global model performance index at time step t, wherein the global model performance index is the classification accuracy based on the global test data set, Indicates the target accuracy.
[0011] In some embodiments, the method further comprises: The local data prototype is calculated by using the heterogeneous graph neural network to represent the hidden layer of the local independent heterogeneous graph data, and the calculation formula is: ; in, Represents the local data prototype of the kth client, represents the heterogeneous graph neural network local to the kth client, Represents the independent heterogeneous graph data locally on the kth client; The client identifies the target client closest to its local data prototype, and introduces a regularization term by minimizing the distance between the local data prototype and the target client. The calculation formula of the regularization term is: ; in, Indicates the client local data prototype that is closest to the local data prototype of the kth client.
[0012] On the other hand, the present invention also provides a masked lateral federated heterogeneous graph learning device, comprising a processor, a memory, and a computer program / instructions stored in the memory, wherein the processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the above method.
[0013] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.
[0014] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0015] The beneficial effects of the present invention are at least: The masked horizontal federated heterogeneous graph learning method and device described in the present invention are carried out through two stages: client local training and global aggregation. In the client local training, the local graph neural network is first deployed based on the initial parameters distributed by the global server, and the input feature embedding is randomly and selectively masked by the dynamically generated mask mask, forcing the model to mine high-order topological structures, and establishing edge reconstruction loss to optimize the topological perception ability; at the same time, the node attributes are randomly masked and the masking ratio is dynamically adjusted. The high masking rate in the early stage of training forces the model to rely on neighborhood information to restore missing attributes, and gradually reduces it in the later stage to improve the accuracy, and enhances the robustness of semantic modeling through consistent semantic loss; in addition, the classification loss is generated by combining the node classifier, and the local parameters are updated by combining the three types of losses. In the global aggregation stage, the server calculates the clustering coefficient according to the edge set under the meta-path specified by each client to reflect the compactness of the graph structure, dynamically allocates the aggregation weight based on the number of nodes, preferentially integrates the client model parameters with rich topological information, and iteratively optimizes the global model. Compared with traditional static aggregation strategies, this solution dynamically adapts to the structural differences and non-independent distribution characteristics of heterogeneous graphs through masking technology, solving the semantic inconsistency problem caused by dynamic changes in client graph data; the weight allocation strategy based on clustering coefficient effectively captures the value of local graph structure and improves the aggregation efficiency and generalization ability of the global model.
[0016] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.
[0017] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings: Figure 1 A structural diagram of a masked horizontal federated heterogeneous graph learning method according to an embodiment of the present invention.
[0019] Figure 2 This is a structural diagram of a mask-based horizontal federated heterogeneous graph learning method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0021] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.
[0022] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0023] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.
[0024] Federated Heterogeneous Graph Learning (FHGL) combines federated learning (FL) and heterogeneous graph neural networks (HGNNs) to deal with the problem of heterogeneous graph (HG) data distribution among participants. Each participant trains a model on its local HG data and transfers the model parameters to a central server for aggregation, which is implemented through the FL framework. FHGL is well suited for scenarios that handle distributed HG data. For example, banks and financial institutions can improve the performance of financial risk management and fraud detection models through local training while protecting user privacy. In a federated learning setting, the non-independent and identically distributed (non-IID) nature of data exacerbates the challenges of model robustness and adaptability, especially when the feature and label distributions are unbalanced. Compared with traditional Euclidean data such as images or text, training HGNNs in the FL setting faces more complex data heterogeneity problems. Horizontal Federated Heterogeneous Graph Learning (HFHGL) is a special case of FHGL, where participants have similar types of HG structures, with nodes and edges sharing the same schema, but each holding different data samples. The distribution characteristics of heterogeneous data further increase the difficulty of HFHGL.
[0025] This application aims to address the challenges of data heterogeneity and graph structure complexity in horizontal federated learning by dynamically adjusting and selecting key information in graph data. This method introduces masking technology on each client to dynamically select and mask unimportant graph structures and node information, so that the global model can more flexibly adapt to the data distribution and graph data characteristics of different clients during training.
[0026] One aspect of the present invention provides a masked horizontal federated heterogeneous graph learning method, which is executed based on a client, the client maintains local independent heterogeneous graph data, and multiple clients and a global server collaborate to perform horizontal federated learning. The method includes the following steps S101-S102: Step S101: deploy the local graph neural network based on the initial parameters of the global graph neural network distributed by the global server, and use the local independent heterogeneous graph data to train the local graph neural network. The local graph neural network dynamically generates a mask to randomly and selectively mask the feature embedding of each layer input to mine the high-order topological structure; the local graph neural network calculates the similarity between nodes under a given meta-path and uses this to determine whether there is a high-order topological relationship, and establishes an edge reconstruction loss; randomly masks some attributes of the nodes in the independent heterogeneous graph data, and dynamically adjusts the masking ratio. The local graph neural network restores the masked attributes and establishes a consistent semantic loss; the local graph neural network combines with the node classifier to classify the nodes in the independent heterogeneous graph data and establishes a first classification loss; the local graph neural network parameters are updated by combining the edge reconstruction loss, the consistent semantic loss and the first classification loss.
[0027] Step S102: Send the local parameters of the trained local graph neural network to the global server, so that the global server calculates the number of triangles and triplets along the specified meta-path according to the edge set under the meta-path specified by each client, calculates the clustering coefficient of each client, calculates the aggregation weight according to the clustering coefficient and the number of nodes in the local independent heterogeneous graph data of the corresponding client, aggregates the local parameters to update the parameters of the global graph neural network, and iterates multiple rounds until the set stop condition is reached.
[0028] In step S101, the global graph neural network initial parameters distributed by the global server provide a unified starting point for each client, ensuring that different clients can carry out training based on similar model architectures and parameters, reducing the differences in local training of each client, and facilitating parameter aggregation in subsequent federated learning. The global server stores an initialized graph neural network model. Each independent client receives the parameters of the initialized model from the global server, such as the weight matrix, bias vector, etc., and locally deploys the same graph neural network architecture as the global model, including graph convolutional layers, attention mechanisms and other modules. The client loads its own independent heterogeneous graph data into the local environment, ready for subsequent training processes.
[0029] In the process of dynamically generating mask masks and mining high-order topological structures, by randomly and selectively masking certain feature embeddings, simulating data missing or noise scenarios, the model is forced to learn the high-order topological structures hidden in the data and enhance the model's ability to understand complex relationships. When embedding the features of each layer of the graph neural network input, the client local model dynamically generates a mask matrix, which has the same dimension as the feature embedding. According to a certain probability, the elements in the mask matrix are randomly selected and set to 0 (indicating that they are masked), and the other elements are set to 1. For example, if the masking ratio is set to 20%, 20% of the feature embedding positions are randomly selected to be masked. The mask matrix is multiplied element by element with the feature embedding, and only the position features with a value of 1 will be retained, and the feature values corresponding to the position with a value of 0 will be ignored in subsequent calculations. As the training progresses, the masking ratio can be adjusted dynamically, such as gradually reducing the masking ratio according to the current training round and the change of the loss function, so as to balance the relationship between mining high-order structures and model training stability.
[0030] Exemplarily, the local graph neural network dynamically generates a mask to randomly and selectively mask the feature embedding of each layer input to mine high-order topological structures, including: Selectively hide the side information of independent heterogeneous graph data input into the local graph neural network, expressed as: ; in, is the mask matrix, represents element-wise multiplication, and A represents the original independent heterogeneous graph data.
[0031] The feature embedding of the Lth layer in this map neural network is expressed as: ; in, , is the adjacency matrix The corresponding degree matrix, is the activation function, I represents the identity matrix, represents the weight of the Lth layer.
[0032] Edge reconstruction loss is to determine whether there is a high-order topological relationship between nodes by calculating the node similarity under a given meta-path, and set the loss function according to whether it actually exists, so as to enable the model to better learn the implicit edge relationship between nodes. Meta-path is a way to define the relationship path between nodes. For example, in a heterogeneous graph, "user-publish-article-cited-another user" can constitute a meta-path. Under a given meta-path, the client uses the local graph neural network to extract the feature representation of the node, for example, by aggregating the information of neighboring nodes through multi-layer graph convolution operations to obtain the node embedding vector. The similarity between the nodes is calculated based on their embedding vectors. Commonly used methods include cosine similarity and inner product. If the similarity exceeds the set threshold, the model believes that there is a high-order topological edge between the nodes. The actual edge set is compared with the edge set predicted by the model, and the edges predicted incorrectly are recorded, such as the edges predicted by the model to exist but do not actually exist, or the edges predicted by the model to not exist but actually exist, forming edge reconstruction loss. The loss function may use cross entropy loss, mean square error, etc. to measure the difference between the prediction and the true value.
[0033] Exemplarily, the local graph neural network calculates the similarity between nodes under a given meta-path and uses this to determine whether a high-order topological relationship exists, and establishes an edge reconstruction loss, including steps S201-S202: Step S201: For two nodes v and u connected by a meta-path p, edge existence is predicted using the following formula; ; in, It is the high-order topological index between nodes u and v under the meta-path p, and f represents the cosine similarity function; is the feature representation of node v under meta-path p, and the calculation formula is: ; in, is the attention weight between nodes uv under meta-path p.
[0034] Step S202: Calculate edge reconstruction loss, the calculation formula is: ; in, Indicates the actual existence, 1 means existence, 0 means non-existence.
[0035] Consistent semantic loss randomly masks some attributes of the nodes, and then restores these masked attributes. By comparing the difference between the restored results and the original attributes, a loss function is formed to train the model for robustness and consistency of semantic features. In the independent heterogeneous graph data of the client, some attributes of the nodes are randomly selected for masking, such as setting the user's age, interests and other attributes as missing values with a certain probability. Based on the current intact attribute information, the masked attributes are restored using the local graph neural network. The restoration process may involve deep learning of multi-layer networks, such as feature mapping through fully connected layers, activation functions, etc. The restored attribute values are compared with the original true attribute values to calculate the consistent semantic loss. The loss function usually uses mean square error (MSE), absolute error (MAE), etc. to measure the degree of difference between the predicted attributes and the true attributes. The masking ratio can be dynamically adjusted according to the training situation. For example, a larger masking ratio (such as 50%) is used at the beginning to allow the model to fully learn the association between attributes. As the training progresses, the masking ratio is gradually reduced to 10%~20% to verify the adaptability of the model to low-noise environments.
[0036] Exemplarily, randomly masking some attributes of nodes in independent heterogeneous graph data, and dynamically adjusting the masking ratio, restoring the masked attributes by the local graph neural network, and establishing a consistent semantic loss, including steps S301 to S303: Step S301: During the heterogeneous graph convolution process of the local graph neural network, the node feature representation after random masking is updated to: ; in, , is the initial masking rate, is the rate at which the mask ratio changes during training, 𝑟 is the current global training round; before the introduction of random masks, each node uses the first probability Retain its characteristics, with the second probability Replaced by the unmasked features of neighboring nodes.
[0037] Step S302: The local graph neural network performs attribute recovery based on the node feature representation after random masking, and the calculation formula is: ; in, is the characteristic after the node is restored, is the final representation generated by multi-layer aggregation, and 𝑔(·) is the decoding function responsible for mapping the high-dimensional node representation back to the attribute space.
[0038] Step S303: Calculate the consistency semantic loss, the calculation formula is: ; in, Represents the set of nodes that are obscured.
[0039] Establish the first classification loss, combine the node classifier to classify the nodes, and use the classification task to encourage the model to learn the category characteristics of the nodes, so that the model can be applied to actual classification scenarios and provide support for subsequent business needs. In independent heterogeneous graph data, each node usually has a certain category label. For example, in a social network graph, a user node may be labeled as an interest category. The client's local graph neural network inputs the node's embedding vector into the node classifier, which can be a softmax classifier or other type of classifier. After the classifier calculates, the probability distribution of the node belonging to each category is obtained. Compare the predicted probability distribution with the true category label of the node, usually expressed in one-hot encoding form, and calculate the classification loss. The classification loss generally uses the cross entropy loss function to measure the difference between the predicted distribution and the true distribution. Adjust the parameters of the graph neural network and node classifier according to the classification loss to optimize the classification performance of the model so that it can accurately classify nodes.
[0040] The joint edge reconstruction loss, consistency semantic loss and first classification loss are used to update the parameters of the local graph neural network. The loss calculation formula after the kth client is combined is: ; in, represents the first classification loss, represents the edge reconstruction loss, represents the consistency semantic loss, and is the weight coefficient.
[0041] In step S102, the parameters updated by each client after local training are collected to the global server to provide a data basis for the subsequent global graph neural network parameter aggregation. After completing local training (after multiple training batches or cycles), the client sends the parameters of the local graph neural network (such as weight matrix, bias vector, etc.) to the global server. Since directly uploading the original data may involve privacy issues, encryption is usually used to encrypt the parameters and then transmit them to ensure the security of the data. The global server receives the local parameters from each client and stores them in a specific storage area, ready for aggregation operations. In the process of calculating the clustering coefficient and aggregation weight, the clustering coefficient and aggregation weight are calculated according to the local graph structure characteristics and data scale of each client, so as to determine the contribution of each client when aggregating local parameters in the future, and achieve more reasonable parameter aggregation. Based on the local parameters of each client and the calculated aggregation weight, the parameters of the global graph neural network are updated to generate new global parameters for the next round of federated learning iterations.
[0042] Specifically, the global server calculates the number of triangles and triples along the specified meta-path according to the edge set under the meta-path specified by each client, and calculates the clustering coefficient of each client. The calculation formula is: ; Wherein, p represents the meta-path, v and w represent the nodes under the meta-path, represents the set of neighbor nodes, Denotes the edge set.
[0043] The aggregation weight is calculated based on the clustering coefficient and the number of nodes in the local independent heterogeneous graph data of the corresponding client. The aggregation weight calculation formula for the kth client is: ; in, Represents the number of nodes in the local independent heterogeneous graph data of the kth client.
[0044] In some embodiments, in the method, the client further performs the following steps S401-S404: Step S401: deploy active learning agents, construct a first state space, and construct a local active state based on the node centrality, information entropy, and information density of each node in the independent heterogeneous graph data; construct a first action space, collect data samples in the independent heterogeneous graph data with a fixed batch size and calculate the active scores of the data samples, and select a set number of data samples with higher active scores to participate in local training, and calculate the statistical characteristics of the active scores of the data samples participating in the training; during the local training process, the results of node classification are combined with the labels in the data samples to form a second classification loss; and the hidden layer representation of the local independent heterogeneous graph data is calculated based on the local graph neural network as a local data prototype.
[0045] Step S402: Correspondingly, the global server obtains the local data prototypes of the clients currently participating in the training to obtain a global prototype set, and redistributes the global prototype set to the clients currently participating in the training; at the same time, the statistical features corresponding to the clients currently participating in the training are obtained and combined as the global state to construct a second state space; and the second action space is constructed with the selection of the clients participating in the next round of training as the action.
[0046] Step S403: The client identifies the target client that is closest to its local data prototype, introduces a regularization term by minimizing the distance between the local data prototype of the client and the target client, adds a second classification loss, and updates the parameters of the client's local training by combining the edge reconstruction loss, consistency semantic loss, and the first classification loss.
[0047] Step S404: Calculate the first reward by combining the local training performance index of the client and the global model performance index of the global server; calculate the second reward value by combining the global model performance index and the target accuracy; based on the form of reinforcement learning, select the clients participating in the next round of training and their local data samples participating in the training with maximizing the first reward and the second reward value as the optimization direction.
[0048] In step S401, the deployment of active learning agents builds local active states, allowing the client to identify the most valuable parts of the data sample for model training, thereby more efficiently performing data sampling and model training. The first state space is composed of features such as node centrality, information entropy, and information density of each node in the independent heterogeneous graph data. Node centrality reflects the importance of the node in the network, information entropy measures the uncertainty of node information, and information density reflects the richness of information around the node.
[0049] The method calculates the contribution of different types of edges to the centrality based on the degree centrality, and quantifies the node centrality. The calculation formula is: ; in, is the degree centrality of node v; T represents the set of edge types; represents the degree of node v on edge type t; The weight representing the edge type.
[0050] In some embodiments, the method further includes: using a node classifier to quantify the information entropy corresponding to the classification probability of the node; using the norm, sparsity index or diversity index of the hidden layer representation of each node after feature extraction through the heterogeneous graph neural network to quantify the information density; wherein the sparsity index is the zero element ratio, and the diversity index is the Simpson diversity index. Based on the parameters , the active score The percentiles are used as the corresponding statistical features.
[0051] The client collects data samples in the local data with a fixed batch size. The batch size can be set to a certain value, such as 32, 64, etc. After collecting the data samples, the activity score of each sample is calculated. The activity score may be comprehensively evaluated based on factors such as the diversity, complexity, and potential for improving model performance of the sample. According to the level of the activity score, a set number of samples (such as the batch size) are selected to participate in local training. The features of these highly active samples may be more representative and can better promote the model to learn key information. Calculate the statistical features of the activity scores of the samples participating in the training data, such as the mean, standard deviation, and variance. These statistical features can reflect the overall activity level of the current sample set and provide a basis for subsequent decision-making and model optimization. Combine the node classification results with the true label to construct a new classification loss function, which works together with the first classification loss to further optimize the classification performance of the model. Combine the node classification results with the true label to construct a new classification loss function, which works together with the first classification loss to further optimize the classification performance of the model.
[0052] Generate a high-level feature representation for local data to facilitate subsequent global server aggregation analysis of data and models. Use local graph neural networks to calculate the hidden layer representation of local independent heterogeneous graph data. The hidden layer is the middle layer in the neural network, which contains abstract features of the original input data. For example, the node embedding vector after multi-layer graph convolution operations. After some form of aggregation (such as average, maximum value, etc.), the hidden layer representation forms a vector that can represent the overall characteristics of the local data, that is, the local data prototype.
[0053] In some embodiments, a local data prototype is calculated by using a heterogeneous graph neural network to represent the hidden layer of the independent heterogeneous graph data, and the calculation formula is: ; in, Represents the local data prototype of the kth client, represents the heterogeneous graph neural network local to the kth client, Represents the independent heterogeneous graph data locally on the kth client.
[0054] In step S402, the global server collects the local data prototypes of each client, constructs a global prototype set, provides a unified reference framework for each client, and promotes the collaborative optimization of data and models between different clients. Based on the statistical features collected by the global server, a global state is constructed to provide a global perspective for subsequent client selection and training decisions. The global server obtains the statistical features corresponding to the client currently participating in the training. These statistical features may include statistical values (such as mean, variance) of the local data prototypes of each client, node classification performance indicators, etc. Taking the selection of clients to participate in the next round of training as an action, an action space is constructed to provide possible options for the global server to decide on the next stage of training arrangements.
[0055] In step S403, the distance between the local data prototypes of the client and the target client is shortened by the regularization term, so as to reduce overfitting and enhance the generalization ability of the model. The client identifies the target client that is closest to its local data prototype. This may be based on a distance metric between the data prototypes of the two clients, such as Euclidean distance, cosine similarity, etc. A regularization term is introduced, and the value of the regularization term is the distance between the local data prototypes of the two clients. By minimizing this distance, the local data prototype is brought closer to the data prototype of the target client. The edge reconstruction loss, consistency semantic loss, first classification loss and the newly added regularization term are combined to jointly update the model parameters to achieve multi-objective optimization.
[0056] The client identifies the target client that is closest to its local data prototype, and introduces a regularization term by minimizing the distance between the local data prototype and the target client. The calculation formula of the regularization term is: ; in, Indicates the client local data prototype that is closest to the local data prototype of the k-th client.
[0057] In step S404, by calculating the reward value, an optimization target is provided for the subsequent reinforcement learning process, guiding the system to select the optimal training strategy.
[0058] The first reward is calculated by combining the local training performance index of the client and the global model performance index of the global server. The calculation formula is: ; in, Indicates the first reward, represents the first exponent base, represents the global model performance index at time step t. The global model performance index is the classification accuracy based on the global test data set. Represents the local training performance indicator at time step t. The local training performance indicator is the classification accuracy based on the local test dataset.
[0059] The second reward value is calculated by combining the global model performance index and the target accuracy. The calculation formula is: ; in, Indicates the second reward, represents the second exponent base, represents the global model performance index at time step t. The global model performance index is the classification accuracy based on the global test data set. Indicates the target accuracy.
[0060] On the other hand, the present invention also provides a masked lateral federated heterogeneous graph learning device, comprising a processor, a memory, and a computer program / instructions stored in the memory, wherein the processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the above method.
[0061] The present invention is described below in conjunction with a specific embodiment: This embodiment provides a horizontal federated heterogeneous graph learning method based on masking, the structure is as follows Figure 2 As shown. The key technologies of this embodiment include high-order topological structure mining, consistent semantic modeling, and aggregation strategy based on clustering coefficient. High-order topological structure mining enhances the model's perception of multi-hop and indirect connections, enabling it to effectively capture the global structural information of the graph. Through consistent semantic modeling, MAFedHGL learns to recover missing information by dynamically masking some node attributes to ensure semantic consistency between clients. In addition, the federated aggregation strategy based on clustering coefficient adjusts the aggregation weight according to the structural closeness of each client graph, allowing the global model to pay more attention to valuable graph structures.
[0062] For a federated environment with k clients and one server, the kth client maintains its own independent heterogeneous graph data ,in and are the feature matrix and the label matrix respectively, and Represents a heterogeneous graph data.
[0063] Mining high-order topological structures: In heterogeneous graphs, the relationships between nodes are not only determined by direct adjacency connections; instead, there are complex high-order topological relationships. These high-order relationships refer to the interactions between nodes formed by multi-hop, multi-path, or indirect connections. By mining high-order topological structures, the model can effectively capture these multi-scale graph features. In local HGNN training, the edge information in the input graph is randomly and selectively hidden. This can be expressed as: ; in, is the mask matrix, represents element-wise multiplication, and A represents the original independent heterogeneous graph data. Then, the model passes through the heterogeneous graph convolutional network Perform hierarchical learning, each layer of feature embedding Capturing information from local neighborhoods to higher-order topological structures.
[0064] ; in, , is the adjacency matrix The corresponding degree matrix, is the activation function, I represents the identity matrix, Represents the weight of the Lth layer. During the hierarchical learning process, convolution operations are repeatedly stacked so that node features can propagate from adjacent nodes to more distant nodes. This mechanism forces the model to rely not only on local direct connection information, but also to infer hidden features from the remaining graph structure. The hidden information in the edge relationship information drives the model to learn how to capture topological information from distant nodes or high-order graph paths. The model needs to learn the similarity between nodes under a given meta-path and use this similarity to determine whether there is a high-order topological relationship. For two nodes 𝑣 and 𝑢 connected by a meta-path 𝑝, the model needs to predict whether there is a relationship between 𝑣 and 𝑢.
[0065] ; in, It is the high-order topological index between nodes u and v under the meta-path p, and f represents the cosine similarity function; is the feature representation of node v under meta-path p, and the calculation formula is: ; in, is the attention weight between nodes uv under meta-path p.
[0066] In order to optimize the accuracy of high-order topology mining, the loss is calculated based on edge reconstruction. The model minimizes the following loss function: ; in, Indicates the actual existence, 1 means existence, 0 means non-existence.
[0067] By learning high-order topological structures, the model can not only understand local node relationships, but also capture the global distribution of the graph. This enables the model to form a global consistent understanding of the entire graph when processing complex heterogeneous graphs, thereby enhancing its reasoning and generalization capabilities.
[0068] Consistent Semantic Modeling: This model focuses on recovering the attribute information of nodes by predicting the obscured target attributes. CSM aims to learn the global and local semantic information of nodes and establish adaptive semantic representations of nodes. The goal of CSM is to ensure that even when the information of some nodes or edges is missing, the model can use other visible information in the graph to recover the missing attributes. This requires the model to not only understand the local node-edge structure, but also to build a consistent semantic representation in the global context.
[0069] Randomly masking some attributes of some nodes forces the model to rely on the unmasked attributes of other nodes and the topological relationships between nodes to infer the masked information. In order to further enhance the robustness and generalization ability of the model when processing heterogeneous graphs (HG), the model dynamically adjusts the masking ratio according to the complexity of different nodes or features during training, instead of using a fixed masking ratio. Therefore, during the heterogeneous graph convolution process, the node representation is updated as: ; in, , is the initial masking rate, is the rate at which the mask ratio changes during training, 𝑟 is the current global training round; before the introduction of random masks, each node uses the first probability Retain its characteristics, with the second probability Replaced by the unmasked features of neighboring nodes.
[0070] In the early stages of training, the model applies a higher masking rate and more features are masked, forcing the model to learn from limited input features or neighborhood information. As training progresses, the dynamic masking rate gradually decreases, allowing the model to utilize more node features, thereby improving its accuracy in reconstruction tasks. In this way, the model gradually transitions to processing scenarios with fewer masks, enhancing its adaptability to complex graph structures. In order to ensure the randomness of information masking and the stability of model convergence, before applying feature masking, a portion of node samples will be masked with a certain probability. retains its characteristics unaffected. In addition, with a certain probability , some sample features will be replaced by the unmasked features of neighboring nodes. Once the node representation is updated through the aggregation operation, the model attempts to recover the masked target attributes. The recovered attributes can be expressed as: ; in, is the characteristic after the node is restored, is the final representation generated by multi-layer aggregation, and 𝑔(·) is the decoding function responsible for mapping the high-dimensional node representation back to the attribute space. In order to ensure that the restored attributes closely match the true attributes, the model uses the attribute reconstruction loss function to measure the difference between the restored value and the true value: ; in, Represents the set of nodes that are obscured.
[0071] This loss function enables the model to minimize the difference between the predicted attributes and the true attributes, thereby improving the accuracy of the recovery process. The final learning objective of client k is The calculation formula is as follows: ; in, represents the first classification loss, represents the edge reconstruction loss, represents the consistency semantic loss, and is the weight coefficient.
[0072] Federated aggregation based on clustering coefficient: In HG, the structure of different types of nodes and edges is complex, and in FL environment, the data distribution between clients may be significantly different. The clustering coefficient is a metric used to measure the closeness of the connection between a node and its neighbors, reflecting the local structural characteristics of the graph. Introducing the clustering coefficient into FHGL can effectively capture the connection strength between nodes in the local graph structure of each client.
[0073] A meta-path based approach is proposed, which involves defining a specific meta-path to calculate the clustering coefficient of client 𝑘 Assuming that a specific meta-path 𝑃 is selected, we can Count the number of triangles and triplets along this metapath, and thus calculate , the formula is as follows: ; Wherein, p represents the meta-path, v and w represent the nodes under the meta-path, represents the set of neighbor nodes, Denotes the edge set.
[0074] Global servers collect from each client , and according to the number of nodes in the local graph and Calculate the aggregate weight of the client. The aggregate weight of client 𝑘 is thus defined as: ; in, Represents the number of nodes in the local independent heterogeneous graph data of the kth client.
[0075] The higher the customer's local map Indicates that the nodes are more closely connected and may contain more valuable structural information. By assigning higher aggregation weights to customers with higher values, the global model can be guided to pay more attention to these valuable subgraphs, enabling the model to more effectively learn useful features from complex graph structures.
[0076] Client-side local active learning agent ALA: On the local client, ALA calculates the activity score of the sample based on the local state. It prioritizes nodes with higher scores to participate in the training of the local heterogeneous graph neural network. At the same time, the statistical features of the activity score are transmitted to the server. Since the results of local active learning are an important input to the global reinforcement learning state, it is crucial to generate stable and accurate active learning results. The reinforcement algorithm can adaptively adjust the sample selection strategy to cope with different usage scenarios and evolving global models. To achieve this goal, the active learning process on the client is instantiated as a Markov decision process. The ALA on the kth client can be represented as a tuple ,in, represents the local state set, represents the action set, specifically the probability distribution of the output choices, and Represents the reward associated with the selected action.
[0077] Status. Local active status It includes three key aspects: Node centrality, which reflects the importance of a node in a data network and is effectively calculated using the PageRank algorithm. Information entropy measures the ease with which a classifier can accurately classify node embeddings. High entropy helps learn fuzzy information, while low entropy strengthens existing knowledge. The present invention uses the classification probability of a local classifier as information entropy. Information density involves active learning on the client, selecting samples with the highest training priority instead of creating a core set for labeling. Because traditional methods that rely on core set distance calculations are difficult to apply, the present invention uses the hidden layer representation of nodes to evaluate the information density of sample embeddings.
[0078] Action. Based on the state of the local node, ALA uses a fixed batch size to calculate the activity scores of all local samples. The top node with the highest activity score is selected. samples participate in local training. At the same time, the statistical features of the activity score are calculated.
[0079] Reward. The goal of local AL can be summarized as improving the performance of the model, which is specifically reflected in the local training performance and global model performance Two aspects. It should be noted that improving global performance is the top priority; therefore, changes in global performance will be calculated and scaled exponentially. To ensure that samples with low or even negative local performance changes but that may help improve global performance are not ignored, local performance is given a linear weight. The reward is calculated as follows: ; in, represents the global model performance index at time step t. The global model performance index is the classification accuracy based on the global test data set. Represents the local training performance indicator at time step t. The local training performance indicator is the classification accuracy based on the local test dataset.
[0080] Server-Client Selection Agent CSA: On the global server side, CSA builds a global state derived from the aggregated statistical features of all client liveness scores on the global server. Subsequently, the server identifies the clients that are most likely to make significant contributions to the global model for model aggregation. Therefore, in each round of federated communication, CSA is used to select The specific design of CSA agent is as follows: State. The global client selection state can be represented as a vector ,in Indicates The statistical characteristics of the client activity score results. For the given parameters , the statistical features correspond to the evaluation results percentiles.
[0081] Action. The action space is defined as {1, 2, ..., K}, where a = k means selecting the kth device to participate in federated training.
[0082] Reward. The reward is designed to motivate the agent to get close to the target accuracy. , so as to achieve higher accuracy, the specific formula is as follows: ; in, represents the exponential base, represents the global model performance index at time step t. The global model performance index is the classification accuracy based on the global test data set. Indicates the target accuracy.
[0083] Data drift correction based on data prototypes: Due to the data selection process on the client and server sides, the global model in each aggregation round is only affected by a portion of the characteristic data. This may cause the global model to converge to a local optimum and aggravate the client drift phenomenon. To address this problem, this embodiment proposes a mitigation strategy based on data prototypes. This strategy aims to limit local training to prevent abnormal samples from having too much impact on the model and ensure the stability of training. Specifically, each client initially selects the model based on its local dataset. The hidden layer represents the calculation of the local data prototype .
[0084] ; in, Represents the local data prototype of the kth client, represents the heterogeneous graph neural network local to the kth client, Represents the independent heterogeneous graph data locally on the kth client.
[0085] Then, the central server collects all client prototypes to obtain the global prototype set , and then distribute it to the client. In this process, the server does not aggregate these prototypes, but introduces a regularization term to penalize nodes whose hidden layer features deviate from the entire federation system. The calculation formula is: ; in, Indicates the client local data prototype that is closest to the local data prototype of the k-th client.
[0086] In summary, the masked horizontal federated heterogeneous graph learning method and device described in the present invention is through two stages: client local training and global aggregation. In the client local training, the local graph neural network is first deployed based on the initial parameters distributed by the global server, and the input feature embedding is randomly and selectively masked by the dynamically generated mask mask, forcing the model to mine high-order topological structures, and establishing edge reconstruction loss to optimize the topological perception ability; at the same time, the node attributes are randomly masked and the masking ratio is dynamically adjusted. The high masking rate at the beginning of training forces the model to rely on neighborhood information to restore missing attributes, and gradually reduces it in the later stage to improve the accuracy, and enhances the robustness of semantic modeling through consistent semantic loss; in addition, the classification loss is generated by combining the node classifier, and the three types of losses are combined to update the local parameters. In the global aggregation stage, the server calculates the clustering coefficient according to the edge set under the meta-path specified by each client to reflect the compactness of the graph structure, dynamically allocates the aggregation weight based on the number of nodes, and preferentially integrates the client model parameters with rich topological information, and iteratively optimizes the global model. Compared with traditional static aggregation strategies, this solution dynamically adapts to the structural differences and non-independent distribution characteristics of heterogeneous graphs through masking technology, solving the semantic inconsistency problem caused by dynamic changes in client graph data; the weight allocation strategy based on clustering coefficient effectively captures the value of local graph structure and improves the aggregation efficiency and generalization ability of the global model.
[0087] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0088] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0089] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.
[0090] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A masked horizontal federated heterogeneous graph learning method, characterized in that: The method is executed based on a client, the client maintains local independent heterogeneous graph data, and multiple clients and a global server collaborate to perform horizontal federated learning. The method includes the following steps: The local graph neural network is deployed based on the initial parameters of the global graph neural network distributed by the global server, and the local graph neural network is trained using the local independent heterogeneous graph data. The local graph neural network dynamically generates a mask to randomly and selectively mask the feature embedding of each layer input to mine the high-order topological structure; the local graph neural network calculates the similarity between nodes under a given meta-path and uses this to determine whether there is a high-order topological relationship, and establishes an edge reconstruction loss; randomly masks some attributes of the nodes in the independent heterogeneous graph data, and dynamically adjusts the masking ratio, and the local graph neural network restores the masked attributes to establish a consistent semantic loss; the local graph neural network combines with a node classifier to classify the nodes in the independent heterogeneous graph data to establish a first classification loss; the local graph neural network is updated with the edge reconstruction loss, the consistent semantic loss and the first classification loss; The local parameters of the trained local graph neural network are sent to the global server, so that the global server calculates the number of triangles and triplets along the specified meta-path according to the edge set under the meta-path specified by each client, calculates the clustering coefficient of each client, calculates the aggregation weight according to the clustering coefficient and the number of nodes in the local independent heterogeneous graph data of the corresponding client, aggregates each local parameter to update the parameters of the global graph neural network, and iterates multiple rounds until the set stop condition is reached.
2. The masked horizontal federated heterogeneous graph learning method according to claim 1, characterized in that: In the method, the client further performs the following steps: Deploy an active learning agent, construct a first state space, and construct a local active state based on the node centrality, information entropy, and information density of each node in the independent heterogeneous graph data; construct a first action space, collect data samples in the independent heterogeneous graph data with a fixed batch size and calculate the activity scores of the data samples, and select a set number of data samples with higher activity scores to participate in local training, and calculate the statistical characteristics of the activity scores of the data samples participating in the training; During the local training process, the node classification result is combined with the label in the data sample to form a second classification loss; the hidden layer representation of the local independent heterogeneous graph data is also calculated based on the local graph neural network as a local data prototype; Correspondingly, the global server obtains the local data prototypes of the client currently participating in the training to obtain a global prototype set, and redistributes the global prototype set to the client currently participating in the training; at the same time, the statistical features corresponding to the client currently participating in the training are obtained and combined as the global state to construct a second state space; Constructing a second action space with the selection of the client participating in the next round of training as the action; The client identifies a target client that is closest to the local data prototype, introduces a regularization term by minimizing the distance between the local data prototype of the target client and the target client, adds the second classification loss, and updates the parameters of the local training of the client by combining the edge reconstruction loss, the consistency semantic loss and the first classification loss; Calculating a first reward by combining the local training performance indicator of the client and the global model performance indicator of the global server; Calculating a second reward value by combining the global model performance indicator and the target accuracy; Based on the form of reinforcement learning, the client participating in the next round of training and its local data samples participating in the training are selected with maximizing the first reward and the second reward value as the optimization direction.
3. The masked horizontal federated heterogeneous graph learning method according to claim 1, characterized in that: The local graph neural network dynamically generates a mask to randomly and selectively mask the feature embedding of each layer input to mine high-order topological structures, including: Selectively hiding the side information of the independent heterogeneous graph data input into the local graph neural network is expressed as: ; in, is the mask matrix, represents element-wise multiplication, and A represents the original independent heterogeneous graph data; The feature embedding of the Lth layer in the local graph neural network is expressed as: ; in, , is the adjacency matrix The corresponding degree matrix, is the activation function, I represents the identity matrix, represents the weight of the Lth layer; The local graph neural network calculates the similarity between nodes under a given meta-path and uses this to determine whether there is a high-order topological relationship, and establishes an edge reconstruction loss, including: For two nodes v and u connected by a meta-path p, the following formula is used to predict the existence of the edge; ; in, It is the high-order topological index between nodes u and v under the meta-path p, and f represents the cosine similarity function; is the feature representation of node v under meta-path p, and the calculation formula is: ; in, is the attention weight between nodes uv under meta-path p; Calculate the edge reconstruction loss, the calculation formula is: ; in, Indicates the actual existence, 1 means existence, 0 means non-existence.
4. The masked horizontal federated heterogeneous graph learning method according to claim 3, characterized in that: Randomly masking some attributes of nodes in the independent heterogeneous graph data, and dynamically adjusting the masking ratio, restoring the masked attributes by the local graph neural network, and establishing a consistent semantic loss, including: During the heterogeneous graph convolution process of the local graph neural network, the node feature representation after random masking is updated as follows: ; in, , is the initial masking rate, is the rate at which the mask ratio changes during training, 𝑟 is the current global training round; before introducing the random mask, each node uses the first probability Retain its characteristics, with the second probability Replaced by the unmasked features of neighboring nodes; The local graph neural network performs attribute recovery based on the node feature representation after random masking, and the calculation formula is: ; in, is the characteristic after the node is restored, is the final representation generated by multi-layer aggregation, 𝑔(·) is the decoding function responsible for mapping the high-dimensional node representation back to the attribute space; The consistency semantic loss is calculated as follows: ; in, Represents the set of obscured nodes; The edge reconstruction loss, the consistency semantic loss and the first classification loss are combined to update the parameters of the local graph neural network. The loss calculation formula after the kth client is combined is: ; in, represents the first classification loss, represents the edge reconstruction loss, represents the consistency semantic loss, and is the weight coefficient.
5. The masked horizontal federated heterogeneous graph learning method according to claim 1, characterized in that: The global server calculates the number of triangles and triples along the specified meta-path according to the edge set under the meta-path specified by each client, and calculates the clustering coefficient of each client, and the calculation formula is: ; Wherein, p represents the meta-path, v and w represent the nodes under the meta-path, represents the set of neighbor nodes, represents the edge set; The aggregation weight is calculated according to the clustering coefficient and the number of nodes in the independent heterogeneous graph data of the corresponding client. The aggregation weight calculation formula of the kth client is: ; in, Represents the number of nodes in the independent heterogeneous graph data locally on the kth client.
6. The masked horizontal federated heterogeneous graph learning method according to claim 1, characterized in that: The first reward is calculated by combining the local training performance index of the client and the global model performance index of the global server, and the calculation formula is: ; in, represents the first reward, represents the first exponent base, represents the global model performance index at time step t, wherein the global model performance index is the classification accuracy based on the global test data set, The local training performance indicator representing the t time step, wherein the local training performance indicator is the classification accuracy based on the local test data set; The second reward value is calculated by combining the global model performance index and the target accuracy, and the calculation formula is: ; in, represents the second reward, represents the second exponent base, represents the global model performance index at time step t, wherein the global model performance index is the classification accuracy based on the global test data set, Indicates the target accuracy.
7. The masked horizontal federated heterogeneous graph learning method according to claim 1, characterized in that: The method further comprises: The local data prototype is calculated by using the heterogeneous graph neural network to represent the hidden layer of the local independent heterogeneous graph data. The calculation formula is: ; in, Represents the local data prototype of the kth client, represents the heterogeneous graph neural network local to the kth client, Represents the independent heterogeneous graph data locally on the kth client; The client identifies the target client closest to its local data prototype, and introduces a regularization term by minimizing the distance between the local data prototype and the target client. The calculation formula of the regularization term is: ; in, Indicates the client local data prototype that is closest to the local data prototype of the kth client.
8. A masked horizontal federated heterogeneous graph learning device, comprising a processor, a memory, and a computer program / instruction stored in the memory, characterized in that: The processor is used to execute the computer program / instructions. When the computer program / instructions are executed, the device implements the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method as claimed in any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Hybrid prototype-based session recommendation denoising method for internal and external flow networks
CN120632325A
Fair map model construction method, equipment and medium
CN120671724A
Welding quality detection method fusing welding spatio-temporal characteristics of multiple stud welding
CN120744409A
Electric power large model pre-training method and device based on MAE and comparative learning
CN121415180A