Getting Started with MONAI

Getting Started AI in Healthcare with MONAI

Project development in AI in healthcare domain can be exhausting without MONAI. Because computer vision and image processing methods in healthcare are quite different from regular methods. Basically, evaluation methods and KPIs are different in medical models from others. Additionally, there are many imaging modalities and every modality has its own data and labelling structure. We need healthcare-specific solutions to standardize methods and reproduce research results.

What is MONAI?

Project MONAI is started by NVIDIA and King’s College London and MONAI is developed by Project MONAI. Its name comes from initials of Medical Open Network for Artificial Intelligence and it is a Python framework for healthcare imaging. It provides healthcare domain-optimized features for developers. It brings PyTorch ecosystem to healthcare-specific applications because it is based on PyTorch. It is published open-source and distributed with Apache 2.0 licence.

It solves many of our problems when we encounter developing AI models in healthcare. Shortly, it brings standardized, user friendly, reproducible and high quality code structure and it covers end-to-end workflow with labeling, training and deployment tools. You can visit MONAI Project web site from here.

Getting Started with MONAI

Why is MONAI Needed?

Actually, the answer is obvious. We want to solve biomedical problems fast and efficient. Because biomedical applications of AI needs some different methodologies from other areas and they have specific requirements. Medical image’s data structure is different from regular images. So, modalities like MRI, CT, USG have different processing methods and paradigms like voxel spacing, HU. Also medical images have different file format like DICOM, NIfTI unlike regular image formats like PNG, JPG.

Additionally, problems in medical AI can be highly domain specific. We should solve these in efficient and specific way. Lastly, some network architectures are highly successful in biomedical applications. So, we need to collect these architectures in a same bucket.

How to Install MONAI?

MONAI has three components: Label, Core and Deploy. Each component should be installed separately. We can use pip or conda managers to install each component. You can choose one of them according to your development environment.

Install with pip

pip install monai
pip install monailabel
pip install monai-deploy-app-sdk

Install with conda

conda install -c conda-forge monai
conda install -c conda-forge monailabel
conda install -c conda-forge monai-deploy-app-sdk

Using MONAI on Docker Container

If you are familiar with Docker and containerization you may want to use Docker container of MONAI from Docker Hub. Official Docker image contains all tools that you need to use MONAI. So, working with Docker images is gorgeous and not exhausting when you understand the container mechanics. I will write another blog post about using containers and ML tools together in detail in upcoming days.

Before pulling the container image you should be sure that you have installed NVIDIA GPU Driver, Docker 19.03+, NVIDIA Docker also called NVIDIA Container Toolkit. If you installed and validated these we can continue. Let’s pull the container image. The command below ends with 0.9.1 because we want to work with released version of MONAI not a version under the development. So, we specified a version tag instead of latest tag.

docker pull projectmonai/monai:0.9.1

This process will take some time because container image is more than 6GB in size. After the pulling we will create a container from the MONAI image which we downloaded. Let’s create a container with the command below.

docker run --name monai --gpus all --ti --ipc=host projectmonai/monai:0.9.1

We created a container from the image, assigned all available GPUs to it, named it monai with this command. Now, you can use this container for your work. You can start your journey with reading Research Papers About COVID-19 and Artificial Intelligence post and then applying these researches to your environment.

That’s all! We’ve installed all components that we need. Now, you can start our projects about AI in medicine. If you stuck in somewhere you can ask your question in the comments section.

Leave a Reply

Your email address will not be published.