Pneumonia Detection Using Deep Learning
Sreevarshini Aireddy, Maruthi Sanjana, Palle Uday Kiran Goud, Mattipatti Sameer,
Myla Kalyana Ramakrishna and D. Archana
Nalla Malla Reddy Engineering College, Hyderabad, Telangana, India
Keywords: Pneumonia, Deep Learning, Convolutional Neural Networks (CNNs), VGG16, Chest X‑Ray, Web‑Based
Interface.
Abstract: Pneumonia is a serious lung infection that mainly affects children and the elderly people which requires rapid
and accurate diagnosis. There are simple and effective methods for pneumonia detection, including the deep
learning techniques, such as the convolutional neural network (CNN). As of now, such techniques have
proved potential for medical image classification. In this paper, we present a pneumonia detection model built
using the VGG16 pre-trained model of convolutional neural network architecture and trained on a labeled
dataset of the chest X-ray images. The proposed system implementation is evaluated for its performance and
also compared with the traditional methods, which show the significantly improved accuracy. This paper
mostly exhibits the potential of transfer learning and using data augmentation to improve model
generalization. This model was trained and tested on a chest X-ray image of a labeled dataset, obtaining the
accuracy of around 93%. This system is deployed with a local web-based interface, which allowed the users
to upload chest X-ray images for the real-time classification. The results show that deep learning can
significantly improve the pneumonia detection, providing a more efficient, accurate, and automated
alternative to existing diagnostic techniques.
1 INTRODUCTION
Pneumonia is an inflammatory infection of the lung
and a respiratory disease caused by bacterial, viral, or
fungal agents that affects millions of people worldwide
and has a major impact on the healthcare challenges
and mortality. Traditionally chest X-ray interpretations
are implemented by human radiologists which is time-
consuming, prone to human error, and highly
dependent on their experience. In case of any
misdiagnosis or delayed diagnosis, it may result in
serious complications, so making accurate detection
and early diagnosis is crucial.
In recent years, artificial intelligence (AI) and
deep learning have developed towards automated
diagnostic systems for medical image classification.
Convolutional Neural Networks (CNNs) have
exhibited strong performance in complex patterns in
images and obtaining high accuracy in classification
tasks. Transfer learning, which utilizes pre-trained
models of CNN on large the datasets, has been
particularly effective in medical image analysis.
Traditional methods for pneumonia detection, such as
manual interpretation of the chest X-ray images, tend
to be highly subjective as they require significant
medical experience. Other machine learning methods
such as support vector machines (SVMs) and logistic
regression have been explored variously in the past
but generally require extensive feature engineering
and have less effectiveness compared with the
complex imaging data. Other deep learning models,
such as ResNet and Inception, have also been utilized
for medical imaging, however, VGG16 particularly
has simple architecture model and is highly effective
for feature extraction. We use VGG16 to enhance
pneumonia detection accuracy while minimizing the
computational complexity.
This research mainly utilized the VGG16 model
of CNN architecture for pneumonia detection in chest
X-ray images. VGG16 is a pre-trained model which
is used in the process of feature extraction, was
performed after the additional custom layers for
classification. This model was trained on a labeled
dataset containing the chest X-ray images of normal
and pneumonia-affected to develop an automated
detection system. This research evaluates the model's
performance, helping to reduce the pressure on
radiologists and improving patient outcomes and
Aireddy, S., Sanjana, M., Goud, P. U. K., Sameer, M., Ramakrishna, M. K. and Archana, D.
Pneumonia Detection Using Deep Learning.
DOI: 10.5220/0013908400004919
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 1st International Conference on Research and Development in Information, Communication, and Computing Technologies (ICRDICCT‘25 2025) - Volume 4, pages
75-80
ISBN: 978-989-758-777-1
Proceedings Copyright © 2026 by SCITEPRESS Science and Technology Publications, Lda.
75
aims to automate the efficient pneumonia diagnosis
process.
2 LITERATURE REVIEW
In recent years, a number of research studies have
explored deep learning for the pneumonia detection.
Rohit Kundu, Ritacheta Das et al. (2021) proposed an
ensemble based deep learning methodology for
pneumonia detection in Chest radiographs. In this the
methodology is included of three CNN architectures
namely GoogLeNet, ResNet-18, and DenseNet-121
with a weighted average of ensemble methodology
using the precision, recall, F1-score, and AUC. This
study evaluated the algorithm using the two publicly
available datasets of pneumonia with an accuracy of
98.81% and 86.85% and also a sensitivity value of
98.80% and 87.02%. The proposed method also
exceeded the state-of-the art (SOA) methods and this
method performs better than the other ensembled
techniques. Tawsifur Rahman et al. (2020) analyzed
and used four pre-trained CNNs - AlexNet,
ResNet18, DenseNet201, and SqueezeNet. They are
categorized to identify subtypes of pneumonia
(normal vs. pneumonia, bacterial vs. viral, three-class
classification also) using transfer learning to classify
chest X-ray images. The dataset comprised of 5,247
X-rays and the methods reached the classification
accuracy of 98%, 95% and 93.3% respectively. The
study also supports using AI potentially to assist with
the rapid pneumonia diagnosis and screening.
Ayush Pant, Akshat Jain et al. (2020) by
considering the higher mortality rate of pneumonia,
this paper presented an automated deep learning
approach for the early diagnosis of pneumonia
detection by utilizing CNNs. The authors tried to
combine two CNN architectures with an ensemble
model to be allowed for the improvement of issues
with the existing methods. This study provides the
improved model with robustness and performance in
which it is to develop a diagnostic tool for the health
care professionals efficiently. Faiza M Qaimkhani,
Md G Hussain et al. (2022) studied the mostly applied
deep learning methods, which are specifically ANN,
CNN, and also the VGG19 architecture, which helps
to improve pneumonia identification accuracy
efficiently. The study focuses mainly on the early
identification, and special emphasis on the cases that
occur mostly in the children, although their aim is to
provide and serve a reliable, helpful automated
system as an aid to healthcare to mainly identify the
pneumonia cases rapidly for early treatment. Shagun
Sharma, Kalpna Guleria (2023) created a pneumonia
detection model that is mostly based on the deep
learning techniques by using the VGG-16
architecture. There is a various feature extraction
from the chest X-ray images, which are then
classified for pneumonia detection. This study aims
to support the healthcare professionals by early
diagnosis and precision of pneumonia, by improving
the health resource efficiency, and also overall
outcomes of the patient. These results show that deep
learning is a possible method for identification of
pneumonia, but, there is still a need for models that
balance the high accuracy with computational
efficiency for real-time applications.
3 METHODOLOGY
3.1 Methods
Convolutional Neural Networks: Convolutional
neural networks (CNNs), are fundamental
components of deep learning-based image
classification, including pneumonia detection in chest
X-rays. Analysis of medical imaging greatly benefits
from CNNs' ability to automatically extract
hierarchical features from input images. The
architecture is formed of different types of layers,
which include pooling layers, convolutional layers,
activation functions, and fully linked layers. The
convolutional layers use learnable filters to identify
key characteristics like edges, textures, and patterns
at various levels of abstraction. Activation functions
like ReLU (Rectified Linear Unit) introduce non-
linearity which enables the model to recognize the
complex patterns in medical imaging. Pooling layers,
such as max pooling, enhance computational
efficiency while maintaining essential information by
reducing the spatial dimensions of feature maps.
Once these features are extracted and then processed
through the fully connected layers, the model
classifies the image as either ‘Normal’ or
‘Pneumonia’. As CNNs can learn spatial structures
and identify the complex patterns which human
radiologists might miss, they perform better in
medical imaging than the traditional machine
learning techniques. The automatic feature
extraction, which reduces the need for manual feature
engineering, makes CNNs a resilient and effective
method for pneumonia detection in chest X-ray
analysis.
Pre-trained Model VGG16: The most commonly
used convolutional neural network (CNN)
architecture VGG16 was pre-trained model used on
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
76
the large ImageNet dataset, which includes datasets
of having millions of images in hundreds of
categories of images. VGG16 is very successful in
transfer learning in the field of medical image
analysis, because of its ability to learn rich feature
representations through pre-training models,
including the pneumonia detection. There are 16
layers that form the architecture, which includes
convolutional layers, pooling layers, and fully
connected layers. Convolutional layers mainly use
tiny 3x3 receptive fields to collect the hidden
information in photos. Instead of beginning from
scratch, we usually take the advantage of VGG16's
capacity to extract high-level spatial features and
textural information from the chest X-ray images by
utilizing it as a basis model. On top of the pre-trained
model convolutional layers, more custom layers like
the dense and dropout layers are added to improve the
model for binary classification which maintains the
important hierarchial features. This method in general
significantly decreases the training time and improves
the model accuracy because VGG16 is already pre-
trained on the broad features of images that can be
optimized for pneumonia detection. Additionally, by
freezing initial layers and training on the top layers of
the pneumonia specified data. We ensure the better
model generalization which reduce the risk of
overfitting, and improve the model's ability to detect
pneumonia in real chest X-ray images.
Model Enhancement Techniques: The pneumonia
detection model is optimized with various
preprocessing, classification, and optimization
strategies to improve its performance and
generalization. Data augmentation methods such as
rescaling, flipping and rotation are mostly utilized in
image preprocessing to introduce variations in the
training data, avoid overfitting, and enhance model
robustness. These modifications optimize the model's
ability to generalize to unseen chest X-ray images.
This model was developed for binary classification,
to classify chest X-ray images as eitherNormal or
‘Pneumonia’, where it applies a sigmoid activation
function in the output layer, and to optimize strategies
which include learning rate scheduling, dropout
layers and the Adam optimizer are used to achieve
even better performance. When validation loss
gradually decreases then the learning rate
management supports stable convergence by
lowering the rate, at the same time the Adam
optimizer automatically optimizes learning rates for
improved training performance. To prevent
overfitting and improve generalization, dropout
layers acts as a regularization method by randomly
disabling neurons while training. The combination of
these methods results with high accuracy and
effective model of deep learning for pneumonia
detection.
Figure 1 shows the Normal chest X-ray and
Figure 2 shows the Pneumonia chest X-ray
respectively.
Figure 1: Normal chest X-Ray.
Figure 2: Pneumonia chest X-Ray.
3.2 Working
The methodical process of the pneumonia detection
system begins with the dataset preparation, which
utilizing a labeled dataset of chest X-ray images. The
three subsets of the dataset are the training set,
validation set, and test sets. The test set provides an
accurate and fair evaluation of the model’s
performance, the validation set supports
hyperparameter optimization and performance
tracking, and the training set is used to train the
model. This prevents overfitting and provides an
effective training process. In the next stage, VGG16
is utilized as the fundamental model to develop the
architecture of the model. The custom dense layers
with ReLU activation are added to VGG16, a pre-
trained model of CNN because to improve non-
linearity and learning capacity and also dropout layers
are employed to improve model generalization by
reducing the risk of overfitting through the random
deactivation of neurons during the training period.
The final output layer predicts the chest X-ray image
which shows whether it is ‘Normal’ or ‘Pneumonia’
for binary classification by using the sigmoid
activation function. This model is been trained using
the augmented data of the image, that goes through
Pneumonia Detection Using Deep Learning
77
stability-improving changes such as rescaling,
flipping and rotation. By using the Adam optimizer,
the learning rates are continuously adjusted to
optimize the convergence speed. The early stopping
process is used to prevent overfitting and unwanted
computation by finishing the training process when
validation loss stabilizes. The continuous learning is
maintained by assessing the training process using
accuracy metrics and loss curves. Once the training
process is completed then the evaluation phase
utilizes a various metrics to evaluate the model's
performance, including accuracy, precision, recall,
and F1-score, which evaluates the model’s
effectiveness in data classification on the test dataset.
Additionally, the prediction accuracy is analyzed by
evaluating true positives, false positives, true
negatives, and false negatives using a confusion
matrix. During the deployment phase, the trained
model is integrated into a Flask-based web interface,
providing a real-time communication. The web-based
application enables users to upload the chest X-ray
images, which are then processed by the model to
predict the condition of pneumonia. This interface
provides an efficient automated diagnostic system
that helps healthcare professionals by making faster
and more accurate decisions.
4 RESULT AND ANALYSIS
Figure 3: Training & validation loss graph.
The graph in figure 3 shows the training and
validation loss during the training period. The blue
line which is represented as training loss gradually
decreases, showing that the model improves and
processes more data. The orange line which
represented as validation loss fluctuates in the
beginning but afterward, it becomes steady at a low
value. This shows that the model generalizes well to
new data. The early fluctuations in validation loss
indicate slight uncertainty, but there are no major
signs of overfitting. The consistently stable
downward trend confirms an effective learning.
Figure 4: Training & validation accuracy graph.
The graph in figure 4 which mentioned above
signifies the training and validation accuracy. The
training accuracy line increases easily and attains a
high value above 95%. On the other hand, the
validation accuracy line fluctuates in the beginning
before reaching close to 100%. These fluctuations
imply that the model in the early stages had difficulty
with validation data but eventually adjusted well. For
both the training and new data the final accuracy
levels indicate that the model is providing accurate
predictions, pointing to have a good generalization.
Figure 5: Confusion matrix.
The image in figure 5 shown above is the confusion
matrix, which helps us to understand that how
accurately the model classifies the chest X-ray
images. Among all the normal cases, 199 were
correctly detected, yet 35 cases were misclassified as
pneumonia. In the case of pneumonia, the model
correctly recognized 383, but 7 wrongly identified as
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
78
normal. The least number of false negatives, the 7
cases only is highly important because this indicates
that the model almost never misses actual pneumonia
cases, which is important for real-world medical
applications. On the other hand, the false positives
which are 35 cases that are higher, this is actually
better because it reduces the chance of missing
pneumonia cases.
Figure 6: Classification report & prediction result.
The above figure 6 is a classification report of the
pneumonia detection model that highlights the
model’s effective performance.
The precision for the normal cases is 0.97,
which means the 97% of predicted normal cases
are exactly normal.
The recall for the normal cases is 0.85, which
means the 85% of actual normal cases were
correctly identified.
The precision for the pneumonia cases is 0.92,
and recall is 0.98, showing that the model
identifies pneumonia cases in a very effective
way.
The model achieves an overall accuracy of 93%,
indicating high model performance.
The macro and weighted averages of precision,
recall, and F1-score are approximately 0.93,
verifying equal performance for both classes.
At the bottom of the classification report, the note
‘Model saved successfully!’ shows that the trained
model has been saved and can be used later in future.
The last part that is the prediction output which says
the ‘Person is safe’ shows that the uploaded image of
chest X-ray was correctly classified as normal, with
the prediction value [[0.]] likely falls into the normal
category in the model’s processing system.
Figure 7: Web interface for pneumonia detection.
This above-mentioned figure 7 is a Flask-based web
interface which is simple and user-friendly to enable
users to upload the chest X-ray images for pneumonia
detection. This interface is running on local host
(127.0.0.1:5000) on your computer, this makes that it
is only accessible from your own machine during
testing locally. By uploading an image through the
file upload button, and then pressing the ‘Predict’
button, users can have the model identify whether it
is normal or pneumonia. After the prediction, the
application will provide a result such as ‘Person is
safe’ or ‘Person is has Pneumonia’, ensuring the
output is clear and easy to understand. This
deployment is an easy access to users, allowing
anyone to test the chest X-ray images easily without
having the direct interaction with the code, making it
an effective tool for quick and real-time diagnosis.
5 CONCLUSIONS
This research used CNN and VGG16 to build a deep
learning model for pneumonia detection system. This
model achieved high accuracy in classifying the chest
X-ray images, demonstrating the capability of deep
learning in the field of medical diagnosis. A web-
based interface developed to make the system utilized
in real-time experience, providing a faster and
effective automatic diagnostic system. The future
enhancements may include using an extensive dataset
for higher accuracy and faster model performance. In
summary, this study highlights AI-driven systems
that supports in medical field assisting doctors in
treating and detecting pneumonia at early stage.
REFERENCES
Asnake, Nigus Wereta, Ayodeji Olalekan Salau, and Aleka
Melese Ayalew. "X-ray image-based pneumonia
detection and classification using deep
learning." Multimedia Tools and Applications 83.21
(2024): 60789-60807.
Ayan, Enes, and Halil Murat Ünver. "Diagnosis of
pneumonia from chest X-ray images using deep
learning." 2019 Scientific meeting on electrical-
electronics & biomedical engineering and computer
science (EBBT). Ieee, 2019.
Barhoom, Alaa MA, and Samy S. Abu-Naser. "Diagnosis
of pneumonia using deep learning." (2022).
Gabruseva, Tatiana, Dmytro Poplavskiy, and Alexandr
Kalinin. "Deep learning for automatic pneumonia
detection." Proceedings of the IEEE/CVF conference
on computer vision and pattern recognition workshops.
2020.
Pneumonia Detection Using Deep Learning
79
Goyal, Shimpy, and Rajiv Singh. "Detection and
classification of lung diseases for pneumonia and
Covid-19 using machine and deep learning
techniques." Journal of Ambient Intelligence and
Humanized Computing 14.4 (2023): 3239-3259.
Jain, Deepak Kumar, et al. "Deep Learning‐Aided
Automated Pneumonia Detection and Classification
Using CXR Scans." Computational intelligence and
neuroscience 2022.1 (2022): 7474304.
Kundu, Rohit, et al. "Pneumonia detection in chest X-ray
images using an ensemble of deep learning
models." PloS one 16.9 (2021): e0256630.
Li, Shaojie, Yuhong Mo, and Zhenglin Li. "Automated
pneumonia detection in chest x-ray images using deep
learning model." Innovations in Applied Engineering
and Technology (2022): 1-6.
Manickam, Adhiyaman, et al. "Automated pneumonia
detection on chest X-ray images: A deep learning
approach with different optimizers and transfer learning
architectures." Measurement 184 (2021): 109953.
Pant, Ayush, et al. "Pneumonia detection: An efficient
approach using deep learning." 2020 11th International
Conference on Computing, Communication and
Networking Technologies (ICCCNT). IEEE, 2020.
Saul, Can Jozef, Deniz Yagmur Urey, and Can Doruk
Taktakoglu. "Early diagnosis of pneumonia with deep
learning." arXiv preprint arXiv:1904.00937 (2019).
Sharma, Shagun, and Kalpna Guleria. "A deep learning
based model for the detection of pneumonia from chest
X-ray images using VGG-16 and neural
networks." Procedia Computer Science 218 (2023):
357-366.
Singh, Swapnil. "Pneumonia detection using deep
learning." 2021 4th Biennial International Conference
on Nascent Technologies in Engineering (ICNTE).
IEEE, 2021.
Tilve, Ashitosh, et al. "Pneumonia detection using deep
learning approaches." 2020 international conference on
emerging trends in information technology and
engineering (ic-ETITE). IEEE, 2020.
Yaseliani, Mohammad, et al. "Pneumonia detection
proposing a hybrid deep convolutional neural network
based on two parallel visual geometry group
architectures and machine learning classifiers." IEEE
access 10 (2022): 62110-62128.
ICRDICCT‘25 2025 - INTERNATIONAL CONFERENCE ON RESEARCH AND DEVELOPMENT IN INFORMATION,
COMMUNICATION, AND COMPUTING TECHNOLOGIES
80