Skip to content

ML model to classify whether a person has Pneumonia or not.

Notifications You must be signed in to change notification settings

techrajat/pneumonia-classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pneumonia Classifier

GitHub repo size GitHub contributors GitHub stars

Pneumonia-Classifier.mp4

The Pneumonia Classifier is a machine learning model that uses chest X-ray images to classify whether a person has pneumonia or not. This project includes a Jupyter Notebook containing the model implementation and the user interface consists of a React website connected to a Flask backend.

Dataset Citation

The dataset used for training and testing the model is the "Labeled Optical Coherence Tomography (OCT) and Chest X-Ray Images for Classification" dataset provided by Daniel S. Kermany, Kang Zhang and Michael Goldbaum.

Model Accuracy

The Pneumonia Classifier model has achieved an accuracy of 84% on the test dataset. This accuracy represents the model's ability to correctly classify pneumonia and non-pneumonia cases based on the provided chest X-ray images.

Prerequisites

Before running the Pneumonia Classifier project, make sure you have the following prerequisites installed:

Installation

  1. Clone the repository:

    git clone https://github.com/techrajat/pneumonia-classifier.git
  2. Set up the backend:

    • Navigate to the backend directory:
      cd pneumonia-classifier/backend
    • Create a virtual environment (optional):
      python -m venv myenv
    • Activate the virtual environment:
      • On Windows:
        myenv\Scripts\activate
      • On macOS/Linux:
        source myenv/bin/activate
    • Install the project dependencies:
      pip install -r requirements.txt
  3. Set up the frontend:

    • Navigate to the root directory:
      cd ../
    • Install the frontend dependencies:
      npm install

Usage

  1. Start the backend server:

    • Navigate to the backend directory:
      cd pneumonia-classifier/backend
    • Activate the virtual environment (if using one):
      • On Windows:
        myenv\Scripts\activate
      • On macOS/Linux:
        source myenv/bin/activate
    • Run the Flask server:
      python app.py
  2. Start the frontend development server:

    • Open a new terminal and navigate to the root directory:
      cd pneumonia-classifier
    • Run the React development server:
      npm start
  3. Access the Pneumonia Classifier website:

Architecture

The Pneumonia Classifier consists of a React frontend for user interaction and a Flask backend for serving the machine learning model.

  • The React frontend provides a user-friendly interface for uploading chest X-ray images and displaying the classification results.
  • The Flask backend handles the image classification process and communicates with the frontend to send the results back to the user.

The interaction between the frontend and backend follows the following steps:

  1. The user uploads a chest X-ray image through the React frontend.
  2. The React frontend sends the image to the Flask backend via an HTTP request.
  3. The Flask backend receives the image and performs the classification using the trained machine learning model.
  4. The Flask backend sends the classification results back to the React frontend.
  5. The React frontend displays the results to the user.

This architecture allows for a seamless integration between the machine learning model and the user interface, providing a smooth user experience for pneumonia classification based on chest X-ray images.

About

ML model to classify whether a person has Pneumonia or not.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages