The repo contains the code to reproduce the experiments presented in the paper:
Catalfamo, Alessio, Villari, Massimo, and Galletta, Antonino.
Fedsnr: Enhancing Federated Learning Aggregation Using Signal-to-Noise Ratio in MRI Analysis.
SSRN, 2025.
https://ssrn.com/abstract=5357509
https://doi.org/10.2139/ssrn.5357509
If you want to reproduce the tests of the paper, you can follow the steps below.
Create a virtual environment and activate it:
python3 -m venv venv
source venv/bin/activateInstall the required packages:
pip install -r requirements.txtNavigate to the folder test-reproduction:
cd test-reproductionRun the partition generator script with 30 partitions (Run both iid and dirichlet to reproduce all the combinations of the paper):
python3 partition-generator.py --type-partitions-provided [iid|dirichlet] --num-partitions 30 --dataset [alzheimer|brain-tumor]Run the partition server to serve the generated partitions:
python3 server-partition.pyOpen the fedmriapp/pyproject.toml file and set the number of GPUs available for client applications.
If you don't have GPUs, set it to 0.
[tool.flwr.federations.local-simulation-gpu]
options.backend.client-resources.num-cpus = 1 # each ClientApp assumes to use 2CPUs
options.backend.client-resources.num-gpus = <number_of_gpus> # at most 5 ClientApp will run in a given GPUTo reproduce the paper resultsplease open the fedmriapp/pyproject.toml file and modify the following line:
options.num-supernodes= NWhere N is 20 for the alzheimer dataset and 30 for the brain-tumor dataset. Even if during the partition generation you created 30 partitions for both datasets, alzheimer experiments do not exploit the whole dataset.
In a new terminal, navigate to the test-reproduction folder and run the experiment script:
./test_exec.sh 42 20 alzheimer./test_exec.sh 42 30 brain-tumorfor the alzheimer dataset