Diagnosis of Pneumonia with the use of AI

Since early 2020, we have witnessed the huge changes in our lives brought on by the COVID-19 virus. As we continue to combat the pandemic, AI has played an increasingly important role. Part of this role is the detection and diagnosis of pneumonia associated with COVID-19.

As an Inspirit AI scholar during the summer of 2021, I had the opportunity to learn about and work on a project mentored by Sifan Ye on X-ray based pneumonia detection using AI algorithms and models. In this article, I will explain why pneumonia detection is important, how AI has facilitated the process, and what AI algorithms are used to do so.

What is Pneumonia?

Pneumonia fills your lungs with fluid, preventing oxygen from entering your bloodstream and potentially causing respiratory failure.

Why is it Important to Diagnose Pneumonia?

According to an article from GE Healthcare, pneumonia is not an easy disease to diagnose. Pneumonia can be contracted nearly anywhere through a number of pathogens, including bacteria, fungi, and viruses. Even using X-ray images of patients’ lungs, pneumonia can be mistaken for other conditions and it’s hard to discern the cause of the infection in the first place. The confusion is exacerbated when the patient is experiencing additional health complications. However, correct diagnosis is vital for patients with pneumonia due to its severity and deadliness.

How can you use AI to diagnose pneumonia?

This is where AI comes in. Using AI techniques specific to images for the diagnosis of pneumonia from chest X-rays can improve the accuracy of medical diagnosis and make the process much more efficient. Both the Harvard Business Review and GE Healthcare have said that AI performed as well as radiologists when analyzing images. AI quickly learns from a large quantity of data and can process multiple images at once. Applying AI to medical imaging will also result in other benefits, like lower expenses for hospitals and less human labor.

In order to detect pneumonia from chest X-rays in this project, we used some common AI models. We fed these models images from our dataset and trained them to diagnose new images. Our goal was to be as accurate as possible in our predictions, so we used multiple models in order to compare their accuracies.

Usine K-Nearest Neighbors to Diagnose Pneumonia

The first model, K-nearest neighbors, makes predictions based on what input is closest to. It mathematically represents the difference between features of a new image to images it has seen before. Depending on whether the least “different” images depict pneumonia or not, the new image will be classified accordingly. The K in K-nearest neighbors refers to the number of closest images the model considers when making its prediction. For our project, we set K equal to 5.

Using Neural Networks to Diagnose Pneumonia

The second model, neural networks, can recognize patterns and features across groups of pixels in an image. A neural network has an input layer, an output layer, and intermediate or hidden layers. Each layer has things called neurons that take in inputs and pass on outputs to the next layer. We used a neural network with 64 neurons in the first hidden layer and 32 neurons in the second hidden layer.

Using Convolutional Neural Networks to Diagnose Pneumonia

The third model, convolutional neural networks, is a special type of neural network that can recognize a pattern regardless of its location in an image. They search for a pattern across each small section of an image using what is known as a convolutional layer. The output of the convolutional layer can be condensed, and then inputted into a regular neural network to produce the final classification. Our convolutional neural network had two hidden layers.

Using Transfer Learning to Diagnose Pneumonia

The final model, transfer learning, involves using expert models that have already learned to do a task, like classifying images, and training it to do your task, like detecting pneumonia.

Because these expert models already have experience, transfer learning is easier than training another model from scratch. Out of our four models, the convolutional neural network had the highest accuracy in detecting pneumonia from the X-ray images.

The Future of AI in Healthcare

Medical imaging is just one out of a vast number of fields AI can be applied to in our world. I hope this article gives you some insight into how AI can be used for disease diagnosis and encourages you to dive deeper in your exploration of AI.

Sources

https://hbr.org/2018/03/ai-will-change-radiology-but-it-wont-replace-radiologists

https://blogs.bmj.com/bmj/2021/07/23/artificial-intelligence-for-covid-19-response/

https://www.gehealthcare.com/article/ai-could-hold-the-key-to-identifying-pneumonia-via-x-ray

https://www.healthgrades.com/right-care/lungs-breathing-and-respiration/why-pneumonia-can-be-dangerous

Previous
Previous

AI in Space: The Use of AI for Finding Exoplanets

Next
Next

AI in Sports Explained by a High School Student Who's Played Badminton Since First Grade