Privacy-Preserving Asynchronous Federated Learning under Non-IID settings——非独立同分布下的异步联邦学习隐私保护

来源

导读

Abstract

Existing privacy-preserving asynchronous FL schemes still suffer from the problem of low model accuracy caused by inconsistency between delayed model updates and current model updates, and even cannot adapt well to Non-Independent and Identically Distributed (Non-IID) settings.

  • 为了解决分布式机器学习中数据孤岛和异构性带来的挑战,保护隐私的异步联邦学习(FL)在学术和工业领域得到了广泛的探索。然而,现有的保护隐私的异步FL方案仍然存在延迟模型更新与当前模型更新不一致导致的模型精度低的问题,甚至不能很好地适应非独立和同分布(Non-IID)的设置。本文中数据为独立但非同分布的
  • 为了解决这些问题,本文提出了一种基于交替方向乘子方法的隐私保护异步联邦学习(PAFed),该方法能够在Non-IID设置中实现高精度模型。
  • 具体而言,本文利用向量投影技术来纠正延迟模型更新与当前模型更新之间的不一致性,从而减少延迟模型更新对当前模型更新聚合的影响。此外,采用了一种基于交替方向乘子法的优化方法来适应Non-IID设置,以进一步提高模型的全局精度。

INTRODUCTION

However, even if FL does not leak client-side local data, the model may still be vulnerable to inference attacks. Moreover, compared with traditional central learning, FL has many client groups and limited communication resources, which often causes asynchronous update, resulting in a decrease in model accuracy.

  • 即使联邦学习不泄漏客户端本地数据,该模型仍然可能容易受到推理攻击。此外,与传统的集中学习相比,联邦学习的客户群体多,通信资源有限,往往导致异步更新,导致模型精度下降。

However, existing privacypreserving asynchronous FL solutions still face many problems in practical applications.

The first problem is that existing privacy-preserving asynchronous FL still has the problem of conflicts between delayed model updates and current model updates, resulting in a decrease in global model accuracy.

  • 第一个问题是现有的保护隐私的异步联邦学习仍然存在延迟模型更新与当前模型更新冲突的问题,导致全局模型精度下降。因为网络延迟等问题存在,一些本地网络会延迟发送本地模型更新
  • 具体来说,在异步环境中,服务器在执行参数聚合时,可能会在不同的时间段接收来自不同客户端的模型更新。随着延迟轮数的增加,延迟客户机的模型更新方向可能会出现显著差异,从而影响全局模型精度。
  • 然而,模型精度降低的根本问题是延迟模型更新与当前模型更新的方向不一致。具体来说,当延迟模型更新与当前模型更新之间存在冲突,且两次模型更新的大小有显著差异时,梯度值越大,对聚合梯度的影响就越大,与全局最优值的偏差就越大。
  • 因此,解决延迟模型更新方向不一致的问题对于缓解延迟和当前更新之间的冲突,最终提高异步联邦学习系统的整体效率。

The second problem is that the existing privacy-preserving
asynchronous FL still cannot adapt well to Non-IID settings,
thereby affecting the model accuracy.

  • 第二个问题是现有的隐私保护异步联邦学习仍然不能很好地适应Non-IID设置,从而影响模型的准确性。
  • 在实际场景中,大量的客户端组导致本地数据分布经常出现Non-IID设置,客户端之间的本地模型参数可能存在较大差异。在异步环境中,客户机模型更新之间的差异可能更加突出,从而导致聚合全局模型的准确性降低。许多同步联邦学习下的解决方案并不能很好地应用到异步环境下。
  • 同态加密(HE)、安全多方计算(SMC)和差分隐私(DP)在异步通信中得到了广泛的应用。但这些方法都有一些问题,SME会导致通信效率降低,DP因注入噪声会降低模型精度,HE因为单密钥存在安全问题。
  • 本文提出了一种Non-IID环境中的高精度隐私保护异步联邦学习(PAFed)。
  • 为了解决延迟模型更新与当前模型更新之间的冲突,我们利用梯度方向来识别延迟更新,并利用向量投影技术来调整延迟更新的方向,从而使其更接近当前平均更新。 其次,本文基于交替方向乘子方法优化损失函数,以适应数据的异质性。
  • 采用多密钥隐私保护框架,有效防止本地数据泄露,解决单密钥HE机制导致的低隐私安全性问题。

PRELIMINARIES

In this section, we introduce the goals of FL, and then
introduce the principles of the Alternating Direction Method of Multipliers (ADMM) and Cheon-Kim-Kim-Song (CKKS)
homomorphic encryption.

  • 在本节中,本文将介绍联邦学习的目标,然后介绍交替方向乘子法(ADMM)和Cheon-Kim-Kim-Song (CKKS)同态加密的原理。

A. Federated Learning (FL)

FL aims to find the global model ω \omega ω that minimize the
weighted average loss of all clients.

B. Alternating Direction Method of Multipliers

Alternating Direction Method of Multipliers (ADMM) is a distributed optimization algorithm derived from the combination of the Douglas-Rachford and Bregman algorithms, primarily utilized to solve constrained optimization problems by decomposing complex challenges into manageable sub-problems for distributed computing and parallel processing.

  • ADMM (Alternating Direction Method of Multipliers, ADMM)是Douglas-Rachford和Bregman算法结合而来的分布式优化算法,主要用于将复杂挑战分解为可管理的子问题进行分布式计算和并行处理,从而解决约束优化问题。

C. Full Homomorphic Encryption (CKKS)

  • CKKS是一种基于近似最小编码的全HE方案,允许对加密数据进行加法和乘法运算。CKKS在保证计算精度的同时,实现了较高的加密效率和安全性。
  • CKKS包括Initialization(初始化), Encoding(编码),Decoding(解码), KeyGeneration(产生密钥), Encryption(加密), Decryption(解密), Addition(同态加),and Multiplication(同态乘).

PROBLEM FORMULATION

In this section, we show the system model, problem definition and design goals, respectively.

A. System Model

In this section, we consider asynchronous update environments. The system model of PAFed consists of servers,
online clients, delayed clients and key distribution center
(KDC).

  • 在本节中,我们将考虑异步更新环境。PAFed系统模型由服务器、在线客户端、延迟客户端和密钥分发中心(KDC)组成。

KDC: KDC assigns public/secret key pairs to server S 1 S_1 S1 and all clients.

  • KDC: KDC将公钥/密钥对分配给服务器 S 1 S_1 S1和所有客户机。

Servers: In the asynchronous environment, the server
S 0 S_0 S0 tracks the status of each client, dynamically adjusts
the aggregation strategy, and then transmits the result to server S 1 S_1 S1 for key conversion, finally returns aggregation
result to clients.

  • 服务器:在异步环境中,服务器 S 0 S_0 S0跟踪每个客户端的状态,动态调整聚合策略,然后将结果传送给服务器 S 1 S_1 S1 进行密钥转换,最后将聚合结果返回给客户端。

Online Clients: In each round, online clients receive the
global model and train it locally, then upload updates to
S 0 S_0 S0 .

  • 在线客户端:在每一轮中,在线客户端接收全局模型,然后进行本地训练,最后讲更新上传到 S 0 S_0 S0

Delayed clients: Updates uploaded by delayed clients
are not received by S0 immediately due to network delays
and other reasons, but will be received by S0 in several
delayed rounds.

  • 延迟客户端:由于网络延迟等原因,延迟客户端上传的更新不会立即被 S0 接收,而是会被 S0 分几轮延迟接收。
  • 具体来说,KDC将公钥/密钥对分配给每个客户端和服务器S1(步骤①)。在第T轮中,在线客户端 C i C_i Ci更新本地模型 ω i T \omega^T_i ωiT并对其进行本地加密(步骤②),然后将加密后的模型更新[[ ω i T \omega^T_i ωiT]]上传到服务器 S 0 S_0 S0(步骤③)。除了接收在线客户端发送的更新外, S 0 S_0 S0还可以接收T-ts轮的客户端 C i T − t s C^{T-ts}_i CiTts上传的延迟模型更新(步骤④)。然后,服务器 S 0 S_0 S0进行安全聚合,然后将聚合结果发送给 S 1 S_1 S1进行密钥转换(步骤⑤)。最后, S 0 S_0 S0将全局模型[[ ω T + 1 \omega^{T+1} ωT+1]]发送给在线客户端(步骤⑥)。

B. Threat Model

In our system, we assume that KDC is honest and servers
and clients are honest-but-curious
. Specifically, all entities
honestly follow the initially set learning protocol
, but the
servers will infer the client’s private information through the
client’s local model, and the client may also curiously infer
other clients’ private information through the global model
.

  • 在我们的系统中,我们假设KDC是诚实的,服务器和客户端是诚实但好奇的。具体来说,所有实体都诚实地遵循最初设置的训练协议,但服务器会通过客户端的本地模型推断客户端的私有信息,客户端也可能通过全局模型好奇地推断其他客户端的私有信息。

Furthermore, the asynchronous environment of the system
involves delayed clients.

  • 此外,系统的异步环境涉及延迟的客户端
  • 本文的威胁模型如下:
    • Reduction of model accuracy: Since the dataset of client
      presents a Non-IID distribution, and the existence of the
      delayed client will introduce delay in the communication
      process, therefore the accuracy of global model will
      eventually be greatly degraded.

    • 降低模型精度:由于客户端数据集呈现Non-IID分布,而延迟客户端的存在会在通信过程中引入延迟,因此全局模型的精度最终会大大降低。
    • Leakage of data privacy: The central server is honest but
      curious, there may be a risk that the server infers private
      information from client local data.

    • 数据隐私泄露:中央服务器诚实但好奇,可能存在服务器从客户端本地数据中推断出隐私信息的风险。

C. Problem Definition

  • 给定n个客户端 C C C C = { C 1 , C 2 , . . . , C n } C=\{C_1,C_2,...,C_n\} C={C1,C2,...,Cn},它们对应的本地数据为 D , D = { D 1 , D 2 , . . . , D n } D,D=\{D_1,D_2,...,D_n\} D,D={D1,D2,...,Dn},所有客户端有一个共同的全局模型 ω T \omega^T ωT。考虑异步环境的影响,会存在延迟的客户端,我们进一步划分,假定在第T轮,d个延迟客户端组成的延迟客户端群为 C d T = { C 1 , C 2 , . . . , C d } C^T_d=\{C_1,C_2,...,C_d\} CdT={C1,C2,...,Cd},正常更新的n-d个在线客户端组成的在线客户端群为 C o T = { C d + 1 , C d + 2 , . . . , C n } C^T_o=\{C_{d+1,}C_{d+2},...,C_n\} CoT={Cd+1,Cd+2,...,Cn}
  • 如果在同步环境下,服务器 S 0 S_0 S0需要等待延迟客户端的更新到达才可以更新全局模型,但是在异步环境下, S 0 S_0 S0可以直接抛弃延迟更新,而是直接使用在线客户端 C o T C^T_o CoT发来的模型更新 ∇ ω o T = { ∇ ω d + 1 T , ∇ ω d + 2 T , . . . , ∇ ω n T } \nabla\omega^T_o=\{\nabla\omega^T_{d+1},\nabla\omega^T_{d+2},...,\nabla\omega^T_n\} ωoT={ωd+1T,ωd+2T,...,ωnT}进行全局模型更新,但是这种方法会导致模型精度下降。
  • 为了解决这个问题,本文中 S 0 S_0 S0采用基于时间戳的异步聚合。具体来说,在第T轮, S 0 S_0 S0可以同时接受来自 T j T_j Tj轮的延迟客户端群 C d T j C^{T_j}_d CdTj的模型更新 ∇ ω d T j \nabla\omega^{T_j}_d ωdTj以及当前轮的在线客户端群 C o T C^T_o CoT发来的模型更新 ∇ ω o T \nabla\omega^T_o ωoT。然后, S 0 S_0 S0 根据加权聚合的延迟轮数 T − T j T-T_j TTj ∇ ω d T j \nabla\omega^{T_j}_d ωdTj 分配一个较低的权重值,以弥补梯度的缺失。然而,基于时间戳的异步聚合策略也有缺陷:当 T − T j T-T_j TTj过大时, ∇ ω d T j \nabla\omega^{T_j}_d ωdTj ∇ ω o T \nabla\omega^T_o ωoT的版本会有很大差异,导致 ∇ ω d T j \nabla\omega^{T_j}_d ωdTj ∇ ω o T \nabla\omega^T_o ωoT的梯度方向可能会有很大偏差和冲突。我们可以定义一个冲突度量函数 R ( ∇ ω i T , ∇ ω j T j ) R(\nabla\omega^T_i,\nabla\omega^{T_j}_j) R(ωiT,ωjTj)来量化两个向量之间的冲突,即 R ( ∇ ω i T , ∇ ω j T j ) = ∇ ω i T ⋅ ∇ ω j T j R(\nabla\omega^T_i,\nabla\omega^{T_j}_j)=\nabla\omega^T_i\cdot\nabla\omega^{T_j}_j R(ωiT,ωjTj)=ωiTωjTj,其中 ∇ ω i T ∈ ∇ ω o T , ∇ ω j T j ∈ ∇ ω d T j \nabla\omega^{T}_i\in\nabla\omega^T_o,\nabla\omega^{T_j}_j\in\nabla\omega^{T_j}_d ωiTωoT,ωjTjωdTj。根据上述定义,我们可以进一步给出问题的定义:

Definition 1: In the τ -th communication round, the update
∇ ω i T ∈ R d \nabla\omega^T_i\in\mathbb{R}^d ωiTRd of online client C i T C^T_i CiT conflicts with the update ∇ ω j T j ∈ R d \nabla\omega^{T_j}_j\in\mathbb{R}^d ωjTjRd of delayed client C j T j C^{T_j}_j CjTj, if R ( ∇ ω i T , ∇ ω j T j ) R(\nabla\omega^T_i,\nabla\omega^{T_j}_j) R(ωiT,ωjTj) < 0.

  • 定义 1:在第τ 轮通信中,如果 R ( ∇ ω i T , ∇ ω j T j ) R(\nabla\omega^T_i,\nabla\omega^{T_j}_j) R(ωiT,ωjTj)< 0,则在线客户端 C i T C^T_i CiT的更新 ∇ ω i T ∈ R d \nabla\omega^T_i\in\mathbb{R}^d ωiTRd与延迟客户端 C j T j C^{T_j}_j CjTj的更新 ∇ ω j T j ∈ R d \nabla\omega^{T_j}_j\in\mathbb{R}^d ωjTjRd冲突。
  • 此外,在Non-IID 环境下,不同客户端 C i C_i Ci的数据可能呈现不同的分布特征。例如, D i D_i Di只包含某个类别的样本,而 D j ≠ i D_{j\neq\\i} Dj=i可能包含其他类别的样本。这意味着本地模型更新可能会针对特定设备上的数据分布而不是全局数据分布进行优化。(独立,非同分布)
  • 此外,每个客户端 C i C_i Ci训练出的本地模型 ω i T \omega^T_i ωiT可能会有很大差异,导致中央服务器聚合后 ω T \omega^T ωT的精度下降。如图2所示, ω c T \omega^T_c ωcT指的是使用 SGD 在所有数据上训练的模型,而 ω f T \omega^T_f ωfT指的是 fedavg 中的中心服务器聚合 ω i T \omega^T_i ωiT ω j T \omega^T_j ωjT后的模型。
    在这里插入图片描述
  • 此外,在单密钥系统中,所有客户端共享一对密钥 K = ( p k , s k ) K=(pk,sk) K=(pk,sk)。如果客户端 C i C_i Ci的私钥 s k sk sk被泄露,任何客户端 C j ≠ i C_{j\neq\\i} Cj=i都可能面临信息泄露的风险,如式 7 所示,其中 ω j ′ \omega^{'}_j ωj是包含客户端 j 本地信息的解密模型。
    在这里插入图片描述

D. Design Goals

Based on the above discussion, our scheme needs to design a FL that ensures both security and high accuracy in Non-IID settings and asynchronous update scenarios. The design goals are as follows:
- Model accuracy: Our scheme should achieve high model accuracy under specific Non-IID settings and asynchronous update scenarios. Specifically, our scheme should meet or outperform FedAvg’s model performance, whether in a client environment with Non-IID settings or in asynchronous environment.
- Privacy: During the entire FL period, neither server S 0 S_0 S0, S 1 S_1 S1 nor the client should infer any valid information about other clients except within the scope of their own permissions.

  • 基于上述讨论,我们的方案需要设计在非独立同分布环境和异步更新情况下确保安全和高精度的 FL。设计目标如下:
    • 模型精度:我们的方案应在特定的非独立同分布环境和异步更新情况下实现较高的模型准确性。具体来说,无论是在非独立同分布环境的客户端环境下,还是在异步环境下,我们的方案都应达到或超过 FedAvg 的模型性能。
    • 隐私保护:在整个联邦学习期间,服务器 S 0 S_0 S0 S 1 S_1 S1 和各客户端均不得推断出其他客户端的任何有效信息,除非是在其自身权限范围内。

PROPOSED SCHEME

A. Technical Overview

  • 传统的联邦学习不能很好地适应异步环境下的非独立同分布环境,导致模型精度降低。为了解决这个问题,我们在异步环境中引入了 ADMM 算法来优化损失函数,具体如下:
    在这里插入图片描述
    • 其中, y i T r ∈ R d y^{T_r}_i\in\mathbb{R}^d yiTrRd是客户端 C i C_i Ci持有的本地对偶变量, T T T指当前回合, T r T_r Tr指客户最近的在线回合, ρ > 0 \rho>0 ρ>0 是二次项的系数。具体来说,我们首先更新客户端 C i C_i Ci T T T轮的本地模型 ω i T + 1 \omega^{T+1}_i ωiT+1,如公式 9 所示
      在这里插入图片描述
      然后按以下步骤更新 y i T + 1 y^{T+1}_i yiT+1
      在这里插入图片描述
      最后,服务器 S 0 S_0 S0按如下方式更新全局模型 ω T + 1 \omega^{T+1} ωT+1:
      在这里插入图片描述
    • 其中, C T C^T CT 是被选中参与第 T T T 轮训练的客户集, η \eta η是全局学习率。

    In addition, to better adapt to the asynchronous environment and solve the potential conflict issue between the current round of model update ∇ ω i T ∈ ∇ ω o T \nabla\omega^T_i\in\nabla\omega^T_o ωiTωoT and the delayed model update ∇ ω j ≠ i T j ∈ ∇ ω d T ( i . e . , ∇ ω i T ⋅ ∇ ω j ≠ i < 0 T j ) \nabla\omega^{T_j}_{j\neq\\i}\in\nabla\omega^T_d(i.e.,\nabla\omega^T_i\cdot\nabla\omega^{T_j}_{j\neq\\i<0}) ωj=iTjωdT(i.e.,ωiTωj=i<0Tj). We use the projection method to correct the direction of the delayed average update so that it is close to the current average update.

  • 此外,为了更好地适应异步环境,解决本轮模型更新 ∇ ω i T ∈ ∇ ω o T \nabla\omega^T_i\in\nabla\omega^T_o ωiTωoT与延迟模型更新 ∇ ω j ≠ i T j ∈ ∇ ω d T \nabla\omega^{T_j}_{j\neq\\i}\in\nabla\omega^T_d ωj=iTjωdT 之间的潜在冲突问题(即 ∇ ω i T ⋅ ∇ ω j ≠ i < 0 T j \nabla\omega^T_i\cdot\nabla\omega^{T_j}_{j\neq\\i<0} ωiTωj=i<0Tj)。我们使用投影法修正延迟平均更新的方向,使其接近当前平均更新。
  • 》》具体来说,服务器 S 0 S_0 S0接收本轮在线客户端发送的更新 ∇ ω i T \nabla\omega^T_i ωiT,并计算平均值 ∇ ω m T \nabla\omega^T_m ωmT。然后, S 0 S_0 S0记录本轮收到的所有延迟更新 ∇ ω d T = ( ∇ ω 0 T 0 , . . . , ∇ ω d T d ) \nabla\omega^T_d=(\nabla\omega^{T_0}_0,...,\nabla\omega^{T_d}_d) ωdT=(ω0T0,...,ωdTd)。对于延迟更新,我们采用了多层分类处理的理念。首先, S 0 S_0 S0判断 ∇ ω j T j \nabla\omega^{T_j}_j ωjTj ∇ ω m T \nabla\omega^T_m ωmT是否冲突(即 ∇ ω m T − ∇ ω j T j > 0 \nabla\omega^T_m-\nabla\omega^{T_j}_j>0 ωmTωjTj>0) 。然后, S 0 S_0 S0通过对满足 ∇ ω m T − ∇ ω j T j < 0 \nabla\omega^T_m-\nabla\omega^{T_j}_j<0 ωmTωjTj<0 的延迟模型更新进行平均,计算出 ∇ ω m 1 T \nabla\omega^T_{m_1} ωm1T。同样的, S 0 S_0 S0首先计算满足 ∇ ω m T − ∇ ω j T j > 0 \nabla\omega^T_m-\nabla\omega^{T_j}_j>0 ωmTωjTj>0的所有延迟模型更新 ∇ ω j T j \nabla\omega^{T_j}_j ωjTj的平均值,记为 ∇ ω m 2 T \nabla\omega^T_{m_2} ωm2T然后将 ∇ ω m 2 T \nabla\omega^T_{m_2} ωm2T投影到 ∇ ω m T \nabla\omega^T_m ωmT的法线平面上,以修正 ∇ ω m 2 T \nabla\omega^T_{m_2} ωm2T的方向,如公式 12 所示。
    在这里插入图片描述
  • 如图 3 所示,我们将延迟模型更新 ∇ ω i T \nabla\omega^T_i ωiT ∇ ω j T \nabla\omega^T_j ωjT分别投影到平均更新 ∇ ω T \nabla\omega^T ωT的法线平面上,使修正后的模型更新 ∇ ω i T ′ \nabla\omega^{T^{'}}_i ωiT ∇ ω j T ′ \nabla\omega^{T^{'}}_j ωjT ∇ ω T \nabla\omega^T ωT的方向更加一致。此外,图 3 显示,由 ∇ ω i T ′ \nabla\omega^{T^{'}}_i ωiT ∇ ω j T ′ \nabla\omega^{T^{'}}_j ωjT 聚合而成的全局模型 ∇ ω T + 1 ′ \nabla\omega^{{T+1}^{'}} ωT+1与由 ∇ ω i T ′ \nabla\omega^{T^{'}}_i ωiT ∇ ω j T ′ \nabla\omega^{T^{'}}_j ωjT聚合而成的全局模型 ∇ ω T + 1 ′ \nabla\omega^{{T+1}^{'}} ωT+1相比,更有利于全局模型的性能。
    在这里插入图片描述

To protect the privacy of C i C_i Ci, we use CKKS to encrypt the model update uploaded by C i C_i Ci and ensure that servers perform aggregations under the ciphertext, thus preventing local data leakage. Before encrypting the model updates, we first need to quantify the model updates and classify the models, and then calculate the average of each category. Since CKKS supports additive homomorphism and multiplicative homomorphism, we can simply calculate the average value [ [ ∇ ω m T ] ] [[\nabla\omega^T_m]] [[ωmT]]. However, it should be noted that CKKS cannot directly support the operation of classification processing, that is, it cannot directly determine whether there is a conflict between ∇ ω j T j \nabla\omega^{T_j}_j ωjTj and ∇ ω m T \nabla\omega^T_m ωmT under the ciphertext, because [ [ ∇ ω m T ] ] ⋅ [ [ ∇ ω j T j ] ] [[\nabla\omega^T_m]]\cdot[[\nabla\omega^{T_j}_j]] [[ωmT]][[ωjTj]] is a ciphertext value and cannot be directly decrypted by servers.

  • 为了保护 C i C_i Ci的隐私,我们使用 CKKS 对 C i C_i Ci上传的模型更新进行加密,并确保服务器在密文下进行聚合,从而防止本地数据泄露。在对模型更新进行加密之前,我们首先需要对模型更新进行量化和分类,然后计算每个类别的平均值。由于 CKKS 支持加法同态和乘法同态,我们只需计算平均值 [ [ ∇ ω m T ] ] [[\nabla\omega^T_m]] [[ωmT]]即可。但需要注意的是,CKKS 无法直接支持分类处理操作,即无法直接判断密文下的 ∇ ω j T j \nabla\omega^{T_j}_j ωjTj ∇ ω m T \nabla\omega^T_m ωmT之间是否存在冲突,因为 [ [ ∇ ω m T ] ] ⋅ [ [ ∇ ω j T j ] ] [[\nabla\omega^T_m]]\cdot[[\nabla\omega^{T_j}_j]] [[ωmT]][[ωjTj]]是密文值,服务器无法直接解密。

To solve this problem, we introduce the algorithm M i n ( ⋅ , ⋅ ) Min(\cdot,\cdot) Min(,) for computing the minimum value of two ciphertexts,as shown in Algorithm 1. Given two ciphertexts [[a]] and [[b]] encrypted by CKKS, M i n ( ⋅ , ⋅ ) Min(\cdot,\cdot) Min(,) returns a ciphertext whose decrypted value approximates to the value of a when a ≤ b,otherwise M i n ( ⋅ , ⋅ ) Min(\cdot,\cdot) Min(,) returns a ciphertext whose decrypted value approximates to the value of b, where a, b ∈ [0, 1].

  • 为了解决这个问题,我们引入了算法 M i n ( ⋅ , ⋅ ) Min(\cdot,\cdot) Min(,),用于计算两个密码文本的最小值,如算法 1 所示。给定由 CKKS 加密的两个密码文本 [[a]] 和 [[b]] ,当 a≤b 时, M i n ( ⋅ , ⋅ ) Min(\cdot,\cdot) Min(,) 返回解密值近似于 a 值的密码文本,否则 M i n ( ⋅ , ⋅ ) Min(\cdot,\cdot) Min(,)返回解密值近似于 b 值的密码文本,其中 a, b∈ [0, 1]。
    在这里插入图片描述
  • 为了实现延迟模型更新的分类,然后对其进行平均,我们应根据算法 4 确定密文下 ∇ ω m T − ∇ ω j T j \nabla\omega^T_m-\nabla\omega^{T_j}_j ωmTωjTj与 0 之间的关系。我们首先将 ∇ ω m T \nabla\omega^T_m ωmT ∇ ω j T j \nabla\omega^{T_j}_j ωjTj归一化,然后将 ( ∇ ω m T ⋅ ∇ ω j T j + 1 ) / 2 (\nabla\omega^T_m\cdot\nabla\omega^{T_j}_j+1)/2 (ωmTωjTj+1)/2 1 / 2 1/2 1/2 输入 M i n ( ⋅ , ⋅ ) Min(\cdot,\cdot) Min(,),间接得到 ∇ ω m T − ∇ ω j T j \nabla\omega^T_m-\nabla\omega^{T_j}_j ωmTωjTj和 0 的大小关系。此外,我们设置两个变量 [ [ ∇ ω m 1 T ] ] [[\nabla\omega^T_{m_1}]] [[ωm1T]] , [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_2}]] [[ωm2T]]并初始化为 0。对于每个延迟模型更新 ∇ ω j T j \nabla\omega^{T_j}_j ωjTj,我们对 [ [ ∇ ω m 1 T ] ] [[\nabla\omega^T_{m_1}]] [[ωm1T]] , [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_2}]] [[ωm2T]]进行一次累积,如公式13。
    在这里插入图片描述
  • 最后, S 0 S_0 S0 计算 [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_2}]] [[ωm2T]]的平均值,然后根据公式 14 修正 [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_2}]] [[ωm2T]]
    在这里插入图片描述

B. Concrete Construction of PAFed

We divide the privacy framework into five parts, system initialization, local update and processing, delayed model update classification and correction, model aggregation, and
key transformation, as shown in Fig. 4. Next, we describe its specific process in Algorithm 3.

图4

System initialization. First, KDC selects a security parameter λ \lambda λ, then initializes like CKKS.Initialization ( 1 λ ) (1^{\lambda}) (1λ), and then assigns a public/secret key pair ( p k i , s k i ) (pk_i,sk_i) (pki,ski) to each client C i C_i Ci by calling CKKS.KeyGen ( χ s ; χ e ) (\chi _s;\chi _e) (χs;χe). Similarly, KDC also assigns a public/secret key pair ( p k s , s k s ) (pk_s,sk_s) (pks,sks) to S 1 S_1 S1.

  • 系统初始化。首先,KDC 选择一个安全参数 λ,然后像 CKKS.Initialization ( 1 λ ) (1^{\lambda}) (1λ) 一样进行初始化,然后通过调用 CKKS.KeyGen ( χ s ; χ e ) (\chi _s;\chi _e) (χs;χe) 为每个客户端 C i C_i Ci分配一对公开/保密密钥 ( p k i , s k i ) (pk_i,sk_i) (pki,ski)。同样,KDC 也会为 S 1 S_1 S1 分配一对公开/保密密钥 ( p k s , s k s ) (pk_s,sk_s) (pks,sks)

Local update and processing. The server S 0 S_0 S0 initializes the global model ω 0 \omega^0 ω0, and each client initializes a dual variable y i 0 y^0_i yi0. For the t-th iteration, S 0 S_0 S0 selects the client subset C T C^T CT of the τ -th round, and sends the global model ω T \omega^T ωT to the client C i ∈ C o T C_i\in C^T_o CiCoT, where C o T C^T_o CoT refers to a subset of online clients in C T C^T CT.

  • 本地更新和处理服务器。 S 0 S_0 S0初始化全局模型 ω 0 \omega^0 ω0,每个客户端初始化一个对偶变量 y^0_i 。在第 t 次迭代中, 。在第 t 次迭代中, 。在第t次迭代中,S_0 选择第 τ 轮的客户端子集 选择第 τ 轮的客户端子集 选择第τ轮的客户端子集C^T$,并将全局模型 ω T \omega^T ωT发送给客户端 C i ∈ C o T C_i\in C^T_o CiCoT, 其中 C o T C^T_o CoT 指的是 C T C^T CT中的在线客户端子集。然后,在线客户端 C i ∈ C o T C_i\in C^T_o CiCoT执行 E i E_i Ei轮局部训练,选择最小的一批数据样本 b ∈ B b\in B bB,目标函数如下:
    公式15
  • 为了求解目标函数,我们使用交替方向乘子法,根据公式 9 计算 ω i T + 1 \omega^{T+1}_i ωiT+1。如算法 2 所示,在进行 E i E_i Ei 轮局部训练后,客户端 C i C_i Ci 根据公式 10 更新 y i T + 1 y^{T+1}_i yiT+1,然后计算模型更新 ∇ ω i T \nabla\omega^T_i ωiT,如公式 16 所示。
    公式16
    算法2
  • 此外,为了实现对密文情况下模型更新延迟的修正, C i C_i Ci ∇ ω i T \nabla\omega^T_i ωiT进行了标准化处理,如算法 3 第 8 行所示。虽然量化过程会在一定程度上影响模型的准确性,但其影响仍在可接受的范围内,而且量化过程也在一定程度上减少了计算和通信开销。
    算法3
  • 然后, C i C_i Ci使用 S 1 S_1 S1的公开密钥 p k s pk_s pks进行本地加密,即 C K K S . E n c p k s ( ∇ ω i T ) CKKS.Enc_{pk_s}(\nabla\omega^T_i) CKKS.Encpks(ωiT)。最后, C i C_i Ci将加密结果 [ [ ∇ ω i T ] ] [[\nabla\omega^T_i]] [[ωiT]]发送给 S 0 S_0 S0

Delayed Update Classification and Correction (DUCC). As shown in Algorithm 4, the server S 0 S_0 S0 receives encrypted model updates [ [ ∇ ω i T ] ] [[\nabla\omega^T_i]] [[ωiT]] sent by online clients C i C_i Ci , and calculates the average value [ [ ∇ ω m T ] ] [[\nabla\omega^T_m]] [[ωmT]]. Then, S 0 S_0 S0 records all delayed updates received in this round, as denoted ∇ ω d = ( [ [ ∇ ω 0 T 0 ] ] , . . . , [ [ ∇ ω d T d ] ] ) \nabla\omega_d=([[\nabla\omega^{T_0}_0]],...,[[\nabla\omega^{T_d}_d]]) ωd=([[ω0T0]],...,[[ωdTd]]), and initializes [ [ ∇ ω m 1 T ] ] , [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_1}]],[[\nabla\omega^T_{m_2}]] [[ωm1T]],[[ωm2T]], n 1 , n 2 n_1,n_2 n1,n2 to 0. For each delayed model update [ [ ∇ ω j T j ] ] ∈ H [[\nabla\omega^{T_j}_j]]\in H [[ωjTj]]H, S 0 S_0 S0 executes Eq. 13 once. In addition,
S 0 S_0 S0 also accumulates n 1 n_1 n1 and n 2 n_2 n2, where n 1 n_1 n1 and n 2 n_2 n2 respectively record the total accumulated weights of [ [ ∇ ω m 1 T ] ] , [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_1}]],[[\nabla\omega^T_{m_2}]] [[ωm1T]],[[ωm2T]].

  • 延迟更新分类和更正 (DUCC)。如算法 4 所示,服务器 S 0 S_0 S0 接收在线客户端 C i C_i Ci 发送的加密模型更新 [ [ ∇ ω i T ] ] [[\nabla\omega^T_i]] [[ωiT]],并计算平均值 [ [ ∇ ω m T ] ] [[\nabla\omega^T_m]] [[ωmT]]。然后, S 0 S_0 S0记录这一轮收到的所有延迟更新,表示为 ∇ ω d = ( [ [ ∇ ω 0 T 0 ] ] , . . . , [ [ ∇ ω d T d ] ] ) \nabla\omega_d=([[\nabla\omega^{T_0}_0]],...,[[\nabla\omega^{T_d}_d]]) ωd=([[ω0T0]],...,[[ωdTd]]),并初始化 [ [ ∇ ω m 1 T ] ] 、 [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_1}]]、[[\nabla\omega^T_{m_2}]] [[ωm1T]][[ωm2T]] n 1 、 n 2 n_1、n_2 n1n2 为 0。对于每个延迟模型更新 [ [ ∇ ω j T j ] ] ∈ H [[\nabla\omega^{T_j}_j]]\in H [[ωjTj]]H S 0 S_0 S0执行公式13 一次。此外, S 0 S_0 S0 还会累积 n 1 n_1 n1 n 2 n_2 n2,其中 n 1 n_1 n1 n 2 n_2 n2 分别记录 [ [ ∇ ω m 1 T ] ] 、 [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_1}]]、[[\nabla\omega^T_{m_2}]] [[ωm1T]][[ωm2T]] 的总累积权重。
    算法4
  • 最后, S 0 S_0 S0 [ [ ∇ ω m 1 T ] ] [[\nabla\omega^T_{m_1}]] [[ωm1T]]除以 n1,计算出 [ [ ∇ ω m 1 T ] ] [[\nabla\omega^T_{m_1}]] [[ωm1T]]的平均值。同样, [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_2}]] [[ωm2T]]除以 n2,得出 [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_2}]] [[ωm2T]]的平均值。然后, S 0 S_0 S0 根据公式14 修正 [ [ ∇ ω m 2 T ] ] [[\nabla\omega^T_{m_2}]] [[ωm2T]]

Model aggregation. As in Eq. 17, S 0 S_0 S0 updates the global model [ [ ω T ] ] [[\omega^T]] [[ωT]].

  • 模型汇总。如公式 17 所示, S 0 S_0 S0更新全局模型 [ [ ω T ] ] [[\omega^T]] [[ωT]]
    公式17
    • 其中, α 0 、 α 1 、 α 2 \alpha_0、\alpha_1、\alpha_2 α0α1α2分别为非延迟模型更新、非冲突延迟模型更新和冲突延迟模型更新的权重值。

Key transformation. Since [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]] is encrypted by the public key p k s pk_s pks and cannot be directly decrypted by the clients, we need to perform key conversion. As shown in Algorithm 5, S 0 S_0 S0 first randomly generates a non-zero vector r r r as a mask vector, where the size of r r r is consistent with the size of [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]]. Then, S 0 S_0 S0 locally encrypts r by calling C K K S . E n c p k s ( r ) CKKS.Enc_{pk_s}(r) CKKS.Encpks(r). Then, S 0 S_0 S0 confuses [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]] as [ [ ω T + 1 ] ] + [ [ r ] ] [[\omega^{T+1}]]+[[r]] [[ωT+1]]+[[r]]. Finally, S 0 S_0 S0 sends [ [ ω T + 1 + r ] ] [[\omega^{T+1}+r]] [[ωT+1+r]] to S 1 S_1 S1. After receiving [ [ ω T + 1 + r ] ] [[\omega^{T+1}+r]] [[ωT+1+r]], S 1 S_1 S1 first decrypts it with its own private key s k s sk_s sks to get ω T + 1 + r \omega^{T+1}+r ωT+1+r, then encrypts ω T + 1 + r \omega^{T+1}+r ωT+1+r with each client’s public key by calling
C K K S . E n c p k i ( ω T + 1 + r ) CKKS.Enc_{pk_i}(\omega^{T+1}+r) CKKS.Encpki(ωT+1+r), finally sends the encrypted result to S 0 S_0 S0. S 0 S_0 S0 first encrypts r r r with the public key of each client to obtain [ [ r ] ] [[r]] [[r]], then removes the mask by [ [ ω T + 1 + r ] ] − [ [ r ] ] [[\omega^{T+1}+r]]-[[r]] [[ωT+1+r]][[r]],finally sends the corresponding [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]] to the next round of clients.

  • 密钥转换。由于 [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]]是由公钥 p k s pk_s pks 加密的,客户端无法直接解密,因此我们需要进行密钥转换。如算法 5 所示, S 0 S_0 S0 首先随机生成一个非零向量 r r r 作为掩码向量,其中 r r r 的大小与 [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]] 的大小一致。然后, S 0 S_0 S0 通过调用 C K K S . E n c p k s ( r ) CKKS.Enc_{pk_s}(r) CKKS.Encpks(r) r r r 进行本地加密。然后, S 0 S_0 S0 [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]]混淆为 [ [ ω T + 1 ] ] + [ [ r ] ] [[\omega^{T+1}]]+[[r]] [[ωT+1]]+[[r]]。最后, S 0 S_0 S0 [ [ ω T + 1 + r ] ] [[\omega^{T+1}+r]] [[ωT+1+r]]发送给 S 1 S_1 S1 S 1 S_1 S1 收到 [ [ ω T + 1 + r ] ] [[\omega^{T+1}+r]] [[ωT+1+r]] 后,首先用自己的私钥 s k s sk_s sks 解密,得到 ω T + 1 + r \omega^{T+1}+r ωT+1+r,然后调用 C K K S . E n c p k i ( ω T + 1 + r ) CKKS.Enc_{pk_i}(\omega^{T+1}+r) CKKS.Encpki(ωT+1+r),用每个客户端的公钥对 ω T + 1 + r \omega^{T+1}+r ωT+1+r进行加密,最后将加密结果发送给 S 0 S_0 S0 S 0 S_0 S0首先用每个客户端的公开密钥对 r r r 进行加密,得到 [ [ r ] ] [[r]] [[r]] ,然后通过 [ [ ω T + 1 + r ] ] − [ [ r ] ] [[\omega^{T+1}+r]]-[[r]] [[ωT+1+r]][[r]]删除掩码,最后向下一轮客户端发送相应的 [ [ ω T + 1 ] ] [[\omega^{T+1}]] [[ωT+1]]
    算法5

个人总结

本文求解问题

  1. 因为网络延迟问题,一些客户端的本地训练结果无法按时发送给聚合服务器,在异步联邦学习环境下会严重影响训练效率、模型精度。
  2. 以为联邦学习存在多个客户端,每个客户端的本地数据不可能完全一样,因此数据呈现Non-IID(非独立同分布)现象,在本文中,Non-IID被解释为独立、非同分布,现存的异步联邦学习不能很好地适应Non-IID环境,会影响模型精度。

本文解决方法

  1. 对于延迟模型更新,本文采用交替方向乘子法,首先将延迟模型更新分为两个部分,冲突延迟模型更新 ∇ ω m 2 T \nabla\omega^T_{m_2} ωm2T和非冲突延迟模型更新 ∇ ω m 1 T \nabla\omega^T_{m_1} ωm1T,对于冲突延迟模型更新 ∇ ω m 2 T \nabla\omega^T_{m_2} ωm2T,将其投影到 ∇ ω m T \nabla\omega^T_m ωmT(在线客户端模型更新的平均值)的法线平面上,以修正 ∇ ω m 2 T \nabla\omega^T_{m_2} ωm2T的方向,图3表明这样聚合后的全局模型更加准确。
  2. 对于Non-IID问题,我们采用ADMM 算法来优化损失函数。

隐私保护

  • 本文假设KDC是诚实的,服务器和客户端是诚实但好奇的。具体来说,所有实体都诚实地遵循最初设置的训练协议,但服务器会通过客户端的本地模型推断客户端的私有信息,客户端也可能通过全局模型好奇地推断其他客户端的私有信息。
  • 本文采用全同态加密来保护本地数据,单密钥系统下所有客户端共享密钥对,并不安全,本文采用CKKS全同态加密算法,每个客户端和 S 1 S_1 S1有自己的密钥对。在发送本地训练结果前, C i C_i Ci会使用 S 1 S_1 S1的公钥进行加密,而聚合过程发生在 S 0 S_0 S0而不是 S 1 S_1 S1,这样,因为 S 0 S_0 S0收到的是加密数据,且 S 0 S_0 S0不具有密钥,而 S 1 S_1 S1虽然拥有密钥,但是 S 1 S_1 S1只会收到来自 S 0 S_0 S0的聚合结果,即使 S 1 S_1 S1解密数据,也无法从中推断 C i C_i Ci的数据。

思考

  1. 加密方法:可以采用其他全同态,同样地,为 C i C_i Ci分配密钥对,由服务器进行加解密。
  2. 服务器数量:能否只用一台服务器并保证数据安全?似乎不可以
  3. 对于延迟模型更新有无其他解决方案?
  4. 对于Non-IID的影响是否有其他方法解决?
  • 4
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Privacy-preserving machine learning is becoming increasingly important in today's world where data privacy is a major concern. Federated learning and secure aggregation are two techniques that can be used to achieve privacy-preserving machine learning. Federated learning is a technique where the machine learning model is trained on data that is distributed across multiple devices or servers. In this technique, the model is sent to the devices or servers, and the devices or servers perform the training locally on their own data. The trained model updates are then sent back to a central server, where they are aggregated to create a new version of the model. The key advantage of federated learning is that the data remains on the devices or servers, which helps to protect the privacy of the data. Secure aggregation is a technique that can be used to protect the privacy of the model updates that are sent to the central server. In this technique, the updates are encrypted before they are sent to the central server. The central server then performs the aggregation operation on the encrypted updates, and the result is sent back to the devices or servers. The devices or servers can then decrypt the result to obtain the updated model. By combining federated learning and secure aggregation, it is possible to achieve privacy-preserving machine learning. This approach allows for the training of machine learning models on sensitive data while protecting the privacy of the data and the model updates.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值