Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
Beyond the Human Eye: Using CNNs to
Decipher COVID-19 in Chest X-rays
Mr. G Amar Tej1, Jangala Aparna2, Gudiwada Chinmay Naga Lakshmi3, Konda Komali4,
Kongala Nitya Satwika5
Assistant Professor, Dept. of Electronics and Communication Engineering, Vasireddy Venkatadri
Institute of Technology, Andhra Pradesh, India1
UG Student, Dept. of Electronics and Communication Engineering, Vasireddy Venkatadri Institute of
Technology, Andhra Pradesh, India2,3,4,5
ABSTRACT
The COVID-19 pandemic has posed challenges, for healthcare systems worldwide requiring effective
diagnostic methods and patient management strategies. As a result, the analysis of large-scale data statistics and
the precise identification of COVID-19 patients using chest X-rays have become crucial in the fight against the
virus. Radiologists, who are at the forefront of this battle face the task of sifting through several X-ray images to
accurately identify cases of COVID-19. While traditional diagnostic procedures like Polymerase Chain Reaction
(PCR) tests are accurate they suffer from time delays and resource limitations. Chest X-rays offer a cost-effective
alternative; however, radiologists may encounter difficulties in interpreting them due to the features that indicate
COVID-19-related pneumonia. To address these challenges, we propose a Conventional Convolutional Neural
Networks (CNNs) model in deep learning using Adam optimizer. We aim to improve management efficiency enable
early detection and ultimately enhance patient outcomes in detecting the disease.
Keywords: - COVID-19, CNN, Chest X-Rays, Adam Optimizer and PCR
1. INTRODUCTION
The global health emergency brought about by the COVID-19 pandemic originating from the
coronavirus_SARS_CoV_2 has caused unprecedented challenges worldwide. Starting in Wuhan, China the virus
rapidly spread across borders impacting millions of individuals and resulting in loss of life. COVID-19 primarily
affects the system manifesting through symptoms like coughing, breathing difficulties, and pneumonia. The exposed
vulnerabilities in healthcare systems reveal disparities in access to medical care and funding. In response to this
crisis, technology has played a role in healthcare advancements with deep learning algorithms emerging as valuable
tools. These algorithms enable precise analysis of medical images a promising development for enhanced diagnostic
capabilities. While conventional methods like PCR testing have proven effective, they are hindered by processing
times and occasional false positive results. Utilizing chest X-ray imaging presents an invasive approach to detecting
respiratory infections like COVID 19 making it a focus, for technological innovation. The goal of initiatives, like
developing CNN models is to enhance the effectiveness of diagnosing COVID-19 by automating the analysis of
chest X-ray images. Through utilizing CNN architectures and optimization methods these models strive to surpass
current standards ultimately aiding in early detection initiatives and improving patient care. The intersection of deep
learning and medical imaging holds potential not only for solving the current challenges brought by COVID-19 but
also for shaping the future of diagnostic medicine.
2. LITERATURE SURVEY
Pavipra Singh and Shashank Sahu[1] in their research “Detection of COVID-19 using CNN from Chest X-
ray Images,” used pooling layers and CNNs with ReLU activation functions. The model achieved 88% accuracy by
processing over 40,000 photos in four categories: COVID-19, Viral Pneumonia, Normal, and Lung Opacity. There
were 20 epochs in the training phase, and the dataset was split 70:30 for training and testing.
1111 www.ijariie.com 1
Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
Sanhitha Basu, Sushmitha Mitra, and Nilanjan Saha[2] in their influential work, “Deep Learning for
Screening COVID-19 using Chest X-ray images,” used domain extension transfer learning with Grad-CAM for
visualization to obtain a 90.13% accuracy. Using the TensorFlow Python framework, they efficiently trained on
108,948 pictures from the NIH Chest X-ray dataset over 100 epochs by employing stochastic gradient descent and
Adam optimizers.
Arpan Mangal, Suriya Kalia[3] with their model in “CovidAID: COVID-19 Detection Using Chest X-
Ray,”obtained a ground-breaking 90.5% accuracy in COVID-19 detection from chest X-ray pictures. In response to
lack of radiologists, the authors provide CovidAID, an advanced AI model that outperforms earlier benchmarks like
Covid-Net, recognizing COVID-19 on the COVID Chest X-Ray dataset with 90.5% accuracy and 100% sensitivity.
Matteo Polsinelli, Luigi Cinque, and Giuseppe Placidi[4] in “A light CNN for detecting COVID-19 from
CT scans of the chest,” presented a unique method based on data from Zhao et al. and an Italian dataset. They
creatively swapped out ReLU layers with ELU layers using a 200-epoch training that was optimized using Bayesian
techniques, and they achieved an astounding 85.03% accuracy. Their lightweight CNN, which was modeled after
SqueezeNet, outperformed more intricate architectures with a 10% increase in efficiency.
Singh, Shrinjal, Piyush Sapra, Aman Garg, and Dinesh Kumar Vishwakarma[5] “CNN based Covid-aid:
Covid 19 Detection using Chest X-ray.” This study endeavors to develop a deep learning model leveraging CNNs to
detect COVID-19 from chest radiography images. Employing a publicly available dataset, our model achieved a
classification accuracy of 87%, demonstrating promising potential for aiding in the timely diagnosis of the disease.
Maghari, Ashraf Yunis[6] “COVID-19 Detection in X-ray Images using CNN Algorithm.” In this study,
they applied a CNN algorithm similar to the CheXNet approach. Using a dataset of 550 chest X-ray images, sourced
from Kaggle and including some infected with the COVID-19 virus, we achieved an acceptable prediction accuracy
of 89.7%, closely matching the performance of the CheXNet algorithm.
Sahinbas, Kevser, and Ferhat Ozgur Catak[7] “Transfer learning-based convolutional neural network for
COVID-19 detection with X-ray images”. This study proposed a deep CNN model using pretrained architectures
(VGG16, VGG19, ResNet, DenseNet, InceptionV3) for COVID-19 detection from chest X-ray images. The
pretrained VGG16 model achieved the highest accuracy of 80%, demonstrating its efficacy in radiology
departments.
3. DATASET
The researchers worked with medical professionals to generate the Chest X-ray picture dataset, which was
obtained from the Kaggle Repository [8] using a variety of internet resources such as GitHub, SIRM, and other sites.
published works, the Pad chest dataset, the Pneumonia dataset, and the Radiology Society of North America
(RSNA). 42330 photos overall from 4 categories—COVID-19, non-COVID-19 (lung opacity & viral pneumonia),
Normal—are included in the experiment dataset. Given the intricacy of the system, we have selected 4,000 images
from the COVID-19 and Normal categories. The training and testing dataset is split 70:30, with 2800 training
images and 1200 testing images. Fig. 1 represents the various classes of X-ray images of Chest and the splitting of
chest X-ray images for training and testing is shown in Fig. 2
(a) (b)
Fig. 1: Categories of Chest X-ray images (a) COVID-19 (b)Normal [9]
1111 www.ijariie.com 2
Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
The dataset is divided as follows
Fig. 2: Dataset flow chart
4. PREPROCESSING AND AUGMENTATION
Preprocessing of image data is made easier by utilizing the Keras Image Data Generator. Each pixel value
in the training set is normalized because the generator is configured with the rescale parameter set to 1/255, which
results in the range [0, 1]. To provide consistent input data for both the training and assessment phases, the testing
set also goes through the same rescaling process. The generated normalized images are used as the basis for X-ray
dataset analysis and efficient model training.
Keras Image Data Generator facilitates augmentation in the training set at improve dataset variety, it adds
shear and zoom transformations, with training parameters set at 0.2. We lower the possibility that the model may
focus too much on particular details by improving its adaptability to various types of input data. As the model's
flexibility increases through modifications, so does its capacity to analyze images
5. PROPOSED WORK
The proposed model has 15 layers, which have varied contributions toward its efficacy which includes five
convolutional layers followed by five max pooling layers, two dense layers, one output layer, one flatten layer and
one dropout layer. First, five layers analyze photos to identify significant patterns, and then another five layers
downscale and extract features of images for easy processing. Then the image is flattened ready for the final
decision-making stage whereby the output layer checks the presence of COVID-19 indicators. A dropout layer helps
to prevent over-emphasis on certain areas, whereas two more layers are there to study complex features. To make
progress, a model is trained on different pictures to improve accuracy without becoming too obsessed with minor
details. Overall, our model combines adaptable nature and experience-based learning enabling reliable COVID-19
detection. Fig.3 illustrates our model's flowchart, whereas Fig. 4 depicts our model's architecture.
Fig. 3: Flowchart of the model
1111 www.ijariie.com 3
Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
5.1 CNN
Fig 4: Convolutional Neural Network Architecture
5.1.1 CONVOLUTIONAL LAYER:
This model consists of five convolutional layers, employing filter sizes ranging from 32 to 512 and utilizing a
3x3 filter size alongside ReLU activation functions. These layers play a vital role in identifying spatial patterns such
as edges and textures within the input images. As the network deepens, these layers progressively capture
increasingly complex features, which are essential for accurate classification.
5.1.2 MAXPOOLING LAYER:
In this model, we use five max-pooling layers to reduce feature map size by selecting the maximum value in
2x2 windows. This enhances computational efficiency while preserving important features. Max-pooling promotes
generalization, and robust feature extraction, and prevents overfitting, maximizing CNN effectiveness in image
categorization.
5.1.3 DENSE LAYER:
In this model, we use two dense layers: the first layer uses 512 neurons that are activated with ReLU to help
with feature extraction, and the second layer uses one neuron that is activated with sigmoid to help with the final
prediction of COVID-19 presence. The model's learning ability and classification accuracy are greatly improved by
these layers.
5.1.4 DROPOUT LAYER:
The dropout layer is a regularization technique employed to mitigate overfitting in neural networks. By
randomly deactivating a portion of input neurons during training, the model avoids relying excessively on specific
features, thus enhancing its ability to generalize to new data. In our model, Dropout (0.3) signifies that 30% of input
units will be randomly dropped during training, striking a balance between reducing overfitting and preserving
valuable information.
5.1.5 FLATTEN LAYER:
The final convolutional layer's output is converted into a 1D vector in our model's `Flatten` layer so that it
may be fed into the dense layers. Dense layers require this reshaping to process the data efficiently for
prediction, as they anticipate one-dimensional data.
1111 www.ijariie.com 4
Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
Libraries used in the above discussed model:
• Keras
• TensorFlow
• Numpy
• Scikit-Learn
• Matplotlib
Table I shows a brief introduction to libraries used in this model.
Table -1 : List of Libraries
Software Package Purpose
Python Base programming language.
Keras High-level deep learning API for building and training
models.
TensorFlow Backend used by Keras (may not be needed if your Keras
installation includes it automatically).
NumPy Fundamental library for numerical computations.
scikit-learn Used for data manipulation, specific metrics, etc.
matplotlib Main plotting library for creating graphs.
System requirements for implementation
• Processor: Multi-core CPU
• RAM: Minimum 8GB
• Storage: Adequate disk space
• Internet Connection: Stable and high-speed
• Coding Language: Python
• IDE: VS Code /Google Colab
6. EXPERIMENT AND RESULT
The model was trained and validated for 100 consecutive epochs as part of the experimental work.
According to the findings, the proposed approach has a training accuracy of 97.88% and a validation accuracy of
93.58%. For training and validation, the corresponding loss values were 0.0062 and 0.2872, respectively. Table II
summarises the accuracy and loss for both training and testing and Table III represents the evaluation metrics of
each class. Fig. 5 illustrates the confusion matrix. The link between epochs and accuracy and epochs and loss for the
training and validation sets is depicted in the graph in Fig. 6 and Fig. 7 below.
Table -2 : Accuracy and Loss
Values Training Testing
Accuracy 97.88 93.58
Loss 0.006 0.2872
1111 www.ijariie.com 5
Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
Table -3: Evaluation Metrics Of Each Class
Precision Recall F1-score Support
Class 0 0.95 0.91 0.93 600
Class 1 0.91 0.95 0.93 600
Accuracy 0.93 1200
Macro 0.93 0.93 0.93 1200
avg
Weighted 0.93 0.93 0.93 1200
avg
Fig -5: Confusion Matrix
Accuracy: = 93
Precision: = 91
Recall: = 95
F1-score: 2* = 93
Support: Number of actual occurrences of a particular class in the dataset
Fig -6: Epoch vs Accuracy Graph Fig -7: Epoch vs Loss Graphs
1111 www.ijariie.com 6
Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
7. RESULT
The following images showcase the outcomes of applying the provided code, depicting predictions made for
both COVID-19 positive and normal cases. Fig. 8 represents both COVID positive and normal chest X-Rays.
(a) (b)
Fig -8: Result (a) COVID (b) Normal
8. CONCLUSION
Our strategy combines feasible techniques like data augmentation, optimization functions, and loss functions to
achieve 93% accuracy in COVID-19 detection. By diversifying the dataset and optimizing functions, we aim to
improve the model's ability to identify subtle COVID-19 indicators in chest X-ray images. Our approach emphasizes
the development of precise diagnostic tools crucial for combating the pandemic. In this paper, we enhanced the
precision of the Convolutional Neural Network by incorporating layers and integrating dropout layers to combat
overfitting. Adam optimization accelerated training, enhancing the CNN's ability to identify COVID-19 patterns
across the dataset. These efforts promise effective diagnostic solutions for addressing the COVID-19 crisis.
9. REFERENCES
[1] Singh, Pavipra, and Shashank Sahu. “Detection of COVID-19 using CNN from Chest X-ray Images.” In 2022
International Conference on Computational Intelligence and Sustainable Engineering Solutions (CISES), pp. 447-
452. IEEE, 2022.
[2] Basu, Sanhita, Sushmita Mitra, and Nilanjan Saha. “Deep learning for screening covid-19 using chest x-ray
images.” In 2020 IEEE symposium series on computational intelligence (SSCI), pp. 2521-2527. IEEE, 2020.
[3] Mangal, Arpan, Surya Kalia, Harish Rajgopal, Krithika Rangarajan, Vinay Namboodiri, Subhashis Banerjee, and
Chetan Arora. “CovidAID: COVID-19 detection using chest X-ray.” arXiv preprint arXiv:2004.09803 (2020).
[4] Saqib, Muhammad, Abbas Anwar, Saeed Anwar, Lars Petersson, Nabin Sharma, and Michael Blumenstein.
“COVID-19 detection from radiographs: Is deep learning able to handle the crisis?” Signals 3, no. 2 (2022): 296-
312.
[5] Singh, Shrinjal, Piyush Sapra, Aman Garg, and Dinesh Kumar Vishwakarma. “CNN based Covid-aid: Covid 19
Detection using Chest X-ray.” In 2021 5th International Conference on Computing Methodologies and
Communication (ICCMC), pp. 1791-1797. IEEE, 2021.
[6] Maghari, Ashraf Yunis. “COVID-19 Detection in X-ray Images using CNN Algorithm.” In 2020 International
conference on promising electronic technologies (ICPET), pp. 5-9. IEEE, 2020.
[7] Sahinbas, Kevser, and Ferhat Ozgur Catak. “Transfer learning-based convolutional neural network for COVID-
19 detection with X-ray images.” In Data science for COVID-19, pp. 451-466. Academic Press, 2021.
1111 www.ijariie.com 7
Vol-2 Issue-1 2016 IJARIIE-ISSN(O)-2395-4396
[8] https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database.
[9] https://storage.googleapis.com/kagglesdsdata/datasets/576013/3324348/COVID19_Radiography_Dataset
1111 www.ijariie.com 8