A team of radiologists from New Orleans studied the usefulness of Chest Radiographs for diagnosing COVID-19 compared to the reverse-transcription polymerase chain reaction (RT-PCR) and found out they could aid rapid diagnosis, especially in areas with limited testing facilities [1].
Another study found out that the radiographs of different viral cases of pneumonia are comparative, and they overlap with other infectious and inflammatory lung diseases, making it hard for radiologists to recognize COVID‐19 from other viral pneumonia cases [2].
This project aims to make the former study a reality while dealing with the intricacies in the latter, with the help of Deep Learning.
The project uses the COVID-19 Radiography Database [3] as it's dataset. It has a total of
21165
Chest X-Rays (CXRs) belonging to 4 different classes (COVID-19
,Lung Opacity
,Normal
andViral Pneumonia
).
Three top scoring CNN architectures, VGG-16 [4], ResNet-18 [5] and DenseNet-121 [6], trained on the ImageNet Dataset [7], were chosen for fine-tuning on the dataset.
The results obtained from the different architectures were then evaluted and compared.
Finally, with the help of Gradient weighted Class Activation Maps (Grad-CAM) [8] the affected areas in CXRs were localized.
- Note: The dataset and the trained models can be found in here.
- Dataset Exploration
- Split the dataset
Type COVID-19 Lung Opacity Normal Viral Pneumonia Total Train 3496 5892 10072 1225 20685 Val 60 60 60 60 240 Test 60 60 60 60 240 - Fine-tune VGG-16, ResNet-18 and DenseNet-121
- Define Transformations
- Handle imbalanced dataset with Weighted Random Sampling (Over-sampling)
- Prepare the Pre-trained models
- Fine-tune step with Early-stopping
Hyper-parameters Learning rate 0.00003
Batch Size 32
Number of Epochs 25
Loss Function Optimizer Categorical Cross Entropy
Adam
- Plot running losses & accuracies
- Results Evaluation
- Inference
VGG-16 | ResNet-18 | DenseNet-121 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Confusion Matrices |
- Localization with Gradient-based Class Activation Maps
COVID-19 infected CXR VGG-16 ResNet-18 DenseNet-121