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.
- Introduction
- Prerequisites
- Install and set up environment
- Dataset demonstration
- Metrics
- Experimental configuration
- Results
- Demo
This work is conducted by:
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.
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.
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.
- Python >= 3.6
- Sklearn >= 0.24.2
- NumPy >= 1.13.3
- Tensorflow >= 2.6
conda create -n covid-detect python==3.8 -y
conda activate covid-detect
pip3 install -r requirements.txt
jupyter notebook
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
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.
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.
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.