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.
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.
- Python 3.x
- Pip package manager
- Clone the repository:
git clone https://github.com/AbdullahHDev/AI-LungClassification.git
- Run the Streamlit application:
streamlit run lung_classifier.py
- Select which model you want to use using the sidebar, you can also select all models to see the probabillity results for all models.
- Upload your X-Ray image (test images are included in the datasets/tests folder).
- Press the test button and wait for the results to show.
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:
- 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
- The project includes scripts for training four different models: DenseNet121, VGG16, ResNet50, and InceptionV3.
- 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)
- Ensure that the dataset file paths are correct.
- Run the Jupyter notebook cell by cell
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AI-LungClassification
) - Commit your Changes (
git commit -m 'Add some AI-LungClassification'
) - Push to the Branch (
git push origin feature/AI-LungClassification
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Abdullah Hussain - [email protected]
Project Link: https://github.com/AbdullahHDev/AI-LungClassification
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