|
a/README.md |
|
b/README.md |
1 |
# MetaPred |
1 |
# MetaPred
|
2 |
The repo is code (baseline and the proposed MetaPred) for paper MetaPred: Meta-Learning for Clinical Risk Prediction with Limited Patient Electronic Health Records by [Xi Sheryl Zhang](https://www.xi-zhang.net), [Fengyi Tang](https://github.com/af1tang), [Hiroko H. Dodge](https://medicine.umich.edu/dept/neurology/hiroko-dodge-phd), [Jiayu Zhou](https://jiayuzhou.github.io), and [Fei Wang](https://sites.google.com/site/cornellwanglab/home). |
2 |
The repo is code (baseline and the proposed MetaPred) for paper MetaPred: Meta-Learning for Clinical Risk Prediction with Limited Patient Electronic Health Records by [Xi Sheryl Zhang](https://www.xi-zhang.net), [Fengyi Tang](https://github.com/af1tang), [Hiroko H. Dodge](https://medicine.umich.edu/dept/neurology/hiroko-dodge-phd), [Jiayu Zhou](https://jiayuzhou.github.io), and [Fei Wang](https://sites.google.com/site/cornellwanglab/home). |
3 |
|
3 |
|
4 |
## Overview |
4 |
## Overview |
5 |
|
5 |
|
6 |
MetaPred is a meta-learning framework for Clinical Risk Prediction using limited patient Electronic Health Records (EHRs). We given an example in the following figure: |
6 |
MetaPred is a meta-learning framework for Clinical Risk Prediction using limited patient Electronic Health Records (EHRs). We given an example in the following figure: |
7 |
|
7 |
|
8 |
<p align="center"><img src="figures/task-design.png" alt=" Illustration of the proposed learning procedure" width="500"></p> |
8 |
<p align="center"><img src="https://github.com/sheryl-ai/MetaPred/blob/master/figures/task-design.png?raw=true" alt=" Illustration of the proposed learning procedure" width="500"></p> |
9 |
|
9 |
|
10 |
Suppose we have multiple domains, our goal is to predict Alzheimer’s disease with few labeled patients, which give rise to a low-resource classification. The idea is to employ labeled patients from high-resource domains and design a learning to transfer framework with sources and a simulated target in meta-learning. There are four steps: (1) constructing episodes by sampling from the source domains and the simulated target domain; (2) learn the parameters of predictors in an episode-by-episode manner; (3) fine-tuning the model parameters on the genuine target domain; (4) predicting the target clinical risk. We respectively implemented Convolutional Neural Network (CNN) and Long-Shot Term Memory (LSTM) Network as base predictors. The model overview (meta-training procedure) is shown as follows: |
10 |
Suppose we have multiple domains, our goal is to predict Alzheimer’s disease with few labeled patients, which give rise to a low-resource classification. The idea is to employ labeled patients from high-resource domains and design a learning to transfer framework with sources and a simulated target in meta-learning. There are four steps: (1) constructing episodes by sampling from the source domains and the simulated target domain; (2) learn the parameters of predictors in an episode-by-episode manner; (3) fine-tuning the model parameters on the genuine target domain; (4) predicting the target clinical risk. We respectively implemented Convolutional Neural Network (CNN) and Long-Shot Term Memory (LSTM) Network as base predictors. The model overview (meta-training procedure) is shown as follows: |
11 |
|
11 |
|
12 |
<p align="center"><img src="figures/MetaPred.png" alt="MetaPred framework overview" width="750"></p> |
12 |
<p align="center"><img src="https://github.com/sheryl-ai/MetaPred/blob/master/figures/MetaPred.png?raw=true" alt="MetaPred framework overview" width="750"></p> |
13 |
|
13 |
|
14 |
The entire learning procedure can be viewed as: iteratively transfer the parameter Θ learned from source domains through utilizing it as the initialization of the parameter that needs to be updated in the target domain. |
14 |
The entire learning procedure can be viewed as: iteratively transfer the parameter Θ learned from source domains through utilizing it as the initialization of the parameter that needs to be updated in the target domain. |
15 |
|
15 |
|
16 |
## Results |
16 |
## Results |
17 |
|
17 |
|
18 |
The learned representations of patients in five disease domains are visualized by t-SNE. In detail, AD, PD, DM, AM, MCI are abbreviations of Alzheimer's Disease, Parkinson's Disease, Dementia, Amnesia and Mild Cognitive Impairment, respectively. As a patient might suffer multiple diseases, there is supposed to be some overlaps among the given domains. |
18 |
The learned representations of patients in five disease domains are visualized by t-SNE. In detail, AD, PD, DM, AM, MCI are abbreviations of Alzheimer's Disease, Parkinson's Disease, Dementia, Amnesia and Mild Cognitive Impairment, respectively. As a patient might suffer multiple diseases, there is supposed to be some overlaps among the given domains. |
19 |
|
19 |
|
20 |
<p align="center"><img src="figures/patient_vis_metapred.png" alt="Visualization of patient representation learned by MetaPred" width="500"></p> |
20 |
<p align="center"><img src="https://github.com/sheryl-ai/MetaPred/blob/master/figures/patient_vis_metapred.png?raw=true" alt="Visualization of patient representation learned by MetaPred" width="500"></p> |
21 |
|
21 |
|
22 |
To demonstrate the effectiveness of the proposed MetaPred in the context of domain adaptation, we compare it with the state-of-the-art meta-learning algorithm ``Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks`` (MAML). The results on Alzheimer's Disease domain are presented in terms of AUC and F1-Score. |
22 |
To demonstrate the effectiveness of the proposed MetaPred in the context of domain adaptation, we compare it with the state-of-the-art meta-learning algorithm ``Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks`` (MAML). The results on Alzheimer's Disease domain are presented in terms of AUC and F1-Score. |
23 |
|
23 |
|
24 |
<p align="center"><img src="figures/vs_maml_ad_cnn.png" alt="Performance comparison of MetaPred and MAML on the top of Alzheimer's Disease" width="500"></p> |
24 |
<p align="center"><img src="https://github.com/sheryl-ai/MetaPred/blob/master/figures/vs_maml_ad_cnn.png?raw=true" alt="Performance comparison of MetaPred and MAML on the top of Alzheimer's Disease" width="500"></p> |
25 |
|
25 |
|
26 |
|
26 |
|
27 |
## Requirements |
27 |
## Requirements
|
28 |
This package has the following requirements: |
28 |
This package has the following requirements:
|
29 |
* `Python 3.x` |
29 |
* `Python 3.x`
|
30 |
* [TensorFlow 1.5](https://github.com/tensorflow/tensorflow) |
30 |
* [TensorFlow 1.5](https://github.com/tensorflow/tensorflow)
|
31 |
* [Progress Bar](https://progressbar-2.readthedocs.io/en/latest/index.html) |
31 |
* [Progress Bar](https://progressbar-2.readthedocs.io/en/latest/index.html) |
32 |
|
32 |
|
33 |
|
33 |
|
34 |
## Usage |
34 |
## Usage
|
35 |
### Baseline in Sequential Data Modeling |
35 |
### Baseline in Sequential Data Modeling
|
36 |
The [baseline implementation](https://github.com/sheryl-ai/MetaPred/tree/master/baselines) includes: |
36 |
The [baseline implementation](https://github.com/sheryl-ai/MetaPred/tree/master/baselines) includes:
|
37 |
* Logistic Regression |
37 |
* Logistic Regression
|
38 |
* K-Nearest Neighbors |
38 |
* K-Nearest Neighbors
|
39 |
* XGBoost |
39 |
* XGBoost
|
40 |
* SVM |
40 |
* SVM
|
41 |
* Random Forest |
41 |
* Random Forest
|
42 |
* MLP |
42 |
* MLP
|
43 |
* LSTM |
43 |
* LSTM
|
44 |
* CNN |
44 |
* CNN |
45 |
|
45 |
|
46 |
which can be used in any sort of sequence modeling, especially for EHRs data, directly. |
46 |
which can be used in any sort of sequence modeling, especially for EHRs data, directly. |
47 |
|
47 |
|
48 |
### How to Run |
48 |
### How to Run
|
49 |
To run MetaPred on EHR data, you need to revise the learning settings in main.py and the network hyperparameters in model.py. Then run the shell script metapred.sh. |
49 |
To run MetaPred on EHR data, you need to revise the learning settings in main.py and the network hyperparameters in model.py. Then run the shell script metapred.sh.
|
50 |
```bash |
50 |
```bash
|
51 |
bash metapred.sh |
51 |
bash metapred.sh
|
52 |
``` |
52 |
```
|
53 |
Our settings of learning procedures are: |
53 |
Our settings of learning procedures are:
|
54 |
```bash |
54 |
```bash
|
55 |
python main.py --method='cnn' --metatrain_iterations=10000 --meta_batch_size=32 --update_batch_size=4 --meta_lr=0.001 --update_lr=1e-5 --num_updates=4 --n_total_batches=500000 |
55 |
python main.py --method='cnn' --metatrain_iterations=10000 --meta_batch_size=32 --update_batch_size=4 --meta_lr=0.001 --update_lr=1e-5 --num_updates=4 --n_total_batches=500000
|
56 |
``` |
56 |
```
|
57 |
or |
57 |
or
|
58 |
```bash |
58 |
```bash
|
59 |
python main.py --method='rnn' --metatrain_iterations=10000 --meta_batch_size=32 --update_batch_size=4 --meta_lr=0.001 --update_lr=1e-5 --num_updates=4 --n_total_batches=500000 |
59 |
python main.py --method='rnn' --metatrain_iterations=10000 --meta_batch_size=32 --update_batch_size=4 --meta_lr=0.001 --update_lr=1e-5 --num_updates=4 --n_total_batches=500000
|
60 |
``` |
60 |
``` |
61 |
|
61 |
|
62 |
### Additional Material |
62 |
### Additional Material
|
63 |
There is implementations used in: |
63 |
There is implementations used in: |
64 |
|
64 |
|
65 |
Chelsea Finn, Pieter Abbeel, Sergey Levine, [Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks](https://arxiv.org/abs/1703.03400), International Conference on Machine Learning (ICML), 2017. |
65 |
Chelsea Finn, Pieter Abbeel, Sergey Levine, [Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks](https://arxiv.org/abs/1703.03400), International Conference on Machine Learning (ICML), 2017. |
66 |
|
66 |
|
67 |
## References |
67 |
## References
|
68 |
If you happen to use our work, please consider citing our paper: |
68 |
If you happen to use our work, please consider citing our paper:
|
69 |
``` |
69 |
```
|
70 |
@inproceedings{Zhang:2019:MMC:3292500.3330779, |
70 |
@inproceedings{Zhang:2019:MMC:3292500.3330779,
|
71 |
author = {Zhang, Xi Sheryl and Tang, Fengyi and Dodge, Hiroko H. and Zhou, Jiayu and Wang, Fei}, |
71 |
author = {Zhang, Xi Sheryl and Tang, Fengyi and Dodge, Hiroko H. and Zhou, Jiayu and Wang, Fei},
|
72 |
title = {MetaPred: Meta-Learning for Clinical Risk Prediction with Limited Patient Electronic Health Records}, |
72 |
title = {MetaPred: Meta-Learning for Clinical Risk Prediction with Limited Patient Electronic Health Records},
|
73 |
booktitle = {Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining}, |
73 |
booktitle = {Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
|
74 |
series = {KDD '19}, |
74 |
series = {KDD '19},
|
75 |
year = {2019}, |
75 |
year = {2019},
|
76 |
location = {Anchorage, AK, USA}, |
76 |
location = {Anchorage, AK, USA},
|
77 |
pages = {2487--2495}, |
77 |
pages = {2487--2495},
|
78 |
} |
78 |
}
|
79 |
``` |
79 |
```
|
80 |
This paper can be accessed on : [MetaPred] (https://dl.acm.org/citation.cfm?id=3330779) |
80 |
This paper can be accessed on : [MetaPred] (https://dl.acm.org/citation.cfm?id=3330779) |
81 |
|
81 |
|