COVID-19 Lung CT Scan Segmentation using Deep Learning: Response to the growing demand of radiologists during the pandemic
According to a report by Accenture, it’s expected that the health AI market will achieve CAGR of 40% in 2021. The AI health market is expected to reach a valuation of $6.6 Billion by 2021. According to Accenture analysis, when combined, key clinical health AI applications can potentially create $150 billion in annual savings for the US healthcare economy by 2026. [Source]
Artificial intelligence has transformed almost every industry and healthcare is no more an exception. It is said by some leading organizations that AI has got a great potential to improve the resulting outcomes by 30% to 40% while slashing the treatment costs by approximately 50%. Hence, in this blog, we present to you one such use case which demonstrates the capability of AI in the field of healthcare.
The arrival of AI in healthcare
In the healthcare domain of AI, the impact created is life-changing. Artificial Intelligence is being used for simplifying the clinical process in the area of radiology. Radiologists play a great role in the transformation of healthcare in terms of digital perspective. AI in radiology can help healthcare professionals to respond to the growing demands for diagnostic imaging services which in result will improve and make the complete workflow more effective. The majority of the governing bodies around the world are increasingly emphasizing AI ethics which will help society to accept AI-driven technology.
Impact of AI in radiology
The data obtained in the field of radiology is growing at a rapid pace due to radiology examinations. Artificial intelligence is helping radiologists to respond to the exponentially growing demands of radiologists by simplifying the diagnostic and prediction process by using machine/deep learning algorithms. When these complex machine/deep learning models are combines with the human expertise of clinicians and radiologists, then they offer amazing potential to the healthcare industry.
According to the CEO of Siemens Healthineers[LinkedIn], Dr. Bernd Montag, the workflow of AI-driven radiology involves:
- Beginning the process with building more and more digitalization into our devices and incorporating AI.
- As the machine/deep learning models are becoming more advanced, accurate, and intelligent due to the huge amount of data, hence they are capable of delivering the right quality automatically.
- The next step involves supporting the diagnostic findings with the help of data from a CT or MRI. This step is then followed by solving a bigger challenge which involves bringing all the data from different sources and then building a digital assistant that will provide better decision-making in healthcare
Working of neural networks in medical imaging
Since, the availability of cheap resources and deep learning frameworks such as Tensorflow and PyTorch, there is extensive utilization of neural networks in medical imagining. The motivation behind neural networks is the structure of our brain.
The neural networks consist of multiple layers namely input layer, hidden layers, and output layers. The input layers receive the data such as CT scan volume or ultrasound image, or skin lesion images which are related to a particular type of diagnostic.
The neural networks then learn the features which help them to assess and detect a specific diagnostic task. For training, these neural networks huge amount of data is required. For the model to generalize well and obtain better accuracy, we need high quality of data. Hence, we would require an annotated dataset. For this purpose, you just need to stay focused on your development and model building part and let Labellerr take up your data challenge and solve it. Labellerr is an automated, AI-enabled, SAAS platform that allows users to effectively annotate data for their deep learning models.
COVID-19 Lung CT Scan Segmentation using Deep Learning
Currently, the demand for effective tools to diagnose COVID-19 patients is sky-rocketing. Hence, we need a feasible solution for detecting and labeling the infected tissues on CT scans of the chest images of the patients. This task is primarily a task of image segmentation.
For the segmentation, we have used U-Net architecture. The U-Net is a Convolutional Neural Network (CNN) based architecture for fast and precise segmentation of the images. It has outperformed many traditional ways of segmenting images such as a sliding-window convolutional network. [Source]
The U-Net architecture was primarily used as a binary segmentor to segment the lungs from the original lung CT scan and then was used as a multi-segmentor for segmenting different infected regions in the lungs.
The necessity of our use case
This solution will semantically segment the lung CT scan images which are particularly of the patients diagnosed with COVID-19. This will help healthcare professionals to identify the risk level and the severity of the infection which will, in turn, help them to prioritize the patients according to the same. This is an automated computer-based technique that proves to be a reliable technique to detect infected tissues. This solution will help professionals to fight the pandemic by automating, prioritizing, and broaden the treatment of COVID-19 patients globally.
Getting started with the implementation
Introduction to the dataset
CT scans are the key procedure for analyzing the severity level of the infection a COVID-19 positive person is fighting with. Since there is a shortage of radiologists hence the AI models play a crucial role in optimizing diagnostic and treatments. This dataset contains 20 CT scans of patients diagnosed with COVID-19 as well as segmentation of lungs and infections made by experts.
 – Paiva, O., 2020. CORONACASES.ORG – Helping Radiologists To Help People In More Than 100 Countries! | Coronavirus Cases – 冠状病毒病例. [online] Coronacases.org. Available at: <link>
 – Glick, Y., 2020. Viewing Playlist: COVID-19 Pneumonia | Radiopaedia.Org. [online] Radiopaedia.org. Available at: <link>
 – Ma Jun, Ge Cheng, Wang Yixin, An Xingle, Gao Jiantao, Yu Ziqi, … He Jian. (2020). COVID-19 CT Lung and Infection Segmentation Dataset (Version Version 1.0) [Data set]. Zenodo. DOI
Writing the codes
- The whole implementation is performed on the Kaggle platform. Here is the link to the same notebook. We have imported the libraries that we will be using in this implementation.
2. Now, we will be reading the metadata provided with our dataset.
3. Since, the CT scans are provided to us are in .nii format so we would require them to convert into an array that can be later fed into the model. We will be passing the path to the function and the function will return the corresponding array.
4. Now, we will read the lung CT scan data which includes the original image, lung mask, and the infection mask.
5. Having a quick view of our data by loading a sample image and its corresponding masks.
6. We need to convert the whole image and its corresponding masks to an array so that it can be fed to the model.
7. The data is split into training and testing data. 10% of the data will be used for testing and 90% of the data will be used to train the model.
8. Starting the model-building part.
9. Since, the U-Net architecture involves up-scaling and down-scaling both. So, we will first build the architecture for up-scaling also known as contraction path.
10. Now, it’s time to build the expansive path and compile the model.
11. Starting the model training.
12. Plotting the evaluation metric and analyzing it.
13. The model has been trained and from the evaluation metrics we can conclude that it has performed well on the validation set. Therefore, now we will proceed with the prediction task.
About the writer
Hey Guys, congratulation on making it to the end! I am Akshat Dubey and I work as a Data Science Intern at Labellerr. I am a fourth-year student pursuing an Integrated Master of Science in Mathematics and Computing from Birla Institute of Technology – Mesra, Ranchi. My course focuses on the implementation of mathematics in the field of artificial intelligence. I am a Kaggle Master well versed in Machine Learning, Deep Learning, Computer Vision, and Natural Language Processing. My primary interests involve the application of artificial intelligence in the field of healthcare and retail. To connect with me, you can click on the following links:
Connect with the Labellerr Team: