Skip to content

Commit 58a563e

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 41ad4aa commit 58a563e

15 files changed

+27
-29
lines changed

federated_learning/breast_density_challenge/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ logs
1010

1111
# example data
1212
*preprocessed*
13-

federated_learning/breast_density_challenge/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## MammoFL_MICCAI2022
22

3-
Reference implementation for
3+
Reference implementation for
44
[ACR-NVIDIA-NCI Breast Density FL challenge](http://BreastDensityFL.acr.org).
55

66
Held in conjunction with [MICCAI 2022](https://conferences.miccai.org/2022/en/).
@@ -14,13 +14,13 @@ We provide a minimal example of how to implement Federated Averaging using [NVFl
1414

1515
### 1.1 Download example data
1616
Follow the steps described in [./data/README.md](./data/README.md) to download an example breast density mammography dataset.
17-
Note, the data used in the actual challenge will be different. We do however follow the same preprocessing steps and
17+
Note, the data used in the actual challenge will be different. We do however follow the same preprocessing steps and
1818
use the same four BI-RADS breast density classes for prediction.
1919

2020
We provide a set of random data splits as `./data/dataset_blinded_site-*.json` which follows the same format as what
21-
will be used in the challenge. Please do not modify the data list filenames in the configs as they will be the same during the challenge.
21+
will be used in the challenge. Please do not modify the data list filenames in the configs as they will be the same during the challenge.
2222

23-
Note, the location of the dataset and data lists will be given by the system.
23+
Note, the location of the dataset and data lists will be given by the system.
2424
Do not change the locations given in [config_fed_client.json](./code/configs/mammo_fedavg/config/config_fed_client.json):
2525
```
2626
"DATASET_ROOT": "/data/preprocessed",
@@ -32,7 +32,7 @@ The argument specifies the FQDN of the FL server. Use `localhost` when simulatin
3232
```
3333
./build_docker.sh localhost
3434
```
35-
Note, all code and pretrained models need to be included in the docker image.
35+
Note, all code and pretrained models need to be included in the docker image.
3636
The virtual machines running the containers will not have public internet access during training.
3737
For an example, please see the `download_model.py` used to download ImageNet pretrained weights in this example.
3838

@@ -44,7 +44,7 @@ Run all commands at once using. Note this will also create separate logs under `
4444
```
4545
./run_all_fl.sh
4646
```
47-
Note, the GPU index to use for each client is specified inside `run_all_fl.sh`.
47+
Note, the GPU index to use for each client is specified inside `run_all_fl.sh`.
4848
See the individual `run_docker_site-*.sh` commands described below.
4949
Note, the server script will automatically kill all running container used in this example
5050
and final results will be placed under `./result_server`.
@@ -64,10 +64,10 @@ After training completed, the training curves can be visualized using
6464
```
6565
tensorboard --logdir=./result_server
6666
```
67-
A visualization of the global accuracy and [Kappa](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.cohen_kappa_score.html) validation scores for each site with the provided example data is shown below.
67+
A visualization of the global accuracy and [Kappa](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.cohen_kappa_score.html) validation scores for each site with the provided example data is shown below.
6868
The current setup runs on a machine with two NVIDIA GPUs with 12GB memory each.
6969
The runtime for this experiment is about 45 minutes.
70-
You can adjust the argument to the `run_docker_site-*.sh` scripts to specify different
70+
You can adjust the argument to the `run_docker_site-*.sh` scripts to specify different
7171
GPU indices if needed in your environment.
7272

7373
![](./figs/example_data_val_global_acc_kappa.png)
@@ -84,10 +84,10 @@ docker kill server site-1 site-2 site-3
8484

8585
You can modify and extend the provided example code under [./code/pt](./code/pt).
8686

87-
You could use other components available at [NVFlare](https://github.com/NVIDIA/NVFlare)
87+
You could use other components available at [NVFlare](https://github.com/NVIDIA/NVFlare)
8888
or enhance the training pipeline using your custom code or features of other libraries.
8989

90-
See the [NVFlare examples](https://github.com/NVIDIA/NVFlare/tree/main/examples) for features that could be utilized in this challenge.
90+
See the [NVFlare examples](https://github.com/NVIDIA/NVFlare/tree/main/examples) for features that could be utilized in this challenge.
9191

9292
### 2.1 Debugging the learning algorithm
9393

@@ -157,7 +157,7 @@ for the global model (should be named `SRV_best_FL_global_model.pt`).
157157
"probs": [0.005602597258985043, 0.7612965703010559, 0.23040543496608734, 0.0026953918859362602]
158158
}, {
159159
...
160-
},
160+
},
161161
"site-3": {
162162
"SRV_best_FL_global_model.pt": {
163163
...
@@ -166,5 +166,5 @@ for the global model (should be named `SRV_best_FL_global_model.pt`).
166166
"probs": [0.005602597258985043, 0.7612965703010559, 0.23040543496608734, 0.0026953918859362602]
167167
}, {
168168
...
169-
}
169+
}
170170
```

federated_learning/breast_density_challenge/code/fl_project.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ builders:
4343
- relaxed
4444
roles:
4545
super: super user of system
46-
groups:
47-
relaxed:
46+
groups:
47+
relaxed:
4848
desc: org group with relaxed policies
49-
rules:
49+
rules:
5050
allow_byoc: true
5151
allow_custom_datalist: true
5252
disabled: false
5353
- path: nvflare.lighter.impl.cert.CertBuilder
5454
- path: nvflare.lighter.impl.he.HEBuilder
5555
args:
56-
poly_modulus_degree: 8192
56+
poly_modulus_degree: 8192
5757
coeff_mod_bit_sizes: [60, 40, 40]
5858
scale_bits: 40
5959
scheme: CKKS

federated_learning/breast_density_challenge/code/run_fl.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,3 @@ python3 ./run_fl.py --port=8003 --admin_dir="./${workspace}/${admin_username}" \
2727
# sleep for FL system to shut down, so a new run can be started automatically
2828
sleep 30
2929
echo "TRAINING ENDED"
30-

federated_learning/breast_density_challenge/data/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Extract here.
66
## Data source
77
This example data is based on [CBIS-DDSM](https://wiki.cancerimagingarchive.net/display/Public/CBIS-DDSM) from [TCIA](https://wiki.cancerimagingarchive.net/) [1].
88

9-
We preprocessed all files using `code/pt/utils/preprocess_dicomdir.py` and generated train/val splits for each client
9+
We preprocessed all files using `code/pt/utils/preprocess_dicomdir.py` and generated train/val splits for each client
1010
and separate testing split.
1111

1212
For more details on this example data, see [2,3].

federated_learning/breast_density_challenge/data/dataset_blinded_phase2_site-1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4452,4 +4452,4 @@
44524452
"image": "Mass-Training_P_00630_LEFT_MLO.npy"
44534453
}
44544454
]
4455-
}
4455+
}

federated_learning/breast_density_challenge/data/dataset_blinded_phase2_site-2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4317,4 +4317,4 @@
43174317
"image": "Calc-Test_P_01303_LEFT_CC.npy"
43184318
}
43194319
]
4320-
}
4320+
}

federated_learning/breast_density_challenge/data/dataset_blinded_phase2_site-3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4406,4 +4406,4 @@
44064406
"image": "Calc-Training_P_02563_RIGHT_MLO.npy"
44074407
}
44084408
]
4409-
}
4409+
}

federated_learning/breast_density_challenge/data/dataset_blinded_site-1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3464,4 +3464,4 @@
34643464
"image": "Mass-Test_P_00612_RIGHT_MLO.npy"
34653465
}
34663466
]
3467-
}
3467+
}

federated_learning/breast_density_challenge/data/dataset_blinded_site-2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3233,4 +3233,4 @@
32333233
"image": "Calc-Training_P_01300_LEFT_MLO.npy"
32343234
}
32353235
]
3236-
}
3236+
}

federated_learning/breast_density_challenge/data/dataset_blinded_site-3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3378,4 +3378,4 @@
33783378
"image": "Calc-Training_P_02437_LEFT_MLO.npy"
33793379
}
33803380
]
3381-
}
3381+
}

federated_learning/breast_density_challenge/data/dataset_site-1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5265,4 +5265,4 @@
52655265
"label": 1
52665266
}
52675267
]
5268-
}
5268+
}

federated_learning/breast_density_challenge/data/dataset_site-2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5100,4 +5100,4 @@
51005100
"label": 3
51015101
}
51025102
]
5103-
}
5103+
}

federated_learning/breast_density_challenge/data/dataset_site-3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5145,4 +5145,4 @@
51455145
"label": 2
51465146
}
51475147
]
5148-
}
5148+
}

federated_learning/breast_density_challenge/result_server/predictions.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)