Skip to content

Zafir547/Basic-Bone-Fracture-Detection-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฆด Bone Fracture Detection (X-ray Images)

๐Ÿ“Œ Overview

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.


โš™๏ธ Dataset Preparation

  • Original Dataset: 3,631 training, 348 validation, 169 test images
  • Annotation Source: Roboflow + Manual corrections with labelImg
  • Problem: Duplicate/imbalanced classes and missing annotations

โœ… Steps Taken

  1. Annotation Fixing:

    • Added missing bounding boxes manually using labelImg.
    • Verified all labels followed YOLO format (class x_center y_center width height).
  2. Class Cleaning:

    • Removed duplicate class (humerus fracture had only 3 samples).
    • Unified the label structure to avoid confusion.
  3. Label Remapping:

    • Original data.yaml had 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
      
  4. 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)
    

๐Ÿš€ Model Training

  • 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=5 helped reduce overfitting).
    • Cosine learning rate scheduling (cos_lr=True).
    • Data augmentation (flips, rotations, scale).

๐Ÿ“Š Results

  • 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.

๐Ÿ”ฎ Next Steps

  • Expand dataset size (currently ~3K).
  • Balance underrepresented classes (e.g., wrist positive).
  • Explore 3D X-ray or CT-based approaches for better performance.

๐Ÿ“‚ Project Structure

โ”œโ”€โ”€ dataset/
โ”‚   โ”œโ”€โ”€ train/
โ”‚   โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ”‚   โ””โ”€โ”€ labels/
โ”‚   โ”œโ”€โ”€ val/
โ”‚   โ”‚   โ”œโ”€โ”€ images/
โ”‚   โ”‚   โ””โ”€โ”€ labels/
โ”‚   โ””โ”€โ”€ test/
โ”‚       โ”œโ”€โ”€ images/
โ”‚       โ””โ”€โ”€ labels/
โ”œโ”€โ”€ runs/
โ”‚   โ””โ”€โ”€ train/
โ”‚       โ””โ”€โ”€ bone_fracture_exp/
โ”œโ”€โ”€ data.yaml
โ””โ”€โ”€ README.md

๐Ÿ™Œ Acknowledgements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published