You are on page 1of 5

Volume 8, Issue 5, May – 2023 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Comparison of Deep Learning Algorithms for


Pneumonia Detection
Amrutha P M, Mariya Philip, Ashwaika P V
Department of Mathematics, Amrita School of Physical Science,
Amrita Vishwa Vidyapeetham, Kochi, Kerala, India

Abstract:- Pneumonia is a very dangerous disease that II. RELATED WORKS


affects the lungs of human beings and can even cause
death. It is caused by a bacteria called Streptococcus  CheXNet: Radiologist-Level Pneumonia Detection on
pneumoniae. There are different types of pneumonia like Chest X-Rays with Deep Learning (2017)
bacterial, viral, and covid 19 pneumonia. This mainly Pranav Rajpurkar, Jeremy Irvin, et al. (2017)
affects children below five years and elderly people. developed an algorithm that could detect 4,444 types of
Chest X-rays are used to diagnose pneumonia and this pneumonia from chest X-rays at a level that far exceeds the
needs expert radiotherapists for evaluation. This may practice of radiology. The CheXNet algorithm is a 121-layer
cause a delay in detecting pneumonia which can be life- convolutional neural network trained on ChestX-ray14. Four
threatening. Here comes the need for deep learning practice radiologists described tests in which they compared
algorithms for analyzing medical images. In this paper, CheXNet’s performance to that of radiologists. They found
we use deep learning algorithms like CNN, transfer that the CheXNet outperformed the average radiologist’s F1
learning and ANN in detecting pneumonia and compare metric.
their accuracies to determine which algorithm is better.
Chest X-ray dataset from Guangzhou Women and  Pneumonia detection using CNN-based feature ex-
Children’s Medical Center is used. traction(2019)
In the work of Dimpy Varshni; Kartik Thakral; Lucky
I. INTRODUCTION Agarwal; Rahul Ni-jawan; Ankush Mittal (2019),evaluated
the ability of pre-trained CNN models to be used as feature
A lung infection known as pneumonia is brought on by extractors and then used different classifiers for the clas-
bacteria, viruses, or fungi. The infection causes sification of abnormal and normal chest X-rays. To do this,
inflammation in the lungs’ alveoli, which are small air sacs. they determine the best CNN model through analysis. The
As the alveoli swell with liquid or pus, breathing becomes obtained results show that the proposed CNN model used in
challenging.[1]Pneumonia causes the death of around conjunction with the observer algorithm is much more
700,000 children every year and affects 7 percentage of the useful in the analysis of chest X-ray images, especially in
global population. In the present scenario where Covid19, the diagnosis of lung disease.
which was found as a cluster of pneumonia, is pertaining the
estimate of people affected by lung diseases is doubled. In  Pneumonia detection in chest X-ray images using con-
the beginning, doctors used a clinical examination, a volutional neural networks and transfer learning(2020)
patient’s medical history, and chest X-rays to diagnose A paper by Rachna Jain, Preeti Nagrath et al (2020),
pneumonia. Different computer-aided diagnosis methods presents a convolutional neural network model for lung
can be used to solve the issue of a lack of experts. Deep cancer diagnosis using X-ray images. Several convolutional
learning is mostly used for pneumonia detection that occurs neural networks were trained to classify X-ray images into
more quickly. In order to determine which deep learning two classes, pneumonia and non-pneumonia, by varying the
algorithm provides higher accuracy at a faster rate, we are parameters, hyper-parameters, and number of layers. Six
analysing the accuracy of various deep learning algorithms models are mentioned in the article. The first and second
in this study. The compared algorithms include CNN, ANN, models have two and three convolution layers, respectively.
and transfer learning. Each year, pneumonia affects over 450 The other four models are pre-trained models which are
million people worldwide. The majority of children under 5 VGG16, VGG19, ResNet50, Inception-v3.
who develop pneumonia. This age group of kids has the
highest prevalence of pneumonia-related deaths. Among the  Prediction of Community-Acquired Pneumonia Using
models compared and studied, CNN was found to have Artificial Neural Networks(2003)
higher accuracy than other models. Paul S.Heckerling, MD, Ben S.Gerber et al wrote a
paper in which ANN was trained on health, symptoms,
signs, symptoms, and recommendation data from 1044
patients at the University of Illinois (training group) and
applied to 116 patients at the University of Nebraska.
patients (test cohort). ANNs trained with different strategies
were compared among themselves and the main effects were

IJISRT23MAY733 www.ijisrt.com 1511


Volume 8, Issue 5, May – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
compared with logistic regression. Calibration accuracy was disease tests. Experimental results show the possibility of
measured as the square of the error and discrimination training deep learning models on published data on chest X-
accuracy was measured as the area under the receiver ray images to diagnose lung diseases. The efficacy of chest
operating characteristic (ROC) curve. X-rays of COVID-19 patients has been confirmed by a
special diagnostic model.
 A Novel COVID-19 Diagnosis Support System Using the
Stacking Approach and Transfer Learning Technique on III. METHODOLOGY
Chest X-Ray Images (2021)
Soufiane Hamida et al. wrote an article in 2021 in a  Dataset description
similar domain. The purpose of this article is to improve the The dataset has three folders: train, test, and valuation,
rapid and accurate diagnosis of COVID-19 on chest X-ray with a subfolder for each type of image
images by using the stacking technique combined with (pneumonia/normal). 5,863 X-ray images (JPEG) are
transfer learning and KNN algorithm to select the best included, with 2 classifications (pneumonia/normal). At the
model. This approach can store and use the knowledge Guangzhou Women and Children’s Medical Centre, chest
gained by pre-trained convolutional neural networks to X-ray images (anterior-posterior view) were chosen from a
solve new problems. To ensure the robustness of the retrospective cohort of paediatric patients between the ages
proposed system for diagnosing COVID-19 patients using of one and five. The patient receives routine clinical care
X-ray images, we use a machine learning technique called that includes all chest X-rays. Prior to analysis, all chest
stacking to combine the performances of the many transfer radiographs were checked for quality control to exclude any
learning based models. The model was trained on data that subpar or unlawful scans. In order to train the AI system, the
included four categories such as COVID-19, tuberculosis, diagnostics from the photos were first cleaned up and scored
pneumonia, and common diseases. Validation data was by two experienced doctors. A third expert also checked the
collected from a 6-domain dataset of X-ray images. They evaluation set to rule out any scoring problems.
use different general measures to evaluate the effectiveness
of the proposal. The proposed method achieved a very high  Process
accuracy of 99.23 The process consists of four stages,
 Selection of appropriate dataset
 Pneumonia Detection Using Deep Learning Based on  Data preprocessing
Convolutional Neural Network(2021)  Building the model
Luka Raˇci´c; Tomo Popovi´c; Stevan ˇcaki´c; Stevan  Prediction based on the accuracy of deep learning
Sandi together did their research using deep learning based algorithms
on cnn in 2021 itself. Their article describes the use of
machine learning algorithms to process chest X-ray images  Data Pre-processing
to support decision making. In particular, the research We first alter our photographs to make them better
focuses on the development of models using deep learning candidates for training a convolutional neural network
algorithms based on neural networks. The role of the model before we begin. Then we do data preprocessing and data
is to help solve the classification problem of detecting augmentation for this assignment using the Keras Image
whether the chest X-ray varies according to the lung disease Data Generator function. Additionally, this class provides
and dividing the X-ray images into two groups according to simple data enhancements like random image horizontal
the diagnosis. flipping. Additionally, we utilise the generator to change
each batch’s values to have a mean of 0 and a standard
 Deep Learning on Chest X-ray Images to Detect and deviation of 1. By normalising the input distribution, this
Evaluate Pneumonia Cases at the Era of COVID- will facilitate model training. The generator additionally
19(2021) changes our grayscale x-ray images to a three-channel
As COVID-19 hit, faster detection of pneumonia format by iterating over the image’s values across all
became more necessary. During that period, Karim channels. We need to do this since the pre-trained model we
Hammoudi , Halim Benhabiles wrote a paper regarding this. will be using demands that the images be in a three-channel
Because lung diseases can be detected by X-rays, this article format.
explores the deep learning process for the evaluation and
interrogation of chest X-rays, hoping to provide patient  Algorithms Used
doctors with equipment that has been tested for and Here the dataset is split into train, test, and validation
identifies patients for COVID-19. In this context, training datasets. In this study, we use deep learning algorithms like
datasets, deep learning and analysis techniques from the ANN, CNN, and transfer learning. Trans-fer learning makes
data contained in chest X-ray images were tested. There is a use of different algorithms like DenseNet, VGG16, ResNet,
different learning process from the learning model to learn and InceptionNet. We use these algorithms for detecting
about pneumonia, especially infectious diseases. It is pneumonia. In this paper, we compare these algorithms and
assumed that cases of pneumonia diagnosed in the context find out which one is more accurate for prediction.
of the spread of COVID-19 disease are most likely to be
considered a disease of COVID-19 disease. In addition,
simple sanitation measures have been proposed to predict
the spread of disease and predict patient status from lung

IJISRT23MAY733 www.ijisrt.com 1512


Volume 8, Issue 5, May – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
 Deep Learning where the dataset is small, transfer learning may be helpful.
A subset of machine learning called ”deep learning” The idea behind transfer learning is straightforward: we take
uses neural networks. It may discover intricate links and a big data learning model and apply its expertise to small
patterns in the data. It is founded on deep neural networks data. We freeze the network’s initial convolutional layers for
(DNN), often referred to as artificial neural networks object recognition in CNN and train the final few layers just
(ANN). These neural networks are built to learn from for prediction. [10]tTransfer learning has recently been
massive amounts of data, and they were inspired by the applied successfully in a variety of real-world settings,
architecture and operation of organic neurons found in the including manufacturing, healthcare, and baggage screening.
human brain. An input layer is coupled to one or more This eliminates the need for a sizable dataset and shortens
primitive layers in a fully connected deep neural network. the lengthy training period that the deep learning system
The previous group of neurons fed information to each requires when created from scratch.
neuron. Up until the formation of the final layer of the
network, the output of one neuron becomes the input of To solve the vanishing/exploding gradient problem, the
additional neurons in the subsequent layer. The layers of the architecture intro-duces a concept called residual blocks. In
neural network transform the input data with non-linear this network, we use a technique called skip-connections.
transformations, allowing the network to learn the Skip-connection links the processes of one layer to other
representation of the input data. layers by skipping some layers. This creates a residual
block. Resnet is created by putting the residual block
 CNN Architecture together. The benefit of adding this kind of skip-connections
CNNs have gained popularity as a result of their is that if a layer causes any problem in architectural
enhanced picture categorization capabilities. The network’s operation it will be skipped by the normal process. The
convolutional layers and filters aid in the extraction of an network uses a 34-layer traditional network architecture
image’s spatial and temporal information. The weight- inspired by VGG-19 and then adds short links. These short
sharing method used by the layers aids in minimising links then converts the architecture to the residual network.
computational work. CNNs are the best choice for tasks like
image classification, object identification, and im-age Each layer in DenseNet is linked to every other layer
segmentation because they can learn the characteristics of deeper in the network.[11]Compared to a conventional
images. The input layer, convolutional layer, pooling layer, CNN, the DenseNet design requires less parameters. Only
and fully connected layers are only a few of the layers that 12 filters and a limited number of new feature maps are used
make up a convolutional neural network. in DenseNet layers. With some essential differences, it is
extremely similar to a ResNet. Due to the disappearing
A set of filters (or kernels) with modest widths and the gradients generated by the distance between input and
same height and depth as the volume make up the output processes, where data is lost before it reaches its
convolutional process. Each stride (for high-resolution destination, DenseNet was particularly created to improve
images, its value can be 2, 3, or even 4) represents the accuracy in advanced neural networks.[11]By providing
amount of time it takes to gradually move each filter across access to the gradient values from the loss function and the
the entire volume as we compute the dot product between input image, DenseNet resolves this problem. In a DenseNet
the kernel weights and patch from the input volume. When with L layers, there will be approximately L and L plus one
we move the filters, the output is filled with filters of the by two connections, or L(L+1)/2. So in dense networks we
same depth because we combined the 2D outputs of each have less layers than other models, so here we can easily
filter. All the filters will be learned by the network. train models with more than 100 layers using this method.

This layer is placed in CNN from time to time and its One of the most well-known models of convolutional
main function is to reduce the size of the volume, thus neural network (CNN) architecture to date is VGG16. It
speeding up computation, reducing memory and preventing begins with blocks of two or three convolutional layers, then
overfitting. The two types of pooling layers are max pooling moves on to a pooling layer, a dense network made up of
and average pooling. If we use 2 x 2 filters and max pooling two hidden layers, and finally an output layer. VGG16
with stride 2, the resulting volume will be 16x16x12. The employs a max pooling layer with a 2x2 filter with stride 2
results of the maps are flattened into one-dimensional and a convolutional layer with a 3x3 filter at the same
vectors after the convolution and pooling layers so that they padding in place of several hyperparameters. Throughout
can be transmitted to a fully connected layer for the architecture, it always adheres to the convolutional and
classification or regression. maximum pooling layer orders. Last but not least, it has two
arrays of connections, all of which are output by Softmax.
The results of the combined process are then put into a The 16 in VGG16 denotes the presence of 16 weighted
logistic function for classification, such as sigmoid or layers.
softmax, which transforms the output of each class into a
probability score test for all classes. The GoogleNet is another name for the InceptionNet.
The architecture offers inception module subnets. It enables
 Transfer learning quick training, complicated pattern computation, and
A larger dataset often yields better results for CNNs parameter usage optimisation. To increase speed and
than a smaller one does. When using CNN in applications precision, it employs a variety of strategies. There are 22

IJISRT23MAY733 www.ijisrt.com 1513


Volume 8, Issue 5, May – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
layers in the architecture altogether. Nine linearly fitted
inception modules make up GoogleNet. There are 22 layers
(27 including the outer layers). The architecture’s last layer,
global average pooling, which determines the average value
of each feature map, replaces all previous levels. This
drastically lowers the total number of parameters.

 ANN Architecture
Artificial neural networks are created from the
structures and operations of human neurons. It is also called
neural network. Artificial neurons, also called units, are Fig 1: Accuracy Graph
found in artificial neural networks. All the artificial nueral
networks made up of these artificial neurons are arranged in The work under discussion assesses how well different
a single layer. A fully connected neural network has an input deep learning algorithms, such as ANN, CNN and transfer
layer and one or more hidden layers. Each neuron receives learning, such as DenseNet, ResNet,VGG16 and
input from the previous input processes. The output of one InceptionNet, recognise pneumonia. We evaluate the
neuron becomes the input of other neurons in the next layer performance of various algorithms to see which one is faster
of the network, and this process continues until the last layer and more accurate. The best deep learning-based pneumonia
of the network is formed. Then, after going through one or detection algorithm must be selected based on the results of
more hidden processes, this information is converted into this test. DenseNet surpassed other methods utilised in the
master information for the output process. Finally, the study, according to the computed accuracy of 93 percentage.
output process is displayed as the neural network’s response The DenseNet model per-formed this task with great
to the incoming data. accuracy, raising the possibility that it could help identify
pneumonia early even in the absence of specialised
IV. RESULT radiologists.
The death rate from pneumonia can be lowered with V. CONCLUSION
early identification. various algorithms is effective in
identifying pneumonia. Our goal was to identify the Detection of pneumonia in its early stage is necessary
algorithm that serves superior. In order to do that, we to reduce the death rate. Due to the lack of expert
contrasted a number ofdeep learning algorithms, including radiotherapists, this task becomes a bit difficult, this is
ANN, CNN, and transfer learning. Accuracy ratings for the solved using deep learning algorithms. In our study, we have
models were determined. The fraction of correctly predicted used several algorithms to detect pneumonia and concluded
outcomes is what is referred to as accuracy. that DenseNet is more accurate than other algorithms in the
faster detection of pneumonia with a calculated accuracy of
The accuracy is measured using different elements 93 percentage.
namely true positives(P), true negatives(N), false
positives(p), false negatives(n),precision(x) and recall(y). It REFERENCES
is calculated using the below equation:
[1]. Mohammad Farukh Hashmi, Satyarth Katiyar, Avinash
Accuracy = (P + N)/(P + N + p + n) (1) G Keskar, Neeraj Dhanraj Bokde, and Zong Woo
Geem. Efficient pneumonia detec-tion in chest xray
The recall score for a model is calculated as: images using deep transfer learning. Diagnostics
(Basel), 10(6), June 2020.
Recall = y = P/(P + n) (2) [2]. Pranav Rajpurkar, Jeremy Irvin, Kaylie Zhu, Brandon
Yang, Hershel Mehta, Tony Duan, Daisy Ding, Aarti
Precision is defined as the number of accurate positive Bagul, Curtis Langlotz, Katie Sh-panskaya, Matthew P
predictions and is calcu-lated as: Lungren, and Andrew Y Ng. CheXNet: Radiologist-
Level pneumonia detection on chest X-Rays with deep
P recision = x = P/(P + p) (3) learning. arXiv [cs.CV], November 2017.
[3]. Dimpy Varshni, Kartik Thakral, Lucky Agarwal, Rahul
F1-score measures the model’s accuracy and it is calculated Nijhawan, and Ankush Mittal. Pneumonia detection
as: using CNN based feature extrac-tion. In 2019 IEEE
International Conference on Electrical, Computer and
F 1Score = (2 ∗ x ∗ y)/(x ∗ y) (4) Communication Technologies (ICECCT), pages 1–7,
February 2019.
[4]. Rachna Jain, Preeti Nagrath, Gaurav Kataria, V Sirish
Kaushik, and D Jude Hemanth. Pneumonia detection in
chest x-ray images using convo-lutional neural
networks and transfer learning. Measurement,
165:108046, December 2020.

IJISRT23MAY733 www.ijisrt.com 1514


Volume 8, Issue 5, May – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
[5]. Paul S Heckerling, Ben S Gerber, Thomas G Tape, and
Robert S Wig-ton. Prediction of community-acquired
pneumonia using artificial neural networks. Med.
Decis. Making, 23(2):112–121, 2003.
[6]. Soufiane Hamida, Oussama El Gannour, Bouchaib
Cherradi, Abdelhadi Raihani, Hicham Moujahid, and
Hassan Ouajji. A novel COVID-19 di-agnosis support
system using the stacking approach and transfer
learning technique on chest X-Ray images. J. Healthc.
Eng., 2021:9437538, Novem-ber 2021.
[7]. Luka Raˇci´c, Tomo Popovi´c, Stevan Caki´c, and
Stevan Sandi. Pneumonia detection using deep
learning based on convolutional neural network. In
2021 25th International Conference on Information
Technology (IT), pages 1–4, February 2021.
[8]. Karim Hammoudi, Halim Benhabiles, Mahmoud
Melkemi, Fadi Dornaika, Ignacio Arganda-Carreras,
Dominique Collard, and Arnaud Scherpereel. Deep
learning on chest x-ray images to detect and evaluate
pneumonia cases at the era of COVID-19. J. Med.
Syst., 45(7):75, June 2021.
[9]. Daniel S Kermany, Michael Goldbaum, Wenjia Cai,
Carolina C S Valentim, Huiying Liang, Sally L Baxter,
Alex McKeown, Ge Yang, Xiaokang Wu, Fangbing
Yan, Justin Dong, Made K Prasadha, Jacqueline Pei,
Magdalene Y L Ting, Jie Zhu, Christina Li, Sierra
Hewett, Jason Dong, Ian Ziyar, Alexander Shi, Runze
Zhang, Lianghong Zheng, Rui Hou, William Shi, Xin
Fu, Yaou Duan, Viet A N Huu, Cindy Wen, Edward D
Zhang, Charlotte L Zhang, Oulan Li, Xiaobo Wang,
Michael A Singer, Xiaodong Sun, Jie Xu, Ali Tafreshi,
M Anthony Lewis, Huimin Xia, and Kang Zhang.
Identifying medical diagnoses and treatable diseases by
Image-Based deep learning. Cell, 172(5):1122–
1131.e9, February 2018.
[10]. Tawsifur Rahman, Muhammad E H Chowdhury, Amith
Khandakar, Khan-daker R Islam, Khandaker F Islam,
Zaid B Mahbub, Muhammad A Kadir, and Saad
Kashem. Transfer learning with deep convolutional
neural net-work (CNN) for pneumonia detection using
chest x-ray. NATO Adv. Sci. Inst. Ser. E Appl. Sci.,
10(9):3233, May 2020.
[11]. Vikash Chouhan, Sanjay Kumar Singh, Aditya
Khamparia, Deepak Gupta, Prayag Tiwari, Catarina
Moreira, Robertas Damaˇseviˇcius, and Victor Hugo C
de Albuquerque. A novel transfer learning based
approach for pneumonia detection in chest x-ray
images. NATO Adv. Sci. Inst. Ser. E Appl. Sci.,
10(2):559, January 2020.

IJISRT23MAY733 www.ijisrt.com 1515

You might also like