Skip to content

This ML project uses several CNN's to evaluate which is the best model in identifying between normal lung X-Ray images and those with pneumonia.

License

Notifications You must be signed in to change notification settings

AbdullahHDev/AI-LungClassification

Repository files navigation

AI Lung Classification Project


About The Project

This project aims to develop an image classification system for chest X-Rays to differentiate between normal lungs and lungs which have pneumonia. The system uses several CNN architectures, including DenseNet121, VGG16, ResNet50, and InceptionV3. Each model is adapted for binary classification to distinguish between pneumonia-afflicted and healthy lung images. To prevent overfitting and ensure the best model performance, early stopping and model checkpoints are implemented. These methods monitor validation loss across epochs, halting training when no improvement is seen and saving the best model respectively.

Built With

Python TensorFlow Keras Streamlit

Getting Started

This section outlines the steps to set up the AI Lung Classification Project locally, focusing on the model training and web application deployment for pneumonia detection.

Prerequisites

  • Python 3.x
  • Pip package manager

Installation

  1. Clone the repository: git clone https://github.com/AbdullahHDev/AI-LungClassification.git
  2. Run the Streamlit application: streamlit run lung_classifier.py

Usage

  1. Select which model you want to use using the sidebar, you can also select all models to see the probabillity results for all models.
  2. Upload your X-Ray image (test images are included in the datasets/tests folder).
  3. Press the test button and wait for the results to show.

Usage for Model Training

This project is designed to enable users to train machine learning models to classify chest X-ray images for the detection of pneumonia. Here's how you can train the models yourself:

Pre-requisites

  • Ensure you have Python and Pip installed on your system.
  • The project uses TensorFlow, Keras, and Streamlit among other libraries. Install all required libraries using: pip install -r requirements.txt
  • Clone the repository: git clone https://github.com/AbdullahHDev/AI-LungClassification.git

Training the Models

  1. The project includes scripts for training four different models: DenseNet121, VGG16, ResNet50, and InceptionV3.
  2. Open the "chest-x-ray-model.ipynb" file in your desired IDE or using Jupyter (if you require a GPU, use Kaggle or Google Cloud and import the notebook)
  3. Ensure that the dataset file paths are correct.
  4. Run the Jupyter notebook cell by cell

Contributing

Contributions are welcome and appreciated. Whether it's bug fixes, feature enhancements, or suggestions, feel free to fork the project and create a pull request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AI-LungClassification)
  3. Commit your Changes (git commit -m 'Add some AI-LungClassification')
  4. Push to the Branch (git push origin feature/AI-LungClassification)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Abdullah Hussain - [email protected]

Project Link: https://github.com/AbdullahHDev/AI-LungClassification

Acknowledgments

Data: https://data.mendeley.com/datasets/rscbjbr9sj/2

License: CC BY 4.0

Citation: http://www.cell.com/cell/fulltext/S0092-8674(18)30154-5

About

This ML project uses several CNN's to evaluate which is the best model in identifying between normal lung X-Ray images and those with pneumonia.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published