0% found this document useful (0 votes)
6 views

Covid-19 Detection System using Chest X-Ray

This document presents a Covid-19 detection system utilizing chest X-ray images through a novel 16-layer Convolutional Neural Network (CNN) model. The study highlights the challenges posed by the pandemic and the limitations of traditional testing methods like RTPCR, advocating for faster AI-based diagnostic approaches using deep learning. The model demonstrated high accuracy in classifying patients using two datasets, one with 224 images and another with 4626 images, showcasing its potential for effective Covid-19 detection.

Uploaded by

lovomo6229
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Covid-19 Detection System using Chest X-Ray

This document presents a Covid-19 detection system utilizing chest X-ray images through a novel 16-layer Convolutional Neural Network (CNN) model. The study highlights the challenges posed by the pandemic and the limitations of traditional testing methods like RTPCR, advocating for faster AI-based diagnostic approaches using deep learning. The model demonstrated high accuracy in classifying patients using two datasets, one with 224 images and another with 4626 images, showcasing its potential for effective Covid-19 detection.

Uploaded by

lovomo6229
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

Covid-19 Detection System using Chest X-Ray

Pritam Mondal, Arya Panja and Vedant Sikdar


Dr. Chandra Mouliswaran S
School of Information Technology & Engineering
Department of Computer Application
Vellore Institute of Technology, Vellore – 632014, Tamil Nadu, India.
E-mail: [email protected]

Abstract
Covid-19 has changed our entire world having been a total menace. In February 2020, the
World Health Organization (WHO) proclaimed it to be pandemic. It was first believed to
have emerged from China in December 2019. Covid had a disastrous impact on the entire
mankind killing more than half a billion people worldwide. Even developed nations with
well-established medical infrastructure were shocked; unable to stop the loss of human life.
To date, RTPCR and other tests have been used to identify the illness. However, they take a
little longer. Therefore, in order to construct required models utilising the CT scan and chest
X-ray images of the affected ones, scientists are applying AI-based approaches. Their
objective is to accurately and promptly diagnose the illness. This project is centred on
developing an improved model in order to instantly detect covid-19 using chest X-rays with
maximum perfection. In this work, a novel 16-layer CNN model is suggested. In our
experiment, we used two datasets, the first of which had 224 chest x-ray images and the
second of which contained 4626 chest x-ray images. The model's patient categorization
accuracy is quite up to the mark.

Key Words
Covid-19; Chest X-ray images; Convolutional neural networks; CNN; Deep learning.

Introduction
Corona Virus Disease was initially identified as an epidemic in late 2019 in Wuhan, China. It
spread like a wildfire across the entire world, and in 2020, the WHO declared it to be a
pandemic. Since then, human society has suffered great damage and has completely
collapsed. The government enacted security measures like quarantine, house isolation, and
lockdown to stop the disease's spread. Gradually, the economy weakened, the public
healthcare system failed, and thousands of people died. Finding a vaccinated cure or another
treatment is challenging because of this fast mutation. The virus originally infected people's
respiratory tracts through droplets and later damaged lungs, producing acute pneumonia. The
symptoms can range from moderate to severe, and many infected people show no symptoms
at all, turning into silent epicentres. Chest X-rays of pneumonic patients show mottling and
ground-glass opacity. Huge patient data sets may be analysed using artificial intelligence to
enhance patient management and decision-making. Deep learning-based approaches, which
are based on artificial intelligence, are frequently used. Covid-19 can be detected primarily
using three different techniques: RTPCR, CXR, and CT scan. Despite the accuracy of the
RTPCR test, it takes a long time. The CXR and CTS pictures, on the other hand, diagnose
diseases more quickly and are used to examine their aftereffects. Convolutional neural
networks (CNN) have proven to be effective models for analysing medical images. CNN
accepts an image as input. It then has one or more convolutional (Conv) layers where it
applies numerous filters to the input picture to conduct convolution on the image to create a
feature map. The function of one or more pooling layers is to down-sample the enormous
features produced. One-dimensional features are produced using a flatten layer and sent into
one or more fully connected layers before being concatenated into a single output layer for
the classification result. Multiple dropout layers may be employed to prevent the model from
fitting the data too closely during training. CNN uses a hierarchy of layers that resembles the
human brain in order to learn macro characteristics from the data acquired from the layer
before.

Fig. 1 Outline of suggested approach to detect Covid-19.

Related work
In this section, we look at the literature research done over the previous three years on CNN's
usage in Covid-19 detection. For the purpose of detecting Covid-19, A.M. Ismael et al. ( A.M.
Ismael et al., 2021) used 224 x 224 scaled chest X-ray images. Pre-trained CNN models like
VGG (16/19) and ResNet (18/50/101), are used in a transfer learning technique. Features
from earlier trained networks are supplied into the SVM using kernels that are linear,
quadratic, cubic, and gaussian. With respect to features derived using ResNet18/50/101 and
VGG16/19, the model attained average accuracy in the range of 85% to 90%. The best
average accuracy is provided by the cubic kernel (90.3%). For the trial, 180 and 200 chest X-
ray photographs of Covid-19 and healthy subjects, respectively, were employed. All models
were fine-tuned, and ResNet50 provided 92.63% accuracy. Lastly, a CNN model (21-layeres)
is trained, consisting of 1 input layer, 5 convolutional layers, 5 ReLU layers, 5 batch
normalisation layers, 2 pooling layers, 1 fully connected layer, 1 SoftMax layer, and 1 output
layer. With a starting learning rate of 0.001, the stochastic gradient descent optimizer with
momentum (SGDM) is applied. After 11400 epochs, the obtained training accuracy is
91.58%. As a result of their extensive image training, CNN that has already been trained
displays improved accuracy, according to the data. In addition, eight image texture features
are considered for comparison purposes which are QLRBP, Frequency Decoded LBP, BSIF,
LPQ, CENTRIST, LBP, BGP and PHOG. All kernels except Gaussian produced the best
accuracy, 90.5 percent, from BSIF. In several situations, CNN outperformed it; for instance,
ResNet + SVM produced an accuracy of 94.7%.
For Covid-19 detection, H. Panwar et al. ( H. Panwar et al., 2020) used a grad-CAM based
colour visualisation method with CNN. The suggested model is a 19 Convolutional-ReLU-
MaxPooling layer, 27-layer CNN. Gradient Weighted Activation Class Mapping (Grad
CAM) was developed by Selvaraju et al. to explain the CNN. Grad CAM is used at the final
convolutional layer after the label prediction to view the output. The algorithm that is
suggested does binary classification. As the initial base model for transfer learning, VGG19
was trained on 1,41,97,122 pictures and the suggested model is applied with the pretrained
weights. Covid 19 vs. normal x-ray image, Covid-19 vs. pneumonia, and Covid-19 vs. non
Covid19 dataset are 3 separate classification tests that are performed. In percentage terms the
accuracy, sensitivity and specify are 89.47, 76.19, and 97.22 respectively. Using CXR and
CTS images, E. Hussain et al. suggested a CNN (22 Layers) to identify Covid. The suggested
CNN model "CoroDet" is capable of diagnosing three different types of pneumonia, covid
and normal. 18 (Convolutional + Maxpooling) ReLU layers, including 2 dense, 1 flat, and 1
leaky, were employed in the model. Training is conducted with batch sizes of 10 and 50
epoch with a learning rate of 1/10000. The dataset was put together from CXR and CTS
pictures from eight separate standard datasets. For their trial, they employed 2843 Covid-19
photos, 1439 images with pneumonia and 3108 normal images. Fivefold cross validation is
performed once again on the training data. For the 2-class classification, 3 class classification,
and 4 class classification examples, the accuracy levels were 99.1, 94.2, and 91.2,
respectively. For each class in each classification task, the F1-score, Recall, and Precision are
assessed, and the results are determined to be between 86.15 and 97.51 percent.
A 46 layered CNN was suggested by S. Chakraborty et al. ( S. Chakraborty et al.,2022) to
detect COVID-19 using patient CXR. Max-pooling, convolution, polling, hidden, dropout,
and SoftMax layers were present in the model. It classifies the dataset into three different
classes. The pulmonary contour mask and FCDenseNet103 segmentation algorithm are used
to get the region of interest, or the lung region, from the chest x-ray image. ResNet18’s
trained weight values are utilised in the suggested model to implement transfer learning. To
tackle the vanishing gradient problem, skipping is used. The dataset includes of a collection
of Covid19, Pneumonia, and Normal patients' 2143, 3674, and 4223 224x224 CXR pictures.
The dataset is extended from 10400 to 16574 photos by flipping, enlarging, and rotating the
images. SGD optimizer is used to run the training with 13251 images. The model was
accurate at 96.43%. For covid19, pneumonia, and normal pictures, the AUC was calculated to
be 0.99, 0.97, and 0.98, respectively.
Using CXR pictures, V. Madaan et al. (V. Madaan et al.,2021) built a CNN model for the
detection of covid19. The suggested model has 3 max pooling layers, 1 ReLU layer, and 4
conv layers respectively. The experiment uses 196 covid and 196 non-Covid-19 CXR frontal
pictures. CXRs were enlarged to 224x224x3 in order to reduce noise. Shearing, zooming, and
horizontal flipping were also utilised. Adam optimizer, 50 iterations, a learning rate of 0.001,
and a batch size of 32 were employed in the training. Two MaxPooling size and stride
settings are used to test three different CNN versions. The finest accuracy is 98.44%. R.
Tawsifur et al. (R. Tawsifur et al.,2021) investigated the impact of picture augmentation and
segmentation on the COVID-19 detection accuracy using CXR. The initial dataset had 18479
CXR images, including 3616 Covid-19 photos, 8851 healthy images, and 6012 non-Covid
images. The detection performance of five image enhancement algorithms—namely,
complement, histogram equalisation, contrast limiting adaptive HE, gamma correction and
balanced contrast enhancement—was examined. The CNN-based U-Net segmentation
network, which is effective for medical image segmentation, was used to construct a new
database of segmented chest x-ray images for the lung. Experimental values for segmentation
accuracy, the Jacquard Index, and the F1-score were observed to be 98.63, 94.3, and 96.94
percent, respectively. DenseNet201's segmented picture classification accuracy with gamma
correction was 95.11 percent, and ChexNet's classification accuracy with no enhancements
was 93.22 percent. The model performed better, with a normal un-segmented image accuracy
of 93.45 percent with InceptionV3 and 96.29% accuracy with ChexNet and gamma
correction. The visualisation of Score-CAM was utilised to identify the Region of Interest.
T. Ozturk et al. ( T. Ozturk et al.,2020) developed a technique for Covid-19 identification with
deep neural networks utilising CXR. The model could classify Covid-19 and Non-Covid-19
CXR in binary classification, while it could also classify Covid-19, Non-Covid-19, and
Pneumonia in multiclass classification. In addition to Covid-19 and Pneumonia CXR, two
distinct image databases are integrated. The proposed model had 17 layers and was based on
the Darknet19 model. The original DarkNet-19 classified for the YOLO (You Only Look
Once) object detection system using 19 convolutional and 5 MaxPooling layers using Leaky
ReLU activation function. While each 3XConv layer has three DN sub-layers, each Dark Net
(DN) layer has three convolutions, batch normalisation (BN), and leaky RELU sub-layers.
While Leaky ReLU produces relatively small values of the derivative in the negative region,
as opposed to sigmoid and ReLU, which produce zero values, batch normalisation
standardises input, shortens training times, and increases model stability. Accuracy rates were
98.08 and 87.02 in percent for binary and multi-class, respectively, using fivefold cross
validation with 100 epochs from training. Visualization is performed using Grad-CAM. To
identify Covid-19, B. Nigam et al. applied transfer learning with CNN. Classifying covid19,
normal, and non-covid-19 patients was done using the algorithms VGG16, DenseNet121,
Xception, NASNet, and EfficientNet. In terms of percent, the accuracy was 79.01, 89.96,
88.03, 85.03, and 93.48, respectively. The dataset included 5000 additional patients, 6000
normal patients, and 5634 covid CXR pictures from hospitals in Maharastra and Indore. R-
CNN cropped the images in order to remove text data from CXR. For training, 100 epochs
with a batch size of 32 were employed.
A Multilayer-spatial CNN was utilised by Md. I. Khattak et al. ( Md. I. Khattak et al.,2021) to
identify Covid19 in patient CXR and CTS. The investigation used 723 x-ray images. There
are 3228 total photos in the CTS database, 1601 of which are covid and 1627 of which are
not. For CXR and CTS, respectively, the achieved accuracies were 93.63 and 91.44 in terms
of percent. The model was based on the VGG-11 and has 5 layers (Convolution, ReLU,
MaxPooling), one of which is dense and has 512 neurons. Training was done at a learning
rate of 0.01. In order to test their CNN-based model, G. Gilanie et al. ( G. Gilanie et al.,2021)
used the CXR and CTS datasets at the Victoria Hospital in Bahawalpur, Pakistan. The dataset
included 1066 covid pictures and 7021 normal/pneumonia images. The model used 14 layers,
including 8 convolutional layers, and was able to distinguish between healthy, pneumonia,
and Covid-19. The model's accuracy was 96.68 percent.

Materials and methods

Dataset
The dataset is downloaded from https://www.kaggle.com/. We used two different datasets for
this project. The first dataset is a small-scale dataset containing 224 images including 112
Covid positive X-ray images. Second dataset is a large dataset containing a total of 4626
including 2313 Covid-19 positive images. We have taken 2 different sets of data to ensure
that our proposed model works for both small and large data.

Data Pre-processing
Data cleaning
The dataset we obtained consisted of a large number of chest X-Ray pictures of various
angles. In addition to the PA (posteroanterior) view, there were many side-view images as
well, hence we clean our dataset by erasing side-view images and those images that were a
bit blurry and low in quality. This prevented our model from getting biased.

Resizing data
Resizing data is a primary procedure in data pre-processing because smaller images are
trained more quickly by deep learning models. Every image will use the same amount of
processing RAM if they are of the same size. Memory must be restructured if its size varies,
which will take time. Insufficient memory may also result in the process failing. Hence each
image was resized to the standard 224*224 size.

Data augmentation
Techniques for data augmentation were used on the existing training photos. These methods
involve random shearing, zooming, and horizontal flipping in addition to rescaling the
image's pixel values by a factor of 1/255. To artificially enhance the size of a dataset, we
employ data augmentation by generating new examples from the existing data that helps to
reduce overfitting, increase the diversity of the dataset, and make the model more robust to
changes in the data distribution.

Proposed Method

Fig. 2 Flow diagram of proposed method

Here we use CNN approach to find Covid-19 using chest X-ray. Convolutional Neural
Networks is a kind of deep learning model that are commonly used for image classification.
A CNN is built to systematically learn spatial levels of features from input images. The
architecture of a CNN typically consists of a series of convolutional and max pooling layers,
along with multiple connected layers afterwards. The convolutional layers are responsible for
learning local patterns or features in the input image, such as edges, textures, and parts of
objects. The max pooling layers have been used to normalize the feature maps and provide
some form of translational invariance. Convolution layer to full connected layer transitions
frequently use the flatten layer to reduce the multidimensional input to one dimension. The
fully connected layers at the end of the network are used for classification, the output can be
binary or multiple. The training process involve back-propagation and other optimization
technique to adjust the parameters of the model (weights and biases) such that the
classification error is minimized.
Fig. 3 Max Pooling Layer

We built a 16-layer sequential CNN architecture in the following fashion 2 convolutional


layer, a max pooling layer (output shape (None, 110, 110, 64)) and a dropout layer (output
shape (None, 110, 110, 64)). Again, a convolutional layer, a max pooling layer (output shape
(None, 54, 54, 64)) and a dropout layer. Next, a convolutional, a max pooling, a dropout layer
and a flatten layer are added. To finally categorise the photos as positive or negative for
Covid-19, a fully connected dense layer is applied.

Fig. 4 Visual representation of proposed CNN model.

In our model we get the model summary as total params: 5,668,097, Trainable params:
5,668,097 and Non-trainable params: 0"Total params" refers to the total number of
parameters in the model, and "Trainable params" refers to the number of parameters that can
be updated during training, such as the weights and biases of neural network layers. "Non-
trainable params" refers to any parameters that cannot be updated during training.
Fig. 5 Model summary

Experiment and result

All coding was carried out with Jupiter software on a system having 16gb ram, i5-9300h
processor and GTX 1650 (4gb) GPU. The chest X-ray images are download from Kaggle and
loaded into local system. Two different datasets are used to train and test the model e.g. a
small dataset containing a total of 224 images including 112 Covid-19 positive X-ray images
and a large dataset containing a total of 4626 including 2313 Covid-19 positive images. After
10 epoch we got train accuracy of 98% and validation accuracy of 94%.
Fig. 6 & 7 loss and accuracy graph.

The examples in a predicted class are represented by each row in the confusion matrix, while
the instances in an actual class are represented by each column (or vice versa). The diagonal
elements of the matrix represent the number of instances that have been classified correctly,
while the off-diagonal elements are the ones that have been misclassified. The entries in the
diagonal are true positive, the entries outside the diagonal are false positive and false
negatives, depending the position in the matrix.

Fig. 8 Confusion matrix

We have tested our model with 60 test chest x ray images. Within those images, our model
has predicted 30 Covid-19 positive images as Covid-19 positive, 5 normal images as Covid-
19 positive and 25 normal images as normal.
Fig.9. Test result

Conclusion
To stop the novel coronavirus from infecting other people, it is crucial to diagnose the virus
as soon as possible. Additionally, we developed a deep transfer learning-based system that
combines chest X-ray pictures of patients with COVID-19 and those without the condition to
automatically identify the illness. The proposed classification model can identify COVID-19
with an accuracy of around 94 percent. Our study's findings indicate that, given its strong
overall performance, doctors and other health professionals should naturally rely on it to aid
in clinical decision-making. This work has a thorough grasp of the application of deep
transfer learning algorithms to find COVID-19 as soon as feasible. COVID-19 kills millions
of individuals and poses a threat to the global medical community. Doctors have limited time
because of the enormous number of patients they encounter in emergency situations or
outside, and AI-based analysis might save lives by early screening and providing the right
therapy. Our refined models perform well in the categorization of COVID-19 pneumonia
thanks to quick training using a limited picture set. The suggested computer-aided diagnosis
technique, in our opinion, has the potential to significantly enhance COVID-19 case
diagnosis. When there is a pandemic and there is a need for preventative measures but there
are not enough medical resources to handle the demand, this is extremely beneficial.

Acknowledgement
We would like to express our sincere gratitude to our guide Dr. Chandra Mouliswaran S for
his invaluable guidance and support throughout the research process. We are also deeply
grateful to our Head of the Department Dr. Vanitha M for her support and guidance with the
paper. We are thankful to all of our Vellore Institute of Technology (Vellore) Officials for
supporting us and help us in gaining knowledge towards this research work.

References

Aras M. Ismael, Abdulkadir Sengur “Deep learning approaches for COVID-19 detection
based on chest X-ray images”, Expert Systems with Applications,Vol 164,pp. 01-02-2021.

G. Gilanie, U.I. Bajwa, M.M. Waraich, M.M. Asghar, R. Kousar, A. Kashif, R.S. Aslam,
M.M. Qasim, H. Rafique, “Coronavirus (COVID-19) Detection from Chest Radiology
Images using Convolutional Neural Networks”, Biomedical Signal Processing and
Control,Vol. 66, Issue.102490, pp. 1- 6,2021.

Harsh Panwar, P.K. Guptaa, Mohammad Khubeb Siddiqui, Ruben Morales-Menendez,


Prakhar Bhardwaj, Vaishnavi Singha “A deep learning and grad-CAM based color
visualization approach for fast detection of COVID-19 cases using chest X-ray and
CT- Scan images”,ELSEVIER, Vol 140, November 2020.

Md. I. Khattak, M. Al-Hasan, A. Jan, N. Saleem, E. Verdu, N. Khurshid, “Automated


Detection of COVID-19 using ChestXRay Images and CT Scans through Multilayer
Spatial Convolutional Neural Networks”, International Journal of Interactive
Multimedia and Artificial Intelligence, Vol.6, Issue.6, pp.15-24,2021.

Somenath Chakraborty, Beddhu Murali and Amal K. Mitra “An Efficient Deep Learning
Model to Detect COVID-19 Using Chest X-ray Images”,International Journal of
Environmental Research and Public Health, pp. 11 Feb 2022.

T. Rahman, A. Khandakar, Y. Qiblawey, A.Tahir, S. Kiranyaz, S.B.A. Kashem, Md.T. Islam,


S.A. Madeed, S.M. Zughaier, Md. S. Khan, Md. E.H. Chowdhury, “Exploring the
Effect of Image Enhancement Techniques on COVID-19 Detection Using Chest X-
Ray Images", Computers in Biology and Medicine, Vol.132, Issue.104319, pp. 1-16, 2021.

T. Ozturk, Md. Talo, E.A. Yildirim, U.B. Baloglu, O. Yildirim, U. R. Acharya, “Automated
Detection Of COVID-19 Cases Using Deep Neural Networks with X-Ray Images”,
Computers in Biology and Medicine, Vol. 121, Issue. 103792, pp.1-11, 2020.

Vishu Madaan, Aditya Roy, Charu Gupta, Prateek Agrawal, Anand Sharma, Cristian Bologa,
Radu Prodan “XCOVNet: Chest X-ray Image Classifcation for COVID-19 Early
Detection Using Convolutional Neural Networks”, New Generation Computing, pp.
24 February 2021.

You might also like