Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: arxiv.org, wiley.com -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: marielonfils
- Language: Jupyter Notebook
- Default Branch: main
- Size: 33.1 MB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
MKFL: practical tool for Secure Federated Learning
MKFL is a privacy-preserving federated learning tool based on the xMK-CKKS encryp tion scheme.
- Client data security is provided by the xMK-CKKS homomorphic multi-key encryption scheme [1]. The parameters communicated between the clients and the server are encrypted using the aggregated public key and can only be decrypted by the collaboration of all clients.
<!---- Contribution evaluation [2] is realized by a trusted server computing the Shapley value [3] of each client update. We implemented three client elimination methodologies based on it :
- delete_one: the client with the Shapley value the most under the threshold is discarded.
- delete : all clients with Shapley values under the threshold are discarded.
- set_aside : all client with Shapley values under the threshold are discarded but are given the opportunity rejoin the process at the next contribution evaluation. --->
Table of Contents
Installation
Works with Python 3.10.12.
<!---1. Clone the repository:
bash
git clone git@github.com:marielonfils/CCAFLR.git
2. Clone the dependencies repositories and install them:
bash
git clone git@github.com:marielonfils/flower.git
cd flower
pip install .
git clone git@github.com:marielonfils/TenSEAL.git
cd TenSEAL
pip install.
--->
- Install the dependencies repositories and install them:
Download flower from https://anonymous.4open.science/r/flower-4103/README.md.
bash
cd flower
pip install .
Download TenSEAL from https://anonymous.4open.science/r/TenSEAL-8F2A/README.md.
bash
cd TenSEAL
pip install .
- Install dependencies:
bash cd CCAFLR pip install -r requirements.txt pip install pyg_lib torch_geometric torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.4.0+cpu.html pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cpu
Usage
Scripts
The CCAFLR/src/FL folder contains bash scripts to run easily the federated learning task on a single machine: - fl_run.sh : without encryption and without contribution evaluation - flrunenc.sh : with encryption but without contribution evaluation
Do not forget to replace the address of the server at the end of the src/FL/flclientenc.py or src/FL/fl_client.py. <!---- ce_run.sh : without encryption but with contribution evaluation - cerunenc.sh : with encryption and with contribution evaluation. --->
Manually
If you want to run each component manually, you need to run the aggregation server, the contribution evaluation server and the clients.
To run the secure server, use the following command in CCAFLR/src/:
python
python FL/fl_server_enc.py --nclients [number of clients] --nrounds [number of rounds] --filepath [folder path to store results] --dataset [split_scdg1] [--noce]
<!-----methodo [deleteone/delete/setaside] --threshold [threshold value]
The noce option specifies that no contribution evaluation should be done. In that case, it is unnecessary to specify the methodo and threshold options.--->
To run the federated learning task without encryption, replace the filenames of the server and the clients by fl_server.py and fl_client.py, respectively. <!--- and remove the enc* option from the CE server command.--->
Do not forget to replace the address of the server at the end of the src/FL/flclientenc.py or src/FL/fl_client.py.
Modify the database used
In the init_datasets function of src/FL/main_utils: - add a branch with the name of the dataset - create a Dataset object and provide it an initialization function - call init_db on the new Dataset and return it
Modify the model used
In the get_model function of src/FL/main_utils: - add a branch with the name of the model - initialize your model - create a Model object and provide your model to it - return the Model object
Docker Installation and Usage
Docker image can be created with
bash
docker build ./ -t ccaflr
Note that the build takes about 25-30 minutes.
To run the secure federated learning framework (without contribution evaluation) on a single machine docker compose can be used
bash
docker compose up -d
.env file contains parameters for docker compose: number of clients, number of rounds, dataset name, model name, path to the dataset, and path to a folder to output results.
Latest execution logs can be checked with
bash
docker compose logs
Examples
Example datasets are provided in src/databases.
The first one is the directory examples_samy. It contains graphical representation of malware. The dataset to give as parameter is example_samy and the model is GINE.
The second dataset is example_images.zip. It contains image representations of malware. It should first be unzipped in a folder of the same name. The dataset to give as parameter is example_images and the model is images.
References
[1] Ma, Jing, et al. "Privacy-preserving Federated Learning based on Multi-key Homomorphic Encryption." arXiv preprint arXiv:2104.06824 (2021). [2] Liu, Zelei, et al. "CAreFL: Enhancing smart healthcare with Contribution‐Aware Federated Learning." AI Magazine 44.1 (2023): 4-15. [3] Shapley, Lloyd S. "A value for n-person games." (1953): 307-317.
Owner
- Login: marielonfils
- Kind: user
- Repositories: 1
- Profile: https://github.com/marielonfils
Citation (CITATION.cff)
cff-version: 1.0.0 message: "If you use this software, please cite it as below." authors: - family-names: "Lonfils" given-names: "Marie" - family-names: "Lucca" given-names: "Serena" title: "Secure Federated Learning with Contribution Evaluation" version: 1.0.0 date-released: 2024-06-19 url: "https://github.com/marielonfils/CCAFLR"
GitHub Events
Total
- Delete event: 3
- Member event: 1
- Push event: 24
- Pull request event: 9
- Create event: 5
Last Year
- Delete event: 3
- Member event: 1
- Push event: 24
- Pull request event: 9
- Create event: 5