A federated graph learning difference-aware semantic alignment method and system
Patent Information
- Application Number
- CN202611121076.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]在实际联邦学习场景中,随机边删除、特征掩码等增强操作会扭曲节点属性、破坏图结构依赖,引发增强诱导型语义偏差,导致局部节点嵌入受扰动后严重失真,大幅降低局部模型的训练稳定性;而非独立同分布的图数据分区会造成节点邻域信息不完整、数据分布偏置,引发分布诱导型语义偏差,使得跨客户端的同一节点表示出现显著错位
(1)本发明通过构建差异感知损失,约束了扰动操作带来的节点嵌入波动;同时通过构建语义对齐损失,统一了跨客户端的模型优化方向,训练过程中损失曲线平滑无震荡,能够规避现有方法常见的优化震荡、客户端优化方向偏离等问题,进而使得本发明相较于现有主流联邦图学习方法收敛速度更快,各客户端的训练损失差异显著降低,大幅提升了分布式训练的稳定性,减少了无效迭代带来的算力浪费;
Smart Images

Figure CN122965720A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of federated graph learning technology, and in particular to a federated graph learning difference-aware semantic alignment method and system. Background Technology
[0002] In the current field of federated graph learning, existing technologies, whether based on model aggregation and personalized optimization or semantic and structural alignment, assume that graph augmentation operations can fully preserve the semantic information of nodes when processing collaborative training of distributed graph data. They also focus only on mitigating data heterogeneity at the client, subgraph, or category level, which has many technical shortcomings.
[0003] In practical federated learning scenarios, enhancement operations such as random edge deletion and feature masking can distort node attributes and disrupt graph structural dependencies, leading to enhancement-induced semantic bias. This results in severe distortion of local node embeddings after perturbation, significantly reducing the training stability of local models. Furthermore, non-independent and identically distributed graph data partitioning can cause incomplete node neighborhood information and data distribution bias, leading to distribution-induced semantic bias and significant misalignment of the same node representation across clients. Simultaneously, existing methods often employ coarse-grained semantic alignment at the global or prototype level, failing to accurately correct semantic biases in individual nodes. This limits the generalization ability of the global model in non-independent and identically distributed scenarios, and some alignment methods also increase communication rounds and computational overhead, making them unsuitable for the efficient deployment requirements of large-scale distributed federated graph learning. Summary of the Invention
[0004] The purpose of this invention is to provide a difference-aware semantic alignment method and system for federated graph learning of non-independent identically distributed graph data. This method is based on computer program processing flow and solves the node-level semantic drift problem induced by graph augmentation and data distribution, thereby improving the robustness, cross-client consistency and generalization ability of federated graph learning models.
[0005] To achieve the above-mentioned objectives, the first aspect of this invention provides a federated graph learning difference-aware semantic alignment method, the method comprising: The server initializes global model parameters and synchronously distributes them to all clients. The client receives global model parameters, performs perturbation operations on the locally stored original graph, and generates the corresponding enhanced graph; Calculate the attribute differences and structural differences of each node in the original graph and the enhanced graph, fuse them to obtain the total difference value of each node, and construct the difference-aware loss based on the total difference value; The client extracts the local and global embeddings of each node in the original graph, constructs a comparison sample set based on the label differences between the node and the global embedding, and constructs a semantic alignment loss based on the comparison sample set. By fusing node classification loss, difference perception loss, and semantic alignment loss, a total loss function is constructed. The total loss function is then solved to complete the iterative update of the local model parameters on the client side. All clients upload the updated local model parameters to the server. After receiving the local model parameters uploaded by all clients, the server performs a weighted average aggregation to obtain the updated global model parameters. The server determines whether the preset number of global communication rounds has been reached. If not, it starts a new round of training based on the updated global model parameters. If the number of rounds has been reached, it outputs the final trained global model, which is a graph neural network model.
[0006] Furthermore, the original graph includes a node set, an adjacency matrix, and a node feature matrix. The adjacency matrix is used to characterize the topological connection relationships between nodes in the node set, and the node feature matrix is used to characterize the dimensional attribute information of each node in the node set. The perturbation operation performed on the locally stored original graph to generate the corresponding enhanced graph specifically involves: performing a random edge deletion operation on the adjacency matrix of the original graph and performing a feature masking operation on the node feature matrix to obtain an enhanced graph with the same node set as the original graph, except that the structure and node features have been perturbed.
[0007] Furthermore, the calculation of attribute differences and structural differences between each node in the original graph and the enhanced graph, and the fusion to obtain the total difference value for each node, specifically includes: The cosine dissimilarity of the feature vectors of each node in the original graph and the enhanced graph is calculated as the attribute difference, which is used to characterize the degree of perturbation of the node's dimensional attributes. The Wasserstein-1 distance of each node in the adjacency distribution of the original graph and the enhanced graph is calculated as the structural difference, which is used to characterize the degree of perturbation of the node's neighborhood structure. Adjust the structural differences to the same value range as the attribute differences; The convex combination of the attribute differences and structural differences is calculated as the total difference value.
[0008] Furthermore, the calculation of the Wasserstein-1 distance of each node's adjacency distribution in the original and enhanced graphs as a structural difference specifically includes: Extract the adjacent row vectors of nodes in the original graph and the enhanced graph respectively, and normalize the two adjacent row vectors into a discrete distribution on the node index space; Based on the shortest path hop count between nodes as the basic cost, the structural differences are obtained by calculating the difference in the discrete distribution of two adjacent row vectors using Wasserstein-1 distance.
[0009] Furthermore, the construction of the difference-perceived loss based on the total difference value specifically includes: The embedding vectors of nodes in the original graph and the augmented graph are extracted separately using a graph neural network encoder, and the two embedding vectors are calculated. Distance, to obtain the embedding offset of the node; The embedding offset is constrained based on the total difference value to generate a difference-aware loss.
[0010] Furthermore, the client extracts the local and global embeddings of each node in the original graph, and constructs a comparison sample set based on the label differences between the node and the global embeddings, specifically including: For each node in the original graph, the client first extracts its local embedding through the local encoder, and then extracts the global embedding of the corresponding node through the global model of the current training round. For each node, global embeddings with the same preset real labels as that node are set as positive samples, and global embeddings with different preset real labels as negative samples. A comparison sample set is constructed based on the positive and negative samples.
[0011] Furthermore, the construction of semantic alignment loss based on the contrastive sample set specifically includes: The local embedding of a node is compared with the global embedding of all positive samples to calculate the temperature scale cosine similarity, and the first calculation result is obtained. The first calculation results are then summed after taking the exponent, and the total positive sample matching degree is obtained. The local embedding of a node is compared with the global embeddings of all positive and negative samples to calculate the temperature scale cosine similarity, and the second calculation result is obtained. All the second calculation results are then summed after taking the exponent to obtain the total matching degree of the whole sample. The contrast loss for each node is calculated based on the sum of the positive sample matching scores and the sum of the full sample matching scores. The semantic alignment loss is obtained by averaging the contrast loss of all nodes.
[0012] Furthermore, before determining whether the preset number of global communication rounds has been reached, the server performs the following operations: Using the updated global model parameters, calculate the node classification accuracy for the current training round on the preset validation set; Compare the node classification accuracy of the current training round with the best node classification accuracy of the historical training rounds, and count the number of consecutive training rounds in which the node classification accuracy has not improved. Determine if the number of consecutive training rounds without improvement in node classification accuracy is greater than or equal to the preset convergence verification threshold. If yes, output the current global model as the final trained global model; otherwise, determine if the preset number of global communication rounds has been reached.
[0013] A second aspect of the present invention provides a federated graph learning difference-aware semantic alignment system, the system comprising a server and a client, the server comprising: The initialization and distribution module is used to initialize global model parameters and synchronously distribute them to all clients; The aggregation module is used to receive all local model parameters uploaded by clients, perform weighted average aggregation, and obtain updated global model parameters. The judgment module is used to determine whether the preset number of global communication rounds has been reached. If not, a new round of training is started based on the updated global model parameters. If the number of rounds has been reached, the final trained global model is output, which is a graph neural network model. The client includes: The augmented graph generation module receives global model parameters, performs perturbation operations on the locally stored original graph, and generates the corresponding augmented graph. The difference-aware loss construction module is used to calculate the attribute differences and structural differences of each node between the original graph and the enhanced graph, fuse them to obtain the total difference value of each node, and construct the difference-aware loss based on the total difference value; The semantic alignment loss construction module is used to extract the local embedding and global embedding of each node in the original graph, construct a comparison sample set according to the label difference between the local embedding and the global embedding, and construct the semantic alignment loss based on the comparison sample set; The model parameter update module is used to fuse node classification loss, difference-aware loss, and semantic alignment loss to construct a total loss function, solve the total loss function, and complete the iterative update of the local model parameters on the client. The upload module is used to upload the updated local model parameters to the server.
[0014] Compared with the prior art, the beneficial effects of the present invention are: (1) This invention constrains the node embedding fluctuations caused by perturbation operations by constructing a difference-aware loss; at the same time, it unifies the model optimization direction across clients by constructing a semantic alignment loss. The loss curve is smooth and oscillating during training, which can avoid the optimization oscillations and client optimization direction deviations that are common in existing methods. As a result, this invention converges faster than existing mainstream federated graph learning methods, significantly reduces the difference in training loss among clients, greatly improves the stability of distributed training, and reduces the waste of computing power caused by invalid iterations. (2) Existing methods can only achieve coarse-grained semantic alignment at the client and category levels. This invention constructs semantic alignment loss by comparing the differences between nodes and global embedded labels. For the first time in the federated graph learning scenario, it simultaneously completes the quantification and mitigation of two types of node-level semantic drift: reinforcement-induced and distribution-induced. It corrects semantic deviations at the finest node level, making the consistency of node-level representations better than the existing best baseline. It solves both the problem of local embedding distortion caused by graph perturbation operations and the problem of cross-client semantic misalignment caused by non-independent and identically distributed data. It achieves a breakthrough in underlying principles compared to existing methods. (3) This invention is fully compatible with existing mainstream federated learning frameworks and distributed training infrastructures. It does not require modification of the original business architecture and data flow. The additional computational overhead of local training on a single client is low, and it can adapt to the deployment needs of edge terminals and low-computing-power clients. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only preferred embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of the overall process of a federated graph learning difference-aware semantic alignment method provided in an embodiment of the present invention. Detailed Implementation
[0017] The principles and features of the present invention are described below with reference to the accompanying drawings. The listed embodiments are only used to explain the present invention and are not intended to limit the scope of the present invention.
[0018] Federated learning is a distributed training paradigm that enables multiple clients to collaboratively train a global model without directly sharing their raw data. Each client performs local training on its private dataset and periodically communicates model parameters or gradients to a central server, which aggregates these parameters or gradients to update the global model. The federated learning framework ensures data privacy because the raw data never leaves the local client, while the global model benefits from knowledge shared across distributed data sources. However, in practice, the effectiveness of federated learning is challenged by the non-IID nature of client data, leading to biased local updates and degraded global performance. These challenges are further amplified in graph-structured data due to the inherent dependencies between nodes and their neighborhoods.
[0019] Graph contrastive learning is a self-supervised paradigm that improves graph representation learning by maximizing the consistency between embeddings of different augmented views of the same instance. By contrasting multiple augmented views, graph contrastive learning encourages representation invariance and enhances the discriminative power of learned embeddings. However, traditional graph contrastive learning methods typically assume that augmented views preserve the original semantics, which may not hold true in federated learning based on heterogeneous multi-client datasets.
[0020] The method provided in this invention addresses node-level semantic drift in federated graph learning by limiting embedding variations with specific view differences through difference awareness and enforcing semantic consistency across clients through semantic alignment. Semantic drift refers to the semantic inconsistency in node representations caused by heterogeneous data distribution among clients during federated training.
[0021] Specifically, refer to Figure 1 This invention provides a federated graph learning difference-aware semantic alignment method, the method comprising the following operations: S101. The server initializes global model parameters and synchronously distributes them to all clients.
[0022] In this embodiment, the global model is a graph neural network model. The server initializes the global model parameters, specifically by initializing the trainable weight matrix of the global model encoder. This trainable weight matrix consists of core trainable parameters used to extract semantic representations of graph data nodes. Simultaneously, it presets the global communication rounds, convergence verification threshold, and validation set. The maximum global communication rounds are the pre-set maximum number of global iterations for federated training; the convergence verification threshold is the pre-set upper limit for consecutive rounds where model accuracy does not improve; and the validation set is a pre-defined, dedicated validation dataset for node classification that does not participate in model training. This step synchronously distributes the initialized trainable weight matrix to all clients participating in federated training. These clients are distributed computing nodes holding local private graph data, which are restricted by privacy regulations from sharing the original data.
[0023] S102. The client receives global model parameters, performs perturbation operations on the locally stored original graph, and generates the corresponding enhanced graph.
[0024] The original graph is local private graph data held by the client. Let the original graph be represented as... ,in Represents a set of nodes; Represents the adjacency matrix; The adjacency matrix represents the node feature matrix. The node feature matrix is used to characterize the topological connections between nodes in the node set; the node feature matrix is used to characterize the dimensional attribute information of each node in the node set.
[0025] According to at least one embodiment of this disclosure, the step of performing a perturbation operation on the locally stored original graph to generate a corresponding enhanced graph specifically involves: performing a random edge deletion operation on the adjacency matrix of the original graph, and performing a feature masking operation on the node feature matrix to obtain an enhanced graph with the same node set as the original graph, except that its structure and node features have been perturbed. .
[0026] For example, in other embodiments, methods such as node dropping, subgraph sampling, or attribute perturbation can be used instead of random edge deletion and feature masking operations.
[0027] S103. Calculate the attribute differences and structural differences of each node in the original graph and the enhanced graph, fuse them to obtain the total difference value of each node, and construct the difference-aware loss based on the total difference value.
[0028] In some embodiments, this step specifically includes: S201. Calculate the cosine dissimilarity of the feature vectors of each node in the original graph and the enhanced graph as the attribute difference, which is used to characterize the degree of perturbation of the node's feature attributes.
[0029] S202. Calculate the Wasserstein-1 distance of each node in the adjacency distribution of the original graph and the enhanced graph as the structural difference, which is used to characterize the degree of perturbation of the node's neighborhood structure.
[0030] S203. Adjust the structural differences to the same value range as the attribute differences.
[0031] S204. Calculate the convex combination of the attribute differences and structural differences as the total difference value.
[0032] Traditional contrastive learning typically assumes that the augmented view fully preserves node semantics, which may ignore biases introduced by perturbations and may be insufficient to capture fine-grained attribute-based semantic features and structural-level topological patterns. In contrast, this invention accurately quantifies attribute-level and structural-level variations by forcing the embedding distance between original and augmented graph nodes to be proportional to the difference they measure, and accordingly constrains representational variations. Thus, strongly perturbed nodes exhibit larger embedding variations, while stable nodes remain consistent.
[0033] According to at least one embodiment of this disclosure, for each node First, the cosine dissimilarity is used to define the eigenvectors of the original and enhanced graphs. and The attribute differences between them are used to characterize the degree of perturbation of the node dimension attributes, as shown in the following formula:
[0034] In the formula, , Indicates the first The feature vectors of each node in the original graph and the enhanced graph and The difference in attributes between them, this metric is located in Within the range, the larger the value, the greater the difference in the node's attributes.
[0035] According to at least one embodiment of this disclosure, for structural differences, the adjacency matrix of the original graph is represented as follows: , of which Row adjacency row vector Represents a node The connection mode, accordingly, Let represent the adjacent row vectors corresponding to the nodes in the augmented graph. These adjacent row vectors are normalized to a discrete distribution in the node index space, as shown in the following equation:
[0036]
[0037] In the formula, Represents the adjacency row vector of the original graph Normalized discrete distribution; Represents the adjacency row vectors of an augmented graph. Normalized discrete distribution; It is a small constant that ensures numerical stability.
[0038] Based on this, structural differences are defined as:
[0039] In the formula, For the first Structural differences among nodes; express and Wasserstein-1 distance; for The node index in the support set; express The node index in the support set; Represents the optimal transmission plan matrix Zhong Cong Middle node to Middle node The probability transmission quantity at that location.
[0040] Ground cost matrix The shortest path jump distance between nodes in the client subgraph is defined as follows:
[0041] In the formula, Indicates from arrive The number of hops on the shortest path. Distance exceeding a preset distance threshold. To be truncated into ,and Stored in a sparse format for improved efficiency. (Compared to the standard) Compared to cosine distance, this geometry-aware formula captures structural perturbations through minimal transmission costs between neighborhoods, which is crucial for maintaining representational consistency in heterogeneous federated topologies. In practice, computation is limited to truncated local neighborhoods, rather than the complete client graph. Let... Represents a node of The number of nodes retained within the hop, nodes Transmission optimization scales with the size of the local neighborhood. It can be set... This is sufficient to capture the most informative local structure in graph data. Since distant nodes contribute little to the similarity of local structures, the approximation error introduced by this truncation is negligible, while significantly reducing computational overhead. Furthermore, The sparse storage reduces memory usage from dense pairwise storage to reachable neighborhood pairs, making the proposed structural difference computation efficient and scalable in practice.
[0042] For each node, the Wasserstein-1 distance is calculated only within its truncated local neighborhood, not across the entire client graph. Therefore, the final transport problem is in a graph of size [missing information]. Defined on two discrete distributions. The computation of the ground cost matrix based on the shortest path within the truncated neighborhood requires at most [time period missing]. This limitation on the overall complexity of each operation, i.e., each node, is significantly lower than the complexity required for pairwise matching across the entire graph on all nodes. For those containing The client graph with n nodes has a total complexity of:
[0043] Since it is fixed to a small constant, the neighborhood size is still much smaller than the size of the complete client graph in practice, which allows the above structural difference calculation method to be extended for federated graph learning scenarios.
[0044] In terms of memory consumption, the sparse storage of the ground cost matrix only retains reachable neighborhood pairs within a hop, thus reducing the storage requirements of each local neighborhood from dense storage. Reduce to approximately This significantly improves the memory efficiency of large sparse graphs.
[0045] For example, in other embodiments, KL divergence, Euclidean distance, and cosine distance can be used instead of Wasserstein-1 distance and cosine dissimilarity in the above embodiments. The calculation is simpler, although the accuracy is slightly reduced, but difference-aware constraints can be achieved.
[0046] According to at least one embodiment of this disclosure, in order to combine attribute differences and structural differences into a unified metric, the structural differences are adjusted to the same numerical range as the attribute differences. Above. Specifically, let:
[0047]
[0048] In the formula, Indicates the client The set of nodes on the [node list]. Differences in the normalized structure of the nodes. Defined as:
[0049] The normalization described above is performed independently within each client to account for variations in graph scale and density across clients. This design ensures that the relative magnitude of structural differences is locally preserved, sufficient to guide node-level adjustments. Because the method relies on direct cross-client comparisons of local difference signals rather than normalized values, this client-specific scaling does not adversely affect the overall consistency of the learned representations.
[0050] Then, the total difference value of the nodes. The calculation is a convex combination of attribute differences and structural differences, as shown in the following equation:
[0051] In the formula, It is a balance coefficient that controls the contribution of attribute differences and structural differences.
[0052] Based on the foregoing embodiments, the construction of the difference-perceived loss based on the total difference value may include: S301. Extract the embedding vectors of nodes in the original graph and the enhanced graph respectively using a graph neural network encoder, and calculate the two embedding vectors. Distance, obtains the embedding offset of the node.
[0053] S302. Constrain the embedding offset based on the total difference value to generate the difference-aware loss.
[0054] According to at least one embodiment of this disclosure, and Representing nodes respectively Embedding vectors in the original view and the enhanced view, their embedding offsets As shown below:
[0055] To ensure consistency between representation transfer and semantic difference, this invention designs a difference-aware loss. Forced Total difference The sizes are proportional, as shown in the following formula:
[0056] In the formula, This is the scaling factor for calibrating the alignment strength. The above formula adaptively adjusts the magnitude of embedding changes, enabling the model to better capture node-specific perturbations in federated non-IID environments. For simplicity, interpretability, and optimization stability, this invention employs a linear relationship, ensuring that larger differences always lead to stronger adjustments, a common practice in previous difference-aware computation methods. This monotonic formula provides a stable correction mechanism in heterogeneous federated settings while avoiding the additional complexity and potential overfitting introduced by nonlinear mappings.
[0057] S104. The client extracts the local and global embeddings of each node in the original graph, constructs a comparison sample set based on the label differences between the node and the global embedding, and constructs a semantic alignment loss based on the comparison sample set.
[0058] Since models trained solely on local data are prone to deviating from the global optimum, directly using biased embeddings to construct positive and negative sample sets further distorts the optimization direction. To mitigate this problem, this invention employs global embeddings as reliable guidance, ensuring that local representations align with these globally consistent semantics. Furthermore, utilizing globally consistent semantic priors improves the robustness of embeddings under varying distributions.
[0059] In some embodiments, the client extracts the local embedding and global embedding of each node in the original graph, and constructs a comparison sample set based on the label differences between the node and the global embedding, specifically including: S401. For each node in the original graph, the client first extracts its local embedding through the local encoder, and then extracts the global embedding of the corresponding node through the global model of the current training round.
[0060] S402. For each node, set the global embedding with the same preset real label as a positive sample and the global embedding with a different preset real label as a negative sample, and construct a comparison sample set based on the positive and negative samples.
[0061] According to at least one embodiment of this disclosure, for the client Nodes in The local embedding representation is extracted through the local encoder. The global embedding representation is extracted from the global model of the current training round. The original graph dataset comes with the true labels for node classification. When the original graph is divided into multi-client non-independent identically distributed subgraphs using the Louvain community partitioning method, each node belongs to only a single client. The original class labels of the nodes are stored in the local private data of the corresponding client along with the nodes. During local training, the client can directly read the true labels of all its nodes.
[0062] After constructing a comparison sample set based on the alignment results between nodes and globally embedded real labels, a semantic alignment loss is constructed based on the comparison sample set, which may include: S501. Calculate the temperature scale cosine similarity between the local embedding of the node and the global embedding of all positive samples to obtain the first calculation result. Sum all the first calculation results after taking the exponent to obtain the total positive sample matching degree.
[0063] S502. Calculate the temperature scale cosine similarity between the local embedding of the node and the global embedding of all positive and negative samples respectively to obtain the second calculation result. Sum all the second calculation results after taking the exponent to obtain the total matching degree of the whole sample.
[0064] S503. Calculate the contrast loss for each node based on the sum of the positive sample matching degree and the sum of the full sample matching degree.
[0065] S504. Take the average of the contrast loss for all nodes to obtain the semantic alignment loss.
[0066] According to at least one embodiment of this disclosure, the similarity between the local embedding and the global embedding is measured using temperature-scale cosine similarity, as shown in the following formula:
[0067] In the formula, Indicates local embedding. Indicates global embedding. express and The similarity between them; Used to control the sharpness of the distribution.
[0068] Based on this, nodes Contrast loss It can be represented as:
[0069] In the formula, and These represent the positive and negative sample sets defined by the real labels, respectively. (Molecule) The denominator represents the sum of positive sample matching scores; This represents the total matching degree of all samples. This design explicitly makes node embeddings closer to positive samples with the same semantics, while staying away from negative samples with different semantics. By encouraging node embeddings to approach globally consistent embeddings while staying away from embeddings of different categories, semantic drift between clients is effectively mitigated.
[0070] For example, in other embodiments, MSE loss, L1 loss, triplet loss, or knowledge distillation loss can be used instead of the difference perception loss and contrast loss in the above embodiments to achieve similar semantic stability and alignment effects.
[0071] For example, in other embodiments, a global category prototype can be used instead of a node-by-node global embedding as the alignment benchmark, which can achieve semantic alignment without labels, thereby reducing computational and storage overhead.
[0072] S105. Integrate node classification loss, difference perception loss, and semantic alignment loss to construct a total loss function. Solve the total loss function to complete the iterative update of the local model parameters on the client side.
[0073] In some embodiments, the total loss function can be expressed as:
[0074] In the formula, Indicates the first The cross-entropy loss for each node classification task is the benchmark supervised loss that guarantees the model's classification ability. and The contributions of difference perception and semantic alignment are controlled separately. Generally, and Adjustments can be made based on data characteristics. For datasets with high client heterogeneity or significant distribution variations, add... This helps enforce semantic consistency across clients. For graphs with high sparsity or more pronounced structural perturbations, a larger [size / size] is beneficial. This is beneficial for better capturing local differences.
[0075] For example, the total loss function can be solved using the stochastic gradient descent (SGD) algorithm.
[0076] S106. All clients upload the updated local model parameters to the server. After receiving the local model parameters uploaded by all clients, the server performs a weighted average aggregation to obtain the updated global model parameters.
[0077] In some embodiments, after all clients complete local training, they only upload the updated local model parameters to the server, without transmitting any original graph data or node embedding information. The server then adjusts the parameters based on the number of local nodes on each client. Perform a weighted average aggregation of the model parameters for all clients. This corresponds to the total number of valid nodes in the client's local graph, with aggregate weight and... Proportional to each other, the updated global model parameters are obtained.
[0078] For example, in other embodiments, FedProx, FedNova, simple averaging, or adaptive weighted averaging may be used instead of the weighted average aggregation in the above embodiments to ensure compatibility with different federated learning frameworks.
[0079] S107. The server determines whether the preset number of global communication rounds has been reached. If not, it starts a new round of training based on the updated global model parameters. If the number of rounds has been reached, it outputs the final trained global model.
[0080] In some embodiments, the server performs the following operations before determining whether a preset number of global communication rounds has been reached: S601. Using the updated global model parameters, calculate the node classification accuracy for the current training round on the preset validation set.
[0081] S602. Compare the node classification accuracy of the current training round with the best node classification accuracy of the historical training rounds, and count the number of consecutive training rounds in which the node classification accuracy has not improved.
[0082] S603. Determine whether the number of consecutive training rounds in which the node classification accuracy has not improved is greater than or equal to the preset convergence verification threshold. If yes, output the current global model as the final global model after training. If no, determine whether the preset number of global communication rounds has been reached, i.e., execute step S107.
[0083] In the method provided in the above embodiments, on each client, the local training phase first generates an enhanced view of the local subgraph (i.e., the original graph) through random feature masking and random edge removal. Then, attribute and structural differences between the original and enhanced graphs are evaluated, and embedding offsets are constrained based on these measured differences. This node-specific regularization stabilizes local representation learning by suppressing semantic drift caused by perturbations. Simultaneously, the local embeddings are aligned with the corresponding global embeddings derived from the global model encoder. During local training, this alignment promotes semantic consistency between the local and global views, reducing divergence caused by biased or incomplete neighborhoods. The method progressively improves cross-client consistency and steadily reduces semantic bias caused by enhancements and distributions by iteratively refining the global embeddings and correcting local embedding drift.
[0084] Another embodiment of the present invention provides a federated graph learning difference-aware semantic alignment system, the system comprising a server and a client, the server comprising: The initialization and distribution module is used to initialize global model parameters and synchronously distribute them to all clients; The aggregation module is used to receive all local model parameters uploaded by clients, perform weighted average aggregation, and obtain updated global model parameters. The judgment module is used to determine whether the preset number of global communication rounds has been reached. If not, a new round of training is started based on the updated global model parameters. If the number of rounds has been reached, the final trained global model is output, which is a graph neural network model. The client includes: The augmented graph generation module receives global model parameters, performs perturbation operations on the locally stored original graph, and generates the corresponding augmented graph. The difference-aware loss construction module is used to calculate the attribute differences and structural differences of each node between the original graph and the enhanced graph, fuse them to obtain the total difference value of each node, and construct the difference-aware loss based on the total difference value; The semantic alignment loss construction module is used to extract the local embedding and global embedding of each node in the original graph, construct a comparison sample set according to the label difference between the local embedding and the global embedding, and construct the semantic alignment loss based on the comparison sample set; The model parameter update module is used to fuse node classification loss, difference-aware loss, and semantic alignment loss to construct a total loss function, solve the total loss function, and complete the iterative update of the local model parameters on the client. The upload module is used to upload the updated local model parameters to the server.
[0085] The system is used to execute the methods described in the foregoing method embodiments. Its working principle and technical effects can be referred to in the foregoing method embodiments, and will not be repeated here.
[0086] This invention addresses the core pain point of node-level semantic drift in existing federated graph learning technologies. Through a dual-module collaborative design of difference-aware regularization and node-level semantic alignment, it achieves comprehensive breakthroughs in technical performance, industry adaptability, and privacy compliance. Specific advantages and practical applications are as follows: I. The core technology has significant effects, comprehensively surpassing existing mainstream technical solutions. This invention achieves significantly superior node classification accuracy and a qualitative improvement in generalization capability for non-independent and identically distributed (IMDG) scenarios. On six internationally recognized benchmark datasets (Cora, Citeseer, PubMed, Texas, Wisconsin, and Minesweeper) covering both identically and dissimilarly distributed graphs, this invention consistently ranks first in node classification accuracy across multi-gradient non-independent and identically distributed scenarios with 5, 7, and 10 clients. This comprehensively surpasses traditional federated learning methods such as FedAvg and FedProx, as well as current state-of-the-art federated graph learning baselines such as FGSSL and S²FGL. Specifically, the performance is as follows: On the Citeseer dataset, which features sparse characteristics and unstable neighborhoods, the classification accuracy reaches 77.3% in the 5-client scenario, an improvement of 1.3 percentage points over the current best baseline; and 73.0% in the 10-client scenario, an improvement of 1.0 percentage point over the baseline. On the Minesweeper dataset, which exhibits significant heterogeneity, the accuracy reaches 81.6% in the 7-client scenario, an improvement of 1.1 percentage points over the best baseline. On the large-scale academic dataset PubMed, the accuracy reaches 89.1% in the 5-client scenario and maintains a high accuracy of 85.5% in the 10-client scenario, both improvements of 0.5 percentage points over the best baseline. Even with an increase in the number of clients and increased data heterogeneity, this invention maintains stable high performance, completely solving the industry pain point of existing methods experiencing significant performance degradation with an increase in the number of clients.
[0087] This invention significantly improves training stability and convergence efficiency, greatly reducing unnecessary computational overhead. It constrains node embedding fluctuations caused by graph augmentation operations through difference-aware regularization and unifies the model optimization direction across clients through node-level semantic alignment. The loss curve is smooth and oscillating during training, completely avoiding common problems in existing methods such as optimization oscillations and client-side optimization direction deviations. In a standard 200-round global communication training process, this invention demonstrates more stable and faster convergence than existing mainstream federated graph learning methods, while significantly reducing the difference in training loss among clients, greatly improving the stability of distributed training and reducing the waste of computational power caused by invalid iterations.
[0088] This invention fills a technological gap in fine-grained semantic drift governance, achieving a fundamental breakthrough. Existing methods can only achieve coarse-grained semantic alignment at the client and category levels. This invention, for the first time in a federated graph learning scenario, simultaneously quantifies and mitigates both augmentation-induced and distribution-induced node-level semantic drift, correcting semantic biases at the finest node level. This invention solves both the local embedding distortion problem caused by graph augmentation operations and the cross-client semantic misalignment problem caused by non-independent and identically distributed data, achieving a breakthrough in underlying principles compared to existing methods.
[0089] This invention boasts exceptional deployment adaptability with no additional communication or architectural modification costs. All difference calculations and semantic alignment operations are performed locally on the client side. The server only needs to execute standard weighted average aggregation, requiring no additional communication rounds, synchronization primitives, or message interactions. It is fully compatible with existing mainstream federated learning frameworks and distributed training infrastructures, and can be directly embedded into existing systems as a plug-and-play module without modifying the original business architecture or data flow. Furthermore, all new computations in this invention are lightweight vector operations, reusing node embeddings already generated by the GNN encoder. Compared to the lightweight baseline FedAvg, the method provided by this invention introduces only moderate overhead. Although Wasserstein-based structural difference calculations introduce additional costs, truncated neighborhood matching and sparse storage strategies effectively control the actual overhead. Moreover, this invention is more efficient than other existing methods such as FedPub and S²FGL, and can adapt to the deployment needs of edge computing and low-computing-power clients.
[0090] II. Outstanding economic benefits, significantly reducing the costs and barriers to industrial development. This invention significantly reduces the research and development and training costs of distributed AI models. Without increasing communication or computing power costs, it achieves efficient collaborative training of heterogeneous distributed graph data. This eliminates the need for enterprises and institutions to centralize data for model performance, avoiding the high costs associated with data aggregation, such as data center construction, computing power procurement, and dedicated data transmission lines. Calculations show that for distributed graph learning scenarios with 10 or more nodes, this invention can reduce the overall model training cost by over 30%.
[0091] This invention can improve the efficiency of AI model deployment and shorten the business launch cycle. It can be directly adapted to distributed graph data scenarios in multiple industries such as finance, government affairs, healthcare, and industrial IoT, without requiring customized modifications for heterogeneous data distributions in different industries. The model development and optimization cycle can be shortened by more than 40%, significantly lowering the industrial application threshold for federated graph learning technology and helping enterprises quickly implement AI applications based on distributed graph data.
[0092] This invention can mitigate data compliance risks and reduce potential economic losses. It ensures that the original data remains on the local client throughout the entire process, transmitting only model parameters without sensitive information. This fully complies with the data privacy protection requirements of laws and regulations such as the Data Security Law and the Personal Information Protection Law, avoiding economic losses such as compliance penalties and civil compensation for data breaches caused by cross-institutional data transfer. It provides a compliant and controllable technical foundation for enterprises' distributed AI applications.
[0093] Third, it has significant social value and contributes to the construction of a privacy-compliant distributed AI ecosystem. This invention breaks down industry data silos and enables the compliant flow of data value. Without disclosing the original data, this invention achieves collaborative learning of graph data across institutions and platforms, effectively breaking down data silos in government, healthcare, finance, and industry, allowing the data value of different institutions to be shared and utilized under compliant conditions, and promoting cross-industry and cross-domain digital collaborative development.
[0094] This invention achieves "usable but invisible" data from the underlying technology, avoiding the risk of leakage of sensitive user information in cross-institutional collaborative training. Especially for highly sensitive graph data scenarios such as medical health, financial transactions, and social relationships, it can fully protect users' personal information rights and promote the compliant and healthy development of AI technology.
[0095] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A federated graph learning difference-aware semantic alignment method, characterized in that, The method includes: The server initializes global model parameters and synchronously distributes them to all clients. The client receives global model parameters, performs perturbation operations on the locally stored original graph, and generates the corresponding enhanced graph; Calculate the attribute differences and structural differences of each node in the original graph and the enhanced graph, fuse them to obtain the total difference value of each node, and construct the difference-aware loss based on the total difference value; The client extracts the local and global embeddings of each node in the original graph, constructs a comparison sample set based on the label differences between the node and the global embedding, and constructs a semantic alignment loss based on the comparison sample set. By fusing node classification loss, difference perception loss, and semantic alignment loss, a total loss function is constructed. The total loss function is then solved to complete the iterative update of the local model parameters on the client side. All clients upload the updated local model parameters to the server. After receiving the local model parameters uploaded by all clients, the server performs a weighted average aggregation to obtain the updated global model parameters. The server determines whether the preset number of global communication rounds has been reached. If not, it starts a new round of training based on the updated global model parameters. If the number of rounds has been reached, it outputs the final trained global model, which is a graph neural network model.
2. The federated graph learning difference-aware semantic alignment method according to claim 1, characterized in that, The original graph includes a node set, an adjacency matrix, and a node feature matrix. The adjacency matrix is used to represent the topological connection relationship between each node in the node set, and the node feature matrix is used to represent the dimensional attribute information of each node in the node set. The perturbation operation performed on the locally stored original graph to generate the corresponding enhanced graph is specifically as follows: a random edge deletion operation is performed on the adjacency matrix of the original graph, and a feature masking operation is performed on the node feature matrix to obtain an enhanced graph with the same node set as the original graph, except that the structure and node features have been perturbed.
3. The federated graph learning difference-aware semantic alignment method according to claim 1, characterized in that, The calculation of attribute and structural differences between each node in the original and enhanced graphs, and the fusion of these differences to obtain the total difference value for each node, specifically includes: The cosine dissimilarity of the feature vectors of each node in the original graph and the enhanced graph is calculated as the attribute difference, which is used to characterize the degree of perturbation of the node's dimensional attributes. The Wasserstein-1 distance of each node in the adjacency distribution of the original graph and the enhanced graph is calculated as the structural difference, which is used to characterize the degree of perturbation of the node's neighborhood structure. Adjust the structural differences to the same value range as the attribute differences; The convex combination of the attribute differences and structural differences is calculated as the total difference value.
4. The federated graph learning difference-aware semantic alignment method according to claim 3, characterized in that, The calculation of the Wasserstein-1 distance of each node in the adjacency distribution of the original graph and the enhanced graph as the structural difference specifically includes: Extract the adjacent row vectors of nodes in the original graph and the enhanced graph respectively, and normalize the two adjacent row vectors into a discrete distribution on the node index space; Based on the shortest path hop count between nodes as the basic cost, the structural differences are obtained by calculating the difference in the discrete distribution of two adjacent row vectors using Wasserstein-1 distance.
5. The federated graph learning difference-aware semantic alignment method according to claim 3, characterized in that, The construction of the difference-perceived loss based on the total difference value specifically includes: The embedding vectors of nodes in the original graph and the augmented graph are extracted separately using a graph neural network encoder, and the two embedding vectors are calculated. Distance, to obtain the embedding offset of the node; The embedding offset is constrained based on the total difference value to generate a difference-aware loss.
6. The federated graph learning difference-aware semantic alignment method according to claim 1, characterized in that, The client extracts the local and global embeddings of each node in the original graph, and constructs a comparison sample set based on the label differences between the node and the global embeddings, specifically including: For each node in the original graph, the client first extracts its local embedding through the local encoder, and then extracts the global embedding of the corresponding node through the global model of the current training round. For each node, global embeddings with the same preset real labels as that node are set as positive samples, and global embeddings with different preset real labels as negative samples. A comparison sample set is constructed based on the positive and negative samples.
7. The federated graph learning difference-aware semantic alignment method according to claim 6, characterized in that, The semantic alignment loss constructed based on the comparison sample set specifically includes: The local embedding of a node is compared with the global embedding of all positive samples to calculate the temperature scale cosine similarity, and the first calculation result is obtained. The first calculation results are then summed after taking the exponent, and the total positive sample matching degree is obtained. The local embedding of a node is compared with the global embeddings of all positive and negative samples to calculate the temperature scale cosine similarity, and the second calculation result is obtained. All the second calculation results are then summed after taking the exponent to obtain the total matching degree of the whole sample. The contrast loss for each node is calculated based on the sum of the positive sample matching scores and the sum of the full sample matching scores. The semantic alignment loss is obtained by averaging the contrast loss of all nodes.
8. The federated graph learning difference-aware semantic alignment method according to claim 1, characterized in that, Before determining whether the preset number of global communication rounds has been reached, the server performs the following operations: Using the updated global model parameters, calculate the node classification accuracy for the current training round on the preset validation set; Compare the node classification accuracy of the current training round with the best node classification accuracy of the historical training rounds, and count the number of consecutive training rounds in which the node classification accuracy has not improved. Determine if the number of consecutive training rounds without improvement in node classification accuracy is greater than or equal to the preset convergence verification threshold. If yes, output the current global model as the final trained global model; otherwise, determine if the preset number of global communication rounds has been reached.
9. A federated graph learning difference-aware semantic alignment system, characterized in that, The system includes a server and a client, the server including: The initialization and distribution module is used to initialize global model parameters and synchronously distribute them to all clients; The aggregation module is used to receive all local model parameters uploaded by clients, perform weighted average aggregation, and obtain updated global model parameters. The judgment module is used to determine whether the preset number of global communication rounds has been reached. If not, a new round of training is started based on the updated global model parameters. If the number of rounds has been reached, the final trained global model is output, which is a graph neural network model. The client includes: The augmented graph generation module receives global model parameters, performs perturbation operations on the locally stored original graph, and generates the corresponding augmented graph. The difference-aware loss construction module is used to calculate the attribute differences and structural differences of each node between the original graph and the enhanced graph, fuse them to obtain the total difference value of each node, and construct the difference-aware loss based on the total difference value; The semantic alignment loss construction module is used to extract the local embedding and global embedding of each node in the original graph, construct a comparison sample set according to the label difference between the local embedding and the global embedding, and construct the semantic alignment loss based on the comparison sample set; The model parameter update module is used to fuse node classification loss, difference-aware loss, and semantic alignment loss to construct a total loss function, solve the total loss function, and complete the iterative update of the local model parameters on the client. The upload module is used to upload the updated local model parameters to the server.