lindawangg / COVID-Net

COVID-Net Open Source Initiative
Other
1.15k stars 480 forks source link

transfer learning script to produce COVIDNet-Risk from COVIDNet #40

Closed PaulMcInnis closed 4 years ago

PaulMcInnis commented 4 years ago

Pull Request Template

Description

This adds a script which performs transfer-learning on an existing COVIDNet to produce COVIDNet-Risk a risk-stratification network that predicts patient offset (days since symptom onset).

Eventually this may be used to help make more informed decisions about stage of care, but currently there is not enough data to demonstrate complete examples (52 train 9 test).

There is also work to be done - which is left in the form of TODOs and FIXMES. we can migrate these to issues if we like.

Context of change

Type of change

How Has This Been Tested?

I've tested this by running the script locally, it trains well on my laptop (mobile GTX1080)a by default it produces <CovidNet>/models/COVIDNet-Risk/COVIDNet-Risk-lr2e-06

Checklist:

example output:

Saved pre-trained model with re-initialized output layers.
Baseline eval:
    evaluated 9 images.
confusion matrix:
[[0. 0. 0. 0.]
 [0. 0. 0. 0.]
 [1. 1. 0. 1.]
 [6. 0. 0. 0.]]
per-class accuracies:
[0, 0, 0.0, 0.0]
Transfer Learning Started.
    train samples: 52
    test samples:  9
    stratification: [3, 5, 10]

Fine-Tuning on 1 epoch = 52 images.
...