This repository contains the basic federated learning example of monai code considering substra's opener and algo classes.
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.
To get a local copy up and running follow these simple steps.
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/
- Clone the repo
git clone https://github.com/habibcomsats/monaifl.git
- Create conda environment
conda create -n monaifl python=3
- Activate conda environment
conda activate monaifl
- Install your system compatible pytorch version
https://pytorch.org/get-started/locally/
- Install MONAI with Nibabel and TQDM
https://docs.monai.io/en/latest/installation.html
- Install grpc with python compiler
python -m pip install grpcio
python -m pip install grpcio-tools
- Install Pandas
conda install pandas
- Install Numpy
conda install numpy
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:
- Open a new terminal
- Activate conda environment
- Navigate into code repository (currently it is not dockerized)
$ cd monaifl
- Run the server@($monaifl/)
python aggregator/coordinator/src/server.py
Running Client:
- Open a new terminal
- Activate conda environment
- Navigate into code repository (currently it is not dockerized)
$ cd monaifl
- Run the client@($monaifl/)
python trainer/substra/testmonai.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.
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Habib Rehman - @habibcomsats - email (habibcomsats@gmail.com or mhrehman@ieee.org)
Project Link: https://github.com/habibcomsats/monaifl