GithubHelp home page GithubHelp logo

yala / oncoserve_public Goto Github PK

View Code? Open in Web Editor NEW
31.0 7.0 17.0 457 KB

Sharing Deep Learning Models for Breast Cancer Risk

Home Page: http://learningtocure.csail.mit.edu

License: MIT License

Dockerfile 2.94% Python 91.47% JavaScript 5.58%

oncoserve_public's Introduction

OncoServe: Deploying Deep Learning Models for Breast Cancer Risk Assessment, and Breast Density Assessment.

Introduction

This repository shares the models described in Towards Robust Mammography-Based Models for Breast Cancer Risk and Mammographic Breast Density Assessment Using Deep Learning: Clinical Implementation as a (Flask) webserver. You can send the webserver regular HTTP requests with a list of dicoms for a given mammogram, and a set of metadata keys (like MRN or Accession), and the webserver will return the model predictions along back with the same metadata. We note that we do not support all dicom formats, we assume presentation view mammograms, and have only tested this system with Hologic mammograms.

Structure:

OncoServe spins up a webserver in a docker container encapsulating all the software requirments to convert dicoms, and run the deep learning models. It imports Mirai (and OncoNet for older models) and OncoData as submodules.

The repositories perform the following functions:

  • OncoData: handles conversion from dicom to png
  • Mirai and OncoNet : used for model development and training.
  • OncoServe: Wraps model in a webserver that allows it to return outputs in real time given an HTTP request. Used in clinical implementations.

System Requirements

  • Docker
  • 32 GB of RAM, 32GB of Disk.

How to run it?

Startup Steps:

  • First, download the correct docker image from the following links: Mirai, Density.

  • Pull load the docker image from dockerhub. docker load < filename.tar

  • Start the docker container following the instructions for the specific application (listed bellow).

Running the Density Application:

docker run -p 5000:5000 --shm-size 32G -e CONFIG_NAME=config.DensityConfig learn2cure/oncoserve_density:0.1.0

Running the Mirai Application:

docker run -p 5000:5000 --shm-size 32G learn2cure/oncoserve_mirai:0.5.0

How to use it?

Streaming mode (One mammogram at a time):

Once your webserver is setup, you can get model assessments by sending it HTTP requests. See tests/demo.py for a usage example in python or tests/demo.js for a usage example in javascript. The python demo is organized as a python test case. Note, you'll need to update the paths in the setUp function in the demo to refer to real dicom paths (see comments in the file).

Batch mode:

See the Mirai github. This will require logging into the docker container with a shell and running our batch processing scripts.

Note, batch processing is not supported under the density application.

Have questions?

Please email [email protected].

Usage

This tool and all associated code is provided for under MIT License.

oncoserve_public's People

Contributors

clarali210 avatar yala 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

oncoserve_public's Issues

Missing items in dockerfile

  • These requirements are missing:
    RUN pip install -r OncoData_Public/requirements.txt
    RUN pip install -r OncoNet_Public/requirements.txt

  • torch is missing in requirements.txt

  • Error when starting container:

File "/OncoServe/wsgi.py", line 1, in
from scripts.app import app
File "/OncoServe/scripts/app.py", line 12, in
import oncoserve.onconet_wrapper as onconet_wrapper
File "/OncoServe/oncoserve/onconet_wrapper.py", line 9, in
import onconet.utils.parsing as parsing
ModuleNotFoundError: No module named 'onconet'

Contributing

Hello,

Thank you very much for making this available! Do you have a list of features to implement that you could share with those who might want to contribute?

Here are some ideas:

  • support for tensorflow, keras, Caffe, etc.
  • tooling for data de-identification/disambiguation
  • frontend for model output visualization and data labelling

What would be most useful? Looking forward to your thoughts!

Thanks,
-Richard

Failed to convert error

After modifying the example code to run on internal data, I continue to get the following error telling me that it failed to convert the DICOM. I have tried several source .dcm files from multiple datasets to no avail. I am linking raw dicoms of mammograms in .dcm format from GE scanners.

b'{"log_file":"LOGS","metadata":{"accession":"2222222","mrn":"11111111"},"model_name":"2D_Mammo_Cancer_5Year_Risk_ImgOnly","msg":"Error. Could not serve request. Exception: OncoData- Fail to convert dicom 0. Caused Exception [Errno 2] No such file or directory: '/OncoServe/tmp_images/56ece3d9-be1c-4381-a99a-bc06ce46af68.png' with args: dcmtk","oncodata_version":"0.2.0","onconet_version":"0.2.0","oncoserve_version":"0.2.0","prediction":null}\n'

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.