1. MACHINE LEARNING MODEL FOR
PNEUMONIA DETECTION FROM
CHEST X-RAY IMAGES
Batch No : 09
P . Sravan Kumar (20RA1A0585)
V . Shiva Charan (20RA1A0578)
V . Sai Shiva (20RA1A0569)
Guided by : Dr . Shankar Ganesh
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
lV YEAR
16-12-2023 Compter science and Enginnering 1
2. INDEX
Abstract
Introduction
Motivation
Literature Survey
Existing System
Drawbacks of Existing System
Proposed System
Advantages
Applications
Software Requirements
Package Requirements
Dataset Description
Conclusion
Future Scope
References
16-12-2023 Compter science and Enginnering 2
3. ABSTRACT
Pneumonia is a serious respiratory infection that can lead to severe
complications if not diagnosed and treated promptly.
Pneumonia is one of the leading infectious diseases. It is the inflammation
caused by the virus and bacteria that microscopically adversely
affect the air sacs.
Approximately 7% of the world's population is affected by pneumonia every
year, and 4 million of the affected patients face fatal risks.
Optimize model parameters with a focus on minimizing false positives and
false negatives.
It can lead to improved patient outcomes, reduced hospital stays, and optimized
resource allocation within healthcare facilities.
16-12-2023 Compter science and Enginnering 3
4. INTRODUCTION
Introduction to pneumonia as a widespread respiratory infection with
significant global impact.
Rapid and accurate diagnosis is pivotal for effective treatment and
improved patient outcomes.
Highlighting the motivation behind the study, driven by the need for more
advanced and objective diagnostic tools in respiratory medicine.
Emphasizing the potential impact of the research in improving accuracy, speed,
and efficiency in pneumonia detection, leading to enhanced patient outcomes.
16-12-2023 Compter science and Enginnering 4
5. MOTIVATATION
Pneumonia poses a significant health challenge globally, with timely
detection being crucial for effective treatment and improved patient
outcomes.
Traditional diagnostic methods may be time-consuming and reliant on
human interpretation, prompting the need for advanced technological
solutions.
Developing an automated, accurate, and accessible tool for pneumonia
detection can have a profound impact on global public health by
facilitating early interventions.
The evolution of machine learning, particularly deep learning, has opened
up new possibilities for image analysis and pattern recognition.
16-12-2023 Compter science and Enginnering 5
6. LITERATURE SURVEY
"Diagnosis of Pneumonia Clouds by Chest X-ray using image processing method"
Abhishekh Sharma, Daniel Raju Publisher: IEEE | Conference Paper | Year: 2020 |
proposed This document introduces the novel's method of detecting the presence
of pneumonia clouds in the chest X-rays (CXR) using image processing methods only.
Traditional techniques are designed to cut and remove the lung region from the
images.
"In-depth Neural Convolutional Neural Networks for Diagnosis of Tuberculosis"
Rahib H. Abiyev and Mohammad Khaleel Sallam Maaitah Year: 2021| Document
Paper | Hindawi, Journal of Health Engineering in Paper, introduced convolutional
neural networks (CNNs) to diagnose asthma. The construction of CNN and its
construction process was introduced.
16-12-2023 Compter science and Enginnering 6
7. "CheXNet: Radiologists-Level Pneumonia on Chest X-Rays on Deep
Learning" Pranav Rajpurkar, Jeremy Irvin, Kaylie Zhu, Brandon Yang,
Hershel Mehta, Tony Duan, Daisy Ding, Aarti Bagul , Robyn L. Year: 2021
| Volume: 2 | Conference Paper | Publisher: IEEE, proposed how to
create a 121-layer CheXNet algorithm layer of neural network trained in
the ChexX-ray14 database.
"Active Pneumothorax Acquisition of Chest X-Ray Imaging Using Local
Binary Pattern and Support Vector Machine", suggested by Yuan-Hao
Chan, Yong-Zhi Zeng, Hsien-Chu Wu, Ming-Chi Wu by Hung-Min Sun In
this paper, Image multiscale with strong texture analysis and
classification is used.
"Recognition and Interpretation of Convolutional Neural Network
Predictions in Detecting Pneumonia in Pediatric Chest Radiographs"
Sivaramakrishnan Rajaraman, Sema Candemir, Incheol Kim, George
Thoma and Sameer Antani
16-12-2023 Compter science and Enginnering 7
8. EXISTING SYSTEM / EXISTING METHOD
CheXpert:
Strengths: CheXpert provides uncertainty estimates along with
predictions, which can be valuable in clinical settings.
RSNA Pneumonia Detection Challenge Winner Models:
Strengths: Winning models often demonstrated high performance on
the RSNA Pneumonia Detection dataset.
COVID-Net:
Strengths: Initially designed for COVID-19 detection, COVID-Net
also addresses pneumonia detection, showcasing adaptability.
16-12-2023 Compter science and Enginnering 8
9. DRAWBACKS OF EXISTING SYSTEM
Complexity: The use of an ensemble of models may increase complexity, making
it harder to deploy and interpret the model in some environments.
Challenges in handling uncertainty: While uncertainty estimates are provided,
handling and integrating uncertainty into clinical workflows can be challenging.
Lack of transparency: Some winning models might lack transparency in their
decision-making processes, making it difficult to understand how they arrive at
specific predictions.
Limited to specific manifestations: COVID-Net may have been optimized for
detecting pneumonia as a manifestation of severe COVID-19, potentially limiting
its performance on pneumonia cases unrelated to COVID-19.
16-12-2023 Compter science and Enginnering 9
10. PROPOSED SYSTEM
Data Preprocessing:
•Data Cleaning: Ensure the chest X-ray dataset is clean, removing
any irrelevant or corrupted images.
•Image Preprocessing: Standardize image sizes, adjust
brightness/contrast, and apply normalization techniques.
Feature Extraction:
•Extract relevant features from chest X-ray images, such as texture,
shape, and intensity features.
•Consider using techniques like histogram equalization to enhance
image features.
Random Forest Model Construction:
•Ensemble Learning: Train multiple decision trees, each on a subset
of the data and features.
•Feature Randomization: Randomly select a subset of features for
each decision tree to increase diversity.
16-12-2023 Compter science and Enginnering 10
12. Timely identification of pneumonia through quick analysis of chest X-ray images.
Automation reduces the time and effort needed for manual interpretation,
streamlining the diagnostic process.
Easily scalable to process a large volume of X-ray images, making it valuable in high
patient load scenarios.
While there may be initial costs, in the long run, it can reduce the need for extensive
manual labor in routine tasks.
Adapts and improves over time as it is exposed to new data and medical knowledge.
Improves healthcare accessibility, particularly in regions with a shortage of skilled
radiologists.
ADVANTAGES
16-12-2023 Compter science and Enginnering 12
13. APPLICATIONS
1. Clinical Diagnosis Support:
Assisting healthcare professionals by providing automated and rapid preliminary assessments
of chest X-ray images, aiding in the early detection of pneumonia.
2. Automated Screening Programs:
Facilitating large-scale pneumonia screening initiatives by automating the initial analysis of
chest X-ray
images, identifying potential cases for further examination.
3.Remote Healthcare Services:
Enabling automated pneumonia detection in remote or underserved areas where access to
skilled
radiologists may be limited, contributing to improved healthcare accessibility.
4.Workflow Optimizationin RadiologyDepartments:
Streamlining radiology workflows by automating routine pneumonia screenings, allowing
radiologists to
focus on more complex cases and reducing the overall turnaround time for reporting.
16-12-2023 Compter science and Enginnering 13
15. # importing libraries
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import os
import warnings
warnings.filterwarnings('ignore')
from skimage.transform import resize
from skimage.io import imread
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from skimage import io, transform
from sklearn import preprocessing
import joblib
import json
PACKAGE REQUIREMENTS
16-12-2023 Compter science and Enginnering 15
16. DATASET DESCRIPTION
Figure 1: Sample images from dataset with normal class
16-12-2023 Compter science and Enginnering 16
17. Figure 2: Sample images of dataset with pneumonia class.
Figure 3: Array data of input images after preprocessing.
Figure 4: Target array data (normal = 0, and pneumonia = 1).
16-12-2023 Compter science and Enginnering 17
18. Figure 5: Sample prediction on test data using proposed ML model.
Figure 6: Classification report of random forest model.
16-12-2023 Compter science and Enginnering 18
19. Figure 7: Obtained confusion matrix with actual
and predicted labels using random forest model.
Figure 8: Classification report of proposed
KNN model.
Figure 9: Confusion matrix of proposed KNN model for
detection and classification of CXR images.
16-12-2023 Compter science and Enginnering 19
20. Model name Accuracy Precision Recall F1-score
Random Forest 0.878 0.88 0.88 0.88
KNN classifier 0.9146 0.92 0.91 0.91
Model name
Random Forest KNN classifier
Normal Pneumonia Normal Pneumonia
Precision 0.93 0.82 0.90 0.94
Recall 0.85 0.91 0.96 0.86
F1-score 0.89 0.86 0.93 0.90
Table 2: Overall performance comparison of proposed ML models
16-12-2023 Compter science and Enginnering 20
21. CONCLUSION
Significantly transforms healthcare diagnostics through efficient and accurate
pneumonia detection from chest X-ray images.
Rapid and accurate diagnosis is pivotal for effective treatment and improved
patient outcomes.
Provides consistent, scalable, and objective analyses, streamlining
diagnostic workflows and optimizing healthcare resources.
Applicable in clinical settings, automated screening programs, emergency room
triage, and remote healthcare services.
16-12-2023 Compter science and Enginnering 21
22. FUTURE SCOPE
Research efforts will likely focus on developing models with higher accuracy and
improved generalization across diverse populations and imaging conditions.
Addressing challenges related to dataset biases and ensuring robust performance
on varied patient demographics will be essential.
Enhancing the interpretability of machine learning models is crucial for gaining
trust from healthcare professionals. Future models may incorporate explainability
techniques, providing clear insights into how decisions are made.
Developing models capable of real-time or near-real-time pneumonia detection is
essential for improving patient outcomes.
the models could be integrated into healthcare systems to enable quick and
automated analysis of chest X-rays.
16-12-2023 Compter science and Enginnering 22
23. REFERENCES
Rauf H., Lali M., Khan M., Kadry S., Alolaiyan H., Razaq A., et al. Time series
forecasting of COVID-19 transmission in Asia Pacific countries using deep neural
networks. Personal And Ubiquitous Computing. pp. 1–18 (2021) pmid:33456433
.Lal S., Rehman S., Shah J., Meraj T., Rauf H., Damaševičius R., et al. Adversarial
Attack and Defence through Adversarial Training and Feature Fusion for Diabetic
Retinopathy Recognition. Sensors. 21, 3922 (2021) pmid:34200216
Albahli S., Rauf H., Algosaibi A. & Balas V. AI-driven deep CNN approach for multi-
label pathology classification using chest X-Rays. PeerJ Computer Science. 7 pp.
e495 (2021) pmid:33977135
16-12-2023 Compter science and Enginnering 23