Giter Site home page Giter Site logo

cardio-ai / suture-detection-pytorch Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 160 KB

Point detection through multi-instance deep heatmap regression for sutures in endoscopy, Sharan et al. 2021, IJCARS

License: GNU General Public License v3.0

Python 100.00%

suture-detection-pytorch's Introduction

Suture detection PyTorch

This repo contains the reference implementation of suture detection model in PyTorch for the paper

Point detection through multi-instance deep heatmap regression for sutures in endoscopy

Lalith Sharan, Gabriele Romano, Julian Brand, Halvar Kelm, Matthias Karck, Raffaele De Simone, Sandy Engelhardt

Accepted, IJCARS 2021

Please see the license file for terms os use of this repo. If you find our work useful in your research please consider citing our paper:

@article{sharan_point_2021,
	title = {Point detection through multi-instance deep heatmap regression for sutures in endoscopy},
	issn = {1861-6429},
	url = {https://doi.org/10.1007/s11548-021-02523-w},
	doi = {10.1007/s11548-021-02523-w},
	language = {en},
	urldate = {2021-11-16},
	journal = {International Journal of Computer Assisted Radiology and Surgery},
	author = {Sharan, Lalith and Romano, Gabriele and Brand, Julian and Kelm, Halvar and Karck, Matthias and De Simone,
	Raffaele and Engelhardt, Sandy},
	month = nov,
	year = {2021}
}

Setup

A conda environment is recommended for setting up an environment for model training and prediction. There are two ways this environment can be set up:

  1. Cloning conda environment (recommended)
conda env create -f suture_detection_pytorch.yml
conda activate suture_detection_pytorch

If the installation from .yml file does not work, it may be a cuda error. The solution is to either install the failed packages via pip, or use the pip requirements file here.

  1. Installing requirements
conda intall --file conda_requirements.txt
conda install -c pytorch torchvision=0.7.0
pip install --r requirements.txt

Prediction of suture detection for a single image

You can predict the suture points for a single image with:

python test.py --dataroot ~/data/mkr_dataset/ --exp_dir ~/experiments/unet_baseline_fold_1/ --save_pred_points
  • The command save_pred_points saves the predicted landmark co-ordinates in the resepective op folders in the ../predictions directory.
  • The command save_pred_mask saves the predicted mask that is the output of the model in the resepective op folders in the ../predictions directory. The final points are extracted from this mask.

Dataset preparation

You can download the challenge dataset from the synapse platform by signing up for the AdaptOR 2021 Challenge from the Synapse platform.

  • The Challenge data is present in this format: dataroot --> op_date --> video_folders --> images, point_labels
  • Generate the masks with a blur function and spread by running the following script:
python generate_suture_masks.py --dataroot /path/to/data --blur_func gaussian --spread 2
  • Generate the split files for the generated masks, for cross-validation by running the following script: You can predict depth for a single image with:
python generate_splits.py --splits_name mkr_dataset --num_folds 4

Training a model

Once you have prepared the dataset, you can train the model with:

python train.py --dataroot /path/to/data

suture-detection-pytorch's People

Contributors

lalithnag avatar

Stargazers

Larry avatar ZHANG CHU avatar  avatar Max-Heinrich Laves avatar

Watchers

SvenK avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.