ThoraxScanAI is an advanced deep learning project aimed at classifying lung diseases from X-ray images using TensorFlow and Keras. The project utilizes pre-trained models for transfer learning, augmented with custom layers to tailor the network for lung disease detection.
The project is structured into several key scripts, each fulfilling a specific role in the development and deployment of the machine learning model:
split_dataset.py
: Organizes the original dataset into training, validation, and test sets to ensure a proper distribution of data across different phases.custom_data_loader.py
: A comprehensive script for loading and preprocessing data. It supports data augmentation for the training set to enhance model generalization.model.py
: Constructs the model architecture, leveraging VGG16 for transfer learning and adding custom layers for the specific task of lung disease classification.train.py
: Manages the model training process, incorporating callbacks for optimization and early stopping to improve learning efficiency.evaluate.py
: Assesses the trained model on the test dataset, providing key performance metrics to gauge the model's effectiveness.utils.py
: Contains utility functions for visualizing training progress and preprocessing single images for model predictions.predict_single_image.py
: Demonstrates the application of the trained model to classify individual X-ray images, showcasing the model's practical utility.
- Python 3.8 or later
- TensorFlow 2.x
- NumPy
- Matplotlib
- scikit-learn
Clone the repository to your local machine:
git clone https://github.com/darwin757/ThoraxScanAI.git
cd ThoraxScanAI
Install the required dependencies:
pip install tensorflow numpy matplotlib scikit-learn
The original dataset, "Lung X-Ray Images", is processed and split into training, validation, and test sets using split_dataset.py
. The script organizes the data into a structure suitable for training and evaluation.
Run train.py
to start the training process. The script will use the processed data and apply transfer learning with a VGG16 base model:
python train.py
After training, evaluate the model's performance on the test set with evaluate.py
:
python evaluate.py
The project now includes a script for predicting the class of a single X-ray image using the trained model. After training, you can predict new images with:
python predict_single_image.py path/to/image.jpg
This project is open source and available under the MIT License.
- Dataset sourced from Kaggle - Lung X-Ray Images by Md Alamin Talukder and Fatemeh Mehrparvar.
- ThoraxScanAI utilizes TensorFlow and the VGG16 model for its deep learning pipeline.
For any queries or further discussion, please contact project maintainers at [ala.korabi@gmail.com].