Published May 16, 2025
| Version v1
Software
Open
PARSIFAL: Private and Robust Sign Federated Learning
Authors/Creators
Description
This is the software for the paper PARSIFAL: Private and Robust Sign Federated Learning (KDD '25).
Preparation
Environment
The codes were tested with
python 3.9.Dependencies:
FFHT_unofficial==0.3mclbn256==1.3.5nltk==3.8.1numpy==1.25.2ogb==1.3.6pandas==1.4.4pycryptodome==3.20.0pycryptodomex==3.20.0scikit_learn==1.4.1.post1scipy==1.14.1torch==2.2.1+cu118torch_geometric==2.5.3torcheval==0.0.7torchmetrics==1.3.1torchvision==0.17.1+cu118tqdm==4.66.1
Data
Run
proc_data.py to preprocess the datasets for Federated Learning.Modify the main section in
proc_data.py to configure the number of clients and non-iid parameter.Run PARSIFAL
How to Run Tests
Run
run_test.pyHow to Customize Configuration
Running PARSIFAL with specified configurations needs 4 steps:
1. Configure PARSIFAL algorithm:
conf = get_rosin_config(dataset, use_rkds, global_lr, rkds_th, using_ss)-
dataset: str, optional values including ['mnist', 'cifar10', 'imdb', 'pcba']-
use_rkds: bool, set to True to activate density verification of PARSIFAL-
global_lr: float, learning rate for Model Owner to update global model, independent with learning rate in local training, typical value [1e-4, 1e-3]-
rkds_th: float, threshold for PARSIFAL to detect malicious clients, large threshold -> more clients might be regarded as malicious, 0 -> disable, typical value 0.8-
using_ss: bool, set to True to enable secret sharing2. Configure Federated Learning:
conf = set_fl_config(conf, n_clients, dataset_alpha, malicious_type, malicious_clients)-
n_clients: int, total number of data owners (including benign and malicious), default 100-
dataset_alpha: float, split dataset by Dirichlet distribution Dir(alpha) when alpha in (0, +inf), small alpha -> high non-IIDness, set to None or 0 for IID-
malicious_type: str, attack type, optional values: 'poi' for label flipping attack, 'neg' for gradient flipping attack-
malicious_clients: int, amount of malicious participants3. (Optional) Configure more settings: There are other settings in object
conf. Use conf.property = value to set them. Most are not needed to set or modify for PARSIFAL test, just leaving them as default. Some useful parameters are listed below:-
rkds_r: int, sketch rows, typically [10, 1000]-
rkds_b: int, log2(sketch columns), typically [1, 5]-
batch: int, batch size in local training of each client-
learning_rate: float, learning rate of local training-
train_epoch: int, global rounds of FL4. Start test:
test_config(config=conf)Files
Files
(226.2 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:905b5a849fee372161fd8ae4c0fe602d
|
5.7 kB | Download |
|
md5:b26f849829596f58cdade99abc75004d
|
28.3 kB | Download |
|
md5:40bbb8ef61d5045c816d448b4c117d8e
|
24.7 kB | Download |
|
md5:e5d235d7c303dde3fff08f17acebd9cb
|
602 Bytes | Download |
|
md5:b0cad4ca681190505df2c1a2c09f5d28
|
17.6 kB | Download |
|
md5:712def017e491e7ee7d2d2590571b99f
|
19.9 kB | Download |
|
md5:114a7ed46798caa3954235a30cb71734
|
12.9 kB | Download |
|
md5:7f0901b71a83dde75abda9fb57a7a5e8
|
7.4 kB | Download |
|
md5:f83439d0e84d95aedc5f3b96836ce878
|
7.5 kB | Download |
|
md5:04f9ec597771b3eacc7170f9ccf91f41
|
24.4 kB | Download |
|
md5:efd1c42eec4536664d62939b614359c2
|
9.2 kB | Download |
|
md5:302e1d9b0a20d31607f7cc28efd8bd70
|
35.4 kB | Download |
|
md5:0fb46d953ab9d01d92aacd506f497db4
|
32.8 kB | Download |
Additional details
Software
- Programming language
- Python