Intel has been an integral part of hospital technology for almost 50 years. From desktop computers to MRI scanners, diagnostic monitors, and even portable X-Ray machines, we have been at the forefront of healthcare transformation. So it makes sense that we’ve been an early collaborator with major healthcare centers and medical device manufacturers to help make sense of the new healthcare AI revolution, including educating customers on the best practices and latest advances in the field. In the spirit of continuing to educate the industry, in this blog we will:
The Medical Segmentation Decathlon is a 10-dataset challenge for medical image segmentation. It’s a well-curated, labeled dataset for building semantic segmentation models, such as the popular U-Net. Most importantly,the Creative Commons Attribution-ShareAlike* 4.0 license (CC BY-SA 4.0) makes it friendly to both public and commercial entities alike.
We’ve chosen the Brain Tumor Segmentation (BraTS) subset of the Decathlon as a great real-world example for the budding healthcare AI practitioner to learn how to prepare, train, and infer on semantic segmentation models. It’s relatively easy to train a 2D U-Net within a few hours of work to identify brain tumors from MRI scans. Our hope is that this training example will help data scientists in the same way we’ve been using the beloved MNIST dataset as the “Hello World!” tutorial for deep learning.
We’ve made our 2D U-Net model scripts available on GitHub. You should be able to train directly on your Intel CPU simply by downloading and installing Anaconda* and creating a Conda environment with the latest versions of TensorFlow* (1.12), Keras* (2.2.4), and NiBabel* (2.3.1) to run the training and inference. Anaconda will provide you with the Intel® Optimization for TensorFlow*. We also rely on helper functions from the Python* packages h5py, tqdm, and psutil. These three commands should install the packages for you to train the model:
$ conda create -c anaconda -n decathlon pip python=3.6 tensorflow keras tqdm h5py psutil
$ conda activate decathlon
$ pip install nibabel
Once you download the BraTS dataset from the Decathlon website, you simply untar the file, and then run the script:
$ bash run_brats_model.sh DIRECTORY_FOR_RAW_DATA where
DIRECTORY_FOR_RAW_DATA is the directory in which you untarred the BraTS datafiles.
The script should take the raw MRI data files, preprocess them as Numpy arrays, save them to a single HDF5 file for convenience, and then train a 2D U-Net on the dataset.
Once you’ve trained the model, you can convert it using the Intel Distribution of OpenVINO Toolkit, which enables developers to create high performance computer vision applications and easily incorporate industry standard frameworks for deployment of deep learning solutions that run fast and seamlessly across Intel’s silicon architectures. An Intel CPU-optimized version of OpenCV is included as a part of the toolkit’s installation and will allow you to develop C++ inference scripts using the Inference Engine (IE) plugin.
By using the toolkit’s IE you’ll be able to deploy trained models using the Intel NCS 2, a great choice for inference at the edge due to its low power and bandwidth consumption, fast local processing, and high responsiveness at a reasonable price.
We have included instructions on how to build a Docker container with the Intel Distribution of OpenVINO toolkit to enable edge inference on your U-Net model. You’ll need to download a copy of the OpenVINO installer before running the Docker build script. Be sure to choose the Linux* installer since that is what the Docker container will be using under the hood. Docker will allow you to run your model on a wide range of hardware and operating systems. This gives you a portable solution to run deep learning models on Intel’s wide variety of AI hardware.
We hope that you’ll try out our Decathlon scripts and build tutorials of your own based on the other subsets. Perhaps you can try to build a model based that identifies pancreatic tumors? You could build a 3D U-Net based to differentiate hepatic blood vessels or even create a startup that leverages Intel hardware to provides a complete, low-cost, portable solution for healthcare AI applications at the edge.
Intel technologies’ features and benefits depend on system configuration and may require enabled hardware, software or service activation. Performance varies depending on system configuration. No computer system can be absolutely secure. Check with your system manufacturer or retailer or learn more at intel.ai.
Optimization Notice: Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice Revision #20110804
Hardware configuration for model training: One Intel® Xeon® Processor 8180, 56 cores, CentOS Linux 7 x86_64, 384 GB RAM, SOFTWARE USED: Intel Optimized TensorFlow* 1.12, Keras 2.2.4, nibabel 2.3.1. Date of testing: December 24-26, 2018.
© 2019 Intel Corporation. All rights reserved. Intel, the Intel logo, Xeon, and Intel Nervana are trademarks of Intel Corporation or its subsidiaries in the U.S. and/or other countries. *Other names and brands may be claimed as property of others.