Skip to content

ohinson01/SDS-CP021-pneumonia-detection

 
 

Repository files navigation

Welcome to the SuperDataScience Community Project!

Welcome to the Medical X-Ray Imaging: Pneumonia Detection repository! 🎉

This project is a collaborative initiative brought to you by SuperDataScience, a thriving community dedicated to advancing the fields of data science, machine learning, and AI. We are excited to have you join us in this journey of learning, experimentation, and growth.

Project Scope of Works

Project Overview

This project involves building a convolutional neural network (CNN) to classify medical X-ray images and detect pneumonia. Targeted at beginner to intermediate-level data scientists, the project will focus on leveraging deep learning techniques to develop a robust classification model. The final model will be deployed using Streamlit, providing a user-friendly interface for real-time predictions.

Project Objectives

Dataset Acquisition and Preprocessing:

  • Use the publicly available dataset of X-ray images for model training.
  • Perform data preprocessing, including resizing, normalization, and augmentation, to prepare the images for training.

Link to dataset: https://www.kaggle.com/datasets/paultimothymooney/chest-xray-pneumonia

Model Development:

  • Build a convolutional neural network (CNN) using deep learning frameworks such as TensorFlow or PyTorch.
  • Train and evaluate the model to classify X-ray images as normal or pneumonia.

Model Deployment:

  • Develop a Streamlit application to allow users to upload X-ray images and receive a prediction.
  • Include visualization of prediction confidence and model explanation (e.g., Grad-CAM).

Technical Requirements

Tools and Libraries:

  • Dataset Handling: Pandas, NumPy.
  • Deep Learning Frameworks: TensorFlow or PyTorch.
  • Image Processing: OpenCV, Pillow.
  • Model Deployment: Streamlit.

Environment:

  • Python 3.8+
  • Libraries:
    • tensorflow, pytorch, pandas, numpy, opencv-python, pillow, streamlit, matplotlib.

Workflow

Phase 1: Setup (1 Week)

  • Setup GitHub repo and project folders.
  • Setup virtual environment and respective libraries.

Phase 2: Dataset Acquisition and Preprocessing (1 Week)

  • Download the chest X-ray dataset from a trusted source (e.g., Kaggle).
  • Explore and preprocess the dataset:
    • Resize images to a uniform size.
    • Normalize pixel values for faster model convergence.
    • Perform data augmentation to improve model generalization.

Phase 3: Model Development (1 Week)

  • Design a CNN architecture tailored for image classification.
  • Train the model on the dataset with proper validation.
  • Evaluate the model's performance using metrics like accuracy, precision, recall, and F1-score.
  • Fine-tune the model for optimal performance.

Phase 4: Model Deployment (1 Week)

  • Build a Streamlit app to:
    • Allow users to upload X-ray images.
    • Display the model's predictions (Normal or Pneumonia).
    • Provide additional insights using Grad-CAM visualizations for explainability.

Timeline

Phase Task Duration
Phase 1: Setup Setup GitHub repo and project folder Week 1
Phase 2: Dataset Acquire and preprocess data Week 2
Phase 3: Model Development Design, train, and evaluate CNN Week 3
Phase 4: Model Deployment Build and deploy Streamlit app Week 4

Getting Started

Follow these steps to set up the project locally:

1. Fork the Repository

To work on your own copy of this project:

  1. Navigate to the SDS GitHub repository for this project.
  2. Click the Fork button in the top-right corner of the repository page.
  3. This will create a copy of the repository under your GitHub account.

2. Clone the Repository

After forking the repository:

  1. Open a terminal on your local machine.
  2. Clone your forked repository by running:
    git clone https://github.com/<your-username>/<repository-name>.git
  3. Navigate to the project directory:
    cd <repository-name>

3. Create a virtual environment

Setup a virtual environment to isolate project dependancies

  1. Run the following command in the terminal to create a virtual environment
    python3 -m venv .venv
  2. Activate the virtual environment
  • On a mac/linux:
    source .venv/bin/activate
  • On a windows:
    .venv\Scripts\activate
    
  1. Verify the virtual environment is active (the shell prompt should show (.venv))

4. Install dependancies

Install the required libraries for the project

  1. Run the following command in the terminal to isntall dependancies from the requirements.txt file:
    pip install -r requirements.txt

Once the setup is complete, you can proceed with building your project

About

No description, website, or topics provided.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Jupyter Notebook 99.6%
  • Python 0.4%