Skip to content

Shivansh-3010/BoneFractureClassification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฆด Bone Fracture Classification System

AI-Powered Bone Fracture Detection and Classification using ResNet50 Transfer Learning, TensorFlow, and Gradio

Python TensorFlow Keras Gradio Accuracy


๐Ÿ“Œ Overview

Bone fractures are among the most common orthopedic injuries and require timely diagnosis for effective treatment. Manual interpretation of X-ray images can be time-consuming and may vary depending on clinical expertise.

This project presents an AI-powered Bone Fracture Classification System that automatically analyzes X-ray images and predicts whether a fracture is present.

The system combines Deep Learning, Transfer Learning, Computer Vision, and an interactive Gradio dashboard to provide rapid and reliable fracture assessment. In addition to prediction, the application generates professional PDF diagnostic reports containing patient details, prediction results, confidence scores, risk assessment, AI interpretation, and model information.

This project was developed as a portfolio-focused healthcare AI application demonstrating practical deployment of Deep Learning models in medical image analysis.


๐ŸŽฏ Project Objectives

  • Automate bone fracture detection from X-ray images.
  • Reduce diagnosis time through AI-assisted analysis.
  • Provide confidence-based predictions for improved decision support.
  • Generate professional diagnostic reports automatically.
  • Demonstrate practical deployment of Deep Learning models.

๐Ÿ“Š Project Summary

Feature Details
Model Architecture ResNet50 Transfer Learning
Framework TensorFlow 2.8.0 / Keras 2.8.0
Classification Type Binary Classification
Classes Fractured / Not Fractured
Test Accuracy 92.73%
Dashboard Gradio
Report Generation PDF Reports
Programming Language Python 3.10

๐Ÿš€ Key Features

๐Ÿฆด Bone Fracture Classification

Classifies X-ray images into:

  • Fractured
  • Not Fractured

๐Ÿ“ˆ Confidence Score Analysis

Displays prediction confidence for every uploaded X-ray image.

โš ๏ธ Risk Assessment

Provides reliability and risk-level information associated with model predictions.

๐Ÿ“œ Prediction History

Maintains a history of previous predictions for reference and analysis.

๐Ÿ“„ Professional PDF Report Generation

Automatically generates downloadable PDF reports containing:

  • Patient Information
  • Report ID
  • Scan Date
  • Diagnosis
  • Confidence Score
  • Risk Assessment
  • AI Interpretation
  • Model Information
  • Disclaimer

๐Ÿ–ฅ๏ธ Interactive Gradio Dashboard

Provides an intuitive user interface for image upload, prediction visualization, and report generation.


๐Ÿ—๏ธ System Architecture

X-Ray Image
     โ”‚
     โ–ผ
Image Preprocessing
     โ”‚
     โ–ผ
ResNet50 Feature Extraction
     โ”‚
     โ–ผ
Dense Classification Layers
     โ”‚
     โ–ผ
Fractured / Not Fractured
     โ”‚
     โ–ผ
Confidence Score
     โ”‚
     โ–ผ
PDF Diagnostic Report

๐Ÿง  Model Architecture

The fracture detection model uses Transfer Learning with ResNet50 as the backbone network.

Input Image
     โ”‚
     โ–ผ
ResNet50 (Pretrained on ImageNet)
     โ”‚
     โ–ผ
Flatten
     โ”‚
     โ–ผ
Dense (128)
     โ”‚
     โ–ผ
Dropout
     โ”‚
     โ–ผ
Dense (1)
     โ”‚
     โ–ผ
Binary Classification

The pretrained ResNet50 layers were utilized for feature extraction while custom classification layers were added for fracture prediction.


๐Ÿ“Š Model Performance

Metric Value
Test Accuracy 92.73%
Dataset Type X-Ray Images
Classification Type Binary
Classes Fractured / Not Fractured
Backbone Network ResNet50
Framework TensorFlow / Keras

Classification Logic

prediction < threshold  -> Fractured
prediction >= threshold -> Not Fractured

This logic was verified using multiple test samples and validation images.


๐Ÿ› ๏ธ Technology Stack

Programming Language

  • Python 3.10

Deep Learning

  • TensorFlow 2.8.0
  • Keras 2.8.0
  • ResNet50 Transfer Learning

Dashboard

  • Gradio 6.15.1

Reporting

  • ReportLab 4.5.1

Supporting Libraries

  • NumPy
  • Pandas
  • OpenCV
  • Pillow
  • Matplotlib
  • Scikit-Learn
  • SciPy

๐Ÿ“ธ Application Dashboard

The Gradio dashboard allows users to upload X-ray images, view prediction results, confidence scores, risk assessment, prediction history, and generate professional PDF reports.

Dashboard


๐Ÿ“„ Sample Diagnostic Report

The system automatically generates professional PDF reports containing patient details, diagnostic results, confidence scores, AI interpretation, and model information.

PDF Report


๐Ÿ“‚ Project Structure

BoneFractureClassification/

โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ app.py
โ”‚   โ”œโ”€โ”€ prediction_history.csv
โ”‚   โ””โ”€โ”€ reports/
โ”‚       โ””โ”€โ”€ report_generator.py
โ”‚
โ”œโ”€โ”€ dataset/
โ”‚
โ”œโ”€โ”€ model/
โ”‚   โ””โ”€โ”€ README.md
โ”‚
โ”œโ”€โ”€ screenshots/
โ”‚
โ”œโ”€โ”€ bone_fracture_training.ipynb
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ .gitattributes

โš™๏ธ Installation

Clone Repository

git clone https://github.com/Shivansh-3010/BoneFractureClassification.git
cd BoneFractureClassification

Install Dependencies

pip install -r requirements.txt

Run Application

cd app
python app.py

๐Ÿ“ฆ Required Package Versions

tensorflow==2.8.0
keras==2.8.0
numpy==1.21.6
pandas==2.0.3
gradio==6.15.1
opencv-python==4.13.0.92
pillow==12.2.0
reportlab==4.5.1
matplotlib==3.5.3
scikit-learn==1.7.2
scipy==1.10.1
h5py==3.16.0
protobuf==3.20.3
tensorboard==2.8.0
tensorflow-io-gcs-filesystem==0.31.0

๐Ÿ“Œ Model File

The trained model file is not included in this repository due to GitHub file size limitations.

Expected model location:

model/best_bone_fracture_model.keras

๐Ÿ”ฎ Future Enhancements

  • Multi-Class Fracture Classification
  • Cloud Deployment
  • REST API Integration
  • Mobile Application Support
  • Expanded Medical Dataset
  • Advanced Explainable AI Techniques
  • Real-Time Clinical Decision Support

๐Ÿ‘จโ€๐Ÿ’ป Author

Shivansh Deshwal

Data Science Student

Areas of Interest:

  • Artificial Intelligence
  • Machine Learning
  • Deep Learning
  • Computer Vision
  • Healthcare AI

โš ๏ธ Disclaimer

This project is intended for educational, research, portfolio, and demonstration purposes only.

The predictions generated by this system should not be considered a substitute for professional medical diagnosis, treatment, or medical advice.

Always consult qualified healthcare professionals for clinical decisions.

About

Deep Learning-based Bone Fracture Classification System using ResNet50 Transfer Learning, TensorFlow, Keras, and Streamlit for automated X-ray image analysis.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors