COVID-19 Disease Detection Based on Machine Learning and Chest X-Ray Images

Ramyar A. Teimoor, Mihran A. Muhammed

Department of Computer, College of Science, University of Sulaimani, Iraq

Corresponding author’s e-mail: Ramyar A. Teimoor, Department of Computer Science, College of Science, University of Sulaimanyah, Sulaimanyah, Kurdistan Region, Iraq. ramyar.teimoor@univsul.edu.iq
Received: 01-10-2022 Accepted: 05-11-2022 Published: 21-11-2022

DOI: 10.21928/uhdjst.v6n2y2022.pp126-134



ABSTRACT

Due to increasing population, automated illness identification has become a critical problem in medical research. An automated illness detection framework aids physicians in disease diagnosis by providing precise, consistent, and quick findings, as well as lowering the mortality rate. Coronavirus (COVID-19) has expanded worldwide and is now one of the most severe and acute disorders. To avoid COVID-19 from spreading, making an automatic detection system based on X-ray chest pictures ought to be the quickest diagnostic alternative. The goal of this research is to come up with the best model for detecting COVID-19 diagnosis with the greatest accuracy. Therefore, four models, Convolutional Neural Networks, Residual Network 50, Visual Geometry Group 16 (VGG16), and VGG19, have been evaluated using the same images preprocessing method. In this study, performance metrics include accuracy, precision, recall, and F1 scores are used for evaluating proposed method. According to our findings, the VGG16 model is a viable candidate for detecting COVID-19 instances, because it has highest accuracy; in result overall accuracy of 98.44% in training phase, 98.05% invalidation phase and 96.05% in testing phase is obtained. The results of other performance measurements are shown in the result section, demonstrating that the majority of the approaches are more than 90% accurate. Based on these results, radiologists may find the proposed VGG16 model to be an intriguing and a helpful tool for detecting and diagnosing COVID-19 patients quickly.

Index Terms: COVID-19, Convolutional Neural Networks, Residual Network 50, Visual Geometry Group 19, Visual Geometry Group 16, X-ray Image, Machine Learning

1. INTRODUCTION

Humans have been victims of many pandemics throughout history. The globe is presently dealing with another epidemic and an unseen foe, the new COVID-19 coronavirus. The coronavirus illness (COVID-19) is a global epidemic that has spread rapidly. The first incidence was reported in Wuhan, China, in November 2019. Following reports of a large number of infections in several nations, the “World Health Organization (WHO)” declared the pandemic a public health emergency on March 11, 2020 [1]. According to the WHO, signs of a respiratory infection caused by the virus include inflammation of the lungs, fever, and coughing. Another aggravating issue is that the virus has a high person-to-person transmission ratio [2], The best way to stop and postpone transmission is to keep your distance from people in social situations [3]. More than 150 million individuals had contracted the coronavirus by March 10, 2021, and 3 million people had died as a result of it [1].

Because of its high transmissibility, early identification of the Coronavirus is critical for managing COVID-19. According to Chinese government standards, Reverse Transcription-Polymerase Chain Reactions should primarily be used to identify the presence of the corona virus in respiratory or blood samples using gene sequencing (RT-PCR). The RT-PCR procedure takes 4–6 h to complete which is a considerable period comparing to how rapidly COVID-19 spreads [4]. In addition, RT-PCR test kits are not only useless, but also hard to come by. As a consequence, a lot of infected patients go unnoticed for a while and unintentionally spread the disease to others. The prevalence of COVID-19 illness will reduce if the condition is detected early enough.

In order to address the ineffectiveness and unavailability of the current COVID-19 testing, other test methodologies have been explored to identify COVID-19 infections. Additionally, radiological imaging computed tomography (CT) methods like computed tomography and X-rays may be used. According to the study [4], a method based on chest CT scans might be a useful tool for locating and counting COVID-19 instances. X-ray pictures have been used by several studies to illustrate different methods for detecting COVID-19. It is crucial to understand that utilizing technology ethically will improve human lives [5]. Therefore, recent advances in technology such as computer vision, machine learning, and deep learning have allowed for the automated detection of a number of diseases in the human body, ensuring intelligent treatment. Deep learning is utilized as a one of the best techniques for training a model for classification and detection COVID-19 [4].

As a result, one of the main objectives of this study is to offer a machine learning-based system for COVID-19 illness identification using 4 distinct deep learning models.

The remaining sections of this paper are included as follows: In section 2, we go through the existing literature on utilizing Machine learning techniques to analyze COVID-19 CXR images. The proposed Model is described in depth in section 3, including the required parameters, pre-trained backbones, and procedural stages. In section 4, categorization results are contrasted in terms of recall, precision, and overall accuracy to evaluate the model’s efficacy. Section 5 comes to a close.

2. RELATED WORK

2.1. Ahammed et al. [6]

The goal of this research is to see if using machine learning and deep learning techniques on chest X-ray pictures may help detect coronavirus cases. The two chest X-ray datasets were collected from Kaggle and Github and pre-processed using random sampling to create a single dataset. They used a combination of machine learning and deep learning techniques, including convolutional neural networks (CNN) and traditional machine learning. They looked at specificity, fallout rate, and accuracy to see whether they could better identify non-COVID-19 people. Their suggested that CNN model had the best accuracy (94.03%), AUC (95.52%), f-measure (94.03%), sensitivity (94.03%), and specificity (97.01%), as well as the lowest fall out (4.48%) and miss rate (2.98%).

2.2. Saiz and Barandiaran [7]

They provide a rapid technique for detecting COVID-19 in chest X-ray pictures using deep learning techniques. A publicly available dataset of 1500 images of healthy individuals and those with COVID-19 and pneumonia infection is used to train, test, and recommend object identification architecture. The main goal of their strategy is to categorize a patient’s COVID-19 case as either positive or negative. Utilizing the SDD300 model, they successfully used deep learning models to identify COVID-19 with a sensitivity of 94.92% and a specificity of 92.00% in their studies.

2.3. Ismael and Şengür [8]

In this study, to categorize COVID-19 and normal chest X-rays, deep learning-based techniques were utilized, including deep feature extraction, fine-tuning of CNN (Visual Geometry Group [VGG]16 and VGG19, Residual Network [ResNet]18, ResNet50 and ResNet10), and end-to-end training of a proposed CNN model. Support vector machine (SVM) is used to classify deep features; linear, quadratic, cubic, and Gaussian kernel functions were employed. The fine-tuning process also utilized the previously stated pre-trained deep CNN models. In this research, an end-to-end training paradigm is presented to suggest a new CNN. There were 180 COVID-19 and 200 non-COVID-19 images in this dataset. The study’s performance was measured in terms of classification accuracy. Various local texture descriptors and SVM outcomes were also employed and compared versus alternative deep methods’ performance; the deep methods outperformed local texture descriptors for using chest X-rays in COVID-19 classification. The highest accuracy score achieved among this work’s findings obtained from the ResNet50 model and SVM classifier using the linear kernel function.

2.4. Zebin and Rezvy [9]

Using a transfer learning process, they classified COVID-19 X-ray chest pictures from two datasets. The classifier successfully separates those with and without infection from those with COVID-19 and pneumonitis inflammation in the lungs.They used a number of pre-trained CNN, including VGG16, ResNet50, and EfficientNetB0, for this purpose. About 90%, 94.3%, and 96.8% overall detection accuracy were attained for each, respectively. They also developed and improved the COVID-19 class, a minority in their approach, with the use of a generative adversarial architecture (a CycleGAN). To emphasize the parts of the input image that are crucial for predictions for visual interpretation and explanation, they adopted a gradient class activation mapping technique. They suggest that these visualizations might be used to track the areas of the lung that are damaged as the illness expands and becomes worse.

2.5. Gaur et al. [10]

Three pre-trained CNN models are examined in this research (EfcientNetB0, VGG16, and InceptionV3) using transfer learning. These particular models were chosen based on their balance of precision and effectiveness with fewer parameters, making them perfect for mobile applications. The dataset for the research was gathered from a number of freely available sources. Performance metrics and deep learning methods are used in this research (accuracy, recall, specificity, precision, and F1 scores). The results showed that the suggested method provided a high-quality model with a sensitivity of 94.79% for COVID-19 and an overall accuracy of 92.93%. According to the study, computer vision design might be employed to provide efficient ways for detection and screening.

2.6. Sitaula and Hossain [11]

This study introduces a brand-new attention-based deep learning model that makes use of the attention module with the VGG-16 to record the relationship in space between the ROIs in CXR pictures. Meanwhile, they build a VGG-16 model that includes the attention module in addition to a suitable convolution layer (fourth pooling layer). This model’s accuracy in the VGG-16 suggested model is 79.58%.

3. METHOD

Through the use of machine learning, this work seeks to develop a prediction model for COVID-19 positive or negative, such as CNN, ResNet50, VGG19, and VGG16. The system components’ diagram is presented in Fig. 1, each stage will be covered in detail in the following sections.

thumblarge

Fig. 1. General diagram of the proposed COVID-19 detection system.

3.1. Data Collection

At the first step of the proposed system, we need a dataset. The dataset used for model training, data analyzing, augmentation, and description of data. Images of the chest obtained from Kaggle’s COVID collection include X-rays of the chest [12], [13].

The original dataset conation images of four different categories which is (COVID, lung opacity, normal, and viral pneumonia). In this study, only (COVID-19 and Normal) categories have been used because the main focus is to determining that the patient has COVID-19 or not.

There are 13,808 pictures in the dataset related to these two categories, (Fig. 2) each category has the following number of images:

  • Total COVID images = 3616

  • Total Normal images = 10192.

thumblarge

Fig. 2. Number of images in each category.

3.2. Data Preprocessing

The next step after data collection is pre-processing, so is carried out using a variety of Python jupyter notebook built-in parameters and functions, the details of pre-processing of each image have been shown in the Table 1.

TABLE 1: Parameter value for pre-processing section

thumblarge

Figs. 3 and 4 demonstrate the difference before and after image pre-processing.

thumblarge

Fig. 3. Images of chest X-rays from the dataset, together with their labels.

thumblarge

Fig. 4. Images after pre-processing.

3.3. Data Splitting

After preprocessing, the dataset has been divided into train, validate and test categories, because each one of them has a different role in the proposed system. After several times of model training and testing, the division range for train, validate, and test sets that provide the best results are shown in Table 2.

TABLE 2: Number of samples in train, validate, and test set

thumblarge

3.4. Models Architecture

In this study, 13,808 chest X-ray pictures were utilized to detect COVID-19 infection using VGG-16, VGG-19, ResNet50, and CNN models. The next part provides a short overview of model architecture, followed by an explanation of the proposed models and their specifications.

3.4.1. CNN

The design of CNN aims to resemble the human visual brain. The convolution layer, the pooling layer, and the fully linked layer are the three primary layers that comprise CNN. In CNN Model learning is done by the convolution and pooling layers, while classification is done by the fully connected layers, (Fig. 5) [14].

thumblarge

Fig. 5. Convolutional neural networks architecture.

3.4.2. ResNet

ResNet stands for residual network in short. Residual learning is the novel phrase that this network presents; as its name suggests. A ResNet variant called ResNet50 has 48 Convolutional layers, one MaxPool layer, and one Average Pool layer. It can do 3.8 × 109 floating-point computations overall [9].

The “University of Oxford’s” Simonyan and Zisserman provide the VGG16 Model as a convolutional neural network model in their article; “Very Deep Convolutional Networks for Large-Scale Image Recognition.” The model achieves top-5 test accuracy of 92.7% in ImageNet, a dataset with over 14 million images separated into 1000 classes [15]. The model presented to the 2014 ILSVRC was well-known. By gradually substituting several 3 × 3 kernel-size filters for a large number of larger kernel-size filters 11 and 5, respectively, in the first and second convolutional layers, it beats AlexNet.

The input to the cov1 layer of the VGG16 architecture is a 224 × 224 RGB picture. The picture is processed by a series of convolutional layers that employ filters with extremely small receptive 3*3 fields (This is the least size required to correctly capture the left and right, up and down, and center concepts). In additiom, one of the options employs 1 × 1 convolution filters, which linearly change the input channels followed by non-linearity. Convolution stride and spatial padding of the convolution layer input are both set to 1 pixel for 3 × 3 convolution layers to preserve the spatial resolution after convolution. The spatial pooling process uses five max pooling layers, which are applied after part of the conv layers. Max-pooling is not always used after convolutional layers. For max-pooling in stride 2, a 2 × 2 is used [15].

In various configurations, a stack of convolutional layers with varied depth is increased with three fully connected layers, and then the following is carried out: Soft-max layer is the bottom layer. All networks construct the fully linked levels in the same way [15]. As a consequence, VGG-16 features three fully connected layers in addition to 13 convolutional layers (Fig. 6) [14].

thumblarge

Fig. 6. Visual geometry group 16 model [10].

3.4.3. VGG-19

The VGG-19, on the other hand, consists of three completely connected layers and 16 convolutional layers. Consequently, VGG-19 is seen as a more sophisticated CNN architecture than VGG-16 [14].

3.5. Training Phase

The proposed models were trained based on optimal hyperparameters, one of them is using the Adaptive Moment Estimation (Adam) optimizer [16]. This is the most popular and successful gradient descent optimization technique [17].

Categorical cross-entropy loss function in another hyperparameters that used in this study, it shows that we have multi class to identify so, it is required when we have multi classifications task. Each class’s loss is calculated separately [18].

Table 3 shows other optimal hyperparameters for the CNN, ResNet50, VGG19, and VGG16 architectures that provide the best results.

TABLE 3: CNN, ResNet50, VGG19, and VGG16 Model specifications

thumblarge

The model was run on Google Colab since it provides us with free GPU, which is extremely useful for us because, as we all know, training takes a long time, so one of the most important aspects of any study is obtaining results as quickly as possible.

4. RESULTS

The best experiment results are shown in this part to provide how and compare the performance of the recommended VGG16 architecture to the other three models in classifying X-ray pictures into the normal or COVID-19 classes. A total of 13,808 images were used by both classes. Approximately 69% of the photos were utilized for training, and the remaining 31% were divided nearly equally between testing and validating.

The overall accuracy of all four models, namely, (CNN, ResNet50, VGG19, and VGG16) is presented in Table 4. According to these results, all models have an overall accuracy better than 95%, except for the CNN which has lowest accuracy of 80.04%; while VGG16 gives the highest accuracy 98.44, 98.05, and 96.05 for train, validation, and test, respectively. Thus, in comparison to other works that are referenced in related works, our model has higher accuracy.

TABLE 4: Accuracy result for all models

thumblarge

Each model is evaluated in addition to accuracy using performance indicators such as precision, recall, and F1-score. Table 5 summarizes the outcome of these metrics for all models.

TABLE 5: Precision, recall, and F1-score result for all models

thumblarge

It can be seen from the numbers in this table, VGG16 earned the highest for practically all metrics, with the exception of the precision of normal class, which is better with ResNet50. As a result, VGG16 could be used as a better-balanced classification model for COVID-19.

A confusion matrix is another way to assess relevance of the models for this problem. Fig. 7 illustrates confusion matrix for all models. A total of 306 of the 2200 test set images are misclassified by CNN. Whereas COVID-19 was detected in 258 normal cases, and 48 COVID-19 as normal case. Resnet50, VGG19 misclassify 125 and 146 images, respectively, for both categories, when VGG16 misclassifies only 81 images.

thumblarge

Fig. 7. (a-d) Confusion matrix for (CNN, ResNet50, VGG19, and VGG16). CNN: Convolutional neural networks, ResNet50: Residual network 50, VGG: Visual geometry group.

Thus, the confusion matrix values are likewise consistent with earlier measures. CNN gives the highest rate of misclassification. On the other hand, while ResNet50 and VGG19 provide promising results for COVID-19 detection, VGG16 provides better accurate outcome in this regard.

For both test and validation sets, accuracy and loss of the VGG16 architecture are displayed in Fig. 8 for accuracy and Fig. 9 for loss. We can see that epoch 64 had the highest accuracy and lowest loss.

thumblarge

Fig. 8. Visual geometry group 16 model accuracy and validation chart.

thumblarge

Fig. 9. Visual geometry group 16 model loss and validation loss chart.

Fig. 10 shows two randomly selected images from each class with their counterpart heat maps, which correctly classified by the VGG16 model.

thumblarge

Fig. 10. Heat map images after detection by visual geometry group 16.

5. CONCLUSION

COVID-19 disease is affecting the whole world, the number of infections increasing every day, unfortunately the death cases as well. This work aimed to demonstrate the use of machine learning to a chest X-ray picture to assist the health department in quickly identifying all COVID-19-positive cases and halt the spread of the disease. As the result four alternative models, CNN, ResNet50, VGG16, and VGG19 were used and tested with various parameters to get the best outcome. The results indicate that VGG16, which contains 13 layers of convolutional layers and three fully connected layers, was the best model in our work. Since it has the highest accuracy compared to other models, it also aids physicians in accurately diagnosing the disease. As it is known that COVID-19 disease manifests itself at various phases and with various patterns; this characteristic could be addressed in the future researches. Furthermore, it will be easier for radiologists to have a graphical user interface application to do the real-world tests in hospitals.

REFERENCES

[1]. A. Rehman, T. Saba, U. Tariq and N. Ayesha. “Deep learning-based COVID-19 detection using CT and X-ray images:Current analytics and comparisons“. IT Professional, vol. 23, no. 3, pp. 63-68, 2021.

[2]. M. Maia, J. S. Pimentel, I. S. Pereira, J. Gondim, M. E. Barreto and A. Ara. “Convolutional support vector models:Prediction of coronavirus disease using chest x-rays“. Information, vol. 11, no. 12, pp. 1-19, 2020.

[3]. K. B. Prakash, S. S. Imambi, M. Ismail, T. P. Kumar and Y. V. R. Pawan. “Analysis, prediction and evaluation of COVID-19 datasets“. International Journal of Emerging Trends in Engineering Research,vol. 8, no. 5, pp. 2199-2204, 2020.

[4]. M. Z. Islam, M. M. Islam and A. Asraf. “A combined deep CNN-LSTM network for the detection of novel coronavirus (COVID-19) using X-ray images“. Informatics in Medicine Unlocked, vol. 20, 100412, 2020.

[5]. R. A. Teimoor and A. M. Darwesh. “Node detection and tracking in smart cities based on internet of things and machine learning“. UHD Journal of Science and Technology, vol. 3, no. 1, pp. 30-38, 2019.

[6]. K. Ahammed, M. S. Satu, M. Z. Abedin, M. A. Rahaman and S. M. S. Islam. “Early detection of coronavirus cases using chest X-ray images employing machine learning and deep learning approaches“. medRxiv, Vol. ?2, 2020.06.07.20124594, 2020.

[7]. F. Saiz and I. Barandiaran. “COVID-19 detection in chest X-ray images using a deep learning approach“. International Journal of Interactive Multimedia and Artificial Intelligence, vol. 6, no. 2, 4, 2020.

[8]. A. M. Ismael and A. Şengür. “Deep learning approaches for COVID-19 detection based on chest X-ray images“. Expert Systems with Applications,vol. 164, 114054, 2021.

[9]. T. Zebin and S. Rezvy. “COVID-19 detection and disease progression visualization:Deep learning on chest X-rays for classification and coarse localization“. Applied Intelligence, vol. 51, no. 2, pp. 1010-1021, 2021.

[10]. L. Gaur, U. Bhatia, N. Z. Jhanjhi, G. Muhammad and M. Masud. Medical image-based detection of COVID-19 using deep convolution neural networks. Multimedia Systems, vol. 27, pp. 1-10, 2021.

[11]. C. Sitaula and M. B. Hossain. “Attention-based VGG-16 model for COVID-19 chest X-ray image classification“. vol. 19, pp. 2850-2863, 2021.

[12]. “COVID-19 Radiography Database.“Available from:https://www.kaggle.com/tawsifurrahman/covid19-radiography-database

[13]. M. E. H. Chowdhury, T. Rahman, A. Khandakar, R. Mazhar, M. A. Kadir, Z. B. Mahbub, et al., “Can AI Help in Screening Viral and COVID-19 Pneumonia?,“IEEE Access, vol. 8, pp. 132665-132676, 2020.

[14]. R. Mohammadi, M. Salehi, H. Ghaffari and A. A. Rohani. “JBPE_Volume 10_Issue 5_Pages 559-568.pdf“. vol. 2019, pp. 559-568, 2020.

[15]. K. Simonyan and A. Zisserman. “Very deep convolutional networks for large-scale image recognition“. 3rd International Conference on Learning Representations, ICLR 2015 - Conference Track Proceedings, pp. 1-14, 2015.

[16]. H. Swapnarekha, H. S. Behera, D. Roy, S. Das and J. Nayak. “Competitive deep learning methods for COVID-19 detection using X-ray images“. Journal of The Institution of Engineers (India):Series B, 2021.

[17]. C. Ouchicha, O. Ammor and M. Meknassi. “CVDNet:A novel deep learning architecture for detection of coronavirus (COVID-19) from chest x-ray images“. Chaos, Solitons and Fractals, vol. 140, 2020.

[18]. J. E. Luján-García, M. A. Moreno-Ibarra, Y. Villuendas-Rey and C. Yáñez-Márquez. “Fast COVID-19 and pneumonia classification using chest X-ray images“. Mathematics, vol. 8, no. 9, 2020.