Skip to content

Vinay10100/Chest-X-Ray-Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chest X-Ray Image Classifier

This project aims to classify chest X-ray images into three categories: COVID-19, Pneumonia, and Normal, using a Convolutional Neural Network (CNN) model. The project also includes a deployment using Streamlit for interactive web-based prediction of chest X-ray images.

Dataset

The dataset used for this project consists of a collection of chest X-ray images obtained from Chest X-Ray Images Dataset (Kaggle), including COVID-19-positive cases, pneumonia cases, and normal cases.

Model Architecture

  • Convolutional layer 1: 16 filters, 3x3 kernel, ReLU activation, followed by MaxPooling2D layer (2x2 pool size).
  • Convolutional layer 2: 64 filters, 3x3 kernel, ReLU activation, padding set to 'same', followed by MaxPooling2D layer (2x2 pool size).
  • Dropout layer (0.25) added after Convolutional layer 2.
  • Convolutional layer 3: 128 filters, 3x3 kernel, ReLU activation, padding set to 'same', followed by MaxPooling2D layer (2x2 pool size).
  • Dropout layer (0.3) added after Convolutional layer 3.
  • Convolutional layer 4: 128 filters, 3x3 kernel, ReLU activation, padding set to 'same', followed by MaxPooling2D layer (2x2 pool size).
  • Dropout layer (0.4) added after Convolutional layer 4.
  • Output from convolutional layers is flattened using a Flatten layer.
  • First dense layer: 128 neurons, ReLU activation.
  • Dropout layer (0.25) added after the first dense layer.
  • Second dense layer: 64 neurons, ReLU activation.
  • Output layer: 3 neurons (one for each class), softmax activation for multi-class classification.

Model Evaluation

merge_from_ofoct classification confusion_matrix

Sample Predictions

predict

How to Run

To run the Streamlit app, follow these steps:

  1. Install the required dependencies, Run the Streamlit app:

    pip install -r requirements.txt
    
    streamlit run predict.py
  2. Upload a chest X-ray image and click the "Predict" button to get the Result.