Byzantine tolerant decentralized privacy protection federated learning system based on block chain

By combining blockchain and multi-client function cryptography, a decentralized federated learning system was designed, which solves the problems of Byzantine attacks and privacy protection, and achieves effective resistance to attacks and privacy protection in non-independent and identically distributed data scenarios, thereby improving the system's security and participation.

CN119004533APending Publication Date: 2024-11-22UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411140851.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-20
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

Existing federated learning systems cannot simultaneously achieve decentralization and privacy protection when facing Byzantine attacks. Furthermore, existing robust algorithms perform poorly in scenarios with non-independent and identically distributed data, and may violate privacy protection principles or require a central server, making them vulnerable to SPOF attacks.

Method used

Combining blockchain technology and multi-client function encryption algorithms, a decentralized privacy-preserving federated learning system was designed. Privacy is protected through the IP-MCFE algorithm, and a cryptographic model detection and incentive mechanism is introduced to identify malicious clients and encourage honest, high-quality data participation.

Benefits of technology

It effectively defends against Byzantine attacks in non-independent and identically distributed data scenarios while protecting privacy, and improves the healthy development and participation of the system through incentive mechanisms, thus possessing practical value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004533A_ABST
    Figure CN119004533A_ABST
Patent Text Reader

Abstract

The invention relates to the field of information security, and provides an innovative Byzantine tolerant decentralized privacy protection federated learning system based on a block chain. The objective of the invention is to solve the problems of security and privacy leakage in traditional federated learning. In order to deal with single-point failure and privacy disclosure threats, an improved multi-client function encryption mechanism is introduced. The client model quality detection method based on the constructed function encryption technology and the cosine similarity calculation method is used for distinguishing honest clients and malicious clients. Not only can the Byzantine attack be effectively resisted, but also the model quality of each client in the federal learning process can be ensured to meet the requirement. And finally, on the premise of ensuring data privacy, through a fair incentive evaluation mechanism, including reputation evaluation, contribution evaluation and reward evaluation. The measures aim to stimulate more honest and high-quality data clients to actively participate in federated learning, so that the overall learning effect and the universality of the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a Byzantine-tolerant decentralized privacy-preserving federated learning system based on blockchain. Background Art

[0002] Federated learning is an emerging machine learning method that aims to address privacy and security issues in decentralized data environments. Traditional machine learning methods usually require centralized data collection and storage, followed by model training in a single center. However, in scenarios involving sensitive information, such as healthcare and finance, centralized methods may have privacy leaks and data security issues. Federated learning overcomes some of the challenges of centralized methods by performing localized model training on distributed devices. In federated learning, participants update the model locally and then share some model parameters or gradients to a central server, which updates the global model based on this information. This collaborative approach allows model training to be performed without sharing the original data, better protecting privacy.

[0003] However, existing research shows that local model gradients in federated learning may reveal data features, so the model needs to be protected to resist various privacy leakage attacks. Existing research is based on a variety of privacy protection technologies, such as differential privacy, secure multi-party computing, homomorphic encryption and other cryptographic technologies for privacy protection, but most of these solutions are based on the premise that the participants are semi-honest, that is, they will not launch any malicious attacks. However, in real life, it is very difficult to ensure that all clients are semi-honest, because there will be some "malicious clients" that destroy the federated learning process through Byzantine attacks, or some "lazy clients" that intercept other client models without making actual contributions to the federated learning process.

[0004] In order to solve the problem of Byzantine attacks, a large number of robust algorithms have been proposed to improve the robustness of the model. In the existing technology, most robust algorithms are built based on independent and identically distributed data, and most of them are invalid for application scenarios with non-independent and identically distributed data. As for algorithms that can work in two data distribution scenarios at the same time, some need to collect clean data sets to defend against attacks, which violates the principle of privacy protection, and some require central servers, which are prone to SPOF attacks. Therefore, the existing technology cannot achieve Byzantine tolerance and privacy protection at the same time in a decentralized federated learning scenario. Summary of the invention

[0005] This invention aims to solve the problem of how to protect privacy and resist Byzantine attacks in federated learning. It combines blockchain technology and multi-client function encryption algorithms to realize a decentralized, privacy-preserving federated learning system that can tolerate Byzantine behavior and designs an incentive mechanism to encourage honest and high-quality data participation.

[0006] The present invention is achieved through the following technical solutions:

[0007] Blockchain system initialization: RI-PPDFL builds the blockchain and initializes the IPFS node. The client registers the corresponding account on the chain and deploys the smart contract. The task issuer registers the account on the chain and publishes the task, sets various algorithm parameters and initializes the global model. The client on the chain receives the task and chooses whether to participate, and uploads all the client sets recruited for this task to the blockchain.

[0008] Encryption algorithm initialization: A multi-client function encryption algorithm that supports inner product is used for privacy protection. The number of clients participating in federated learning is based on the security parameters set by the task issuer. The key generation center (KGC) sets the public parameter pp.

[0009] Key distribution: The key generation center (KGC) generates the master private key msk and the client encryption key based on the public parameter pp And the encryption key is distributed to the client through a secure channel.

[0010] Local model training: The client first calls the IPFS smart contract to download the global model gradient ciphertext of the previous round, and sends a function decryption key query to KGC to obtain the decryption key sk y , use the obtained decryption key to decrypt the global model ciphertext to obtain the gradient plaintext, and complete the local model update based on the global model gradient and the local data set.

[0011] Local model encryption: After the client completes local model training, it is normalized and encrypted using the encryption key sk i Encrypt the local model.

[0012] Closed-state model detection: The system calls the smart contract to select m clients with the highest reward value (referred to as U′). Client U′ sends a function decryption key query to KGC. KGC determines whether it is a legitimate user and returns the decryption key if it is. Finally, client U′ calculates the cosine similarity between the local model gradient of the current round and the global model gradient of the previous round, which is used as the client's closed-state model quality assessment result.

[0013] Model upload & aggregation: According to the threshold set by the task issuer, the quality assessment results of the calculated secret model are classified and counted, and the clients are divided into "malicious" and "honest". The detection results and local model gradient ciphertext are uploaded to IPFS. The system calls the smart contract to aggregate the local model gradient ciphertext judged as "honest client" as the global model gradient ciphertext.

[0014] Incentive mechanism evaluation: This mechanism is divided into three parts, namely, client reputation evaluation, client contribution evaluation, and client reward evaluation. First, the reputation value is calculated based on the client's "honesty" identification and subjective logic value stored in IPFS, and then the corresponding contribution value is calculated based on the client's dense model quality evaluation results stored in IPFS. Finally, the reward value of each client is calculated based on the reputation value and contribution value and uploaded to IPFS.

[0015] Compared with the prior art, the present invention has the following beneficial effects:

[0016] (1) The present invention provides a multi-client functional encryption algorithm (Multi-Client Functional Encryption for Inner Product, IP-MCFE) that supports inner product. The steps include: encryption algorithm initialization, key distribution, decryption operation in local model training, and encryption operation in local model encryption. It provides privacy protection for federated learning and lays the foundation for subsequent secret model detection and secret incentive mechanism design. The theoretical security proof shows that the constructed algorithm is secure.

[0017] (2) The present invention designs a client-side secret model quality detection method, which includes the following steps: secret model detection, client evaluation stage in model upload & aggregation. A secret quality detection method is designed based on the multi-client function encryption algorithm constructed above and combined with a model cosine similarity detection method to help privacy-preserving federated learning identify malicious clients and effectively resist Byzantine attacks.

[0018] (3) The present invention designs a dense incentive mechanism, including client reputation evaluation, contribution evaluation and reward evaluation. The steps include: client reputation evaluation, contribution evaluation and reward evaluation in the incentive mechanism evaluation, in order to ensure that more clients who make contributions can obtain more rewards, thereby attracting more honest and high-quality data clients to actively participate in federated learning.

[0019] (4) The present invention implements a blockchain-based Byzantine-tolerant decentralized privacy-preserving federated learning system (RI-PPDFL), the steps of which cover all the above technical solutions. Experimental results show that RI-PPDFL can simultaneously achieve decentralization, privacy protection, Byzantine tolerance and incentive mechanism, and has practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Formal definition of the IP-MCFE algorithm of the present invention;

[0021] Figure 2 It is a schematic diagram of the system model of the present invention;

[0022] Figure 3 It is a schematic diagram of the system flow of the present invention;

[0023] Figure 4 Comparison of computational and communication efficiency between the present invention and ShieldFL;

[0024] Figure 5 Comparison of the generalization performance of targeted poisoning attacks between the present invention and the baseline model in a non-IID environment;

[0025] Figure 6 This is a comparison of the generalization performance of the present invention and the baseline model in non-IID environment for non-targeted poisoning attacks;

[0026] Figure 7 The performance comparison of the model of the present invention with different poisoning ratios in non-IID and targeted poisoning attack environments is shown;

[0027] Figure 8 The performance comparison of the model of the present invention with different poisoning ratios in non-IID and non-target poisoning attack environments is shown;

[0028] Fig. 9 Comparison of the generalization performance of targeted poisoning attacks between the present invention and the baseline model in an IID environment;

[0029] Fig.10 The generalization performance comparison of the present invention and the baseline model in the IID environment for non-targeted poisoning attacks;

[0030] Fig.11 The performance comparison of the model of the present invention with different poisoning ratios in IID and targeted poisoning attack environments is shown;

[0031] Fig.12 The performance comparison of the model of the present invention with different poisoning ratios in IID and non-target poisoning attack environments is shown;

[0032] Fig.13 Comparison of the accuracy of the present invention with that of the existing solutions;

[0033] Fig.14 Comparison of the model accuracy ACC under different thresholds of the present invention;

[0034] Fig.15Comparison of the attack success rate ASR of the model under different thresholds of the present invention;

[0035] Fig.16 Comparison of client reputation values ​​under different data distributions and different poisoning ratios in the present invention;

[0036] Fig.17 The present invention evaluates the contribution value of honest clients under different data distributions, different poisoning ratios, and different poisoning attacks;

[0037] Fig.18 The present invention compares the contribution values ​​of honest clients and malicious clients under different data distributions, different poisoning ratios, and different poisoning attacks;

[0038] Fig.19 Comparison of client reward values ​​under different data distributions and different poisoning ratios in the present invention; DETAILED DESCRIPTION

[0039] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0040] In order to protect the privacy of federated learning, the cryptographic algorithm we use in the system is IP-MCFE, which is a multi-client function encryption algorithm that supports inner product operations. Figure 1 As shown, according to the literature of Abdalla et al., a multi-client functional encryption algorithm IP-MCFE that supports inner product operations is formally defined as follows:

[0041] Definition (Multi-client functional encryption with inner product support): Given a security parameter λ, a function defined in the family and tag family The multi-client function encryption algorithm that supports inner products consists of five probabilistic polynomial time algorithms (Setup, KeyGen, Enc, KeyDer, Dec).

[0042] Setup(1 λ , n)→pp. Given the security parameter λ and the number of clients n as input, output the public parameter pp.

[0043] Given the security parameter pp as input, output the master private key msk and the client encryption key ).

[0044] Enc(pp,sk i , x i , l→c i Given security parameters pp, client encryption key sk i , message x i And tags Output the corresponding ciphertext c i,l .

[0045] KeyDer(pp, msk, f) → sk f .: Given security parameters pp, master private key msk and function As input, output the corresponding function decryption key skf.

[0046] Given the security parameter pp, the function decrypts the key sk f And the client ciphertext group As input, output the decrypted result y.

[0047] In order to make multi-client function encryption suitable for the needs of federated learning in the present invention, the algorithm of Abdalla et al. is improved based on the DCR difficulty problem. The present invention constructs a multi-client function encryption algorithm that supports inner product calculation. The specific construction content is as follows:

[0048] Setup(1 λ , n)→pp. Given the security parameter λ as input, the key generation center selects two secure prime numbers p′ and q′, and p=2p′+1 and q=2q′+1 are also two secure large prime numbers. Then calculate N=pq and select a secure and collision-resistant hash function In addition, set Select a public function And set the public parameters to pp = (N, H, X, L).

[0049] Given the public parameter pp as input, the key generation center is Integer Gaussian distribution with mean 0 Select an n×d dimensional matrix S as the master private key msk. Then, KGC uses each row of the master private key S matrix as the client u i The encryption key sk of (i∈[1,n]) i And distributed to the client through a secure channel.

[0050] Enc(pp,sk i , x i , l)→c i . Given the public parameter pp, user u iThe encryption key sk of (i∈[1,n]) i , user plaintext vector x i and label l, user u i (i∈[1,n]) calculates the ciphertext as shown below.

[0051]

[0052] KeyDer(pp, msk, Y) → sk y Given the public parameters pp, the master private key msk, and an n×d-dimensional matrix Y (for any The key generation center calculates the function decryption key y i ∈Y T , s′ i ∈S T (i∈[1,d].

[0053] Given the public parameters pp, the matrix Y∈Z n×d , function decryption key sk y , the ciphertext of all clients and label l, client u i The decryption is shown below.

[0054]

[0055] like Figure 2 As shown, this embodiment consists of five entities, including a key generation center, a client, a consensus node, a blockchain, and an interplanetary file system. The specific description is as follows:

[0056] Key Generation Center: The key generation center is a fully trusted third party whose main responsibility is to distribute encryption keys to clients and function decryption keys.

[0057] Client: In the first round of training, the client obtains the initialized global model from the blockchain, trains a local model based on this model and local data, and then transmits the encrypted local model to the consensus node. In subsequent training rounds, the client first obtains the ciphertext of the global model from the blockchain, completes the model update after decryption, and encrypts the new local model and transmits it to the consensus node.

[0058] Consensus node: The consensus node verifies the local model ciphertext received from the client, completes the consensus on the local model ciphertext through the consensus algorithm, and uploads the result to the chain.

[0059] Blockchain: The main function of the blockchain is to store the hash value of the model in the Interstellar File System, and to complete model quality detection, reputation and sharing evaluation, and reward distribution through smart contracts.

[0060] Interstellar File System: An end-to-end distributed file system mainly used to store local model ciphertext and global model ciphertext during federated learning training.

[0061] The process of the blockchain-based Byzantine-tolerant decentralized privacy-preserving federated learning system-RI-PPDFL proposed in this invention is as follows Figure 3 As shown, the detailed workflow is:

[0062] Step A: Blockchain system initialization:

[0063] A1: Initialize and deploy the blockchain: Build the blockchain and initialize the blockchain and its IPFS nodes for subsequent storage of model ciphertexts. Data users (clients) will register accounts on the blockchain and actively participate in the operation and maintenance of the blockchain. At the same time, deploy all necessary smart contracts on the blockchain to ensure the security and reliability of the system.

[0064] A2: Task publishing and setting: The task issuer first registers an account and pays the total fee to publish the federated learning training task to the blockchain. In addition, the task issuer also needs to set the security parameters of the cryptographic algorithm, the hyperparameters of the model training, and initialize a global model W 0 .

[0065] A3: Client recruitment and participation: All clients can browse the details of the federated learning task issued by the task issuer and decide whether to participate. They will upload the collection of all clients participating in this federated learning task to the blockchain for effective execution and management of the task.

[0066] Step B: Initialize the encryption algorithm: (The setup algorithm of IP-MCFE constructed above is executed here)

[0067] B1: Based on the security parameters set by the task issuer and the number of clients n that initiate encryption key inquiries, the key generation center selects two secure prime numbers p′ and q′, and p=2p′+1 and q=2q′+1 are also two secure large prime numbers.

[0068] B2: Then calculate N = pq and choose a secure and collision-resistant hash function

[0069] B3: In addition, Select a public function And set the public parameters to pp = (N, H, X, L).

[0070] Step C: Key distribution: (Here the keyGen algorithm of IP-MCFE constructed above is executed)

[0071] C1: KGC has a variance of Integer Gaussian distribution with mean 0 Select an n×d dimensional matrix S as the master private key msk.

[0072] C2: KGC takes each row of the master private key S matrix as the client u i The encryption key sk of (i∈[1,n]) i And distributed to the client through a secure channel.

[0073] C3: KGC records the client set U to which encryption keys are distributed.

[0074] Step D: Local model training. Take the i-th client u in the t-th iteration i For example, when t = 1, client u i Get the initialized global model from the blockchain, and then u i Based on its local data, machine learning algorithms, hyperparameters and W 0 , train to get the first round of local model gradient And normalize. In the remaining iterations, each client u i The following steps need to be performed, which specifically include the following sub-steps:

[0075] D1: Client u i Call the IPFS smart contract to obtain the global model gradient ciphertext C(g t-1 )=ct l .

[0076] D2: Function decryption key query: client u i Choose a d-dimensional all-1 vector And send a function decryption key query to KGC. After receiving the query, KGC will determine whether it is a legitimate client based on the set U when it distributes the encryption key. If it is a legitimate client, KGC will calculate the function decryption key sk y =[ j , y)] j∈[1,d] ,in is a column vector of S. Finally, KGC decrypts the function key sk y Return to client u i .

[0077] D3: Model decryption: Client u i According to the formula Use the function obtained to decrypt the key sk y Decrypt the global model gradient ciphertext ct l To obtain the corresponding global model gradient plaintext g τ-1 , then the client u​i The global model gradient g based on the t-1th iteration t-1 And its local data set completes the local model update and obtains the local model gradient of the tth round And normalize it.

[0078] Step E: Local model encryption. Take the i-th client u in the t-th iteration i For example, client u i After completing the local model training to obtain the local model of the current iteration and normalizing it, use the encryption key sk i Calculate the corresponding local model ciphertext ct i,l , as shown below:

[0079]

[0080] Step F: Dense Model Detection:

[0081] F1: The i-th client u in the t-th iteration i For example, RI-PPDFL first calls the smart contract to select m clients with the highest total reward value (this client set is denoted as U').

[0082] F2: Secondly, client u j ∈U′ chooses a The d-dimensional t-1th round global model W t-1 The matrix composed of Initiate a function decryption key query to KGC.

[0083] F3: After receiving the query, KGC will determine whether it is a legitimate client based on the set U when it distributes the encryption key. If it is a legitimate client, it calculates sk′ j =[ i ,y i >] i (in are the row vectors corresponding to Y and S respectively, and j∈[1,m]) and return sk′ j To the corresponding client u j ∈U′.

[0084] F4: Then the client u j ∈U′ According to the formula Among them, sk′ i ∈sk′ y , ct i,k,l ∈ct i,l as well as Calculate the client u in round t i ​The local model gradient and the previous round of global model gradient g t-1 The cosine similarity of .

[0085] Step G: Model upload & aggregation:

[0086] G1: Taking the tth iteration as an example, client u j ∈U′ obtains the hyperparameter threshold η set by the task issuer from the blockchain, and calculates the quality evaluation result of the dense model cos i (t) is classified and counted. i (t)≤η, let τ i =0, indicating that the client u i is malicious, otherwise, let τ i =1, indicating that the client u i For an honest client (U * represents the set of honest clients).

[0087] G2: All clients u j ∈U′ uploads the detection results and local model gradient ciphertext to IPFS.

[0088] G3: RI-PPDFL calls the model aggregation smart contract, according to the formula Calculate the global model gradient ciphertext C(g t ).

[0089] Step H: Incentive Mechanism Evaluation:

[0090] Step H1: Client reputation evaluation. The client reputation evaluation method is designed based on the subjective logic model, assuming that each client's subjective logic value (a i , b i , c i )(where a i Means "believe", i Means "don't believe", c i means "uncertain").

[0091] Taking the tth iteration as an example, the reputation evaluation smart contract deployed on the blockchain is based on the client u stored in IPFS. i The logo of τ i Calculate the reputation value of the client. i The corresponding τ i =1, P i =P i +1, when client u i The corresponding τ i =0, N i =Ni +1, calculated later and

[0092] Then call the reputation evaluation smart contract to calculate the other clients u in round t i Reputation value R i (t). The calculation formula is as follows:

[0093]

[0094] Step H2: Client contribution evaluation. The client contribution calculation method is to evaluate the contribution of each client to the final global model. Taking the tth iteration as an example, the contribution evaluation smart contract deployed on the blockchain is based on the client u stored in IPFS. i The dense model detection result of (i∈[1,n]) cos i , calculate the corresponding contribution value C i (t), as shown in the following formula:

[0095] C i (t) = 2(1 + cos i (t))

[0096] Step H3: Client reward evaluation. Based on the client's reputation evaluation result R i (t) and the contribution evaluation result Ci(t) are used to calculate the reward that the client should receive. Taking the tth iteration as an example, the reward evaluation smart contract deployed on the blockchain is based on the reputation value R i (t) and contribution value C i (t), calculate the client u in round t i The reward Ii(t) obtained is as follows:

[0097]

[0098] In the specific implementation process, the experimental simulation environment used is the 12th generation Intel(R) Core(TM) i9-12900K (3.2GHz), 64-bit Ubuntu-20.04 operating system and Python 3.7.6 version. On this basis, the complete experimental code was written based on Pytorch and Gmpy2. In addition, for the blockchain part, Ganache was used to simulate a local Ethereum network, and an IPFS node was registered locally, and the ipfshttpclient library was used to interact with the IPFS file system for data. The data set, data distribution, and model structure settings used in the simulation experiment are described below.

[0099] (1) Datasets. The simulation experiments are conducted on two real-world datasets:

[0100] a.MNIST is a collection of 60,000 training samples and 10,000 test samples of handwritten digits. Each sample is a grayscale image of size 28×28 pixels, representing a number from 0 to 9.

[0101] b.FEMNIST is a collection of handwritten digit and character images consisting of samples generated by 43 different individuals on mobile devices. Each sample is a grayscale image of size 28×28 pixels, representing a number from 0 to 9 or one of the 26 English letters.

[0102] (2) Model structure: In terms of model selection, the simulation experiment uses two different convolutional neural networks to complete the image classification federated learning tasks in MNIST and FEMNIST.

[0103] The first model is LetNet. It consists of seven layers, including two convolutional layers, two pooling layers, and three fully connected layers.

[0104] The second model is AlexNet. It consists of eight layers, including five convolutional layers and three fully connected layers.

[0105] (3) Data distribution settings. The simulation experiment considers two different data distribution environments.

[0106] Independent and identically distributed: The training data will be evenly and randomly divided according to the number of clients, that is, any client will have all the data label categories;

[0107] Non-IID: The training data is no longer divided uniformly and randomly, but is divided according to label categories, that is, each client only has a part of all data label categories instead of all label categories.

[0108] (4) Poisoning attack setting. In order to evaluate the model accuracy of RI-PPDFL under poisoning attack, we consider constructing non-targeted poisoning attack and targeted poisoning attack respectively.

[0109] Targeted poisoning attacks: Targeted poisoning attacks focus on the categories that the target model incorrectly predicts. In this way, the attacker forces the target model to produce abnormal output on the specified samples while ensuring its legitimate function on other benign samples. To this end, this type of poisoning attack is simulated by modifying the labels "1" and "2" in the malicious client's local dataset to "7" and "4".

[0110] Untargeted poisoning attacks: Untargeted poisoning attacks aim to degrade the overall generalization performance of the target model. To this end, this type of poisoning attack is simulated by modifying all data labels in the malicious client's local dataset to random labels.

[0111] (5) Hyperparameter setting: In the simulation experiment, the training hyperparameters including the number of iterations, batch size and learning rate are set to 50, 16 and 0.001 respectively. At the same time, the security parameter λ of the MCFE cryptographic algorithm is set to 128 bits.

[0112] PS: Federated learning without any Byzantine tolerance strategy is used as the benchmark (referred to as Baseline)

[0113] Based on the above experimental environment, the RI-PPDFL system of the present invention is used to illustrate the computational and communication overheads, and is compared with the existing solution ShieldFL. Let n represent the total number of clients participating in federated learning, and d represent the dimension of the gradient vector. In order to evaluate the efficiency of RI-PPDFL, Figure 4 The communication and computational overhead of RI-PPDFL and ShieldFL in the four stages of key generation (KeyGen), encryption (Enc), decryption (Dec), and cosine similarity detection (Cosine) are shown. picture It can be seen that in terms of computational overhead, the present invention and ShieldFL have the same computational overhead in the encryption stage. Although ShieldFL calculates d more modular multiplication operations than ShieldFL in the decryption stage, ShieldFL calculates 4d+2 modular multiplication operations and 2d+3 modular exponentiation operations more than the present invention in the cosine similarity detection stage. In terms of communication overhead, the present invention and ShieldFL have the same communication overhead in the encryption and decryption stages. Although ShieldFL is higher than ShieldFL O((nd-2n-2)|G|) in the key generation stage, ShieldFL has more communication overhead than the present invention in the cosine similarity detection stage by O((3nd+2n)|G|). In summary, whether in terms of computational overhead or communication overhead, the RI-PPDFL of the present invention has significant advantages over ShieldFL and has higher practicality.

[0114] In the non-IID data scenario, the number of iterations is set to 50, the number of clients is set to 30, and the poisoning ratio is set to 30%. The changes in the indicators of the RI-PPDFL model of the present invention under targeted poisoning attacks and non-targeted poisoning attacks are evaluated and compared with the Baseline. Figure 5 and Figure 6 As shown. In a targeted poisoning attack, Figure 5 It can be seen that RI-PPDFL can achieve high accuracy ACC, high source accuracy ACC* and low attack success rate ASR compared to Baseline. For example, after 50 iterations, the accuracy and source accuracy of RI-PPDFL are both greater than 90%, and the attack success rate is less than 10%. Similarly, in the case of non-targeted poisoning attack, Figure 6As shown in the figure, after 50 iterations, the accuracy of RI-PPDFL is greater than 90% and the attack success rate ASR is less than 5%. RI-PPDFL can also achieve high ACC and low ASR. The experimental results show that the model generalization of RI-PPDFL has been significantly improved in both types of poisoning attacks; the number of iterations is set to 50, the number of clients is 30, and the poisoning ratio is 10%, 20%, and 30%, respectively, to evaluate the changes of RI-PPDFL model indicators with poisoning ratio under targeted poisoning attacks and non-target poisoning attacks, as shown in the figure. Figure 7 and Figure 8 As shown. In a targeted poisoning attack, Figure 7 As shown in Figure 1, RI-PPDFL can maintain high accuracy ACC, source accuracy ACC*, and low attack success rate ASR, and the three indicators of RI-PPDFL do not change significantly with the increase of the disconnection rate. Under three different poisoning ratio settings, RI-PPDFL can achieve accuracy ACC and source accuracy ACC* higher than 90% and attack success rate lower than 10%. Similarly, under non-target poisoning attacks, such as Figure 8 As shown in the figure, RI-PPDFL can maintain an accuracy rate of ACC higher than 90% and an attack success rate lower than 10% under different poisoning ratios. The experimental results show that RI-PPDFL can maintain good Byzantine tolerance under different poisoning ratios.

[0115] In the independent and identically distributed data environment scenario, the number of iterations is set to 50, the number of clients is set to 30, and the poisoning ratio is set to 30%. The generalization performance changes of the RI-PPDFL model under targeted poisoning attacks and non-targeted poisoning attacks are evaluated and compared with Basline. Fig. 9 and Fig.10 As shown in the figure. It can be seen that, whether under targeted poisoning attacks or untargeted poisoning attacks, RI-PPDFL has significant improvements in the three indicators of model generalization performance compared to the Baseline. For example, in targeted poisoning attacks, the accuracy ACC and source accuracy ACC* of the model in RI-PPDFL are both higher than 90% after 50 rounds of iterations, and the successful attack rate ASR is reduced to less than 5%. Similarly, under untargeted poisoning attacks, after 50 rounds of iterations, the accuracy ACC of the RI-PPDFL model is higher than 90% and the successful attack rate is less than 10%. The experimental results show that RI-PPDFL also has Byzantine tolerance in an independent and identically distributed data environment; the number of iterations is set to 50, the number of clients is 30, and the poisoning ratio is increased from 10% to 30%. Fig.11 and Fig.12The figure shows how the generalization performance of the RI-PPDFL model changes with the poisoning ratio under two types of poisoning attacks. As can be seen from the figure, no matter what kind of poisoning attack, RI-PPDFL can maintain high model accuracy ACC, high source accuracy ACC*, and low successful attack rate ASR for different poisoning ratios. For example, under different poisoning ratios, after 50 iterations of the RI-PPDFL model, ACC and ACC* can reach more than 90%, and ASR less than 10%. The experiment shows that RI-PPDFL still maintains high model generalization performance under different poisoning ratios.

[0116] In order to evaluate the model generalization performance of the federated learning scheme with Byzantine tolerance in the present invention under different poisoning attacks and different data distribution scenarios, the number of training rounds is set to 100, the number of clients is set to 30, and the poisoning ratio is set to 40%. The model accuracy ACC is compared with the existing Byzantine tolerant federated learning schemes (including Trimmed, Krum, Multi-Krum and Bulyan). Fig.13 As shown. As can be seen from the figure, in the non-IID data environment, RI-PPDFL has a significant improvement in the model accuracy ACC for two types of poisoning attacks. After 100 iterations, the RI-PPDFL model accuracy ACC can reach 90.63% and 88.81% respectively under two different poisoning attacks. However, the model accuracy of other existing schemes is less than 80%. The main reason is that Krum, Multi-Krum and Bulyan can only provide Byzantine tolerance in independent and identically distributed scenarios, but cannot continuously provide Byzantine tolerance capabilities in non-IID data environments. In the independent and identically distributed data environment, the model accuracy ACC of RI-PPDFL can also reach more than 90% under two poisoning attacks, which can achieve the same effect as the existing Byzantine tolerant federated learning scheme. The experimental results show that RI-PPDFL can achieve Byzantine tolerance for different types of poisoning attacks in different data distribution scenarios.

[0117] In order to evaluate the impact of the threshold η used in the dense model detection in the present invention on the generalization performance of the RI-PPDFL model, the number of training rounds is set to 50, the number of clients is set to 20, and the poisoning ratio is set to 30%. Then, the thresholds η∈[0.2, 0.3, 0.4, 0.5, 0.6] are respectively taken to test the changes in the accuracy ACC and attack success rate ASR of the RI-PPDFL model in the independent and identically distributed data and targeted poisoning attack environment, as shown in the figure. Fig.14 and Fig.15As shown in the figure, as the threshold η increases, the model accuracy ACC of RI-PPDFL will be improved to a certain extent. In addition, the attack success rate ASR in RI-PPDFL will also decrease with the increase of the threshold η. The main reason is that the dense model detection uses cosine similarity (that is, calculating the angle between the local model gradient of the client in the current iteration round and the global model gradient in the previous round). When the local model gradient is more similar to the global model gradient, that is, the smaller the angle, the larger the corresponding cosine value will be. Therefore, a higher threshold η will better identify malicious clients and honest clients, and thus obtain a global model with high generalization performance.

[0118] In order to evaluate the effects of the incentive mechanism of the present invention under different data distributions, different poisoning ratios and different poisoning attack types, three groups of experiments were set up, with 50 experimental iterations, 20 clients, different poisoning ratios (30%, 40% and 50%) and targeted poisoning attacks, and the tests were conducted under independent and identically distributed data and non-independent and identically distributed data respectively.

[0119] The first group was evaluated on reputation. Fig.16 The evaluation and comparison of the reputation values ​​of honest clients and malicious clients under different data distribution conditions are shown. As can be seen from the figure, under different poisoning ratio settings, the reputation value of the honest client will increase with the increase of the number of iterations. On the contrary, the reputation value of the malicious client will continue to decrease with the decrease of the number of iterations. Therefore, the experimental results show that the reputation evaluation method in RI-PPDFL is reliable and can well evaluate the reputation size of honest clients and malicious clients in each iteration.

[0120] The second group was evaluated on contribution. Fig.17 The results of the honest client contribution evaluation under different data distributions, different poisoning ratios, and different poisoning attacks are shown. As can be seen from the figure, no matter what simulation experiment setting is used, the contribution value of the honest client will always increase with the increase in the number of iterations. Fig.18 The contribution value comparison between honest clients and malicious clients under different data distributions, different poisoning ratios, and non-targeted poisoning attacks is shown. Under different simulation experiment settings, although the contribution values ​​of malicious and honest clients increase with the increase in the number of iterations, the contribution value of malicious clients is significantly lower than that of honest clients. The experimental results show that the contribution evaluation method in RI-PPDFL is reliable.

[0121] The third group evaluated the rewards. Fig.19The comparison of the reward values ​​of honest clients and malicious clients under different data distributions and different poisoning ratios is shown. As can be seen from the figure, under different simulation experiments, the reward value of the honest client will increase with the increase of the number of iterations and is always positive, while the malicious client is the opposite. The experimental results show that the reward evaluation method in RI-PPDFL is reliable and fair.

[0122] The present invention provides a multi-client function encryption algorithm (IP-MCFE) supporting inner product, which provides strong privacy protection for federated learning. This algorithm can not only effectively protect the privacy of client data, but also perform function calculations securely between multiple clients.

[0123] In addition, the present invention also designs a client-side secret model quality detection method, which can effectively help identify malicious clients and resist Byzantine attacks. Through this method, the federated learning system can ensure the reliability and security of model training while protecting privacy.

[0124] In addition, the present invention introduces a dense incentive mechanism, including client reputation evaluation, contribution evaluation, and reward evaluation. These measures are intended to ensure that clients that provide high-quality data and actively participate in federated learning can receive appropriate rewards, thereby increasing the participation of more honest and high-quality data.

[0125] Finally, the present invention implements a blockchain-based Byzantine-tolerant decentralized privacy-preserving federated learning system (RI-PPDFL). Experimental results show that RI-PPDFL can not only achieve decentralization and privacy protection, but also tolerate Byzantine behavior, and promote the healthy development and participation of the system through incentive mechanisms. These characteristics make the system have important practical value in practical applications.

[0126] In summary, the present invention not only technically promotes privacy protection and security in the field of federated learning, but also provides an innovative solution for building a secure and efficient data sharing and collaboration platform.

Claims

1. A blockchain-based Byzantine-tolerant decentralized privacy-preserving federated learning system, characterized by: This is accomplished by following these steps: Step A. Blockchain system initialization: establish blockchain and initialize IPFS nodes, clients register accounts and deploy smart contracts, task issuers register accounts, publish tasks, set algorithm parameters and global model initialization, on-chain clients choose to participate, and upload participating client collections to the blockchain; Step B. Initialization of encryption algorithm: A multi-client function encryption algorithm supporting inner product is used for privacy protection. The number of clients participating in federated learning is determined according to the security parameters of the task issuer. KGC sets the public parameter pp, where KGC represents the key generation center. Step C. Key distribution: KGC generates the master private key msk and the client encryption key based on the public parameter pp and distribute it to the client through a secure channel; Step D. Local model training: The client downloads the last round of global model gradient ciphertext and requests the decryption key sk from KGC y , and use the decryption key sk y Decrypt the global model ciphertext to obtain the gradient plaintext, and then the client completes the local model update based on the local data set; Step E. Local model encryption: After the client completes local model training, it is normalized and encrypted using the encryption key sk i Encrypt the local model; Step F. Dense model detection: select m clients U′ with the highest reward value, U′ requests the decryption key from KGC, KGC returns the decryption key after verifying the legitimacy of the user, and client U′ calculates the cosine similarity between the current round local model gradient and the previous round global model gradient, which is used for dense model quality assessment; Step G. Model upload & aggregation: Classify and count the quality assessment results of the dense model according to the threshold set by the task issuer, divide the clients into "malicious" and "honest", and upload the detection results and local model gradient ciphertext to IPFS. The system aggregates the local model gradient ciphertext of the "honest client" as the global model gradient ciphertext; Step H Incentive Mechanism Evaluation: including client reputation evaluation, contribution evaluation and reward evaluation. The reputation value is calculated based on the client's "honesty" identification and subjective logic stored in IPFS, and then the contribution value and reward value are calculated based on the client's dense model quality evaluation results and uploaded to IPFS.

2. According to claim 1, a blockchain-based Byzantine-tolerant decentralized privacy-preserving federated learning system is characterized by: Step A is specifically as follows: A1: Initialize the blockchain to build the blockchain and initialize its IPFS node; A2: Register the account of the task issuer and publish the federated learning training task to the blockchain. The task issuer also needs to set the security parameters of the cryptographic algorithm, the hyperparameters of the model training, and initialize a global model W0. A3: Register the client account and choose whether to participate in the task, and upload the participating client set to the blockchain.

3. According to claim 1, a blockchain-based Byzantine-tolerant decentralized privacy-preserving federated learning system is characterized by: Step B is specifically as follows: B1: Based on the security parameters set by the task issuer and the number of clients n that initiate encryption key inquiries, the key generation center selects two secure prime numbers p′ and q′, and p=2p′+1 and q=2q′+1 are also two secure large prime numbers; B2: Then calculate N = pq and choose a secure and collision-resistant hash function In module N 2 The set of non-zero integers in the case; B3: Settings Select a public function And set the public parameters to pp = (N, H, X, L).

4. According to claim 1, a blockchain-based Byzantine-tolerant decentralized privacy-preserving federated learning system is characterized by: Step C is specifically as follows: C1: KGC has a variance of Integer Gaussian distribution with mean 0 Select an n×d dimensional matrix S as the master private key msk; C2: KGC takes each row of the master private key S matrix as the client u i The encryption key sk of (i∈[1,n]) i And distribute it to the client through a secure channel; C3: KGC records the client set U to which encryption keys are distributed.

5. According to claim 1, a blockchain-based Byzantine tolerant decentralized privacy-preserving federated learning system is characterized by: Step D is specifically as follows: D1: Client u i Call the IPFS smart contract to obtain the global model gradient ciphertext C(g t-1 )=ct l ; D2: Function decryption key query: client u i Choose a d-dimensional all-1 vector And send a function decryption key query to KGC. After receiving the query, KGC will determine whether it is a legitimate client based on the set U when it distributes the encryption key. If it is a legitimate client, KGC will calculate the function decryption key sk y =[ j’ y>] j∈[1,d] ,in is the column vector of S. Finally, KGC decrypts the function key sk y Return to client u i ,in represents an integer vector of d dimensions;​ D3: Model decryption: Client u i According to the formula Use the function obtained to decrypt the key sk y Decrypt the global model gradient ciphertext ct l To obtain the corresponding global model gradient plaintext g t-1 , then the client u i The global model gradient g based on the t-1th iteration t-1 And its local data set completes the local model update and obtains the local model gradient of the tth round And normalize it, Represents the global model gradient ciphertext ct l y-th power, L(·) is the public function selected by KGC, It means to hash the timestamp and then multiply it by the decryption key. l represents the current timestamp.

6. According to claim 1, a blockchain-based Byzantine tolerant decentralized privacy-preserving federated learning system is characterized by: Step E is as follows: take the i-th client u in the t-th iteration i For example, client u i After completing the local model training to obtain the local model of the current iteration and normalizing it, according to the formula Using encryption key sk i Calculate the corresponding local model ciphertext ct i,l , where sk i Represents an encryption key.

7. According to claim 1, a blockchain-based Byzantine tolerant decentralized privacy-preserving federated learning system is characterized by: Step F is specifically as follows: F1: The i-th client u in the t-th iteration i For example, RI-PPDFL first calls the smart contract to select m clients with the highest total reward value, and this client set is recorded as U'; F2: Secondly, client u j ∈U' chooses a The d-dimensional t-1th round global model W t-1 The matrix composed of Initiate a function decryption key query to KGC; F3: After receiving the query, KGC will determine whether it is a legitimate client based on the set U when it distributes the encryption key. If it is a legitimate client, it calculates the decryption key sk' j =[ i ,y i )] i ,in are the row vectors corresponding to Y and S respectively, and j∈[1,m]) and return sk' j To the corresponding client u j ∈U';​ F4: Then the client u j ∈U' According to the formula Among them, sk' i ∈sk' y , ct i,k,l ∈ct i,l as well as Calculate the client u in round t i The local model gradient With the previous round of global model gradient g t-1 The cosine similarity of .

8. According to claim 1, a blockchain-based Byzantine tolerant decentralized privacy-preserving federated learning system is characterized by: Step G is specifically as follows: G1: In the tth iteration, client u i ∈U obtains the hyperparameter threshold η set by the task issuer from the blockchain, and calculates the quality evaluation result of the dense model cos i (t) is classified and counted, when cos i (t)≤η, let τ i =0, indicating that the client u i is malicious, otherwise, let τ i =1, indicating that the client u i For an honest client, U * represents the set of honest clients; G2: All clients u j ∈U uploads the detection results and local model gradient ciphertext to IPFS; G3: Call the model aggregation smart contract according to the formula Calculate the global model gradient ciphertext C(g t ),in It means to hash the timestamp l and then multiply it by the decryption key.

9. According to claim 1, a blockchain-based Byzantine tolerant decentralized privacy-preserving federated learning system is characterized by: Step H is specifically as follows: H1: Client reputation evaluation. The client reputation evaluation method is designed based on the subjective logic model. It is assumed that the subjective logic value (a i , b i , c i ), where a i means "believe", i Means "don't believe", c i Indicates "uncertainty"; H1.1: In the tth iteration, the reputation evaluation smart contract deployed on the blockchain is based on the client u stored in IPFS I The logo of τ i Calculate the reputation value corresponding to the client; H1.2: When the client u i The corresponding τ i =1, P i =P i +1, when client u i The corresponding τ i =0, N i =N i +1, calculated later Where P i Represents honesty, N i Represents the degree of maliciousness; H1.3: The reputation evaluation smart contract is then called, according to the formula (j)e -λt , calculate the other clients u in round t i Reputation value R i (t); H2: Client contribution evaluation. In order to evaluate the contribution of each client to the final global model, in the tth iteration, the contribution evaluation smart contract deployed on the blockchain is based on the client u stored in IPFS. i The dense model detection result of (i∈[1,n]) cos i , according to formula C i (t) = 2(1 + cos i (t)), calculate the corresponding contribution value C i (t); H3: Client reward evaluation, based on the client’s reputation evaluation result R i (t) and the contribution evaluation result Ci(t) are used to calculate the reward that the client should receive. In the tth iteration, the reward evaluation smart contract deployed on the blockchain is based on the reputation value R i (t) and contribution value C i (t), according to the formula Calculate the client u in round t i Rewards I i (t).

Citation Information

Cited By

  • Anti-Byzantine privacy protection federal learning method and system based on block chain

    CN121396593A

  • A blockchain-based anti-byzantine privacy protection federated learning method and system

    CN121396593B