Classification of Chest X-ray Images to Diagnose Covid-19 using Deep
Learning Techniques
Isabel Helo
´
ıse Santos Silva
1
, Ramoni Reus Barros Negreiros
1
, Andr
´
e Luiz Firmino Alves
1,2
,
Dalton C
´
ezane Gomes Valadares
2,3,4 a
and Angelo Perkusich
2,3
1
Federal Institute of Para
´
ıba (IFPB), Picu
´
ı, PB, Brazil
2
Federal University of Campina Grande, Computer Science, Campina Grande, PB, Brazil
3
VIRTUS RDI Center, Campina Grande, PB, Brazil
4
Federal Institute of Pernambuco, Mechanical Engineering Department, Caruaru, PE, Brazil
Keywords:
Artificial Neural Networks, ANNs, Machine Learning, Image-based Diagnosis, Radiographic Images.
Abstract:
The new coronavirus pandemic has brought disruption to the world. One of the significant dilemmas to be
solved by countries, especially in underdeveloped countries like Brazil, is the lack of mass testing for the
population. An alternative to these tests is detecting the disease through the analysis of radiographic images.
To process different types of images automatically, we employed deep learning algorithms to achieve success
in recognizing different diagnostics. This work aims to train a deep learning model capable of automatically
recognizing the Covid-19 diagnosis through radiographic images. Comparing images of coronavirus, healthy
lung, and bacterial and viral pneumonia, we obtained a result with 94% accuracy.
1 INTRODUCTION
The new coronavirus pandemic has plagued the world
since November 2019, with its appearance in the
province of Wuhan (China), causing from asymp-
tomatic infections to severe respiratory issues, leading
to death. Initially, the belief was that there were just
a few isolated pneumonia cases, which further aggra-
vated the local population’s situation. According to
the WHO
1
, the Wuhan Municipal Health Commission
has already reported an outbreak of pneumonia cases
on December 31, 2019. Eventually, the scientists dis-
covered that it was a new member of the Coronavirus
family.
The rapid spread of the disease has been one of
the main problems for the health area. According to
the ”Centers for Disease Control and Prevention”
2
,
the contamination occurs mainly by contact with in-
fected people, through droplets of saliva expelled by
them, which land in the mouths and noses of those
nearby. Besides, there may be contamination through
the sharing of objects that have had contact with these
a
https://orcid.org/0000-0003-1709-0404
1
https://www.who.int/news-room/detail/27-04-2020-
who-timeline—covid-19
2
https://www.cdc.gov/coronavirus/2019-ncov/faq.html
droplets.
To have an idea of the pandemic dimension, at the
end of June (2021), what appeared to be a simple dis-
ease claimed the lives of almost 4 million human be-
ings across the globe
3
. Brazil occupies the 3rd place
in the world ranking, with more than 500,000 deaths
4
.
At this moment, the country is behind only India and
the United States, which generates an emotional im-
passe, of people who have lost their loved ones, and
political, on the part of the political authorities trying
to solve the problem.
With the rapid contamination of Covid-19, there is
a lack of infrastructure and medical resources world-
wide. Furthermore, the diagnosis of COVID-19 is
typically associated with pneumonia symptoms that
can be revealed by genetic and imaging tests (Li et al.,
2020; Silva et al., 2021). Countries suffer from the
lack of hospital beds, respirators, exams, and, mainly,
from testing the population, becoming difficult to
know the real proportions of the damage to public and
private health.
Due to this situation, some research areas be-
come good agents to solve or mitigate these prob-
lems. In Computer Science, the Artificial Neural Net-
3
https://www.worldometers.info/coronavirus/
4
https://www.worldometers.info/coronavirus/#countries
Silva, I., Negreiros, R., Alves, A., Valadares, D. and Perkusich, A.
Classification of Chest X-ray Images to Diagnose Covid-19 using Deep Learning Techniques.
DOI: 10.5220/0011339700003286
In Proceedings of the 19th International Conference on Wireless Networks and Mobile Systems (WINSYS 2022), pages 93-100
ISBN: 978-989-758-592-0; ISSN: 2184-948X
Copyright
c
2022 by SCITEPRESS – Science and Technology Publications, Lda. All rights reserved
93
works (ANNs) — characterized by the ability to learn
through examples and to generalize the information
learned (Sp
¨
orl et al., 2011) are an alternative to
help in different areas science (Os
´
oio and Bittencourt,
2000; Shi et al., 2020). Indeed, the computational so-
lutions, especially those from the Computational Vi-
sion’s of state-of-the-art, indicate changes in every-
day life (Cui et al., 2020), such as the unmanned car,
which recognizes routes and objects.
In the field of medicine, Computer Vision has
made several significant contributions, mainly with
the use of advanced ANN techniques (Chen, 1995).
In particular, these contributions can be applied to as-
sist in the Covid-19 diagnosis through the processing
of radiographic images, in which the presence of dis-
eases is visualized. Thus, these techniques allow the
analysis and screening of cases with coronavirus, en-
abling an alternative to mitigate the problem of spe-
cialized mass testing in a country’s population. Thus,
the rapid detection of the disease can contribute to
controlling its propagation (Abbas et al., 2020).
Given this problem, we decided to apply the con-
cepts of Machine Learning (ML) and Deep Learning
(DL) in a computational model, allowing the machine
to automatically diagnostic the Covid-19, through the
analysis of radiographic chest images, assisting in
hospital screening. We trained the model to identify
and catalog the images among the following classes:
Covid-19; healthy lung; viral pneumonia; and bacte-
rial pneumonia.
The main contributions of this work are listed be-
low:
we gather groups of images from different
databases;
we catalog and pre-process these images, mak-
ing them ready for use in machine learning tech-
niques;
we train a model using a deep learning technique
to diagnose Covid-19, bacterial pneumonia, and
viral pneumonia in x-ray images;
we make available the code and datasets regarding
the model training and test processes;
we grant access to our model, which highlights
the Covid-19 class with good accuracy.
The structure of this article is organized as fol-
lows: in Section 2, we explain the general concepts
related to this work; in Section 3, we mention some
related works; in Section 4, we describe the steps of
the proposed methodology; in Section 5, we present
and discuss the model’s results; lastly, in Section 6,
the present our final remarks.
2 BACKGROUND
In Machine Learning, learning can take place in two
ways: supervised learning and unsupervised learning
(dos Santos et al., 2017). In supervised learning, a
labelled data set with input patterns and their corre-
sponding output patterns is applied to train the model.
The model must learn from these examples, providing
the best responses as output, according to the acquired
knowledge from the original dataset. In unsupervised
learning, there is no external agent to accompany this
process, i.e., no type of labelled dataset is given to the
learning algorithm. In this case, the model learns to
identify patterns on its own and tries to classify them
automatically.
Additionally, among these concepts, there is semi-
supervised learning, which has been highly explored
in both machine learning and data mining fields. This
learning type can use available unlabelled data to im-
prove the supervised learning tasks when the datasets
are expensive or scarce/insufficient (Zhu and Gold-
berg, 2009).
In Information Retrieval problems, this learning
can be achieved using Artificial Neural Networks
(ANNs) to predict unknown examples (Chen, 1995).
In this sense, ANNs are learning models that seek to
simulate human brain behavior, inspired by the Cen-
tral Nervous System (dos Santos et al., 2017). Thus,
the ANN operation is normally performed by inter-
connected “neurons” that process the input data and
return a series of outputs, identifying patterns in im-
ages, for example. Within this context, Convolutional
Neural Networks (CNN) are a class of ANNs that was
inspired by the human visual system for image pro-
cessing and recognition (Da Silva and Costa, 2019).
CNN is a class of neural networks known as deep
learning (DL). The main difference between CNN and
simple ANNs is in the depth of the learning methods
to find f (x), the function that determines the model
training. The DL method learns through a series
of f (x) functions that are composed of each other,
functioning as layers (Kopiler et al., 2019): f (x) =
f n(...( f 2( f 1(x))...)). The set of layers f 1, f 2, ..., f n
receive an input value, x, from the input layers, which
”crosses” layer by layer during the learning process -
usually called hidden layers - and returns a value as
output.
Besides the CNNs, there are other ANN types,
such as the Feedback ANN and the Feed Forward
ANN
5
. The main characteristic of the Feed Forward
ANN is recognizing and evaluating input patterns,
while the Feedback ANN is commonly used due to
5
https://www.elprocus.com/artificial-neural-networks-
ann-and-their-types/
WINSYS 2022 - 19th International Conference on Wireless Networks and Mobile Systems
94
its capacity of solving optimization problems.
Figure 1: Simple and Deep Learning Neural Networks.
Fig. 1 shows that the approach in ANN is simpler
than in DL. A CNN comprises three main layers: (i)
convolutional layers, which apply the data augmen-
tation concept, an image regularization method that
avoids overfitting, in addition to increasing the data
batch (this occurs by reusing the images, but changing
their translation, rotation, flattening, etc., to increase
the training dataset); (ii) pooling layers, which reduce
the spatial dimensions of the image; and (iii) fully
connected layers, which convert the 2D feature maps,
the output of a filter applied to the previous layer, into
a 1D feature vector, generating the final classification
(Voulodimos et al., 2018). Besides the CNNs, there
are other ANN types, such as the Feedback ANN and
the Feed Forward ANN
6
. The main characteristic of
the Feed Forward ANN is recognizing and evaluating
input patterns, while the Feedback ANN is commonly
used due to its capacity of solving optimization prob-
lems.
Another relevant concept is Transfer Learning,
a technique that adapts a pre-trained model, which
performs a general task, to perform a specific task
(Da Silva and Costa, 2019). This pre-trained model,
in our case, was the resnet34
7
. The resnet34 is a CNN
belonging to the Residual Networks family, which are
CNNs adapted to maintain good rates of train loss and
validation loss even with many layers of processing.
Before working on our dataset, the resnet34 is pre-
trained with the gigantic ImageNet
8
database, which
puts the Transfer Learning concept into practice.
When working with machine learning, we may en-
counter some problems linked to the dataset. If the
dataset is built with little or “dirty” data, the trained
model may present unsatisfactory results. For in-
stance, the model may suffer overfitting due to not
performing a pre-processing of the dataset before
training. Besides, the model may suffer from in-
sufficient adjustments, such as low/high number of
epochs, loss function, batch size and optimization al-
6
https://www.elprocus.com/artificial-neural-networks-
ann-and-their-types/
7
https://www.kaggle.com/pytorch/resnet34
8
http://image-net.org/
gorithm. In this case, the model fails to generalize
correctly, that is, to learn the necessary classification
standards.
2.1 Covid-19 Detection
Figure 2: Patient with a clinical picture of Covid-19.
Bai et al. (Bai et al., 2020) observed that pneumonia
caused by the Covid-19 had presented peripheral dis-
tribution with ground-glass opacities (GGO) and vas-
cular thickening. The medical diagnostics of Covid-
19 is achieved through the analyses of the lung opac-
ities. Normally, this opacities distribution is bilateral,
peripheral, and in the lower zone of the lung (Ro-
drigues et al., 2020; Wong et al., 2020). Despite this,
due to the similarities in the images, the diagnostic of
diseases by x-ray is easily confused, becoming impor-
tant to diagnose the viral tests, to validate the individ-
ual situation.
Fig. 2 shows the abnormalities (opacities) located
in the lung of a patient with Covid-19. Other exams
carried out by the Italian Society of Medical Radio-
graphy (SIRM)
9
confirmed the Covid-19 diagnostic
in the patient. The diagnostic prediction using the
images happens similarly to the specialists’ predic-
tions. The machine finds opacity patterns and at-
tributes them to specific diseases, once it has already
learned these patterns previously.
3 RELATED WORKS
The Deep Learning and Machine Learning - sub-
areas of Artificial Intelligence (AI) - have been very
useful in the field of Computer Vision (CV) (Shi
et al., 2020). The various AI methods allow mak-
ing automated predictions of different image cate-
gories, making the visual classification process faster
and simplified, without the need of a human specialist
(de Oliveira et al., 2019). Deep learning has brought
significant developments to image processing tasks
such as object detection, image classification, and im-
age segmentation (Ohri and Kumar, 2021).
9
https://www.sirm.org/
Classification of Chest X-ray Images to Diagnose Covid-19 using Deep Learning Techniques
95
CV has been applied in image recognition for sev-
eral purposes, such as fish detection (Cui et al., 2020);
problem solving in the electrical sector (Kopiler et al.,
2019); diagnosis of pneumonia and Alzheimer in the
health area (de Oliveira et al., 2019; Duarte et al.,
2020); and oil recognition on beaches (Negreiros
et al., 2020) in the environmental area.
With applications in the health area, espe-
cially with the pandemic caused by the coronavirus
(COVID-19), AI techniques have made social contri-
butions highlighted by several academic works with
several purposes to alleviate the global crisis: prevent
the spread of the COVID-19 with automatic detection
of face masks (Singh et al., 2021), to monitor people
wearing masks in public places, and Covid-19 diag-
nosis through images x-ray (Shi et al., 2020; Abbas
et al., 2020; Li et al., 2020).
Shi et al. (Shi et al., 2020) analyzes several works
on Covid-19 diagnosis, being possible to observe the
preference of using the U-Net CNN specialized in
biomedical images. Prioritizing the need for labeled
images of lungs, mainly in studies for automatic de-
tection of Covid-19, Zheng et al. [22] proposed an un-
supervised learning model to generate image labels.
Abbas et al. (Abbas et al., 2020) used a pre-
trained CNN architecture called DeTraC, which high-
lights its ability to focus on irregularities (overlap-
ping images) present in the data for detecting the dis-
ease, with a class decomposition mechanism. Li et
al. (Li et al., 2020) developed a DL model based
on neural network, named COVNET, to classify im-
ages in three classes: COVID 19, CAP (Community-
Acquired Pneumonia) and non-pneumonia.
Similar to the previous work, Hu et al. (Hu et al.,
2020) proposed a semi-supervised model capable of
improving the necessary time for manually labeling
images based on three classes: Non-Pneumonia (NP),
Community-acquired pneumonia (CAP), and Covid-
19. Their work differs in a binary classification type,
which compares the introduced classes in pairs, ob-
taining more detailed and precise results. However,
the total quantity of used images (450 equally divided
among the three classes) is lower than the quantity
used by us in this work.
Cohen et al.(Cohen et al., 2020) measured the
Covid-19 gravity to the patients using a linear regres-
sion model. As parameters, they used the lung exten-
sion and its opacity degree. As advantages, the work
enables us to confirm the treatment efficacy and to in-
crease the training epochs. The major disadvantage
is the number of samples (153), which limited their
evaluations on a large scale.
Rajaraman et al. (Rajaraman et al., 2020) anal-
ysed the performance of a set of CNN models,
which contains one customized and eight pre-trained
CNNs (VGG-16, VGG-19, Inception-V3, Xception,
InceptionResNet-V2, MobileNet-V2, DenseNet-201
e NasNet-mobile). They used images from different
datasets, and the results demonstrated that the preci-
sion was greater than 90% for all models. A weighted
mean for the models with the “best performance”
showed that the Covid-19 detection by pulmonary x-
rays presented 99.01% precision.
Phankokkruad (Phankokkruad, 2020) carried out
a similar analysis, considering three pre-trained CNN
models to detect among Covid-19, varied types of
pneumonia, and healthy lungs. The major disadvan-
tage was the limited number of images for Covid-19,
which was only 323 x-ray images. Despite that, the
author used techniques to increase the data, obtaining
excellent results for all CNNs: the Xception model
achieved a precision of 97.19%, while the VGG-16
model achieved 95,42%, and the Inception-Resnet-
V2 model achieved 93,87%.
Hu et al. (Hu et al., 2021) aimed to bring opti-
mization and agility to Covid-19’s detection and train-
ing processes. The authors used deep CNN and Ex-
treme Learning Machines (ELMs), as well as an op-
timization algorithm, to perform real-time detection.
They obtained accuracies of 98.25% and 99.11% for
the two evaluated datasets. The authors highlight the
excellent training time of the network (0.9474 mil-
liseconds). However, the image classifier was trained
to recognize three types of x-ray images: covid 19,
pneumonia, and healthy lung.
Sousa et al. (de Sousa et al., 2020) researched
other works that apply deep learning techniques to
identify the Covid-19 disease. They presented the
main techniques used and the obtained results. Be-
sides, they subdivided the relevant works into two
types: those that used conventional radiographs and
those that used computed tomographies. For the first
type, Altan and Karasu (Altan and Karasu, 2020) pre-
sented the best results, achieving 99,7% of accuracy,
99,4% of sensibility, and 99,5% of F1-Score. For the
second type, Ko et al. (Ko et al., 2020) presented the
best results, with 99,9% of accuracy, 99,6% of sensi-
bility, and 100% of specificity.
In this context, the prior differential of our work
is using a big dataset and the model’s ability to dis-
tinguish four distinct types of categories: Covid-19,
healthy lung, bacterial pneumonia, and viral pneumo-
nia. The inclusion of pneumonia images is because
they are easily confused with some cases of Covid-
19. Therefore, the model acquires a specific skill in
differentiating Covid-19 and pneumonia images.
WINSYS 2022 - 19th International Conference on Wireless Networks and Mobile Systems
96
4 METHODOLOGY
We used the Google Colaboratory environment
(Google Colab), a free cloud tool provided by Google
and built based on Jupyter Notebook to encourage re-
search in the field of AI. In addition to providing GPU
(Graphics Processing Unit) acceleration, responsible
for rendering graphics in real-time, the Google Colab
is free of charge, allowing better optimization of time
and processing.
Figure 3: Applied Methodology.
Figure 3 presents the adopted methodology for
this work, which is divided into the following three
stages: image collection and pre-processing, model
training, and model evaluation. These stages are de-
scribed below.
4.1 Image Collection and
Pre-processing
In the first stage of this work, we gathered 7683 x-ray
images obtained from the following distinct sources:
Cohen’s database
10
, Augmented Covid-19 X-Ray Im-
ages
11
, Chest X-Ray Images
12
, and Italian Society of
Medical Radiography (SIRM)
13
. The Table 1 shows
the total number of images collected for the classes
and the dataset sources.
There are three image classes in the Cohen
dataset: Covid-19, healthy lung, and pneumonia. As
we intended to train the model to classify four types of
lung radiographs, we separated the pneumonia class
images into two others: bacterial pneumonia and viral
pneumonia. In addition, we removed some repeated
images, from the dataset, and the computed tomog-
raphy images of the lungs, as the main objective was
working with chest x-ray images.
We divided the images as follows: the testing
dataset contains 10% of the total number of images,
10
https://github.com/ieee8023/covid-chestxray-dataset
11
https://data.mendeley.com/datasets/2fxz4px6d8/4
12
https://www.kaggle.com/paultimothymooney/chest-
xray-pneumonia
13
https://www.sirm.org/en/category/articles/covid-19-
database/
corresponding to 768 images; the validation dataset
contains 20% of the 6915 remaining images, corre-
sponding to 1383 images; and the training dataset
contains the rest of the images, which corresponds to
5532 images.
Figure 4 presents some pulmonary tomography
images, extracted from the collected dataset, with
their respective diagnoses.
Figure 4: Examples of tomography images.
4.2 Model Training
To build the x-ray image classifier, we used the Fas-
tai
14
library to apply supervised deep learning tech-
niques. We imported the module vision, which con-
tains all the functions necessary to train the model.
This module used the following two sub-modules: vi-
sion.data, which contains the ImageDataBunch ob-
ject, responsible for creating the training, validation,
and test datasets, and vision.learner that allows us to
perform the training or use a pre-trained model as a
base.
To train the model, we used the following four
classes of lung radiography images: healthy, with
Covid-19, with bacterial pneumonia, and with viral
pneumonia. To train and validate the model, respec-
tively, we used 6915 e 1383 images from the dataset.
To test the model, we used 768 images.
To train the classifier, we applied transfer learning
using the cnn learner method, from the fastai.vision
module. The cnn learner assists in obtaining a pre-
trained model from a given architecture. We selected
the architecture resnet34 once it is a neural network
very applied by other researchers (Lau et al., 2020;
Lei et al., 2018; Canziani et al., 2016).
Figure 5: Neural Network Architecture.
14
https://docs.fast.ai/
Classification of Chest X-ray Images to Diagnose Covid-19 using Deep Learning Techniques
97
Table 1: Number of images by dataset.
Datasets Covid Healthy Bacterial P. Viral P.
Cohen’s database 920 - - -
Augmented Covid-19 866 - - -
Chest X-Ray Images - 1583 2761 1493
SIRM 60 - - -
Total of Images 7683
Fig. 5 represents the neural network architecture
used. The image to be categorized goes through an
initial 7x7 convolution layer with a 64 resource map,
and is interpreted through another 34 layers of the
model. The later layers are 3x3 convolutions, with
a map dimension of fixed features at, respectively, 64,
128, 256, 512. During the training of this model, im-
ages of size 224 were used for standardization
4.3 Model Evaluation
Through the confusion matrix, we can make a visual
analysis of our classifier’s mistakes and successes. On
the main diagonal, the correct predictions are located,
while the other positions refer to the classifier errors.
With this tool, we can also scrutinize these results in
the four different terms: True Positives (TP), True
Negatives (TN), False Positives (FP), and False Neg-
atives (FN). These terms are used in the calculations
of the main evaluation metrics by a micro-average.
To evaluate the model, we used accuracy (Acc),
precision, recall, and F1-score (or f-measure). The ac-
curacy is applied to calculate the percentage of correct
answers in the general model. The precision is asso-
ciated with the effective number of correct classifica-
tions. On the other hand, the recall indicates how of-
ten the classifier finds examples from the same class.
Finally, the F1-score represents the harmonic mean of
precision and recall.
Acc =
V P +V N
V P +V N + FP + FN
(1)
Recall =
V P
V P + FN
(2)
Precision =
V P
V P + FP
(3)
F1
score
=
2 × Precision × Recall
Precision + Recall
(4)
We also considered the construction of a model
that does not present underfitting, when the model
does not adapt well to the training set, and overfit-
ting, when a model presents learning bias by mem-
orizing the data set patterns and does not learn in a
generalized way. Experimentally, we evaluated that
15 epochs in the model’s training process were suffi-
cient to present good results during training, valida-
tion, and tests.
5 RESULTS
Table 2 represents the confusion matrix of our model,
which was used to evaluate the performance from
the separate data used to test the X-ray image classi-
fier. The “Covid” class corresponds to lungs affected
by the Covid-19, and the “Healthy” class indicates
healthy and clean lungs. The “BP” and “VP” classes
indicate, respectively, bacterial and viral pneumonia.
We observed that the results of the viral pneu-
monia classification produced the highest error num-
bers, what probably happened due to this class have
a smaller number of images (1493) when compared
with other classes.
Table 2: Confusion Matrix.
Predicted
Covid Healthy BP VP FN
Covid 153 1 1 3 5
Actual Class Healthy 12 248 0 16 28
BP 1 0 184 0 1
VP 8 46 2 93 56
FP 21 47 3 19 90
Table 3: Metrics.
Covid Healthy BP VP
Recall 0.97 0.90 0.99 0.62
Precision 0.88 0.84 0.98 0.83
F1 score 0.92 0.87 0.99 0.71
Accuracy 0.94
The precision of bacterial pneumonia or “BP”
classification is the most striking, as shown in Table 3,
as it is low even with excellent recall. To understand
why this occurs, we go back to Table 2. We can notice
that the FP of the bacterial pneumonia class totalizes
3, indicating that the model rarely classifies the im-
age as “BP” when, in fact, it should be another class,
as happened many times with the categories “VP” and
”Healthy”. To mitigate this problem, we can add more
images of viral pneumonia and healthy lung, aiming
at training the model more frequently with these im-
WINSYS 2022 - 19th International Conference on Wireless Networks and Mobile Systems
98
ages and, consequently, getting better values of recall,
precision, and F1 score.
The model presented the best performance for the
“BP” class, exceeding expectations, as we can see that
it obtained 97% for all three metrics (Tab. 3). Such
results indicate that the model can diagnose bacterial
pneumonia with confidence, helping professionals in
hospitals.
Regarding the “Covid” category, we can evidence
the model’s ability to generalize new images, indicat-
ing an effective adaptation of the classifier in iden-
tifying images of lungs affected by the Coronavirus.
Looking at the error number of the classifier, we
can notice that the “Covid” class presents three times
fewer errors than the “VP” and “Healthy” classes. In
this sense, we were able to build a model that iden-
tifies the COVID-19 in X-ray images, which was the
main objective of our work.
Looking at Table 3, we can see that the best
results belong to the “BP” class, followed by the
“Covid”, “Healthy” and “VP” classes. Therefore, the
chances of the model correctly classifying a lung with
Covid-19 as “Covid” are higher than that of classify-
ing viral pneumonia as “VP”, for example. We can
also notice that the class with lower Recall, Precision,
and F1 values is the VP, with 62%, 83%, and 71%,
respectively. Despite the lower numbers, the general
performance of the model was not affected.
In general, we can check the test results using the
accuracy, which achieved 94% (Table 3). Using the
same metric, but for validation, we obtained 91% ac-
curacy. So we decided to create a test directory, noting
that the validation results are very good. In this sense,
we conclude that when it is required to generalize the
standards for images never seen before by the classi-
fier, it presents more imperfections, even though its
results are satisfactory in the set of tests.
6 CONCLUSION
Given the current pandemic and the need to obtain
an urgent and more accurate diagnosis of COVID-19
contamination, this work proposed to build a com-
putational model capable of automatically identifying
signs of the coronavirus infection in chest x-ray im-
ages. For that, we used a Convolutional Neural Net-
work based on the resnet34 architecture, which allows
excellent results in image identification tasks. In this
sense, using learning transfer techniques, we built and
trained a model to classify x-ray images, identifying
healthy lungs, Covid-19, bacterial pneumonia, and vi-
ral pneumonia.
The model presented excellent classification re-
sults, with an accuracy of 87%. Among the four
classes identified, the “Covid-19” class achieved the
best results: 97% recall, 94% accuracy, and 95% F1
score. We conclude that our machine learning-based
application can automatically identify the Covid-19
disease, using pulmonary radiographs, with a 95%
F1-score. Thus, our solution contributes to assist in
the screening of Covid-19 cases, as an alternative to
the lack of mass testing for the population.
Despite the satisfactory results, medical analysis
is always valuable and important. The diagnoses us-
ing the model work as a medical monitoring instru-
ment, not eliminating the confirmation by a special-
ized physician. Only the radiography is not enough to
define if a patient has Covid-19. Thus, to avoid over-
fitting and bias when implementing such an experi-
ment in a hospital, an expanded and optimized testing
is recommended (Wynants et al., 2020).
As future work, we want to improve the model
training with more images, mainly of other diseases,
to increase the database and optimize the accuracy,
precision, and other evaluation metrics for viral and
bacterial pneumonia. Furthermore, we intend to adapt
the model to detect and classify more types of lung
diseases, such as lung cancers and other pneumonia
types.
Sourcecode. We provide the project source
code publicly at the following address:
https://github.com/double-blind/review/
ACKNOWLEDGEMENTS
We would like to thank VIRTUS Research, Devel-
opment & Innovation Center, Federal University of
Campina Grande (Para
´
ıba/Brazil), for the technical
support provided.
REFERENCES
Abbas, A., Abdelsamea, M. M., and Gaber, M. M. (2020).
Classification of covid-19 in chest x-ray images us-
ing detrac deep convolutional neural network. arXiv
preprint arXiv:2003.13815.
Altan, A. and Karasu, S. (2020). Recognition of covid-19
disease from x-ray images by hybrid model consist-
ing of 2d curvelet transform, chaotic salp swarm algo-
rithm and deep learning technique. Chaos, Solitons &
Fractals, 140:110071.
Bai, H. X., Hsieh, B., Xiong, Z., Halsey, K., Choi, J. W.,
Tran, T. M. L., Pan, I., Shi, L.-B., Wang, D.-C., Mei,
J., et al. (2020). Performance of radiologists in differ-
entiating covid-19 from viral pneumonia on chest ct.
Radiology.
Classification of Chest X-ray Images to Diagnose Covid-19 using Deep Learning Techniques
99
Canziani, A., Paszke, A., and Culurciello, E. (2016). An
analysis of deep neural network models for practical
applications. arXiv preprint arXiv:1605.07678.
Chen, H. (1995). Machine learning for information re-
trieval: Neural networks, symbolic learning, and ge-
netic algorithms. Journal of the American Society for
Information Science, 46(3):194–216.
Cohen, J. P., Dao, L., Morrison, P., Roth, K., Bengio, Y.,
Shen, B., Abbasi, A., Hoshmand-Kochi, M., Ghas-
semi, M., Li, H., et al. (2020). Predicting covid-19
pneumonia severity on chest x-ray with deep learning.
Cureus.
Cui, S. et al. (2020). Fish detection using deep learning.
Applied Computational Intelligence and Soft Comput-
ing.
Da Silva, F. L. and Costa, A. H. R. (2019). A survey on
transfer learning for multiagent reinforcement learn-
ing systems. Journal of Artificial Intelligence Re-
search, 64:645–703.
de Oliveira, R. P. d. C., Sganderla, G. R., Maur
´
ıcio, C.
R. M., and Peres, F. F. F. (2019). Classificac¸ao de
imagens de raio-x de torax com reconhecimento vi-
sual da ibm cloud para diagnostico de pneumonia. In
Anais Estendidos da XXXII Conference on Graphics,
Patterns and Images, pages 203–206. SBC.
de Sousa, O. L., Magalh
˜
aes, D. M., Vieira, P. d. A., and
Silva, R. (2020). Deep learning in image analysis for
covid-19 diagnosis: a survey. IEEE Latin America
Transactions, 100(1e).
dos Santos, Y. C. P., ESTABELECIDAS, C., and
DO NORTE, J. (2017). Desafios e impacto da in-
telig
ˆ
encia artificial na medicina.
Duarte, K. T. N., Gobbi, D. G., Frayne, R., and de Carvalho,
M. A. G. (2020). Detecting alzheimer’s disease based
on structural region analysis using a 3d shape descrip-
tor. In 2020 33rd SIBGRAPI Conference on Graphics,
Patterns and Images (SIBGRAPI), pages 180–187.
Hu, S., Gao, Y., Niu, Z., Jiang, Y., Li, L., Xiao, X., Wang,
M., Fang, E. F., Menpes-Smith, W., Xia, J., Ye, H.,
and Yang, G. (2020). Weakly supervised deep learn-
ing for covid-19 infection detection and classification
from ct images. IEEE Access.
Hu, T., Khishe, M., Mohammadi, M., Parvizi, G.-R.,
Taher Karim, S. H., and Rashid, T. A. (2021).
Real-time covid-19 diagnosis from x-ray images us-
ing deep cnn and extreme learning machines stabilized
by chimp optimization algorithm. Biomedical Signal
Processing and Control, 68:102764.
Ko, H., Chung, H., Kang, W. S., Kim, K. W., Shin, Y.,
Kang, S. J., Lee, J. H., Kim, Y. J., Kim, N. Y., Jung,
H., et al. (2020). Covid-19 pneumonia diagnosis us-
ing a simple 2d deep learning framework with a single
chest ct image: Model development and validation.
Journal of Medical Internet Research, 22(6):e19569.
Kopiler, A. A. et al. (2019). Redes neurais artificiais e suas
aplicac¸
˜
oes no setor el
´
etrico. Revista de Engenharias
da Faculdade Salesiana, (9):27–33.
Lau, S. L. H., Wang, X., Yang, X., and Chong, E. K. P.
(2020). Automated pavement crack segmentation us-
ing fully convolutional u-net with a pretrained resnet-
34 encoder. IEEE Access.
Lei, L., Zhu, H., Gong, Y., and Cheng, Q. (2018). A
deep residual networks classification algorithm of fe-
tal heart ct images. In Intl. Conference on Imaging
Systems and Techniques (IST), pages 1–4. IEEE.
Li, L., Qin, L., Xu, Z., Yin, Y., Wang, X., Kong, B., Bai,
J., Lu, Y., Fang, Z., Song, Q., et al. (2020). Artificial
intelligence distinguishes covid-19 from community
acquired pneumonia on chest ct. Radiology.
Negreiros, R. R. B., dos Santos, R. A., Alves, A. L. F., and
Firmino, A. A. (2020). Oil identification on beaches
using deep learning techniques. In Anais Estendidos
do XXXIII Conference on Graphics, Patterns and Im-
ages, pages 167–170. SBC.
Ohri, K. and Kumar, M. (2021). Review on self-
supervised image recognition using deep neural net-
works. Knowledge-Based Systems, 224:107090.
Os
´
oio, F. S. and Bittencourt, J. R. (2000). Sistemas in-
teligentes baseados em redes neurais artificiais apli-
cados ao processamento de imagens. In I Workshop
de intelig
ˆ
encia artificial.
Phankokkruad, M. (2020). Covid-19 pneumonia detection
in chest x-ray images using transfer learning of con-
volutional neural networks. In Proc. of the 3rd Intl.
Conf. on Data Science and Information Technology,
DSIT 2020, page 147–152, New York, NY, USA. As-
sociation for Computing Machinery.
Rajaraman, S., Siegelman, J., Alderson, P. O., Folio, L. S.,
Folio, L. R., and Antani, S. K. (2020). Iteratively
pruned deep learning ensembles for covid-19 detec-
tion in chest x-rays. IEEE Access.
Rodrigues, J. C. L. et al. (2020). Performance of radiolo-
gists in differentiating covid-19 from viral pneumonia
on chest ct. Public Health Emergency Collection.
Shi, F., Wang, J., et al. (2020). Review of artificial intel-
ligence techniques in imaging data acquisition, seg-
mentation and diagnosis for covid-19. IEEE reviews
in biomedical engineering.
Silva, I., Leoni, G., Sadok, D., and Endo, P. (2021). Clas-
sifying covid-19 positive x-ray using deep learning
models. IEEE Latin America Transactions, 19.
Singh, S., Ahuja, U., Kumar, M., Kumar, K., and Sachdeva,
M. (2021). Face mask detection using yolov3 and
faster r-cnn models: Covid-19 environment. Multi-
media Tools and Applications, 80(13):19753–19768.
Sp
¨
orl, C., Castro, E., and Luchiari, A. (2011). Aplicac¸
˜
ao
de redes neurais artificiais na construc¸
˜
ao de modelos
de fragilidade ambiental. Revista do Departamento de
Geografia, 21:113–135.
Voulodimos, A., Doulamis, N., Doulamis, A., and Protopa-
padakis, E. (2018). Deep learning for computer vi-
sion: A brief review. Computational Intelligence and
Neuroscience, 2018:7068349.
Wong, H. Y. F., Lam, H. Y. S., Fong, A. H., et al. (2020).
Frequency and distribution of chest radiographic find-
ings in patients positive for covid-19. Radiology.
Wynants, L., Van Calster, B., Collins, G. S., Riley, R. D.,
Heinze, G., Schuit, E., Bonten, M. M. J., Dahly, D. L.,
et al. (2020). Prediction models for diagnosis and
prognosis of covid-19: systematic review and critical
appraisal. BMJ, 369.
Zhu, X. and Goldberg, A. B. (2009). Introduction to semi-
supervised learning. Synthesis lectures on artificial
intelligence and machine learning, 3(1):1–130.
WINSYS 2022 - 19th International Conference on Wireless Networks and Mobile Systems
100