DEV Community

Cover image for How To detect covid-19 pneumonia in a chest x-ray using a deep learning process
usamnet000
usamnet000

Posted on

How To detect covid-19 pneumonia in a chest x-ray using a deep learning process

Here, two healthy lungs are shown in black
So that the air does not absorb any X-rays, so it is black and looks almost black on the X-ray because this is mostly everything inside it

Alt Text

X-rays are often used to evaluate for abnormalities in the lungs and bone fractures, for example testing for pneumonia.

Alt Text
As you can see in the picture on the right, pneumonia fills the lungs by infiltrating more than air and thus absorbs more radiation.

In this project, the system is able to discover the different causes of pneumonia in a chest X-ray, using this deep learning process and 2D medical imaging to analyze data from the Kaggle Chest dataset and the COVID19 set and train the CNN to classify a chest X-ray for the presence or absence of COVID19 pneumonia. . This project will culminate

With a model that can accurately predict the presence of pneumonia at the human radiologist level.

The Kaggle Chest X-ray data set and the COVID19 chest X-ray data set were collected by Dr. Joseph Paul Cohen from the University of Montreal.

Both data sets consist of anteroposterior chest images of patients with pneumonia. As the COVID19 dataset is updated daily as more cases are published, this research has reached the conclusion of an optimal solution to classifying four different pneumonia diseases:

  • Pneumonia (viral)
  • Pneumonia (bacterial)
  • COVID-19 pneumonia

Let's look at some examples to underscore the subtle differences between the various causes. In particular, the differences between the virus and COVID-19 cases are indistinguishable without extensive radiological training, reinforcing the difficulties faced by health care providers on the front line.

Alt Text

Chest X-ray for patients from left to right: normal, bacterial, viral, COVID19.

After implementation, the system can classify COVID-19 with most people with pneumonia

Alt Text

The system can not only separate healthy lungs from those with pneumonia, but it can also distinguish between the different causes of pneumonia, whether it is caused by bacteria, SARS-CoV-2, or some other virus.

All code is available in repository github

Sample Solution

Part 1: Choosing a clinical case.

I chose to focus on the case - COVID-19 Compatible Chest CT Pattern.

Part 2: Background research.

I then focused on Performance of radiologists in differentiating COVID-19 from viral pneumonia on chest CT paper by Bai, H.X., Hsieh, B., et. al. for my background research.

Part 3: Framing the problem as a machine learning task.

Per the ACR-DSI, the assigned task is to provide a likelihood of a diagnosis compatible with COVID-19 using chest CT data. I believe an initial step in solving this clinical problem, determining whether any abnormal findings are present on a chest CT, would be well-framed as an object detection task. The output would be a bounding box delineating the areas of abnormality that could indicate viral pneumonia. Based on recent literature, such findings could include consolidation, bilateral and peripheral disease, linear opacities, “crazy-paving” patterns, and the “reverse halo” sign. While these findings are not-specific for COVID-19, their detection could guide the ordering clinician to be more vigilant in follow-up testing for the disease. A negative STAT rapid influenza/RSV PCR tests and positive Real-Time Reverse Transcriptase Polymerase Chain Reaction (rRT-PCR) would confirm the diagnosis.

Top comments (0)