Please star this repository if you like it :)
Feel free to leave feedbacks and ask questions. We want to make the repository helpful for your research.
We will keep updating this repository for pretrained models and weights.
Pretrained neural networks for UK Biobank brain MRI images. SFCN, 3D-ResNet etc.
Under construction.
The models are trained, validated and benchmarked with UK Biobank brain MRI images, 14,503-subject release.
Model input shape: [batch_size, 1, 160, 192, 160]
| File | Model | No. training subjects | Test MAE (years) | Validation MAE (yrs) | Train MAE (yrs) | Val-Train MAE gap (yrs) |
|---|---|---|---|---|---|---|
| ./brain_age/run_20190719_00_epoch_best_mae.p | SFCN (SGD) | 12,949 | 2.14±0.05 | 2.18±0.04 | 1.36±0.03 | 0.83±0.06 |
(As summarized in Table 1 in the manuscript)
Checkout the file examples.ipynb
model = SFCN()
model = torch.nn.DataParallel(model)
# This is to be modified with the path of saved weights
p_ = './run_20190719_00_epoch_best_mae.p'
model.load_state_dict(torch.load(p_))- UK Biobank preprocessing information https://www.fmrib.ox.ac.uk/ukbiobank/fbp/
Accurate brain age prediction with lightweight deep neural networks Han Peng, Weikang Gong, Christian F. Beckmann, Andrea Vedaldi, Stephen M Smith Medical Image Analysis (2021); doi: https://doi.org/10.1016/j.media.2020.101871
To build oasis_mr_ids.csv:
# 1. Download the MR sessions csv from the NITRC
# 2. Run below command to leave only the experiment ID column
cut -d, -f1 <DOWNLOADED_OASIS_MR_SESSIONS_CSV> data/OASIS_3/oasis_MR_ids.csv
# 3. Download the scans using the bash script
bash scripts/download_oasis_scans.sh data/OASIS_3/oasis_MR_ids.csv data/OASIS_3/raw <NITRC_USERNAME> T1w
downloading the ABIDE 1 dataset:
```bash
# ABIDE_1.zip is downloaded from the NITRC
# age included csv file can also be downloaded from there
unzip -d data/ABIDE_1/raw data/ABIDE_1/ABIDE_1.zipTo clean the specific dataset csv fle:
python scripts/clean_${DATASET_NAME}$.py
# for example:
python scripts/clean_OASIS_3.py
# this ensures the csv contains four columns: subject_ID, MR_ID, age, T1w_pathTo split the data into train, validation and test sets, then append (or create) the unified data csv:
python scripts/split_data.py --input-csv <PATH_TO_CLEANED_DATASET_CSV> --dataset-name <DATASET_NAME>
# for example:
python scripts/split_data.py --input-csv data/OASIS_3/OASIS3_cleaned.csv --dataset-name OASIS_3