Skip to content

Latest commit

 

History

History
290 lines (244 loc) · 9.47 KB

README.md

File metadata and controls

290 lines (244 loc) · 9.47 KB

MONAI-FL

This repository contains the basic federated learning example of monai code considering substra's opener and algo classes.

Table of Contents

  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgements

About The Project

MONAI-FL is planned to be a tool-agnostic federated learning platform for medical imaging applications. We envision the below-mentioned architecture for our code-base, however, please feel free to modify the code-base considering your own application requirements.

MONAI-FL

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

Following platforms are neccessary to run this project.

  • Linux Installation (preferably Ubuntu distributions). [For other Operating Systems, you can try and share your experience with us :-)]

  • install visual studio code

    https://code.visualstudio.com/docs/setup/linux
  • install conda environment

    https://docs.conda.io/en/latest/

Installation

  1. Clone the repo
    git clone https://github.com/habibcomsats/monaifl.git
  2. Create conda environment
    conda create -n monaifl python=3
  3. Activate conda environment
    conda activate monaifl
  4. Install your system compatible pytorch version
    https://pytorch.org/get-started/locally/
  5. Install MONAI with Nibabel and TQDM
https://docs.monai.io/en/latest/installation.html
  1. Install grpc with python compiler
python -m pip install grpcio
python -m pip install grpcio-tools
  1. Install Pandas
conda install pandas
  1. Install Numpy
conda install numpy

Running Centralized FL Workflows

MONAI-FL

Reference notebook https://github.com/Project-MONAI/tutorials/blob/master/2d_classification/mednist_tutorial.ipynb

Mount the dataset: This repository contains the demo dataset. If you are cloning this repository, you do not need to mount any dataset. Otherwise, you must execute the cell 5 from the reference notebook, extract the dataset at your preferred location and set the path in testmonai.py

Running FL Nodes first:

  1. Open a new terminal
  2. Activate conda environment
  3. Navigate into code repository (currently it is not dockerized)
$ cd monaifl/hubnspoke
  1. Run the node at each terminal@($monaifl/hubnspoke/)
  python flnode/node1.py
  python flnode/node2.py

Running Hub:

  1. Open a new terminal
  2. Activate conda environment
  3. Navigate into code repository (currently it is not dockerized)
$ cd monaifl/hubnspoke
  1. Run the hub@($monaifl/hubnspoke/)
python hub/start.py

CAUTION: The Hub side code does not require any GPU installation but for the client side you must have a CUDA-enabled device to initiate the training.

Running Decentralized FL Workflows

Reference notebook

https://github.com/Project-MONAI/tutorials/blob/master/2d_classification/mednist_tutorial.ipynb

Mount the dataset: This repository contains the demo dataset. If you are cloning this repository, you do not need to mount any dataset. Otherwise, you must execute the cell 5 from the reference notebook, extract the dataset at your preferred location and set the path in testmonai.py

Running Server:

  1. Open a new terminal
  2. Activate conda environment
  3. Navigate into code repository (currently it is not dockerized)
$ cd monaifl/decentral_fl
  1. Run the server@($monaifl/decentral_fl/)
  python aggregator/src/server.py

Running Client:

  1. Open two new terminals
  2. Activate conda environment in both terminals
  3. Navigate into code repository (currently it is not dockerized)
$ cd monaifl/decentral_fl
  1. Run the client at each terminal@($monaifl/decentral_fl/)
python trainer/client1.py
python trainer/client2.py

CAUTION: The server side code does not require any GPU installation but for the client side you must have a CUDA-enabled device to initiate the training.

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Habib Rehman - @habibcomsats - email (habibcomsats@gmail.com or mhrehman@ieee.org)

Project Link: https://github.com/habibcomsats/monaifl

Acknowledgements