Skip to main content

A Python reimplementation of Semantic Context Forests for Knee Cartilage Segmentation

Project description

kneeseg: Knee Bone & Cartilage Segmentation in 3D MRI

Python Package

kneeseg is a Python reimplementation of the paper "Semantic Context Forests for Learning-Based Knee Cartilage Segmentation in 3D MR Images". [paper] [slides]

Original MICCAI Workshop Paper This Implementation
Bone Segmentation Active Shape Model (Siemens proprietary) Dense Random Forest (Auto-Context)
Cartilage Segmentation Semantic Context Forest (C++) Semantic Context Forest (Python)
Dataset Osteoarthritis Initiative (OAI) SKI10

Table of Contents

  1. Installation
  2. Usage
  3. Experiments Folder
  4. Experiment Results (SKI10)
  5. Algorithm Details
  6. Citation

Installation

You can install the package via pip:

pip install kneeseg

Usage

As a Library

from kneeseg.io import load_volume
from kneeseg.bone_rf import BoneClassifier
# ...

Running the Pipeline

The package includes a unified pipeline script kneeseg-pipeline (or via python module):

# Run using the installed command
kneeseg-pipeline --data-dir /path/to/SKI10/data

For advanced usage and reproduction scripts (e.g., training models from scratch), please refer to the Experiments Documentation.

Experiments Folder

The experiments/ directory contains reproduceable scripts and will store the output models (models/) and predictions (predictions/) if you run the scripts provided there. See experiments/README.md for details.

Experiment Results (SKI10)

Since the SKI10 dataset doesn not provide the ground truth labels for its default testing set, we evaluated the pipeline on a 20% hold-out set (20 cases) from the SKI10 training data (Total 80 cases: 60 Train, 20 Eval).

Metrics

Structure Dice Similarity Coefficient (DSC)
Femur 0.9046 ± 0.0361
Tibia 0.9292 ± 0.0260
Femoral Cartilage 0.5944 ± 0.0654
Tibial Cartilage 0.5805 ± 0.0533

Evaluation Set

The following 20 cases were held out for evaluation: image-004, image-005, image-012, image-014, image-015, image-018, image-028, image-029, image-030, image-032, image-036, image-055, image-065, image-070, image-076, image-082, image-087, image-089, image-095, image-098.

Algorithm Details

Bone Segmentation (Dense Auto-Context RF)

  1. Pass 1: Dense Random Forest voxel classification.

    • Features: Normalized Intensity, Gaussian Smoothed Intensity ($\sigma=2.0, 4.0$), Spatial Coordinates, RSID (20 offsets).
    • Target: 3-class classification (Background, Femur, Tibia).
  2. Pass 2 (Refinement): Auto-Context Random Forest.

    • Features: All Pass 1 features + Probabilities from Pass 1.
    • Performance: Achieves >0.90 DSC on Bones.

Cartilage Segmentation (Semantic Context Forest)

  1. Feature Extraction:
    • Semantic Context: Signed Distance Transforms (SDT) computed from Pass 2 bone masks.
    • Texture: RSID (30 offsets).
    • Local: Intensity, Gaussian ($\sigma=1.0$), Gradient.
    • Arithmetic: DT Sum/Diff.
  2. Classification: Dense Random Forest (100 trees).
    • Performance: Achieves ~0.60 DSC.

Citation

Plain Text:

Quan Wang, Dijia Wu, Le Lu, Meizhu Liu, Kim L. Boyer, and Shaohua Kevin Zhou. "Semantic Context Forests for Learning-Based Knee Cartilage Segmentation in 3D MR Images." MICCAI 2013: Workshop on Medical Computer Vision.

Quan Wang. Exploiting Geometric and Spatial Constraints for Vision and Lighting Applications. Ph.D. dissertation, Rensselaer Polytechnic Institute, 2014.

BibTeX:

@inproceedings{wang2013semantic,
  title={Semantic context forests for learning-based knee cartilage segmentation in 3D MR images},
  author={Wang, Quan and Wu, Dijia and Lu, Le and Liu, Meizhu and Boyer, Kim L and Zhou, Shaohua Kevin},
  booktitle={International MICCAI Workshop on Medical Computer Vision},
  pages={105--115},
  year={2013},
  organization={Springer}
}

@phdthesis{wang2014exploiting,
  title={Exploiting Geometric and Spatial Constraints for Vision and Lighting Applications},
  author={Quan Wang},
  year={2014},
  school={Rensselaer Polytechnic Institute},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kneeseg-0.1.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kneeseg-0.1.0-py3-none-any.whl (23.6 kB view details)

Uploaded Python 3

File details

Details for the file kneeseg-0.1.0.tar.gz.

File metadata

  • Download URL: kneeseg-0.1.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for kneeseg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1d639564b268713d2baa1735c70ac6dbe52cd85077183ab5ca009cbe3acfcf2b
MD5 da1223be10f01d9a7726c6160a8d2a57
BLAKE2b-256 9ff982de3ebad1d1ba03f823f7482e4e88192d2804d341bada2e10df88745448

See more details on using hashes here.

File details

Details for the file kneeseg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kneeseg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for kneeseg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16ae426879bbeaf9082402ca23bad39c91387c089a9d4aa5c6a89a9737987954
MD5 9cfab37ea96cae39f577835ce6b85ece
BLAKE2b-256 5b01ddd923d04cba5f411e1bfcc2c756654af0b57e608e91c0baf77b6aceabee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page