Differentially Private Asynchronous Federated Learning for Mobile Edge Computing in Urban Informatic

针对车联网中机器学习的挑战,提出了一种结合差分隐私的异步联邦学习方案。方案包括使用局部差分隐私进行本地训练,车辆模型的分布式随机传播以及模型验证的权重聚合。优点在于解决车辆移动性和隐私保护问题,但存在验证过程不清晰及模型准确性影响的缺点。
摘要由CSDN通过智能技术生成

Differentially Private Asynchronous Federated Learning for Mobile Edge Computing in Urban Informatics阅读笔记

文献背景及解决问题

由于无线网络带宽和计算资源的限制,车辆很难使用大量数据来进行提高服务质量的机器学习,比如自动驾驶和交通预测。本文设计了一种在车联网环境下的联邦学习方案,实现了具有差分隐私的异步联邦学习。

联邦学习在车联网中的挑战:
1.车辆的移动性很难保持云服务器和车辆连续不断的同步通信
2.负责聚合的中心服务器具有安全威胁,导致学习过程失败
3.敌手通过推测使得更新的模型泄露用户车辆的隐私信息

车联网中的联邦学习

在这里插入图片描述普通的做法:移动车辆在本地训练模型上传至路边单元,路边单元负责传输模型至基站,最后由基站负责聚合全局模型并提供给车辆使用。
问题1:车辆具有很强的移动性,并不能随时随地上传至特定的路边单元
问题2:中心服务器的脆弱性,一旦模型聚合出现问题,就会导致整个联邦学习系统失效
问题3:中心服务器如果发布恶意模型,用户在恶意模型上进行训练会导致用户数据被收集,而且用户不能感知到恶意模型的存在
问题4:差分攻击可能发生在学习方案中,使攻击者可能获取用户上传的更新中的隐私信息;拜占庭攻击使用户上传虚假模型降低模型可用性从而打消其余用户训练积极性
类似投毒攻击

具体方案

Here is the completed code for Differentially Private Stochastic Gradient Descent, including per-example clipping and adding Gaussian noise as well as privacy budget composition: ```python import numpy as np from scipy import optimize from scipy.stats import norm import math def per_example_clipping(grad, clip_factor): """ Clip the gradient per example with a given clip factor. """ return np.clip(grad, -clip_factor, clip_factor) def add_gaussian_noise(grad, sigma): """ Add Gaussian noise to the gradient with a given standard deviation. """ return grad + np.random.normal(0, sigma, grad.shape) def get_epsilon(epoch, delta, sigma, sensitivity, batch_size, training_nums): """ Compute epsilon with basic composition from given epoch, delta, sigma, sensitivity, batch_size and the number of training set. """ steps = math.ceil(training_nums / batch_size) * epoch epsilon = sigma * math.sqrt(2 * math.log(1.25 / delta)) / sensitivity return epsilon * steps def dp_sgd(X, y, epochs, batch_size, clip_factor, sigma, delta): n, d = X.shape w = np.zeros(d) for epoch in range(epochs): for i in range(0, n, batch_size): X_batch = X[i:i+batch_size] y_batch = y[i:i+batch_size] grad = np.mean(X_batch * (sigmoid(X_batch.dot(w)) - y_batch).reshape(-1, 1), axis=0) clipped_grad = per_example_clipping(grad, clip_factor) noise_grad = add_gaussian_noise(clipped_grad, sigma) w -= noise_grad epsilon = get_epsilon(epoch+1, delta, sigma, clip_factor/batch_size, batch_size, n) print("Epoch {}: Epsilon = {}".format(epoch+1, epsilon)) return w ``` The `per_example_clipping` function clips the gradient per example with a given clip factor. The `add_gaussian_noise` function adds Gaussian noise to the gradient with a given standard deviation. The `get_epsilon` function computes epsilon with basic composition from given epoch, delta, sigma, sensitivity, batch_size and the number of training set. The `dp_sgd` function performs Differentially Private Stochastic Gradient Descent. For each epoch, it loops over the training set in batches and computes the gradient of the loss function using the sigmoid function. It then clips the gradient per example, adds Gaussian noise to the clipped gradient, and updates the weight vector. Finally, it computes the privacy budget using the `get_epsilon` function and prints it out. Note that the `get_epsilon` function uses basic composition to compute the privacy budget. It calculates the total number of steps based on the number of epochs and the batch size, and then uses the formula for epsilon with basic composition to compute the privacy budget for each epoch. It is worth noting that basic composition may not provide the tightest bound on privacy, and using the Moments Accountant method may provide a tighter bound.
评论 11
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值