Code for Deep Predictive Motion Tracking in Magnetic Resonance Imaging: Application to Fetal Imaging to model robust spatiotemporal motion in fetal MRI
- Install all the dependencies in python >v3.6 using
python setup.py install - The
main.pyscript runs all training and evaluation OR just evaluation using a pretrained model. - Simply configure the
sample_experiment.jsonin./experimentsdirectory and pass it as an argument to the main script
>>> python main.py ./experiments/sample_experiment.json - If step 2 is training then once the model is trained, the results of held out test set, a copy of experiments .json and model itself will be persisted to given directory.
- An example of how to configure experiments is put in ./experiments directory.
- If a pretrained model path is provided then only evaluation will be done by loading the pretrained model otherwise training from scratch will be performed.
- We have used CUDA implementation of LSTM which needs a NVIDIA GPU to train these models however in
./models/our_model.pyyou can switchCuDNNLSTMby genericLSTMto train on CPU. - In
./experiments/sample_experiment.jsonyou will findnetworksection where you can define what kind of network you would like to train fromresnet18,vgg16,direct_lstm, andour_modelwhere inour_modelyou can specify whether to train asingle_head: truenetwork orsingle_head: falsemodel as well has size of layers usinghidden_units: 512. - In data section of
./experiments/sample_experiment.jsonyou can also setmask: true/falseto enable training models on masked/unmasked data.
To download pretrained models please visit this gdrive link and place them in preferably
./modelsdirectory