Code Monkey home page Code Monkey logo

detect-covid19_pneumonia's Introduction

Detect COVID-19 and Pneumonia via Chest X-Ray images using Deep Learning approaches

In this work, we propose a rapidly testing method which has a high productivity in a short time. In details, we will apply deep learning neural networks, e.g. ResNet50 and VGG16 to solve this problem. After that, we will proceed analysing pros and cons of those models for a thorough vision about applying artificial intelligence in COVID-19 rapid testing.

Contents

  1. Introduction
  2. Prerequisites
  3. Install and set up environment
  4. Dataset demonstration
  5. Metrics
  6. Experimental configuration
  7. Results
  8. Demo

1. Introduction

This work is conducted by:

Dataset's description

In this research, we use COVIDx dataset - which is a widely used dataset in recent research about COVID-19 nowadays. Additionally, this dataset also provides an image extension transfer tool: from .mri into .jpg. And the author moreover provide a code to support data pre-processing and getting rid of unnecessary part for synthesized data.

Method

We proposed using diagnostic imaging, which is an approach using Chest X-ray (CXR) image. This is due to its lower cost and faster testing time in comparison with Real-time Polymerase Chain Reaction (RT PCR) or Computed Tomography (CT) Image.

Model approach

Throughout this research, we use 2 different approaches which are ResNet50 and VGG16 to solve this problem. VGG16 is a deep neural network architecture under-using residual design principals, it is also a compact architecture which has a low diversity of architectures. On the other hand, ResNet50 is a deep neural network harnessing residual design principles and it has a moderate diversity of architectures. This network brings many a high productivity in a large number of researching in classifying X-ray images. Despite each approach has its own benefits and drawbacks, both are proved their productivity through real application.

2. Prerequisites

  • Python >= 3.6
  • Sklearn >= 0.24.2
  • NumPy >= 1.13.3
  • Tensorflow >= 2.6

3. Install and set up environment

conda create -n covid-detect python==3.8 -y
conda activate covid-detect 
pip3 install -r requirements.txt
jupyter notebook

4. Dataset demonstration

We would use COVIDx dataset version 5 with about 30,000 CXR images. The dataset's author also supply some tools to support the preprocessing process, e.g., transforming medical images from the original format into the more popular ones .jpg, synthesizing and removing duplicated components in the datasets. Additionally, we also split the dataset into three separate sets including train set, validation set, and test set with the distribution appeared in Table 1.

Train Validation Test Sum
COVID-19 13,192 3298 200 16690
Normal 6468 1617 100 8185
Pneumonia 4444 1111 100 5655
Sum 24104 6026 400 30530

Table 1. Dataset's distribution

5. Metrics

Precision

Recall

F1-score

6. Experimental configuration

We use the hyperparameters settings to do the training for two models demonstrated as follows:

  • learning rate: 1e-3
  • Optimization algorithm: Adam
  • Number of epochs: 30
  • Batch size: 32
  • Factor: 0.1
  • Learning rate's patience: 1
  • Input resolution: 480x480

The training process is conducted on Colab Pro Plus with NVidia P100 GPU, 32GB RAM, 4 vCPU CPU.

7. Results

Confusion matrix of ResNet50 (left) and VGG16 (right).

Precision Recall F-score Image numbers
COVID-19 0.99 1.00 1.00 200
Normal 0.89 0.98 0.93 100
Pneumonia 0.99 0.87 0.93 100

Table 2.Classification report of VGG16.

Precision Recall F-score Image numbers
COVID-19 1.00 1.00 1.00 200
Normal 0.94 0.98 0.96 100
Pneumonia 0.99 0.94 0.96 100

Table 3. Classification report of ResNet50.

Figure 5. Accuracy of ResNet50 (left) and VGG16 (right).

Accuracy Number of parameters Training time (hour)
VGG16 96.24% 14,781,251 17,1
ResNet50 98.00% 23,827,971 15.45
VGG19 (Wang et al. [1]) 83% 20,370,000 -
ResNet50 (Wang et al. [1]) 90.6% 24,970,000 -
COVID-Net (Wang et al. [1]) 93.3% 11,750,000 -

Table 4. Accuracy, number of parameters, and training time of VGG16 and ResNet50.

Figure 6. Loss of ResNet50 (left) and VGG16 (right).

8. Demo

web_demo.mp4
mobile_demo.mp4

detect-covid19_pneumonia's People

Contributors

ngctnnnn avatar twelcone avatar vokhanhan25 avatar

Forkers

twelcone

detect-covid19_pneumonia's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.