Integrity authentication method for cloud-edge collaborative federated learning based on Merkle tree

Through the homomorphic encryption technology of Merkle tree and pair-two hash, the problem of untrustworthy transmission of edge-end and cloud-end model features in cloud-edge collaborative federated learning is solved, and data integrity authentication is realized, ensuring the security and efficiency of the learning process. .

CN114297728BActive Publication Date: 2024-12-17BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111662782.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-12-17
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In the cloud-edge collaborative federated learning scenario, the transmission of model features between the edge and the cloud is unreliable. Attackers can tamper with the transmission gradient and model features to affect the training effect.

Method used

The binary structure and pairwise hashing characteristics of the Merkle tree are adopted to realize data integrity authentication between the edge and the cloud through homomorphic encryption, ensuring the integrity of the transmitted model features and the number of training sets. The specific steps include building a Merkle tree at the edge and cloud, generating random numbers and sibling paths, and performing decryption and encryption operations to verify the integrity of the data.

Benefits of technology

Effectively prevent data tampering, ensure safe transmission between multiple ends in cloud-edge collaborative federated learning, reduce the complexity of space and time overhead, and make it within the base level.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114297728B_ABST
    Figure CN114297728B_ABST
Patent Text Reader

Abstract

The present invention discloses a cloud-edge collaborative federated learning integrity authentication method based on a Merkle tree, including: (1) the cloud constructs a Merkle tree for the model features to be aggregated and the number of training sets sent by the edge end, generates a verification node, and decrypts the brother path of the edge end; (2) the cloud constructs a Merkle tree for the aggregated model features sent to the edge end, and constructs an encrypted brother path; (3) the cloud aggregates the model features according to the number of training sets at the edge end; (4) data division at the edge end; (5) model training at the edge end; (6) the edge end constructs a Merkle tree for the aggregated model features sent by the cloud end, generates a verification node, and decrypts the brother path; (7) the edge end constructs a Merkle tree for the model features to be aggregated and the number of training sets sent to the cloud end, and constructs an encrypted brother path. Based on the binary structure of the Merkle tree and the high efficiency of bit operations, the present invention makes the transmission space and time overhead between multiple terminals in the cloud-edge collaborative federated learning scenario within the base level complexity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of cloud-edge collaborative federated learning and machine learning, and specifically relates to a cloud-edge collaborative federated learning integrity authentication method based on a Merkle tree. The method utilizes the binary structure of the Merkle tree and the characteristics of pairwise hashing to realize homomorphic encryption between both ends, thereby realizing data integrity authentication between the edge and the cloud under cloud-edge collaborative federated learning. Background Art

[0002] At present, machine learning has been widely used in smart healthcare, smart finance, and smart transportation. However, machine learning will integrate a large amount of data from different users, which requires different users to share data, but there is a risk of privacy leakage in this process. In 2016, Google proposed federated learning to solve the problem of data islands. Federated learning is a distributed machine learning framework. Cloud-edge collaborative federated learning has an additional terminal on the basis of federated learning, which is divided into user local terminal, edge terminal, and cloud. The user's local terminal is responsible for data collection, data processing, and transmission of training data to the edge terminal, as well as model testing after the completion of cloud-edge collaborative federated learning. The edge terminal is responsible for data division and model training. The model is aggregated by transmitting model gradients and training set sizes to the cloud. The cloud will perform federated averaging of model gradients based on the number of training sets. The cloud sends the aggregated model features to each edge terminal for the next round of learning. In this process, attackers can obtain and tamper with the transmitted gradients, thereby affecting the aggregation effect of the cloud. When the cloud transmits the aggregated model features to the edge terminal, attackers can obtain and tamper with the aggregated model features. This affects the next round of model training on the edge terminal. Therefore, the present invention proposes an integrity authentication method for cloud-edge collaborative federated learning based on Merkle tree. Summary of the invention

[0003] Aiming at the situation that the transmission of model features between the edge and the cloud in the cloud-edge collaborative federated learning scenario is unreliable, a cloud-edge collaborative federated learning integrity authentication method based on Merkle tree is proposed. After the edge has trained the model, the model features to be aggregated and the number of training sets will be sent to the cloud. The cloud and edge will respectively construct Merkle trees by pairwise hashing according to the model features to be aggregated and the number of training sets. Homomorphic encryption is realized by relying on the binary structure and pairwise hashing characteristics of the Merkle tree, thereby realizing integrity authentication between the edge and the cloud. After the cloud has trained the model features, the aggregated model features will be sent to the edge for the next round of training. The edge and cloud will construct Merkle trees by pairwise hashing according to the aggregated model features. Homomorphic encryption is realized by relying on the binary structure and pairwise hashing characteristics of the Merkle tree, thereby realizing integrity authentication between the edge and the cloud.

[0004] Figure 1 Architecture diagram of the cloud-edge collaborative federated learning integrity authentication method based on Merkle tree proposed in this invention

[0005] The cloud-edge collaborative federated learning integrity authentication method proposed in the present invention involves three parts: the user's local terminal, the edge, and the cloud. These three parts cooperate with each other to jointly complete the training of the federated learning model. The integrity authentication based on the Merkle tree acts on the transmission of model features between the edge and the cloud. Among them:

[0006] 1. User local terminal: responsible for data collection, data processing and transmission of the data set to be trained to the edge. After the training is completed, the model sent by the edge will be received for model testing.

[0007] 2. Edge: Responsible for data partitioning and model training, and realizes model aggregation by transmitting model gradients and the number of training sets to the cloud. At the same time, in order to verify the integrity of the aggregated model features sent from the cloud, it is also responsible for the verification and proof of the Merkle tree. The Merkle tree verification function of the edge includes three modules: generating verification nodes, constructing Merkle trees, and decrypting sibling paths. The verification node is generated by generating random numbers. The Merkle tree is constructed by taking the hash of two child nodes. The Merkle tree is a typical binary tree structure. Non-leaf nodes (including intermediate nodes and root nodes) are hash values ​​of the contents of its two child nodes. Decryption of the sibling path is performed by XOR bit operation. When the edge receives the aggregated model features sent by the cloud, it verifies that the aggregated model features sent by the cloud have not been tampered with by comparing whether the Merkle tree root composed of the decrypted sibling path is equal to the Merkle tree root composed of the aggregated model features by the edge. The proof function of the Merkle tree includes constructing a Merkle tree and constructing an encrypted sibling path. Here, a Merkle tree is constructed based on the aggregated model features. The construction method is similar to the Merkle tree construction method in the Merkle tree verification function, so it will not be explained here. To construct an encrypted sibling path, for any point V in the Merkle tree, select as few nodes as possible that have no intersection (that is, for nodes A and B, if A≠B and LCA(A,B)≠A and LCA(A,B)≠B, then A and B are said to have no intersection, where LCA(A,B) is the nearest common ancestor of node A and node B). The set of nodes that form V in order from left to right is called the sibling path of V. For example Figure 2The sibling paths of N3 are {N5, N3, N4}. When the edge sends the model features and training set numbers to be aggregated to the cloud, the edge verifies that the model features and training set numbers received by the cloud have not been tampered with by comparing whether the Merkle tree root composed of the decrypted sibling paths is equal to the Merkle tree root composed of the aggregated model features by the edge.

[0008] 3. Cloud: Responsible for the aggregation of model features, and aggregates the model features of each edge end according to the number of training sets of each edge segment. At the same time, in order to ensure the integrity of the model features and the number of training sets to be aggregated sent by the edge end, it is also responsible for the verification of the Merkle tree and the proof of the Merkle tree. The Merkle tree verification function of the cloud includes decrypting the sibling path, generating verification nodes, and constructing the Merkle tree. Its technical ideas are similar to the Merkle tree verification function of the edge end, but the integrity content is different. The integrity verification content of the cloud end is the model features to be aggregated and the number of training sets. Therefore, it will not be elaborated here. When the cloud receives the model features to be aggregated and the number of training sets sent by the edge end, the cloud verifies that the received model features to be aggregated and the number of training sets have not been tampered with by comparing whether the Merkle tree root composed of the decrypted sibling path is equal to the Merkle tree root composed of the model features to be aggregated and the number of training sets on the cloud end. The Merkle tree proof function of the cloud end includes constructing the Merkle tree and constructing the encrypted sibling path. Here, a Merkle tree is constructed for the aggregated model features. The construction method is similar to the Merkle tree verification at the edge, except that the constructed data is different. The data constructed here is the aggregated model features. The process will not be described again. The cloud constructs an encrypted sibling path to construct a sibling path for the verification node generated by the Merkle tree verification function at the edge. The construction method is consistent with the Merkle tree proof function at the edge, and will not be described again here. When the cloud sends the aggregated model features to the edge, the edge and the cloud must perform integrity authentication based on the Merkle tree. The cloud compares whether the Merkle tree root composed of the decrypted sibling path is equal to the Merkle tree root composed of the model features to be aggregated and the number of training sets to be aggregated by the cloud to prove that the aggregated model features received by the edge have not been tampered with.

[0009] The specific interaction process of the method proposed by the present invention is as follows.

[0010] After receiving the model features to be aggregated and the number of training sets sent by the edge, the cloud will first verify the integrity of the data to ensure that the information has not been tampered with by attackers during transmission. First, the cloud will build a Merkle tree based on the received model features and the number of training sets. Then the cloud will generate a random number chal as the verification node and the brother path length L, and send chal and L to the edge for verification. After receiving chal and L, the edge will decrypt chal according to its own Merkle tree to confirm the verification node, and generate an encrypted brother path of length L. The edge will send the encrypted brother path to the cloud. After receiving the encrypted brother path, the cloud will first decrypt it and compare the Merkle tree root in the brother path with the Merkle tree root generated by itself. If the values ​​are not equal, the verification fails, and the cloud will ask the edge to resend the model features to be aggregated, the number of training sets and other information. If the values ​​are equal, the verification is successful.

[0011] After receiving the aggregated model features sent by the cloud, the edge will first verify the integrity of the data to ensure that the received information has not been tampered with by attackers during transmission. First, the edge will build a Merkle tree based on the received aggregated model features. Then the edge will generate a random number chal as the verification node and the brother path length L, and send chal and L to the cloud for verification. After receiving chal and L, the cloud will decrypt chal according to its own Merkle tree to confirm the verification node, and generate an encrypted brother path of length L. The cloud will send the encrypted brother path to the edge. After receiving the encrypted brother path, the edge will first decrypt it and compare the Merkle tree root in the brother path with the Merkle tree root generated by itself. If the values ​​are not equal, the verification fails, and the edge will ask the cloud to resend the aggregated model features. If the values ​​are equal, the verification is successful.

[0012] Compared with the prior art, the present invention has the following advantages:

[0013] 1. In view of the problem that the transmission between multiple terminals in the existing cloud-edge collaborative federated learning scenario does not support integrity authentication, the integrity authentication method based on the Merkle tree of the present invention enables the edge to perform integrity authentication on the content transmitted by the cloud, and the cloud to perform integrity authentication on the content transmitted by the edge. This ensures the secure transmission between multiple terminals in the cloud-edge collaborative federated learning scenario.

[0014] 2. In response to the problems of large space and time overheads for transmission security authentication between multiple terminals in the existing cloud-edge collaborative federated learning scenarios, the present invention is based on the binary structure of the Merkle tree and the high efficiency of bit operations, so that the transmission space and time overheads between multiple terminals in the cloud-edge collaborative federated learning scenario are within the base level of complexity. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a cloud-edge collaborative federated learning architecture based on Merkle tree.

[0016] Figure 2 An example of a Merkle tree with 4 nodes.

[0017] Figure 3 This is the integrity verification process of the model features to be aggregated and the number of training sets sent from the cloud to the edge.

[0018] Figure 4 This is the integrity authentication process of the aggregated model features sent from the edge to the cloud. DETAILED DESCRIPTION

[0019] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0020] The present invention constructs a Merkle tree bilaterally, and relies on the Merkle tree structure combined with bit operations to realize homomorphic encryption, thereby realizing the integrity authentication of the aggregated model features sent by the edge to the cloud, and the integrity authentication of the model features to be aggregated and the number of training sets sent by the cloud to the edge. The key steps include: (1) the cloud constructs a Merkle tree for the model features to be aggregated and the number of training sets sent by the edge, generates verification nodes, and decrypts the brother path of the edge; (2) the cloud constructs a Merkle tree for the aggregated model features sent to the edge, and constructs an encrypted brother path; (3) the cloud aggregates the model features according to the number of training sets at the edge; (4) data division at the edge; (5) model training at the edge; (6) the edge constructs a Merkle tree for the aggregated model features sent by the cloud, generates verification nodes, and decrypts the brother path; (7) the edge constructs a Merkle tree for the model features to be aggregated and the number of training sets sent to the cloud, and constructs an encrypted brother path.

[0021] Specifically, when the cloud receives the model features and training set numbers to be aggregated sent by the edge, the cloud must first verify that the received information has not been tampered with. The cloud and edge will perform integrity authentication based on the Merkle tree. At this time, the cloud is the verifier and the edge is the prover.

[0022] Figure 3 This is the integrity verification process of the model features to be aggregated and the number of training sets sent from the cloud to the edge.

[0023] Step 1: When the cloud receives the model features to be aggregated and the number of training sets sent by the edge

[0024] 1) The cloud constructs a Merkle tree based on the aggregated model features and the number of training sets, and obtains the Merkle tree root MR1 (ie Figure 2 Merkle tree as an example).

[0025] 2) The cloud generates a random number chal as a verification node.

[0026] 3) The cloud generates a random number L as the brother path length.

[0027] 4) The cloud sends chal and L to the edge (iechal=123,L=6).

[0028] Step 2: When the edge receives chal and L

[0029] 1) The edge constructs a Merkle tree for the model features to be aggregated and the number of training sets before sending, and obtains the Merkle tree root MR2. Let n be the number of Merkle tree leaf nodes at the edge.

[0030] 2) The edge end calculates the node to be verified, chal' = (chal mod n) + 1 (iechal' = (123 mod 4) + 1 = 4).

[0031] 3) The edge generates a sibling path sib with a length of L based on the verification node. If the length of sib is less than L, a random number R is added to make the length reach L.

[0032] 4) The edge end encrypts the sibling paths from right to left by performing bitwise XOR with the recursive hash value of the random number seed s. Among them, H x (s) = H(H x-1 (s))x>1,H 1 (s) is equivalent to H(s))

[0033] 5) The edge sends the encrypted brother path resp to the cloud.

[0034] Step 3: When the cloud receives the encrypted brother path resp

[0035] 1) Remove the last item of resp and the random number added before it.

[0036] 2) Let h = MR1⊕(MR2⊕H 1 (s)), perform bitwise XOR with the recursive hash value of h on each element from right to left to get resp'. (ieresp'={N5⊕H 4 (s)⊕H 3 (h),N3⊕H 3 (s)⊕H 2 (h),N4⊕H 2 (s)⊕H 1 (h)})

[0037] 3) Construct the Merkle tree root MR3 for resp'.

[0038] 4) Compare the Merkle tree root MR3 in the brother path with the Merkle tree root MR1 generated by itself. If the values ​​are equal, the verification is successful and the cloud aggregates the model. If the values ​​are not equal, the verification is unsuccessful, and the edge is required to resend the information such as the model to be aggregated and the number of training sets.

[0039] When the edge receives the aggregated model features sent by the cloud, it must first verify whether the received information has been tampered with. The edge and the cloud will interact to verify the integrity based on the aggregated model features. At this time, the cloud is the prover and the edge is the verifier.

[0040] Figure 4 This is the integrity authentication process of the aggregated model features sent from the edge to the cloud.

[0041] Step 1. When the edge receives the aggregated model features sent by the cloud

[0042] 1) The edge end constructs a Merkle tree for the aggregated model features and obtains the Merkle tree root MR1 (ie Figure 2 Merkle tree as an example).

[0043] 2) The edge generates a random number chal as a verification node.

[0044] 3) The edge end generates a random number L as the sibling path length.

[0045] 4) The edge sends chal and L to the cloud (iechal=123,L=6).

[0046] Step 2. When the cloud receives chal and L

[0047] 1) The cloud constructs a Merkle tree for the aggregated model features before sending, and obtains the Merkle tree root MR2. Let n be the number of Merkle tree leaf nodes on the cloud.

[0048] 2) The cloud calculates the node to be verified, chal'=(chal mod n)+1(iechal'=(123mod 4)+1=4).

[0049] 3) The cloud generates a sibling path sib with a length of L based on the verification node. If the length of sib is less than L, a random number is added to make the length reach L.

[0050] 4) The cloud encrypts the sibling paths from right to left by bitwise XOR with the recursive hash value of the random seed s to obtain resp'. (ieresp={R1,R2,N5⊕H4(s),N3⊕H3(s),N4⊕H2(s),MR2⊕H1(s)})

[0051] 5) The cloud sends the encrypted sibling path resp to the edge.

[0052] Step 3. When the edge receives the encrypted brother path resp

[0053] 1) Remove the last item of resp and the random number added before it.

[0054] 2) Let h = MR1⊕(MR2⊕H1(s)), and perform bitwise XOR with the recursive hash value of h on each element from right to left to obtain resp'. (ieresp' = {N5⊕H4(s)⊕H3(h), N3⊕H3(s)⊕H2(h), N4⊕H2(s)⊕H1(h)})

[0055] 3) Construct the Merkle tree root MR3 for resp'.

[0056] 4) Compare the Merkle tree root MR3 in the brother path with the Merkle tree root MR1 generated by itself. If the values ​​are equal, the verification is successful, and the edge will overwrite the original model features with the aggregated model features and conduct the next round of model learning. If the values ​​are not equal, the verification is unsuccessful, and the cloud is required to resend the aggregated model features.

Claims

1. A Merkle tree-based cloud-edge collaborative federated learning integrity authentication method, characterized by: By constructing a Merkle tree bilaterally and relying on the Merkle tree structure combined with bit operations to achieve homomorphic encryption, the integrity authentication of the aggregated model features sent by the edge to the cloud and the integrity authentication of the model features to be aggregated and the number of training sets sent by the cloud to the edge are achieved. The specific steps include: (1) The cloud constructs a Merkle tree for the model features to be aggregated and the number of training sets sent by the edge, generates verification nodes, and decrypts the brother paths of the edge; (2) The cloud constructs a Merkle tree for the aggregated model features sent to the edge and constructs an encrypted brother path; (3) The cloud aggregates the model features according to the number of training sets at the edge; (4) Data division at the edge; (5) Model training at the edge; (6) The edge constructs a Merkle tree for the aggregated model features sent by the cloud, generates verification nodes, and decrypts the brother paths; (7) The edge constructs a Merkle tree for the model features to be aggregated and the number of training sets sent to the cloud and constructs an encrypted brother path; The integrity authentication method of cloud-edge collaborative federated learning involves three parts: the user's local terminal, the edge, and the cloud. These three parts collaborate with each other to complete the training of the federated learning model. The integrity authentication based on the Merkle tree acts on the transmission of model features between the edge and the cloud. The user's local terminal is responsible for data collection, data processing, and transmission of the data set to be trained to the edge. After training is completed, the user's local terminal will receive the model sent by the edge for model testing. The edge is responsible for data partitioning and model training, and realizes model aggregation by transmitting model gradients and the number of training sets to the cloud; it is responsible for Merkle tree verification and Merkle tree proof; the Merkle tree verification function of the edge includes three modules: generating verification nodes, constructing Merkle trees, and decrypting brother paths; generating verification nodes is generated by generating random numbers; constructing Merkle trees is constructed by taking hashes of two child nodes. Merkle trees are a typical binary tree structure, and non-leaf nodes are hash values ​​of the contents of their two child nodes; decrypting brother paths is performed by XOR bit operations; When the edge receives the aggregated model features sent by the cloud, it verifies that the aggregated model features sent by the cloud have not been tampered with by comparing whether the Merkle tree root composed of the decrypted sibling path is equal to the Merkle tree root composed of the aggregated model features by the edge. The Merkle tree proof function includes constructing a Merkle tree and constructing an encrypted sibling path. Here, a Merkle tree is constructed for the aggregated model features. The construction method is similar to the Merkle tree construction method in the Merkle tree verification function, and will not be elaborated here. Construct an encrypted sibling path. For any point V in the Merkle tree, select as few nodes as possible that have no intersection. The cloud is responsible for aggregating model features, aggregating model features of each edge end according to the number of training sets of each edge segment, and is responsible for Merkle tree verification and Merkle tree proof; the Merkle tree verification function of the cloud includes decrypting sibling paths, generating verification nodes and constructing Merkle trees; when the cloud receives the model features to be aggregated and the number of training sets sent by the edge end, the cloud verifies that the received model features to be aggregated and the number of training sets have not been tampered with by comparing whether the Merkle tree root composed of the decrypted sibling paths is equal to the Merkle tree root composed of the model features to be aggregated and the number of training sets on the cloud end; the Merkle tree proof function of the cloud includes constructing Merkle trees and constructing encrypted sibling paths; when the cloud sends the aggregated model features to the edge end, the edge end and the cloud end shall perform integrity authentication based on the Merkle tree, and the cloud end proves that the aggregated model features received by the edge end have not been tampered with by comparing whether the Merkle tree root composed of the decrypted sibling paths is equal to the Merkle tree root composed of the model features to be aggregated and the number of training sets on the cloud end.