GithubHelp home page GithubHelp logo

fjkiani / annotate-medical-images-in-dicom-server-and-build-ml-models-on-amazon-sagemaker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/annotate-medical-images-in-dicom-server-and-build-ml-models-on-amazon-sagemaker

0.0 0.0 0.0 40.42 MB

License: MIT No Attribution

Shell 9.94% JavaScript 15.77% Python 8.86% CSS 21.54% HTML 19.51% Jupyter Notebook 23.40% Dockerfile 0.99%

annotate-medical-images-in-dicom-server-and-build-ml-models-on-amazon-sagemaker's Introduction

Annotate Medical Images in DICOM Server and Build ML models using Amazon SageMaker

Overview Architecture

Architecture

Deployment Steps

Pre-requisite

You will need two public subnets and two private subnets in a given Virtual Private Cloud (VPC). You can either follow this blog post to deploy the network infrastructure first, or deploy the VPC network infrastructure using this CloudFormation template (Optional)

Deploy Orthanc DICOM Server on AWS ECS

To deploy the CloudFormation (CFN) on AWS console, using 1-click deployment button:
launchstackbutton

The required information will be EC2 Key pair and network infrastructure.

After the CFN stack is successfully created, the Orthanc endpoint URL will be available in the Outputs tab like:
this

Upload DICOM images to Orthanc

Orthanc supports WADO-RS with its RESTful API. You can upload a DICOM image from local folder:

curl -u orthanc:orthanc -X POST https://<Orthanc URL>/instances --data-binary @<DICOM Image>.dcm -k

After uploaded, check the instance id assigned: curl -u orthanc:orthanc https://<Orthanc URL>/instances -k

Then put instance IDs in source field of manifest.json. Assuming here is the output of the previous command (list of DICOM instances): [ "502b0a4b-5cb43965-7f092716-bd6fe6d6-4f7fc3ce", "af163634-5f8009c8-a941f2a2-4d108bea-119181b5", "3e9562ab-3bd7b304-e003d1f8-0fe2e8f5-e6af3f36" ]
The manifest.json file will look at this.

Deploy the SageMaker Labeling and Notebook Resources

click the button below to deploy lambda functions, S3 bucket, and Notebook instance with appropriate IAM roles:
launchstackbutton

Fill the parameter PreLabelLambdaSourceEndpointURL with the Orthanc endpoint URL from previous step.

Take a note of the outputs of CFN deployment, including SMGTLabelingExecutionRole and SageMakerAnnotationS3Bucket names:
smcfnoutputs

The manifest.json file generated earlier will be uploaded the the SageMakerAnnotationS3Bucket.

Create Custom Label Job in SageMaker GroundTruth

  • Upload the input manifest.json file generated earlier to the SageMakerAnnotationS3Bucket
  • Create workforce and add team member smgtworkforce
  • Create a SageMaker GroundTruth Labeling Job: at step 1 specify the input and output data locations in SageMakerAnnotationS3Bucket plus the SMGTLabelingExecutionRole as IAM role for labeling job smgtjobstep1
  • Copy the content in template.liquid.html to the Custom Template text field as well as configure the gt-prelabel-task-lambda and gt-postlabel-task-lambda functions deployed earlier. smgtjobstep2

After configuring the custom labeling task, click on the Preview button, you will see the following preview smgtpreview

If you created a private workforce, you can go to the Labeling Workforces tab and find the annotation console link there as shown earlier. The annotator will be able to see the task created like:
startworking

Train and deploy model using SageMaker Notebook Instance

The CFN deployment earlier also create a SageMaker notebook instance, open the Jupyter notebook to train and deploy machine learning models using the annotated datasets from SageMaker GroundTruth labeling job:
smnotebook

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

annotate-medical-images-in-dicom-server-and-build-ml-models-on-amazon-sagemaker's People

Contributors

amazon-auto avatar brymrsh avatar danullom avatar flamingofugang avatar nihirc 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.