This project focuses on bone fracture detection using deep learning and computer vision. The dataset consisted of approximately 3,000 X-ray images across various fracture types. During preprocessing, I identified issues with imbalanced classes, missing annotations, and redundant labels, which necessitated dataset cleaning and label remapping before training the YOLOv8 model.
- Original Dataset: 3,631 training, 348 validation, 169 test images
- Annotation Source: Roboflow + Manual corrections with
labelImg - Problem: Duplicate/imbalanced classes and missing annotations
-
Annotation Fixing:
- Added missing bounding boxes manually using
labelImg. - Verified all labels followed YOLO format (
class x_center y_center width height).
- Added missing bounding boxes manually using
-
Class Cleaning:
- Removed duplicate class (
humerus fracturehad only 3 samples). - Unified the label structure to avoid confusion.
- Removed duplicate class (
-
Label Remapping:
-
Original
data.yamlhad 7 classes:elbow positive fingers positive forearm fracture humerus fracture humerus shoulder fracture wrist positive -
After cleaning, reduced to 6 valid classes:
elbow positive fingers positive forearm fracture humerus shoulder fracture wrist positive
-
-
Class Distribution After Cleaning:
Class 0: 385 instances (elbow positive) Class 1: 606 instances (fingers positive) Class 2: 373 instances (forearm fracture) Class 3: 362 instances (humerus) Class 4: 397 instances (shoulder fracture) Class 5: 262 instances (wrist positive)
-
Framework: Ultralytics YOLOv8
-
Config:
nc: 6 names: ["elbow positive", "fingers positive", "forearm fracture", "humerus", "shoulder fracture", "wrist positive"]
-
Techniques used:
- Patience for early stopping (
patience=5helped reduce overfitting). - Cosine learning rate scheduling (
cos_lr=True). - Data augmentation (flips, rotations, scale).
- Patience for early stopping (
- Detected multiple fractures in unseen X-ray images.
- Successfully identified forearm fracture, shoulder fracture, and finger positive cases.
- Observed class imbalance challenges, but generalization improved after dataset cleaning.
- Expand dataset size (currently ~3K).
- Balance underrepresented classes (e.g., wrist positive).
- Explore 3D X-ray or CT-based approaches for better performance.
โโโ dataset/
โ โโโ train/
โ โ โโโ images/
โ โ โโโ labels/
โ โโโ val/
โ โ โโโ images/
โ โ โโโ labels/
โ โโโ test/
โ โโโ images/
โ โโโ labels/
โโโ runs/
โ โโโ train/
โ โโโ bone_fracture_exp/
โโโ data.yaml
โโโ README.md
- Roboflow for dataset tools
- Ultralytics for YOLOv8