Most of the datasets supported by this benchmark are integrated into torchvision.datasets, expect Tiny-ImageNet-200, Covid-19, Organ-S/A/CMNIST, DermaMNIST.
For those datasets, download scripts are in folder data/download.
e.g.
cd data/download
sh tiny_imagenet.sh📢 All arguments have their default value.
| Arguments for general datasets | Description |
|---|---|
--dataset, -d |
The name of dataset. |
--iid |
Non-zero value for randomly partitioning data and disabling all other Non-IID partition methods. |
--client_num, -cn |
The amount of clients. |
--split, -sp |
Chooses from [sample, user]. user: partition clients into train-test groups; sample: partition each client's data samples into train-test groups. |
--val_ratio, -vr |
Propotion of valset data/clients. |
--test_ratio, -tr |
Propotion of testset data/clients. |
--plot_distribution, -pd |
Non-zero value for saving data distribution image. |
⭐ For CIFAR-100 specifically, this benchmark supports partitioning it into the superclass category (CIFAR-100's 100 classes can also be classified into 20 superclasses) by setting --super_class to non-zero.
Partition data evenly. Client data distributions are similar to each other. Note that this setting has the highest priority, means that activating this scheme will disable all others.
✨ IID partition can only process partial datasets and combines other Non-IID schemes.
--iid: Need to set in[0, 1].
python generate_data.py -d cifar10 --iid 1 -cn 20# 50% data are partitioned IID, and the rest 50% are partitioned according to dirichlet parititon scheme: Dir(0.1)
python generate_data.py -d cifar10 --iid 0.5 --alpha 0.1 -cn 20Refers to Measuring the Effects of Non-Identical Data Distribution for Federated Visual Classification (FedAvgM). Dataset would be splitted according to
--alpha, -a: The parameter for controlling intensity of label heterogeneity.--min_samples_per_client, -ms: The parameter for defining the minimum number of samples each client would be distributed. A small--min_samples_per_clientalong with small--alphaor big--client_nummight considerablely prolong the partition.
python generate_data.py -d cifar10 -a 0.1 -cn 20FL-bench ignores the test set of Tiny-ImageNet-200 due to it is unlabeled.


