GithubHelp home page GithubHelp logo

camma-public / convlstm-surgical-tool-tracker Goto Github PK

View Code? Open in Web Editor NEW
37.0 12.0 10.0 3.56 MB

This repo contains an implementation code for the weakly supervised surgical tool tracker. In this research, the temporal dependency in surgical video data is modeled using a convolutional LSTM which is trained only on image level labels to detect, localize and track surgical instruments.

License: Other

Jupyter Notebook 15.98% Python 84.02%
tracking localization detection analysis lstm convlstm weakly-supervised-learning temporal-data temporal-convolutional-network endoscopic-images surgical-tools video-analysis surgical-video deep-learning convolutional-neural-network surgical-instrument

convlstm-surgical-tool-tracker's Introduction

ConvLSTM Surgical Tool Tracker

Weakly Supervised Convolutional LSTM Approach for Tool Tracking in Laparoscopic Videos (IPCAI 2019)

CI. Nwoye, D. Mutter, J. Marescaux, N. Padoy

This repository contains the inference demo and evaluation scripts.

Read on ArXiv Open In Colab

Introduction

This model is a re-implementation of the deep learning tracking model for surgical tools in Laparoscopic videos using weakly supervised Convolutional LSTM approach. The network learns tool detection, localization and tracking from image-level labels. The approach is composed of a CNN + Convolutional LSTM (ConvLSTM) neural networks trained end-to-end, but weakly supervised on tool binary presence labels only. We use the ConvLSTM to model the temporal dependencies in the motion of the surgical tools and leverage its spatio-temporal ability to smooth the class peak activations in the localization heat maps (Lh-maps). Remarkably, the model learn the spatio-temporal information in time-space domain just from binary presence label using ConvLSTM. The model achieved a state-of-the-art performance on tool detection, localization and tracking for weakly supervised models.

ConvLSTM Tracker
Fig. 1: Architecture of the model (R+C+CL variant)

Model

There are several variants of the tracker as contained in the paper, but this gitlab repo provides the code for only the R+CL+C variant which can easily be modified to the other variants. (See the published paper)

Code list:

  • model.py: the model implementation (with all the necessary libs)
  • evaluation.ipynb: the evaluation and demo script (jupyter notebook)
  • lib: The model depends on three utility files: resnet, resnet_utils and convlstm_cell. The convlstm_cell is a modified version of the original ConvLSTM library due to bugs in the contrib release. (TensorFlow may likely correct this in future release) The one-shot state initialization and subsequent between batch state propagation is implemented in the model.py code. So, frame seek information (frame index number) is necessary to enforce this continuity in the video data.

The model is trained on the largest public endoscopic video dataset to date: Cholec80 dataset. To reproduce this model on a custom dataset, users can write their training script. All the necessary hyperparameters are contained in the published paper and can be tuned to suit your task and dataset. Model can be trained on sequential frames or video data (with frame-wise binary presence labels)

No data preprocessing is required.

Download

If you clone this repo, running the evaluation script will automatically download the model weights (in ckpt directory) and a sample shortened test video (in data directory) for model testing. If you redirect these downloads to a different location, change also their paths in the jupyter notebook's Variables & Device setup section. Feel free to try on other laparoscopic videos.

Dependency

The model depends on the following libraries:

  1. Tensorflow (1.3 < tf < 2.0)
  2. ffmpeg
  3. Opencv
  4. imageio
  5. imageio-ffmpeg
  6. matplotlib
  7. Python >= 2.7

System Requirements:

The code has been test on Linux operating system. It runs on both CPU and GPU. Equivalence of basic OS commands such as unzip, cd, wget, etc. will be needed to run in Windows or Mac OS.

Result

The test results are contained in the published paper. Qualitative results can be found on the CAMMA ICube YouTube channel: video 1 and video 2

ConvLSTM Tracker

Citation

If you use a whole or part of the code, data, model weights or any idea contained herein in your research, please cite this paper:

Nwoye, C.I., Mutter, D., Marescaux, J. and Padoy, N., 2019. Weakly supervised convolutional LSTM approach for tool tracking in laparoscopic videos. International journal of computer assisted radiology and surgery, 14(6), pp.1059-1067.

Bibtex:

	@article{nwoye2019weakly,
        title={Weakly supervised convolutional LSTM approach for tool tracking in laparoscopic videos},
        author={Nwoye, Chinedu Innocent and Mutter, Didier and Marescaux, Jacques and Padoy, Nicolas},
        journal={International journal of computer assisted radiology and surgery},
        volume={14},
        number={6},
        pages={1059--1067},
        year={2019},
        publisher={Springer}
        }

License

This code, models, and datasets are available for non-commercial scientific research purposes provided by CC BY-NC-SA 4.0 LICENSE attached as LICENSE file. By downloading and using this code you agree to the terms in the LICENSE. Third-party codes are subject to their respective licenses.


This repo is maintained by CAMMA. Comments are welcomed. Check for updates.

convlstm-surgical-tool-tracker's People

Contributors

armine13 avatar nwoyecid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

convlstm-surgical-tool-tracker's Issues

Tensorflow Version on Google Colab

Hi,

I'm trying to execute your model on Google Colab, however Colab does not support Tensorflow 1.x anymore. How can we change the model to optimize it for Tensorflow 2.0?

Any help would be appreciated, thank you.

Error while running evaluation.ipynb

!wget --no-check-certificate https://s3.unistra.fr/camma_public/github/convlstm_tracker/data.zip
!unzip data.zip

print("Download completed ...")

error - --2024-05-27 14:17:35-- https://s3.unistra.fr/camma_public/github/convlstm_tracker/data.zip
Resolving s3.unistra.fr (s3.unistra.fr)... 185.38.109.109
Connecting to s3.unistra.fr (s3.unistra.fr)|185.38.109.109|:443... connected.
WARNING: cannot verify s3.unistra.fr's certificate, issued by ‘CN=’:
Self-signed certificate encountered.
WARNING: certificate common name ‘
’ doesn't match requested host name ‘s3.unistra.fr’.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://mahav-cbf.info/unistra.fr?adTagId=5dbe70a0-d198-11ee-9496-0a639443d451&amp;fallbackUrl=https%3A%2F%2F4943999.com [following]
--2024-05-27 14:17:51-- http://mahav-cbf.info/unistra.fr?adTagId=5dbe70a0-d198-11ee-9496-0a639443d451&amp;fallbackUrl=https%3A%2F%2F4943999.com
Resolving mahav-cbf.info (mahav-cbf.info)... 184.72.243.125, 44.213.169.71
Connecting to mahav-cbf.info (mahav-cbf.info)|184.72.243.125|:80... connected.
HTTP request sent, awaiting response... 302
Location: https://potsaglu.net/4/6423806?clickid=cff30840-1c05-11ef-882d-127f27443653 [following]
--2024-05-27 14:17:56-- https://potsaglu.net/4/6423806?clickid=cff30840-1c05-11ef-882d-127f27443653
Resolving potsaglu.net (potsaglu.net)... 139.45.197.245
Connecting to potsaglu.net (potsaglu.net)|139.45.197.245|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2024-05-27 14:18:00 ERROR 403: Forbidden.

unzip: cannot find or open data.zip, data.zip.zip or data.zip.ZIP.
Download completed ...

!wget --content-disposition https://s3.unistra.fr/camma_public/github/convlstm_tracker/ckpt.zip
!unzip ckpt.zip

print("Download completed ...")

error -
!wget --content-disposition https://s3.unistra.fr/camma_public/github/convlstm_tracker/ckpt.zip
!unzip ckpt.zip

print("Download completed ...")
--2024-05-27 13:44:44-- https://s3.unistra.fr/camma_public/github/convlstm_tracker/ckpt.zip
Resolving s3.unistra.fr (s3.unistra.fr)... 185.38.109.109
Connecting to s3.unistra.fr (s3.unistra.fr)|185.38.109.109|:443... connected.
ERROR: cannot verify s3.unistra.fr's certificate, issued by ‘CN=’:
Self-signed certificate encountered.
ERROR: certificate common name ‘
’ doesn't match requested host name ‘s3.unistra.fr’.
To connect to s3.unistra.fr insecurely, use `--no-check-certificate'.
unzip: cannot find or open ckpt.zip, ckpt.zip.zip or ckpt.zip.ZIP.
Download completed ...

please help with this error

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.