COVID-19 detection in Chest X-ray Images using Deep Learning



COVID-19 is an important threat worldwide. This disease is caused by the novel SARS-CoV-2. CXR and CT images reveal specific information about the disease. However, when interpreting these images, experiencing an overlap with other lung infections complicates the detection of the disease. Due to this situation, the need for computer-aided systems is increasing day by day. In this study, solutions were developed with proposed models based on deep neural networks (DNN). All analyzes were performed on CXR data received on the publicly available. This paper offers a comparison of the deep learning models (SqueezeNet, Inception-V3, VGG16, MobileNet, Xception, VGG19+MobileNet (Concatenated)) that results in the detection and classification of disease. Empirical evaluations demonstrate that the Inception-V3 model gives 90% accuracy with 100% precision for the COVID-19 infection. This model has been provided with better results compared to other models.


COVID-19 is an infectious disease whose first symptoms resemble the flu. The origin of the disease, which first started in China and spread rapidly to the rest of the world, is the SARS-CoV-2 (beta coronavirus) virus. Standard methods used for the diagnosis of COVID-19: viral nucleic acid test, chest computed tomography imaging. The application time of these methods can take time. Elderly patients with chronic obstructive, cardiovascular, or hypertension are vulnerable to this condition, posing serious danger. For COVID-19 diagnosis, 47 models have been identified, 34 of which are based on medical illustrations. 16 prognostic models have been identified for determining the lethal state, length of hospital stay, and disease progression.

Symptoms such as age, body temperature, blood pressure, and creatinine are taken into account most often when detecting COVID-19 [1]. In the global fight against Covid-19, X-ray and computed tomography (CT) imaging tools play an important role. However, various picture characteristics can make differences in the interpretation of CT or X-ray scan results. Interpretation of CT or X-ray images by radiologists is moderate in the diagnosis of COVID-19. AI technologies contribute to the power of imaging tools and assist experts. AI-supported image analysis simplifies workflow by providing minimal contact with the patient [2,3]. The combination of AI and imaging techniques can support the COVID-19 prognostic forecast. For this reason, AI-based systems are needed to improve performance in the diagnosis of COVID-19. In most medical imaging classifications, CNN is used. In some studies, SVM and RF were used. It is stated by the researchers that the proposed models perform well on the test data. This may not always be the case. Because classification success status may change as a result of the noise situations on real-life data [4].

Ilyas and et al. have observed ResNet, VGG19, InceptionV3 deep learning architectural results on chest x-ray images. VGG19, ResNet, ResNet50 and InceptionV3 have with an accuracy of 98%, 96%, 95% and 96%, respectively [5]. Diagnostic performance on Chest X-Ray (CXR) images may not be sufficient for routine clinical use. Artificial intelligence is needed to improve the diagnostic performance of CXR. For this purpose, Oh and et al. have applied U-Net, FC-DenseNet67 and FC-DenseNet103 architectures on CXR images. It has been obtained an accuracy of 85.9%, 81.8%, and 88.9%, respectively [6]. Wang etc. applied the COVID-Net architecture on 13,975 CXR images taken from 13,870 patients. In COVID- 19 detection, it gave more successful prediction results than VGG-19 and ResNet-50 models [7]. Zhang etc. measured 83.61% AUC and 71.70% sensitivity on the X-VIRAL data set with the CAAD model [8]. The X-VIRAL data set contains 5,977 viral pneumonia (no COVID-19), 18,619 non-viral pneumonia and 18,774 healthy CXR images [9]. Farooq and etc. made COVID-19 detection on COVIDx dataset containing CXR images. In the results obtained, approximately 13% superior performance compared to COVID-Net [10]. Mahdy and etc. have used SVM for COVID-19 classification. The results obtained included 97.48% accuracy, 95.76% sensitivity, and 99.7% specificity [11]. In another study, 89.2% of accuracy was achieved on the 135 non COVID-19 and 320 COVID-19 CXR images with the ResNet50 model [12]. The COVID-CAPS model framework based on capsule networks has presented on X-Ray images by Afhsar and etc.. It has been more successful than CNN based models. The model achieved 95.7% accuracy in the results obtained [13]. In the study by Minaee et al., classification was made on 5000 Chest X-rays image with the help of popular convolutional neural networks. Model implementations were carried out with Pytorch. In the results obtained, the specificity rate was around 90% and the sensivity rate was around 97% [14]. COVID-19 was detected with DeTraC method proposed by Abbas and etc.. DeTrac has yielded effective results in classifying cases [15]. In a study by Rajamaran and others, 99.01% accuracy and 99.72% AUC was obtained with the deep learning model proposed on CXR images [16]. In a study by Apostolopoulos et al., 96.78% accuracy was obtained in diagnosis of Covid-19 disease on X-ray images [17]. In a study by Singh et al., 98.94% accuracy was obtained with Xception architecture on X-ray pulmonary images [18].

Studies supporting CT images are also underway. Some of the CT findings of COVID-19: consolidation, pleural thickening and GGO. AI systems can help doctors or radiologists to quickly diagnose. The AI system, which diagnoses COVID-19, has been developed by Zhang et al using CT scans. In the classification model, 361.221 CT images from 2246 patients were used for training. System performance recommended internationally has been tested. For testing, 40,880 images from 260 patients were used. The overall accuracy of the proposed model is ~ 92% [19]. In another study on CT images, the AI model developed was 87% accuracy on independent test data [20]. Ardakani et al. studied 1020 CT images (from 108 patients (COVID group) and 86 patients (non-COVID group)). For COVID detection, AlexNet, VGGNet, GoogleNet, MobileNet, ResNet, SqueezeNet and Xception architectures were used. The best results were obtained with ResNet-101 and Xception [21]. In another study on CT images, a deep learning model was developed on 4352 images collected from 332 patients. AUC for COVID-19, pneumonia, and non-pneumonia has been obtained as 0.96, 0.95 and 0.98, respectively [22].

In this paper, methods for the diagnosis of COVID-19 based on AI technique are proposed. The proposed techniques have been evaluated on CXR scanning images. The general flow diagram of the study carried out for disease detection is given in Figure 1.

Materials And Methods

2.1 Material

Since there is a limited source of COVID data in open access, operations have been performed on the small dataset. In this paper, 3 different dataset was used. Each dataset is available on the Internet. The first dataset was collected from two different sources. One of the sources contains COVID-19 X-ray images. These images were developed by Cohen JP. The other source is from the ChestX-ray8 database [23, 24, 25]. The second dataset was developed by the Canadian Image Processing Group [26,27]. The third dataset is taken from the website, which is open to public access by COVIDEEP developers [28]. The combination of three datasets has been studied in this study (Figure 2).

The dataset contains a total of 1521 CXR images 730 of which having pneumonia, 234 COVID-19, and 557 normal. The dataset is organized in 2 folders (train, test), as given in Table 1.

Table 1 General distribution of dataset





Normal (Healthy)

COVID-19+ChestX-ray8 [23, 24, 25]




COVID-chestxray [26, 27]








Training Set




Test Set




2.2  Deep Learning Models

We evaluated the performance of ImageNet pre-trained CNN models: VGGNet [29], InceptionNet [30,31], XceptionNet [32], MobileNet [33], SqueezeNet [34]. In addition, we applied transfer learning. This method was realized by using the ImageNet dataset. Thus, we overcome training time and insufficient data. Through the transfer learning technic, is kept the parameters of the previous layer and is removed the last layer, retrained the last layer of the deep learning model. Before the training phase, images have been reshaped to 256x256. Also, data augmentation is one of the important parts before training to reduce overfitting. So, techniques used for augmentation in this study: geometric transforms such as zoom, rescaling, rotation, horizontal flip, vertical flip, and shearing transformations. Deep learning models are designed for the detection of disease without requiring any handcrafted feature extraction. In this study, we augmented the data of CXR images, then used the deep learning models to extract features automatically, then used the Softmax classifier to detect COVID-19. Finally, it was compared with various deep learning models (Figure 3).

VGGNet has two different variations: VGG16 and VGG19. VGG16 was trained on ImageNet dataset of 1000 classes. It uses 16 layers, including 13 convolutional layers (5 convolutional blocks) and 3 fully connected dense layers. VGG19 consist of 19 layers. It uses 16 convolutional layers (5 convolutional blocks) and 3 fully connected dense layers. SqueezeNet consists of a stand-alone convolution layer, 8 fire modules, and a final convolution layer. Xception is CNN based on a deep neural network. It consists of depthwise separable convolution layers. MobileNet is based on linear bottlenecks and inverted residual. It starts convolution layers, followed by inverted residual blocks, linear bottlenecks blocks, convolution layer and fully connected dense layer [21]. Inception-V3 was improved version of the GoogleNet (In 2015). It consist of 48-layers. Inception-V3 consist of three kinds of Inception modules: Inception A, Inception B and Inception C. Inception modules A,B and C are composed of convolutional and pooling layers [35]. In this study, used the last network is a concatenated (VGG19+MobileNet) neural network. We have trained VGG19, MobileNet and a concatenation of VGG19 and MobileNet. This concatenated model is designed by concatenating the extracted features of VGG19 and MobileNet.


In this paper, the implementation of the deep transfer learning models is carried out using personal computer with 24 GB RAM and Intel(R) Core(TM) i7-7700 CPU running on Windows 10 (64 bit). CXR images have been used for the prediction of COVID-19. In this way, popular pre-trained models have been trained and tested on CXR images. The deep learning models training was performed with a batch size of 32, an initial learning rate 0.0001 and 100 epochs. In Fig. 4, Fig. 5, Fig. 6, Fig. 7, Fig. 8, and Fig. 9 the training and validation accuracy and loss graphs of the multi-class classification are shown. It can be seen from Fig. 5 and Fig. 7 that the highest training accuracy and the lowest loss are obtained with the Inception-V3 and MobileNet. So, we can say Inception-V3 and MobileNet models have similar performance. Therefore, these two models can be considered to be the more suitable model. Also, the main reason for the extreme high or extreme low fluctuations that are generally seen in all graphs is due to the low data count of the COVID-19 class. However, as the number of epochs increased (especially when the epoch was between 80 and 100), the train and validation distributions converged.

When the results are examined in general, deep learning models are successful in detecting COVID-19. (Fig. 10 (a,b,c,d,e,f))

Accuracy, precision, recall and F1-score values are shown in Table 2 for detection disease. The best accuracy result is obtained in the Inception-V3 model. The obtained accuracy, precision, recall and F1- score values are 90%, 100%, 88%, and 94%, respectively.

Table 2 Performance results


Performance (%)





































COVID-19 caused by SARS-CoV-2 is spreading rapidly around the world. For the diagnosis of COVID- 19, stages such as CT imaging, clinical findings, nucleic acid detection are passed. Globally, it is extremely important that COVID-19 detection and infected patients can be brought under control as soon as possible. For this purpose, deep learning-based systems are being developed on CXR images. Automated deep learning methods for the diagnosis of COVID-19 from CXR images are proposed in this paper. We presented pre-trained CNN models and a concatenated neural network (VGG19 and MobileNet) for classifying CXR images.

Performance results show that the Inception-V3 pre-trained model yielded the highest accuracy of 90% and precision 100% among the other deep learning models. The results obtained from the Inception-V3 model have high accuracy. This model is compared with other deep learning models. The comparative study reveals that the Inception-V3 method performs better than the other deep learning methods. So, the method can be used for the diagnosis of disease.

Different studies on datasets used in this study were examined. When the studies using the COVID data in the first dataset [23] are examined; it was achieved 80% accuracy with the InceptionV2 model on 50 COVID-19 patients by Narin et al. [36]. With the Inception-V3 model proposed in this study, the InceptionV2 model success has been increased by 10%. Inception, Xception, and InceptionResNet models were applied on 224 COVID-19 patients by Apostolopoulos et al. The accuracy rates of 86%, 85%, and 84% were respectively [37]. With the Inception-V3 model proposed in this paper, the Inception model success was increased by 4%, Xception model success was increased by 5%, and InceptionResNet success was increased by 6%. Singh et al. administered DarkCovidNet on 132 COVID patients and achieved an accuracy of 87.02% [18]. With the Inception-V3 model proposed in this study, DarkCovidNet model success was increased by ~ 3%. When the studies using COVID patient data in the first and second datasets [23, 26] are examined; Zhong achieved 87.3% accuracy with the DCNN model. With the Inception-V3 model proposed in this study, the success of the DCNN model was increased by ~ 3% [38]. In the study by Gour, the accuracy achieved by ~ 89.86% with VGG19 was increased by ~ 1% in this study. The success achieved by ~ 87.73% with CovNet30 was increased by ~ 3% in this study [39]. To the best of our knowledge, the study conducted with the third dataset [28] used in this study is not yet available in the literature.

These days, because the limited number of COVID data is made available for open access, the datasets studied are not evenly distributed. With more data for future studies, it is planned to develop more effective and robust solutions for the classification of COVID-19 cases. It is thought that by increasing the dataset, the success status can be increased.

In the light of this information, COVID-19 prediction models should be quickly brought to the literature to support medical decision-making systems.


Author Contributions

E.E. processed and analyzed the data. T.A. and E.E. reviewed the manuscript.

Conflict of interest

The authors declare that they have no conflict of interest.


  1. Wynants, , et al. Prediction models for diagnosis and prognosis of covid-19 infection: systematic review and critical appraisal. Bmj. 369, (2020).
  1. Shi, F., et al. Review of artificial intelligence techniques in imaging data acquisition, segmentation and diagnosis for covid-19. IEEE reviews in biomedical engineering. (2020).
  1. Dong, D., et al. The role of imaging in the detection and management of COVID-19: a review. IEEE reviews in biomedical engineering. (2020).
  1. Mohamadou, Y., Halidou, A., Kapen, P. T. A review of mathematical modeling, artificial intelligence and datasets used in the study, prediction and management of COVID-19. Applied Intelligence. 1-13 (2020).
  1. Ilyas, M., Rehman, H., Naït-Ali, A. Detection of Covid-19 From Chest X-ray Images Using Artificial Intelligence: An Early Review. Preprint at (2020).
  1. Oh, Y., Park, S., Ye, J. C. Deep learning covid-19 features on cxr using limited training data sets. IEEE Transactions on Medical Imaging. (2020).
  1. Wang, , Wong, A. COVID-Net: A Tailored Deep Convolutional Neural Network Design for Detection of COVID-19 Cases from Chest X-Ray Images. Preprint at (2020).
  1. Zhang, J., et al. Viral pneumonia screening on chest X-ray images using confidence-aware anomaly detection. Preprint at (2020).
  1. Farooq, M., Hafeez, A. Covid-resnet: A deep learning framework for screening of covid19 from radiographs. Preprint at (2020).
  1. Khalifa, E. M., Taha, M. H. N., Hassanien, A. E., Elghamrawy, S. Detection of coronavirus (COVID- 19) associated pneumonia based on generative adversarial networks and a fine-tuned deep transfer learning model using chest X-ray dataset. Preprint at (2020).
  1. Hassanien, E., Mahdy, L. N., Ezzat, K. A., Elmousalami, H. H., Ella, H. A. Automatic x-ray covid-19 lung image classification system based on multi-level thresholding and support vector machine. Preprint at (2020).
  1. Hall, L. O., Paul, R., Goldgof, D. B., Goldgof, G. M. Finding covid-19 from chest x-rays using deep learning on a small dataset. Preprint at (2020).
  1. Afshar, P., et al. Covid-caps: A capsule network-based framework for identification of covid-19 cases from x-ray images. Preprint at (2020).
  1. Minaee, S., Kafieh, R., Sonka, M., Yazdani, S., Soufi, G. J. Deep-covid: Predicting covid-19 from chest x-ray images using deep transfer learning. Preprint at (2020).
  1. Abbas, A., Abdelsamea, M. M., Gaber, M. M. Classification of COVID-19 in chest X-ray images using DeTraC deep convolutional neural network. Preprint at (2020).
  1. Rajaraman, S., et al. Iteratively Pruned Deep Learning Ensembles for COVID-19 Detection in Chest X- rays. Preprint at (2020)
  1. Apostolopoulos, D., Mpesiana, T. A. Covid-19: automatic detection from x-ray images utilizing transfer learning with convolutional neural networks. Physical and Engineering Sciences in Medicine. 1, (2020).
  1. Singh, K. K., Siddhartha, M., Singh, A. Diagnosis of Coronavirus Disease (COVID-19) from Chest X- ray images using modified XceptionNet. ROMANIAN JOURNAL OF INFORMATION SCIENCE AND TECHNOLOGY. 23, S91-105 (2020).
  1. Zhang, K., et al. Clinically applicable AI system for accurate diagnosis, quantitative measurements, and prognosis of covid-19 pneumonia using computed tomography. Cell. (2020).
  1. Bai, H. X., et al. AI augmentation of radiologist performance in distinguishing COVID-19 from pneumonia of other etiology on chest CT. Radiology. 296(3), 201491 (2020).
  1. Ardakani, A. A., Kanafi, A. R., Acharya, U. R., Khadem, N., Mohammadi, A. Application of deep learning technique to manage COVID-19 in routine clinical practice using CT images: Results of 10 convolutional neural networks. Computers in Biology and Medicine. 121, 103795 (2020).
  1. Li, L., et al. Using Artificial Intelligence to Detect COVID-19 and Community-acquired Pneumonia Based on Pulmonary CT: Evaluation of the Diagnostic Accuracy. Radiology. 296(2), (2020).
  1. Cohen J.P., COVID-19 Image Data Collection. 8023/COVID-chestxray-dataset (2020).
  1. Wang, , et al. Chestx-ray8: Hospital-scale chest x-ray database and benchmarks on weakly-supervised classification and localization of common thorax diseases. In Proceedings of the IEEE conference on computer vision and pattern recognition. 2097-2106 (2017).
  1. Talo M., Automated Detection of COVID-19 Cases Using Deep Neural Networks with X-Ray Images. (2020).
  1. Agchung, Figure 1 COVID-19 Chest X-ray Dataset Initiative. COVID-chestxray-dataset (2020).
  1. BUILD AI YOU CAN TRUST Accelerate Deep Learning Development with Explainable AI. (2020).
  1. Simonyan, K., Zisserman A. Very deep convolutional networks for large-scale image recognition. Preprint at (2015).
  1. Szegedy, C., Ioffe, S., Vanhoucke, V., Alemi, AA. Inception-v4, inception-resnet and the impact of residual connections on learning. In: Thirty-first AAAI conference on artificial intelligence. (2017)
  1. Szegedy C., et al. “Going deeper with convolutions”. IEEE Conf. Comput. Vis. Pattern Recognit. 1-9 (Jun. 2015).
  1. Chollet, F. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition. 1251-1258 (2017).
  1. Howard, A. G., et al. Mobilenets: Efficient convolutional neural networks for mobile vision applications. Preprint at (2017).
  1. Iandola, N., et al. SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and< 0.5 MB model size. Preprint at (2016).
  1. Guan, Q., et al. Deep convolutional neural network Inception-v3 model for differential diagnosing of lymph node in cytological images: a pilot study. Annals of translational medicine, 7(14), (2019).
  1. Narin, A., Kaya, C., Pamuk, Z. Automatic Detection of Coronavirus Disease (COVID-19) Using X-ray Images and              Deep                          Convolutional Neural                              Preprint                     at (2020).
  1. Apostolopoulos, D., Mpesiana, T.A. Covid-19: automatic detection from x-ray images utilizing transfer learning with convolutional neural networks. Physical and Engineering Sciences in Medicine, 1, (2020).
  1. Zhong, Y. Using Deep Convolutional Neural Networks to Diagnose COVID-19 From Chest X-Ray Images. Preprint at (2020).
  1. Gour, M., Jain, S. Stacked Convolutional Neural Network for Diagnosis of COVID-19 Disease from X- ray Images. Preprint at (2020).