Skip to main content

PySyft: A Library for Easy Federated Learning

  • Chapter
  • First Online:
Federated Learning Systems

Abstract

PySyft is an open-source multi-language library enabling secure and private machine learning by wrapping and extending popular deep learning frameworks such as PyTorch in a transparent, lightweight, and user-friendly manner. Its aim is to both help popularize privacy-preserving techniques in machine learning by making them as accessible as possible via Python bindings and common tools familiar to researchers and data scientists, as well as to be extensible such that new Federated Learning (FL), Multi-Party Computation, or Differential Privacy methods can be flexibly and simply implemented and integrated. This chapter will introduce the methods available within the PySyft library and describe their implementations. We will then provide a proof-of-concept demonstration of a FL workflow using an example of how to train a convolutional neural network. Next, we review the use of PySyft in academic literature to date and discuss future use-cases and development plans. Most importantly, we introduce Duet: our tool for easier FL for scientists and data owners.

We thank the OpenMined community and contributors for their work making PySyft possible. For more information about OpenMined, find us on GitHub or slack. https://www.openmined.org/.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 139.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 179.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. S. Ahmed, R.S. Mula, S.S. Dhavala, A framework for democratizing ai (2020). arXiv:2001.00818

  2. H. Arora, Guided pate for scalable learning. https://www2.isye.gatech.edu/~fferdinando3/cfp/PPAI20/papers/paper_20.pdf. Accessed 29 May 2020

  3. M.U. Asad, A.A. Moustafa, T. Ito, A. Muhammad, Evaluating the communication efficiency in federated learning algorithms (2020). arXiv:2004.02738

  4. J.D. Beutel, T. Topal, A. Mathur, X. Qiu, T. Parcollet, N.D. Lane, Flower: a friendly federated learning research framework (2020)

    Google Scholar 

  5. F. Boemer, R. Cammarota, D. Demmler, T. Schneider, H. Yalame, Mp2ml: a mixed-protocol machine learning framework for private inference. Cryptology ePrint Archive, Report 2020/721 (2020), https://eprint.iacr.org/2020/721

  6. A. Chaulwar, Private dataset generation using privacy preserving collaborative learning (2020). arXiv:2004.13598

  7. S. Chen, D. Xue, G. Chuai, Q. Yang, Q. Liu, Fl-qsar: a federated learning based qsar prototype for collaborative drug discovery. bioRxiv (2020)

    Google Scholar 

  8. I. Damgård, M. Keller, E. Larraia, V. Pastro, P. Scholl, N.P. Smart, Practical covertly secure mpc for dishonest majority–or: breaking the spdz limits, in European Symposium on Research in Computer Security (Springer, 2013), pp. 1–18

    Google Scholar 

  9. I. Damgård, V. Pastro, N. Smart, S. Zakarias, Multiparty computation from somewhat homomorphic encryption, in Advances in Cryptology - CRYPTO 2012, ed. by R. Safavi-Naini, R. Canetti (Springer, Berlin, 2012), pp. 643–662

    Google Scholar 

  10. A. Das, T. Brunschwiler, Privacy is what we care about: experimental investigation of federated learning on edge devices, in Proceedings of the First International Workshop on Challenges in Artificial Intelligence and Machine Learning for Internet of Things, AIChallengeIoT’19, New York, NY, USA. Association for Computing Machinery (2019), pp. 39–42

    Google Scholar 

  11. Wang et al., Beyond inferring class representatives: user-level privacy leakage from federated learning (2018). arXiv:1812.00535

  12. A. Feraudo, P. Yadav, V. Safronov, D.A. Popescu, R. Mortier, S. Wang, P. Bellavista, J. Crowcroft, Colearn: enabling federated learning in mud-compliant iot edge networks, in Proceedings of the Third ACM International Workshop on Edge Systems, Analytics and Networking (2020), pp. 25–30

    Google Scholar 

  13. D. Gao, C. Ju, X. Wei, Y. Liu, T. Chen, Q. Yang, Hhhfl: hierarchical heterogeneous horizontal federated learning for electroencephalography (2019). arXiv:1909.05784

  14. Z. Ghodsi, T. Gu, S. Garg. Safetynets: verifiable execution of deep neural networks on an untrusted cloud, in Advances in Neural Information Processing Systems (2017), pp. 4672–4681

    Google Scholar 

  15. C. He, M. Annavaram, S. Avestimehr, Fednas: Federated deep learning via neural architecture search (2020)

    Google Scholar 

  16. C. He, S. Li, J. So, M. Zhang, H. Wang, X. Wang, P. Vepakomma, A. Singh, H. Qiu, L. Shen, P. Zhao, Y. Kang, Y. Liu, R. Raskar, Q. Yang, M. Annavaram, S. Avestimehr, Fedml: A research library and benchmark for federated machine learning (2020)

    Google Scholar 

  17. T. Hiessl, D. Schall, J. Kemnitz, S. Schulte, Industrial federated learning - requirements and system design (2020). arXiv:2005.06850

  18. M. Hirt, D. Tschudi, Efficient general-adversary multi-party computation, in International Conference on the Theory and Application of Cryptology and Information Security (Springer, 2013), pp. 181–200

    Google Scholar 

  19. H. Sixu, X. Yuan Li, Q.L. Liu, W. Zhaomin, B. He, The oarf benchmark suite: Characterization and implications for federated learning systems (2020)

    Google Scholar 

  20. S. Ickin, K. Vandikas, M. Fiedler, Privacy preserving qoe modeling using collaborative learning, in Proceedings of the 4th Internet-QoE Workshop on QoE-Based Analysis and Management of Data Communication Networks, Internet-QoE’19, New York, NY, USA. Association for Computing Machinery (2019), pp. 13–18

    Google Scholar 

  21. M. Jansson, M. Axelsson, Federated learning used to detect credit card fraud. Master’s thesis. Accessed 19 June 2020

    Google Scholar 

  22. D. Kahrobaei, A. Wood, K. Najarian, Homomorphic encryption for machine learning in medicine and bioinformatics. ACM Comput. Surv. (2020)

    Google Scholar 

  23. P. Kairouz, H.B. McMahan, B. Avent, A. Bellet, M. Bennis, A.N. Bhagoji, K. Bonawitz, Z. Charles, G. Cormode, R. Cummings, R.G.L. D’Oliveira, S.E. Rouayheb, D. Evans, J. Gardner, Z. Garrett, Adrion, B. Ghazi, P.B. Gibbons, M. Gruteser, Z. Harchaoui, C. He, L. He, Z. Huo, B. Hutchinson, J. Hsu, M. Jaggi, T. Javidi, G. Joshi, M. Khodak, J. Konecný, A. Korolova, F. Koushanfar, S. Koyejo, T. Lepoint, Y. Liu, P. Mittal, M. Mohri, R. Nock, A. Özgür, R. Pagh, M. Raykova, H. Qi, D. Ramage, R. Raskar, D. Song, W. Song, S.U. Stich, Z. Sun, A.T. Suresh, F. Tramèr, P. Vepakomma, J. Wang, L. Xiong, Z. Xu, Q. Yang, F.X. Yu, H. Yu, S. Zhao, Advances and Open Problems in Federated Learning (2019). arXiv:1912.04977 [cs, stat]

  24. G.A. Kaissis, M.R. Makowski, D. Rückert, R.F. Braren, Secure, privacy-preserving and federated machine learning in medical imaging. Nat. Mach. Intell. 1–7 (2020)

    Google Scholar 

  25. J. Kang, Z. Xiong, C. Jiang, Y. Liu, S. Guo, Y. Zhang, D. Niyato, C. Leung, C. Miao, Scalable and communication-efficient decentralized federated edge learning with multi-blockchain framework (2020)

    Google Scholar 

  26. D. Kawa, S. Punyani, P. Nayak, A. Karkera, V. Jyotinagar, Credit risk assessment from combined bank records using federated learning. Int. Res. J. Eng. Technol. (IRJET) 6 (2019)

    Google Scholar 

  27. Q. Li, Z. Wen, B. He, Federated learning systems: Vision, hype and reality for data privacy and protection (2019). arXiv:1907.09693

  28. W.Y.B. Lim, N.C. Luong, D.T. Hoang, Y. Jiao, Y. Liang, Q. Yang, D. Niyato, C. Miao, Federated learning in mobile edge networks: a comprehensive survey. IEEE Commun. Surv. Tutor. 22(3), 2031–2063 (2020)

    Article  Google Scholar 

  29. Y. Liu, H. Li, J. Xiao, H. Jin, Floc: fingerprint-based indoor localization system under a federated learning updating framework, in 2019 15th International Conference on Mobile Ad-Hoc and Sensor Networks (MSN) (2019), pp. 113–118

    Google Scholar 

  30. Y. Liu, J.J.Q. Yu, J. Kang, D. Niyato, S. Zhang, Privacy-preserving traffic flow prediction: a federated learning approach. IEEE Internet Things J. 7(8), 7751–7763 (2020)

    Article  Google Scholar 

  31. Y. Liu, S. Garg, J. Nie, Y. Zhang, Z. Xiong, J. Kang, M.S. Hossain, Deep anomaly detection for time-series data in industrial iot: a communication-efficient on-device federated learning approach. IEEE Internet Things J. 1–1 (2020)

    Google Scholar 

  32. Y. Liu, S. Zhang, C. Zhang, J.J.Q. Yu, Fedgru: Privacy-preserving traffic flow prediction via federated learning (2020)

    Google Scholar 

  33. R. Mayer, H.-A. Jacobsen, Scalable deep learning on distributed infrastructures: challenges, techniques, and tools. ACM Comput. Surv. 53(1) (2020)

    Google Scholar 

  34. C. Milani, Protecting against linkage attacks that use ‘anonymous data’

    Google Scholar 

  35. A. Neupane, Homomorphic learning: a privacy-focused approach to machine learning. IEEE Comput. Soc. (2019)

    Google Scholar 

  36. J. Passerat-Palmbach, T. Farnan, R. Miller, M.S. Gross, H. Flannery, B. Gleim, A blockchain-orchestrated federated learning architecture for healthcare consortia (2019). arXiv:1910.12603

  37. A. Paszke, et al., Basic MNIST example (2016). Accessed 15 Nov 2020

    Google Scholar 

  38. A. Qayyum, J. Qadir, M. Bilal, A. Al-Fuqaha, Secure and robust machine learning for healthcare: a survey (2020). arXiv:2001.08103

  39. N. Rodríguez-Barroso, G. Stipcich, D. Jiménez-López, J.A. Ruiz-Millán, E. Martínez-Cámara, G. González-Seco, M.V. Luzón, M.A. Veganzones, F. Herrera, Federated learning and differential privacy: software tools analysis, the sherpa.ai fl framework and methodological guidelines for preserving data privacy. Inf. Fus. 64, 270–292 (2020)

    Google Scholar 

  40. T. Ryffel, D. Pointcheval, F. Bach, Ariann: low-interaction privacy-preserving deep learning via function secret sharing (2020)

    Google Scholar 

  41. N.C. Sameer Wagh, D. Gupta, Securenn: 3-party secure computation for neural network training (2018)

    Google Scholar 

  42. S. Singh, S. Bhardwaj, H. Pandey, G. Beniwal, Anomaly detection using federated learning, in Proceedings of International Conference on Artificial Intelligence and Applications, ed. by P. Bansal, M. Tushir, V.E. Balas, R. Srivastava, vol. 1164 (Springer Singapore, Singapore, 2021), pp. 141–148

    Google Scholar 

  43. A. Süzen, M. Simsek, A novel approach to machine learning application to protection privacy data in healthcare: federated learning. Namik Kemal Tip Dergisi 8, 22–30 (2020)

    Google Scholar 

  44. F. Tang, J. Hao, J. Liu, H. Wang, M. Xian, PFDLIS: privacy-preserving and fair deep learning inference service under publicly verifiable covert security setting. Electronics 8(12), 1488 (2019)

    Article  Google Scholar 

  45. C. Waites, PyVacy: towards practical differential privacy for deep learning. Ph.D. Thesis, Georgia Institute of Technology, Atlanta, GA, USA, 2019

    Google Scholar 

  46. Y. Xia, Watermarking federated deep neural network models. G2 pro gradu, diplomityö. Accessed 16 March 2020

    Google Scholar 

  47. R. Xu, N. Baracaldo, Y. Zhou, A. Anwar, H. Ludwig, Hybridalpha: an efficient approach for privacy-preserving federated learning, in Proceedings of the 12th ACM Workshop on Artificial Intelligence and Security, AISec’19, New York, NY, USA. Association for Computing Machinery (2019), pp. 13–23

    Google Scholar 

  48. C. Yang, Q.P. Wang, M. Xu, S. Wang, K. Bian, X. Liu, Heterogeneity-aware federated learning (2020)

    Google Scholar 

  49. Q. Yang, Y. Cheng, Y. Kang, T. Chen, H. Yu, Federated Learning, vol. 13, 3rd edn. (Morgan & Claypool Publishers, San Rafael, 2019)

    Google Scholar 

  50. X. Zhu, J. Wang, Z. Hong, T. Xia, J. Xiao, Federated learning of unsegmented chinese text recognition model, in 2019 IEEE 31st International Conference on Tools with Artificial Intelligence (ICTAI) (2019), pp. 1341–1345

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Georgios Kaissis .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Ziller, A. et al. (2021). PySyft: A Library for Easy Federated Learning. In: Rehman, M.H.u., Gaber, M.M. (eds) Federated Learning Systems. Studies in Computational Intelligence, vol 965. Springer, Cham. https://doi.org/10.1007/978-3-030-70604-3_5

Download citation

Publish with us

Policies and ethics