摘 要:聯邦學習解決了機器學習的數據孤島問題,然而,各方的數據集在數據樣本空間和特征空間上可能存在較大差異,導致聯邦模型的預測精度下降。針對上述問題,提出了一種基于差分隱私保護知識遷移的聯邦學習方法。該方法使用邊界擴展局部敏感散列計算各方實例之間的相似度,根據相似度對實例進行加權訓練,實現基于實例的聯邦遷移學習。在此過程中,實例本身無須透露給其他方,防止了隱私的直接泄露。同時,為了減少知識遷移過程的隱私間接泄露,在知識遷移過程中引入差分隱私機制,對需要在各方之間傳輸的梯度數據進行擾動,實現知識遷移過程的隱私保護。理論分析表明,知識遷移過程滿足ε-差分隱私保護。在XGBoost梯度提升樹模型上實現了所提方法,實驗結果表明,與無知識遷移方法相比,所提方法使聯邦模型測試誤差平均下降6%以上。
關鍵詞:聯邦學習; 遷移學習; 局部敏感散列; 差分隱私; 梯度提升樹
中圖分類號:TP309文獻標志碼:A
文章編號:1001-3695(2023)08-037-2473-08
doi:10.19734/j.issn.1001-3695.2022.10.0633
Federated learning method based on differential privacyprotection knowledge transfer
Xu Chenyang Ge Lina Wang Zhe Zhou Yongquan Qin Xia Tian Lei
(1. a.School of Artificial Intelligence, b.Key Laboratory of Network Communication Engineering, c.School of Electronic Information, Guangxi Minzu University, Nanning 530006, China; 2.Guangxi Key Laboratory of Hybrid Computation amp; IC Design Analysis, Nanning 530006, China)
Abstract:Federated learning solves the data silo problem of machine learning. However, the dataset of each party may have large differences in the instance space and feature space, which led to the degradation of prediction accuracy of the federated model. To address the above problems, this paper proposed a federated learning method based on differential privacy protection knowledge transfer. The method used boundary-expanding locality-sensitive hashing to calculate the similarity between instances of each party, and carried out weighted training of instances according to the similarity to achieve instance-based fede-rated transfer learning. In the above process, each party didn’t need to disclose their instances to other parties, which could prevent the direct leakage of privacy. Meanwhile, to reduce the indirect privacy leakage in the knowledge transfer process, the proposed method introduced differential privacy mechanism to perturb the gradient data transmitted between all parties, so as to achieve privacy protection in the process of knowledge transfer. Theoretical analysis shows that the knowledge transfer process satisfies ε-differential privacy protection. This paper implemented the proposed method based on the XGBoost model. The experimental results show that, compared with the other methods without knowledge transfer, the proposed method reduces the test error of the federated model by more than 6% on average.
Key words:federated learning; transfer learning; locality-sensitive hashing; differential privacy; gradient boosting decision tree
0 引言
傳統機器學習方法大多需要將分散的數據集中起來進行訓練[1],隨著大數據時代深入發展,數據隱私泄露帶來的危害日趨嚴重,國家和社會層面對數據安全和隱私保護越發重視。2017年實施的《中華人民共和國網絡安全法》在第四章對涉及個人信息安全的事項作出專門規定。2021年實施的《中華人民共和國民法典》指出:“信息處理者應當采取技術措施和其他必要措施,確保其收集、存儲的個人信息安全,防止信息泄露、竄改、丟失。”這些法律法規的實施對數據收集和使用提出新挑戰,分散的數據無法輕易地集中起來用于訓練機器學習模型,形成“數據孤島”。
2017年由McMahan等人[2]首次提出的“聯邦學習”正是為解決上述問題而做的努力。聯邦學習考慮了多方訓練的隱私問題[3],參與方使用本地數據訓練本地模型,之后同其他參與方交換本地模型關聯數據(如模型參數或梯度等),使得各方最終可以訓練出相同的模型,即聯邦模型。在此過程中,參與方數據不出本地,可以防止原始數據被敵手捕獲而造成隱私數據的直接泄露[4]。根據參與方數據樣本空間和特征空間的不同,聯邦學習可分為橫向聯邦學習、縱向聯邦學習、聯邦遷移學習[4]。McMahan等人[2]提出針對神經網絡模型的FedAvg算法,參與方將本地模型參數發送到聚合服務器用于構建聯邦模型,這是橫向聯邦學習最早的解決方案。Cheng等人[5]提出一種基于同態加密的聯邦梯度提升決策樹算法,解決了縱向聯邦學習場景下多方樹節點屬性分割的問題。張君如等人[6]提出一種無損聯邦梯度提升決策樹算法,使用特征索引序列的掃描和分裂來搜索最佳分割點,提升了預測精度的同時降低了訓練時間開銷。
聯邦學習雖然可以解決多方分布式訓練的數據孤島和隱私直接泄露問題,但當各方的數據集在樣本空間和特征空間上的差異較大時,聯邦模型難免出現預測精度和穩定性下降的問題。針對聯邦學習的這一局限性,Liu等人[7]于2018年提出聯邦遷移學習,提升了聯邦模型預測精度。Yang等人[8]根據知識遷移對象不同,將聯邦遷移學習分為基于模型的聯邦遷移學習[9~16]、基于特征的聯邦遷移學習[7,17~19]和基于實例的聯邦遷移學習[20]。其中,基于實例的聯邦遷移學習基本原理是:參與方根據一定的知識遷移策略,有選擇地挑選或者加權訓練樣本,以減小分布差異,從而可以將目標損失函數最小化,提升模型預測精度。一部分聯邦遷移學習研究工作僅關注模型性能而忽視隱私保護[9,11,14,20],例如,Li等人[20]提出一種針對梯度提升樹模型的聯邦遷移學習方法,雖然文中聲稱該方法滿足隱私保護,但實際上其工作只滿足了樸素的隱私保護觀點[2]。該文認為只要參與方原始數據不出本地即可實現隱私保護,僅考慮了隱私的直接泄露,而未考慮模型參數或梯度等信息被捕獲可能導致的隱私泄露[21]。此類隱私泄露是間接泄露[4],尤其是梯度數據泄露,可能招致標簽推理攻擊[22]、成員推理攻擊[23]等。
因此,必須引入額外的隱私保護策略。Liu等人[7]提出一種針對神經網絡模型的安全聯邦遷移學習框架,使用同態加密和秘密共享保護隱私,是基于特征的聯邦遷移學習。其使用獨立的神經網絡模型將參與方數據集的源特征映射到一個共同的特征子空間中,在該特征子空間中實現參與方之間的知識遷移。Zhu等人[12]提出了一種針對神經網絡模型基于投票策略的差分隱私聯邦遷移學習方法,是基于模型的聯邦遷移學習。各方使用本地模型對來自中央服務器的公共數據集進行預測得到偽標簽,中央服務器根據偽標簽以及多數原則進行投票生成全局標簽實現知識遷移。Pan等人[16]提出了一種針對神經網絡模型基于PATE框架的聯邦遷移學習算法,使用差分隱私防止隱私泄露,是基于模型的聯邦遷移學習。參與方以及中央服務器維護一組教師—學生模型,參與方的知識經由此模型轉移到中央服務器管理的可公開發布模型中,實現知識遷移。Gao等人[17]提出一種針對邏輯回歸和支持向量機模型的異構聯邦遷移學習方法,使用同態加密和秘密共享保護隱私,是基于特征的聯邦遷移學習。其使用域適應和特征映射將參與方的數據映射到同質的公共特征空間,在該空間中實現知識遷移。
但上述基于模型與基于特征的聯邦遷移學習普遍需要各參與方維護一個較大的公共機器學習模型或公共數據集。相比之下,基于實例的聯邦遷移學習僅需在保護隱私的前提下建立各參與方之間數據的關聯性便能夠實現知識遷移,無須維護公共的機器學習模型或公共數據集。此外,由Dwork等人[24]提出的差分隱私是一種可靠且常用的隱私保護方法,通過向數據添加特定的擾動噪聲實現隱私保護。這是一種可形式化證明的、可定量分析的隱私保護方法,在實現難度和計算開銷上都要優于同態加密或秘密共享[25]。
針對上述研究背景及現狀,本文提出一種基于差分隱私保護知識遷移的聯邦學習方法,使用基于實例相似度的知識遷移策略,同時關注知識遷移過程中的隱私泄露問題,借助差分隱私技術實現聯邦遷移學習的知識遷移過程隱私保護。本文主要貢獻如下:
a)提出局部敏感散列(locality-sensitive hashing,LSH)可以用于實現基于實例的聯邦遷移學習,設計了一種聯邦遷移學習方法,給出了相應的知識遷移訓練策略。使用局部敏感散列算法計算實例的散列值形成全局散列表,進而挖掘實例之間的相似關系并計算相似度,根據相似度在各方之間交換梯度。最終根據知識遷移策略,使用交換的梯度對實例進行加權訓練,實現知識遷移(基于實例的遷移學習)。在此過程中,實例本身無須透露給他人,避免了隱私的直接泄露。
b)使用差分隱私技術為知識遷移過程中需要傳輸的梯度添加噪聲,實現了保護隱私的知識遷移,進一步降低了隱私間接泄露的可能性。通過理論分析,證明了本文知識遷移過程滿足ε-差分隱私。
c)基于XGBoost梯度提升樹模型實現了本文方法,在六種通用數據集上評估了不同實驗設置下模型的測試誤差。實驗結果表明,本文方法可以降低聯邦模型的測試誤差。
1 DP-IBFTL方法
本文所提基于差分隱私保護知識遷移的聯邦學習方法(instance-based federated transfer learning based on differential privacy protection knowledge transfer,DP-IBFTL)包含兩個主要設計目標:a)在各方之間實現基于實例的知識遷移,且在知識遷移過程中實現隱私保護;b)各方通過知識遷移可訓練預測精度較高的聯邦模型。
針對目標a),本文設計了一種隱私保護加權梯度知識遷移策略(privacy protection weighted gradient knowledge transfer,PPWGKT),使用差分隱私保護的梯度對參與方數據實例進行加權訓練,并從理論上證明了知識遷移過程滿足ε-差分隱私;針對目標b),設計了若干組對比實驗,通過實驗結果說明所提方法可以訓練預測精度較高(即測試誤差較低)聯邦模型。
1.1 基本假設
1.2 DP-IBFTL方法設計
1.2.1 預處理階段
如圖1所示,預處理階段各方的最終目標是:根據由散列表決定的相似度,在其他方中為自己的每個實例找到一個對應的相似實例,從而構建相似矩陣S。
局部敏感散列(LSH)最早由Datar等人[27]于1998年提出,這是一種實現近似最近鄰搜索的算法。LSH使用散列值作為桶編號,其核心思想是:兩個相鄰的數據點(即兩個相似的數據點),它們的散列值有很大概率是相等的,會被映射到同一個桶中。LSH的關鍵在于盡可能地發現和產生散列沖突,實現最近鄰搜索。這與密碼學意義上的散列不同,密碼學中的散列算法都要求盡可能減少散列沖突。LSH會將多個輸入映射為相同的散列值輸出,一個輸入可以通過多次計算散列值被映射為一個散列值向量輸出,通過輸出無法判斷原始輸入的值,達到保護數據隱私的效果。
本文使用由Wang等人[28]提出的文獻[27]的改進算法——邊界擴展局部敏感散列(boundary-expanding LSH,BELSH)計算實例的散列值、構建散列表,考慮了散列桶邊界處實例的相似度。根據BELSH的散列沖突及單向性特點,使用BELSH計算實例的散列值,將實例的全局ID映射到對應的桶內,既能用散列值(桶編號)展示經過映射后的實例特征,又不會泄露實例真正的屬性特征。
1.2.2 訓練階段
2 理論分析
2.1 知識遷移過程滿足ε-差分隱私
2.2 DP-IBFTL方法開銷
假設M個參與方共同訓練T棵樹作為全局聯邦模型,全體參與方共有N個d維實例參與訓練,每一方都隨機生成了L個BELSH函數。
2.2.1 計算開銷
2.2.2 通信開銷
3 實驗結果與分析
3.1 實驗設置
3.2 不平衡率θ對于測試誤差的影響
3.3 參與方數量對于測試誤差的影響
4 結束語
本文提出了一種基于差分隱私保護知識遷移的聯邦學習方法DP-IBFTL,并為其設計了一種隱私保護加權梯度知識遷移策略PPWGKT,在知識遷移過程中實現了差分隱私保護。參與方首先使用BELSH計算全局散列表,然后根據全局散列表計算實例之間的相似度,根據相似度在各方之間交換相似實例的加噪梯度,最后用本地梯度與相似實例的梯度之和作為新的梯度,使用PPWGKT策略實現基于實例的差分隱私保護知識遷移。本文從理論上證明了所提的知識遷移過程滿足ε-差分隱私。實驗表明,DP-IBFTL方法可以有效改善聯邦模型的性能,提升預測精度、降低測試誤差,對數據集劃分方法和參與方數量的變化相對不敏感。
本文研究工作仍存在一些不足。首先,局部敏感散列中存在隨機參數,使得DP-IBFTL的預測結果會在一個區間內波動,單次訓練結果可能無法代表模型的實際表現,因此需要多次訓練,這無疑增加了不確定性,多次訓練也帶來了額外的計算開銷。其次,本文研究工作重點關注知識遷移過程中的隱私問題,而未考慮聯邦學習訓練過程中的隱私問題,各方之間交換的模型參數或模型本身,都存在潛在的隱私泄露風險。
在未來的工作中,首先,將訓練過程中各方交換本地模型導致的隱私間接泄露納入考慮,對可能泄露隱私的數據進行保護。其次,將考慮改進現有的差分隱私機制,以便在同等模型性能下降低所需的隱私預算,或在相同的隱私預算下提高模型性能。此外,考慮改進局部敏感散列算法,尋求更優的相似度計算策略,緩解隨機參數帶來的不確定性。
參考文獻:
[1]Zhang Chen, Xie Yu, Bai Hang, et al. A survey on federated lear-ning[J]. Knowledge-Based Systems, 2021,216: 106775.
[2]McMahan B, Moore E, Ramage D, et al. Communication-efficient learning of deep networks from decentralized data[C]//Proc of the 20th International Conference on Artificial Intelligence and Statistics. 2017: 1273-1282.
[3]Li Li, Fan Yuxi, Tse M, et al. A review of applications in federated learning[J]. Computers amp; Industrial Engineering, 2020,149: 106854.
[4]Yang Qiang, Liu Yang, Chen Tianjian, et al. Federated machine learning:concept and applications[J]. ACM Trans on Intelligent Systems and Technology, 2019,10(2): 1-19.
[5]Cheng Kewei, Fan Tao, Jin Yilun, et al. SecureBoost: a lossless fe-derated learning framework[J]. IEEE Intelligent Systems, 2021,36(6): 87-98.
[6]張君如, 趙曉焱, 袁培燕. 面向用戶隱私保護的聯邦安全樹算法[J]. 計算機應用, 2020,40(10): 2980-2985. (Zhang Junru, Zhao Xiaoyan, Yuan Peiyan. Federated security tree algorithm for user privacy protection[J]. Journal of Computer Applications, 2020,40(10): 2980-2985.)
[7]Liu Yang, Kang Yan, Xing Chaoping, et al. A secure federated transfer learning framework[J]. IEEE Intelligent Systems, 2020,35(4): 70-82.
[8]Yang Qiang, Liu Yang, Cheng Yong, et al. Federated learning[M]//Brachman R, Rossi F, Stone P. Synthesis Lectures on Artificial Intelligence and Machine Learning.Cham:Springer, 2019.
[9]Guha N, Talwalkar A, Smith V. One-shot federated learning[EB/OL]. (2019-03-05)[2022-07-11]. https://arxiv. org/abs/1902. 11175.
[10]Chen Yiqiang, Qin Xin, Wang Jindong, et al. FedHealth: a federated transfer learning framework for wearable healthcare[J]. IEEE Intelligent Systems, 2020,35(4): 83-93.
[11]He Chaoyang, Annavaram M, Avestimehr S. Group knowledge transfer: federated learning of large CNNS at the edge[J]. Advances in Neural Information Processing Systems, 2020,33: 14068-14080.
[12]Zhu Yuqing, Yu Xiang, Tsai Y H, et al. Voting-based approaches for differentially private federated learning[EB/OL]. (2021-02-16)[2022-07-11]. https://arxiv. org/abs/2010. 04851.
[13]Li Qinbin, He Bingsheng, Song D. Practical one-shot federated lear-ning for cross-silo setting[EB/OL]. (2021-05-20)[2022-07-11]. https://arxiv. org/abs/2010.01017.
[14]Wang K I, Zhou Xiaokang, Liang Wei, et al. Federated transfer learning based cross-domain prediction for smart manufacturing[J]. IEEE Trans on Industrial Informatics, 2021,18(6): 4088-4096.
[15]Zhang Wei, Li Xiang. Federated transfer learning for intelligent fault diagnostics using deep adversarial networks with data privacy[J]. IEEE/ASME Trans on Mechatronics, 2021,27(1): 430-439.
[16]Pan Yanghe, Ni Jianbing, Su Zhou. FL-PATE: differentially private federated learning with knowledge Transfer[C]//Proc of IEEE Global Communications Conference. Piscataway, NJ: IEEE Press, 2021: 1-6.
[17]Gao Dashan, Liu Yang, Huang Anbu, et al. Privacy-preserving heterogeneous federated transfer learning[C]//Proc of IEEE International Conference on Big Data. Piscataway, NJ: IEEE Press, 2019: 2552-2559.
[18]Sharma S, Xing Chaoping, Liu Yang, et al. Secure and efficient fe-derated transfer learning[C]//Proc of IEEE International Conference on Big Data. Piscataway, NJ: IEEE Press, 2019: 2569-2576.
[19]Ju Ce, Gao Dashan, Mane R, et al. Federated transfer learning for EEG signal classification[C]// Proc of the 42nd Annual International Conference of the IEEE Engineering in Medicine amp; Biology Society. Piscataway, NJ: IEEE Press, 2020: 3040-3045.
[20]Li Qinbin, Wen Zeyi, He Bingsheng. Practical federated gradient boosting decision trees[C]//Proc of the 34th AAAI Conference on Artificial Intelligence. Palo Alto, CA: AAAI Press, 2020:4642-4649.
[21]Li Qinbin, Wen Zeyi, Wu Zhaomin, et al. A survey on federated learning systems: vision, hype and reality for data privacy and protection[J]. IEEE Trans on Knowledge and Data Engineering, 2021,35(4): 1-44.
[22]Fu Chong, Zhang Xuhong, Ji Shouling, et al. Label inference attacks against vertical federated learning[C]//Proc of the 31st USENIX Security Symposium. Berkeley, CA: USENIX, 2022: 1-18.
[23]Nasr M, Shokri R, Houmansadr A. Comprehensive privacy analysis of deep learning: passive and active white-box inference attacks against centralized and federated learning[C]//Proc of IEEE Symposium on Security and Privacy. Piscataway, NJ: IEEE Press, 2019: 739-753.
[24]Dwork C, McSherry F, Nissim K, et al. Calibrating noise to sensiti-vity in private data analysis[C]// Proc of the 3rd Theory of Cryptography Conference. Berlin: Springer, 2006: 265-284.
[25]Li Tian, Sahu A K, Talwalkar A, et al. Federated learning: chal-lenges, methods, and future directions[J]. IEEE Signal Proces-sing Magazine, 2020,37(3): 50-60.
[26]Chen Tianqi, Guestrin C. XGBoost: a scalable tree boosting system[C]//Proc of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. New York: ACM Press, 2016: 785-794.
[27]Datar M,Immorlica N,Indyk P, et al. Locality-sensitive hashing scheme based on p-stable distributions[C]//Proc of the 20th Annual Symposium on Computational Geometry. New York:ACM Press, 2004:253-262.
[28]Wang Qiang, Guo Zhiyuan, Liu Gang, et al. Boundary-expanding locality sensitive hashing[C]//Proc of the 8th International Symposium on Chinese Spoken Language Processing. Piscataway, NJ: IEEE Press, 2012: 358-362.
[29]Luo Changyin, Chen Xuebin, Xu Jingcheng, et al. Research on privacy protection of multi source data based on improved GBDT federated ensemble method with different metrics[J]. Physical Communication, 2021, 49: 101347.
[30]Wen Zeyi, Liu Hanfeng, Shi Jiashuai, et al. ThunderGBM: fast GBDTs and random forests on GPUs[J]. Journal of Machine Learning Research, 2020,21(108): 1-5.
[31]Chang C C, Lin C J. LIBSVM data: classification (binary class)[EB/OL]. (2021-04-14)[2022-07-11]. https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html.