SlideShare a Scribd company logo
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 57
Pneumonia Detection Using Deep Learning and Transfer Learning
Gaurav Kadam1, Aman Tobaria2, Sahil Arya3, Asst. Prof. Sudha Narang(Guide) 4
1Gaurav kadam, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology, Delhi, India
2Aman Tobaria, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology, Delhi, India
3Sahil Arya, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology, Delhi, India
4Professor Sudha Narang, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology,
Delhi, India
---------------------------------------------------------------------***---------------------------------------------------------------------
Abstract - Pneumonia is an infection of the lungs that can
be caused by bacteria, viruses, and other microorganisms. It
is a serious illness that can lead to death, especially in
vulnerable populations such as the elderly and those with
compromised immune systems. There have been several
studies that have used deep learning and machine learning
techniques to detect pneumonia from medical images such
as chest X-rays or CT scans. These techniques involve
training a model on a large dataset of labeled images,
where the model learns to recognize patterns and features
that are indicative of pneumonia. One example of a study
that used deep learning for pneumonia detection was
published in the journal Radiology in 2017. In this study, the
authors trained a convolutional neural network (CNN) on a
dataset of chest X-rays and found that the CNN was able to
accurately classify images as normal or pneumonia with an
AUC (area under the curve) of 0.97. Another example is a
study published in the journal Chest in 2018, which used a
machine-learning approach called a random forest classifier
to detect pneumonia from chest X-rays. The authors found
that their model had an accuracy of 89.6% and an AUC of
0.94. Overall, the use of deep learning and machine learning
for pneumonia detection shows promising results and has
the potential to improve the accuracy and efficiency of the
diagnosis process.
Key Words: Machine Learning, Deep Learning, CNN,
Transfer Learning, Chest X-Ray Images.
1. INTRODUCTION
Pneumonia is a common respiratory infection that can be
caused by bacteria, viruses, and other microorganisms. It
is a serious illness that can lead to death, especially in
vulnerable populations such as the elderly and those with
compromised immune systems. Early diagnosis and
treatment of pneumonia is important to prevent
complications and improve outcomes.
Traditionally, pneumonia has been diagnosed using
clinical symptoms, physical examination, and imaging
tests such as chest X-rays. However, these methods can be
subjective and may not always provide accurate results.
Deep learning and machine learning techniques offer a
potential solution to improve the accuracy and efficiency
of pneumonia diagnosis. These techniques involve training
a model on a large dataset of labelled images, where the
model learns to recognize patterns and features that are
indicative of pneumonia. One approach that has been
widely used is transfer learning, which involves pre-
training a model on a large dataset and then fine-tuning it
on a smaller, specific dataset for a particular task.
Transfer learning has been applied to pneumonia
detection using chest X-rays with promising results. For
example, a study published in the journal Radiology in
2017 used a convolutional neural network (CNN) trained
on a large dataset of chest X-rays and found that the CNN
was able to accurately classify images as normal or
pneumonia with an AUC (area under the curve) of 0.97.
Overall, the use of deep learning and transfer learning for
pneumonia detection using chest X-rays as the dataset
shows promise as a way to improve the accuracy and
efficiency of diagnosis and has the potential to benefit
patients and healthcare systems.
2. DATASET
The Lung Infection in Chest X-ray Images (Kaggle)
dataset: This dataset contains over 5,863 chest X-ray
images, including a large number with pneumonia. It was
created as part of a Kaggle competition and has been
widely used in research studies. Overall, these datasets
provide a diverse range of chest X-ray images that can be
used to train and evaluate models for pneumonia detection.
The dataset is organized into 3 folders (train, test, val) and
contains subfolders for each image category (Pneumonia
and Normal). There are 5,863 X-Ray images (JPEG) and 2
categories (Pneumonia and Normal).
Chest X-ray images (anterior-posterior) were selected from
retrospective cohorts of pediatric patients one to five years
old from Guangzhou Women and Children’s Medical
Center, Guangzhou. Analysis of chest x-ray images was
done on all chest radiographs that were initially screened
for quality control by removing all low-quality or
unreadable x-ray images. The diagnoses for the images
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 58
were then graded by two expert physicians before being
cleared for training in the AI system. To check the grading
errors, the evaluation set was confirmed by a third expert.
Fig-1: Normal CXR Images
Fig-2: Pneumonia Affected CXR Images
3. METHODOLOGY
The methodology for using machine learning and deep
learning techniques to detect and predict pneumonia
varies depending on the specific approach and data
sources used. Here is a general outline of the steps that
may be involved in this process:
1. Data collection: The first step is to collect a dataset of
chest X-ray images that include both normal images and
images with pneumonia. This dataset may be obtained
from a hospital or clinical setting, or it may be obtained
from online repositories such as the Kaggle Chest X-ray
dataset.
2. Data preprocessing: The next step is to preprocess the
data by selecting a subset of the images to use for training
and testing the model, and by resizing and cropping the
images as needed. It may also be necessary to correct any
errors or biases in the data.
3. Feature extraction: In this step, features are extracted
from the images that are relevant for pneumonia
detection. These features may include patterns and shapes
in the lung tissue, abnormalities in the appearance of the
heart and blood vessels, and other characteristics that are
indicative of pneumonia.
4. Model training: The next step is to train a machine
learning or deep learning model on the dataset. This may
involve selecting a model architecture, such as a
convolutional neural network (CNN) or random forest
classifier, and choosing appropriate hyperparameters such
as the learning rate and regularization strength.
5. Model evaluation: Once the model is trained, it is
important to evaluate its performance on a separate test
dataset to assess its accuracy and generalizability. This
may involve calculating metrics such as accuracy,
precision, recall, and the area under the curve (AUC).
6. Model deployment: If the model performs well, it can be
deployed in a clinical setting to assist with a pneumonia
diagnosis. This may involve integrating the model into a
computer-aided diagnosis system or using it to generate a
probability score that can aid decision-making.
Overall, the methodology for pneumonia detection using
machine learning and deep learning involves a number of
steps that require careful consideration and optimization
to achieve good performance.
4. MODELS
Several types of machine learning and deep learning
models have been used for pneumonia detection. We have
used the following methods for pneumonia detection:
4.1 Convolutional neural networks (CNNs)
These are a type of deep learning models that are
particularly well-suited for image classification tasks. They
consist of multiple layers of interconnected nodes that are
trained to recognize patterns and features in images. CNNs
have been widely used for pneumonia detection and have
achieved good results in a number of studies.
We Build a separate generator for valid and test sets. We
cannot use the same generator for the previously trained
data because it normalizes each image per batch, meaning
that it uses batch statistics. We should not be able to do
batch tests and validations of data, because in the real-life
scenario we don't process input images in a batch as it is
not possible. We will have the advantage of knowing the
average per batch of test data. That is why we need to do
is to normalize input test data using the statistics
functions from the training dataset.
4.2 DenseNet
DenseNet is a type of convolutional neural network (CNN)
that has been used for various image classification tasks,
including pneumonia detection. It was introduced in a
paper published in the journal Computer Vision and
Pattern Recognition in 2017. One of the key features of
DenseNet is that it uses dense connectivity, which means
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 59
that each layer in the network is connected to all of the
preceding layers. This allows the network to learn more
efficiently and reduces the risk of overfitting. There have
been a number of studies that have used DenseNet for
pneumonia detection using chest X-ray images. For
example, a study published in the journal Biomedical
Signal Processing and Control in 2019 used DenseNet to
classify chest X-ray images as normal or pneumonia.
Overall, DenseNet has shown good performance for
pneumonia detection using chest X-ray images and may be
a promising approach for this task. However, it is
important to carefully evaluate the performance of
different models and choose the one that is most suitable
for a particular dataset and task.
4.3 VGG-16
VGG-16 is a type of convolutional neural network (CNN)
that was introduced in a paper published in the journal
Computer Science in 2014. It was developed by the Visual
Geometry Group at the University of Oxford and has been
widely used for various image classification tasks,
including pneumonia detection. One of the key features of
VGG-16 is its use of small, 3x3 convolutional filters, which
allows it to capture fine-grained details in images. It also
uses a large number of layers, which allows it to learn
complex patterns and features in the data. There have
been a number of studies that have used VGG-16 for
pneumonia detection using chest X-ray images. For
example, a study published in the journal Biomedical
Signal Processing and Control in 2018 used VGG-16 to
classify chest X-ray images as normal or pneumonia
affected. Overall, VGG-16 has shown good performance for
pneumonia detection using chest X-ray images and may be
a promising approach for this task. However, it is
important to carefully evaluate the performance of
different models and choose the one that is most suitable
for a particular dataset and task.
4.4 ResNet
ResNet is a type of convolutional neural network (CNN)
that has been used for various image classification tasks,
including pneumonia detection. It was introduced in a
paper published in the journal Computer Vision and
Pattern Recognition in 2015. One of the key features of
ResNet is its use of residual connections, which allow the
network to learn more efficiently and reduce the risk of
overfitting. It also has a very deep architecture, with over
50 layers, which allows it to learn complex patterns and
features in the data. Overall, ResNet has shown good
performance for pneumonia detection using chest X-ray
images and may be a promising approach for this task.
However, it is important to carefully evaluate the
performance of different models and choose the one that
is most suitable for a particular dataset and task.
4.5 Inception Net
InceptionNet is a type of convolutional neural network
(CNN) that has been used for various image classification
tasks, including pneumonia detection. It was introduced in
a paper published in the journal Computer Vision and
Pattern Recognition in 2014. One of the key features of
InceptionNet is its use of inception modules, which allow
the network to learn multiple scales and sizes of features
in the data. It also has a relatively shallow architecture
compared to some other CNNs, which makes it more
efficient and easier to train. Overall, InceptionNet has
shown good performance for pneumonia detection using
chest X-ray images and may be a promising approach for
this task. However, it is important to carefully evaluate the
performance of different models and choose the one that
is most suitable for a particular dataset and task.
5. EVALUATION METRICS
There are several evaluation metrics that can be used to
assess the performance of a model for pneumonia
detection. True positive and true negative are terms used
to describe the performance of a classifier in a binary
classification task. True positives (TP) are instances where
the classifier correctly predicts the positive class. True
negatives (TN) are instances where the classifier correctly
predicts the negative class. False positives (FP) are
instances where the classifier predicts the positive class
but the instance is actually negative. False negatives (FN)
are instances where the classifier predicts the negative
class but the instance is actually positive. Some common
metrics include:
1. Accuracy: This is the percentage of images that are
correctly classified by the model. It is calculated by
dividing the number of correct predictions by the total
number of predictions.
Accuracy = (True Positives + True Negatives) / Total
Predictions
2. Precision: This is the percentage of predicted positive
cases (i.e., cases where the model predicts
pneumonia) that are actually positive. It is calculated
by dividing the number of true positive predictions by
the total number of positive predictions.
Precision = True Positives / (True Positives + False
Positives)
3. Recall: This is the percentage of actual positive cases
(i.e., cases where the patient has pneumonia) that are
correctly predicted by the model. It is calculated by
dividing the number of true positive predictions by
the total number of actual positive cases.
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 60
Recall = True Positives / (True Positives + False
Negatives)
4. F1 score: This is the harmonic mean of precision and
recall. It is calculated by taking the average of the
precision and recall, with higher weights given to
lower values.
Fig-3: CNN Evaluation Metrics
Fig-4: CNN_2 Evaluation Metrics
Fig-5: DenseNet Evaluation Metrics
6. RESULT AND ANALYSIS
In this section, we attempt to analyze the classification
using metrics such as accuracy and loss. There have been
numerous studies that have analyzed the use of machine
learning for pneumonia detection. Overall, the results of
these studies have been promising, with machine learning
models demonstrating high accuracy in identifying
pneumonia from medical images. We try to put Training
and Validation Accuracy into a graph representation using
accuracy on the y-axis and epochs on the x-axis. The
results came out to be as following for the different
models:
Fig-6: CNN model
Fig-7: CNN_2 model
Fig-8: DenseNet model
Fig-9: VGG-16 model
Fig-10: ResNet model
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056
Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072
© 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 61
Fig-11: InceptionNet model
7. Comparisons of Different Models
In this section, we try to compare the different
preprocessed models based on their performance such as
accuracy and loss. Ultimately, the best model for
pneumonia detection will depend on the specific
characteristics of the dataset and the desired performance.
It may be necessary to try several different models in
order to find the one that works best. We are comparing
the different models on testing and training accuracy. The
accuracies came out to be as following:
Fig-12: Mean Average Error of all models tested
Fig-13: Accuracy of all models tested (in %)
8. Conclusions
We have proposed various models that detect pneumonia
from chest x-ray images. We have made this model from
scratch and all the models are purely based on transfer
learning and CNN models. However, there are also some
limitations to consider when using CNNs for pneumonia
detection. One potential issue is the need for a large
amount of annotated data to train the model, which can be
time-consuming and expensive to collect. In the future,
further research is needed to better understand the
strengths and limitations of CNNs for pneumonia
detection and to identify the most effective approaches for
different types of datasets. This work can be extended for
the classification and detection of the dataset of
Dicom(.dcm) images. This would be our next approach to
increase the accuracy using Dicom images.
9. Acknowledgement
We would like to acknowledge the contribution of the
following people without whose help and guidance this
research would not have been completed. We
acknowledge and counsel and support of faculty from
Maharaja Agrasen Institute of Technology for providing us
a platform to research on the topic “Pneumonia Detection
using CNN” and also would to thank our HOD Dr. Namita
Gupta for giving us the opportunities and time to conduct
and research on our topic. This acknowledgment will
remain incomplete if we fail to express our deep sense of
obligation to our guide Asst. Prof. Sudha Narang (CSE
Department). We are indeed fortunate and proud to be
supervised by them during our research, which would
have seemed difficult without their motivation, constant
support, and valuable suggestion. We shall ever remain in
debt of our parents and friends for their support and
encouragement during the research. It would’ve been
impossible without their cooperation and support.
REFERENCES
[1] Kaggle Dataset accessed on 10 October 2022:
https://www.kaggle.com/datasets/paultimothymooney/c
hest-xray-pneumonia
[2] Alom MZ, Hasan M, Islam MT, et al. Automatic
pneumonia detection from chest X-ray images using a
deep convolutional neural network. In 2018 International
Conference on Informatics, Electronics and Vision (ICIEV)
(pp. 1-6). IEEE, 2018
[3] Han B, Kim Y, Kim H, Lee S. A deep learning-based
approach for detecting pneumonia from chest X-rays.
Computers in Biology and Medicine, 98: 58-64, 2018.
[4] Tulabandhula S, Mehta K, Elgendy IY, et al. Deep
learning-based automated detection of pneumonia from
chest radiographs. Journal of Medical Systems, 43(2): 31,
2019.
[5] Li Q, Zhang L, Chen M, et al. Automated detection of
pneumonia in chest X-ray images using a deep learning
model. Radiology, 291(3): 673-681, 2019.

More Related Content

Similar to Pneumonia Detection Using Deep Learning and Transfer Learning (20)

PPTX
MACHINE LEARNING MODEL FOR PNEUMONIA DETECTION FROM CHEST.pptx
padamsravan8
 
PDF
Using Deep Learning and Transfer Learning for Pneumonia Detection
IRJET Journal
 
PDF
Study and Analysis of Different CNN Architectures by Detecting Covid- 19 and ...
IRJET Journal
 
PPTX
web developing proposal for VHMS &ERP.pptx
MahmudHasan191288
 
PDF
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
PDF
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
PDF
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
PDF
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
PPTX
Pneumonia jjjjjjjjjjjjjjjjjjjjjjdetectionkkkkkkkkkk.pptx
KumarAnshuman19
 
PDF
Application for Diagnosis of Detection of Pneumonia Disease for Rural Context
ijtsrd
 
PDF
Pneumonia prediction on chest x-ray images using deep learning approach
IAESIJAI
 
PDF
Pneumonia Classification using Transfer Learning
Tushar Dalvi
 
PDF
Enhancing Pneumonia Detection: A Comparative Study of CNN, DenseNet201, and V...
IRJET Journal
 
PPTX
Chest X-ray Pneumonia Classification with Deep Learning
BaoTramDuong2
 
PDF
Deep Learning-based Diagnosis of Pneumonia using X-Ray Scans
IRJET Journal
 
PDF
TARGET DETECTION AND CLASSIFICATION PERFORMANCE ENHANCEMENT USING SUPERRESOLU...
sipij
 
PDF
THE X-RAY EUCLIDEAN SYNTHETIC IMAGE.....
sipij
 
PPTX
lung disease detection using deep learning
vickygowda577
 
PDF
AI-Powered Detection of COVID-19 and Pneumonia: A Machine Learning Approach
IgMin Publications Inc.
 
PDF
X-Ray Disease Identifier
IRJET Journal
 
MACHINE LEARNING MODEL FOR PNEUMONIA DETECTION FROM CHEST.pptx
padamsravan8
 
Using Deep Learning and Transfer Learning for Pneumonia Detection
IRJET Journal
 
Study and Analysis of Different CNN Architectures by Detecting Covid- 19 and ...
IRJET Journal
 
web developing proposal for VHMS &ERP.pptx
MahmudHasan191288
 
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
AN INVESTIGATION INTO DETECTING PNEUMONIA THROUGH IMAGE PROCESSING AND OBJECT...
ijait
 
Pneumonia jjjjjjjjjjjjjjjjjjjjjjdetectionkkkkkkkkkk.pptx
KumarAnshuman19
 
Application for Diagnosis of Detection of Pneumonia Disease for Rural Context
ijtsrd
 
Pneumonia prediction on chest x-ray images using deep learning approach
IAESIJAI
 
Pneumonia Classification using Transfer Learning
Tushar Dalvi
 
Enhancing Pneumonia Detection: A Comparative Study of CNN, DenseNet201, and V...
IRJET Journal
 
Chest X-ray Pneumonia Classification with Deep Learning
BaoTramDuong2
 
Deep Learning-based Diagnosis of Pneumonia using X-Ray Scans
IRJET Journal
 
TARGET DETECTION AND CLASSIFICATION PERFORMANCE ENHANCEMENT USING SUPERRESOLU...
sipij
 
THE X-RAY EUCLIDEAN SYNTHETIC IMAGE.....
sipij
 
lung disease detection using deep learning
vickygowda577
 
AI-Powered Detection of COVID-19 and Pneumonia: A Machine Learning Approach
IgMin Publications Inc.
 
X-Ray Disease Identifier
IRJET Journal
 

More from IRJET Journal (20)

PDF
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
IRJET Journal
 
PDF
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
IRJET Journal
 
PDF
Kiona – A Smart Society Automation Project
IRJET Journal
 
PDF
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
IRJET Journal
 
PDF
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
IRJET Journal
 
PDF
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
IRJET Journal
 
PDF
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
IRJET Journal
 
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
PDF
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
IRJET Journal
 
PDF
BRAIN TUMOUR DETECTION AND CLASSIFICATION
IRJET Journal
 
PDF
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
IRJET Journal
 
PDF
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
IRJET Journal
 
PDF
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
IRJET Journal
 
PDF
Breast Cancer Detection using Computer Vision
IRJET Journal
 
PDF
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
PDF
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
PDF
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
IRJET Journal
 
PDF
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
PDF
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
PDF
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Enhanced heart disease prediction using SKNDGR ensemble Machine Learning Model
IRJET Journal
 
Utilizing Biomedical Waste for Sustainable Brick Manufacturing: A Novel Appro...
IRJET Journal
 
Kiona – A Smart Society Automation Project
IRJET Journal
 
DESIGN AND DEVELOPMENT OF BATTERY THERMAL MANAGEMENT SYSTEM USING PHASE CHANG...
IRJET Journal
 
Invest in Innovation: Empowering Ideas through Blockchain Based Crowdfunding
IRJET Journal
 
SPACE WATCH YOUR REAL-TIME SPACE INFORMATION HUB
IRJET Journal
 
A Review on Influence of Fluid Viscous Damper on The Behaviour of Multi-store...
IRJET Journal
 
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Explainable AI(XAI) using LIME and Disease Detection in Mango Leaf by Transfe...
IRJET Journal
 
BRAIN TUMOUR DETECTION AND CLASSIFICATION
IRJET Journal
 
The Project Manager as an ambassador of the contract. The case of NEC4 ECC co...
IRJET Journal
 
"Enhanced Heat Transfer Performance in Shell and Tube Heat Exchangers: A CFD ...
IRJET Journal
 
Advancements in CFD Analysis of Shell and Tube Heat Exchangers with Nanofluid...
IRJET Journal
 
Breast Cancer Detection using Computer Vision
IRJET Journal
 
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
A Novel System for Recommending Agricultural Crops Using Machine Learning App...
IRJET Journal
 
Auto-Charging E-Vehicle with its battery Management.
IRJET Journal
 
Analysis of high energy charge particle in the Heliosphere
IRJET Journal
 
Wireless Arduino Control via Mobile: Eliminating the Need for a Dedicated Wir...
IRJET Journal
 
Ad

Recently uploaded (20)

PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
PPTX
File Strucutres and Access in Data Structures
mwaslam2303
 
PPTX
drones for disaster prevention response.pptx
NawrasShatnawi1
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PDF
Detailed manufacturing Engineering and technology notes
VIKKYsing
 
PPTX
Smart_Cities_IoT_Integration_Presentation.pptx
YashBhisade1
 
PDF
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
PPTX
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
PPTX
Mining Presentation Underground - Copy.pptx
patallenmoore
 
PDF
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
PDF
Number Theory practice session 25.05.2025.pdf
DrStephenStrange4
 
PPT
Tiles.ppt The purpose of a floor is to provide a level surface capable of sup...
manojaioe
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PDF
1_ISO Certifications by Indian Industrial Standards Organisation.pdf
muhammad2010960
 
PPTX
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
PPT
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PDF
Comparative Analysis of the Use of Iron Ore Concentrate with Different Binder...
msejjournal
 
PPT
Total time management system and it's applications
karunanidhilithesh
 
PDF
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
monopile foundation seminar topic for civil engineering students
Ahina5
 
File Strucutres and Access in Data Structures
mwaslam2303
 
drones for disaster prevention response.pptx
NawrasShatnawi1
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
Detailed manufacturing Engineering and technology notes
VIKKYsing
 
Smart_Cities_IoT_Integration_Presentation.pptx
YashBhisade1
 
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
Mining Presentation Underground - Copy.pptx
patallenmoore
 
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
Number Theory practice session 25.05.2025.pdf
DrStephenStrange4
 
Tiles.ppt The purpose of a floor is to provide a level surface capable of sup...
manojaioe
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
1_ISO Certifications by Indian Industrial Standards Organisation.pdf
muhammad2010960
 
Introduction to Neural Networks and Perceptron Learning Algorithm.pptx
Kayalvizhi A
 
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
Comparative Analysis of the Use of Iron Ore Concentrate with Different Binder...
msejjournal
 
Total time management system and it's applications
karunanidhilithesh
 
Water Design_Manual_2005. KENYA FOR WASTER SUPPLY AND SEWERAGE
DancanNgutuku
 
Ad

Pneumonia Detection Using Deep Learning and Transfer Learning

  • 1. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 57 Pneumonia Detection Using Deep Learning and Transfer Learning Gaurav Kadam1, Aman Tobaria2, Sahil Arya3, Asst. Prof. Sudha Narang(Guide) 4 1Gaurav kadam, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology, Delhi, India 2Aman Tobaria, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology, Delhi, India 3Sahil Arya, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology, Delhi, India 4Professor Sudha Narang, Dept. of Computer Science Engineering, Maharaja Agrasen Institute of Technology, Delhi, India ---------------------------------------------------------------------***--------------------------------------------------------------------- Abstract - Pneumonia is an infection of the lungs that can be caused by bacteria, viruses, and other microorganisms. It is a serious illness that can lead to death, especially in vulnerable populations such as the elderly and those with compromised immune systems. There have been several studies that have used deep learning and machine learning techniques to detect pneumonia from medical images such as chest X-rays or CT scans. These techniques involve training a model on a large dataset of labeled images, where the model learns to recognize patterns and features that are indicative of pneumonia. One example of a study that used deep learning for pneumonia detection was published in the journal Radiology in 2017. In this study, the authors trained a convolutional neural network (CNN) on a dataset of chest X-rays and found that the CNN was able to accurately classify images as normal or pneumonia with an AUC (area under the curve) of 0.97. Another example is a study published in the journal Chest in 2018, which used a machine-learning approach called a random forest classifier to detect pneumonia from chest X-rays. The authors found that their model had an accuracy of 89.6% and an AUC of 0.94. Overall, the use of deep learning and machine learning for pneumonia detection shows promising results and has the potential to improve the accuracy and efficiency of the diagnosis process. Key Words: Machine Learning, Deep Learning, CNN, Transfer Learning, Chest X-Ray Images. 1. INTRODUCTION Pneumonia is a common respiratory infection that can be caused by bacteria, viruses, and other microorganisms. It is a serious illness that can lead to death, especially in vulnerable populations such as the elderly and those with compromised immune systems. Early diagnosis and treatment of pneumonia is important to prevent complications and improve outcomes. Traditionally, pneumonia has been diagnosed using clinical symptoms, physical examination, and imaging tests such as chest X-rays. However, these methods can be subjective and may not always provide accurate results. Deep learning and machine learning techniques offer a potential solution to improve the accuracy and efficiency of pneumonia diagnosis. These techniques involve training a model on a large dataset of labelled images, where the model learns to recognize patterns and features that are indicative of pneumonia. One approach that has been widely used is transfer learning, which involves pre- training a model on a large dataset and then fine-tuning it on a smaller, specific dataset for a particular task. Transfer learning has been applied to pneumonia detection using chest X-rays with promising results. For example, a study published in the journal Radiology in 2017 used a convolutional neural network (CNN) trained on a large dataset of chest X-rays and found that the CNN was able to accurately classify images as normal or pneumonia with an AUC (area under the curve) of 0.97. Overall, the use of deep learning and transfer learning for pneumonia detection using chest X-rays as the dataset shows promise as a way to improve the accuracy and efficiency of diagnosis and has the potential to benefit patients and healthcare systems. 2. DATASET The Lung Infection in Chest X-ray Images (Kaggle) dataset: This dataset contains over 5,863 chest X-ray images, including a large number with pneumonia. It was created as part of a Kaggle competition and has been widely used in research studies. Overall, these datasets provide a diverse range of chest X-ray images that can be used to train and evaluate models for pneumonia detection. The dataset is organized into 3 folders (train, test, val) and contains subfolders for each image category (Pneumonia and Normal). There are 5,863 X-Ray images (JPEG) and 2 categories (Pneumonia and Normal). Chest X-ray images (anterior-posterior) were selected from retrospective cohorts of pediatric patients one to five years old from Guangzhou Women and Children’s Medical Center, Guangzhou. Analysis of chest x-ray images was done on all chest radiographs that were initially screened for quality control by removing all low-quality or unreadable x-ray images. The diagnoses for the images
  • 2. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 58 were then graded by two expert physicians before being cleared for training in the AI system. To check the grading errors, the evaluation set was confirmed by a third expert. Fig-1: Normal CXR Images Fig-2: Pneumonia Affected CXR Images 3. METHODOLOGY The methodology for using machine learning and deep learning techniques to detect and predict pneumonia varies depending on the specific approach and data sources used. Here is a general outline of the steps that may be involved in this process: 1. Data collection: The first step is to collect a dataset of chest X-ray images that include both normal images and images with pneumonia. This dataset may be obtained from a hospital or clinical setting, or it may be obtained from online repositories such as the Kaggle Chest X-ray dataset. 2. Data preprocessing: The next step is to preprocess the data by selecting a subset of the images to use for training and testing the model, and by resizing and cropping the images as needed. It may also be necessary to correct any errors or biases in the data. 3. Feature extraction: In this step, features are extracted from the images that are relevant for pneumonia detection. These features may include patterns and shapes in the lung tissue, abnormalities in the appearance of the heart and blood vessels, and other characteristics that are indicative of pneumonia. 4. Model training: The next step is to train a machine learning or deep learning model on the dataset. This may involve selecting a model architecture, such as a convolutional neural network (CNN) or random forest classifier, and choosing appropriate hyperparameters such as the learning rate and regularization strength. 5. Model evaluation: Once the model is trained, it is important to evaluate its performance on a separate test dataset to assess its accuracy and generalizability. This may involve calculating metrics such as accuracy, precision, recall, and the area under the curve (AUC). 6. Model deployment: If the model performs well, it can be deployed in a clinical setting to assist with a pneumonia diagnosis. This may involve integrating the model into a computer-aided diagnosis system or using it to generate a probability score that can aid decision-making. Overall, the methodology for pneumonia detection using machine learning and deep learning involves a number of steps that require careful consideration and optimization to achieve good performance. 4. MODELS Several types of machine learning and deep learning models have been used for pneumonia detection. We have used the following methods for pneumonia detection: 4.1 Convolutional neural networks (CNNs) These are a type of deep learning models that are particularly well-suited for image classification tasks. They consist of multiple layers of interconnected nodes that are trained to recognize patterns and features in images. CNNs have been widely used for pneumonia detection and have achieved good results in a number of studies. We Build a separate generator for valid and test sets. We cannot use the same generator for the previously trained data because it normalizes each image per batch, meaning that it uses batch statistics. We should not be able to do batch tests and validations of data, because in the real-life scenario we don't process input images in a batch as it is not possible. We will have the advantage of knowing the average per batch of test data. That is why we need to do is to normalize input test data using the statistics functions from the training dataset. 4.2 DenseNet DenseNet is a type of convolutional neural network (CNN) that has been used for various image classification tasks, including pneumonia detection. It was introduced in a paper published in the journal Computer Vision and Pattern Recognition in 2017. One of the key features of DenseNet is that it uses dense connectivity, which means
  • 3. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 59 that each layer in the network is connected to all of the preceding layers. This allows the network to learn more efficiently and reduces the risk of overfitting. There have been a number of studies that have used DenseNet for pneumonia detection using chest X-ray images. For example, a study published in the journal Biomedical Signal Processing and Control in 2019 used DenseNet to classify chest X-ray images as normal or pneumonia. Overall, DenseNet has shown good performance for pneumonia detection using chest X-ray images and may be a promising approach for this task. However, it is important to carefully evaluate the performance of different models and choose the one that is most suitable for a particular dataset and task. 4.3 VGG-16 VGG-16 is a type of convolutional neural network (CNN) that was introduced in a paper published in the journal Computer Science in 2014. It was developed by the Visual Geometry Group at the University of Oxford and has been widely used for various image classification tasks, including pneumonia detection. One of the key features of VGG-16 is its use of small, 3x3 convolutional filters, which allows it to capture fine-grained details in images. It also uses a large number of layers, which allows it to learn complex patterns and features in the data. There have been a number of studies that have used VGG-16 for pneumonia detection using chest X-ray images. For example, a study published in the journal Biomedical Signal Processing and Control in 2018 used VGG-16 to classify chest X-ray images as normal or pneumonia affected. Overall, VGG-16 has shown good performance for pneumonia detection using chest X-ray images and may be a promising approach for this task. However, it is important to carefully evaluate the performance of different models and choose the one that is most suitable for a particular dataset and task. 4.4 ResNet ResNet is a type of convolutional neural network (CNN) that has been used for various image classification tasks, including pneumonia detection. It was introduced in a paper published in the journal Computer Vision and Pattern Recognition in 2015. One of the key features of ResNet is its use of residual connections, which allow the network to learn more efficiently and reduce the risk of overfitting. It also has a very deep architecture, with over 50 layers, which allows it to learn complex patterns and features in the data. Overall, ResNet has shown good performance for pneumonia detection using chest X-ray images and may be a promising approach for this task. However, it is important to carefully evaluate the performance of different models and choose the one that is most suitable for a particular dataset and task. 4.5 Inception Net InceptionNet is a type of convolutional neural network (CNN) that has been used for various image classification tasks, including pneumonia detection. It was introduced in a paper published in the journal Computer Vision and Pattern Recognition in 2014. One of the key features of InceptionNet is its use of inception modules, which allow the network to learn multiple scales and sizes of features in the data. It also has a relatively shallow architecture compared to some other CNNs, which makes it more efficient and easier to train. Overall, InceptionNet has shown good performance for pneumonia detection using chest X-ray images and may be a promising approach for this task. However, it is important to carefully evaluate the performance of different models and choose the one that is most suitable for a particular dataset and task. 5. EVALUATION METRICS There are several evaluation metrics that can be used to assess the performance of a model for pneumonia detection. True positive and true negative are terms used to describe the performance of a classifier in a binary classification task. True positives (TP) are instances where the classifier correctly predicts the positive class. True negatives (TN) are instances where the classifier correctly predicts the negative class. False positives (FP) are instances where the classifier predicts the positive class but the instance is actually negative. False negatives (FN) are instances where the classifier predicts the negative class but the instance is actually positive. Some common metrics include: 1. Accuracy: This is the percentage of images that are correctly classified by the model. It is calculated by dividing the number of correct predictions by the total number of predictions. Accuracy = (True Positives + True Negatives) / Total Predictions 2. Precision: This is the percentage of predicted positive cases (i.e., cases where the model predicts pneumonia) that are actually positive. It is calculated by dividing the number of true positive predictions by the total number of positive predictions. Precision = True Positives / (True Positives + False Positives) 3. Recall: This is the percentage of actual positive cases (i.e., cases where the patient has pneumonia) that are correctly predicted by the model. It is calculated by dividing the number of true positive predictions by the total number of actual positive cases.
  • 4. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 60 Recall = True Positives / (True Positives + False Negatives) 4. F1 score: This is the harmonic mean of precision and recall. It is calculated by taking the average of the precision and recall, with higher weights given to lower values. Fig-3: CNN Evaluation Metrics Fig-4: CNN_2 Evaluation Metrics Fig-5: DenseNet Evaluation Metrics 6. RESULT AND ANALYSIS In this section, we attempt to analyze the classification using metrics such as accuracy and loss. There have been numerous studies that have analyzed the use of machine learning for pneumonia detection. Overall, the results of these studies have been promising, with machine learning models demonstrating high accuracy in identifying pneumonia from medical images. We try to put Training and Validation Accuracy into a graph representation using accuracy on the y-axis and epochs on the x-axis. The results came out to be as following for the different models: Fig-6: CNN model Fig-7: CNN_2 model Fig-8: DenseNet model Fig-9: VGG-16 model Fig-10: ResNet model
  • 5. International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 10 Issue: 01 | Jan 2023 www.irjet.net p-ISSN: 2395-0072 © 2022, IRJET | Impact Factor value: 7.529 | ISO 9001:2008 Certified Journal | Page 61 Fig-11: InceptionNet model 7. Comparisons of Different Models In this section, we try to compare the different preprocessed models based on their performance such as accuracy and loss. Ultimately, the best model for pneumonia detection will depend on the specific characteristics of the dataset and the desired performance. It may be necessary to try several different models in order to find the one that works best. We are comparing the different models on testing and training accuracy. The accuracies came out to be as following: Fig-12: Mean Average Error of all models tested Fig-13: Accuracy of all models tested (in %) 8. Conclusions We have proposed various models that detect pneumonia from chest x-ray images. We have made this model from scratch and all the models are purely based on transfer learning and CNN models. However, there are also some limitations to consider when using CNNs for pneumonia detection. One potential issue is the need for a large amount of annotated data to train the model, which can be time-consuming and expensive to collect. In the future, further research is needed to better understand the strengths and limitations of CNNs for pneumonia detection and to identify the most effective approaches for different types of datasets. This work can be extended for the classification and detection of the dataset of Dicom(.dcm) images. This would be our next approach to increase the accuracy using Dicom images. 9. Acknowledgement We would like to acknowledge the contribution of the following people without whose help and guidance this research would not have been completed. We acknowledge and counsel and support of faculty from Maharaja Agrasen Institute of Technology for providing us a platform to research on the topic “Pneumonia Detection using CNN” and also would to thank our HOD Dr. Namita Gupta for giving us the opportunities and time to conduct and research on our topic. This acknowledgment will remain incomplete if we fail to express our deep sense of obligation to our guide Asst. Prof. Sudha Narang (CSE Department). We are indeed fortunate and proud to be supervised by them during our research, which would have seemed difficult without their motivation, constant support, and valuable suggestion. We shall ever remain in debt of our parents and friends for their support and encouragement during the research. It would’ve been impossible without their cooperation and support. REFERENCES [1] Kaggle Dataset accessed on 10 October 2022: https://www.kaggle.com/datasets/paultimothymooney/c hest-xray-pneumonia [2] Alom MZ, Hasan M, Islam MT, et al. Automatic pneumonia detection from chest X-ray images using a deep convolutional neural network. In 2018 International Conference on Informatics, Electronics and Vision (ICIEV) (pp. 1-6). IEEE, 2018 [3] Han B, Kim Y, Kim H, Lee S. A deep learning-based approach for detecting pneumonia from chest X-rays. Computers in Biology and Medicine, 98: 58-64, 2018. [4] Tulabandhula S, Mehta K, Elgendy IY, et al. Deep learning-based automated detection of pneumonia from chest radiographs. Journal of Medical Systems, 43(2): 31, 2019. [5] Li Q, Zhang L, Chen M, et al. Automated detection of pneumonia in chest X-ray images using a deep learning model. Radiology, 291(3): 673-681, 2019.