Skip to content
Jacob Silterra edited this page Aug 16, 2024 · 19 revisions

This repository contains the source code for Sybil, a neural network used for lung cancer prediction based on low-dose computed tomography (LDCT) scans.

For general usage, we recommend using the public Docker container which has been packaged with Ark.
See the Ark wiki for more complete documentation.

Refer to the System Requirements before installation and usage.

Example scripts for bash, batch, and powershell: ark_predict.zip. Each of these scripts accepts a directory, host, and port as input. The script then submits every DICOM image in the input directory to the host, assuming that the ark server is running.

Sybil example data

Using published Docker container

A pre-built container is available on Docker Hub at https://hub.docker.com/r/mitjclinic/sybil.

The following commands are an example of how to download and run the container, as well as submit images for prediction.

Graphical User Interface

The Docker container can be launched using Docker Desktop, and we have a simple web site one can use to upload images. The Ark Wiki has an example using Mirai, the only difference for Sybil is that the container name is mitjclinic/sybil.

Command line usage of container

The Docker container runs a simple web server, predictions can be made by POSTing images using a variety of tools. We have created a simple shell script ark_predict.sh which uses curl to send the images to the server and receive the predictions

Linux (or Mac OS) command line

From a terminal:

# Run published container
docker run --rm -d -p 5000:5000 --name sybil mitjclinic/sybil:latest

# Check container is running, get version
curl http://localhost:5000/info

# Download and unzip zip file with scripts
curl -L -o ark_predict.zip "https://github.com/reginabarzilaygroup/ark/files/14299465/ark_predict.zip"
tar -xf ark_predict.zip

# Download example data
curl -L -o sybil_example.zip "https://www.dropbox.com/scl/fi/covbvo6f547kak4em3cjd/sybil_example.zip?rlkey=7a13nhlc9uwga9x7pmtk1cf1c&dl=1"
tar -xf sybil_example.zip

# Submit images for prediction
# Mac/Linx
./ark_predict.sh sybil_demo_data

Windows command line

Open PowerShell in administrative mode, and enter:

Set-ExecutionPolicy RemoteSigned

When prompted, confirm with "Y". The rest of the commands do not need a window with administrative access.

# Run published container in the background
docker run --rm -d -p 5000:5000 --name sybil mitjclinic/sybil:latest

# Check that container is running, and get version
curl.exe http://localhost:5000/info

# Download and unzip zip file with scripts
curl.exe -L -o ark_predict.zip "https://github.com/reginabarzilaygroup/ark/files/14299465/ark_predict.zip"
tar -xf ark_predict.zip

# Download example data
curl.exe -L -o sybil_demo_data.zip "https://www.dropbox.com/scl/fi/covbvo6f547kak4em3cjd/sybil_example.zip?rlkey=7a13nhlc9uwga9x7pmtk1cf1c&dl=1"
tar -xf sybil_demo_data.zip

# Submit images for prediction
.\ark_predict.ps1 sybil_demo_data

Expected Response

Processing can take 2-10 minutes depending on the hardware.

{
  "data": {
    "predictions": [
      [
        [
          0.021628819563619374,
          0.03857256315036462,
          0.07191945816622261,
          0.07926975188037134,
          0.09584583525781108,
          0.13568094038444453
        ]
      ],
      null
    ]
  },
  "message": null,
  "metadata": null,
  "runtime": "169.00s",
  "statusCode": 200
}

The numbers under "prediction" are listed in order for year 1, year 2, ... through year 6. These represent the estimated cumulative probability of the patient contracting lung cancer within the time frame. That is, the probabilities are cumulative.

Video Tutorial

Short video tutorials are also available:

Command line usage: Using Sybil in Docker Container (Video Tutorials).zip

GUI usage:

The tutorial on the Ark wiki is designed for Mirai; the process for Sybil is almost identical. The only difference for Sybil is that the container name is mitjclinic/sybil.

Standalone Command-Line Usage

Since version v1.3.0, Sybil contains a standalone command line interface. It is recommended that one install it into a virtual environment (using conda or virtualenv), one can also use pipx to install and run the tool.

# Install sybil-predict CLI tool.
pip install "git+https://github.com/reginabarzilaygroup/Sybil.git"

sybil-predict --version
# Print current version

# Display usage information
sybil-predict --help

# Download example data
curl -L -o sybil_example.zip "https://www.dropbox.com/scl/fi/covbvo6f547kak4em3cjd/sybil_example.zip?rlkey=7a13nhlc9uwga9x7pmtk1cf1c&dl=1"
tar -xf sybil_example.zip

# Process example data with CLI tool
# Response should be the same as above
sybil-predict sybil_demo_data

Training Data

The Sybil model was trained using the National Lung Screening Trial (NLST) dataset:

National Lung Screening Trial Research Team. (2013). Data from the National Lung Screening Trial (NLST) [Data set]. The Cancer Imaging Archive. https://doi.org/10.7937/TCIA.HMQ8-J677

Cite

@article{mikhael2023sybil,
  title={Sybil: a validated deep learning model to predict future lung cancer risk from a single low-dose chest computed tomography},
  author={Mikhael, Peter G and Wohlwend, Jeremy and Yala, Adam and Karstens, Ludvig and Xiang, Justin and Takigami, Angelo K and Bourgouin, Patrick P and Chan, PuiYee and Mrah, Sofiane and Amayri, Wael and Juan, Yu-Hsiang and Yang, Cheng-Ta and Wan, Yung-Liang and Lin, Gigin and Sequist, Lecia V and Fintelmann, Florian J. and Barzilay, Regina},
  journal={Journal of Clinical Oncology},
  pages={JCO--22},
  year={2023},
  publisher={Wolters Kluwer Health}
}