International Journal of Electrical and Computer Engineering (IJECE)
Vol. 12, No. 4, August 2022, pp. 3655~3664
ISSN: 2088-8708, DOI: 10.11591/ijece.v12i4.pp3655-3664  3655
Journal homepage: http://ijece.iaescore.com
A deep learning approach for COVID-19 and pneumonia
detection from chest X-ray images
Ahmmad Musha1
, Abdullah Al Mamun2
, Anik Tahabilder3
, Md. Jakir Hossen2
, Busrat Jahan4
,
Sima Ranjbari5
1
Department of Electrical and Electronic Engineering, Pabna University of Science and Technology, Pabna, Bangladesh
2
Faculty of Engineering and Technology, Multimedia University, Melaka, Malaysia
3
Department of Computer Science, Wayne State University, Detroit, United States
4
Department of Computer Science and Engineering, Feni University, Feni, Bangladesh
5
School of Industrial and Systems Engineering, Tarbiat Modares University, Tehran, Iran
Article Info ABSTRACT
Article history:
Received Oct 14, 2020
Revised Apr 9, 2022
Accepted Apr 19, 2022
There has been a surge in biomedical imaging technologies with the recent
advancement of deep learning. It is being used for diagnosis from
X-ray, computed tomography (CT) scan, electrocardiogram (ECG), and
electroencephalography (EEG) images. However, most of them are solely
for particular disease detection. In this research, a computer-aided deep
learning model named COVID-CXDNetV2 has been presented to detect two
separate diseases, coronavirus disease 2019 (COVID-19) and pneumonia,
from the X-ray images in real-time. The proposed model is made based on
you only look once (YOLOv2) with residual neural network (ResNet) and
trained by a vast X-ray images dataset containing 3788 samples of three
classes named COVID-19 pneumonia and normal. The model has obtained
the maximum overall classification accuracy of 97.9% with a loss of 0.052
for multiclass classification (COVID-19, pneumonia, and normal) and
99.8% accuracy, 99.52% sensitivity, 100% specificity with a loss of 0.001
for binary classification (COVID-19 and normal), which beats some current
state-of-the-art results. Authors believe that this method will be applicable in
the medical domain for the diagnosis and will significantly contribute to real
life.
Keywords:
Coronavirus
COVID-19
Deep learning
Pneumonia
X-ray images
This is an open access article under the CC BY-SA license.
Corresponding Author:
Abdullah Al Mamun, Md. Jakir Hossen
Faculty of Engineering and Technology, Multimedia University
Ayer Keroh, Melaka-7540, Malaysia
Email: mamun130203@gmail.com, jakir.hossen@mmu.edu.my
1. INTRODUCTION
Coronaviruses (CoVs) are a larger family of harmful viruses that can affect humans and other
animals and even can cause death. In the 21st century, two widely zoonotic CoVs, Middle East respiratory
syndrome coronavirus (MERS-CoV) and severe acute respiratory syndrome coronavirus (SARS-CoV),
spread from animal reservoirs to cause global pandemics with alarming morbidity and mortality [1].
Recently, coronavirus disease 2019 (COVID-19), which is owing to severe acute respiratory syndrome
coronavirus 2 (SARS-CoV-2), has been emerged in Wuhan, China, in December 2019 [2]. It has spread out
all over the world and affected 307 M people, and results in 5.5 M deaths all over the world till Jan 09, 2022
[3]. COVID-19 epidemic was certified as a global pandemic on March 11, 2020, by the World Health
Organization [4].
 ISSN: 2088-8708
Int J Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664
3656
This virus is contagious and can be transmitted from close contact with affected people or even from
sharing ordinary staff [5]. So, isolation is a standard solution to control the spreading of this disease. Even
though the reverse transcription-polymerase chain reaction (RT-PCR) is presently the mainstream procedure
for detecting COVID-19 disease [6], this method has some limitations like requires special test kits, costly,
time-consuming and results are highly false-negative levels and considered in the context of recent exposures
to the patient and the existence of clinical signs and symptoms [7]. Moreover, this method has a low
sensitivity of 60 to 71% for the COVID-19 identification due to a low viral load present in the test specimen
and the laboratory error [8]. Pneumonia is also a lung infection similar syndrome as COVID-19 that causes
viruses bacteria, and fungi. From mild to life-threatening, pneumonia can range in seriousness. It is highly
hazardous for older people (age >65), kids and young children, and people with health issues or weaker
immune systems.
Medical image processing is another feasible technique for COVID-19 or pneumonia detection from
chest X-ray (CXR) or computed tomography (CT) images. Thoracic abnormality in CT images shows high
sensitivity, so a lot of researchers are focusing on CT images to detect COVID-19 disease [9]. But there are
some drawbacks, including the limitation of portability, required deep cleaning of the apparatus used, the
high value of radiation, and the higher cost [10]. On the other hand, CXR is very common, cost-effective,
portable, available in almost any diagnostic center, and easily accessible [11]. Therefore, CXR based method,
which can easily determine lung abnormalities, can be a good alternative tool to diagnose COVID-19 and
pneumonia.
In recent times, the deep learning technique has led to medical imaging study. Image classification,
segmentation, and pattern finding are the most common task which is handled efficiently by convolutional
neural networks (CNNs). In the meantime, this technique has proven successful in detecting bleeding, breast
cancer, pneumonia, skin cancer, arrhythmia, diabetic retinopathy, brain disease, and so on. The fast transmission
of COVID-19 disease required more radiologists in this field to support the diagnostic centers, which is almost
impossible within a short span of time. The proposed deep learning technique of COVID-19 and pneumonia
detection can help in this aspect and reduce the cost of the test kit, technologists, and other logistics.
To handle the rapidly growing number of COVID-19 and pneumonia cases, the researchers are
usually using CT and X-rays images. In their research [12], presented a deep learning model named the
DarkCovidNet on the basis of the darknet object detection method, which can determine corona from X-ray
images. This article reported a classification accuracy of 87.02 % for a three-category classification problem,
including COVID-19, normal, and pneumonia. Heidari et al. [13] have derived a computer-aided diagnosis
scheme from CNN to diagnose the COVID-19 infected pneumonia, which has shown overall accuracy of
94.5 % in a three-class disease classification problem. Similarly, researchers have used DenseNet-121 in
COVID-CXNet to classify corona from X-ray images [14]. The fusion of two models can be used for
increasing the accuracy of the deep learning-based model. For example, Rahimzadeh and Attar [15] have
fused the Xception, ResNet50V2, and the neural network, which has achieved 91.4% accuracy. Khan et al.
[16] have derived a deep CNN model from the Xception model named CoroNet, which has gained 95%
accuracy. Also, the transfer learning technique is the best way of medical image classification, especially if
the number of samples in the dataset is less [17]. For example, Abbas et al. [18] have applied a transfer
learning approach and achieved an accuracy of 95.12% to detect COVID-19 using the CXR images.
This research proposes a novel deep learning model named COVID-CXDNetV2 based on the
modification of you only look once (YOLOv2) [19] with ResNet [20] for detecting COVID-19 and
pneumonia patients as a multiclass classification problem. In addition, a customized CXR images dataset was
also formed to train the model by collecting data from four different open-source repositories. The dataset
contains 1,102 COVID-19 positive, 1,341 normal, and 1,345 infected viral pneumonia CXR images. The
model needs raw CXR images as an input and gives COVID-19, pneumonia, or normal as an output. The
main limitation of CXR based COVID-19 and pneumonia detection is that it cannot usually detect accurately
in a very early stage of COVID-19 or pneumonia as it does not have high sensitivity in detecting the ground-
glass opacities [7].
The paper is organized into three sections: in section 2, the method of this research is presented,
which includes dataset, dataset preprocessing, and proposed model architecture. The performance evaluation
of the model and comparison of other existing state-of-the-art models in this field are discussed in section 3.
Finally, the conclusion and future direction are provided in section 4.
2. METHOD
A novel deep learning model is introduced in this study to automatically identify confirmed
COVID-19 patients from viral pneumonia and normal patients using 2D traditional CXR images. An open
access customized dataset is also developed to encourage training and evaluation of the proposed model. The
Int J Elec & Comp Eng ISSN: 2088-8708 
A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha)
3657
complete operation of the proposed framework is represented in Figure 1. The Figure 1 shows that first
collect dataset from different authentic sources and preprocess data to fit the proposed model and apply to the
deep learning model to identify diseases from the CXR images.
Figure 1. Flow diagram of the proposed method
2.1. Dataset
Small datasets are one of the challenges of medical image processing techniques. In this research,
the CXR images were applied to detect COVID-19. However, there are just a few publicly available
COVID-19 CXR images because COVID-19 is a recent disease. This analysis uses and assembles a dataset
of CXR images taken from four publicly accessible medical repositories which are shown in Table 1.
The customized dataset is generated by filtering four datasets with a posteroanterior (PA) view of
X-ray images and avoiding data leakage. After assembled, 3788 2D CXR images are considered for affected
COVID-19 detection; among them, 1102 images are positive COVID-19, 1,345 images are infected viral
pneumonia, and 1,345 images are normal cases. The customized dataset is publicly available on Kaggle [21].
Table 1. Summary of dataset collection
Name Pneumonia COVID-19 Normal
Dataset_1[22] 0 59 0
Dataset_2[23] 0 53 0
Dataset_3[21] 1345 219 1341
Dataset_4[14] 0 818 0
2.2. Dataset preprocessing
The dataset is collected from four different sources, so the CXR size of the images varies from
205×243 to 3804×3487 pixels. During training, all images are resized to 256×256 pixels. Images are also
normalized to prevent more computation time and reduce random access memory (RAM) usage. In the case
of deep learning algorithms, data augmentation is a strategy to enhance the dataset size for real-time practical
application. Due to the small number of data sets, data augmentation is a useful medical imaging technique.
Data augmentation is a technique to generate copies of one image into multiple possibilities of geometric
transformations, blur, luminance, flipping, noise injection, color modification, cropping, and rotation
variances of the image, for effective and generalized training. In this experiment, the values of parameters
i.e., p_lighting: 0.75, p_affine: 0.75, maximum zoom: 1.1, maximum warp: 0.2, maximum lighting: 0.2 are
used for the CXR image transformation. But, due to the location of the heart, lungs, and other organs, the
flipping of the CXR image is ignored. The technique also helps reduce overfitting when training the model.
After data augmentation, the dataset is sliced into two parts, 80% is used for training, and 20% is utilized for
validation tests, and 80% for the training of a total number of CXR images.
2.3. Model architecture
In this study, the proposed model was developed using a deep learning approach. This approach is a
subfield of artificial intelligence (AI) that trains to learn models using artificial neural networks (ANNs).
There are several kinds of deep learning algorithms, but CNN are the most broadly used. YOLO is one of the
well-known deep learning models that utilize CNN architecture for real-time object detection tasks. This
technique utilizes only one neural network to the entire image. Then splits it into sections and identifies the
bounding boxes and probabilities of each part. The estimated probabilities are used to weigh these boxes. The
proposed COVID-CXDNetV2 model architecture was designed by modifying YOLOv2 inspired by Ozturk et
al. [12] and residual neural network (ResNet) to detect COVID-19 patients from pneumonia and normal CXR
images. Residual network connections are shortcut or skip connection that takes activations from one layer
and feed it to another layer. According to the connection, the weight layer sequence output is the sum of the
 ISSN: 2088-8708
Int J Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664
3658
present weight and past activation (the main input) and then crosses over a non-linear activation function.
There are residual blocks in ResNet that help in training deeper networks. The advantage of training a
residual network is that the training error does not rise when training a deeper network. The residual network
connections are shown in Figure 2.
Figure 2. Residual connection
The proposed COVID-CXDNetV2 architecture is presented in Figure 3 and marked in several colors
to make it easier to understand. The proposed model consists of 14 convolution blocks, five max-pooling
layers, four residual connections, one convolution layer, one flatten layer, and one linear layer with various
filter numbers, sizes, and stride sizes. The dimension of the input color image is 256×256×3, which indicates
the CXR image with 256 height and 256 widths with three channels (green, red, and blue). The first
convolutional block takes the image that has eight kernels of size 3×3 with padding one and stride one. The
convolution block has a single convolution layer with batch normalization and the leaky rectified linear unit
(LReLU) activation function. The convolution layer is a significant aspect of the CNN model framework that
utilizes the convolution operation (*) rather than regular matrix multiplication. It involves a set of learnable
filters for detecting features in the input image. If I is the input image, kernel K, m×n is the kernel size, and S
is the output, the 2D convolution process is given by (1).
𝑆(𝑖, 𝑗) = (𝐼 ∗ 𝑘)(𝑖, 𝑗) = ∑ 𝑚 ∑ 𝑛 𝐼(𝑚, 𝑛)𝑘(𝑖 − 𝑚, 𝑗 − 𝑛) (1)
Figure 3. Architecture of COVID-CXDNetV2
Batch normalization is used to normalize the input image, minimize training time, and improve
model robustness. An LReLU non-linear activation function is used in that the value is a small fraction in the
negative section of their derivatives. Then a max-pooling layer with a stride of 2 and a 2×2 filter is used.
After the process, the output shape of image 128×128×8 is utilized in the second convolution block, which
Int J Elec & Comp Eng ISSN: 2088-8708 
A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha)
3659
contains 16 filters. In Figure 3, the third block has one max pooling layer with a stride of 2, and a 2×2 filter is
utilized after the second convolution block, and the output shape of the image downsizes to 64×64×16. The
block also includes three convolutional blocks with kernels 32, 16 and 32 of size 3×3, 1×1, and 3×3,
respectively, as well as one residual block. This process continues for four, five, and six blocks in the figure.
After that, a single convolution layer with two kernels of size 3×3/1, a flatten layer, and a linear layer was
used. The linear layer has 3 or 1 neurons to classify COVID-19 or pneumonia or normal CXR images
(3 neurons for pneumonia, normal and COVID-19; 1 neuron for COVID-19 or normal). All layers and their
parameters and output shape of the proposed architecture are shown in Table 2.
Table 2. The architectural summary of the proposed model
Type Filters Size/Stride Output
Convolutional 8 3×3/1 256×256
Maxpool 8 2×2/2 128×128
Convolutional 16 3×3/1 128×128
Maxpool 16 2×2/2 64×64
Convolutional 32 3×3/1 64×64
Convolutional 16 1×1/1 66×66
Convolutional 32 3×3/1 66×66
Residual 66×66
Maxpool 32 2×2/2 33×33
Convolutional 64 3×3/1 33×33
Convolutional 32 1×1/1 35×35
Convolutional 64 3×3/1 35×35
Residual 35×35
Maxpool 64 2×2/2 17×17
Convolutional 128 3×3/1 17×17
Convolutional 64 1×1/1 19×19
Convolutional 128 3×3/1 19×19
Residual 19×19
Maxpool 128 2×2/2 9×9
Convolutional 256 3×3/1 9×9
Convolutional 128 1×1/1 11×11
Convolutional 256 3×3/1 11×11
Residual 11×11
Convolutional 2 3x3/1 11×11
Flatten 242
Linear 3 or 1
The proposed model is implemented using PyTorch 1.4 open-source machine learning framework.
The network architecture is trained by utilizing the Adam optimizer with 3e-3 learning rate, 32 batch sizes,
and the maximum number of epochs 100. Adam optimizer converts the learning rate and attributes weight to
decrease the loss of the learning network architecture. The ‘cross-entropy' loss function is used to evaluate
the performance of a classification model since it is utilized to solve the classification problem. All the
computational and analysis are done on the Google Colaboratory platform with a Tesla T4 GPU.
3. EVALUATION AND DISCUSSION
The performance of the COVID-CXDNetV2 model is evaluated using six different metrics:
accuracy, sensitivity, specificity, precision, and F1 score [24]–[26]. They are defined as (2) to (6).
Accuracy =
∑TP+∑TN
∑TP+∑TN+∑FN+∑FP
(2)
Sensitivity =
∑TP
∑TP+ ∑FN
(3)
Specificity =
∑TN
∑FP+ ∑TN
(4)
Precision =
∑TP
∑TP+ ∑FP
(5)
F1 score =
2∑TP
2∑TP+FP+FN
(6)
 ISSN: 2088-8708
Int J Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664
3660
In this study, two experiments (one for the multiclass classification and another for the binary
classification) are performed to judge the efficiency and performance of the proposed COVID-CXDNetV2
model to classify COVID-19 or pneumonia from CXR images. The confusion matrix for multiclass and
binary classification of the model are included in Figure 4.
According to (2)-(6), the COVID-CXDNetV2 model obtained an overall classification accuracy of
97.33% for multiclass disease classification. For COVID-19 detection the model achieved 99.13%
sensitivity, 99.81% specificity, 99.56% precision and 99.34% F1 score. Similarly, the performance for
detecting only pneumonia diseases is shown in Table 3. The model also obtained 99.79% classification
accuracy, 99.52% sensitivity, 100% specificity, 100% precision, and 99.76% F1 score for binary
classification (normal and COVID-19).
Figure 4. Confusion matrix for multiclass classification and binary classification respectively
Table 3. The performance of the model for each disease
Class Precision Sensitivity Specificity F1 score
COVID-19 99.56% 99.13% 99.81% 99.34%
Normal 95.11% 98.44% 96.68% 96.75%
Pneumonia 97.64% 94.66% 98.77% 96.13%
The accuracy, validation loss and training loss of the COVID-CXDNetV2 has been evaluated
through a different number of epochs (20, 40, 60, 80, 100), which is shown in Table 4. The model may
overfit if the number of epochs is very high, and the training accuracy will reach 100%. If validation loss >
training loss, the model is overfitting. In opposite, the model is underfitting. For a good fit of the model, the
difference between validation loss and training loss should be minimum. The best results were obtained using
that approach at epoch 80 for multiclass classification and 100 for binary classification, where the validation
and training loss is minimum. In both multiclass and binary classification, the training and validation loss
decreases as the number of epochs increases which are shown in Figure 5. The initial position of the loss
graph is highly distorted between training and validation losses. After a few epochs, the training and
validation losses are approximately equal. In the last position of the graph, the validation loss increases
gradually. So, the model obtained maximum overall classification accuracy of 97.9% at 80 epochs for
multiclass and 99.8% at 100 epochs for binary classification where the losses and difference between training
and validation loss are minimum.
Table 4. Performance evaluation of multiclass and binary classification for different epochs
Multiclass classification Binary class classification
Epoch Accuracy (%) Training loss Validation loss Accuracy (%) Training loss Validation loss
20 92.5 0.212981 0.202916 97.9 0.067623 0.067721
40 94.9 0.141943 0.153560 99.5 0.033901 0.023971
60 96.9 0.083831 0.088530 99.8 0.018865 0.013667
80 97.9 0.052176 0.070637 99.8 0.007013 0.015052
100 97.3 0.034904 0.085641 99.8 0.001320 0.014740
Int J Elec & Comp Eng ISSN: 2088-8708 
A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha)
3661
A lot of researchers are conducting research for COVID-19 or pneumonia diseases detection from
CXR images. Ozturk et al. [12] presented DarkCovidNet to identify COVID-19 cases from CXR images and
have obtained an accuracy of 87.02% for multiclass classification and 98.08% accuracy for binary
classification. Another deep learning model [15] is developed based on Xception + ResNet50V2 obtained an
accuracy of 91.4% for three classes. Apostolopoulos and Mpesiana [27] achieved a classification accuracy of
93.48% and 93.5% for using the VGG19 and MobileNetV2 model, respectively, for three-class classification
cases. A deep learning network, CoroNet is used [16] to detect corona from CXR images and achieved 95%
accuracy for multiclass classification. However, the result of the proposed COVID-CXDNetV2 model is
superior compared to other existing researches, which is shown in Table 5. The table only included the
research that analyzed the performance of COVID-19 detection from CXR images.
CXR images are recommended because they are easily accessible for disease identification. During
the pandemic situation, they are frequently utilized in health clinics throughout the world. As the
performances of the proposed COVID-CXDNetV2 are comparatively more efficient than the other existing
work, it can be used for diagnosing COVID-19 in an easy manner.
Figure 5. Loss graph for multiclass classification (left) and binary classification (right)
Table 5. Performance comparison of the COVID-CXDNetV2 model with other existing models
Multiclass classification Binary class classification
Approach Method Accuracy
(%)
Sensitivity
(%)
Specificity
(%)
Accuracy
(%)
Sensitivity
(%)
Specificity
(%)
Sethy et al. [28] Resnet50+ SVM - - - 95.38 - -
Hemdan et al. [29] COVIDX-Net - - - 90.0 - -
Gunraj et al. [30] COVID-Net 93.3 - 91.0 96.6 - 91.0
Apostolopoulos
and Mpesiana [27]
MobileNetV2 93.5 98.6 - 96.7 98.6 -
Narin et al. [31] ResNet50 - - - 98.0 96.0 -
Ozturk et al. [12] DarkCovidNet 87.02 - - 98.08 - -
Rahimzadeh and
Attar [15]
Xception +
ResNet50V2
91.4 - 80.53 - - -
Heidari et al. [13] VGG16 94.5 98.4 - 98.1 98.4 -
Apostolopoulos
and Mpesiana [27]
VGG19 93.48 92.85 98.75 98.75 92.85 98.75
Khan et al. [16] CoroNet 95 - 95.0 98.8 - 95.0
Rahimzadeh and
Attar [15]
Xception +
ResNet50V2
- - - 99.5 - 80.53
Abbas et al. [18] DeTraC Deep CNN 95.12 97.91 91.87 - - -
Proposed Model COVID-CXDNetV2 97.9 99.13 99.81 99.79 99.52 100
4. CONCLUSION AND FUTURE WORK
COVID-19 has become a life-threatening disease worldwide, and a lot of researchers are conducting
research to detect this disease. Computer vision-based recognition is one of the most prominent ways to
detect COVID-19 disease from X-ray images. Pneumonia is a lung disease with very similar symptoms and
can also be detected from X-ray images. This research proposed a deep learning-based COVID-19 and
pneumonia diseases detection model that recognizes the disease as a multiclass and binary classification
problem from X-ray images. The proposed model builds by modifying YOLOv2 with ResNet. A vast
customized X-ray dataset of 3788 2D posteroanterior (PA) X-ray images has been used for training the
model. Among those X-rays, 1,102 images are labeled as COVID-19 positive, 1,345 images are labeled
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0 10 20 30 40 50 60 70 80 90
Loss
Epoch
Train Loss
Validation Loss
0
0.5
1
1.5
2
0 10 20 30 40 50 60 70 80 90
Loss
Epoch
Train Loss
Validation Loss
 ISSN: 2088-8708
Int J Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664
3662
pneumonia positive, and 1,345 are labeled normal, meaning those are both COVID-19 and pneumonia
negative. Eventually, the model has been compared with other existing computer vision-based COVID-19
diseases detection and the pneumonia detection results, and this model achieved height accuracy, sensitivity,
and specificity. In addition, the training loss recorded was 0.052 for multiclass classification cases and 0.001
for binary classification cases during the training process. The accuracy of this model has beat the
performance of the state of art results of this research area. The accuracy of this model largely depends on the
dataset. Increasing the number of samples by collecting more images or by image synthesis and augmentation
may help increase the proposed model's accuracy.
ACKNOWLEDGEMENTS
The research has been supported by the PUST (Pabna University of Science and Technology)
research group. We would like to express our gratitude to the PUST research group.
REFERENCES
[1] J. M. Abramo et al., “Individuality in music performance,” Assessment & Evaluation in Higher Education, vol. 37, no. October,
2012, doi: 10.1007/82.
[2] C. Qin et al., “Dysregulation of immune response in patients with coronavirus 2019 (COVID-19) in Wuhan, China,” Clinical
Infectious Diseases, vol. 71, no. 15, pp. 762–768, 2020, doi: 10.1093/cid/ciaa248.
[3] Worldometer, “COVID-19 coronavirus pandemic.” 2019, [Online]. Available: https://www.worldometers.info/coronavirus/.
[4] D. Cucinotta and M. Vanelli, “WHO declares COVID-19 a pandemic,” Acta Biomedica, vol. 91, no. 1. pp. 157–160, 2020, doi:
10.23750/abm.v91i1.9397.
[5] L. Bao et al., “Transmission of severe acute respiratory syndrome coronavirus 2 via close contact and respiratory droplets among
human angiotensin-converting enzyme 2 mice,” Journal of Infectious Diseases, vol. 222, no. 4, pp. 551–555, 2020, doi:
10.1093/infdis/jiaa281.
[6] X. Xu et al., “A deep learning system to screen novel coronavirus disease 2019 pneumonia,” Engineering, vol. 6, no. 10,
pp. 1122–1129, Oct. 2020, doi: 10.1016/j.eng.2020.04.010.
[7] Z. Y. Zu et al., “Coronavirus disease 2019 (COVID-19): a Perspective from China,” Radiology, vol. 296, no. 2, pp. E15----E25,
2020, doi: 10.1148/radiol.2020200490.
[8] H. X. Bai et al., “Performance of radiologists in differentiating COVID-19 from non-COVID-19 viral pneumonia at chest CT,”
Radiology, vol. 296, no. 2, pp. E46----E54, 2020, doi: 10.1148/radiol.2020200823.
[9] M. Chung et al., “CT imaging features of 2019 novel coronavirus (2019-NCoV),” Radiology, vol. 295, no. 1, pp. 202–207, 2020,
doi: 10.1148/radiol.2020200230.
[10] B. Furlow, “Radiation dose in computed tomography.,” Radiologic technology, vol. 81, no. 5. pp. 437–450, 2010, doi:
10.3109/9780203089743-4.
[11] M. Cellina, M. Orsi, T. Toluian, C. Valenti Pittino, and G. Oliva, “False negative chest X-Rays in patients affected by COVID-19
pneumonia and corresponding chest CT findings,” Radiography, vol. 26, no. 3, pp. e189----e194, 2020, doi:
10.1016/j.radi.2020.04.017.
[12] T. Ozturk, M. Talo, E. A. Yildirim, U. B. Baloglu, O. Yildirim, and U. Rajendra Acharya, “Automated detection of COVID-19
cases using deep neural networks with X-ray images,” Computers in Biology and Medicine, vol. 121, no. April, 2020, doi:
10.1016/j.compbiomed.2020.103792.
[13] M. Heidari, S. Mirniaharikandehei, A. Z. Khuzani, G. Danala, Y. Qiu, and B. Zheng, “Improving the performance of CNN to
predict the likelihood of COVID-19 using chest X-ray images with preprocessing algorithms,” International Journal of Medical
Informatics, vol. 144, no. September, p. 104284, 2020, doi: 10.1016/j.ijmedinf.2020.104284.
[14] A. Haghanifar, M. M. Majdabadi, Y. Choi, S. Deivalakshmi, and S. Ko, “COVID-CXNet: detecting COVID-19 in frontal chest
X-ray images using deep learning,” arxiv.org/abs/2006.13807, 2020.
[15] M. Rahimzadeh and A. Attar, “A modified deep convolutional neural network for detecting COVID-19 and pneumonia from
chest X-ray images based on the concatenation of Xception and ResNet50V2,” Informatics in Medicine Unlocked, vol. 19, 2020,
doi: 10.1016/j.imu.2020.100360.
[16] A. I. Khan, J. L. Shah, and M. M. Bhat, “CoroNet: A deep neural network for detection and diagnosis of COVID-19 from chest x-
ray images,” Computer Methods and Programs in Biomedicine, vol. 196, p. 105581, 2020, doi: 10.1016/j.cmpb.2020.105581.
[17] M. Raghu, C. Zhang, J. Kleinberg, and S. Bengio, “Transfusion: Understanding transfer learning for medical imaging,” in
Advances in Neural Information Processing Systems, 2019, vol. 32, no. NeurIPS.
[18] A. Abbas, M. M. Abdelsamea, and M. M. Gaber, “Classification of COVID-19 in chest X-ray images using DeTraC deep
convolutional neural network,” Applied Intelligence, vol. 51, no. 2, pp. 854–864, 2021, doi: 10.1007/s10489-020-01829-7.
[19] J. Redmon and A. Farhadi, “YOLO9000: better, faster, stronger,” Proceedings - 30th IEEE Conference on Computer Vision and
Pattern Recognition, CVPR 2017, vol. 2017-Janua, pp. 6517–6525, 2017, doi: 10.1109/CVPR.2017.690.
[20] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in 2016 IEEE Conference on Computer
Vision and Pattern Recognition (CVPR), Jun. 2016, pp. 770–778, doi: 10.1109/CVPR.2016.90.
[21] M. Chowdhury, A. Khandakar, and T. Rahman, “COVID-19 Radiography Database | Kaggle,” Kaggle. 2021, Accessed: Apr. 04,
2022. [Online]. Available: https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database.
[22] GitHub, “GeneralBlockchain/covid-19-chest-xray-segmentations-dataset: lung segmentations of COVID-19 chest X-ray Dataset.”
2019, [Online]. Available: https://github.com/GeneralBlockchain/covid-19-chest-xray-segmentations-dataset.
[23] J. P. Cohen, P. Morrison, and L. Dao, “COVID-19 image data collection,” arXiv, Mar. 2020, [Online]. Available:
http://arxiv.org/abs/2003.11597.
[24] A. Al Mamun, M. S. Hossain, P. P. Em, A. Tahabilder, R. Sultana, and M. A. Islam, “Small intestine bleeding detection using
color threshold and morphological operation in WCE images,” International Journal of Electrical and Computer Engineering,
vol. 11, no. 4, pp. 3040–3048, 2021, doi: 10.11591/ijece.v11i4.pp3040-3048.
[25] A. Al Mamun, E. P. Ping, and J. Hossen, “An efficient encode-decode deep learning network for lane markings instant
Int J Elec & Comp Eng ISSN: 2088-8708 
A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha)
3663
segmentation,” International Journal of Electrical and Computer Engineering, vol. 11, no. 6, pp. 4982–4990, 2021, doi:
10.11591/ijece.v11i6.pp4982-4990.
[26] A. Al Mamun, P. P. Em, T. Ghosh, M. M. Hossain, M. G. Hasan, and M. G. Sadeque, “Bleeding recognition technique in wireless
capsule endoscopy images using fuzzy logic and principal component analysis,” International Journal of Electrical and Computer
Engineering, vol. 11, no. 3, pp. 2688–2695, 2021, doi: 10.11591/ijece.v11i3.pp2688-2695.
[27] I. D. Apostolopoulos and T. A. Mpesiana, “Covid-19: automatic detection from X-ray images utilizing transfer learning with
convolutional neural networks,” Physical and Engineering Sciences in Medicine, vol. 43, no. 2, pp. 635–640, Jun. 2020, doi:
10.1007/s13246-020-00865-4.
[28] P. K. Sethy, S. K. Behera, P. K. Ratha, and P. Biswas, “Detection of coronavirus disease (COVID-19) based on deep features and
support vector machine,” International Journal of Mathematical, Engineering and Management Sciences, vol. 5, no. 4,
pp. 643–651, 2020, doi: 10.33889/IJMEMS.2020.5.4.052.
[29] E. E.-D. Hemdan, M. A. Shouman, and M. E. Karar, “COVIDX-net: a framework of deep learning classifiers to diagnose
COVID-19 in x-ray images,” arXiv preprint arXiv:2003.11055., Mar. 2020, [Online]. Available: http://arxiv.org/abs/2003.11055.
[30] H. Gunraj, L. Wang, and A. Wong, “COVIDNet-CT: A Tailored deep convolutional neural network design for detection of
COVID-19 cases from chest CT images,” Frontiers in Medicine, vol. 7, pp. 1–12, 2020, doi: 10.3389/fmed.2020.608525.
[31] A. Narin, C. Kaya, and Z. Pamuk, “Automatic detection of coronavirus disease (COVID-19) using X-ray images and deep
convolutional neural networks,” arXiv preprint arXiv:2003.10849., 2020.
BIOGRAPHIES OF AUTHORS
Ahmmad Musha is pursuing a B.Sc. degree in Electrical and Electronic
Engineering from Pabna University of Science and Technology (PUST), Pabna, Bangladesh,
since 2016. His research interest includes deep learning, biomedical engineering, robotics and
automation. He can be contacted at email: mushaxyz@gmail.com.
Abdullah Al Mamun has received a B.Sc. degree in Electrical and Electronic
Engineering from Pabna University of Science and Technology in 2018. Now he is pursuing
M.Eng.Sc. at Multimedia University (MMU) in the Faculty of Engineering and Technology
since 2019. He is also working as a lecturer (on study leave) since November 2019 in EEE at
Feni University, Feni, Bangladesh. His research interest includes computer vision, image
processing, signal processing, deep learning and machine learning. He can be reached at the
email address mamun130203@gmail.com.
Anik Tahabilder is currently pursuing his Ph.D. in Computer Science at Wayne
State University, Detroit, MI-48202, USA. He had his master's degree in Engineering
Technology from Western Carolina University, Cullowhee, NC-28723, USA. He also got a
bachelor's degree in Electrical and Electronic Engineering from Pabna University of Science
and Technology, Pabna-6600, Bangladesh. His research interest includes machine learning,
deep learning, computer vision, and big data workflow. He can be contacted at email:
tahabilderanik@gmail.com.
Md. Jakir Hossen is graduated in Mechanical Engineering from the Dhaka
University of Engineering and Technology (Former Name is BIT Dhaka,1997), Higher
Diploma in Computer Science and Engineering (1999), master’s in communication and
Network Engineering from Universiti Putra Malaysia (2003), and Ph.D. in Smart Technology
and Robotic Engineering at Universiti Putra Malaysia (2012). He is currently a Senior
Lecturer at the Faculty of Engineering and Technology, Multimedia University, Melaka,
Malaysia. His research interests are in the area of artificial intelligence, data analytics, robotics
and control. He can be contacted at email: jakir.hossen@mmu.edu.my.
 ISSN: 2088-8708
Int J Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664
3664
Busrat Jahan is working as a Senior Lecturer and Department head of CSE since
2019 at Feni University, Feni, Bangladesh. Currently, she is working on Data Science,
Information Security, Natural Language Processing and Machine Learning Approaches. She
can be contacted at email: hossenbipasa980@gmail.com.
Sima Ranjbari has a master's degree in Industrial Engineering from Tarbiat
Modares University (2018), Tehran, Iran. She also got a bachelor's degree in Industrial
Engineering from University of Tabriz (2016), Tabriz, Iran. Her research interests are
machine learning and deep learning in healthcare. She can be contacted at email:
sima.ranjbari119@gmail.com.

A deep learning approach for COVID-19 and pneumonia detection from chest X-ray images

  • 1.
    International Journal ofElectrical and Computer Engineering (IJECE) Vol. 12, No. 4, August 2022, pp. 3655~3664 ISSN: 2088-8708, DOI: 10.11591/ijece.v12i4.pp3655-3664  3655 Journal homepage: http://ijece.iaescore.com A deep learning approach for COVID-19 and pneumonia detection from chest X-ray images Ahmmad Musha1 , Abdullah Al Mamun2 , Anik Tahabilder3 , Md. Jakir Hossen2 , Busrat Jahan4 , Sima Ranjbari5 1 Department of Electrical and Electronic Engineering, Pabna University of Science and Technology, Pabna, Bangladesh 2 Faculty of Engineering and Technology, Multimedia University, Melaka, Malaysia 3 Department of Computer Science, Wayne State University, Detroit, United States 4 Department of Computer Science and Engineering, Feni University, Feni, Bangladesh 5 School of Industrial and Systems Engineering, Tarbiat Modares University, Tehran, Iran Article Info ABSTRACT Article history: Received Oct 14, 2020 Revised Apr 9, 2022 Accepted Apr 19, 2022 There has been a surge in biomedical imaging technologies with the recent advancement of deep learning. It is being used for diagnosis from X-ray, computed tomography (CT) scan, electrocardiogram (ECG), and electroencephalography (EEG) images. However, most of them are solely for particular disease detection. In this research, a computer-aided deep learning model named COVID-CXDNetV2 has been presented to detect two separate diseases, coronavirus disease 2019 (COVID-19) and pneumonia, from the X-ray images in real-time. The proposed model is made based on you only look once (YOLOv2) with residual neural network (ResNet) and trained by a vast X-ray images dataset containing 3788 samples of three classes named COVID-19 pneumonia and normal. The model has obtained the maximum overall classification accuracy of 97.9% with a loss of 0.052 for multiclass classification (COVID-19, pneumonia, and normal) and 99.8% accuracy, 99.52% sensitivity, 100% specificity with a loss of 0.001 for binary classification (COVID-19 and normal), which beats some current state-of-the-art results. Authors believe that this method will be applicable in the medical domain for the diagnosis and will significantly contribute to real life. Keywords: Coronavirus COVID-19 Deep learning Pneumonia X-ray images This is an open access article under the CC BY-SA license. Corresponding Author: Abdullah Al Mamun, Md. Jakir Hossen Faculty of Engineering and Technology, Multimedia University Ayer Keroh, Melaka-7540, Malaysia Email: [email protected], [email protected] 1. INTRODUCTION Coronaviruses (CoVs) are a larger family of harmful viruses that can affect humans and other animals and even can cause death. In the 21st century, two widely zoonotic CoVs, Middle East respiratory syndrome coronavirus (MERS-CoV) and severe acute respiratory syndrome coronavirus (SARS-CoV), spread from animal reservoirs to cause global pandemics with alarming morbidity and mortality [1]. Recently, coronavirus disease 2019 (COVID-19), which is owing to severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), has been emerged in Wuhan, China, in December 2019 [2]. It has spread out all over the world and affected 307 M people, and results in 5.5 M deaths all over the world till Jan 09, 2022 [3]. COVID-19 epidemic was certified as a global pandemic on March 11, 2020, by the World Health Organization [4].
  • 2.
     ISSN: 2088-8708 IntJ Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664 3656 This virus is contagious and can be transmitted from close contact with affected people or even from sharing ordinary staff [5]. So, isolation is a standard solution to control the spreading of this disease. Even though the reverse transcription-polymerase chain reaction (RT-PCR) is presently the mainstream procedure for detecting COVID-19 disease [6], this method has some limitations like requires special test kits, costly, time-consuming and results are highly false-negative levels and considered in the context of recent exposures to the patient and the existence of clinical signs and symptoms [7]. Moreover, this method has a low sensitivity of 60 to 71% for the COVID-19 identification due to a low viral load present in the test specimen and the laboratory error [8]. Pneumonia is also a lung infection similar syndrome as COVID-19 that causes viruses bacteria, and fungi. From mild to life-threatening, pneumonia can range in seriousness. It is highly hazardous for older people (age >65), kids and young children, and people with health issues or weaker immune systems. Medical image processing is another feasible technique for COVID-19 or pneumonia detection from chest X-ray (CXR) or computed tomography (CT) images. Thoracic abnormality in CT images shows high sensitivity, so a lot of researchers are focusing on CT images to detect COVID-19 disease [9]. But there are some drawbacks, including the limitation of portability, required deep cleaning of the apparatus used, the high value of radiation, and the higher cost [10]. On the other hand, CXR is very common, cost-effective, portable, available in almost any diagnostic center, and easily accessible [11]. Therefore, CXR based method, which can easily determine lung abnormalities, can be a good alternative tool to diagnose COVID-19 and pneumonia. In recent times, the deep learning technique has led to medical imaging study. Image classification, segmentation, and pattern finding are the most common task which is handled efficiently by convolutional neural networks (CNNs). In the meantime, this technique has proven successful in detecting bleeding, breast cancer, pneumonia, skin cancer, arrhythmia, diabetic retinopathy, brain disease, and so on. The fast transmission of COVID-19 disease required more radiologists in this field to support the diagnostic centers, which is almost impossible within a short span of time. The proposed deep learning technique of COVID-19 and pneumonia detection can help in this aspect and reduce the cost of the test kit, technologists, and other logistics. To handle the rapidly growing number of COVID-19 and pneumonia cases, the researchers are usually using CT and X-rays images. In their research [12], presented a deep learning model named the DarkCovidNet on the basis of the darknet object detection method, which can determine corona from X-ray images. This article reported a classification accuracy of 87.02 % for a three-category classification problem, including COVID-19, normal, and pneumonia. Heidari et al. [13] have derived a computer-aided diagnosis scheme from CNN to diagnose the COVID-19 infected pneumonia, which has shown overall accuracy of 94.5 % in a three-class disease classification problem. Similarly, researchers have used DenseNet-121 in COVID-CXNet to classify corona from X-ray images [14]. The fusion of two models can be used for increasing the accuracy of the deep learning-based model. For example, Rahimzadeh and Attar [15] have fused the Xception, ResNet50V2, and the neural network, which has achieved 91.4% accuracy. Khan et al. [16] have derived a deep CNN model from the Xception model named CoroNet, which has gained 95% accuracy. Also, the transfer learning technique is the best way of medical image classification, especially if the number of samples in the dataset is less [17]. For example, Abbas et al. [18] have applied a transfer learning approach and achieved an accuracy of 95.12% to detect COVID-19 using the CXR images. This research proposes a novel deep learning model named COVID-CXDNetV2 based on the modification of you only look once (YOLOv2) [19] with ResNet [20] for detecting COVID-19 and pneumonia patients as a multiclass classification problem. In addition, a customized CXR images dataset was also formed to train the model by collecting data from four different open-source repositories. The dataset contains 1,102 COVID-19 positive, 1,341 normal, and 1,345 infected viral pneumonia CXR images. The model needs raw CXR images as an input and gives COVID-19, pneumonia, or normal as an output. The main limitation of CXR based COVID-19 and pneumonia detection is that it cannot usually detect accurately in a very early stage of COVID-19 or pneumonia as it does not have high sensitivity in detecting the ground- glass opacities [7]. The paper is organized into three sections: in section 2, the method of this research is presented, which includes dataset, dataset preprocessing, and proposed model architecture. The performance evaluation of the model and comparison of other existing state-of-the-art models in this field are discussed in section 3. Finally, the conclusion and future direction are provided in section 4. 2. METHOD A novel deep learning model is introduced in this study to automatically identify confirmed COVID-19 patients from viral pneumonia and normal patients using 2D traditional CXR images. An open access customized dataset is also developed to encourage training and evaluation of the proposed model. The
  • 3.
    Int J Elec& Comp Eng ISSN: 2088-8708  A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha) 3657 complete operation of the proposed framework is represented in Figure 1. The Figure 1 shows that first collect dataset from different authentic sources and preprocess data to fit the proposed model and apply to the deep learning model to identify diseases from the CXR images. Figure 1. Flow diagram of the proposed method 2.1. Dataset Small datasets are one of the challenges of medical image processing techniques. In this research, the CXR images were applied to detect COVID-19. However, there are just a few publicly available COVID-19 CXR images because COVID-19 is a recent disease. This analysis uses and assembles a dataset of CXR images taken from four publicly accessible medical repositories which are shown in Table 1. The customized dataset is generated by filtering four datasets with a posteroanterior (PA) view of X-ray images and avoiding data leakage. After assembled, 3788 2D CXR images are considered for affected COVID-19 detection; among them, 1102 images are positive COVID-19, 1,345 images are infected viral pneumonia, and 1,345 images are normal cases. The customized dataset is publicly available on Kaggle [21]. Table 1. Summary of dataset collection Name Pneumonia COVID-19 Normal Dataset_1[22] 0 59 0 Dataset_2[23] 0 53 0 Dataset_3[21] 1345 219 1341 Dataset_4[14] 0 818 0 2.2. Dataset preprocessing The dataset is collected from four different sources, so the CXR size of the images varies from 205×243 to 3804×3487 pixels. During training, all images are resized to 256×256 pixels. Images are also normalized to prevent more computation time and reduce random access memory (RAM) usage. In the case of deep learning algorithms, data augmentation is a strategy to enhance the dataset size for real-time practical application. Due to the small number of data sets, data augmentation is a useful medical imaging technique. Data augmentation is a technique to generate copies of one image into multiple possibilities of geometric transformations, blur, luminance, flipping, noise injection, color modification, cropping, and rotation variances of the image, for effective and generalized training. In this experiment, the values of parameters i.e., p_lighting: 0.75, p_affine: 0.75, maximum zoom: 1.1, maximum warp: 0.2, maximum lighting: 0.2 are used for the CXR image transformation. But, due to the location of the heart, lungs, and other organs, the flipping of the CXR image is ignored. The technique also helps reduce overfitting when training the model. After data augmentation, the dataset is sliced into two parts, 80% is used for training, and 20% is utilized for validation tests, and 80% for the training of a total number of CXR images. 2.3. Model architecture In this study, the proposed model was developed using a deep learning approach. This approach is a subfield of artificial intelligence (AI) that trains to learn models using artificial neural networks (ANNs). There are several kinds of deep learning algorithms, but CNN are the most broadly used. YOLO is one of the well-known deep learning models that utilize CNN architecture for real-time object detection tasks. This technique utilizes only one neural network to the entire image. Then splits it into sections and identifies the bounding boxes and probabilities of each part. The estimated probabilities are used to weigh these boxes. The proposed COVID-CXDNetV2 model architecture was designed by modifying YOLOv2 inspired by Ozturk et al. [12] and residual neural network (ResNet) to detect COVID-19 patients from pneumonia and normal CXR images. Residual network connections are shortcut or skip connection that takes activations from one layer and feed it to another layer. According to the connection, the weight layer sequence output is the sum of the
  • 4.
     ISSN: 2088-8708 IntJ Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664 3658 present weight and past activation (the main input) and then crosses over a non-linear activation function. There are residual blocks in ResNet that help in training deeper networks. The advantage of training a residual network is that the training error does not rise when training a deeper network. The residual network connections are shown in Figure 2. Figure 2. Residual connection The proposed COVID-CXDNetV2 architecture is presented in Figure 3 and marked in several colors to make it easier to understand. The proposed model consists of 14 convolution blocks, five max-pooling layers, four residual connections, one convolution layer, one flatten layer, and one linear layer with various filter numbers, sizes, and stride sizes. The dimension of the input color image is 256×256×3, which indicates the CXR image with 256 height and 256 widths with three channels (green, red, and blue). The first convolutional block takes the image that has eight kernels of size 3×3 with padding one and stride one. The convolution block has a single convolution layer with batch normalization and the leaky rectified linear unit (LReLU) activation function. The convolution layer is a significant aspect of the CNN model framework that utilizes the convolution operation (*) rather than regular matrix multiplication. It involves a set of learnable filters for detecting features in the input image. If I is the input image, kernel K, m×n is the kernel size, and S is the output, the 2D convolution process is given by (1). 𝑆(𝑖, 𝑗) = (𝐼 ∗ 𝑘)(𝑖, 𝑗) = ∑ 𝑚 ∑ 𝑛 𝐼(𝑚, 𝑛)𝑘(𝑖 − 𝑚, 𝑗 − 𝑛) (1) Figure 3. Architecture of COVID-CXDNetV2 Batch normalization is used to normalize the input image, minimize training time, and improve model robustness. An LReLU non-linear activation function is used in that the value is a small fraction in the negative section of their derivatives. Then a max-pooling layer with a stride of 2 and a 2×2 filter is used. After the process, the output shape of image 128×128×8 is utilized in the second convolution block, which
  • 5.
    Int J Elec& Comp Eng ISSN: 2088-8708  A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha) 3659 contains 16 filters. In Figure 3, the third block has one max pooling layer with a stride of 2, and a 2×2 filter is utilized after the second convolution block, and the output shape of the image downsizes to 64×64×16. The block also includes three convolutional blocks with kernels 32, 16 and 32 of size 3×3, 1×1, and 3×3, respectively, as well as one residual block. This process continues for four, five, and six blocks in the figure. After that, a single convolution layer with two kernels of size 3×3/1, a flatten layer, and a linear layer was used. The linear layer has 3 or 1 neurons to classify COVID-19 or pneumonia or normal CXR images (3 neurons for pneumonia, normal and COVID-19; 1 neuron for COVID-19 or normal). All layers and their parameters and output shape of the proposed architecture are shown in Table 2. Table 2. The architectural summary of the proposed model Type Filters Size/Stride Output Convolutional 8 3×3/1 256×256 Maxpool 8 2×2/2 128×128 Convolutional 16 3×3/1 128×128 Maxpool 16 2×2/2 64×64 Convolutional 32 3×3/1 64×64 Convolutional 16 1×1/1 66×66 Convolutional 32 3×3/1 66×66 Residual 66×66 Maxpool 32 2×2/2 33×33 Convolutional 64 3×3/1 33×33 Convolutional 32 1×1/1 35×35 Convolutional 64 3×3/1 35×35 Residual 35×35 Maxpool 64 2×2/2 17×17 Convolutional 128 3×3/1 17×17 Convolutional 64 1×1/1 19×19 Convolutional 128 3×3/1 19×19 Residual 19×19 Maxpool 128 2×2/2 9×9 Convolutional 256 3×3/1 9×9 Convolutional 128 1×1/1 11×11 Convolutional 256 3×3/1 11×11 Residual 11×11 Convolutional 2 3x3/1 11×11 Flatten 242 Linear 3 or 1 The proposed model is implemented using PyTorch 1.4 open-source machine learning framework. The network architecture is trained by utilizing the Adam optimizer with 3e-3 learning rate, 32 batch sizes, and the maximum number of epochs 100. Adam optimizer converts the learning rate and attributes weight to decrease the loss of the learning network architecture. The ‘cross-entropy' loss function is used to evaluate the performance of a classification model since it is utilized to solve the classification problem. All the computational and analysis are done on the Google Colaboratory platform with a Tesla T4 GPU. 3. EVALUATION AND DISCUSSION The performance of the COVID-CXDNetV2 model is evaluated using six different metrics: accuracy, sensitivity, specificity, precision, and F1 score [24]–[26]. They are defined as (2) to (6). Accuracy = ∑TP+∑TN ∑TP+∑TN+∑FN+∑FP (2) Sensitivity = ∑TP ∑TP+ ∑FN (3) Specificity = ∑TN ∑FP+ ∑TN (4) Precision = ∑TP ∑TP+ ∑FP (5) F1 score = 2∑TP 2∑TP+FP+FN (6)
  • 6.
     ISSN: 2088-8708 IntJ Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664 3660 In this study, two experiments (one for the multiclass classification and another for the binary classification) are performed to judge the efficiency and performance of the proposed COVID-CXDNetV2 model to classify COVID-19 or pneumonia from CXR images. The confusion matrix for multiclass and binary classification of the model are included in Figure 4. According to (2)-(6), the COVID-CXDNetV2 model obtained an overall classification accuracy of 97.33% for multiclass disease classification. For COVID-19 detection the model achieved 99.13% sensitivity, 99.81% specificity, 99.56% precision and 99.34% F1 score. Similarly, the performance for detecting only pneumonia diseases is shown in Table 3. The model also obtained 99.79% classification accuracy, 99.52% sensitivity, 100% specificity, 100% precision, and 99.76% F1 score for binary classification (normal and COVID-19). Figure 4. Confusion matrix for multiclass classification and binary classification respectively Table 3. The performance of the model for each disease Class Precision Sensitivity Specificity F1 score COVID-19 99.56% 99.13% 99.81% 99.34% Normal 95.11% 98.44% 96.68% 96.75% Pneumonia 97.64% 94.66% 98.77% 96.13% The accuracy, validation loss and training loss of the COVID-CXDNetV2 has been evaluated through a different number of epochs (20, 40, 60, 80, 100), which is shown in Table 4. The model may overfit if the number of epochs is very high, and the training accuracy will reach 100%. If validation loss > training loss, the model is overfitting. In opposite, the model is underfitting. For a good fit of the model, the difference between validation loss and training loss should be minimum. The best results were obtained using that approach at epoch 80 for multiclass classification and 100 for binary classification, where the validation and training loss is minimum. In both multiclass and binary classification, the training and validation loss decreases as the number of epochs increases which are shown in Figure 5. The initial position of the loss graph is highly distorted between training and validation losses. After a few epochs, the training and validation losses are approximately equal. In the last position of the graph, the validation loss increases gradually. So, the model obtained maximum overall classification accuracy of 97.9% at 80 epochs for multiclass and 99.8% at 100 epochs for binary classification where the losses and difference between training and validation loss are minimum. Table 4. Performance evaluation of multiclass and binary classification for different epochs Multiclass classification Binary class classification Epoch Accuracy (%) Training loss Validation loss Accuracy (%) Training loss Validation loss 20 92.5 0.212981 0.202916 97.9 0.067623 0.067721 40 94.9 0.141943 0.153560 99.5 0.033901 0.023971 60 96.9 0.083831 0.088530 99.8 0.018865 0.013667 80 97.9 0.052176 0.070637 99.8 0.007013 0.015052 100 97.3 0.034904 0.085641 99.8 0.001320 0.014740
  • 7.
    Int J Elec& Comp Eng ISSN: 2088-8708  A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha) 3661 A lot of researchers are conducting research for COVID-19 or pneumonia diseases detection from CXR images. Ozturk et al. [12] presented DarkCovidNet to identify COVID-19 cases from CXR images and have obtained an accuracy of 87.02% for multiclass classification and 98.08% accuracy for binary classification. Another deep learning model [15] is developed based on Xception + ResNet50V2 obtained an accuracy of 91.4% for three classes. Apostolopoulos and Mpesiana [27] achieved a classification accuracy of 93.48% and 93.5% for using the VGG19 and MobileNetV2 model, respectively, for three-class classification cases. A deep learning network, CoroNet is used [16] to detect corona from CXR images and achieved 95% accuracy for multiclass classification. However, the result of the proposed COVID-CXDNetV2 model is superior compared to other existing researches, which is shown in Table 5. The table only included the research that analyzed the performance of COVID-19 detection from CXR images. CXR images are recommended because they are easily accessible for disease identification. During the pandemic situation, they are frequently utilized in health clinics throughout the world. As the performances of the proposed COVID-CXDNetV2 are comparatively more efficient than the other existing work, it can be used for diagnosing COVID-19 in an easy manner. Figure 5. Loss graph for multiclass classification (left) and binary classification (right) Table 5. Performance comparison of the COVID-CXDNetV2 model with other existing models Multiclass classification Binary class classification Approach Method Accuracy (%) Sensitivity (%) Specificity (%) Accuracy (%) Sensitivity (%) Specificity (%) Sethy et al. [28] Resnet50+ SVM - - - 95.38 - - Hemdan et al. [29] COVIDX-Net - - - 90.0 - - Gunraj et al. [30] COVID-Net 93.3 - 91.0 96.6 - 91.0 Apostolopoulos and Mpesiana [27] MobileNetV2 93.5 98.6 - 96.7 98.6 - Narin et al. [31] ResNet50 - - - 98.0 96.0 - Ozturk et al. [12] DarkCovidNet 87.02 - - 98.08 - - Rahimzadeh and Attar [15] Xception + ResNet50V2 91.4 - 80.53 - - - Heidari et al. [13] VGG16 94.5 98.4 - 98.1 98.4 - Apostolopoulos and Mpesiana [27] VGG19 93.48 92.85 98.75 98.75 92.85 98.75 Khan et al. [16] CoroNet 95 - 95.0 98.8 - 95.0 Rahimzadeh and Attar [15] Xception + ResNet50V2 - - - 99.5 - 80.53 Abbas et al. [18] DeTraC Deep CNN 95.12 97.91 91.87 - - - Proposed Model COVID-CXDNetV2 97.9 99.13 99.81 99.79 99.52 100 4. CONCLUSION AND FUTURE WORK COVID-19 has become a life-threatening disease worldwide, and a lot of researchers are conducting research to detect this disease. Computer vision-based recognition is one of the most prominent ways to detect COVID-19 disease from X-ray images. Pneumonia is a lung disease with very similar symptoms and can also be detected from X-ray images. This research proposed a deep learning-based COVID-19 and pneumonia diseases detection model that recognizes the disease as a multiclass and binary classification problem from X-ray images. The proposed model builds by modifying YOLOv2 with ResNet. A vast customized X-ray dataset of 3788 2D posteroanterior (PA) X-ray images has been used for training the model. Among those X-rays, 1,102 images are labeled as COVID-19 positive, 1,345 images are labeled 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0 10 20 30 40 50 60 70 80 90 Loss Epoch Train Loss Validation Loss 0 0.5 1 1.5 2 0 10 20 30 40 50 60 70 80 90 Loss Epoch Train Loss Validation Loss
  • 8.
     ISSN: 2088-8708 IntJ Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664 3662 pneumonia positive, and 1,345 are labeled normal, meaning those are both COVID-19 and pneumonia negative. Eventually, the model has been compared with other existing computer vision-based COVID-19 diseases detection and the pneumonia detection results, and this model achieved height accuracy, sensitivity, and specificity. In addition, the training loss recorded was 0.052 for multiclass classification cases and 0.001 for binary classification cases during the training process. The accuracy of this model has beat the performance of the state of art results of this research area. The accuracy of this model largely depends on the dataset. Increasing the number of samples by collecting more images or by image synthesis and augmentation may help increase the proposed model's accuracy. ACKNOWLEDGEMENTS The research has been supported by the PUST (Pabna University of Science and Technology) research group. We would like to express our gratitude to the PUST research group. REFERENCES [1] J. M. Abramo et al., “Individuality in music performance,” Assessment & Evaluation in Higher Education, vol. 37, no. October, 2012, doi: 10.1007/82. [2] C. Qin et al., “Dysregulation of immune response in patients with coronavirus 2019 (COVID-19) in Wuhan, China,” Clinical Infectious Diseases, vol. 71, no. 15, pp. 762–768, 2020, doi: 10.1093/cid/ciaa248. [3] Worldometer, “COVID-19 coronavirus pandemic.” 2019, [Online]. Available: https://www.worldometers.info/coronavirus/. [4] D. Cucinotta and M. Vanelli, “WHO declares COVID-19 a pandemic,” Acta Biomedica, vol. 91, no. 1. pp. 157–160, 2020, doi: 10.23750/abm.v91i1.9397. [5] L. Bao et al., “Transmission of severe acute respiratory syndrome coronavirus 2 via close contact and respiratory droplets among human angiotensin-converting enzyme 2 mice,” Journal of Infectious Diseases, vol. 222, no. 4, pp. 551–555, 2020, doi: 10.1093/infdis/jiaa281. [6] X. Xu et al., “A deep learning system to screen novel coronavirus disease 2019 pneumonia,” Engineering, vol. 6, no. 10, pp. 1122–1129, Oct. 2020, doi: 10.1016/j.eng.2020.04.010. [7] Z. Y. Zu et al., “Coronavirus disease 2019 (COVID-19): a Perspective from China,” Radiology, vol. 296, no. 2, pp. E15----E25, 2020, doi: 10.1148/radiol.2020200490. [8] H. X. Bai et al., “Performance of radiologists in differentiating COVID-19 from non-COVID-19 viral pneumonia at chest CT,” Radiology, vol. 296, no. 2, pp. E46----E54, 2020, doi: 10.1148/radiol.2020200823. [9] M. Chung et al., “CT imaging features of 2019 novel coronavirus (2019-NCoV),” Radiology, vol. 295, no. 1, pp. 202–207, 2020, doi: 10.1148/radiol.2020200230. [10] B. Furlow, “Radiation dose in computed tomography.,” Radiologic technology, vol. 81, no. 5. pp. 437–450, 2010, doi: 10.3109/9780203089743-4. [11] M. Cellina, M. Orsi, T. Toluian, C. Valenti Pittino, and G. Oliva, “False negative chest X-Rays in patients affected by COVID-19 pneumonia and corresponding chest CT findings,” Radiography, vol. 26, no. 3, pp. e189----e194, 2020, doi: 10.1016/j.radi.2020.04.017. [12] T. Ozturk, M. Talo, E. A. Yildirim, U. B. Baloglu, O. Yildirim, and U. Rajendra Acharya, “Automated detection of COVID-19 cases using deep neural networks with X-ray images,” Computers in Biology and Medicine, vol. 121, no. April, 2020, doi: 10.1016/j.compbiomed.2020.103792. [13] M. Heidari, S. Mirniaharikandehei, A. Z. Khuzani, G. Danala, Y. Qiu, and B. Zheng, “Improving the performance of CNN to predict the likelihood of COVID-19 using chest X-ray images with preprocessing algorithms,” International Journal of Medical Informatics, vol. 144, no. September, p. 104284, 2020, doi: 10.1016/j.ijmedinf.2020.104284. [14] A. Haghanifar, M. M. Majdabadi, Y. Choi, S. Deivalakshmi, and S. Ko, “COVID-CXNet: detecting COVID-19 in frontal chest X-ray images using deep learning,” arxiv.org/abs/2006.13807, 2020. [15] M. Rahimzadeh and A. Attar, “A modified deep convolutional neural network for detecting COVID-19 and pneumonia from chest X-ray images based on the concatenation of Xception and ResNet50V2,” Informatics in Medicine Unlocked, vol. 19, 2020, doi: 10.1016/j.imu.2020.100360. [16] A. I. Khan, J. L. Shah, and M. M. Bhat, “CoroNet: A deep neural network for detection and diagnosis of COVID-19 from chest x- ray images,” Computer Methods and Programs in Biomedicine, vol. 196, p. 105581, 2020, doi: 10.1016/j.cmpb.2020.105581. [17] M. Raghu, C. Zhang, J. Kleinberg, and S. Bengio, “Transfusion: Understanding transfer learning for medical imaging,” in Advances in Neural Information Processing Systems, 2019, vol. 32, no. NeurIPS. [18] A. Abbas, M. M. Abdelsamea, and M. M. Gaber, “Classification of COVID-19 in chest X-ray images using DeTraC deep convolutional neural network,” Applied Intelligence, vol. 51, no. 2, pp. 854–864, 2021, doi: 10.1007/s10489-020-01829-7. [19] J. Redmon and A. Farhadi, “YOLO9000: better, faster, stronger,” Proceedings - 30th IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2017, vol. 2017-Janua, pp. 6517–6525, 2017, doi: 10.1109/CVPR.2017.690. [20] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jun. 2016, pp. 770–778, doi: 10.1109/CVPR.2016.90. [21] M. Chowdhury, A. Khandakar, and T. Rahman, “COVID-19 Radiography Database | Kaggle,” Kaggle. 2021, Accessed: Apr. 04, 2022. [Online]. Available: https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database. [22] GitHub, “GeneralBlockchain/covid-19-chest-xray-segmentations-dataset: lung segmentations of COVID-19 chest X-ray Dataset.” 2019, [Online]. Available: https://github.com/GeneralBlockchain/covid-19-chest-xray-segmentations-dataset. [23] J. P. Cohen, P. Morrison, and L. Dao, “COVID-19 image data collection,” arXiv, Mar. 2020, [Online]. Available: http://arxiv.org/abs/2003.11597. [24] A. Al Mamun, M. S. Hossain, P. P. Em, A. Tahabilder, R. Sultana, and M. A. Islam, “Small intestine bleeding detection using color threshold and morphological operation in WCE images,” International Journal of Electrical and Computer Engineering, vol. 11, no. 4, pp. 3040–3048, 2021, doi: 10.11591/ijece.v11i4.pp3040-3048. [25] A. Al Mamun, E. P. Ping, and J. Hossen, “An efficient encode-decode deep learning network for lane markings instant
  • 9.
    Int J Elec& Comp Eng ISSN: 2088-8708  A deep learning approach for COVID-19 and pneumonia detection from chest … (Ahmmad Musha) 3663 segmentation,” International Journal of Electrical and Computer Engineering, vol. 11, no. 6, pp. 4982–4990, 2021, doi: 10.11591/ijece.v11i6.pp4982-4990. [26] A. Al Mamun, P. P. Em, T. Ghosh, M. M. Hossain, M. G. Hasan, and M. G. Sadeque, “Bleeding recognition technique in wireless capsule endoscopy images using fuzzy logic and principal component analysis,” International Journal of Electrical and Computer Engineering, vol. 11, no. 3, pp. 2688–2695, 2021, doi: 10.11591/ijece.v11i3.pp2688-2695. [27] I. D. Apostolopoulos and T. A. Mpesiana, “Covid-19: automatic detection from X-ray images utilizing transfer learning with convolutional neural networks,” Physical and Engineering Sciences in Medicine, vol. 43, no. 2, pp. 635–640, Jun. 2020, doi: 10.1007/s13246-020-00865-4. [28] P. K. Sethy, S. K. Behera, P. K. Ratha, and P. Biswas, “Detection of coronavirus disease (COVID-19) based on deep features and support vector machine,” International Journal of Mathematical, Engineering and Management Sciences, vol. 5, no. 4, pp. 643–651, 2020, doi: 10.33889/IJMEMS.2020.5.4.052. [29] E. E.-D. Hemdan, M. A. Shouman, and M. E. Karar, “COVIDX-net: a framework of deep learning classifiers to diagnose COVID-19 in x-ray images,” arXiv preprint arXiv:2003.11055., Mar. 2020, [Online]. Available: http://arxiv.org/abs/2003.11055. [30] H. Gunraj, L. Wang, and A. Wong, “COVIDNet-CT: A Tailored deep convolutional neural network design for detection of COVID-19 cases from chest CT images,” Frontiers in Medicine, vol. 7, pp. 1–12, 2020, doi: 10.3389/fmed.2020.608525. [31] A. Narin, C. Kaya, and Z. Pamuk, “Automatic detection of coronavirus disease (COVID-19) using X-ray images and deep convolutional neural networks,” arXiv preprint arXiv:2003.10849., 2020. BIOGRAPHIES OF AUTHORS Ahmmad Musha is pursuing a B.Sc. degree in Electrical and Electronic Engineering from Pabna University of Science and Technology (PUST), Pabna, Bangladesh, since 2016. His research interest includes deep learning, biomedical engineering, robotics and automation. He can be contacted at email: [email protected]. Abdullah Al Mamun has received a B.Sc. degree in Electrical and Electronic Engineering from Pabna University of Science and Technology in 2018. Now he is pursuing M.Eng.Sc. at Multimedia University (MMU) in the Faculty of Engineering and Technology since 2019. He is also working as a lecturer (on study leave) since November 2019 in EEE at Feni University, Feni, Bangladesh. His research interest includes computer vision, image processing, signal processing, deep learning and machine learning. He can be reached at the email address [email protected]. Anik Tahabilder is currently pursuing his Ph.D. in Computer Science at Wayne State University, Detroit, MI-48202, USA. He had his master's degree in Engineering Technology from Western Carolina University, Cullowhee, NC-28723, USA. He also got a bachelor's degree in Electrical and Electronic Engineering from Pabna University of Science and Technology, Pabna-6600, Bangladesh. His research interest includes machine learning, deep learning, computer vision, and big data workflow. He can be contacted at email: [email protected]. Md. Jakir Hossen is graduated in Mechanical Engineering from the Dhaka University of Engineering and Technology (Former Name is BIT Dhaka,1997), Higher Diploma in Computer Science and Engineering (1999), master’s in communication and Network Engineering from Universiti Putra Malaysia (2003), and Ph.D. in Smart Technology and Robotic Engineering at Universiti Putra Malaysia (2012). He is currently a Senior Lecturer at the Faculty of Engineering and Technology, Multimedia University, Melaka, Malaysia. His research interests are in the area of artificial intelligence, data analytics, robotics and control. He can be contacted at email: [email protected].
  • 10.
     ISSN: 2088-8708 IntJ Elec & Comp Eng, Vol. 12, No. 4, August 2022: 3655-3664 3664 Busrat Jahan is working as a Senior Lecturer and Department head of CSE since 2019 at Feni University, Feni, Bangladesh. Currently, she is working on Data Science, Information Security, Natural Language Processing and Machine Learning Approaches. She can be contacted at email: [email protected]. Sima Ranjbari has a master's degree in Industrial Engineering from Tarbiat Modares University (2018), Tehran, Iran. She also got a bachelor's degree in Industrial Engineering from University of Tabriz (2016), Tabriz, Iran. Her research interests are machine learning and deep learning in healthcare. She can be contacted at email: [email protected].