CN117474118A - A federated learning privacy protection method based on improved diffusion model - Google Patents

A federated learning privacy protection method based on improved diffusion model Download PDF

Info

Publication number
CN117474118A
CN117474118A CN202311205515.0A CN202311205515A CN117474118A CN 117474118 A CN117474118 A CN 117474118A CN 202311205515 A CN202311205515 A CN 202311205515A CN 117474118 A CN117474118 A CN 117474118A
Authority
CN
China
Prior art keywords
model
central server
noise
client
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311205515.0A
Other languages
Chinese (zh)
Inventor
任诚
雷靖鹏
王宇
李亚鑫
杨耀钧
袁方智
张江平
高劲松
苟豪锐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southwest Petroleum University
Original Assignee
Southwest Petroleum University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southwest Petroleum University filed Critical Southwest Petroleum University
Priority to CN202311205515.0A priority Critical patent/CN117474118A/en
Publication of CN117474118A publication Critical patent/CN117474118A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/098Distributed learning, e.g. federated learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Bioethics (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Medical Informatics (AREA)
  • Computer Security & Cryptography (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Databases & Information Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明涉及了用户的个人隐私信息保护,并且公开了一种基于改进扩散模型的联邦学习隐私保护方法,实现了对客户端本地模型的数据保护,包括以下步骤:步骤一:各个客户端接收中心服务器端分发的数据;步骤二:数据在N个客户端经过全部T次更新迭代,得到更新后的模型;步骤三:将客户端更新所得模型采用改进的Diffusion Model的深度神经网络进行加密编码,得到正向加密模型步骤四:将加密后的模型上传至中心服务器,并在中心服务器端对加密模型进行采样解码,对模型进行聚合更新,得到新一轮的全局模型,并将模型下发至客户端,进行下一轮联邦学习的模型的更新迭代。本发明主要应用于联邦学习通讯隐私保护的场合,同时也极大提高了联邦学习通讯效率。

The present invention relates to the protection of users' personal privacy information, and discloses a federated learning privacy protection method based on an improved diffusion model, which realizes data protection of client local models and includes the following steps: Step 1: Each client receiving center Data distributed by the server; Step 2: The data undergoes all T update iterations on N clients to obtain the updated model; Step 3: Update the model on the client The deep neural network of the improved Diffusion Model is used for encryption and encoding to obtain the forward encryption model. Step 4: Upload the encrypted model to the central server, sample and decode the encrypted model on the central server, aggregate and update the model, obtain a new round of global model, and deliver the model to the client for downloading. A round of updated iterations of the federated learning model. The invention is mainly used in privacy protection situations of federated learning communication, and at the same time, it also greatly improves the efficiency of federated learning communication.

Description

一种基于改进扩散模型的联邦学习隐私保护方法A federated learning privacy protection method based on improved diffusion model

技术领域Technical field

本发明涉及了用户的个人隐私信息保护,特别涉及目前联邦学习中的通讯隐私保护,采用最新的改进扩散模型的深度神经网络算法,提高了联邦学习的客户端隐私的保护程度,也极大提高了通讯效率。This invention relates to the protection of users' personal privacy information, and in particular to the protection of communication privacy in current federated learning. It adopts the latest deep neural network algorithm with an improved diffusion model, which improves the degree of client privacy protection in federated learning and greatly improves the protection level. Improve communication efficiency.

背景技术Background technique

随着当前的物联网设备日益增加,越来越多的分布式数据开始出现,并且深度学习在智能设备中取得了成功的应用,移动设备中数据的传输以及接收也日益密切,许多运营商也开始关注用户移动设备终端的深度学习框架,今年来也出现了许多移动终端的框架,比如:TensorFlow Lite,PyTorch Mobile,Caffe2,NCNN,MNN等。With the increasing number of current IoT devices, more and more distributed data are beginning to appear, and deep learning has been successfully applied in smart devices. The transmission and reception of data in mobile devices are becoming increasingly close, and many operators are also Beginning to pay attention to the deep learning framework of user mobile device terminals, many mobile terminal frameworks have appeared this year, such as: TensorFlow Lite, PyTorch Mobile, Caffe2, NCNN, MNN, etc.

在分布式数据系统中,数据通常会被分割成多个小块,每个小块会分别存储在不同的节点上。这些节点之间会通过网络互相通信,以协调数据的读取、写入、备份、恢复等操作。同时,分布式数据系统通常也提供了多种数据一致性和容错机制,以保证数据的正确性和可靠性。分布式数据可以应用于各种领域,如互联网搜索引擎、大规模数据分析、分布式存储系统、区块链等。它可以帮助企业和组织更好地管理和处理数据,提高数据处理的效率和质量,同时也可以降低数据存储和维护成本,提高系统的可扩展性和可靠性。In a distributed data system, data is usually divided into multiple small blocks, and each small block is stored on a different node. These nodes communicate with each other through the network to coordinate data reading, writing, backup, recovery and other operations. At the same time, distributed data systems usually provide a variety of data consistency and fault-tolerance mechanisms to ensure the correctness and reliability of data. Distributed data can be applied to various fields, such as Internet search engines, large-scale data analysis, distributed storage systems, blockchain, etc. It can help enterprises and organizations better manage and process data and improve the efficiency and quality of data processing. It can also reduce data storage and maintenance costs and improve the scalability and reliability of the system.

目前,联邦学习可以显著提高机器学习的速度和效率,尽管这样移动设备的分布式数据的存储或是传输都是受到威胁与挑战的,然而,随着移动设备与物联网技术的广泛应用,分布式机器学习的需求也不断增加。在这种情况下,如何保证移动设备上的数据隐私和安全成为了一个重要的问题。因为在传输过程中,数据可能会被黑客攻击或窃取,从而泄露用户的隐私信息。因此传统联邦学习框架在隐私保护上存在极大的漏洞,传统联邦学习具体框架如下:Currently, federated learning can significantly improve the speed and efficiency of machine learning. Although the storage or transmission of distributed data on mobile devices is threatened and challenged, however, with the widespread application of mobile devices and Internet of Things technology, distribution The demand for traditional machine learning is also increasing. In this case, how to ensure data privacy and security on mobile devices has become an important issue. Because during the transmission process, the data may be hacked or stolen, thereby leaking the user's private information. Therefore, the traditional federated learning framework has huge loopholes in privacy protection. The specific framework of traditional federated learning is as follows:

步骤一:选择参与者:从数据持有者中选择几个参与者,他们将参与到训练过程中。Step 1: Select participants: Select several participants from the data holders who will participate in the training process.

步骤二:模型初始化:在开始训练之前,需要初始化一个全局模型。Step 2: Model initialization: Before starting training, a global model needs to be initialized.

步骤三:参与者训练:每个参与者使用本地数据对模型进行训练。这可以是基于传统的机器学习算法,也可以是深度学习算法。Step 3: Participant training: Each participant uses local data to train the model. This can be based on traditional machine learning algorithms or deep learning algorithms.

步骤四:模型聚合:经过一定轮次的本地训练后,参与者将他们的模型参数上传到中央服务器,然后进行模型聚合。常见的聚合方法包括加权平均和梯度平均。Step 4: Model aggregation: After a certain round of local training, participants upload their model parameters to the central server, and then perform model aggregation. Common aggregation methods include weighted averaging and gradient averaging.

步骤五:更新全局模型:使用聚合后的模型参数来更新全局模型。Step 5: Update the global model: Use the aggregated model parameters to update the global model.

步骤六:重复迭代:重复以上步骤,直到达到预定的收敛条件或迭代次数。Step 6: Repeat iteration: Repeat the above steps until the predetermined convergence condition or number of iterations is reached.

因此对于目前联邦学习中的隐私保护存在的漏洞以及通讯效率这两个方面的问题,目前已经有大量的研究的改进方法。WANG等利用对抗生成网络(GenerativeAdversarial Networks,GAN)通过在服务器部署多任务生成对抗网络mGAN-AI,对数据的真伪、类别和归属用户进行判别,利用更新值重构参与者的典型数据。ZHU等发现恶意攻击者根据部分更新的梯度信息能够窃取原始训练数据。因此,采用基于差分隐私(DifferentialPrivacy,DP)、安全多方计算(Secure Multi-Party Computation,SMC)和同态加密(Homomorphic Encryption,HE)等技术保护梯度机密性的相关方案被提出。Therefore, there are currently a large number of research methods to improve the loopholes in privacy protection and communication efficiency in federated learning. WANG et al. used Generative Adversarial Networks (GAN) to deploy the multi-task generative adversarial network mGAN-AI on the server to determine the authenticity, category and user belonging of the data, and use the updated values to reconstruct the typical data of the participants. Zhu et al. found that malicious attackers can steal original training data based on partially updated gradient information. Therefore, related schemes have been proposed to protect gradient confidentiality based on technologies such as Differential Privacy (DP), Secure Multi-Party Computation (SMC) and Homomorphic Encryption (HE).

发明内容Contents of the invention

在现存的联邦学习存在的隐私保护漏洞问题以及通讯效率问题中,本发明旨在采用最新的改进的扩散模型深度神经网络算法,在加密数据模型阶段采用类马尔科夫决策过程,具体为接收中心服务器端分发的数据;数据在本地客户端经过全部T次更新迭代,得到更新后的模型将客户端更新所得模型/>采用改进的扩散模型的深度神经网络进行加密编码,在使用加密编码时采用对数极大似然的方法得到正向加密模型/>将加密后的模型上传至中心服务器,并在中心服务器端对加密模型进行采样解码,对模型进行聚合更新,得到新一轮的全局模型,并将模型下发至客户端,进行下一轮联邦学习的模型的更新迭代。Among the privacy protection loopholes and communication efficiency problems existing in the existing federated learning, the present invention aims to adopt the latest improved diffusion model deep neural network algorithm, and adopt a Markov-like decision-making process in the encrypted data model stage, specifically the receiving center Data distributed by the server; the data undergoes all T update iterations on the local client to obtain the updated model. Update the model obtained by the client/> The deep neural network of the improved diffusion model is used for encryption and encoding. When using encryption and encoding, the logarithmic maximum likelihood method is used to obtain the forward encryption model/> Upload the encrypted model to the central server, sample and decode the encrypted model on the central server, aggregate and update the model to obtain a new round of global model, and send the model to the client for the next round of federation Update iterations of the learned model.

为了实现上述联邦学习的高效通讯与隐私保护,本发明包括了以下步骤:In order to achieve the above-mentioned efficient communication and privacy protection of federated learning, the present invention includes the following steps:

步骤一:各个客户端接收中心服务器数据:起始中心服务器初始化全局模型w0,并将该全局模型广播给N个客户端,客户端本地更新迭代次数为r次,全局总体训练的次数为T次,改进式扩散模型深度神经网络(IDMN)加密层数为S层。Step 1: Each client receives central server data: the initial central server initializes the global model w 0 and broadcasts the global model to N clients. The number of client local update iterations is r, and the number of global overall training is T. times, the number of encryption layers of the improved diffusion model deep neural network (IDMN) is S layer.

步骤二:客户端更新模型数据:每个客户端将从中心服务器所接受的模型在本地进行r次的更新迭代,对于N个客户端,中心服务器广播了m个全局模型,对第N个客户端所更新的本地模型迭代后为 Step 2: Client updates model data: Each client will perform r update iterations locally from the model accepted by the central server. For N clients, the central server broadcasts m global models, and for the Nth client After iteration, the local model updated by the terminal is

步骤三:使用改进式扩散模型深度神经网络(IDMN)加密模型:设置IDMN的扩散模型层数为S层,给定一个数据分布x0~q(x0),定义一个前向噪声过程q,它通过在时间s添加方差βs∈(0,1)的高斯噪声来产生潜伏期xS~N(0,1)到xS,那么原本的扩散模型如下所示:Step 3: Use the improved diffusion model deep neural network (IDMN) encryption model: Set the number of diffusion model layers of IDMN to S layer, given a data distribution x 0 ~ q (x 0 ), define a forward noise process q, It generates the latency x S ~ N (0, 1) to x S by adding Gaussian noise with variance β s ∈ (0, 1) at time s. Then the original diffusion model is as follows:

给定足够大的S和表现较好的βs调度,潜在xS几乎是各向同性高斯分布。因此,如果知道确切的逆分布q(xs-1|xs),可以对xS~N(0,1)进行采样,并反向运行该过程以从q(x0)获得样本。由于q(xs-1|xs)取决于整个数据分布,使用神经网络对其进行近似,如下所示:Given a sufficiently large S and a well-performing β s schedule, the potential x S is almost isotropically Gaussian. Therefore, if the exact inverse distribution q(x s-1 |x s ) is known, one can sample x S ~N(0,1) and run the process in reverse to obtain samples from q(x 0 ). Since q(x s-1 |x s ) depends on the entire data distribution, it is approximated using a neural network as follows:

pθ(xs-1|xs):=N(xs-1;μθ(xs,s),∑θ(xs,s)) (3)p θ (x s-1 |x s ):=N(x s-1θ (x s ,s),∑ θ (x s ,s)) (3)

q和p的组合是变分自动编码器,因此可以将变分下界(VLB)写成如下:The combination of q and p is a variational autoencoder, so the variational lower bound (VLB) can be written as follows:

Lvlb:=L0+L1+...+LS-1+LS (4)L vlb :=L 0 +L 1 +...+L S-1 +L S (4)

L0:=-logpθ(x0|x1) (5)L 0 :=-logp θ (x 0 |x 1 ) (5)

Ls-1:=DKL(q(xs-1|xs,x0)||pθ(xs-1|xs)) (6)L s-1 :=D KL (q(x s-1 |x s ,x 0 )||pθ(x s-1 |x s )) (6)

LS:=DKL(q(xS|x0)||p(xS)) (7)L S :=D KL (q(x S |x 0 )||p(x S )) (7)

除了L0之外,公式4的每个项是两个高斯分布之间的KL散度,并且因此可以以封闭形式进行评估。为了评估模型的L0,将中心服务器广播到300个客户端,并且计算pθ(x0|x1)。With the exception of L0 , each term of Equation 4 is the KL divergence between two Gaussian distributions and can therefore be evaluated in closed form. To evaluate L 0 of the model, the central server is broadcast to 300 clients, and p θ (x 0 |x 1 ) is calculated.

将公式2中定义的噪声处理允许直接以输入x0为条件的噪声潜伏的任意步骤进行采样。当αs:=1-βt以及时,边缘分布可以写为:The noise processing defined in Equation 2 allows sampling of arbitrary steps of noise latency directly conditioned on the input x 0 . When α s :=1-β t and When , the marginal distribution can be written as:

同时使用贝叶斯定理,在计算之后检验q(xs-1|xs,x0),用来表示其中定义如下:Also use Bayes' theorem to check q(x s-1 |x s ,x 0 ) after calculation, using and to express which is defined as follows:

这里具体阐述本发明中IDMN所采用最大似然提高联邦学习的隐私保护性能以及联邦学习的通讯效率的改进算法,可以通过该深度神经网络预测添加到x0的噪声ε,如下所示:Here is a detailed description of the improved algorithm of maximum likelihood used by IDMN in the present invention to improve the privacy protection performance of federated learning and the communication efficiency of federated learning. The noise ε added to x 0 can be predicted through this deep neural network, as shown below:

与重新加权的损失函数相结合后,定义一个新的损失函数LsimpleAfter combining with the reweighted loss function, a new loss function L simple is defined:

这个损失函数可以看作是Lvlb的重加权形式。通过优化这个重新加权的目标比直接优化Lvlb的结果准确度高得多。此外,IDMN相比原扩散模型改变了扩散的步数,极大减少了加密模型所需的时间。This loss function can be viewed as a reweighted form of L vlb . The results obtained by optimizing this reweighted objective are much more accurate than directly optimizing L vlb . In addition, IDMN changes the number of diffusion steps compared to the original diffusion model, which greatly reduces the time required to encrypt the model.

因为在扩散模型中前几步加噪对变分下界起到了决定性的作用,因此这里定义了学习效果量∑θ(xs,s)以此来改进对数似然,其中v作为模型预测的插值,计算方法如下:Because adding noise in the first few steps of the diffusion model plays a decisive role in the variational lower bound, the learning effect quantity Σ θ (x s , s) is defined here to improve the log likelihood, where v is used as the model prediction Interpolation is calculated as follows:

因为上述公式13中的损失函数Lhybrid不受∑θ(xs,s)的影响,因此这里再次定义一个损失函数Lhybrid,并且设置λ=0.001来减少Lvlb所带来的影响计算方法如下:Because the loss function L hybrid in the above formula 13 is not affected by ∑ θ (x s , s), a loss function L hybrid is defined again here, and λ=0.001 is set to reduce the impact of L vlb . The calculation method is as follows :

Lhybrid=Lsimple+λLvlb (15)L hybrid =L simple +λL vlb (15)

另外,在此基础上构建了一个效果更好的噪声时间表,利用余弦函数在优化目标函数更加灵活的条件下,设置相关噪声参数和函数f(s)的计算方式如下:In addition, a better noise schedule is constructed on this basis, and the cosine function is used to set the relevant noise parameters under the conditions of more flexible optimization of the objective function. The sum function f(s) is calculated as follows:

步骤四:将通过IDMN加密后的模型上传至中心服务器,首先在中心服务器端进行采样解码,具体方式如下:Step 4: Upload the model encrypted by IDMN to the central server. First, sample and decode on the central server. The specific method is as follows:

因为在步骤三中,由公式16定义方差βs,同时让方差βs的值不超过0.999,避免在s=S附近扩散时出现奇点,方差βs计算方式如下:Because in step 3, the variance β s is defined by Formula 16, and the value of the variance β s should not exceed 0.999 to avoid singular points when spreading near s=S. The calculation method of the variance β s is as follows:

因为在模型加密阶段,本发明所采用的方法在保证联邦学习的模型隐私保护的同时,以减少扩散模型加密层数S的方式提高了联邦学习的通讯效率,那么在反向采样解码阶段,对于用S个扩散步骤训练的模型,通常将使用相同的s值序列(1,2,…S)在训练中使用。然而,也可以使用s个值的任意子序列A进行采样。给定训练噪声调度对于给定序列A,可以获得采样噪声调度/>然后可以使用采样噪声调度/>来获得对应的采样方差/>具体计算方式如下:Because in the model encryption stage, the method adopted by the present invention not only ensures the privacy protection of the federated learning model, but also improves the communication efficiency of federated learning by reducing the number of encryption layers S of the diffusion model. Then, in the reverse sampling decoding stage, for A model trained with S diffusion steps will typically use the same sequence of s values (1, 2,...S) used in training. However, it is also possible to sample using any subsequence A of s values. Given training noise schedule For a given sequence A, a sampled noise schedule can be obtained/> You can then use sampled noise scheduling/> To obtain the corresponding sampling variance/> and The specific calculation method is as follows:

在经过上述计算反向采样解码之后,中心服务器对所有客户端上传的模型wi进行聚合更新,从而在中心服务器生成新一轮的全局模型,进而将该全局模型又进行下发,广播到各个客户端,进行下一轮的联邦学习数据模型的迭代更新,即是重复上述步骤的计算。After the above calculation and reverse sampling decoding, the central server aggregates and updates the models w i uploaded by all clients, thereby generating a new round of global models on the central server, and then delivers the global model and broadcasts it to each The client performs the next round of iterative updates of the federated learning data model, which means repeating the calculations of the above steps.

因此本发明通过上述计算将扩散模型加密层数由原本的S步缩短到A步,不论是前向加密模型过程,还是反向采样解码的过程,都极大地缩短了扩散层数,这也说明了本发明的联邦学习的隐私保护方法在确保客户端隐私保护的同时,又提高了联邦学习的通讯效率。Therefore, the present invention shortens the number of encryption layers of the diffusion model from the original S steps to A steps through the above calculations. Whether it is the forward encryption model process or the reverse sampling decoding process, the number of diffusion layers is greatly shortened. This also shows that The privacy protection method of federated learning of the present invention not only ensures client privacy protection, but also improves the communication efficiency of federated learning.

目前的联邦学习隐私保护技术大多都只考虑了单方面对客户端数据的保护,而缺乏了对联邦学习很重要的通讯效率的提升,因此本发明通过采用IDMN这一改进的深度神经网络的算法,通过改进传统的添加噪声与方差的方法,改进噪声数据中的对数最大似然,对传统的扩散模型的损失函数做出了相关的改进,控制了变分下界损失函数,以及模型训练的学习方法,减少了模型加密以及反向采样解密的步数,由此提高了联邦学习的隐私保护的通讯效率,建立了联邦学习的隐私保护的模型,防止由于梯度反向传播推导的方式来获取联邦学习的网络中传递的模型的信息。Most of the current federated learning privacy protection technologies only consider the unilateral protection of client data, but lack the improvement of communication efficiency, which is important for federated learning. Therefore, the present invention adopts IDMN, an improved deep neural network algorithm. , by improving the traditional method of adding noise and variance, improving the logarithmic maximum likelihood in noisy data, making relevant improvements to the loss function of the traditional diffusion model, controlling the variational lower bound loss function, and the model training The learning method reduces the number of steps for model encryption and reverse sampling decryption, thereby improving the communication efficiency of federated learning's privacy protection, and establishing a privacy-protecting model for federated learning to prevent acquisition due to gradient backpropagation derivation. The model information is passed in the federated learning network.

附图说明Description of the drawings

图1为一种基于改进的扩散模型的联邦学习隐私保护方法框架图。Figure 1 is a framework diagram of a federated learning privacy protection method based on an improved diffusion model.

图2为一种基于改进的扩散模型的联邦学习隐私保护方法模型训练流程图。Figure 2 is a model training flow chart of a federated learning privacy protection method based on an improved diffusion model.

图3为本发明FedIDMN算法对比了传统的联邦学习算法FedAvg算法在数据模型在独立同步分布(IID)与非独立同分布(no-IID)的条件下,分别在CIFAR-10数据集与MNIST数据集下的模型训练后的准确率。Figure 3 shows the comparison of the FedIDMN algorithm of the present invention with the traditional federated learning algorithm FedAvg algorithm under the conditions of independent synchronous distribution (IID) and non-independent and identical distribution (no-IID) of the data model, respectively in the CIFAR-10 data set and MNIST data. The accuracy of the model after training in the set.

具体实施方式Detailed ways

本发明通过提出了一种改进的扩散模型的联邦学习隐私保护方法,采用扩散模型加密模型的IDMN算法,比传统联邦学习的隐私保护算法有更大的优势,不仅在传统联邦学习算法的基础上提高了隐私保护性能,又加快了联邦学习中最重要的通讯效率。此外,又由于大多数传统联邦学习算法存在太多的局限性,通过加入噪声干扰以梯度反向传播的方式来保护模型数据隐私,但是在解码的过程中又不能以更高的准确率来还原至原有的模型数据,同样也影响了联邦学习中数据模型的准确率,不能做到既提高联邦学习的通讯效率,同时又做到更好地提供数据模型隐私的保护,难以做到完全兼顾。故考虑到联邦学习中的多种因素,本发明综合这些影响因素,提出了以IDMN算法为核心的改进的扩散模型的联邦学习隐私保护方法。The present invention proposes an improved diffusion model federated learning privacy protection method and adopts the IDMN algorithm of the diffusion model encryption model, which has greater advantages than the traditional federated learning privacy protection algorithm. Not only on the basis of the traditional federated learning algorithm It improves privacy protection performance and speeds up the most important communication efficiency in federated learning. In addition, because most traditional federated learning algorithms have too many limitations, model data privacy is protected by adding noise interference and gradient backpropagation, but it cannot be restored with higher accuracy during the decoding process. The original model data also affects the accuracy of the data model in federated learning. It is impossible to improve the communication efficiency of federated learning and at the same time better protect the privacy of the data model. It is difficult to completely balance it. . Therefore, taking into account various factors in federated learning, the present invention combines these influencing factors and proposes a federated learning privacy protection method with an improved diffusion model as the core of the IDMN algorithm.

本发明在训练IDMN算法的模型时使用CIFAR-10数据集以及MNIST数据集,使用60000个数据划分为200组大小为300的数据切片,然后在给每个客户端划分数据切片,并且考虑到联邦学习中数据的非独立同分布的情况,对数据切片的划分进行随机性划分,保证本发明应用在联邦学习的隐私保护实际场景下。This invention uses the CIFAR-10 data set and the MNIST data set when training the model of the IDMN algorithm, uses 60,000 data to divide it into 200 groups of data slices with a size of 300, and then divides the data slices for each client, and takes into account the federation In the case of non-independent and identically distributed data during learning, the data slices are divided randomly to ensure that the present invention is applied in the actual privacy protection scenario of federated learning.

具体实施步骤如下:The specific implementation steps are as follows:

步骤一:各个客户端接收中心服务器数据:起始中心服务器初始化全局模型w0,并将该全局模型广播给N个客户端,客户端本地更新迭代次数为r次,全局总体训练的次数为T次,改进式扩散模型深度神经网络(IDMN)加密层数为S层。Step 1: Each client receives central server data: the initial central server initializes the global model w 0 and broadcasts the global model to N clients. The number of client local update iterations is r, and the number of global overall training is T. times, the number of encryption layers of the improved diffusion model deep neural network (IDMN) is S layer.

步骤二:客户端更新模型数据:每个客户端将从中心服务器所接受的模型在本地进行r次的更新迭代,对于N个客户端,中心服务器广播了m个全局模型,对第N个客户端所更新的本地模型迭代后为 Step 2: Client updates model data: Each client will perform r update iterations locally from the model accepted by the central server. For N clients, the central server broadcasts m global models, and for the Nth client After iteration, the local model updated by the terminal is

步骤三:使用改进式扩散模型深度神经网络(IDMN)加密模型:设置IDMN的扩散模型层数为S层,给定一个数据分布x0~q(x0),定义一个前向噪声过程q,它通过在时间s添加方差βs∈(0,1)的高斯噪声来产生潜伏期xS~N(0,1)到xS,那么原本的扩散模型如下所示:Step 3: Use the improved diffusion model deep neural network (IDMN) encryption model: Set the number of diffusion model layers of IDMN to S layer, given a data distribution x 0 ~ q (x 0 ), define a forward noise process q, It generates the latency x S ~ N (0, 1) to x S by adding Gaussian noise with variance β s ∈ (0, 1) at time s. Then the original diffusion model is as follows:

给定足够大的S和表现较好的βs调度,潜在xS几乎是各向同性高斯分布。因此,如果知道确切的逆分布q(xs-1|xs),可以对xS~N(0,1)进行采样,并反向运行该过程以从q(x0)获得样本。由于q(xs-1|xs)取决于整个数据分布,使用神经网络对其进行近似,如下所示:Given a sufficiently large S and a well-performing β s schedule, the potential x S is almost isotropically Gaussian. Therefore, if the exact inverse distribution q(x s-1 |x s ) is known, one can sample x S ~N(0,1) and run the process in reverse to obtain samples from q(x 0 ). Since q(x s-1 |x s ) depends on the entire data distribution, it is approximated using a neural network as follows:

pθ(xs-1|xs):=N(xs-1;μθ(xs,s),∑θ(xs,s)) (3)p θ (x s-1 |x s ):=N(x s-1θ (x s ,s),∑ θ (x s ,s)) (3)

q和p的组合是变分自动编码器,因此可以将变分下界(VLB)写成如下:The combination of q and p is a variational autoencoder, so the variational lower bound (VLB) can be written as follows:

Lvlb:=L0+L1+...+LS-1+LS (4)L vlb :=L 0 +L 1 +...+L S-1 +L S (4)

L0:=-logpθ(x0|x1) (5)L 0 :=-logp θ (x 0 |x 1 ) (5)

Ls-1:=DKL(q(xs-1|xs,x0)||pθ(xs-1|xs)) (6)L s-1 :=D KL (q(x s-1 |x s ,x 0 )||pθ(x s-1 |x s )) (6)

LS:=DKL(q(xS|x0)||p(xS)) (7)L S :=D KL (q(x S |x 0 )||p(x S )) (7)

除了L0之外,公式4的每个项是两个高斯分布之间的KL散度,并且因此可以以封闭形式进行评估。为了评估模型的L0,将中心服务器广播到300个客户端,并且计算pθ(x0|x1)。With the exception of L0 , each term of Equation 4 is the KL divergence between two Gaussian distributions and can therefore be evaluated in closed form. To evaluate L 0 of the model, the central server is broadcast to 300 clients, and p θ (x 0 |x 1 ) is calculated.

将公式2中定义的噪声处理允许直接以输入x0为条件的噪声潜伏的任意步骤进行采样。当αs:=1-βt以及时,边缘分布可以写为:The noise processing defined in Equation 2 allows sampling of arbitrary steps of noise latency directly conditioned on the input x 0 . When α s :=1-β t and When , the marginal distribution can be written as:

同时使用贝叶斯定理,在计算之后检验q(xs-1|xs,x0),用来表示其中定义如下:Also use Bayes' theorem to check q(x s-1 |x s ,x 0 ) after calculation, using and to express which is defined as follows:

这里具体阐述本发明中IDMN所采用最大似然提高联邦学习的隐私保护性能以及联邦学习的通讯效率的改进算法,可以通过该深度神经网络预测添加到x0的噪声ε,如下所示:Here is a detailed description of the improved algorithm of maximum likelihood used by IDMN in the present invention to improve the privacy protection performance of federated learning and the communication efficiency of federated learning. The noise ε added to x 0 can be predicted through this deep neural network, as shown below:

与重新加权的损失函数相结合后,定义一个新的损失函数LsimpleAfter combining with the reweighted loss function, a new loss function L simple is defined:

这个损失函数可以看作是Lvlb的重加权形式。通过优化这个重新加权的目标比直接优化Lvlb的结果准确度高得多。此外,IDMN相比原扩散模型改变了扩散的步数,极大减少了加密模型所需的时间。This loss function can be viewed as a reweighted form of L vlb . The results obtained by optimizing this reweighted objective are much more accurate than directly optimizing L vlb . In addition, IDMN changes the number of diffusion steps compared to the original diffusion model, which greatly reduces the time required to encrypt the model.

因为在扩散模型中前几步加噪对变分下界起到了决定性的作用,因此这里定义了学习效果量∑θ(xs,s)以此来改进对数似然,其中v作为模型预测的插值,计算方法如下:Because adding noise in the first few steps of the diffusion model plays a decisive role in the variational lower bound, the learning effect quantity Σ θ (x s , s) is defined here to improve the log likelihood, where v is used as the model prediction Interpolation is calculated as follows:

因为上述公式13中的损失函数Lhybrid不受∑θ(xs,s)的影响,因此这里再次定义一个损失函数Lhybrid,并且设置λ=0.001来减少Lvlb所带来的影响计算方法如下:Because the loss function L hybrid in the above formula 13 is not affected by ∑ θ (x s , s), a loss function L hybrid is defined again here, and λ=0.001 is set to reduce the impact of L vlb . The calculation method is as follows :

Lhybrid=Lsimple+λLvlb (15)L hybrid =L simple +λL vlb (15)

另外,在此基础上构建了一个效果更好的噪声时间表,利用余弦函数在优化目标函数更加灵活的条件下,设置相关噪声参数和函数f(s)的计算方式如下:In addition, a better noise schedule is constructed on this basis, and the cosine function is used to set the relevant noise parameters under the conditions of more flexible optimization of the objective function. The sum function f(s) is calculated as follows:

步骤四:将通过IDMN加密后的模型上传至中心服务器,首先在中心服务器端进行采样解码,具体方式如下:Step 4: Upload the model encrypted by IDMN to the central server. First, sample and decode on the central server. The specific method is as follows:

因为在步骤三中,由公式16定义方差βs,同时让方差βs的值不超过0.999,避免在s=S附近扩散时出现奇点,方差βs计算方式如下:Because in step 3, the variance β s is defined by Formula 16, and the value of the variance β s should not exceed 0.999 to avoid singular points when spreading near s=S. The calculation method of the variance β s is as follows:

因为在模型加密阶段,本发明所采用的方法在保证联邦学习的模型隐私保护的同时,以减少扩散模型加密层数S的方式提高了联邦学习的通讯效率,那么在反向采样解码阶段,对于用S个扩散步骤训练的模型,通常将使用相同的s值序列(1,2,…S)在训练中使用。然而,也可以使用s个值的任意子序列A进行采样。给定训练噪声调度对于给定序列A,可以获得采样噪声调度/>然后可以使用采样噪声调度/>来获得对应的采样方差/>具体计算方式如下:Because in the model encryption stage, the method adopted by the present invention not only ensures the privacy protection of the federated learning model, but also improves the communication efficiency of federated learning by reducing the number of encryption layers S of the diffusion model. Then, in the reverse sampling decoding stage, for A model trained with S diffusion steps will typically use the same sequence of s values (1, 2,...S) used in training. However, it is also possible to sample using any subsequence A of s values. Given training noise schedule For a given sequence A, a sampled noise schedule can be obtained/> You can then use sampled noise scheduling/> To obtain the corresponding sampling variance/> and The specific calculation method is as follows:

在经过上述计算反向采样解码之后,中心服务器对所有客户端上传的模型wi进行聚合更新,从而在中心服务器生成新一轮的全局模型,进而将该全局模型又进行下发,广播到各个客户端,进行下一轮的联邦学习数据模型的迭代更新,即是重复上述步骤的计算。After the above calculation and reverse sampling decoding, the central server aggregates and updates the models w i uploaded by all clients, thereby generating a new round of global models on the central server, and then delivers the global model and broadcasts it to each The client performs the next round of iterative updates of the federated learning data model, which means repeating the calculations of the above steps.

Claims (2)

1. The federal learning privacy protection method based on the improved diffusion model is characterized by comprising the following steps of: in order to realize the efficient communication and privacy protection of the federal study, the invention comprises the following steps:
step one: each client receives central server data: the origin center server initializes the global model w 0 Broadcasting the global model to N clients, wherein the local updating iteration times of the clients are r times, the global overall training times are T times, and the encryption layer number of an improved diffusion model deep neural network (IDMN) is S;
step two: the client updates the model data: each client performs r updating iterations locally on the model received from the central server, and for N clients, the central server broadcasts m global models, and for N clients, the local model updated by the central server is
Step three: an improved diffusion model deep neural network (IDMN) encryption model is used: setting the diffusion model layer number of the IDMN as an S layer, and giving a data distribution x 0 ~q(x 0 ) Defining a forward noise process q by adding a variance beta at time s s Gaussian noise of e (0, 1) to generate latency x S -N (0, 1) to x S Then the original diffusion model is as follows:
given a sufficiently large S and a well behaved beta s Scheduling, potential x S Is an almost isotropic gaussian distribution, so if the exact inverse distribution q (x s-1 |x s ) Can be relative to x S N (0, 1) and run the process in reverse to go from q (x) 0 ) Samples are obtained, since q (x s-1 |x s ) Depending on the overall data distribution, it is approximated using a neural network, as follows:
p θ (x s-1 |x s ):=N(x s-1 ;μ θ (x s ,s),∑ θ (x s ,s)) (3)
the combination of q and p is a variant automatic encoder, so the Variant Lower Bound (VLB) can be written as follows:
L vlb :=L 0 +L 1 +...+L S-1 +L S (4)
L 0 :=-log p θ (x 0 |x 1 ) (5)
L s-1 :=D KL (q(x s-1 |x s ,x 0 )||p θ (x s-1 |x s )) (6)
L S :=D KL (q(x S |x 0 )||p(x S )) (7)
in addition to L 0 Besides, each term of equation 4 is the KL divergence between two Gaussian distributions, and thus can be evaluated in a closed form, in order to evaluate the L of the model 0 Broadcasting a central server to 300 clients and calculating p θ (x 0 |x 1 );
The noise processing defined in equation 2 allows direct input of x 0 Sampling is performed for any step of conditional noise latency, when alpha s :=1-β t AndWhen the edge distribution can be written as:
while using bayesian theorem, q (x s-1 |x s ,x 0 ) By usingAnd->To represent the following definitions therein:
the improved algorithm for improving the privacy protection performance of the federal learning and the communication efficiency of the federal learning by using the maximum likelihood of the IDMN in the invention is specifically described herein, and can be added to x through the deep neural network prediction 0 Is shown below:
in combination with the re-weighted loss function, a new loss function L is defined simple
This loss function may beTo be regarded as L vlb Directly optimizing L by optimizing this re-weighted target ratio vlb The result accuracy of (2) is much higher, in addition, the IDMN changes the step number of diffusion compared with the original diffusion model, so that the time required by the encryption model is greatly reduced;
since the first few steps of noise addition in the diffusion model play a decisive role in the lower bound of variation, the learning effect amount Σ is defined here θ (x s S) to improve the log likelihood, where v is interpolated as model prediction, the calculation method is as follows:
because of the loss function L in the above equation 13 hybrid Is not subjected to sigma θ (x s S), a loss function L is thus defined again hybrid And λ=0.001 is set to reduce L vlb The influence calculation method is as follows:
L hybrid =L simple +λL vlb (15)
in addition, a noise time table with better effect is constructed on the basis, and relevant noise parameters are set by using a cosine function under the condition of more flexible optimization of an objective functionThe sum function f(s) is calculated as follows:
step four: uploading the model encrypted by the IDMN to a central server, and firstly, sampling and decoding at the central server side, wherein the specific mode is as follows:
because in step three the variance β is defined by equation 16 s Let the variance beta at the same time s The value of (2) is not more than 0.999, singular points are avoided when diffusion is carried out near s=s, and the variance beta is avoided s The calculation method is as follows:
because the method adopted by the invention improves the communication efficiency of federal learning in a mode of reducing the diffusion model encryption layer number S while ensuring the privacy protection of the federal learning model in the model encryption stage, the same S value sequence (1, 2, … S) is usually used in training for the model trained by S diffusion steps in the reverse sampling decoding stage, however, any subsequence A of S values can also be used for sampling, and the training noise scheduling is givenFor a given sequence A, a sampling noise schedule can be obtained>Sampling noise scheduling can then be used>To obtain the corresponding sampling variance->And->The specific calculation mode is as follows:
after the above-mentioned calculation and inverse sampling decoding, the central server uploads the model w to all clients i Performing aggregation update to generate a new round of global model at the central server, further issuing the global model, broadcasting the global model to each client, performing iterative update of the federal learning data model of the next round,i.e. the calculation of repeating the above steps.
2. A federal learning privacy protection method based on an improved diffusion model as claimed in claim 1, wherein in the IDMN algorithm of the present invention, step one: each client receives data distributed by a central server;
step two: the data is subjected to all T updating iterations in N clients to obtain an updated model
Step three: updating the client with the obtained modelEncryption coding is carried out by adopting a depth neural network of an improved diffusion model, so that a forward encryption model is obtained>
Step four: uploading the encrypted model to a central server, sampling and decoding the encrypted model at the central server, aggregating and updating the model to obtain a new round of global model, and transmitting the model to a client to perform updating iteration of the model of the next round of federal learning.
CN202311205515.0A 2023-09-18 2023-09-18 A federated learning privacy protection method based on improved diffusion model Pending CN117474118A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311205515.0A CN117474118A (en) 2023-09-18 2023-09-18 A federated learning privacy protection method based on improved diffusion model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311205515.0A CN117474118A (en) 2023-09-18 2023-09-18 A federated learning privacy protection method based on improved diffusion model

Publications (1)

Publication Number Publication Date
CN117474118A true CN117474118A (en) 2024-01-30

Family

ID=89622863

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311205515.0A Pending CN117474118A (en) 2023-09-18 2023-09-18 A federated learning privacy protection method based on improved diffusion model

Country Status (1)

Country Link
CN (1) CN117474118A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117910601A (en) * 2024-03-20 2024-04-19 浙江大学滨江研究院 Personalized federal potential diffusion model learning method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117910601A (en) * 2024-03-20 2024-04-19 浙江大学滨江研究院 Personalized federal potential diffusion model learning method and system

Similar Documents

Publication Publication Date Title
Balle et al. Privacy amplification via random check-ins
Liu et al. Privacy-enhanced federated learning against poisoning adversaries
Besser et al. Wiretap code design by neural network autoencoders
CN115841133A (en) Method, device and equipment for federated learning and storage medium
Manohar et al. Data encryption & decryption using steganography
CN115310121A (en) Real-time reinforcement federated learning data privacy security method based on MePC-F model in the Internet of Vehicles
CN113298268A (en) Vertical federal learning method and device based on anti-noise injection
Qu et al. Analysis and Improvement of Steganography Protocol Based on Bell States in Noise Environment.
CN115643105B (en) Federal learning method and device based on homomorphic encryption and depth gradient compression
CN117474118A (en) A federated learning privacy protection method based on improved diffusion model
Nguyen et al. An efficient federated learning framework for training semantic communication systems
CN115510472B (en) A multiple differential privacy protection method and system for cloud-side aggregation system
CN117749324A (en) Image semantic communication method based on federal learning
CN116070277B (en) Longitudinal federal learning privacy protection method and system based on deep hash
CN116226901A (en) Adaptive Top-k Disturbance Shuffle Federated Learning Method and System Based on Differential Privacy
Jiao et al. A Differential Privacy Federated Learning Scheme Based on Adaptive Gaussian Noise.
Yan et al. Layered randomized quantization for communication-efficient and privacy-preserving distributed learning
CN117171814B (en) Federal learning model integrity verification method, system, equipment and medium based on differential privacy
Sasidharan et al. Private data access in blockchain systems employing coded sharding
CN115062331B (en) A privacy-preserving deep learning method based on additive homomorphic encryption
CN114465722B (en) Information processing method, apparatus, device, storage medium, and program product
Sanon et al. Cross-Silo Horizontal Federated Learning Methods in Network Traffic Analysis
CN116303002A (en) Heterogeneous software defect prediction algorithm based on top-k communication efficient federated learning
Chen et al. Crowdlearning: Crowded deep learning with data privacy
Prabhakaran et al. On the role of interaction between sensors in the CEO problem

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination