OpenImaging / miqa

A Medical Imaging Quality Assurance tool
https://miqa.kitware.com
Apache License 2.0
31 stars 9 forks source link

Add active learning #445

Open dzenanz opened 2 years ago

dzenanz commented 2 years ago

Create a new web component and expose a few parameters which control re-learning:

When only a subset of data is selected, focus on cases which had the largest discrepancy between automatic and manual decisions.

dzenanz commented 2 years ago

My idea: add a "Retrain" button somewhere. When clicked, it shows a new web form with a spin-box for number of epochs prepopulated with a default value (e.g. 5), a 0% to 100% slider initialized to some default (e.g. 100%), and a "Start" button.

When the start button is clicked, invoke a (yet to be written) update(model_path, csv_path, epochs, data_percent) function from nn_training.py. The first is the path to the NN weights file (e.g. ./models/miqaT1-val0.pth), the second a path to a CSV file (e.g. /tmp/20220420_135506.csv). The last two are just numbers from the GUI.

The CSV file should be similar to this:

series_type,normal_variants,lesions,full_brain_coverage,misalignment,swap_wraparound,ghosting_motion,inhomogeneity,susceptibility_metal,flow_artifact,truncation_artifact,overall_qa_assessment,file_path
T1-15,,TRUE,TRUE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,3,/data/sub-000410/ses-43317/anat/sub-000410_ses-43317_run-003_T1w.nii.gz
T1-30,,FALSE,TRUE,FALSE,FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,8,/data/sub-000527/ses-20877/anat/sub-000527_ses-20877_run-004_T1w.nii.gz
T1-30,,FALSE,TRUE,FALSE,FALSE,FALSE,TRUE,FALSE,FALSE,FALSE,10,/data/sub-000527/ses-20877/anat/sub-000527_ses-20877_run-007_T1w.nii.gz

Namely, normal_variants is always empty as we don't check that. For other artifacts: true if indicated as present otherwise false. OverallQA: 3 for bad, 8 for usable, 10 for "usable extra". This mapping is somewhat arbitrary.

dzenanz commented 2 years ago

update method needs to take in the original model, current, and updated model (to be produced).