/Pneumonia_Detection_using_CNN

Pneumonia Detection using CNN

Primary LanguageJupyter NotebookMIT LicenseMIT

GitHub Repo stars GitHub forks contributors-shield LinkedIn


Logo

Pneumonia Detection using CNN
Explore the docs »

View Demo · Report Bug

Table of Contents

About The Project

This project uses Chest X-Ray dataset from kaggle. The dataset is organized into 3 folders (train, val & test) and contains subfolders for each image category (Pneumonia/Normal). There are 5,863 X-Ray images (JPEG) and 2 categories (Pneumonia/Normal). These images are used for building an CNN model using keras to detect pneumonia in patients based on X-ray reports. After model building the best performing model is used to build a flask base web application.

Steps involved

  • Reading data from source and preprocessing it using OpenCV.
  • Performing data preprocessing before feeding the data to the model.
  • Building sequential model architecture using keras.
  • Using data augmentating to prevent the model from overfitting during training phase.
  • Creating web application using flask to detect Pneumonia upon receiving the preprocessed X-ray.

Tools used

Following are the tools/frameworks used in developing the application:

Getting Started

Installation

For proper execution of application firstly create an environment, then to install prerequisite libraries execute below command in terminal.

pip install -r requirements.txt

Data Analysis and Model Building

Refer Pneumonia_Detection_CNN.ipynb to find details regarding data analysis and model building.

Since this is a classification problem, to check model performance Confusion Matrix and Classification Report are used.

Confusion Matrix

Application Development

After model development, the web application is developed using flask which is a python based web-framework. For source code refer app.py.

Below are few snapshots of application in use:

  • Step 1 Uploading X-Ray

  • Step 2 Displaying Result

Usage

To run this application firstly execute python app.py, after which the flask built-in server would start hosting the application at localhost i.e. http://127.0.0.1:5000/