Lightweight Blockchain-Empowered Secure and Efficient Federated Edge Learning
This repository contains the code of our paper, Lightweight Blockchain-Empowered Secure and Efficient Federated Edge Learning.
Environment
The golang environment (Go 1.16). The release of the Go 1.16 can be found here, and the installation instruction can be found here.
Python 3.7 is required for the go-python library go-python3.
IPFS 0.19.0. Instruction for IPFS installation can be found at https://docs.ipfs.tech/install/command-line/#system-requirements.
Packge requirement
| Package |
Version |
| pytorch |
1.7.1 |
| numpy |
1.18.1 |
| scipy |
1.4.1 |
| torchvision |
0.8.2 |
The reuqired go packages will be automatically downloaded when run the experiment.
Data
FEMNIST: from the LEAF benchmark suite, with the relevant downloading and preprocessing instructions here. The command-line arguments for the LEAF preprocessing utility used were to generate the full-sized non-iid dataset, with minimum 15 samples/user, sample-based 80-20 train-test split were: ./preprocess.sh -s niid --sf 1.0 -k 15 -t sample --tf 0.8. The resulting training .json files files should then be copied to ../data/FEMNIST_data/train and the testing files to ../data/FEMNIST_data/test.
CIFAR10: can be downloaded here. The extracted file should be copied to ../data/CIFAR10_data/.
Hyperparameters
The hyperpearemeters about the blockchain are set in chain/variables.go。 client/variables_FL.go contains the set hyperparameters for the FL task.
Project running
First start the IPFS by running ipfs deamon, then
go run main.go