This project leverages deep learning to classify chest X-ray images and detect the presence of pneumonia.
Pneumonia is an inflammatory condition of the lung affecting primarily the small air sacs known as alveoli. Early detection of pneumonia through X-rays can significantly improve treatment efficacy. This project implements a Convolutional Neural Network (CNN) model using TensorFlow to classify chest X-ray images as 'Normal' or 'Pneumonia'.
- Clone the repository:
git clone https://github.com/Tamaghnatech/pneumonia-detection.git
- Navigate to the directory:
cd pneumonia-detection
- Set up a virtual environment (optional but recommended):
python3 -m venv env
source env/bin/activate
- Install required packages:
pip install -r requirements.txt
(Note: This assumes that you have a requirements.txt
file with necessary packages.)
-
Data Preparation:
- Place normal chest X-ray images in
/content/normal
- Place pneumonia chest X-ray images in
/content/pneumonia
- Place normal chest X-ray images in
-
Training:
- Run the Jupyter Notebook or Python script to initiate the training process. The model will be saved as
pneumonia_classifier.h5
.
- Run the Jupyter Notebook or Python script to initiate the training process. The model will be saved as
-
Evaluation:
- Use the provided evaluation script or Jupyter cells to evaluate the model's performance on the test set.
The model achieved an accuracy of 91.91% on the test set. A confusion matrix provides further details on the model's performance:
(Insert confusion matrix image here)
- Dataset source: Chest X-Ray Images (Pneumonia) from Kaggle
- Thanks to TensorFlow for the deep learning framework.
Copyright (c) [2023] [Tamagha Nag]
Permission is hereby granted, free of charge, to any person obtaining a copy of this project and associated documentation files, to deal in the project without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.