Automated fracture detection in musculoskeletal X-ray images from the MURA dataset using deep learning and computer vision techniques.
This repository provides:
- a ready-to-use PyTorch inference package,
- pretrained per-anatomical-area models,
- and a full analytical report describing the methodology and experiments.
The project was developed as an academic research work and is intended for educational and research purposes only.
Musculoskeletal Radiographs (MURA) present several challenges for automated analysis:
- high intra-class variability,
- subtle fracture patterns,
- strong anatomical differences between body parts.
To address this, the project follows a per-area modeling strategy: each anatomical region is trained with its own dedicated classifier.
XR_ELBOWXR_FINGERXR_FOREARMXR_HANDXR_HUMERUSXR_SHOULDERXR_WRIST
Each area has an independently trained model and checkpoint.
The full methodology is described in detail in the analytical note, but the main steps are:
-
Dataset preparation
- MURA dataset with image-level and study-level labels
- Explicit separation by anatomical area
- Study-aware aggregation for evaluation
-
Baseline architecture
- DenseNet-121 pretrained on ImageNet
- Binary classification head (fracture / no fracture)
-
Training strategy
- Area-specific training
- Class imbalance handling
- Two-phase fine-tuning strategy
- Best model selection based on validation metrics
-
Hyperparameter optimization
- Automated tuning using Optuna
- Separate studies per anatomical area
-
Evaluation
- Image-level metrics
- Study-level aggregation and AUC evaluation
-
Interpretability
- Grad-CAM based visualization
- Qualitative localization analysis of fracture regions
-
Advanced experiments (research stage)
- CAM-based regularization
- Hybrid architectures (DenseNet + Transformer backbones)
A detailed analytical report describing the dataset analysis, experimental setup, training strategies, evaluation protocols, and results is available here:
The document includes:
- MURA dataset analysis,
- per-area classification rationale,
- DenseNet baseline and improvements,
- Optuna hyperparameter optimization,
- CAM / Grad-CAM interpretability analysis,
- two-phase training strategy,
- hybrid DenseNet + Transformer experiments,
- quantitative and qualitative results.
Install directly from GitHub:
pip install git+https://github.com/mariamvol/mura-model-classifier.git- Python ≥ 3.9
- PyTorch
- torchvision
- NumPy, pandas, scikit-learn
mura-infer \
--image path/to/image.png \
--area XR_WRIST
On first run, the corresponding pretrained weights will be automatically downloaded from the GitHub release and cached locally.
mura-infer \
--image path/to/image.png \
--area XR_WRIST \
--ckpt /path/to/XR_WRIST_FINAL_best.pt
The command prints:
- predicted fracture probability (sigmoid output),
- binary prediction using a configurable threshold (default: 0.5).
Example output:
area=XR_WRIST
prob_fracture=0.8731
pred=1
- Architecture: DenseNet-121
- Input resolution: 224 × 224
- Normalization: ImageNet statistics
- Output: single logit → sigmoid probability
Each anatomical area uses its own independently trained model.
This project is provided for research and educational purposes only.
It is not a medical device and must not be used for clinical decision-making or diagnostic purposes.
This project is released under the MIT License.