/openfl-mri

OpenFL pipeline for training MRI image classifier

Primary LanguageJupyter Notebook

Federated learning system for learning MRI Images classifer

This project was created for learning MRI images classifier using the Federated Learning method (McMahan B., et al., 2016).

The project structure consists of two following folders:

  • distributed_federated_system - contains the implemented federated system, which can be deployed and run on multiple nodes.
  • experimtents - includes federated learning experiments using differently distributed data between clients

How to run the federated system?

In order to run the federated system on multiple different nodes, please, take the following steps:

  • Move every single envoy_# and director (aggregator) + workspace folders to separate nodes and install required packages using pip install -r requirements.txt
  • For every envoy_# download its corresponding data from here and extract all files to the according envoy's data folder.
  • On aggregator node:
    • Set listen_host and listen_port parameters in director.yaml

    • Open director folder in cmd or bash and run the following command to start the director:

      fx director start --disable-tls -c director_config.yaml

  • On envoys nodes:
    • Open envoy_# folder in cmd or bash and run the following command to start the envoy:

      fx envoy start -n ${ENVOY_NAME} --disable-tls --envoy-config-path envoy_config.yaml -dh ${AGGREGATOR_FQDN} -dp ${AGGREGATOR_PORT}

  • Open experiment-manager.ipynb in Jupyter Notebook and run all of its cells.

Some of the experiments data

Loss function for experiment with 4 collaborators using distributed system and model from Qu R., et al.

Loss Function

Loss function for experiment with 4 collaborators using simple CNN.

Loss Function

Loss function for experiment with 3 collaborators using simple CNN.

Loss Function

Client_1 train dataset distribution:

Data Distribution

Client_1 test dataset distribution:

Data Distribution

Client_2 train dataset distribution:

Data Distribution

Client_2 test dataset distribution:

Data Distribution

Client_3 train dataset distribution:

Data Distribution

Client_3 test dataset distribution:

Data Distribution

Client_4 train dataset distribution:

Data Distribution

Client_4 test dataset distribution:

Data Distribution