Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🦴 Bone Fracture Classifier using Deep Learning

This project focuses on building a deep learning model to classify bone fractures from X-ray images using a convolutional neural network (CNN). The dataset used contains multi-region X-ray images categorized into fractured and not_fractured.

πŸ“‚ Dataset

  • Source: Fracture Multi-Region X-Ray Data
  • The dataset is structured into three splits:
    dataset_bone_fracture/
    β”œβ”€β”€ train/
    β”‚   β”œβ”€β”€ fractured/
    β”‚   └── not_fractured/
    β”œβ”€β”€ val/
    β”‚   β”œβ”€β”€ fractured/
    β”‚   └── not_fractured/
    └── test/
        β”œβ”€β”€ fractured/
        └── not_fractured/
    

Note: The dataset is large and is not included in this repository. Please download it from Kaggle and place the unzipped dataset_bone_fracture folder in the same directory as the notebook.

πŸ“Š Exploratory Data Analysis

  • Directory structure and file counts explored using a custom explore_dataset() function.
  • Grid visualization of sample images from each class.
  • File integrity checks to remove any corrupted images.
  • Distribution plots showing image counts across train, val, and test splits.

πŸ§ͺ Preprocessing and Augmentation

  • All images resized to 224x224.
  • Image data generators apply random transformations:
    • Rotation, width/height shift, zoom, horizontal/vertical flip.
  • Pixel values normalized to the [0, 1] range.

🧠 Model Architecture

  • Sequential CNN with:
    • Convolutional layers + MaxPooling
    • Batch Normalization and Dropout
    • Dense layers with ReLU and softmax activation
  • Compiled with:
    • Loss: Categorical Crossentropy
    • Optimizer: Adam
    • Metrics: Accuracy

πŸ“ˆ Training and Evaluation

  • Trained using:
    history = model.fit(
        train_data,
        validation_data=val_data,
        epochs=10,
        steps_per_epoch=len(train_data),
        validation_steps=len(val_data)
    )
  • Visualizations:
    • Accuracy and Loss vs. Epoch
    • Confusion Matrix
    • Classification Report

βœ… Results

  • Evaluation on the test set shows classification performance using precision, recall, and F1-score.
  • The confusion matrix helps visualize the model's performance in classifying both fractured and not_fractured images.

πŸš€ How to Run

  1. Download the dataset from Kaggle.
  2. Unzip it and place the dataset_bone_fracture folder in the same directory as the notebook.
  3. Install required packages:
    pip install tensorflow matplotlib seaborn scikit-learn
  4. Run all cells in the notebook.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages