Exploring Federated Learning for Semantic Segmentation in Autonomous Driving and Satellite Images Scenarios
The repository supports experiments on the following datasets:
- Reduced Federated IDDA from FedDrive [2]
- Task: semantic segmentation for autonomous driving
- 24 users
- Reduced GTA5
- Task: semantic segmentation for autonomous driving
- downloadGta.py available to download it.
- Reduced LoveDA
- Task: semantic segmentation for satellite/aerial imagery.
- downloadLoveda.py available to download it.
NOTE: to use the scripts and download the files run before (if needed): pip install pymegatools
The main.py
setup the whole application. All arguments need to be specified through the args
parameter (options can be found in utils/args.py
).
Example of experiments:
- IDDA
python main.py --dataset idda --centr --model deeplabv3_mobilenetv2 --num_rounds 200 --num_epochs 20 --clients_per_round 8
- GTA5
python main.py --dataset idda --model deeplabv3_mobilenetv2 --num_rounds 200 --num_epochs 2 --clients_per_round 8
- GTA as source and IDDA as target
python main.py --dataset idda --fda --model deeplabv3_mobilenetv2 --num_rounds 200 --num_epochs 2 --clients_per_round 8
Some checkpoints are already available in the repo. In particular they are located in models/checkpoints
.
To reproduce the result you can use the args --load_from (e.g.):
- GTA as source and IDDA as target (FDA + Pseudo)
python main.py --dataset idda --fda --model deeplabv3_mobilenetv2 --load_from "models/checkpoints/gta5_fda.pth" --num_rounds 200 --num_epochs 2 --clients_per_round 8
- Loveda (Pseudo)
python main.py --dataset loveda --fda --model deeplabv3_mobilenetv2 --load_from "models/checkpoints/loveda_nofda.pth" --num_rounds 200 --num_epochs 2 --clients_per_round 8
- GTA5 CENTR TRANSFORMER
python main.py --dataset gta5 --model segformer --transformer_model b1 --load_from "models/checkpoints/gta5_nofda.pth" --num_rounds 1 --num_epochs 1 --clients_per_round 1
Load the best checkpoint of the model trained on gta5 dataset + FDA transformation.
Load the best checkpoint of the model trained on gta5 dataset w/o FDA.
Load the best checkpoint of the model trained loveda.
All the checkpoints are saved on a run of 100 epochs.
For other checkpoints (e.g. Segformer checkpoints): Drive Checkpoints