Code for the Federated Learning project.
The project is designed to run on google colab, to run it be sure to follow this steps:
- Install required packages:
pip install wandb pip install overrides
- Add Idda dataset in
data/idda
- Add GTA dataset in
data/gta
- If wandb must be used to save metrics and models, login using the command
wandb login
(otherwise add the argument--not_use_wandb
in run.py)
The repository supports experiments on the following datasets:
- Reduced Federated IDDA from FedDrive [1]
- Task: semantic segmentation for autonomous driving
- 24 users
- Reduced GTA
- Task: semantic segmentation for autonomous driving
- 20 classes
The run.py
orchestrates everything. All arguments need to be specified through the args
parameter (options can be found in config/args.py
).
Example of experiment:
python run.py
--project exam-project
--exp_name big-round
--seed 0
--training_ds idda
--test_ds idda
--model deeplabv3_mobilenetv2
--num_epochs 5
--bs 4
--optimizer SGD
--lr 0.1
--weight_decay 0
--momentum 0.9
--lr_policy poly
--lr_power 0.9
--lr_decay_step 15
--lr_decay_factor 0.1
--rrc_transform
--min_scale 0.5
--max_scale 2.0
--h_resize 756
--w_resize 1344
--norm eros_norm
--jitter
--phase all
--not_use_wandb
federated
--num_rounds 500
--clients_per_round 5
- ClAvBN:
- follow step 2 and 3 from the Environment section
- import the file
clavbn.sh
in Google Colab - run the command
!chmod +x clavbn.sh
in a code cell - run the command
!./clavbn.sh
- SiloBN:
- follow step 2 and 3 from the Environment section
- import the file
silobn.sh
in Google Colab - run the command
!chmod +x silobn.sh
in a code cell - run the command
!./silobn.sh
[1] Fantauzzo, Lidia, et al. "FedDrive: generalizing federated learning to semantic segmentation in autonomous driving." 2022 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). IEEE, 2022.