Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge the Updated Codebase #201

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
Task_1/venv/*
Task_1/my_code
Task_1/ucb_r*
Task_1/fets_challenge/__pycache__/*
*pycache*
Task_1/cert*
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@

# Federated Tumor Segmentation Challenge

The repo for the FeTS Challenge: The 1st Computational Competition on Federated Learning.
Repo for FeTS Challenge: The 1st Computational Competition on Federated Learning.
Year 2024 and beyond

## Website

https://www.synapse.org/#!Synapse:syn28546456

## Challenge Tasks
## Challenge Task
The challenge involves customizing core functions of a baseline federated learning system implementation. The goal is to improve over the baseline consensus models in terms of robustness in final model scores to data heterogeneity across the simulated collaborators of the federation. For more details, please see [Task_1](./Task_1).

### Task 1

The first task of the challenge involves customizing core functions of a baseline federated learning system implementation. The goal is to improve over the baseline consensus models in terms of robustness in final model scores to data heterogeneity across the simulated collaborators of the federation. For more details, please see [Task_1](./Task_1).

### Task 2

This task utilizes federated testing across various sites of the FeTS initiative in order to evaluate model submissions across data from different medical institutions, MRI scanners, image acquisition parameters and populations. The goal of this task is to find algorithms (by whatever training technique you wish to apply) that score well across these data. For more details, please see [Task_2](./Task_2).

## Documentation and Q&A

Expand Down
8 changes: 8 additions & 0 deletions Task_1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FeTS_Challenge-flair.py
FeTS_Challenge_FedPOD_partitioning2.py
FeTS_Challenge_RL.py
FeTS_Challenge_RecEng.py
FeTS_Challenge_leonardklausman.py
*final_submission*
build*
cert*
11 changes: 7 additions & 4 deletions Task_1/FeTS_Challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,18 @@ def FedAvgM_Selection(local_tensors,
# to those you specify immediately above. Changing the below value to False will change
# this fact, excluding the three hausdorff measurements. As hausdorff distance is
# expensive to compute, excluding them will speed up your experiments.
include_validation_with_hausdorff=True
include_validation_with_hausdorff=True # IF SET TO FALSE WHOLE CODE RUNS SEGMENTATION FOR SOME REASON
sarthakpati marked this conversation as resolved.
Show resolved Hide resolved

# We encourage participants to experiment with partitioning_1 and partitioning_2, as well as to create
# other partitionings to test your changes for generalization to multiple partitionings.
#institution_split_csv_filename = 'partitioning_1.csv'
institution_split_csv_filename = 'small_split.csv'
#institution_split_csv_filename = 'partitioning_1.csv'
institution_split_csv_filename = '/home/locolinux2/datasets/MICCAI_FeTS2022_TrainingData/partitioning_2.csv'
institution_split_csv_filename = '/home/locolinux2/datasets/MICCAI_FeTS2022_TrainingData/sanity_partitioning.csv' # a small subset for sanity checks and debugging. Comment out to run the actual challenge partition.

# change this to point to the parent directory of the data
brats_training_data_parent_dir = '/raid/datasets/FeTS22/MICCAI_FeTS2022_TrainingData'
brats_training_data_parent_dir = '/home/locolinux2/datasets/MICCAI_FeTS2022_TrainingData'
brats_training_data_parent_dir = '/home/locolinux2/datasets/MICCAI_FeTS2022_Resized'
Comment on lines +527 to +532
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These paths (and anything similar) is going to be problematic. I will suggest using something that defined based on pathlib.Path.cwd() (or something similar) to ensure non-breakage.


# increase this if you need a longer history for your algorithms
# decrease this if you need to reduce system RAM consumption
Expand All @@ -537,7 +540,7 @@ def FedAvgM_Selection(local_tensors,

# you'll want to increase this most likely. You can set it as high as you like,
# however, the experiment will exit once the simulated time exceeds one week.
rounds_to_train = 5
rounds_to_train = 20

# (bool) Determines whether checkpoints should be saved during the experiment.
# The checkpoints can grow quite large (5-10GB) so only the latest will be saved when this parameter is enabled
Expand Down
16 changes: 8 additions & 8 deletions Task_1/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# FeTS 2022 Challenge Task 1
# FeTS 2024+ Challenge Task 1
Task 1 (**"Federated Training"**) aims at effective weight aggregation methods for the creation of a consensus model given a pre-defined segmentation algorithm for training, while also (optionally) accounting for network outages.

Please ask any additional questions in our discussion pages on our github site and we will try to update this README.md as we identify confusions/gaps in our explanations and instructions.
Expand All @@ -20,18 +20,18 @@ Please ask any additional questions in our discussion pages on our github site a
2. ```git clone https://github.com/FETS-AI/Challenge.git```
3. ```cd Challenge/Task_1```
4. ```git lfs pull```
5. Create virtual environment (python 3.6-3.8): using Anaconda, a new environment can be created and activated using the following commands:
5. Create virtual environment (python 3.9): using Anaconda, a new environment can be created and activated using the following commands:
```sh
## create venv in specific path
conda create -p ./venv python=3.7 -y
conda create -p ./venv python=3.9 -y
conda activate ./venv
```
6. ```pip install --upgrade pip```
7. Install Pytorch LTS (1.8.2) for your system (use CUDA 11):
```pip3 install torch==1.8.2 torchvision==0.9.2 torchaudio==0.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu111```
*Note all previous versions of pytorch can be found in [these instructions]([https://pytorch.org/get-started/locally/](https://pytorch.org/get-started/previous-versions/))
9. Set the environment variable `SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True` (to avoid sklearn deprecation error)
10. ```pip install .```
7. Install Pytorch (2.3.1) for your system:
```pip install torch==2.3.1 torchvision==0.18.1```
*Note all previous versions of pytorch can be found in [this link](https://pytorch.org/get-started/previous-versions/#v231).
8. Set the environment variable `SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True` (to avoid sklearn deprecation error)
9. ```pip install .```
> * _Note: if you run into ```ERROR: Failed building wheel for SimpleITK```, try running ```pip install SimpleITK --only-binary :all:``` then rerunning ```pip install .```_
10. ```python FeTS_Challenge.py```
> * _Note: if you run into ```ImportError: /home/locolinux/FETS2024/fets2024env/bin/../lib/libstdc++.so.6: version GLIBCXX_3.4.30' not found (required by /home/locolinux/FETS2024/fets2024env/lib/python3.7/site-packages/SimpleITK/_SimpleITK.so)```, try installing a previous version of SimpleITK (version 2.2.0 works)
Expand Down
2 changes: 1 addition & 1 deletion Task_1/fets_challenge/custom_aggregation_wrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from openfl.component.aggregation_functions.experimental import PrivilegedAggregationFunction
from openfl.interface.aggregation_functions.experimental import PrivilegedAggregationFunction


# extends the openfl agg func interface to include challenge-relevant information
Expand Down
Loading