AI-Powered Bone Fracture Detection and Classification using ResNet50 Transfer Learning, TensorFlow, and Gradio
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.
- 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.
| 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 |
Classifies X-ray images into:
- Fractured
- Not Fractured
Displays prediction confidence for every uploaded X-ray image.
Provides reliability and risk-level information associated with model predictions.
Maintains a history of previous predictions for reference and analysis.
Automatically generates downloadable PDF reports containing:
- Patient Information
- Report ID
- Scan Date
- Diagnosis
- Confidence Score
- Risk Assessment
- AI Interpretation
- Model Information
- Disclaimer
Provides an intuitive user interface for image upload, prediction visualization, and report generation.
X-Ray Image
โ
โผ
Image Preprocessing
โ
โผ
ResNet50 Feature Extraction
โ
โผ
Dense Classification Layers
โ
โผ
Fractured / Not Fractured
โ
โผ
Confidence Score
โ
โผ
PDF Diagnostic Report
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.
| Metric | Value |
|---|---|
| Test Accuracy | 92.73% |
| Dataset Type | X-Ray Images |
| Classification Type | Binary |
| Classes | Fractured / Not Fractured |
| Backbone Network | ResNet50 |
| Framework | TensorFlow / Keras |
prediction < threshold -> Fractured
prediction >= threshold -> Not FracturedThis logic was verified using multiple test samples and validation images.
- Python 3.10
- TensorFlow 2.8.0
- Keras 2.8.0
- ResNet50 Transfer Learning
- Gradio 6.15.1
- ReportLab 4.5.1
- NumPy
- Pandas
- OpenCV
- Pillow
- Matplotlib
- Scikit-Learn
- SciPy
The Gradio dashboard allows users to upload X-ray images, view prediction results, confidence scores, risk assessment, prediction history, and generate professional PDF reports.
The system automatically generates professional PDF reports containing patient details, diagnostic results, confidence scores, AI interpretation, and model information.
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
git clone https://github.com/Shivansh-3010/BoneFractureClassification.git
cd BoneFractureClassificationpip install -r requirements.txtcd app
python app.pytensorflow==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
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
- Multi-Class Fracture Classification
- Cloud Deployment
- REST API Integration
- Mobile Application Support
- Expanded Medical Dataset
- Advanced Explainable AI Techniques
- Real-Time Clinical Decision Support
Data Science Student
Areas of Interest:
- Artificial Intelligence
- Machine Learning
- Deep Learning
- Computer Vision
- Healthcare AI
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.

