3.1 Data
To identify the COVID-19 using DenseNet architecture based CNN, a real patient image dataset[2] from a hospital from Sao Paulo, Brazil, was used in this study. Soares, Angelov [21] made this dataset publicly available to encourage further research development for the further stimulation of knowledge. There are 2482 CT images in total, while 1252 CT images were COVID-19 positive, and 1230 CT images were from non-infected by COVID-19 but who presented other pulmonary diseases. The images classes were labeled into two types: COVID and nonCOVID. Figure 2 represents a few instances of CT scans for patients infected and non-infected by COVID-19 that compose the dataset.
3.1.1 Pre-processing
The objective of the image pre-processing stage is to smother unwanted twists present in the picture, resize and normalize the image for further processing. There is numerous image pre-processing technique found in the previous literature based on the requirement of model building. Among them, image resizing, image normalization, and covert level to categorical are generally used techniques. In this study, images were resized to ensuring the same size and the same pixel using the “Pillow 2.7++”[3] python package. This study considers 64×64 pixel values for images. Besides, image normalization is a process in which we adjust the pixel intensity to make the picture increasingly natural. Normally, most of the image pixel integrates the values between 0 to 255. But, due to the use of network architecture, it is better to perform all values between 0 to 1, which will be a good fit for the model building. This reduces the computational complexity during training the model. However, using Eq. (11), images were normalize
Where Xmin and Xmax refers to minimum and maximum pixel values.
3.1.2 Experimental Setup and Performance Measurement
The proposed COVID-19 classification model was implemented using Python 3.7 software[4] with related packages. Intel(R) Core(TM) i5-8250U CPU @ 1.60 GHz processor with 16GB primary memory with 4-GB NVIDIA GeForce 940MX Graphics and 64-bit windows operating systems was used. COVID-19 patients’ identification aims to determine if a patient is a COVID-19 infected or not. Before model building data was split into three part: training (70%), validation (10%) and testing (20%). The model history is presented in table 3 which was trained with 50 epochs. The DenseNet-121 code of COVID-19 detection is available at https://github.com/shawon100/Covid-19-Disease-Diagnosis. The outcomes of samples of each category correctly and incorrectly classified can be summarized as a confusion matrix, shown in Table 2. We can determine the accuracy based on the confusion matrix (Equation 12). The classification model's performance was calculated using four performance measurements: precision, recall, F1-measure, and G-Mean. Accuracy is the percentage of all instances that are correctly predicted.
Nonetheless, accuracy cannot differentiate between the numbers of correctly classified samples of each class, particularly for the positive class in classification problems. A very reliable classifier may have misclassified the positive classes as negative. Occasionally, accuracy is, therefore, not enough to evaluate model performance in classification problems.
Table 2: Confusion Matrix for COVID-19 Prediction
|
Predicted
|
Actual
|
Absence of COVID-19
|
Presence of COVID-19
|
Absence of COVID-19
|
True positive (TP)
|
False Negative (FN)
|
Presence of COVID-19
|
False Position (FS)
|
True Negative (TN)
|
Moreover, we implemented two metrics: F-measure, and G-Mean, along with accuracy, which is widely used for classification problems are as follows.
Where F-measure is the weighted average of the precision and precision is the percentage of correct predictions for the positive class and recall is a measurement of how much a classifier can recognize positive examples. GMean aims to evaluate the two-class recall balance. The GMean value will be lower if the model is highly biased towards one class since this approach has become widely used in the classification problem. Thus, we used F-measure and GMean to assess the model's performance.
Table 3: Model Summary of CNN
Model: "model_1"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
input_2 (InputLayer) (None, 64, 64, 3) 0
_________________________________________________________________
conv2d_1 (Conv2D) (None, 64, 64, 3) 84
_________________________________________________________________
densenet121 (Model) multiple 7037504
_________________________________________________________________
global_average_pooling2d_1 ( (None, 1024) 0
_________________________________________________________________
batch_normalization_1 (Batch (None, 1024) 4096
_________________________________________________________________
dropout_1 (Dropout) (None, 1024) 0
_________________________________________________________________
dense_1 (Dense) (None, 256) 262400
_________________________________________________________________
batch_normalization_2 (Batch (None, 256) 1024
_________________________________________________________________
dropout_2 (Dropout) (None, 256) 0
_________________________________________________________________
root (Dense) (None, 2) 514
=================================================================
Total params: 7,305,622
Trainable params: 7,219,414
Non-trainable params: 86,208
[2] Source: https://www.kaggle.com/plameneduardo/sarscov2-ctscan-dataset
[3] Source: https://pillow.readthedocs.io/en/latest/
[4] Source: https://www.python.org/