CoolFace
Modelpublic

aagatti/nnunet_knee

sourceHugging Facemitupdated 11mo agoView on Hugging Face
3likes168downloads
Model Card

nnU-Net Knee MRI Segmentation

Automated knee MRI segmentation using nnU-Net cascade architecture for clinical and research applications.

This model provides accurate segmentation of 9 anatomical structures in knee MRI scans including cartilage, meniscus, and bone components with a mean Dice coefficient of 0.924.

๐ŸŽฏ Model Overview

  • โ€”Architecture: nnU-Net cascade (3dlowres โ†’ 3dcascade_fullres)
  • โ€”Input: Knee MRI volumes (.nii.gz, .nrrd)
  • โ€”Output: 9-class segmentation masks
  • โ€”Performance: 0.906 mean DSC across all structures
  • โ€”Inference Time: ~80 seconds per volume

๐Ÿ“Š Segmentation Classes

LabelStructureTypical DSC
0Background-
1Patellar cartilage>0.86
2Femoral cartilage>0.86
3Medial tibial cartilage>0.86
4Lateral tibial cartilage>0.86
5Medial meniscus>0.84
6Lateral meniscus>0.84
7Femur bone>0.95
8Tibia bone>0.95
9Patella bone>0.95

๐Ÿš€ Quick Start

Installation

bash
# Install dependencies
pip install torch nnunetv2 SimpleITK numpy huggingface_hub

# Download models from HuggingFace
from huggingface_hub import snapshot_download
snapshot_download(repo_id="aagatti/nnunet_knee", local_dir="./nnunet_knee_models")

Python Usage

python
from scripts.inference import KneeSegmentationInference

# Initialize inference
inference = KneeSegmentationInference(model_path="./nnunet_knee_models/models")

# Run segmentation
result = inference.predict("knee_mri.nii.gz", "segmentation_output.nii.gz")

Command Line Usage

bash
python scripts/inference.py --input knee_mri.nii.gz --output segmentation.nii.gz

๐Ÿ’ป Complete Setup Instructions

For complete setup with testing and validation:

  1. 1.Clone the inference package: nnunet_knee inference code
  2. 2.Download models: Use the code above or HuggingFace CLI
  3. 3.Run tests: Validate with provided test data and DSC metrics

๐Ÿ”ฌ Technical Details

Architecture

  • โ€”Stage 1: 3d_lowres model generates coarse segmentation
  • โ€”Stage 2: 3dcascadefullres refines using lowres predictions
  • โ€”Framework: nnU-Net v2 with PyTorch backend
  • โ€”Preprocessing: Automatic intensity normalization and resampling

Performance Metrics

  • โ€”Overall Mean DSC: 0.906
  • โ€”Cartilage Structures: 0.86+ DSC (excellent)
  • โ€”Meniscus Structures: 0.84+ DSC (excellent)
  • โ€”Bone Structures: 0.95+ DSC (excellent)
  • โ€”Inference Time: ~80 seconds per volume

Input Requirements

  • โ€”Format: NIfTI (.nii.gz) or NRRD (.nrrd)
  • โ€”Modality: T2-weighted knee MRI
  • โ€”Orientation: Any (automatically handled)
  • โ€”Resolution: Any (automatically resampled)

๐Ÿ“„ Citation

If you use this model in your research, please cite:

bibtex
@article{nnunet_knee_2024,
  title={Automating Imaging Biomarker Analysis for Knee Osteoarthritis Using an Open-Source MRI-Based Deep Learning Pipeline},
  author = {Goyal, Ananya and Belibi, Francesca and Sahani, Vyoma and Pedersen, Rune and Vainberg, Yael and Williams, Ashley and Chu, Constance and Haddock, Bryan and Gold, Garry and Chaudhari, Akshay and Kogan, Feliks and Gatti, Anthony},
  year={2025},
  doi = {10.1101/2025.02.21.25322094},
	publisher = {Cold Spring Harbor Laboratory Press},
  URL = {https://www.medrxiv.org/content/early/2025/02/23/2025.02.21.25322094},
	eprint = {https://www.medrxiv.org/content/early/2025/02/23/2025.02.21.25322094.full.pdf},
	journal = {medRxiv},
  note={Available at: https://huggingface.co/aagatti/nnunet_knee}
}

๐Ÿค Contributing

This model is part of an open-source knee MRI analysis pipeline. Contributions and feedback are welcome!

๐Ÿ“ง Contact

For questions about this model or collaboration opportunities, please reach out through the HuggingFace repository discussions.


Model Version: 1.0 Last Updated: 2025 License: MIT Maintained by: @aagatti