{"id":15455860,"url":"https://github.com/jopasserat/federated-learning-tutorial","last_synced_at":"2025-04-21T15:01:48.806Z","repository":{"id":45584394,"uuid":"512053848","full_name":"jopasserat/federated-learning-tutorial","owner":"jopasserat","description":"Hands-on part of the Federated Learning and Privacy-Preserving ML tutorial given at VISUM 2022","archived":false,"fork":false,"pushed_at":"2022-07-22T11:18:32.000Z","size":119,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T00:59:34.887Z","etag":null,"topics":["differential-privacy","dp-sgd","federated-learning","flower","medical-imaging","opacus","ppml","privacy-enhancing-technologies","privacy-preserving-machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jopasserat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-08T23:59:00.000Z","updated_at":"2023-12-24T04:10:55.000Z","dependencies_parsed_at":"2022-08-26T02:42:57.145Z","dependency_job_id":null,"html_url":"https://github.com/jopasserat/federated-learning-tutorial","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jopasserat%2Ffederated-learning-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jopasserat%2Ffederated-learning-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jopasserat%2Ffederated-learning-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jopasserat%2Ffederated-learning-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jopasserat","download_url":"https://codeload.github.com/jopasserat/federated-learning-tutorial/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249834788,"owners_count":21331988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["differential-privacy","dp-sgd","federated-learning","flower","medical-imaging","opacus","ppml","privacy-enhancing-technologies","privacy-preserving-machine-learning"],"created_at":"2024-10-01T22:21:17.081Z","updated_at":"2025-04-20T00:59:45.793Z","avatar_url":"https://github.com/jopasserat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FL simulation with medical imaging classification task\n\n\nThis code splits the Pathology MedMNIST dataset into `pool_size` partitions (user defined) and does a few rounds of training.\n\n\n## Requirements\n\n*    Flower 0.19.0\n*    A recent version of PyTorch. This example has been tested with Pytorch 1.11.0\n*    A recent version of Ray. This example has been tested with Ray 1.11.1.\n\n\n### Install\n\nCreate a new Conda environment with Python 3.9, the following commands will isntall all the dependencies needed:\n```\nconda create --name my_project_env --file conda-linux-64.lock\npoetry install\n```\n\n### Updating the environment\n\n```\n# Re-generate Conda lock file(s) based on environment.yml\nconda-lock -k explicit --conda mamba\n# Update Conda packages based on re-generated lock file\nmamba update --file conda-linux-64.lock\n# Update Poetry packages and re-generate poetry.lock\npoetry update\n```\n\n## How to run\n\nThis example:\n\n1. Downloads Pathology MedMNIST\n2. Partitions the dataset into N splits, where N is the total number of\n   clients. We refere to this as `pool_size`. The partition can be IID or non-IID\n4. Starts a Ray-based simulation where a % of clients are sample each round.\n   This example uses N=3, so 3 clients will be sampled each round.\n5. After the M rounds end, the global model is evaluated on the entire testset.\n   Also, the global model is evaluated on the valset partition residing in each\n   client. This is useful to get a sense on how well the global model can generalise\n   to each client's data.\n\nThe command below will assign each client 1 CPU threads. If your system does not have 1xN(=3) = 3 threads to run all 3 clients in parallel, they will be queued but eventually run. The server will wait until all N clients have completed their local training stage before aggregating the results. After that, a new round will begin.\n\n```bash\n$ python main.py --num_client_cpus 2 # note that `num_client_cpus` should be \u003c= the number of threads in your system.\n```\n\n## References\n\n- MedMNIST code adapted from this [Getting Started](https://github.com/MedMNIST/MedMNIST/blob/d8422ac64028488133fd21ff54372729e12bbaba/examples/getting_started.ipynb) example.\n- Flower code adapted from this example: https://github.com/adap/flower/tree/2d45f12189984c2901d54e295f5c684b07039bd8/examples/simulation_pytorch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjopasserat%2Ffederated-learning-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjopasserat%2Ffederated-learning-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjopasserat%2Ffederated-learning-tutorial/lists"}