This is the code of Deep Reinforcement Learning for Surgical Gesture Segmentation and Classification(Supplementary)
(MICCAI 2018)
This repo includes two parts:
- Re-implementation of Temporal Convolutional Networks (For the original version, please refer to Colin Lea's repo).
- The MDP formulation and a customized OpenAI Gym Env. Policy training is implemented with OpenAI Baseline.
- Install scipy, numpy, pandas, matplotlib
- Install pytorch, tensorflow, gym
- Clone this snapshot version of OpenAI Baseline and follow its install instructions. The offical library is under rapid development and often brings breaking changes
- Clone this repo
The code is tested on the three tasks of JIGSAWS dataset (Video and sensor data for the suturing. Only sensor data for the knot-tying and the needle-passing).
We use the same data features and splits as Colin Lea. Request for the data and split files from Colin and put them into folder ./raw_features and ./splits.
We also test on other datasets such as 50Salads and GTEA but do not formally benchmark or claim any results.
Please be careful about the naming of JIGSAWS:
'JIGSAWS': The suturing task in JIGSAWS
'JIGSAWS_K': The knot tying task in JIGSAWS
'JIGSAWS_N': The needle passing task in JIGSAWS
Setttings and hyper-parameters are in config.json. The defaults work well but you can modify it.
First setup the experiment in experiment.py. Then:
cd <this repo>
python3 experiment.py
python3 export_csv.py
The results will be in CSV files. It takes about 24h for one dataset.
python3 tcn_main.py --feature_type {}
Train:
python3 trpo_train.py --feature_type {} --tcn_run_idx {} --split_idx {} --run_idx {}
Test:
python3 trpo_test.py --feature_type {} --tcn_run_idx {} --split_idx {} --run_idx {}
CSV files: the final results
Folder result: the results in npy format
Folder graph: plots and figures
Folder tcn_featrues: featrues extracted by TCN (states for RL)
Floder tcn_log: Training log for TCN (Visulize with tensorboard)
Folder tcn_model: Trained models for TCN
Folder trpo_model: Trained models for RL
Any question please contact with Daochang Liu at finspire13@gmail.com
@InProceedings{10.1007/978-3-030-00937-3_29, author="Liu, Daochang and Jiang, Tingting", title="Deep Reinforcement Learning for Surgical Gesture Segmentation and Classification", booktitle="Medical Image Computing and Computer Assisted Intervention -- MICCAI 2018", year="2018", publisher="Springer International Publishing", address="Cham", pages="247--255", isbn="978-3-030-00937-3" }