Professional Documents
Culture Documents
IN PYTHON
A Project Report
Submitted By
Pooja N. Ahire
Prajakta V. Joshi
Saylee R. Khotre
Swapnil S. Raut
In Partial Fulfillment
Bachelor Of Engineering
(Electronics& Telecommunication)
2020-21
SANDIP FOUNDATION SANDIP INSTITUTE OF ENGINEERING &
MANAGEMENT, NASHIK(MH) 2020-21
CERTIFICATE
This is to certify that, the project
“PNEUMONIA DETECTION BY USING CNN WITH IMPLEMENTATION IN PYTHON”
Submitted by
Pooja N. Ahire (SEAT NO: -B150833001)
Prajakta V. Joshi (SEAT NO: - B150833020)
Saylee R. Khotre (SEAT NO: -B150833026)
Swapnil S. Raut (SEAT NO: -B150833052)
is a bonafied work completed under my supervision and guidance in partial fulfillment for award
of Bachelor of Engineering (Electronics & Telecommunication) Degree of University of Pune
(MS, INDIA).
Place: Nashik
Date:
Prof.(Dr.) D. P. Patil
(Principal)
I sincerely thanks to Prof. (Dr.) D. P. Patil Principal, Sandip Institute of Engineering and
Management, Nashik, for his advice and support during the course of my work.
Pooja N. Ahire
Prajakta V. Joshi
Saylee R. Khotre
Swapnil S. Raut
SIEM, NASHIK
ABSTRACT
Pneumonia is a high mortality disease that kills 50, 000 people in the United States
each year. Children under the age of 5 and older population over the age of 65 are
susceptible to serious cases of pneumonia. The United States spend billions of
dollars fighting pneumonia-related infections every year. Early detection and
intervention are crucial in treating pneumonia related infections. People with
infectious pneumonia often have a productive cough, fever accompanied by
shaking chills, shortness of breath, sharp or stabbing chest pain during deep
breaths, andan increased rate of breathing. In elderly people, confusion may be the
most prominent sign. The typical signs and symptoms in children under five are
fever, cough, and fast or difficult breathing. Fever is not very specific, as it occurs
in many other common illnesses and may be absent in those with severe disease,
malnutrition or in the elderly. In addition, a cough is frequently absent in children
less than 2 months old. More severe signs and symptoms in children may include
blue-tinged skin, unwillingness to drink, convulsions, ongoing vomiting, extremes
of temperature, or a decreased level of consciousness. Bacterial and viral cases of
pneumonia usually result in similar symptoms. Some causes are associated with
classic, but non-specific, clinical characteristics.
Since chest x-ray is one of the simplest and cheapest methods to diagnose
pneumonia, we propose a deep learning algorithm based on convolutional neural
networks to identify and classify pneumonia cases from these images. It is the first
line of approach in diagnosing any lung disorders. However, detecting pneumonia
on CXR is a challenging task. It heavily relies on expertise of the physician and is
subject to misdiagnosis. Clinically, chest radiograph is one of two types -
posteroanterior (PA) and lateral. When patients are severely ill, anteroposterior
(AP) CXR is done. Chest radiograph depends on the ability to X rays to penetrate
the matter. Depending on the type of pathogen, the appearance of CXR of
pneumonia patients varies. In general, a radiographic sign includes increased
density of the infected area due to a mixture of consolidation and atelectasis. As
the infection becomes severe, air bronchogram appears due to the presence of air
column surrounded by consolidation and atelectasis. As a result, dark bronchioles
are surrounded by white area of infiltrates. This area appears as patchy and
uniform throughout the area. In some cases, pleural effusion due to the presence of
fluid outside the lung and in the pleural space may also develop.
Pneumonia quite often presents with other disease process and appear with other
radiographic findings which may include atelectasis, consolidation, and pleural
effusion. Therefore, diagnosis of pneumonia from CXR is a difficult process. This
is even complicated in the case of acute cases of pneumonia since infiltrates are
beginning to develop on CXR. With the rapid advancements in computer vision
and deep learning techniques, highly efficient techniques have been introduced in
image classification, recognition, and segmentation. Deep learning techniques can
also be employed in medical data analysis such as in diagnosis of abnormalities
from chest radiograph. Every day, hundreds of chest radiographs are being taken in
hospitals across the nation. This creates a large number of unexplored medical
images and datasets.
This project is about building a web application that can diagnose a patient with
pneumonia correctly by analyzing its X-ray image. Even though there are already
several working and successful systems that have the same function, this project
attempts to create a system that has a different approach from other systems, in
terms of how the system is built. Pneumonia is a disease that causes the
inflammation of the air sacs inside either of the lungs. This infection is most
commonly diagnosed by taking the X-ray of the patient. The risk of pneumonia is
immense for many, especially in developing nations where billions face energy
poverty and rely on polluting forms of energy. The WHO estimates that over 4
million premature deaths occur annually from household air pollution-related
diseases including pneumonia. Over 150 million people get infected with
pneumonia on an annual basis especially children under 5 years old. In such
regions, the problem can be further aggravated due to the dearth of medical
resources and personnel. For example, in Africa’s 57 nations, a gap of 2.3 million
doctors and nurses exists. For these populations, accurate and fast diagnosis means
everything.
INDEX
Acknowledgement i
Abstract
ii
Index
iii
List of Abbreviations
iv
List of Figures
v
List of Tables
vi
1. INTRODUCTION 1
1.1 Neccessity of Project ………………………………………………… 1
2. LITERATURE SURVEY 3
3. SYSTEM METHODOLOGY 5
3.1 Software Requirement ……………………………………………… 5
3.1.1 Datasets ……………………………………………………….. 5
3.1.2 Content ……………………………………………………….. 6
3.1.3 Google Colab …………………………………………………. 7
3.2 Data Augmentation …………………………………………........... 8
3.2.1 Introduction to Data Augmentation …………………………… 8
3.2.2 Libraries to Data Augmentation ……………………………….. 10
3.3 Convolution Neural Network ………………………………………. 11
3.3.1 Convolution Operation ……………………………………….... 11
3.3.2 Pooling Operation ……………………………………………… 12
3.3.3 Flattening Operation …………………………………………… 13
4. CONCLUSION 15
4.1 Impact of the Proposed Solution …………………………………… 15
APPENDIX A 16
Reference 17
LIST OF ABBREVIATIONS
LIST OF TABLES
3.1.1 Model performance for different applications with and without data. . . . . 9
augmentation
CHAPTER 01.
INTRODUCTON
classification tasks with deep neural network architecture. The neural network
architecture was specifically designed for pneumonia image classification tasks.
The proposed technique is based on the convolutional neural network algorithm,
utilizing a set of neurons to convolve on a given image and extract relevant
features from them. Demonstration of the efficacy of the proposed method with the
minimization of the computational cost as the focal point was conducted and
compared with the exiting state-of-the-art pneumonia classification networks.
CHAPTER 02.
LITERATURE SURVEY
3. Split the data into training and testing data set. Form classifier models of the
algorithms stated previously.
4. Train the classifier with the training data set obtained in step.
5. Test the classifier which has been created in the previous step.
CHAPTER 03.
SYSTEM METHODOLOGY
3.1.1 Dataset:
The normal chest X-ray (left panel) depicts clear lungs without any areas of
abnormal opacification in the image. Bacterial pneumonia (middle) typically
exhibits a focal lobar consolidation, in this case in the right upper lobe (white
arrows), whereas viral pneumonia (right) manifests with a more diffuse
‘‘interstitial’’ pattern in both lungs.
3.1.2. Content
The dataset is organized into 3 folders (train, test, val) and contains subfolders for
each image category (Pneumonia/Normal). There are 5,863 X-Ray images (JPEG)
and 2 categories (Pneumonia/Normal).
Chest X-ray images (anterior-posterior) were selected from retrospective cohorts of
pediatric patients of one to five years old from Guangzhou Women and Children’s
Medical Center, Guangzhou. All chest X-ray imaging was performed as part of
patients’ routine clinical care.
For the analysis of chest x-ray images, all chest radiographs were initially screened
for quality control by removing all low quality or unreadable scans. The diagnoses
for the images were then graded by two expert physicians before being cleared for
training the AI system. In order to account for any grading errors, the evaluation
set was also checked by a third expert.
The total size of the dataset is 2.16 GB.
The prediction accuracy of the Supervised Deep Learning models is largely reliant
on the amount and the diversity of data available during training. The relation
between deep learning models and amount of training data required is analogous to
that of the relation between rocket engines (deep learning models) and the huge
amount of fuel (huge amounts of data) required for the rocket to complete its
mission (success of the deep learning model).
Another way to deal with the problem of limited data is to apply different
transformations on the available data to synthesize new data. This approach of
synthesizing new data from the available data is referred to as ‘Data
Augmentation’.
Data augmentation can be used to address both the requirements, the diversity of
the training data, and the amount of data. Besides these two, augmented data can
also be used to address the class imbalance problem in classification tasks.
The questions that come to the mind are; does data augmentation work? Do we
really get better performance from the models when we use augmented data for
training? Table 1 shows a few case studies indicating the effect of data
augmentation on model performance for different applications.
Table: 3.1.1 Model performance for different applications with and without data augmentation
4. OS(Operating System) :
The OS module in Python provides functions for interacting with the
operating system. OS comes under Python's standard utility modules.
(n - f + 1) / s x (n - f + 1)/s x n
h w c
We flatten the output of convolutional layers to create a single long feature vector.
And it is connected to the final classification layer in the model, which is called
“Fully connected layer”.
CHAPTER 05.
CONCLUSION
Pneumonia is an infectious disease that has tormented humanity for ages. Even
with the significant advancement in technology, pneumonia is still listed among
the top 10 causes of death in the world. Early and accurate interventions are critical
for treating pneumonia. Chest x-ray is one of the cheapest and most widely used
diagnostic tool in identifying pneumonia and other lung abnormalities. With the
surprising advancements in new deep learning approaches, we have proposed a
new tool that can help improve diagnostic accuracy of pulmonary abnormalities
from chest radiograph. The system will provide the final result that whether that
person is having pneumonia or not. It will also provide highest accuracy from the
three different classifiers. Easy user interface has been designed keeping the user's
convenience in mind. Due to the effectiveness of the trained CNN model for
identifying pneumonia from chest X-ray images, the validation accuracy of our
model was significantly higher when compared with other approaches.
APPENDIX A
Specifications Details
BIBLIOGRAPHY
1.Bi, X., Li, S., Xiao, B., Li, Y., Wang, G., Ma, X.: Computer aided Alzheimer’s
disease diagnosis by an unsupervised deep learning technology. Neurocomputing
(2019)
2. Eckle, K., Schmidt-Hieber, J.: A comparison of deep networks with ReLU
activation function and linear spline-type methods. Neural Netw. 110, 232–242
(2019)
3. Ren, S., Jain, D.K., Guo, K., Xu, T., Chi, T.: Towards efficient medical lesion
image super-resolution based on deep residual networks. Sig. Process. Image
Commun. 75, 1–10 (2019)
4. Zheng, Y., Iwana, B.K., Uchida, S.: Mining the displacement of max-pooling for
text recognition. Pattern Recogn. 93, 558–569 (2019)
5. Bhumika, P.S.S.S., Nayyar, P.A.: A review paper on algorithms used for text
classification. Int. J. Appl. Innov. Eng. Manage. 3(2), 90–99 (2013)
6.Kumar, A., Sangwan, S.R., Arora, A., Nayyar, A., Abdel-Basset, M.: Sarcasm
detection using soft attention-based bidirectional long short-term memory model
with convolution network. IEEE Access 7, 23319–23328 (2019)
7. Saeed, F., Paul, A., Karthigaikumar, P., Nayyar, A.: Convolutional neural
network based early fire detection. In: Multimedia Tools and Applications, pp. 1–
17 (2019)
8. Kukkar, A., Mohana, R., Nayyar, A., Kim, J., Kang, B.G., Chilamkurti, N.: A
novel deep-learning-based bug severity classification technique using
convolutional neural networks and random forest with boosting. Sensors 19(13),
2964 (2019)
9. Khan, S.H., Hayat,M., Porikli, F.: Regularization of deep neural networks with
spectral dropout. Neural Netw. 110, 82–90 (2019)
10. ALzubi, J.A., Bharathikannan, B., Tanwar, S., Manikandan, R., Khanna, A.,
Thaventhiran, C.: Boosted neural network ensemble classification for lung cancer
disease diagnosis. Appl. Soft Comput. 80, 579–591 (2019)
11. Chakraborty, S., Aich, S., Sim, J.S., Kim, H.C.: Detection of pneumonia from
chest x-rays using a convolutional neural network architecture. In: International
Conference on Future Information & Communication Engineering, vol. 11, no. 1,
pp. 98–102 (2019)
12. Liang, G., Zheng, L.: A transfer learning method with deep residual network
for pediatric pneumonia diagnosis. In: Computer Methods and Programs in
Biomedicine (2019)