Skip to content

An adaptive batch homomorphic encryption framework for cross-device Federated Learning, which determines cost-efficient and sufficiently secure encryption strategies for clients with heterogeneous data and system capabilities.

License

Notifications You must be signed in to change notification settings

liyan2015/AdaptiveBatchHE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AdaptiveBatchHE

This repository provides the implementation of the paper "Adaptive Batch Homomorphic Encryption for Joint Federated Learning in Cross-Device Scenarios", which is published in IEEE INTERNET OF THINGS JOURNAL. In this paper, we propose an adaptive batch HE framework for cross-device FL, which determines cost-efficient and sufficiently secure encryption strategies for clients with heterogeneous data and system capabilities. Our framework can achieve comparable accuracy to plain HE (i.e., encryption applied per gradient), while reducing training time by 3×-31×, and communication cost by 45×-66×.

Training time over 100 epochs Testing accuracy over epochs Communication cost in one epoch Cost efficiency under various HE key sizes

Our framework consists of the following three key components:

1. Clustering of Clients based on Sparsity of CNNs

The code in the folder CNN Sparisty is for determining the sparsity vectors of clients.

federated_main.py is the main function.

The input is the path of the dataset.

2. Selection of HE Key Size for Each Client based on Fuzzy Logic

The code in the folder fuzzy logic is for determining the HE key size of clients.

fuzzy_logic_main.py is the main function.

There are three inputs: input_NS, input_TR, and input_CC.

Their values are between 0 and 1.

3. Accuracy-lossless Batch Encryption and Aggregation

The code in the folder batch encryption is for accuracy-lossless batch encryption and aggregation of model parameters for FL training.

federated_experiment_main.py is the main function.

The code needs a proper hyperparameter K to run correctly, of which reason has been explained with detail in the paper. The default K value is 4. For specific settings, please refer to the comments in the code.

Prerequisites

To run the code, it needs some libraies:

  • Python >= 3.8
  • Pytorch >= 1.10
  • torchvision >= 0.11
  • phe >= 1.5
  • skfuzzy >= 0.4

Our environment is shown in the file, named environment.yaml.

Citing

If you use this repository, please cite:

@article{han2023adaptiveBatchHE,
  title={Adaptive Batch Homomorphic Encryption for Joint Federated Learning in Cross-Device Scenarios},
  author={Han, Junhao and Yan, Li},
  journal={IEEE Internet of Things Journal},
  volume={Early Access},
  year={2023},
  publisher={IEEE}
}

About

An adaptive batch homomorphic encryption framework for cross-device Federated Learning, which determines cost-efficient and sufficiently secure encryption strategies for clients with heterogeneous data and system capabilities.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages