Skip to content

Commit

Permalink
Training instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
etetteh committed May 27, 2021
1 parent 128f012 commit 3cc1057
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,23 @@ torchvision
torchxrayvsion
madgrad
```

There are 12 different training, validation and test settings generated by combining 4 different Chest X-ray datasets (NIH ChestX-ray8 dataset, PadChest dataset, CheXpert, and MIMIC-CXR). These 12 settings are broken down into 6 splits (ranging from 0 to 5) that can be called by passing the argument `--split=<split>`. For each split, you have the option to choose between 2 validation datasets by passing the argument `--valid_data=<name of valid dataset>`.
The dataset names are condensed as short strings: `"nih"`= NIH ChestX-ray8 dataset, `"pc"` = PadChest dataset, `"cx"` = CheXpert, and `"mc"` = MIMIC-CXR.

For each split, you train on 2 datasets, validate on 1 and test on the remaining one.
The [baseline_rex.py](https://github.com/etetteh/OoD_Gen-Chest_Xray-REx/blob/main/baseline_rex.py) file contains code to run both our baseline and REx models.

### Train Using Baseline Model
To train the baseline model on the first split, and validate on the MIMIC-CXR dataset, run the following code:
```
python baseline_rex.py --split=0 --valid_data="mc"
```
Note that for the first split, PadChest is automatically selected as the `test_data`, when you pass MIMIC-CXR as the validation data, and vice versa.

### Train Using REx Model
To train the REx model, we run the same code above with some addtional arguments. We first turn off the baseline approach by passing the argument
`--baseline=False`, and also specify the amount of penalty weight (float in multiples of 10) to use by passing `--penalty_weight=<penalty weight amount>`. Example:
```
python baseline_rex.py --baseline=False --penalty_weight=100.0 --split=0 --valid_data="mc"
```

0 comments on commit 3cc1057

Please sign in to comment.