This project involves building and comparing different deep learning models for classifying bone fractures using X-ray images. The objective is to determine which model best distinguishes between fractured and non-fractured bones.
The dataset for this project is available on Kaggle: Bone Fracture Dataset. It contains labeled X-ray images of bones, categorized into fractured and healthy.
The following libraries are required:
- TensorFlow
- Keras
- Google Colab (optional)
- Pillow (PIL)
- NumPy
- Matplotlib
- os (for directory management)
Install the dependencies using:
pip install tensorflow Pillow numpy matplotlib- Download the dataset from Kaggle and ensure it is organized into appropriate directories.
- Clone the repository or download the notebook.
- Install the required dependencies using the above command.
- Optionally, use Google Colab for running the notebook with Google Drive integration.
- Image Augmentation: Data augmentation is performed using
ImageDataGenerator, which includes techniques like random rotations, flips, zooming, and shifts. - Preprocessing: All images are resized and normalized to ensure uniformity before model training.
Several deep learning models are explored and evaluated in this project:
- Pre-trained VGG16 model used as a feature extractor.
- Fine-tuning added fully connected layers on top of VGG16 for binary classification.
- Optimizer: Adam
- Loss Function: Binary Crossentropy
- Utilizes the ResNet architecture to handle image classification.
- ResNet's skip connections are leveraged to improve training performance, especially for deeper layers.
- Custom fully connected layers added for binary output.
- Optimizer: Adam
- Loss Function: Binary Crossentropy
- A custom-built Convolutional Neural Network (CNN) model designed from scratch.
- Includes multiple convolutional, pooling, and fully connected layers.
- Optimizer: Adam
- Loss Function: Binary Crossentropy
Each model is trained using similar hyperparameters, including batch size, number of epochs, and learning rate.
- The dataset is split into training, validation, and test sets.
- During training, the models are evaluated based on accuracy, loss, and confusion matrices.
- Hyperparameter tuning is performed to optimize performance across models.
- The performance of each model is compared based on key metrics: accuracy, loss, precision, recall, and F1-score.
- Final evaluation on the test set provides a comprehensive comparison of the models.
- Results are visualized using plots and confusion matrices for error analysis.
- Open the notebook in Google Colab or a local environment.
- Load the dataset using either Google Drive or a local path.
- Run each model's section to train and evaluate the models on the dataset.
- Review the results and comparisons in the results section.