A personalized robust aggregation method, device and storage medium based on key parameters

Through personalized robust aggregation method based on key parameters in collaborative learning, clustering division and security score calculation, the Byzantine robustness problem under data heterogeneity in collaborative learning is solved, and the robustness and security of the model are improved. sex.

CN119026710BActive Publication Date: 2025-02-11TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411507923.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-11
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

There is a problem of Byzantine robustness in collaborative learning, especially in data heterogeneity scenarios, and it is difficult to effectively prevent the negative impact of malicious gradients on the global model.

Method used

By clustering and partitioning based on the key parameter vectors of each local node during each round of aggregation of collaborative learning, security scores and aggregation weights are calculated, thereby discovering and reducing the impact of malicious gradients and achieving robust Byzantine personality in heterogeneous scenarios Collaborative learning.

Benefits of technology

It improves the robustness of the collaborative learning model and the security of collaborative training, effectively prevents the negative impact of malicious gradients on the global model, and ensures the model performance and security in heterogeneous scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119026710B_ABST
    Figure CN119026710B_ABST
Patent Text Reader

Abstract

The present invention discloses a personalized robust aggregation method, device and storage medium based on key parameters, the method includes receiving key parameter vectors and local models sent by each local node; based on the key parameter vectors of each local node, obtaining the clustering grouping results of the local node; based on the clustering grouping results of the local node, obtaining the security score and aggregation weight of each local node; based on the security score, aggregation weight, clustering grouping result and key parameter vector of each local node, aggregating each local model to obtain the global model of the current round of each local node; sending the global model of the current round of each local node to each local node, repeating the above steps until the collaborative training is completed. Thus, Byzantine robust personalized collaborative learning in heterogeneous scenarios is realized, and the robustness of the collaborative learning model and the security of collaborative training are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence security and collaborative learning technology, and in particular to a personalized robust aggregation method, device and storage medium based on key parameters. Background Art

[0002] With the rise of artificial intelligence and large language models, collaborative learning has been widely used in various industries as a new paradigm to solve data silos and data privacy. Among them, collaborative learning can ensure that data is not migrated, and can efficiently collaborate with multiple parties for training, thereby obtaining a model with better performance. However, collaborative learning faces a large number of security issues, such as defending against malicious participants from maliciously poisoning the global model. Specifically, since collaborative learning is different from traditional centralized training, all participants can affect the global model while training independently locally, and model parameters are generally not interpretable. Therefore, it is difficult to prevent malicious gradients by directly checking local model parameters, resulting in malicious participants being able to easily negatively affect the global model by uploading poisoned gradients, thereby affecting all other benign clients participating. Based on this, how to solve the Byzantine robustness problem in the above-mentioned collaborative learning is an urgent problem to be solved.

[0003] In the prior art, the statistical characteristics of gradients can be used, represented by the median method (Median), to select only a certain amount of gradients with similar update directions for each aggregation, and discard some gradients with large deviations in direction, to prevent malicious gradients from participating in the aggregation. The above method can achieve good results in the case of independent and identical distribution (IID), but when the data is obviously heterogeneous, the local models may differ greatly because the data sets trained locally at different nodes have different characteristics. At this time, if the malicious gradients are judged according to the similarity of the direction, a large number of benign heterogeneous gradients will be judged as malicious gradients, resulting in a decrease in model performance or even model deviation, making it impossible to achieve Byzantine robust collaborative learning, reducing the security of collaborative training. Summary of the invention

[0004] The present disclosure provides a personalized robust aggregation method, device and storage medium based on key parameters. In each round of aggregation of collaborative learning, clustering is performed based on the key parameter vector of each local node, and based on the clustering grouping result, the security score and aggregation weight of each local node are obtained, so as to discover possible malicious gradients to reduce their impact on collaborative learning, thereby improving the robustness of the collaborative learning model and the security of collaborative training. At the same time, based on the security score, aggregation weight, clustering grouping result and key parameter vector of each local node, the key parameters within the clustering group and the non-key parameters outside the clustering group are aggregated for each local model, so as to realize Byzantine robust personalized collaborative learning in heterogeneous scenarios.

[0005] According to a first aspect of the present disclosure, a personalized robust aggregation method based on key parameters is provided, which is applied to an aggregation node and includes:

[0006] Receiving a key parameter vector and a local model sent by each local node, wherein the local model is trained by the local node;

[0007] Based on the key parameter vectors of the local nodes, obtaining clustering grouping results of the local nodes;

[0008] Based on the clustering grouping results of the local nodes, obtaining the security score and aggregation weight of each local node;

[0009] Aggregate the local models based on the security scores, aggregation weights, clustering grouping results and key parameter vectors of the local nodes to obtain the global models of the current round of the local nodes;

[0010] The global model of the current round of each local node is sent to each local node, and the above steps are repeated until the collaborative training is completed.

[0011] Optionally, obtaining the clustering grouping result of the local nodes based on the key parameter vector of each local node includes:

[0012] Based on the key parameter vectors of the local nodes, obtaining the key parameter overlap rate of the local nodes;

[0013] Based on the overlapping rate of the key parameters of the local nodes, a clustering grouping result of the local nodes is obtained.

[0014] Optionally, obtaining the security score and aggregation weight of each local node based on the clustering grouping result of the local nodes includes:

[0015] Based on the clustering result of the local nodes, calculating the cosine similarity between the gradient update direction of the local nodes in the clustering group and the median gradient update direction corresponding to the clustering group;

[0016] Based on the cosine similarity, obtaining a security score of the local node in the cluster group to which it belongs;

[0017] Based on the gradient update direction of the local nodes in the cluster grouping, the aggregation weight of each local node is obtained.

[0018] Optionally, aggregating the local models based on the safety scores, aggregation weights, clustering grouping results, and key parameter vectors of the local nodes to obtain the global models of the current round of the local nodes includes:

[0019] Based on the security score, aggregation weight and cluster group to which each local node belongs, performing individual aggregation within the cluster group on the key parameters in the key parameter vector of each local node to obtain a first aggregation result;

[0020] Performing commonality aggregation outside of clustering grouping on non-key parameters in the key parameter vectors of each local node to obtain a second aggregation result;

[0021] Based on the first aggregation result and the second aggregation result, a global model of the current round of each local node is obtained.

[0022] According to a second aspect of the present disclosure, a personalized robust aggregation method based on key parameters is provided, which is applied to a local node and includes:

[0023] Determine the trained local model and key parameter vector;

[0024] Sending the local model and key parameter vector to an aggregation node;

[0025] Receive the global model of the current round sent by the aggregation node, and repeat the above steps until the collaborative training is completed.

[0026] Optionally, determining the trained local model and key parameter vector includes:

[0027] The local model is trained based on the local data set to determine the trained local model;

[0028] Determine the parameter criticality corresponding to each parameter in the trained local model;

[0029] Based on the parameter criticality corresponding to each parameter, determine the corresponding critical parameters and non-critical parameters;

[0030] Based on the key parameters and non-key parameters, a key parameter vector is determined.

[0031] According to a third aspect of the present disclosure, a personalized robust aggregation device based on key parameters is provided, characterized in that it is applied to an aggregation node, and the device includes:

[0032] A receiving module, used to receive a key parameter vector and a local model sent by each local node, wherein the local model is trained by the local node;

[0033] A first data processing module, configured to obtain a clustering grouping result of the local nodes based on the key parameter vectors of the local nodes;

[0034] A second data processing module, configured to obtain a security score and an aggregation weight of each local node based on the clustering grouping result of the local nodes;

[0035] A third data processing module is used to aggregate the local models based on the security scores, aggregation weights, clustering grouping results and key parameter vectors of the local nodes to obtain the global models of the current round of the local nodes;

[0036] The sending module is used to send the global model of the current round of each local node to each local node, and repeat the above steps until the collaborative training is completed.

[0037] According to a fourth aspect of the present disclosure, a personalized robust aggregation device based on key parameters is provided, characterized in that it is applied to a local node and comprises:

[0038] A determination module, used to determine the trained local model and key parameter vector;

[0039] A sending module, used for sending the local model and key parameter vector to the aggregation node;

[0040] The receiving module is used to receive the global model of the current round sent by the aggregation node, and repeat the above steps until the collaborative training is completed.

[0041] According to another aspect of the present disclosure, there is provided an electronic device, comprising:

[0042] at least one processor; and

[0043] a memory communicatively connected to the at least one processor; wherein,

[0044] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any one of the methods of the first aspect or the second aspect.

[0045] According to another aspect of the present disclosure, a computer storage medium storing computer instructions is provided, wherein the computer storage medium stores computer executable instructions; after the computer executable instructions are executed by a processor, the method described in any one of the first aspect or the second aspect can be implemented.

[0046] The personalized robust aggregation method and device based on key parameters of the disclosed embodiment performs clustering based on the key parameter vectors of each local node in each round of aggregation of collaborative learning, and obtains the security score and aggregation weight of each local node based on the clustering grouping results, thereby discovering possible malicious gradients to reduce their impact on collaborative learning, thereby improving the robustness of the collaborative learning model and the security of collaborative training. At the same time, based on the security score, aggregation weight, clustering grouping results and key parameter vectors of each local node, the key parameters within the clustering group and the non-key parameters outside the clustering group are aggregated for each local model, thereby realizing Byzantine robust personalized collaborative learning in heterogeneous scenarios.

[0047] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0049] Figure 1 is a flow chart of a personalized robust aggregation method based on key parameters according to an embodiment of the present disclosure;

[0050] Figure 2 is a schematic diagram of safety score calculation according to an embodiment of the present disclosure;

[0051] Figure 3 is a flow chart of a personalized robust aggregation method based on key parameters according to an embodiment of the present disclosure;

[0052] Figure 4 is an interactive flow chart of a personalized robust aggregation method based on key parameters according to an embodiment of the present disclosure;

[0053] Figure 5 is a structural diagram of a personalized robust aggregation device based on key parameters according to an embodiment of the present disclosure;

[0054] Figure 6 is a structural diagram of a personalized robust aggregation device based on key parameters according to an embodiment of the present disclosure;

[0055] Figure 7 It is a block diagram of an electronic device used to implement the personalized robust aggregation method based on key parameters of an embodiment of the present disclosure. DETAILED DESCRIPTION

[0056] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0057] In order to enable those skilled in the art to better understand the scheme of the present disclosure, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present disclosure.

[0058] The following describes a personalized robust aggregation method and device based on key parameters proposed according to an embodiment of the present disclosure with reference to the accompanying drawings.

[0059] Figure 1 It is a flowchart of a personalized robust aggregation method based on key parameters according to an embodiment of the present disclosure.

[0060] like Figure 1 As shown, the personalized robust aggregation method based on key parameters is applied to the aggregation node, including:

[0061] S101, receiving a key parameter vector and a local model sent by each local node;

[0062] It should be noted that the executor of the above-mentioned personalized robust aggregation method based on key parameters is a personalized robust aggregation device based on key parameters, which can be implemented by software and / or hardware. The personalized robust aggregation device based on key parameters in this embodiment can be configured in an electronic device.

[0063] In this example embodiment, the electronic device may include devices such as terminal devices and servers, and this embodiment does not limit the electronic device.

[0064] In one embodiment of the present disclosure, the above-mentioned local model is trained by the local node.

[0065] In one embodiment of the present disclosure, the key parameters and non-key parameters in the local model can be determined according to the received key parameter vector. Specifically, in one embodiment of the present disclosure, if the local node The key parameter vector Middle Elements is 0, then the local model Parameters is a non-critical parameter; if the above critical parameter vector Middle Elements is 1, then the local model Parameters is the key parameter, among which, is the round of aggregation.

[0066] S102, obtaining clustering grouping results of local nodes based on the key parameter vectors of each local node;

[0067] In one embodiment of the present disclosure, after receiving the key parameter vector sent by each local node through the above steps, the clustering grouping result of the local nodes can be obtained based on the key parameter vector of each local node.

[0068] Specifically, in one embodiment of the present disclosure, a method for obtaining a clustering grouping result of a local node based on a key parameter vector of each local node may include the following steps:

[0069] S1021, based on the key parameter vector of each local node, obtaining the key parameter overlap rate of each local node;

[0070] S1022: Obtain clustering grouping results of the local nodes based on the key parameter overlap rate of each local node.

[0071] In one embodiment of the present disclosure, based on the key parameter vectors of each local node, a method for obtaining the key parameter overlap rate of each local node may include: based on the key parameter vectors of each local node, obtaining the key parameter overlap rate of the local model corresponding to each local node by calculating through a first formula, wherein the first formula is:

[0072]

[0073] in, Represents the local model i and j In the t The key parameter of round polymerization is the overlap ratio, is the L1 norm, n is the total number of parameters of the model, Indicates the local node In the t The key parameter vector during round aggregation.

[0074] And, in one embodiment of the present disclosure, the global model after aggregating the local models corresponding to the local nodes should have common and individual attributes. Specifically, in the early stage of collaborative training, the global model should have commonality, based on which the strength of the early clustering and grouping division is relatively coarse. With the increase of aggregation rounds, each local node should obtain a personalized model that is more suitable for its heterogeneous data. Based on this, in the later stage of collaborative training, the global model should have individuality and the clustering division strength is relatively fine.

[0075] Further, in one embodiment of the present disclosure, according to the above description, all local nodes can be dynamically clustered based on the overlap rate of key parameters of each local node to obtain the clustering grouping result of the local nodes. Specifically, in one embodiment of the present disclosure, the method for obtaining the clustering grouping result of the local nodes based on the overlap rate of key parameters of each local node may include: determining the clustering division threshold by a second formula, comparing the overlap rate of key parameters of each local node with the clustering division threshold, and obtaining the clustering grouping result of the local nodes, wherein the second formula is:

[0076]

[0077] in, β is a hyperparameter used to control the strength of clustering division, , , , , T is the total number of aggregation rounds.

[0078] In one embodiment of the present disclosure, the key parameter overlap rate of each local node and other nodes is compared with the clustering threshold to obtain the first i Clustering results of local nodes And, in one embodiment of the present disclosure, as the aggregation rounds t As the number of nodes increases, the clustering groups will become more and more independent, and in the final round, the individual local nodes will become clusters, effectively achieving the compatibility of the commonality and individuality of the model. At the same time, the key parameter overlap rate of malicious gradients will show a significant difference from the key parameter overlap rate of other normal gradients. Based on this, if the key parameter overlap rate of a local node has been low during the dynamic division process, it can be preliminarily determined as an abnormal node, that is, the first-level security assessment, which is determined as a risk gradient based on the robustness of the key parameters, and corresponding manual inspection can be performed.

[0079] It should be noted that, in one embodiment of the present disclosure, the above clustering process is performed on a local node basis, that is, each local node needs to be clustered in each round of aggregation.

[0080] S103, based on the clustering grouping results of the local nodes, obtaining the security score and aggregation weight of each local node;

[0081] In one embodiment of the present disclosure, after the clustering grouping results of the local nodes are obtained through the above steps, the local nodes in the same clustering group have a higher overlap rate of key parameters, that is, their data distribution is similar. Based on this, the gradient update directions of the local nodes in this round should be similar. When there are malicious gradient nodes, there will be obvious differences in the updated gradient directions in the clustering group. According to the above principle, the security score (TrustScore, TS) of each local node gradient can be calculated, and the corresponding aggregation weight is assigned through the calculated security score as the second-layer robust security guarantee to ensure that even if some malicious gradients are not screened out by the above steps, they will not have a serious impact on the model.

[0082] Specifically, in one embodiment of the present disclosure, the method for obtaining the safety score and aggregation weight of each local node based on the clustering grouping result of the local nodes may include the following steps:

[0083] S1031, based on the clustering result of the local node, calculating the cosine similarity between the gradient update direction of the local node in the clustering group and the median gradient update direction corresponding to the clustering group;

[0084] S1032, based on the cosine similarity, obtaining a security score of the local node in the cluster group to which it belongs;

[0085] S1033, based on the gradient update direction of the local nodes in the cluster grouping, obtain the aggregation weight of each local node.

[0086] Among them, in one embodiment of the present disclosure, the method for calculating the cosine similarity between the gradient update direction of the local node in the cluster grouping and the median gradient update direction corresponding to the cluster grouping based on the cluster grouping result of the local node may include: based on the cluster grouping result of the local node, calculating the cosine similarity between the gradient update direction of the local node in the cluster grouping and the median gradient update direction corresponding to the cluster grouping by a third formula, wherein the third formula is:

[0087]

[0088] in, For Node i All local nodes in the cluster group j The gradient update direction is For Node i The median gradient update of the updated gradient direction in the cluster grouping.

[0089] And, in one embodiment of the present disclosure, the local node can be calculated by the fourth formula j The gradient update direction is:

[0090]

[0091] in, For t -1 round for a node i The personalized aggregated global model, for t Round Node j The local model.

[0092] Furthermore, in one embodiment of the present disclosure, clustering can be performed Local node in ( ), calculate the median of all gradient update values ​​in each dimension to get the median gradient update of the local node update gradient direction in the cluster .

[0093] And, in one embodiment of the present disclosure, after the cosine similarity is obtained through the above steps, some cosine similarities are negative. Based on this, the ReLU function can be used to clip them to obtain the safety score of the local node in the cluster grouping to avoid the negative impact caused by them. Specifically, in one embodiment of the present disclosure, the method for obtaining the safety score of the local node in the cluster grouping to which it belongs based on the cosine similarity may include: based on the cosine similarity, obtaining the safety score of the local node in the cluster grouping to which it belongs through the fifth formula, wherein the fifth formula is:

[0094] .

[0095] Figure 2 It is a schematic diagram of a safety score calculation provided by an embodiment of the present disclosure. Figure 2 The diagram in Figure 1 is a schematic diagram of calculating the safety score in a cluster. , , and The gradient update vectors for the four different local nodes in the cluster. First, the median update vector of these four vectors is calculated, as shown in the figure , and then calculate each vector and The angle cosine similarity of , , and , after obtaining the cosine similarity, each value is clipped, such as Direction and The overall trend is the opposite, so after clipping with the ReLU function, Will not affect the aggregation, which is equivalent to treating it as a toxic gradient, while others are treated as benign gradients and given a corresponding safety score, that is, the cosine similarity value. Since the vector is processed using normalization, the magnitude of each gradient update is limited to be consistent with , so it presents a central circle form.

[0096] Furthermore, in one embodiment of the present disclosure, considering that some malicious nodes will amplify their own updated gradient values ​​to have a greater impact on the global model as much as possible, it is necessary to standardize and clip the local gradient. Specifically, in one embodiment of the present disclosure, based on the gradient update direction of the local nodes in the cluster grouping, the method for obtaining the aggregate weight of each local node may include: based on the gradient update direction of the local nodes in the cluster grouping, obtaining the aggregate weight of each local node through the sixth formula, wherein the sixth formula is:

[0097] .

[0098] in, For local nodes j Clustering of The aggregate weight of all local nodes in , and Refers to the standardized clipped value.

[0099] S104, aggregating each local model based on the security score, aggregation weight, clustering grouping result and key parameter vector of each local node to obtain the global model of the current round of each local node;

[0100] Among them, in one embodiment of the present disclosure, after obtaining the security score, aggregation weight, clustering grouping result and key parameter vector of each local node through the above steps, each local model can be aggregated based on the security score, aggregation weight, clustering grouping result and key parameter vector of each local node to obtain the global model of the current round of each local node.

[0101] Specifically, in one embodiment of the present disclosure, the method for aggregating each local model based on the safety score, aggregation weight, clustering grouping result and key parameter vector of each local node to obtain the global model of the current round of each local node may include the following steps:

[0102] S1041, based on the security score of each local node, the aggregation weight, and the cluster group to which each local node belongs, perform individual aggregation within the cluster group on the key parameters in the key parameter vector of each local node to obtain a first aggregation result;

[0103] S1042, performing commonality aggregation outside of clustering grouping on non-key parameters in the key parameter vector of each local node to obtain a second aggregation result;

[0104] S1043: Based on the first aggregation result and the second aggregation result, obtain a global model of the current round of each local node.

[0105] Among them, in one embodiment of the present disclosure, the method of performing individual aggregation within the cluster grouping on the key parameters in the key parameter vector of each local node based on the security score of each local node, the aggregation weight and the cluster grouping to which each local node belongs to obtain the first aggregation result may include: performing individual aggregation within the cluster grouping on the key parameters in the key parameter vector of each local node based on the security score of each local node, the aggregation weight and the cluster grouping to which each local node belongs to obtain the first aggregation result by using the seventh formula, wherein the seventh formula is:

[0106] .

[0107] Where M is the number of local nodes in the cluster group. for Each neuron parameter in for The parameters in is the global learning rate hyperparameter, is the sequence number corresponding to the key parameters in the key parameter vector.

[0108] And, in one embodiment of the present disclosure, the seventh formula above performs robust aggregation on the local nodes of the cluster grouping and the neurons of the key parameters, and the calculated value is the new value of the key parameter after aggregation.

[0109] Furthermore, in one embodiment of the present disclosure, in order to effectively utilize the commonalities of other local nodes, non-critical parameters are also aggregated. Non-critical parameters have little impact on security and model output. Based on this, in the aggregation process on non-critical parameters, the aggregation range is not limited to within the cluster and the security score weight is not added. Based on this, the above method of performing commonality aggregation outside the clustering grouping on the non-critical parameters in the key parameter vector of each local node to obtain the second aggregation result may include: performing commonality aggregation outside the clustering grouping on the non-critical parameters in the key parameter vector of each local node through the eighth formula to obtain the second aggregation result, wherein the eighth formula is:

[0110]

[0111] in, for of neurons, It is the sequence number corresponding to the non-key parameters in the key parameter vector.

[0112] Further, in one embodiment of the present disclosure, after obtaining the first aggregation result and the second aggregation result through the above steps, the global model of the current round of each local node can be obtained based on the first aggregation result and the second aggregation result. In one embodiment of the present disclosure, the method for obtaining the global model of the current round of each local node based on the first aggregation result and the second aggregation result may include: obtaining the global model of the current round of each local node based on the first aggregation result and the second aggregation result through the ninth formula, wherein the ninth formula is:

[0113] .

[0114] Among them, in one embodiment of the present disclosure, the new values ​​of the key parameters and non-key parameters can be integrated to obtain the local node through the ninth formula i In the t Robust personalized global model for rounds .

[0115] S105, sending the global model of the current round of each local node to each local node, and repeating the above steps until the collaborative training is completed.

[0116] Among them, in one embodiment of the present disclosure, after obtaining the global model of the current round of each local node through the above steps, the global model of the current round of each local node can be sent to each local node, and the above steps are repeated until the collaborative training is completed.

[0117] In one or more embodiments of the present disclosure, a key parameter vector and a local model sent by each local node are received, wherein the local model is trained for the local node; based on the key parameter vector of each local node, a clustering result of the local node is obtained; based on the clustering result of the local node, a security score and aggregation weight of each local node is obtained; based on the security score, aggregation weight, clustering result and key parameter vector of each local node, each local model is aggregated to obtain a global model of the current round of each local node; the global model of the current round of each local node is sent to each local node, and the above steps are repeated until the collaborative training is completed. Thus, in each round of aggregation of collaborative learning, clustering is performed based on the key parameter vector of each local node, and based on the clustering result, the security score and aggregation weight of each local node are obtained, thereby discovering possible malicious gradients to reduce their impact on collaborative learning, thereby improving the robustness of the collaborative learning model and the security of collaborative training. At the same time, based on the security score, aggregation weight, clustering grouping results and key parameter vector of each local node, the key parameters within the clustering grouping and the non-key parameters outside the clustering grouping of each local model are aggregated, thereby realizing Byzantine robust personalized collaborative learning in heterogeneous scenarios.

[0118] Figure 3 It is a flowchart of a personalized robust aggregation method based on key parameters according to an embodiment of the present disclosure.

[0119] like Figure 3 As shown, the personalized robust aggregation method based on key parameters is applied to the local node, including:

[0120] S301, determining the trained local model and key parameter vector;

[0121] S302, sending the local model and key parameter vector to the aggregation node;

[0122] S303, receiving the global model of the current round sent by the aggregation node, and repeating the above steps until the collaborative training is completed.

[0123] In one embodiment of the present disclosure, the method for determining the trained local model and key parameter vector may include the following steps:

[0124] S3011, training a local model based on a local data set, and determining a trained local model;

[0125] S3012, determining the parameter criticality corresponding to each parameter in the trained local model;

[0126] S3013, determining corresponding key parameters and non-key parameters based on the parameter criticality corresponding to each parameter;

[0127] S3014, determining a key parameter vector based on the key parameters and non-key parameters.

[0128] Among them, in one embodiment of the present disclosure, before determining the parameter criticality corresponding to each parameter in the trained local model, define the first k The criticality of a parameter is the change in the loss function value after the parameter is set to zero. , as shown in the following tenth formula,

[0129]

[0130] in, L is the loss function, For the k parameters.

[0131] And, in one embodiment of the present disclosure, it can be seen from the above tenth formula that calculating the criticality of all parameters of a local model will cause a very large amount of additional calculations. Based on this, in order to reduce the amount of calculations, the first-order Taylor approximation is used to simplify the calculation, as shown in the following eleventh formula,

[0132]

[0133]

[0134] Among them, the above eleventh formula is for the change direction of the loss function at a certain moment, and the local training process is generally a continuous change. Based on this, if the value at a certain moment is taken, it may cause greater randomness, thereby affecting the calculation of key parameters. Therefore, use Alternative ,in, express In the t wheel( [1 ,T ]) The first r wheel( [1 ,R ]) Local training, T is the total number of aggregation rounds, R is the total number of client local training rounds for each round of aggregation. Based on this, the final parameter criticality calculation formula obtained through the above process can be shown in the following twelfth formula:

[0135] .

[0136] Further, in one embodiment of the present disclosure, after obtaining the parameter criticality corresponding to each parameter through the above steps, the corresponding key parameters and non-key parameters can be determined based on the parameter criticality corresponding to each parameter. Specifically, in one embodiment of the present disclosure, the above method for determining the corresponding key parameters and non-key parameters based on the parameter criticality corresponding to each parameter can include: sorting the parameter criticality corresponding to each parameter in descending order, determining the parameters with the top hyperparameter critical threshold among all parameters as key parameters, and determining the remaining parameters as non-key parameters.

[0137] In one embodiment of the present disclosure, the above hyperparameter critical threshold τ∈[0,1] can be set as needed. For example, assuming τ=0.5, the criticality of the parameters corresponding to each parameter is sorted in descending order, and the top 50% of all parameters are determined as critical parameters, and the remaining parameters are determined as non-critical parameters.

[0138] And, in one embodiment of the present disclosure, after determining the key parameters and non-key parameters through the above steps, the key parameter vector can be determined based on the key parameters and non-key parameters. Specifically, in one embodiment of the present disclosure, if the parameter is a key parameter, the corresponding vector value is 1; if the parameter is a non-key parameter, the corresponding vector value is 0, as shown in the following thirteenth formula,

[0139]

[0140] In one or more embodiments of the present disclosure, a key parameter vector and a local model sent by each local node are received, wherein the local model is trained for the local node; based on the key parameter vector of each local node, a clustering result of the local node is obtained; based on the clustering result of the local node, a security score and aggregation weight of each local node is obtained; based on the security score, aggregation weight, clustering result and key parameter vector of each local node, each local model is aggregated to obtain a global model of the current round of each local node; the global model of the current round of each local node is sent to each local node, and the above steps are repeated until the collaborative training is completed. Thus, in each round of aggregation of collaborative learning, clustering is performed based on the key parameter vector of each local node, and based on the clustering result, the security score and aggregation weight of each local node are obtained, thereby discovering possible malicious gradients to reduce their impact on collaborative learning, thereby improving the robustness of the collaborative learning model and the security of collaborative training. At the same time, based on the security score, aggregation weight, clustering grouping results and key parameter vector of each local node, the key parameters within the clustering grouping and the non-key parameters outside the clustering grouping of each local model are aggregated, thereby realizing Byzantine robust personalized collaborative learning in heterogeneous scenarios.

[0141] Figure 4 It is an interactive flow chart of the personalized robust aggregation method based on key parameters according to an embodiment of the present disclosure.

[0142] like Figure 4 As shown, the interactive method based on personalized robust aggregation of key parameters includes:

[0143] S401, the local node determines the trained local model and key parameter vector;

[0144] S402, the local node sends a local model and a key parameter vector to the aggregation node;

[0145] S403, the aggregation node obtains the key parameter overlap rate and clustering grouping result of each local node based on the key parameter vector of each local node;

[0146] S404, the aggregation node obtains the security score and aggregation weight of each local node based on the clustering grouping result of the local nodes;

[0147] S405, the aggregation node aggregates each local model based on the security score, aggregation weight, clustering grouping result and key parameter vector of each local node to obtain the global model of the current round of each local node;

[0148] S406, the aggregation node sends the global model of the current round of each local node to each local node;

[0149] S407, repeat the above steps until the collaborative training is completed and the local node obtains the corresponding personalized model.

[0150] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0151] See also Figure 5 , which shows a structural schematic diagram of a personalized robust aggregation device based on key parameters provided by an embodiment of the present disclosure. The personalized robust aggregation device based on key parameters 500 is applied to an aggregation node, and includes a receiving module 501, a first data processing module 502, a second data processing module 503, a third data processing module 504 and a sending module 505, wherein:

[0152] The receiving module 501 is used to receive the key parameter vector and the local model sent by each local node, wherein the local model is trained by the local node;

[0153] A first data processing module 502 is used to obtain a clustering grouping result of the local nodes based on the key parameter vector of each local node;

[0154] The second data processing module 503 is used to obtain the security score and aggregation weight of each local node based on the clustering grouping result of the local nodes;

[0155] The third data processing module 504 is used to aggregate each local model based on the security score, aggregation weight, clustering grouping result and key parameter vector of each local node to obtain the global model of the current round of each local node;

[0156] The sending module 505 is used to send the global model of the current round of each local node to each local node, and repeat the above steps until the collaborative training is completed.

[0157] Optionally, in an actual example of the present disclosure, the first data processing module is specifically used to:

[0158] Based on the key parameter vectors of each local node, the key parameter overlap rate of each local node is obtained;

[0159] Based on the overlapping ratio of key parameters of each local node, the clustering grouping results of the local nodes are obtained.

[0160] Optionally, in an actual example of the present disclosure, the second data processing module is further used to:

[0161] Based on the clustering results of the local nodes, the cosine similarity between the gradient update direction of the local nodes in the clustering group and the median gradient update direction corresponding to the clustering group is calculated;

[0162] Based on the cosine similarity, the security score of the local node in the cluster group to which it belongs is obtained;

[0163] Based on the gradient update direction of the local nodes in the cluster grouping, the aggregation weight of each local node is obtained.

[0164] Optionally, in one embodiment of the present disclosure, the third data processing module is further used to:

[0165] Based on the security score, aggregation weight and cluster group of each local node, the key parameters in the key parameter vector of each local node are individually aggregated within the cluster group to obtain a first aggregation result;

[0166] Performing commonality aggregation outside of clustering grouping on non-key parameters in the key parameter vector of each local node to obtain a second aggregation result;

[0167] Based on the first aggregation result and the second aggregation result, a global model of the current round of each local node is obtained.

[0168] In one or more embodiments of the present disclosure, a key parameter vector and a local model sent by each local node are received, wherein the local model is trained for the local node; based on the key parameter vector of each local node, a clustering result of the local node is obtained; based on the clustering result of the local node, a security score and aggregation weight of each local node is obtained; based on the security score, aggregation weight, clustering result and key parameter vector of each local node, each local model is aggregated to obtain a global model of the current round of each local node; the global model of the current round of each local node is sent to each local node, and the above steps are repeated until the collaborative training is completed. Thus, in each round of aggregation of collaborative learning, clustering is performed based on the key parameter vector of each local node, and based on the clustering result, the security score and aggregation weight of each local node are obtained, thereby discovering possible malicious gradients to reduce their impact on collaborative learning, thereby improving the robustness of the collaborative learning model and the security of collaborative training. At the same time, based on the security score, aggregation weight, clustering grouping results and key parameter vector of each local node, the key parameters within the clustering grouping and the non-key parameters outside the clustering grouping of each local model are aggregated, thereby realizing Byzantine robust personalized collaborative learning in heterogeneous scenarios.

[0169] See also Figure 6 , which shows a structural diagram of a personalized robust aggregation device based on key parameters provided by an embodiment of the present disclosure. The personalized robust aggregation device based on key parameters 600 is applied to a local node, and includes a determination module 601, a sending module 602 and a receiving module 603, wherein:

[0170] A determination module 601 is used to determine the trained local model and key parameter vector;

[0171] A sending module 602, configured to send a local model and a key parameter vector to an aggregation node;

[0172] The receiving module 603 is used to receive the global model of the current round sent by the aggregation node, and repeat the above steps until the collaborative training is completed.

[0173] Optionally, in an embodiment of the present disclosure, the determination module 601 is specifically configured to:

[0174] The local model is trained based on the local data set to determine the trained local model;

[0175] Determine the parameter criticality of each parameter in the trained local model;

[0176] Based on the parameter criticality corresponding to each parameter, determine the corresponding key parameters and non-key parameters;

[0177] Based on the key parameters and the non-key parameters, a key parameter vector is determined.

[0178] In one or more embodiments of the present disclosure, a key parameter vector and a local model sent by each local node are received, wherein the local model is trained for the local node; based on the key parameter vector of each local node, a clustering result of the local node is obtained; based on the clustering result of the local node, a security score and aggregation weight of each local node is obtained; based on the security score, aggregation weight, clustering result and key parameter vector of each local node, each local model is aggregated to obtain a global model of the current round of each local node; the global model of the current round of each local node is sent to each local node, and the above steps are repeated until the collaborative training is completed. Thus, in each round of aggregation of collaborative learning, clustering is performed based on the key parameter vector of each local node, and based on the clustering result, the security score and aggregation weight of each local node are obtained, thereby discovering possible malicious gradients to reduce their impact on collaborative learning, thereby improving the robustness of the collaborative learning model and the security of collaborative training. At the same time, based on the security score, aggregation weight, clustering grouping results and key parameter vector of each local node, the key parameters within the clustering grouping and the non-key parameters outside the clustering grouping of each local model are aggregated, thereby realizing Byzantine robust personalized collaborative learning in heterogeneous scenarios.

[0179] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0180] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a computer storage medium.

[0181] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable electronic devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0182] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0183] A number of components in the electronic device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information / data with other electronic devices through a computer network such as the Internet and / or various telecommunication networks.

[0184] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as a personalized robust aggregation method based on key parameters. For example, in some embodiments, the personalized robust aggregation method based on key parameters may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the personalized robust aggregation method based on key parameters described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured in any other appropriate manner (eg, by means of firmware) to execute the personalized robust aggregation method based on key parameters.

[0185] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0186] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0187] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or electronic device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or electronic device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage electronic device, a magnetic storage electronic device, or any suitable combination of the foregoing.

[0188] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0189] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0190] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0191] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0192] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A personalized robust aggregation method based on key parameters, characterized in that: The method comprises performing the following steps at an aggregation node: Receiving a key parameter vector and a local model sent by each local node, wherein the local model is trained by the local node, and the key parameter vector is used to determine key parameters and non-key parameters in the local model; Based on the key parameter vectors of the local nodes, obtaining clustering grouping results of the local nodes; Based on the clustering result of the local nodes, the security score and aggregation weight of each local node are obtained, wherein, based on the clustering result of the local nodes, the cosine similarity between the gradient update direction of the local node in the clustering group and the median gradient update direction corresponding to the clustering group is calculated, and based on the cosine similarity, the security score of the local node in the clustering group to which it belongs is obtained, and based on the gradient update direction of the local node in the clustering group, the aggregation weight of each local node is obtained, wherein the aggregation weight is the aggregation weight of all local nodes in the clustering group of the local node, and the security score of the local node in the clustering group to which it belongs is obtained by the following formula based on the cosine similarity: ; Based on the security score, aggregation weight, clustering grouping result and key parameter vector of each local node, the local models are aggregated to obtain the global model of the current round of each local node, wherein, based on the security score, aggregation weight and clustering group of each local node, the key parameters in the key parameter vector of each local node are individually aggregated within the clustering group to obtain a first aggregation result, and the non-key parameters in the key parameter vector of each local node are commonly aggregated outside the clustering group to obtain a second aggregation result, and the global model of the current round of each local node is obtained based on the first aggregation result and the second aggregation result; The global model of the current round of each local node is sent to each local node, and the above steps are repeated until the collaborative training is completed.

2. The method according to claim 1, characterized in that The obtaining the clustering grouping result of the local nodes based on the key parameter vectors of the local nodes includes: Based on the key parameter vectors of the local nodes, obtaining the key parameter overlap rate of the local nodes; Based on the overlapping rate of the key parameters of the local nodes, a clustering grouping result of the local nodes is obtained.

3. The method according to any one of claims 1 to 2, characterized in that: The method comprises executing the following steps at a local node: Determine the trained local model and key parameter vector; Sending the local model and key parameter vector to an aggregation node; Receive the global model of the current round sent by the aggregation node, and repeat the above steps until the collaborative training is completed.

4. The method according to claim 3, characterized in that The step of determining the trained local model and key parameter vector includes: The local model is trained based on the local data set to determine the trained local model; Determine the parameter criticality corresponding to each parameter in the trained local model, wherein the parameter criticality is defined as the criticality of the kth parameter in the local model is the amount of change in the loss function value after the parameter is set to zero; Based on the parameter criticality corresponding to each parameter, determine the corresponding critical parameters and non-critical parameters; Based on the key parameters and non-key parameters, a key parameter vector is determined.

5. A personalized robust aggregation device based on key parameters, characterized in that: The device comprises the following modules at the aggregation node: A receiving module, used to receive a key parameter vector and a local model sent by each local node, wherein the local model is trained by the local node, and the key parameter vector is used to determine the key parameters and non-key parameters in the local model; A first data processing module, configured to obtain a clustering grouping result of the local nodes based on the key parameter vectors of the local nodes; The second data processing module is used to obtain the security score and aggregation weight of each local node based on the clustering result of the local nodes, wherein the cosine similarity between the gradient update direction of the local node in the clustering group and the median gradient update direction corresponding to the clustering group is calculated based on the clustering result of the local nodes, and the security score of the local node in the clustering group to which it belongs is obtained based on the cosine similarity, and the aggregation weight of each local node is obtained based on the gradient update direction of the local node in the clustering group, wherein the aggregation weight is the aggregation weight of all local nodes in the clustering group of the local node, and the security score of the local node in the clustering group to which it belongs is obtained by the following formula based on the cosine similarity: ; A third data processing module is used to aggregate the local models based on the security scores, aggregation weights, cluster grouping results and key parameter vectors of the local nodes to obtain the global model of the current round of the local nodes, wherein, based on the security scores, aggregation weights and cluster groups to which the local nodes belong, the key parameters in the key parameter vectors of the local nodes are individually aggregated within the cluster grouping to obtain a first aggregation result, and the non-key parameters in the key parameter vectors of the local nodes are commonly aggregated outside the cluster grouping to obtain a second aggregation result, and the global model of the current round of the local nodes is obtained based on the first aggregation result and the second aggregation result; The sending module is used to send the global model of the current round of each local node to each local node, and repeat the above steps until the collaborative training is completed.

6. The device according to claim 5, characterized in that The device comprises the following modules at the local node: A determination module, used to determine the trained local model and key parameter vector; A sending module, used for sending the local model and key parameter vector to the aggregation node; The receiving module is used to receive the global model of the current round sent by the aggregation node, and repeat the above steps until the collaborative training is completed.

7. An electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-2 or 3-4.

8. A computer storage medium, wherein: The computer storage medium stores computer executable instructions; after the computer executable instructions are executed by the processor, the method described in any one of claims 1-2 or 3-4 can be implemented.

Citation Information

Patent Citations

  • Transverse federated learning security aggregation method, system and device for privacy protection and medium

    CN116644454A

  • A lightweight attacker identification method for federated learning with secure byzantine-robust aggregation via clustering

    US20240195816A1