Skip to main content

FLightcase :airplane::briefcase:

A federated Learning toolbox for neuro-image research, based on secure copy protocol (SCP) via secure shell (SSH).
It was first introduced in a preprint in medrXiv[1], and now contains a Command-Line Interface (CLI): FLightcase

PyPI


Requirements

  • Unix-based operating system for each node in the network
  • All computers in the same network (e.g. connected via VPN), identifiable via an IP Address
  • All datasets in the Brain Imaging Data Structure (BIDS)([2])
  • Make sure sending files via SCP is possible (e.g. on Mac, enable "Remote Login" (click here for more info))

In brief

The FLightcase toolbox works by sending files via SCP between computers. To ensure full transmission of a file, a .txt file is sent to mark transmission completion. Each node (server and clients) prepares a "workspace", which is a local directory that collect files. Files are shared between computers by knowing each other's workspace location. This, and other information, is available in a JSON metadata file included in each workspace directory. The server additionally defines the Federated Learning plan in a JSON file, containing the parameters for the FL process.


How to get started

Install FLightcase

Install FLightcase in a virtual environment or conda environment on each node. Example for virtual environment:

  1. python3 -m venv .venv (creates virtual environment called ".venv" in current workspace)
  2. source .venv/bin/activate (activate virtual environment)
  3. pip3 install FLightcase (optional: define version number, e.g. pip3 install FLightcase==0.1.0)

Preparing the workspaces

The FLightcase prepare-workspace command is used for preparing the local workspace. Define two flags:

  • --who: client or server
  • --workspace_path: path to workspace directory

Running it will first check whether the workspace path exists, and create it if this is not the case.
Then, an instruction menu is to be completed in your terminal:

  • --who client: Preparation of the client_node_settings.json file
  • --who server: Preparation of the server_node_settings.json, the FL_plan.json file and the architecture.py file

When preparing each JSON file, there are two options:

  1. Copying the template file to the workspace. The template can then be filled in manually with any preferred text editor.
  2. Filling the template file in the terminal. The instruction menu will, step by step, complete the template with you. It will then be saved to the workspace. For the server, the architecture.py will always be copied to the workspace without being completed in the terminal. Please update this file to your preferred network architecture.

Running FLightcase

Make sure your terminal is in the virtual environment that contains FLightcase on each node. Then:

  1. On client nodes, run: FLightcase run-client --settings_path /path/to/client_node_settings.json
  2. On the server node, run FLightcase run-server --settings_path /path/to/server_node_settings.json

Enjoy the show! :woman_dancing::man_dancing:

Note:

A file clean-up will be performed in the FL workspace after federated learning has completed. All files except the node settings, FL plan and architecture will be moved to a subdirectory marked by date and time stamp. The FL_plan and architecture will be copied to this subdirectory to keep a log of the exact experiment that was performed.


Need help or discovered a problem?

If you experience problems with this GitHub repository, please do not hesitate to create an issue, or send a mail to stijn.denissen@vub.be


References

[1] Denissen, S., Grothe, M., Vaneckova, M., Uher, T., Laton, J., Kudrna, M., ... & Nagels, G. (2023). Transfer learning on structural brain age models to decode cognition in MS: a federated learning approach. medRxiv, 2023-04.

[2] Gorgolewski, K. J., Auer, T., Calhoun, V. D., Craddock, R. C., Das, S., Duff, E. P., ... & Poldrack, R. A. (2016). The brain imaging data structure, a format for organizing and describing outputs of neuroimaging experiments. Scientific data, 3(1), 1-9.

Metadata

Release files for FLightcase 0.1.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for FLightcase 0.1.20
File Size Uploaded Provenance Actions
flightcase-0.1.20.tar.gz 36.8 kB Without provenance Details for flightcase-0.1.20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for FLightcase 0.1.20
File Interpreter ABI Platform Actions
flightcase-0.1.20-py3-none-any.whl Python 3 none any Details for flightcase-0.1.20-py3-none-any.whl

Total release size: 78.7 kB

Release files / flightcase-0.1.20.tar.gz

Download URL flightcase-0.1.20.tar.gz
Size 36.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6ff863aa1ad49706ae36bc78b1d51f26ae27976b31e5b9dee9ac8f68aa2bb00d
BLAKE2b-256 checksum
How to use checksums
ca89215165151049c278ff7fc1c2b4281d20957e25fbe1fea7fa190a9f2992da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.2

Release files / flightcase-0.1.20-py3-none-any.whl

Download URL flightcase-0.1.20-py3-none-any.whl
Size 42.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
636be2b38af6821bb62bc3a3d706d0786002dedb4fb5ed8555e8cc1d5dca41d2
BLAKE2b-256 checksum
How to use checksums
81f291bba72174b99f25da770f3c4ce901529d853477520ddf8b6b0a89a35aff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.2

Security for FLightcase 0.1.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page