Skip to content

perdoorrajeshnayak/Elicode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Classification and Gradient-based

Contents

Introduction

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.

Overview

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 and Viral 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.

Steps

  1. Dataset Exploration
  2. 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
  3. Fine-tune VGG-16, ResNet-18 and DenseNet-121
    1. Define Transformations
    2. Handle imbalanced dataset with Weighted Random Sampling (Over-sampling)
    3. Prepare the Pre-trained models
    4. 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
    5. Plot running losses & accuracies
      • Model Summary Plot
        VGG-16 vgg_plot
        ResNet-18 res_plot
        DenseNet-121 dense_plot
  4. Results Evaluation
    1. Plot confusion matrices
    2. Compute test-set Accuracy, Precision, Recall & F1-score
    3. Localize using Grad-CAM
  5. Inference

Results

VGG-16 ResNet-18 DenseNet-121
Pathology
COVID-19
Lung Opacity
Normal
Viral Pneumonia
Accuracy Precision Recall F1-Score
0.9956 0.9833 1.0000 0.9916
0.9582 0.8833 0.9464 0.9138
0.9622 0.9667 0.8923 0.9280
0.9913 0.9833 0.9833 0.9833
Accuracy Precision Recall F1-Score
0.9871 0.9667 0.9830 0.9748
0.9664 0.8667 1.0000 0.9286
0.9664 1.0000 0.8823 0.9375
0.9957 1.0000 0.9836 0.9917
Accuracy Precision Recall F1-Score
0.9957 0.9833 1.0000 0.9916
0.9623 0.9167 0.9322 0.9244
0.9623 0.9500 0.9047 0.9268
0.9957 0.9833 1.0000 0.9916
TL;DR
Train set
Test set
Total Correct Predictions Total Accuracy
20362 98.44%
229 95.42%
Total Correct Predictions Total Accuracy
20639 99.78%
230 95.83%
Total Correct Predictions Total Accuracy
20540 99.30%
230 95.83%
Confusion Matrices

vgg_confmat

res_confmat

dense_confmat

  • Localization with Gradient-based Class Activation Maps
original vgg_cam res_cam dense_cam
COVID-19 infected CXR VGG-16 ResNet-18 DenseNet-121

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published