Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Pneumonia Classifier

Overview

This project uses a custom Convolutional Neural Network (CNN) to identify pneumonia in chest X-ray images. The model is trained on the "paultimothymooney/chest-xray-pneumonia" dataset from Kaggle and achieves approximately 90% accuracy on test data.

Dataset

The model uses the Chest X-Ray Images (Pneumonia) dataset from Kaggle:

  • Training samples: 5,216 images
  • Test samples: 624 images
  • Validation samples: 16 images
  • Classes: PNEUMONIA, NORMAL

Model Architecture

The model consists of:

  • 5 Convolutional layers with increasing filters (32, 64, 64, 128, 256)
  • Batch normalization after each convolutional layer
  • Max pooling layers for dimensionality reduction
  • Dropout layers (rates: 0.1, 0.2) for regularization
  • Fully connected layers with 128 units and sigmoid output

Total parameters: 1,246,401

Performance

  • Test Accuracy: 90.54%
  • Test Loss: 0.266

Classification metrics:

  • PNEUMONIA: Precision 0.95, Recall 0.90, F1-score 0.92
  • NORMAL: Precision 0.85, Recall 0.91, F1-score 0.88

Dependencies

  • numpy
  • pandas
  • matplotlib
  • seaborn
  • tensorflow
  • scikit-learn
  • opencv-python
  • kagglehub

Usage

  1. Install dependencies
  2. Download the dataset using kagglehub
  3. Run the notebook to train and evaluate the model
  4. The trained model is saved as "pneumonia_classifier_model.keras"

Features

  • Image preprocessing and normalization
  • Data augmentation (rotation, zoom, shifts, flips)
  • Learning rate reduction on plateau
  • Confusion matrix and classification reports
  • Single image prediction capability

About

A deep learning model for classifying chest X-ray images to detect pneumonia.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages